Merge branch 'blankart-dev' into socmenus2

This commit is contained in:
NepDisk 2025-06-19 13:05:47 -04:00
commit db66b00ec0
50 changed files with 794 additions and 931 deletions

View file

@ -328,6 +328,11 @@ target_compile_options(SRB2SDL2 PRIVATE
$<$<AND:$<COMPILE_LANGUAGE:C>,$<C_COMPILER_ID:MSVC>>:
/Wv:19.20.27004.0
>
# GNU
$<$<C_COMPILER_ID:GNU>:
-fmax-errors=5
>
)
if(SRB2_CONFIG_ERRORMODE)
target_compile_options(SRB2SDL2 PRIVATE

View file

@ -1624,7 +1624,7 @@ bool CallFunc_PlayerSkin(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::
&& (info->mo != NULL && P_MobjWasRemoved(info->mo) == false)
&& (info->mo->player != NULL))
{
UINT8 skin = info->mo->player->skin;
UINT16 skin = info->mo->player->skin;
thread->dataStk.push(~env->getString( skins[skin].name )->idx);
return false;
}

View file

@ -57,6 +57,7 @@ static void COM_Toggle_f(void);
static void COM_Add_f(void);
static void COM_Choose_f(void);
static void COM_ChooseWeighted_f(void);
static void COM_Reset_f(void);
static void CV_EnforceExecVersion(void);
@ -354,6 +355,7 @@ void COM_Init(void)
COM_AddCommand("add", COM_Add_f);
COM_AddCommand("choose", COM_Choose_f);
COM_AddCommand("chooseweighted", COM_ChooseWeighted_f);
COM_AddCommand("reset", COM_Reset_f);
RegisterNetXCmd(XD_NETVAR, Got_NetVar);
}
@ -1219,6 +1221,36 @@ static void COM_ChooseWeighted_f(void)
}
}
static void COM_Reset_f(void)
{
size_t i;
if (COM_Argc() < 2)
{
CONS_Printf(M_GetText("reset <cvar1> [cvar2] [...]: Resets a cvar to its default value\n"));
return;
}
for (i = 1; i < COM_Argc(); ++i)
{
consvar_t *cvar = CV_FindVar(COM_Argv(i));
if (!cvar)
{
CONS_Alert(CONS_NOTICE, M_GetText("%s is not a cvar\n"), COM_Argv(i));
continue;
}
CV_Set(cvar, cvar->defaultvalue);
// Sometimes a cvar cannot be changed, e.g. CV_NETVAR without admin privilege.
if (!stricmp(cvar->string, cvar->defaultvalue))
{
CONS_Printf("%s = %s\n", cvar->name, cvar->string);
}
}
}
// =========================================================================
// VARIABLE SIZE BUFFERS
// =========================================================================

View file

@ -1080,7 +1080,7 @@ static void SV_SendPlayerInfo(INT32 node)
netbuffer->u.playerinfo[i].score = LONG(players[i].score);
netbuffer->u.playerinfo[i].timeinserver = SHORT((UINT16)(players[i].jointime / TICRATE));
netbuffer->u.playerinfo[i].skin = (UINT8)(players[i].skin
netbuffer->u.playerinfo[i].skin = (UINT16)(players[i].skin
#ifdef DEVELOP // it's safe to do this only because PLAYERINFO isn't read by the game itself
% 3
#endif
@ -3715,7 +3715,7 @@ static void Got_RemovePlayer(UINT8 **p, INT32 playernum)
static void Got_AddBot(UINT8 **p, INT32 playernum)
{
INT16 newplayernum;
UINT8 skinnum = 0;
UINT16 skinnum = 0;
UINT8 difficulty = DIFFICULTBOT;
botStyle_e style = BOT_STYLE_NORMAL;
@ -3731,7 +3731,7 @@ static void Got_AddBot(UINT8 **p, INT32 playernum)
}
newplayernum = READUINT8(*p);
skinnum = READUINT8(*p);
skinnum = READUINT16(*p);
difficulty = READUINT8(*p);
style = READUINT8(*p);
@ -3835,11 +3835,11 @@ static boolean SV_AddWaitingPlayers(SINT8 node, const char *name, const char *na
}
/*--------------------------------------------------
boolean K_AddBotFromServer(UINT8 skin, UINT8 difficulty, botStyle_e style, UINT8 *p)
boolean K_AddBotFromServer(UINT16 skin, UINT8 difficulty, botStyle_e style, UINT8 *p)
See header file for description.
--------------------------------------------------*/
boolean K_AddBotFromServer(UINT8 skin, UINT8 difficulty, botStyle_e style, UINT8 *p)
boolean K_AddBotFromServer(UINT16 skin, UINT8 difficulty, botStyle_e style, UINT8 *p)
{
UINT8 newplayernum = *p;
@ -3880,7 +3880,7 @@ boolean K_AddBotFromServer(UINT8 skin, UINT8 difficulty, botStyle_e style, UINT8
if (server)
{
UINT8 buf[4];
UINT8 buf[5];
UINT8 *buf_p = buf;
WRITEUINT8(buf_p, newplayernum);
@ -3890,7 +3890,7 @@ boolean K_AddBotFromServer(UINT8 skin, UINT8 difficulty, botStyle_e style, UINT8
skin = numskins;
}
WRITEUINT8(buf_p, skin);
WRITEUINT16(buf_p, skin);
if (difficulty < 1)
{
@ -4662,7 +4662,8 @@ static void HandlePacketFromPlayer(SINT8 node)
// If we already received a ticcmd for this tic, just submit it for the next one.
tic_t faketic = maketic;
if (!!(netcmds[maketic % BACKUPTICS][netconsole].flags & TICCMD_RECEIVED))
if ((!!(netcmds[maketic % BACKUPTICS][netconsole].flags & TICCMD_RECEIVED))
&& (maketic - firstticstosend < BACKUPTICS))
faketic++;
// Copy ticcmd

View file

@ -317,7 +317,7 @@ struct plrinfo
char name[MAXPLAYERNAME+1];
UINT8 address[4]; // sending another string would run us up against MAXPACKETLENGTH
UINT8 team;
UINT8 skin;
UINT16 skin;
UINT8 data; // Color is first four bits, hasflag, isit and issuper have one bit each, the last is unused.
UINT32 score;
UINT16 timeinserver; // In seconds.
@ -327,7 +327,7 @@ struct plrinfo
struct plrconfig
{
char name[MAXPLAYERNAME+1];
UINT8 skin;
UINT16 skin;
UINT16 color;
UINT32 pflags;
UINT32 score;
@ -481,7 +481,7 @@ void SV_StopServer(void);
void SV_ResetServer(void);
/*--------------------------------------------------
boolean K_AddBotFromServer(UINT8 skin, UINT8 difficulty, botStyle_e style, UINT8 *newplayernum);
boolean K_AddBotFromServer(UINT16 skin, UINT8 difficulty, botStyle_e style, UINT8 *newplayernum);
Adds a new bot, using a server-sided packet sent to all clients.
Using regular K_AddBot wherever possible is better, but this is kept
@ -498,7 +498,7 @@ void SV_ResetServer(void);
true if a bot can be added via a packet later, otherwise false.
--------------------------------------------------*/
boolean K_AddBotFromServer(UINT8 skin, UINT8 difficulty, botStyle_e style, UINT8 *p);
boolean K_AddBotFromServer(UINT16 skin, UINT8 difficulty, botStyle_e style, UINT8 *p);
void CL_AddSplitscreenPlayer(void);
void CL_RemoveSplitscreenPlayer(UINT8 p);

View file

@ -81,15 +81,16 @@
#include <tracy/tracy/Tracy.hpp>
// Put hashes here to get them out of header hell.
#define ASSET_HASH_SRB2_SRB 0xf3ec1ea4d0eca4a9
#define ASSET_HASH_GFX_KART 0xc91b0d43f5ba131f
#define ASSET_HASH_TEXTURES_KART 0xb4211b2f32b6a291
#define ASSET_HASH_CHARS_KART 0x1e68a3e01aa5c68b
#define ASSET_HASH_MAPS_KART 0x38558ed00da41ce9
#define ASSET_HASH_MAIN_PK3 0xfd350f17314cd848
#define ASSET_HASH_MAPPATCH_PK3 0x36ef622b54d98871
#define ASSET_HASH_SRB2_SRB 0xf3ec1ea4d0eca4a9
#define ASSET_HASH_GFX_KART 0xc91b0d43f5ba131f
#define ASSET_HASH_TEXTURES_KART 0xb4211b2f32b6a291
#define ASSET_HASH_CHARS_KART 0x1e68a3e01aa5c68b
#define ASSET_HASH_MAPS_KART 0x38558ed00da41ce9
#define ASSET_HASH_MAIN_PK3 0x41568cadaf608e27
#define ASSET_HASH_MAPPATCH_PK3 0x36ef622b54d98871
#define ASSET_HASH_BONUSCHARS_KART 0x60e6f13d822a7461
#ifdef USE_PATCH_FILE
#define ASSET_HASH_PATCH_PK3 0x0000000000000000
#define ASSET_HASH_PATCH_PK3 0x0000000000000000
#endif
#ifdef CMAKECONFIG
@ -557,20 +558,12 @@ static bool D_Display(void)
HU_Drawer();
break;
case GS_GAMEEND:
F_GameEndDrawer();
break;
case GS_EVALUATION:
F_GameEvaluationDrawer();
HU_Erase();
HU_Drawer();
break;
case GS_CONTINUING:
//F_ContinueDrawer();
break;
case GS_CREDITS:
F_CreditDrawer();
HU_Erase();
@ -1203,6 +1196,7 @@ static void IdentifyVersion(void)
D_AddFile(startupiwads, va(pandf,srb2waddir,MAPSNAME));
D_AddFile(startupiwads, va(pandf,srb2waddir,MAINNAME));
D_AddFile(startupiwads, va(pandf,srb2waddir,MAPPATCHNAME));
D_AddFile(startupiwads, va(pandf,srb2waddir,BONUSCHARSNAME));
#ifdef USE_PATCH_FILE
D_AddFile(startupiwads, va(pandf,srb2waddir,PATCHNAME));
#endif
@ -1477,6 +1471,7 @@ void D_SRB2Main(void)
W_VerifyFileHash(MAINWAD_MAPS, ASSET_HASH_MAPS_KART);
W_VerifyFileHash(MAINWAD_MAIN, ASSET_HASH_MAIN_PK3);
W_VerifyFileHash(MAINWAD_MAPPATCH, ASSET_HASH_MAPPATCH_PK3);
W_VerifyFileHash(MAINWAD_BONUSCHARS, ASSET_HASH_BONUSCHARS_KART);
#ifdef USE_PATCH_FILE
W_VerifyFileHash(MAINWAD_PATCH, ASSET_HASH_PATCH_PK3);
#endif
@ -1489,6 +1484,7 @@ void D_SRB2Main(void)
wadfiles[MAINWAD_MAPS]->compatmode = true;
wadfiles[MAINWAD_MAIN]->compatmode = false;
wadfiles[MAINWAD_MAPPATCH]->compatmode = false;
wadfiles[MAINWAD_BONUSCHARS]->compatmode = true;
#ifdef USE_PATCH_FILE
wadfiles[MAINWAD_PATCH]->compatmode = false;
#endif
@ -1628,6 +1624,7 @@ void D_SRB2Main(void)
I_StartupSound();
I_InitMusic();
S_InitSfxChannels(cv_soundvolume.value);
S_InitMusicVolume();
}
CON_SetLoadingProgress(LOADED_SINITSFXCHANNELS);

View file

@ -29,6 +29,7 @@ extern "C" {
#define MAPSNAME "maps.kart"
#define MAINNAME "main.pk3"
#define MAPPATCHNAME "mappatch.pk3"
#define BONUSCHARSNAME "bonuschars.kart"
#define PATCHNAME "patch.pk3"
#define MUSICNAME "music.kart"
#define SOUNDSNAME "sounds.kart"
@ -42,6 +43,7 @@ typedef enum
MAINWAD_MAPS,
MAINWAD_MAIN,
MAINWAD_MAPPATCH,
MAINWAD_BONUSCHARS,
#ifdef USE_PATCH_FILE
MAINWAD_PATCH,
#endif

View file

@ -509,9 +509,10 @@ static CV_PossibleValue_t kartdebugitem_cons_t[] =
#undef FOREACH
{0}
};
consvar_t cv_kartdebugitem = CVAR_INIT ("kartdebugitem", "0", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugitem_cons_t, NULL);
consvar_t cv_kartdebugitem = CVAR_INIT ("kartdebugitem", "0", CV_NETVAR|CV_CHEAT, kartdebugitem_cons_t, NULL);
static CV_PossibleValue_t kartdebugamount_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
consvar_t cv_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugamount_cons_t, NULL);
consvar_t cv_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_CHEAT, kartdebugamount_cons_t, NULL);
consvar_t cv_kartdebugshrink = CVAR_INIT ("kartdebugshrink", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
#ifdef DEVELOP
#define VALUE "Yes"
#else
@ -519,17 +520,17 @@ consvar_t cv_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_C
#endif
#undef VALUE
consvar_t cv_kartdebugdistribution = CVAR_INIT ("kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebughuddrop = CVAR_INIT ("kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugdistribution = CVAR_INIT ("kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
consvar_t cv_kartdebughuddrop = CVAR_INIT ("kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
static CV_PossibleValue_t kartdebugwaypoint_cons_t[] = {{0, "Off"}, {1, "Forwards"}, {2, "Backwards"}, {0, NULL}};
consvar_t cv_kartdebugwaypoints = CVAR_INIT ("kartdebugwaypoints", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugwaypoint_cons_t, NULL);
consvar_t cv_kartdebuglap = CVAR_INIT ("kartdebuglap", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugwaypoint_cons_t, NULL);
consvar_t cv_kartdebugbot = CVAR_INIT ("kartdebugbot", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugwaypoints = CVAR_INIT ("kartdebugwaypoints", "Off", CV_NETVAR|CV_CHEAT, kartdebugwaypoint_cons_t, NULL);
consvar_t cv_kartdebuglap = CVAR_INIT ("kartdebuglap", "Off", CV_NETVAR|CV_CHEAT, kartdebugwaypoint_cons_t, NULL);
consvar_t cv_kartdebugbot = CVAR_INIT ("kartdebugbot", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
consvar_t cv_kartdebugcheckpoint = CVAR_INIT ("kartdebugcheckpoint", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugnodes = CVAR_INIT ("kartdebugnodes", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugcolorize = CVAR_INIT ("kartdebugcolorize", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugdirector = CVAR_INIT ("kartdebugdirector", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugcheckpoint = CVAR_INIT ("kartdebugcheckpoint", "Off", 0, CV_OnOff, NULL);
consvar_t cv_kartdebugnodes = CVAR_INIT ("kartdebugnodes", "Off", 0, CV_OnOff, NULL);
consvar_t cv_kartdebugcolorize = CVAR_INIT ("kartdebugcolorize", "Off", 0, CV_OnOff, NULL);
consvar_t cv_kartdebugdirector = CVAR_INIT ("kartdebugdirector", "Off", 0, CV_OnOff, NULL);
static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}};
consvar_t cv_votetime = CVAR_INIT ("votetime", "20", CV_NETVAR, votetime_cons_t, NULL);
@ -1727,7 +1728,7 @@ static void SendNameAndColor(UINT8 n)
WRITESTRINGN(p, cv_playername[n].zstring, MAXPLAYERNAME);
WRITEUINT32(p, (UINT32)player->availabilities);
WRITEUINT16(p, (UINT16)cv_playercolor[n].value);
WRITEUINT8(p, (UINT8)cv_skin[n].value);
WRITEUINT16(p, (UINT16)cv_skin[n].value);
WRITESINT8(p, (SINT8)cv_follower[n].value);
WRITEUINT16(p, (UINT16)cv_followercolor[n].value);
@ -1739,10 +1740,10 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
player_t *p = &players[playernum];
char name[MAXPLAYERNAME+1];
UINT16 color, followercolor;
UINT8 skin;
UINT16 skin;
SINT8 follower;
SINT8 localplayer = -1;
UINT8 i;
UINT16 i;
#ifdef PARANOIA
if (playernum < 0 || playernum > MAXPLAYERS)
@ -1768,7 +1769,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
READSTRINGN(*cp, name, MAXPLAYERNAME);
p->availabilities = READUINT32(*cp);
color = READUINT16(*cp);
skin = READUINT8(*cp);
skin = READUINT16(*cp);
follower = READSINT8(*cp);
followercolor = READUINT16(*cp);

View file

@ -176,6 +176,7 @@ extern consvar_t cv_encorevotes;
extern consvar_t cv_votetime;
extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugdistribution, cv_kartdebughuddrop;
extern consvar_t cv_kartdebugshrink;
extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize, cv_kartdebugdirector;
extern consvar_t cv_kartdebugwaypoints, cv_kartdebuglap, cv_kartdebugbot;

View file

@ -1409,6 +1409,7 @@ void PT_FileFragment(void)
|| !strcmp(filename, MAPSNAME)
|| !strcmp(filename, MAINNAME)
|| !strcmp(filename, MAPPATCHNAME)
|| !strcmp(filename, BONUSCHARSNAME)
|| !strcmp(filename, PATCHNAME)
|| !strcmp(filename, SOUNDSNAME)
|| !strcmp(filename, MUSICNAME)

View file

@ -675,6 +675,7 @@ struct player_t
UINT8 pickuprings; // Number of rings being picked up before added to the counter (prevents rings from being deleted forever over 20)
UINT8 ringdelay; // (0 to 3) - 3 tic delay between every ring usage
UINT16 ringboost; // Ring boost timer
UINT16 ringtime; // The current Ring boost timer if it wasn't capped. Used for spam prevention measures.
UINT16 superring; // Spawn rings on top of you every tic!
UINT8 nextringaward; // When should we spawn our next superring ring?
UINT8 ringvolume; // When consuming lots of rings, lower the sound a little.

View file

@ -1086,8 +1086,13 @@ void readlevelheader(MYFILE *f, char * name)
deh_strlcpy(mapheaderinfo[num]->skytexture, word2,
sizeof(mapheaderinfo[num]->skytexture), va("Level header %d: sky texture", num));
else if (fastcmp(word, "SKYNUM"))
deh_strlcpy(mapheaderinfo[num]->skytexture, va("SKY%s", word2),
{
char namebuf[9];
sprintf(namebuf, "SKY%.5s", word2);
deh_strlcpy(mapheaderinfo[num]->skytexture, namebuf,
sizeof(mapheaderinfo[num]->skytexture), va("Level header %d: sky texture", num));
}
else if (fastcmp(word, "PRECUTSCENENUM"))
mapheaderinfo[num]->precutscenenum = (UINT8)i;
else if (fastcmp(word, "CUTSCENENUM"))
@ -3433,14 +3438,6 @@ void readwipes(MYFILE *f)
else if (fastcmp(pword, "FINAL"))
wipeoffset = wipe_voting_final;
}
else if (fastncmp(word, "CONTINUING_", 11))
{
pword = word + 11;
if (fastcmp(pword, "TOBLACK"))
wipeoffset = wipe_continuing_toblack;
else if (fastcmp(pword, "FINAL"))
wipeoffset = wipe_continuing_final;
}
else if (fastncmp(word, "TITLESCREEN_", 12))
{
pword = word + 12;
@ -3475,14 +3472,6 @@ void readwipes(MYFILE *f)
else if (fastcmp(pword, "FINAL"))
wipeoffset = wipe_evaluation_final;
}
else if (fastncmp(word, "GAMEEND_", 8))
{
pword = word + 8;
if (fastcmp(pword, "TOBLACK"))
wipeoffset = wipe_gameend_toblack;
else if (fastcmp(pword, "FINAL"))
wipeoffset = wipe_gameend_final;
}
else if (fastncmp(word, "ENCORE_", 7))
{
pword = word + 7;

View file

@ -1403,12 +1403,10 @@ struct int_const_s const INT_CONST[] = {
{"GS_NULL",GS_NULL},
{"GS_LEVEL",GS_LEVEL},
{"GS_INTERMISSION",GS_INTERMISSION},
{"GS_CONTINUING",GS_CONTINUING},
{"GS_TITLESCREEN",GS_TITLESCREEN},
{"GS_TIMEATTACK",GS_TIMEATTACK},
{"GS_CREDITS",GS_CREDITS},
{"GS_EVALUATION",GS_EVALUATION},
{"GS_GAMEEND",GS_GAMEEND},
{"GS_INTRO",GS_INTRO},
{"GS_CUTSCENE",GS_CUTSCENE},
{"GS_DEDICATEDSERVER",GS_DEDICATEDSERVER},
@ -1556,7 +1554,7 @@ struct int_const_s const INT_CONST[] = {
// terrain_flags_t
{"TRF_LIQUID",TRF_LIQUID},
{"TRF_SNEAKERPANEL",TRF_SNEAKERPANEL},
{"TRF_WATERRUNPANEL",},
{"TRF_WATERRUNPANEL", TRF_WATERRUNPANEL},
{"TRF_TRIPWIRE",TRF_TRIPWIRE},
{"TRF_REMAP",TRF_REMAP},
{"TRF_BYPASSBOOST", TRF_BYPASSBOOST},

View file

@ -207,7 +207,7 @@ extern char logfilename[1024];
#define MAXSPLITSCREENPLAYERS 4 // Max number of players on a single computer
#define MAXGAMEPADS (MAXSPLITSCREENPLAYERS * 2) // Number of gamepads we'll be allowing
#define MAXSKINS UINT8_MAX
#define MAXSKINS 4096
#define MAXFOLLOWERS UINT16_MAX
#define COLORRAMPSIZE 16

View file

@ -1067,13 +1067,6 @@ void F_BlanCreditTicker(void)
void F_StartGameEvaluation(void)
{
// Credits option in secrets menu
if (cursaveslot == -2)
{
F_StartGameEnd();
return;
}
G_SetGamestate(GS_EVALUATION);
// Just in case they're open ... somehow
@ -1084,6 +1077,9 @@ void F_StartGameEvaluation(void)
CON_ToggleOff();
finalecount = 0;
G_SetGamestate(GS_TITLESCREEN);
S_StopMusic();
}
void F_GameEvaluationDrawer(void)
@ -1093,12 +1089,6 @@ void F_GameEvaluationDrawer(void)
void F_GameEvaluationTicker(void)
{
if (++finalecount > 10*TICRATE)
{
F_StartGameEnd();
return;
}
if (finalecount == 5*TICRATE)
{
if (netgame || multiplayer) // modify this when we finally allow unlocking stuff in 2P
@ -1127,44 +1117,6 @@ void F_GameEvaluationTicker(void)
}
}
// ==========
// GAME END
// ==========
void F_StartGameEnd(void)
{
G_SetGamestate(GS_GAMEEND);
gameaction = ga_nothing;
paused = false;
CON_ToggleOff();
S_StopSounds();
// In case menus are still up?!!
M_ClearMenus(true);
timetonext = TICRATE;
}
//
// F_GameEndDrawer
//
void F_GameEndDrawer(void)
{
// this function does nothing
}
//
// F_GameEndTicker
//
void F_GameEndTicker(void)
{
if (timetonext > 0)
timetonext--;
else
D_StartTitle();
}
// ==============
// TITLE SCREEN
// ==============

View file

@ -36,7 +36,6 @@ boolean F_CutsceneResponder(event_t *ev);
boolean F_CreditResponder(event_t *ev);
// Called by main loop.
void F_GameEndTicker(void);
void F_IntroTicker(void);
void F_TitleScreenTicker(boolean run);
void F_CutsceneTicker(void);
@ -44,7 +43,6 @@ void F_TitleDemoTicker(void);
void F_TextPromptTicker(void);
// Called by main loop.
void F_GameEndDrawer(void);
void F_IntroDrawer(void);
void F_TitleScreenDrawer(void);
void F_SkyScroll(INT32 scrollxspeed, INT32 scrollyspeed, const char *patchname);
@ -76,7 +74,6 @@ void F_EndTextPrompt(boolean forceexec, boolean noexec);
boolean F_GetPromptHideHudAll(void);
boolean F_GetPromptHideHud(fixed_t y);
void F_StartGameEnd(void);
void F_StartIntro(void);
void F_StartTitleScreen(void);
void F_StartCredits(void);
@ -169,12 +166,10 @@ enum
wipe_level_toblack,
wipe_intermission_toblack,
wipe_voting_toblack,
wipe_continuing_toblack,
wipe_titlescreen_toblack,
wipe_timeattack_toblack,
wipe_credits_toblack,
wipe_evaluation_toblack,
wipe_gameend_toblack,
wipe_intro_toblack,
wipe_ending_toblack,
wipe_cutscene_toblack,
@ -187,12 +182,10 @@ enum
wipe_level_final,
wipe_intermission_final,
wipe_voting_final,
wipe_continuing_final,
wipe_titlescreen_final,
wipe_timeattack_final,
wipe_credits_final,
wipe_evaluation_final,
wipe_gameend_final,
wipe_intro_final,
wipe_ending_final,
wipe_cutscene_final,

View file

@ -56,12 +56,10 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
0, // wipe_level_toblack
0, // wipe_intermission_toblack
0, // wipe_voting_toblack,
0, // wipe_continuing_toblack
0, // wipe_titlescreen_toblack
0, // wipe_timeattack_toblack
99, // wipe_credits_toblack
0, // wipe_evaluation_toblack
0, // wipe_gameend_toblack
UINT8_MAX, // wipe_intro_toblack (hardcoded)
99, // wipe_ending_toblack (hardcoded)
99, // wipe_cutscene_toblack (hardcoded)
@ -72,12 +70,10 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
UINT8_MAX, // wipe_level_final
0, // wipe_intermission_final
0, // wipe_voting_final
0, // wipe_continuing_final
0, // wipe_titlescreen_final
0, // wipe_timeattack_final
99, // wipe_credits_final
0, // wipe_evaluation_final
0, // wipe_gameend_final
99, // wipe_intro_final (hardcoded)
99, // wipe_ending_final (hardcoded)
99 // wipe_cutscene_final (hardcoded)

View file

@ -973,7 +973,7 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
if (ghost->player->followmobj->colorized)
followtic |= FZT_COLORIZED;
if (followtic & FZT_SKIN)
WRITEUINT8(demobuf.p,(UINT8)(((skin_t *)(ghost->player->followmobj->skin))-skins));
WRITEUINT16(demobuf.p,(UINT16)(((skin_t *)(ghost->player->followmobj->skin))-skins));
oldghost[playernum].flags2 |= MF2_AMBUSH;
}
@ -1134,14 +1134,14 @@ void G_ConsGhostTic(INT32 playernum)
{
demobuf.p += sizeof(INT16);
if (followtic & FZT_SKIN)
demobuf.p++;
demobuf.p += sizeof(UINT16);
}
if (followtic & FZT_SCALE)
demobuf.p += sizeof(fixed_t);
// momx, momy and momz
demobuf.p += sizeof(fixed_t) * 3;
if (followtic & FZT_SKIN)
demobuf.p++;
demobuf.p += sizeof(UINT16);
demobuf.p += sizeof(UINT16);
demobuf.p++;
demobuf.p += sizeof(UINT16);
@ -1432,7 +1432,7 @@ void G_GhostTicker(void)
follow->colorized = true;
if (followtic & FZT_SKIN)
follow->skin = &skins[READUINT8(g->p)];
follow->skin = &skins[READUINT16(g->p)];
}
if (follow)
{
@ -1452,7 +1452,7 @@ void G_GhostTicker(void)
follow->z = g->mo->z + temp;
P_SetThingPosition(follow);
if (followtic & FZT_SKIN)
follow->sprite2 = READUINT8(g->p);
follow->sprite2 = READUINT16(g->p);
else
follow->sprite2 = 0;
follow->sprite = READUINT16(g->p);

View file

@ -85,7 +85,7 @@ struct menudemo_t {
struct {
UINT8 ranking;
char name[17];
UINT8 skin, color;
UINT16 skin, color;
UINT32 timeorscore;
} standings[MAXPLAYERS];
};

View file

@ -1605,15 +1605,6 @@ boolean G_Responder(event_t *ev)
return true;
}
}
else if (gamestate == GS_CONTINUING)
{
return true;
}
// Demo End
else if (gamestate == GS_GAMEEND)
{
return true;
}
else if (gamestate == GS_INTERMISSION || gamestate == GS_VOTING || gamestate == GS_EVALUATION)
if (HU_Responder(ev))
{
@ -2224,20 +2215,12 @@ void G_Ticker(boolean run)
HU_Ticker();
break;
case GS_GAMEEND:
if (run)
F_GameEndTicker();
break;
case GS_EVALUATION:
if (run)
F_GameEvaluationTicker();
HU_Ticker();
break;
case GS_CONTINUING:
break;
case GS_CREDITS:
if (run)
F_CreditTicker();
@ -2549,7 +2532,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
starpostnum = players[player].starpostnum;
starposttime = players[player].starposttime;
prevcheck = players[player].prevcheck;
prevcheck = players[player].nextcheck;
nextcheck = players[player].nextcheck;
lastsafelap = players[player].lastsafelap;
lastsafestarpost = players[player].lastsafestarpost;
bigwaypointgap = players[player].bigwaypointgap;

View file

@ -28,14 +28,12 @@ typedef enum
GS_LEVEL, // Playing, in a level.
GS_INTERMISSION, // Gazing at the intermission screen.
GS_VOTING, // SRB2Kart: MP voting screen
GS_CONTINUING, // continue screen
GS_TITLESCREEN, // title screen
GS_TIMEATTACK, // time attack menu
GS_CREDITS, // credit sequence
GS_EVALUATION, // Evaluation at the end of a game.
GS_GAMEEND, // game end sequence - "did you get all those chaos emeralds?"
// Hardcoded fades or other fading methods
GS_INTRO, // introduction

View file

@ -1116,9 +1116,11 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT32
void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
{
FOutVector v[4];
FBITFIELD flags;
FSurfaceInfo Surf;
float fx, fy, fw, fh;
UINT8 alphalevel = ((color & V_ALPHAMASK) >> V_ALPHASHIFT);
UINT8 blendmode = ((color & V_BLENDMASK) >> V_BLENDSHIFT);
// 3--2
// | /|
@ -1198,6 +1200,8 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
Surf.PolyColor = V_GetColor(color);
flags = HWR_GetBlendModeFlag(blendmode+1)|PF_Modulated|PF_NoDepthTest|PF_NoTexture;
if (alphalevel)
{
if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[st_translucency]; // V_HUDTRANSHALF
@ -1208,7 +1212,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
}
HWD.pfnDrawPolygon(&Surf, v, 4,
PF_Modulated|PF_NoTexture|PF_NoDepthTest|PF_Translucent);
flags);
}
#ifdef HAVE_PNG

View file

@ -53,7 +53,6 @@
#define R_FAKEFLOORS
#define HWPRECIP
//#define POLYSKY
// ==========================================================================
// the hardware driver object
@ -78,8 +77,6 @@ void HWR_AddTransparentFloor(levelflat_t *levelflat, extrasubsector_t *xsub, boo
void HWR_AddTransparentPolyobjectFloor(levelflat_t *levelflat, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight,
INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap);
boolean drawsky = true;
// ==========================================================================
// VIEW GLOBALS
// ==========================================================================
@ -108,10 +105,6 @@ static angle_t gl_xtoviewangle[MAXVIDWIDTH+1];
#define DOPLANES
//#define DOWALLS
// test of drawing sky by polygons like in software with visplane, unfortunately
// this doesn't work since we must have z for pixel and z for texture (not like now with z = oow)
//#define POLYSKY
// test change fov when looking up/down but bsp projection messup :(
//#define NOCRAPPYMLOOK
@ -644,50 +637,6 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
#endif
}
#ifdef POLYSKY
// this don't draw anything it only update the z-buffer so there isn't problem with
// wall/things upper that sky (map12)
static void HWR_RenderSkyPlane(extrasubsector_t *xsub, fixed_t fixedheight)
{
polyvertex_t *pv;
float height; //constant y for all points on the convex flat polygon
FOutVector *v3d;
INT32 nrPlaneVerts; //verts original define of convex flat polygon
INT32 i;
// no convex poly were generated for this subsector
if (!xsub->planepoly)
return;
height = FIXED_TO_FLOAT(fixedheight);
pv = xsub->planepoly->pts;
nrPlaneVerts = xsub->planepoly->numpts;
if (nrPlaneVerts < 3) // not even a triangle?
return;
if (nrPlaneVerts > MAXPLANEVERTICES) // FIXME: exceeds plVerts size
{
CONS_Debug(DBG_RENDER, "polygon size of %d exceeds max value of %d vertices\n", nrPlaneVerts, MAXPLANEVERTICES);
return;
}
// transform
v3d = planeVerts;
for (i = 0; i < nrPlaneVerts; i++,v3d++,pv++)
{
v3d->s = 0.0f;
v3d->t = 0.0f;
v3d->x = pv->x;
v3d->y = height;
v3d->z = pv->y;
}
HWD.pfnDrawPolygon(NULL, planeVerts, nrPlaneVerts, PF_Invisible|PF_NoTexture|PF_Occlude);
}
#endif //polysky
#endif //doplanes
FBITFIELD HWR_GetBlendModeFlag(INT32 ast)
@ -2761,12 +2710,6 @@ static void HWR_Subsector(size_t num)
floorlightlevel, &levelflats[gl_frontsector->floorpic], NULL, 255, floorcolormap);
}
}
else
{
#ifdef POLYSKY
HWR_RenderSkyPlane(&extrasubsectors[num], locFloorHeight);
#endif
}
}
if (cullCeilingHeight > dup_viewz)
@ -2784,20 +2727,8 @@ static void HWR_Subsector(size_t num)
ceilinglightlevel, &levelflats[gl_frontsector->ceilingpic], NULL, 255, ceilingcolormap);
}
}
else
{
#ifdef POLYSKY
HWR_RenderSkyPlane(&extrasubsectors[num], locCeilingHeight);
#endif
}
}
#ifndef POLYSKY
// Moved here because before, when above the ceiling and the floor does not have the sky flat, it doesn't draw the sky
if (gl_frontsector->ceilingpic == skyflatnum || gl_frontsector->floorpic == skyflatnum)
drawsky = true;
#endif
#ifdef R_FAKEFLOORS
if (gl_frontsector->ffloors)
{
@ -5928,11 +5859,7 @@ void HWR_RenderSkyboxView(player_t *player)
//------------------------------------------------------------------------
HWR_ClearView();
if (drawsky)
HWR_DrawSkyBackground(player);
//Hurdler: it doesn't work in splitscreen mode
drawsky = r_splitscreen;
HWR_DrawSkyBackground(player);
HWR_ClearSprites();
@ -6028,7 +5955,7 @@ void HWR_RenderPlayerView(void)
HWD.pfnClearBuffer(true, false, &ClearColor); // Clear the Color Buffer, stops HOMs. Also seems to fix the skybox issue on Intel GPUs.
ps_hw_skyboxtime = I_GetPreciseTime();
if (skybox && drawsky) // If there's a skybox and we should be drawing the sky, draw the skybox
if (skybox) // If there's a skybox and we should be drawing the sky, draw the skybox
HWR_RenderSkyboxView(player); // This is drawn before everything else so it is placed behind
ps_hw_skyboxtime = I_GetPreciseTime() - ps_hw_skyboxtime;
@ -6115,12 +6042,9 @@ void HWR_RenderPlayerView(void)
//------------------------------------------------------------------------
HWR_ClearView(); // Clears the depth buffer and resets the view I believe
if (!skybox && drawsky) // Don't draw the regular sky if there's a skybox
if (!skybox) // Don't draw the regular sky if there's a skybox
HWR_DrawSkyBackground(player);
//Hurdler: it doesn't work in splitscreen mode
drawsky = r_splitscreen;
HWR_ClearSprites();
drawcount = 0;

View file

@ -1836,6 +1836,7 @@ EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags)
pglDepthMask(0);
}
////Hurdler: not used if we don't define POLYSKY
////Nep: This is also used for portals and HWR_DrawSkyWall acutally.
if (Xor & PF_Invisible)
{
if (PolyFlags&PF_Invisible)

View file

@ -922,7 +922,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
// Handles key input and string input
//
static inline boolean HU_keyInChatString(char *s, char ch)
/*static inline boolean HU_keyInChatString(char *s, char ch)
{
size_t l;
@ -983,7 +983,7 @@ static inline boolean HU_keyInChatString(char *s, char ch)
return false; // did not eat key
return true; // ate the key
}
}*/
//
//
@ -2142,7 +2142,6 @@ void HU_Drawer(void)
if (!( Playing() || demo.playback )
|| gamestate == GS_INTERMISSION || gamestate == GS_CUTSCENE
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION
|| gamestate == GS_GAMEEND
|| gamestate == GS_VOTING || gamestate == GS_WAITINGPLAYERS
|| gamestate == GS_BLANCREDITS
) // SRB2kart

View file

@ -47,7 +47,7 @@ consvar_t cv_forcebots = CVAR_INIT ("kartforcebots", "Off", CV_NETVAR|CV_CHEAT,
consvar_t cv_botcontrol = CVAR_INIT ("kartbotcontrol", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
/*--------------------------------------------------
void K_SetNameForBot(UINT8 playerNum, UINT8 skinnum)
void K_SetNameForBot(UINT8 playerNum, const char *realname)
See header file for description.
--------------------------------------------------*/
@ -100,11 +100,11 @@ void K_SetNameForBot(UINT8 newplayernum, const char *realname)
}
/*--------------------------------------------------
void K_SetBot(UINT8 playerNum, UINT8 skinnum, UINT8 difficulty, botStyle_e style)
void K_SetBot(UINT8 playerNum, UINT16 skinnum, UINT8 difficulty, botStyle_e style)
See header file for description.
--------------------------------------------------*/
void K_SetBot(UINT8 newplayernum, UINT8 skinnum, UINT8 difficulty, botStyle_e style)
void K_SetBot(UINT8 newplayernum, UINT16 skinnum, UINT8 difficulty, botStyle_e style)
{
CONS_Debug(DBG_NETPLAY, "addbot: %d\n", newplayernum);
@ -146,11 +146,11 @@ void K_SetBot(UINT8 newplayernum, UINT8 skinnum, UINT8 difficulty, botStyle_e st
}
/*--------------------------------------------------
boolean K_AddBot(UINT8 skin, UINT8 difficulty, botStyle_e style, UINT8 *p)
boolean K_AddBot(UINT16 skin, UINT8 difficulty, botStyle_e style, UINT8 *p)
See header file for description.
--------------------------------------------------*/
boolean K_AddBot(UINT8 skin, UINT8 difficulty, botStyle_e style, UINT8 *p)
boolean K_AddBot(UINT16 skin, UINT8 difficulty, botStyle_e style, UINT8 *p)
{
UINT8 newplayernum = *p;
@ -186,16 +186,16 @@ boolean K_AddBot(UINT8 skin, UINT8 difficulty, botStyle_e style, UINT8 *p)
--------------------------------------------------*/
void K_UpdateMatchRaceBots(void)
{
const UINT8 defaultbotskin = K_BotDefaultSkin();
const UINT16 defaultbotskin = K_BotDefaultSkin();
UINT8 difficulty;
UINT8 pmax = (dedicated ? MAXPLAYERS-1 : MAXPLAYERS);
UINT8 numplayers = 0;
UINT8 numbots = 0;
UINT8 numwaiting = 0;
SINT8 wantedbots = 0;
UINT8 usableskins = 0, skincount = numskins;
UINT8 grabskins[MAXSKINS+1];
UINT8 i;
UINT16 usableskins = 0, skincount = numskins;
UINT16 grabskins[MAXSKINS+1];
UINT16 i;
// Init usable bot skins list
for (i = 0; i < skincount; i++)
@ -318,11 +318,11 @@ void K_UpdateMatchRaceBots(void)
while (numbots < wantedbots)
{
UINT8 skinnum = defaultbotskin;
UINT16 skinnum = defaultbotskin;
if (usableskins > 0)
{
UINT8 index = P_RandomKey(usableskins);
UINT16 index = P_RandomKey(usableskins);
skinnum = grabskins[index];
if (((cv_ingamecap.value > 0) && (usableskins+1 >= cv_ingamecap.value)) || (usableskins+1 >= cv_maxplayers.value))
{
@ -359,10 +359,6 @@ void K_UpdateMatchRaceBots(void)
--------------------------------------------------*/
boolean K_PlayerUsesBotMovement(const player_t *player)
{
if (player->exiting)
return false;
if (player->bot)
return true;
@ -1541,6 +1537,14 @@ static void K_BuildBotTiccmdNormal(player_t *player, ticcmd_t *cmd)
return;
}
if (player->exiting)
{
//Bot finish
// TODO: Make bots spin around like a player would based on random chance
return;
}
if (player->botvars.respawnconfirm >= BOTRESPAWNCONFIRM)
{
// We want to respawn. Simply hold brake and stop here!

View file

@ -175,7 +175,7 @@ fixed_t K_DistanceOfLineFromPoint(fixed_t v1x, fixed_t v1y, fixed_t v2x, fixed_t
/*--------------------------------------------------
boolean K_AddBot(UINT8 skin, UINT8 difficulty, botStyle_e style, UINT8 *p);
boolean K_AddBot(UINT16 skin, UINT8 difficulty, botStyle_e style, UINT8 *p);
Adds a new bot, using code intended to run on all clients.
@ -190,7 +190,7 @@ fixed_t K_DistanceOfLineFromPoint(fixed_t v1x, fixed_t v1y, fixed_t v2x, fixed_t
true if a bot was added, otherwise false.
--------------------------------------------------*/
boolean K_AddBot(UINT8 skin, UINT8 difficulty, botStyle_e style, UINT8 *p);
boolean K_AddBot(UINT16 skin, UINT8 difficulty, botStyle_e style, UINT8 *p);
// NOT AVAILABLE FOR LUA
@ -215,7 +215,7 @@ void K_SetNameForBot(UINT8 newplayernum, const char *realname);
/*--------------------------------------------------
void K_SetBot(UINT8 newplayernum, UINT8 skinnum, UINT8 difficulty, botStyle_e style);
void K_SetBot(UINT8 newplayernum, UINT16 skinnum, UINT8 difficulty, botStyle_e style);
Sets a player ID to be a new bot directly. Invoked directly
by K_AddBot, and indirectly by K_AddBotFromServer by sending
@ -231,7 +231,7 @@ void K_SetNameForBot(UINT8 newplayernum, const char *realname);
None
--------------------------------------------------*/
void K_SetBot(UINT8 newplayernum, UINT8 skinnum, UINT8 difficulty, botStyle_e style);
void K_SetBot(UINT8 newplayernum, UINT16 skinnum, UINT8 difficulty, botStyle_e style);
/*--------------------------------------------------

View file

@ -96,11 +96,11 @@ INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers)
}
/*--------------------------------------------------
UINT8 K_BotDefaultSkin(void)
UINT16 K_BotDefaultSkin(void)
See header file for description.
--------------------------------------------------*/
UINT8 K_BotDefaultSkin(void)
UINT16 K_BotDefaultSkin(void)
{
const char *defaultbotskinname = "tails";
INT32 defaultbotskin = R_SkinAvailable(defaultbotskinname);
@ -111,7 +111,7 @@ UINT8 K_BotDefaultSkin(void)
defaultbotskin = 0;
}
return (UINT8)defaultbotskin;
return (UINT16)defaultbotskin;
}
/*--------------------------------------------------
@ -136,7 +136,7 @@ UINT8 K_GetGPPlayerCount(UINT8 humans)
--------------------------------------------------*/
void K_InitGrandPrixBots(void)
{
const UINT8 defaultbotskin = K_BotDefaultSkin();
const UINT16 defaultbotskin = K_BotDefaultSkin();
const UINT8 startingdifficulty = K_BotStartingDifficulty(grandprixinfo.gamespeed);
UINT8 difficultylevels[MAXPLAYERS];
@ -147,14 +147,14 @@ void K_InitGrandPrixBots(void)
UINT8 numplayers = 0;
UINT8 competitors[MAXSPLITSCREENPLAYERS];
UINT8 usableskins, skincount = numskins;
UINT8 grabskins[MAXSKINS+1];
UINT16 usableskins, skincount = numskins;
UINT16 grabskins[MAXSKINS+1];
UINT8 botskinlist[MAXPLAYERS];
UINT8 botskinlistpos = 0;
UINT16 botskinlist[MAXPLAYERS];
UINT16 botskinlistpos = 0;
UINT8 newplayernum = 0;
UINT8 i, j;
UINT16 i, j;
memset(competitors, MAXPLAYERS, sizeof (competitors));
memset(botskinlist, defaultbotskin, sizeof (botskinlist));
@ -237,10 +237,10 @@ void K_InitGrandPrixBots(void)
rivalnum = R_SkinAvailable(rivalname);
// Intentionally referenced before (currently dummied out) unlock check. Such a tease!
if (rivalnum != -1 && grabskins[(UINT8)rivalnum] != MAXSKINS)
if (rivalnum != -1 && grabskins[(UINT16)rivalnum] != MAXSKINS)
{
botskinlist[botskinlistpos++] = (UINT8)rivalnum;
grabskins[(UINT8)rivalnum] = MAXSKINS;
botskinlist[botskinlistpos++] = (UINT16)rivalnum;
grabskins[(UINT16)rivalnum] = MAXSKINS;
}
}
}
@ -268,11 +268,11 @@ void K_InitGrandPrixBots(void)
{
while (botskinlistpos < wantedbots)
{
UINT8 skinnum = defaultbotskin;
UINT16 skinnum = defaultbotskin;
if (usableskins > 0)
{
UINT8 index = P_RandomKey(usableskins);
UINT16 index = P_RandomKey(usableskins);
skinnum = grabskins[index];
if (usableskins >= K_GetGPPlayerCount(1))
{
@ -545,13 +545,13 @@ void K_IncreaseBotDifficulty(player_t *bot)
--------------------------------------------------*/
void K_RetireBots(void)
{
const UINT8 defaultbotskin = K_BotDefaultSkin();
const UINT16 defaultbotskin = K_BotDefaultSkin();
SINT8 newDifficulty;
UINT8 usableskins = 0, skincount = numskins;
UINT8 grabskins[MAXSKINS+1];
UINT16 usableskins = 0, skincount = numskins;
UINT16 grabskins[MAXSKINS+1];
UINT8 i;
UINT16 i;
if (grandprixinfo.gp == true
&& (((grandprixinfo.cup != NULL) && (grandprixinfo.roundnum >= grandprixinfo.cup->numlevels))
@ -643,11 +643,11 @@ void K_RetireBots(void)
if (bot->pflags & PF_NOCONTEST)
{
UINT8 skinnum = defaultbotskin;
UINT16 skinnum = defaultbotskin;
if (usableskins > 0)
{
UINT8 index = P_RandomKey(usableskins);
UINT16 index = P_RandomKey(usableskins);
skinnum = grabskins[index];
if (usableskins+1 >= K_GetGPPlayerCount(1))
{

View file

@ -72,13 +72,13 @@ INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers);
/*--------------------------------------------------
UINT8 K_BotDefaultSkin(void);
UINT16 K_BotDefaultSkin(void);
Returns the skin number of the skin the game
uses as a fallback option.
--------------------------------------------------*/
UINT8 K_BotDefaultSkin(void);
UINT16 K_BotDefaultSkin(void);
/*--------------------------------------------------
UINT8 K_GetGPPlayerCount(UINT8 humans)

View file

@ -3342,7 +3342,7 @@ static void K_drawKartMinimapNametag(fixed_t objx, fixed_t objy, INT32 hudx, INT
fixed_t amnumxpos, amnumypos;
INT32 amxpos, amypos;
UINT8 skin = 0;
UINT16 skin = 0;
UINT16 chatcolor = skincolors[player->mo->color].chatcolor;
amnumxpos = (FixedMul(objx, minimapinfo.zoom) - minimapinfo.offs_x);
@ -3457,7 +3457,7 @@ static void K_drawKartMinimap(void)
INT32 x, y;
INT32 minimaptrans = cv_kartminimap.value;
INT32 splitflags = 0;
UINT8 skin = 0;
UINT16 skin = 0;
UINT8 *colormap = NULL;
SINT8 localplayers[MAXSPLITSCREENPLAYERS];
SINT8 numlocalplayers = 0;

View file

@ -262,6 +262,7 @@ void K_RegisterKartStuff(void)
CV_RegisterVar(&cv_kartdebugitem);
CV_RegisterVar(&cv_kartdebugamount);
CV_RegisterVar(&cv_kartdebugshrink);
CV_RegisterVar(&cv_kartdebugdistribution);
CV_RegisterVar(&cv_kartdebughuddrop);
CV_RegisterVar(&cv_kartdebugwaypoints);
@ -3654,7 +3655,9 @@ static void K_GetKartBoostPower(player_t *player)
// This should always remain the last boost
if (player->botvars.rubberband > FRACUNIT && K_PlayerUsesBotMovement(player) == true)
{
K_DoBoost(player, player->botvars.rubberband - FRACUNIT, 0, false, false);
//K_DoBoost(player, player->botvars.rubberband - FRACUNIT, 0, false, false);
//Always stack this boost....
player->boostinfo.stackspeedboost += player->botvars.rubberband - FRACUNIT;
}
player->boostpower = boostpower;
@ -3808,6 +3811,9 @@ UINT16 K_GetKartFlashing(player_t *player)
boolean K_PlayerShrinkCheat(player_t *player)
{
if (cv_kartdebugshrink.value)
return true;
return (
(player->pflags & PF_SHRINKACTIVE)
&& (player->bot == false)
@ -7266,27 +7272,21 @@ INT32 K_ChainOrDeincrementTime(player_t *player, INT32 timer, INT32 deincrement,
}
// Get the tic inverse sum using kartspeed, kartweight and your number of boosts.
static INT32 ticinversesum(UINT8 kartspeed, UINT8 kartweight, UINT8 grade)
static INT32 K_TicInversesum(UINT8 kartspeed, UINT8 kartweight, UINT8 grade)
{
return (TICRATE / kartspeed) + (TICRATE / CLAMP(kartweight, 1, 5)) + grade;
}
// Get the maximum required stacks needed for the ringnerf based on kartspeed and kartweight
static INT32 statrangemap(UINT8 kartspeed, UINT8 kartweight)
// Get the threshold for the ringnerf based on kartspeed and kartweight
static INT32 K_StackThreshold(UINT8 kartspeed, UINT8 kartweight)
{
INT32 scaledsw = (9 - kartspeed) + (9 - kartweight);
fixed_t scaled_input = (scaledsw)*FRACUNIT/16;
// Scale the result to be within range [2, 4]
fixed_t result = 4*FRACUNIT - (FixedMul(scaled_input, 2*FRACUNIT));
fixed_t result = 4*FRACUNIT - (FixedMul(scaledsw*FRACUNIT/16, 2*FRACUNIT));
// Stay within range please!
result = CLAMP(result, 2*FRACUNIT, 4*FRACUNIT);
result = result >> FRACBITS;
return result;
return result >> FRACBITS;
}
static void K_HandleRingDeincrement(player_t *player, boolean chainnerf)
@ -7301,11 +7301,11 @@ static void K_HandleRingDeincrement(player_t *player, boolean chainnerf)
if (chainnerf)
{
UINT8 requiredgrade = statrangemap(player->kartspeed, player->kartweight);
UINT8 requiredgrade = K_StackThreshold(player->kartspeed, player->kartweight);
if (player->numboosts >= requiredgrade)
{
INT32 insum = ticinversesum(player->kartspeed, player->kartweight, player->numboosts);
INT32 insum = K_TicInversesum(player->kartspeed, player->kartweight, player->numboosts);
INT32 subring = (player->ringboost*2)/insum;
if (player->kartspeed == 1)
@ -7528,12 +7528,18 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->ringdelay--;
if (P_PlayerInPain(player))
{
player->ringboost = 0;
player->ringtime = 0;
}
else if (player->ringboost)
{
K_HandleRingDeincrement(player, chainingactive);
}
if (!player->ringboost && !player->chaintimer)
player->ringtime = 0;
if (player->sneakertimer)
player->sneakertimer = K_ChainOrDeincrementTime(player, player->sneakertimer, 1, false);
@ -9079,6 +9085,7 @@ static void K_UpdatePlayerWaypoints(player_t *const player)
INT32 K_GetKartRingPower(player_t *player, boolean boosted)
{
fixed_t ringPower = ((9 - player->kartspeed) + (9 - player->kartweight)) * (FRACUNIT/2);
UINT16 finalPower = 0;
if (boosted == true)
{
@ -9091,7 +9098,23 @@ INT32 K_GetKartRingPower(player_t *player, boolean boosted)
ringPower += 1;
}
return max(ringPower / FRACUNIT, 1);
finalPower = max(ringPower / FRACUNIT, 1);
// the base is 4 tics
finalPower += 3;
// If you use more then 20 rings at a time, you start gaining less ring timer..
if (player->ringtime == finalPower*20)
{
if (P_IsLocalPlayer(player))
S_StartSound(NULL, sfx_cdfm66);
}
else if (player->ringtime > finalPower*20)
{
finalPower = 2;
}
return finalPower;
}
// Returns false if this player being placed here causes them to collide with any other player

View file

@ -57,6 +57,13 @@ static precise_t gif_prevframetime = 0;
static UINT32 gif_delayus = 0; // "us" is microseconds
static UINT8 gif_writeover = 0;
typedef struct
{
void *pixels;
size_t size;
boolean owns_pixels;
} gif_screen_t;
static gif_screen_t gif_screens[2];
// OPTIMIZE gif output
@ -541,7 +548,8 @@ static void GIF_rgbconvert(UINT8 *linear, UINT8 *scr)
static void GIF_framewrite(void)
{
UINT8 *p;
UINT8 *movie_screen = screens[2];
UINT8 *base_screen = gif_screens[0].pixels;
UINT8 *movie_screen = gif_screens[1].pixels;
INT32 blitx, blity, blitw, blith;
boolean palchanged;
@ -566,7 +574,7 @@ static void GIF_framewrite(void)
if (gif_optimize && gif_frames > 0 && (!palchanged))
{
// before blit movie_screen points to last frame, cur_screen points to this frame
UINT8 *cur_screen = screens[0];
UINT8 *cur_screen = base_screen;
GIF_optimizeregion(cur_screen, movie_screen, &blitx, &blity, &blitw, &blith);
// blit to temp screen
@ -592,7 +600,7 @@ static void GIF_framewrite(void)
if (rendermode == render_opengl)
{
UINT8 *linear = HWR_GetScreenshot();
GIF_rgbconvert(linear, screens[0]);
GIF_rgbconvert(linear, base_screen);
//free(linear); // Allocated 'statically', no need to free now
}
#endif
@ -602,7 +610,7 @@ static void GIF_framewrite(void)
if (gif_frames == 0 && rendermode == render_soft)
I_ReadScreen(movie_screen);
movie_screen = screens[0];
movie_screen = base_screen;
}
// screen regions are handled in GIF_lzw
@ -610,7 +618,7 @@ static void GIF_framewrite(void)
UINT16 delay = 0;
INT32 startline;
if (gif_dynamicdelay ==(UINT8) 2)
if (gif_dynamicdelay ==(UINT8) 2 && !singletics)
{
// golden's attempt at creating a "dynamic delay"
UINT16 mingifdelay = 10; // minimum gif delay in milliseconds (keep at 10 because gifs can't get more precise).
@ -623,7 +631,7 @@ static void GIF_framewrite(void)
gif_delayus -= frames*(mingifdelay*1000); // remove frames by the amount of milliseconds they take. don't reset to 0, the microseconds help consistency.
}
}
else if (gif_dynamicdelay ==(UINT8) 1)
else if (gif_dynamicdelay ==(UINT8) 1 && !singletics)
{
float delayf = ceil(100.0f/NEWTICRATE);
@ -750,13 +758,66 @@ INT32 GIF_open(const char *filename)
return 1;
}
static void GIF_checkscreens(void)
{
for (size_t i = 0; i < sizeof(gif_screens) / sizeof(gif_screens[0]); i++)
{
if (rendermode == render_soft)
{
if (gif_screens[i].owns_pixels)
{
Z_Free(gif_screens[i].pixels);
gif_screens[i].owns_pixels = false;
}
gif_screens[i].size = 0;
if (i == 1)
gif_screens[i].pixels = screens[2];
else
gif_screens[i].pixels = screens[0];
}
else
{
size_t sz = vid.width * vid.height * vid.bpp;
if (!gif_screens[i].owns_pixels)
{
gif_screens[i].size = sz;
gif_screens[i].pixels = Z_Malloc(gif_screens[i].size, PU_STATIC, NULL);
gif_screens[i].owns_pixels = true;
}
else if (gif_screens[i].size != sz)
{
gif_screens[i].size = sz;
gif_screens[i].pixels = Z_Realloc(gif_screens[i].pixels, gif_screens[i].size, PU_STATIC, NULL);
}
}
}
}
static void GIF_freescreens(void)
{
for (size_t i = 0; i < sizeof(gif_screens) / sizeof(gif_screens[0]); i++)
{
if (gif_screens[i].owns_pixels)
{
Z_Free(gif_screens[i].pixels);
gif_screens[i].owns_pixels = false;
}
gif_screens[i].size = 0;
gif_screens[i].pixels = NULL;
}
}
//
// GIF_frame
// writes a frame into the output gif
//
void GIF_frame(void)
{
// there's not much actually needed here, is there.
GIF_checkscreens();
GIF_framewrite();
}
@ -786,6 +847,8 @@ INT32 GIF_close(void)
Z_Free(giflzw_hashTable);
giflzw_hashTable = NULL;
GIF_freescreens();
CONS_Printf(M_GetText("Animated gif closed; wrote %d frames\n"), gif_frames);
return 1;
}

View file

@ -1249,7 +1249,7 @@ boolean M_Responder(event_t *ev)
INT32 deviceplayer = G_GetDevicePlayer(ev->device);
if (dedicated || (demo.playback && demo.title)
|| gamestate == GS_INTRO || gamestate == GS_CUTSCENE || gamestate == GS_GAMEEND
|| gamestate == GS_INTRO || gamestate == GS_CUTSCENE
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION
|| gamestate == GS_BLANCREDITS
)
@ -6511,7 +6511,7 @@ void M_DrawMPMainMenu(void)
#define iconwidth 32
#define spacingwidth 32
#define incrwidth (iconwidth + spacingwidth)
UINT8 i = 0, pskin, pcol;
UINT16 i = 0, pskin, pcol;
// player arrangement width, but there's also a chance i'm a furry, shhhhhh
const INT32 paw = iconwidth + 3*incrwidth;
INT32 trans = 0;

View file

@ -376,7 +376,7 @@ struct modedesc_t
typedef struct
{
char levelname[32];
UINT8 skinnum;
UINT16 skinnum;
UINT8 numemeralds;
UINT8 numgameovers;
INT32 lives;

View file

@ -3171,7 +3171,8 @@ void A_AttractChase(mobj_t *actor)
{
// Base add is 4 tics for 9,9, adds 1 tic for each point closer to the 1,1 end
actor->target->player->ringboost += K_GetKartRingPower(actor->target->player, true) + 3;
actor->target->player->ringboost += K_GetKartRingPower(actor->target->player, true);
actor->target->player->ringtime += K_GetKartRingPower(actor->target->player, true);
S_StartSoundAtVolume(actor->target, sfx_s1b5, actor->target->player->ringvolume);
if (actor->target->player->rings <= 10)
@ -3204,7 +3205,10 @@ void A_AttractChase(mobj_t *actor)
if (actor->extravalue1 >= 16)
{
if (!P_GivePlayerRings(actor->target->player, 1)) // returns 0 if addition failed
actor->target->player->ringboost += K_GetKartRingPower(actor->target->player, true) + 3;
{
actor->target->player->ringboost += K_GetKartRingPower(actor->target->player, true);
actor->target->player->ringtime += K_GetKartRingPower(actor->target->player, true);
}
if (actor->target->player->ringboost > (4*TICRATE + TICRATE/2))
actor->target->player->ringboost = (4*TICRATE + TICRATE/2);

View file

@ -7757,7 +7757,7 @@ static boolean P_MobjDeadThink(mobj_t *mobj)
{
P_SetObjectMomZ(mobj, -2*FRACUNIT/3, true);
if (mobj->player && (skins[mobj->player->skin].flags && SF_OLDDEATH))
if (mobj->player && (skins[mobj->player->skin].flags & SF_OLDDEATH))
{
mobj->player->drawangle -= ANGLE_22h;
}

View file

@ -315,6 +315,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEUINT8(save->p, players[i].pickuprings);
WRITEUINT8(save->p, players[i].ringdelay);
WRITEUINT16(save->p, players[i].ringboost);
WRITEUINT16(save->p, players[i].ringtime);
WRITEUINT16(save->p, players[i].superring);
WRITEUINT8(save->p, players[i].nextringaward);
WRITEUINT8(save->p, players[i].ringvolume);
@ -652,7 +653,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].rings = READSINT8(save->p);
players[i].pickuprings = READUINT8(save->p);
players[i].ringdelay = READUINT8(save->p);
players[i].ringboost = READUINT16(save->p);;
players[i].ringboost = READUINT16(save->p);
players[i].ringtime = READUINT16(save->p);;
players[i].superring = READUINT16(save->p);
players[i].nextringaward = READUINT8(save->p);
players[i].ringvolume = READUINT8(save->p);
@ -2492,7 +2494,7 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
if (diff2 & MD2_CVMEM)
WRITEINT32(save->p, mobj->cvmem);
if (diff2 & MD2_SKIN)
WRITEUINT8(save->p, (UINT8)((skin_t *)mobj->skin - skins));
WRITEUINT16(save->p, (UINT16)((skin_t *)mobj->skin - skins));
if (diff2 & MD2_COLOR)
WRITEUINT16(save->p, mobj->color);
if (diff2 & MD2_EXTVAL1)
@ -3726,7 +3728,7 @@ static thinker_t* LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
if (diff2 & MD2_CVMEM)
mobj->cvmem = READINT32(save->p);
if (diff2 & MD2_SKIN)
mobj->skin = &skins[READUINT8(save->p)];
mobj->skin = &skins[READUINT16(save->p)];
if (diff2 & MD2_COLOR)
mobj->color = READUINT16(save->p);
if (diff2 & MD2_EXTVAL1)

View file

@ -36,7 +36,7 @@ mobj_t *P_FindNewPosition(UINT32 oldposition);
struct savedata_t
{
UINT8 skin;
UINT16 skin;
INT32 score;
INT32 lives;
UINT16 emeralds;

View file

@ -265,18 +265,16 @@ static void R_MapTiltedPlane(drawspandata_t *ds, void(*spanfunc)(drawspandata_t*
spanfunc(ds);
}
void R_ClearFFloorClips (void)
void R_ClearFFloorClips(void)
{
INT32 i, p;
INT32 p;
// opening / clipping determination
for (i = 0; i < viewwidth; i++)
for (p = 0; p < MAXFFLOORS; p++)
{
for (p = 0; p < MAXFFLOORS; p++)
{
ffloor[p].f_clip[i] = (INT16)viewheight;
ffloor[p].c_clip[i] = -1;
}
visffloor_t *fffloor = &ffloor[p];
std::fill(fffloor->f_clip, fffloor->f_clip + viewwidth, static_cast<INT16>(viewheight));
std::fill(fffloor->c_clip, fffloor->c_clip + viewwidth, static_cast<INT16>(-1));
}
numffloors = 0;
@ -288,20 +286,14 @@ void R_ClearFFloorClips (void)
//
void R_ClearPlanes(void)
{
INT32 i, p;
INT32 i;
// opening / clipping determination
for (i = 0; i < viewwidth; i++)
{
floorclip[i] = (INT16)viewheight;
ceilingclip[i] = -1;
frontscale[i] = INT32_MAX;
for (p = 0; p < MAXFFLOORS; p++)
{
ffloor[p].f_clip[i] = (INT16)viewheight;
ffloor[p].c_clip[i] = -1;
}
}
std::fill(floorclip, floorclip + viewwidth, static_cast<INT16>(viewheight));
std::fill(ceilingclip, ceilingclip + viewwidth, static_cast<INT16>(-1));
std::fill(frontscale, frontscale + viewwidth, INT32_MAX);
R_ClearFFloorClips();
for (i = 0; i < MAXVISPLANES; i++)
for (*freehead = visplanes[i], visplanes[i] = NULL;

View file

@ -37,6 +37,32 @@ void Portal_InitList (void)
portal_base = portal_cap = NULL;
}
/** Store the clipping window for a portal in its given range.
*
* The window is copied from the current window at the time
* the function is called, so it is useful for converting one-sided
* lines into portals.
*/
void Portal_ClipRange (portal_t* portal)
{
INT32 start = portal->start;
INT32 end = portal->end;
INT16 *ceil = portal->ceilingclip;
INT16 *floor = portal->floorclip;
fixed_t *scale = portal->frontscale;
INT32 i;
for (i = 0; i < end-start; i++)
{
*ceil = ceilingclip[start+i];
ceil++;
*floor = floorclip[start+i];
floor++;
*scale = frontscale[start+i];
scale++;
}
}
/** Apply the clipping window from a portal.
*/
void Portal_ClipApply (const portal_t* portal)
@ -139,6 +165,13 @@ void Portal_Add2Lines (const INT32 line1, const INT32 line2, const INT32 x1, con
vertex_t dest_c, start_c;
if (mapnamespace == MNS_SRB2KART)
{
portal->viewx = viewx;
portal->viewy = viewy;
portal->viewz = viewz;
}
// looking glass center
start_c.x = (start->v1->x + start->v2->x) / 2;
start_c.y = (start->v1->y + start->v2->y) / 2;
@ -147,17 +180,31 @@ void Portal_Add2Lines (const INT32 line1, const INT32 line2, const INT32 x1, con
dest_c.x = (dest->v1->x + dest->v2->x) / 2;
dest_c.y = (dest->v1->y + dest->v2->y) / 2;
disttopoint = R_PointToDist2(start_c.x, start_c.y, viewx, viewy);
angtopoint = R_PointToAngle2(start_c.x, start_c.y, viewx, viewy);
angtopoint += dangle;
portal->viewx = dest_c.x + FixedMul(FINECOSINE(angtopoint>>ANGLETOFINESHIFT), disttopoint);
portal->viewy = dest_c.y + FixedMul(FINESINE(angtopoint>>ANGLETOFINESHIFT), disttopoint);
portal->viewz = viewz + dest->frontsector->floorheight - start->frontsector->floorheight;
if ((dangle == 0) && (mapnamespace == MNS_SRB2KART))
{
// the entrance goes straight opposite the exit, so we just need to mess with the offset.
portal->viewx += dest_c.x - start_c.x;
portal->viewy += dest_c.y - start_c.y;
}
else
{
disttopoint = R_PointToDist2(start_c.x, start_c.y, viewx, viewy);
angtopoint = R_PointToAngle2(start_c.x, start_c.y, viewx, viewy);
angtopoint += dangle;
portal->viewx = dest_c.x + FixedMul(FINECOSINE(angtopoint>>ANGLETOFINESHIFT), disttopoint);
portal->viewy = dest_c.y + FixedMul(FINESINE(angtopoint>>ANGLETOFINESHIFT), disttopoint);
}
portal->viewangle = viewangle + dangle;
portal->clipline = line2;
if (mapnamespace == MNS_SRB2KART)
Portal_ClipRange(portal);
g_portal = portal; // this tells R_StoreWallRange that curline is a portal seg
}

View file

@ -58,6 +58,7 @@ void Portal_Remove (portal_t* portal);
void Portal_Add2Lines (const INT32 line1, const INT32 line2, const INT32 x1, const INT32 x2);
void Portal_AddSkybox (const visplane_t* plane);
void Portal_ClipRange (portal_t* portal);
void Portal_ClipApply (const portal_t* portal);
void Portal_AddSkyboxPortals (void);

View file

@ -688,8 +688,7 @@ void R_RenderMaskedSegRange(drawseg_t *drawseg, INT32 x1, INT32 x2)
template <typename T>
static constexpr T saturating_add(T x, T y) noexcept
{
INT64 z;
z = static_cast<INT64>(x) + static_cast<INT64>(y);
INT64 z = static_cast<INT64>(x) + static_cast<INT64>(y);
if (z > static_cast<INT64>(std::numeric_limits<T>::max()))
{
z = static_cast<INT64>(std::numeric_limits<T>::max());
@ -704,8 +703,7 @@ static constexpr T saturating_add(T x, T y) noexcept
template <typename T>
static constexpr T saturating_mul(T x, T y) noexcept
{
INT64 z;
z = static_cast<INT64>(x) * static_cast<INT64>(y);
INT64 z = static_cast<INT64>(x) * static_cast<INT64>(y);
if (z > static_cast<INT64>(std::numeric_limits<T>::max()))
{
z = static_cast<INT64>(std::numeric_limits<T>::max());
@ -1596,7 +1594,7 @@ static void R_RenderSegLoop (drawcolumndata_t* dc)
// Portal line
// Spans the entire height of a single-sided line or
// the "window" of a double-sided line.
if (g_portal)
if (g_portal && (mapnamespace != MNS_SRB2KART))
{
I_Assert(rw_x >= g_portal->start && rw_x < g_portal->end);
i = rw_x - g_portal->start;
@ -2245,7 +2243,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|| frontsector->extra_colormap != backsector->extra_colormap
|| (frontsector->ffloors != backsector->ffloors && !Tag_Compare(&frontsector->tags, &backsector->tags))
// Portals block traversal behind them
|| g_portal
|| (g_portal && mapnamespace != MNS_SRB2KART)
// Highlighting death pits
|| (cv_debugfinishline.value && frontsector->damagetype != backsector->damagetype))
{
@ -2283,7 +2281,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|| frontsector->extra_colormap != backsector->extra_colormap
|| (frontsector->ffloors != backsector->ffloors && !Tag_Compare(&frontsector->tags, &backsector->tags))
// Portals block traversal behind them
|| g_portal
|| (g_portal && mapnamespace != MNS_SRB2KART)
// Highlighting death pits
|| (cv_debugfinishline.value && frontsector->damagetype != backsector->damagetype))
{

View file

@ -173,7 +173,7 @@ UINT32 R_GetSkinAvailabilities(void)
{
if (unlockables[i].type == SECRET_SKIN && unlockables[i].unlocked)
{
UINT8 s = min(unlockables[i].variable, MAXSKINS);
UINT16 s = min(unlockables[i].variable, MAXSKINS);
response |= (1 << s);
}
}

View file

@ -1812,7 +1812,7 @@ static void R_ProjectSprite(mobj_t *thing)
basetx = tx = FixedMul(tr_x, viewsin) - FixedMul(tr_y, viewcos); // sideways distance
// too far off the side?
if (!papersprite && abs(tx) > FixedMul(tz, fovtan[viewssnum])<<2) // papersprite clipping is handled later
if (!papersprite && abs(tx) > (INT64)FixedMul(tz, fovtan[viewssnum])<<2) // papersprite clipping is handled later
return;
// aspect ratio stuff
@ -2545,7 +2545,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
// uncapped/interpolation
interpmobjstate_t interp = {0};
// okay... this is a hack, but weather isn't networked, so it should be ok
if (!P_PrecipThinker(thing))
{

View file

@ -63,7 +63,7 @@ consvar_t cv_renderview = CVAR_INIT ("renderview", "On", 0, CV_OnOff, NULL);
consvar_t cv_vhseffect = CVAR_INIT ("vhspause", "On", CV_SAVE, CV_OnOff, NULL);
static CV_PossibleValue_t shittyscreen_cons_t[] = {{0, "Okay"}, {1, "Shitty"}, {2, "Extra Shitty"}, {0, NULL}};
consvar_t cv_shittyscreen = CVAR_INIT ("televisionsignal", "Okay", CV_NOSHOWHELP, shittyscreen_cons_t, NULL);
consvar_t cv_shittyscreen = CVAR_INIT ("televisionsignal", "Okay", 0, shittyscreen_cons_t, NULL);
CV_PossibleValue_t cv_renderer_t[] = {
{1, "Software"},

View file

@ -43,8 +43,8 @@ extern "C" {
// we try to re-allocate a minimum of buffers for stability of the memory,
// so all the small-enough tables based on screen size, are allocated once
// and for all at the maximum size.
#define MAXVIDWIDTH 1920 // don't set this too high because actually
#define MAXVIDHEIGHT 1200 // lots of tables are allocated with the MAX size.
#define MAXVIDWIDTH 2560 // don't set this too high because actually
#define MAXVIDHEIGHT 1440 // lots of tables are allocated with the MAX size.
#define BASEVIDWIDTH 320 // NEVER CHANGE THIS! This is the original
#define BASEVIDHEIGHT 200 // resolution of the graphics.

View file

@ -1294,6 +1294,18 @@ void I_InitJoystick(UINT8 index)
if (M_CheckParm("-nojoy"))
return;
{
char dbpath[1024];
sprintf(dbpath, "%s" PATHSEP "gamecontrollerdb.txt", srb2path);
SDL_GameControllerAddMappingsFromFile(dbpath);
}
{
char dbpath[1024];
sprintf(dbpath, "%s" PATHSEP "gamecontrollerdb_user.txt", srb2home);
SDL_GameControllerAddMappingsFromFile(dbpath);
}
if (M_CheckParm("-noxinput"))
SDL_SetHintWithPriority("SDL_XINPUT_ENABLED", "0", SDL_HINT_OVERRIDE);
@ -2681,7 +2693,4 @@ UINT32 I_GetFreeMem(UINT32 *total)
#endif
}
// note CPUAFFINITY code used to reside here
//void I_RegisterSysCommands(void) {}
#endif // HAVE_SDL

File diff suppressed because it is too large Load diff

View file

@ -1571,7 +1571,7 @@ void V_DrawVhsEffect(boolean rewind)
fixed_t uby = upbary>>FRACBITS, dby = downbary>>FRACBITS;
#ifdef HWRENDER
if ((rendermode == render_opengl))
if (rendermode == render_opengl)
{
HWR_RenderVhsEffect(uby, dby, updistort, downdistort, barsize);
return;

View file

@ -1402,7 +1402,7 @@ lumpnum_t W_CheckNumForName(const char *name)
INT32 i;
UINT32 hash = name ? quickncasehash(name, 8) : 0;
lumpnum_t check = INT16_MAX;
if (name == NULL)
return LUMPERROR;
@ -1454,7 +1454,7 @@ lumpnum_t W_CheckNumForLongName(const char *name)
INT32 i;
UINT32 hash = name ? quickncasehash(name, 8) : 0;
lumpnum_t check = INT16_MAX;
if (name == NULL)
return LUMPERROR;