Compare commits
58
Commits
votebgstuff
..
v8.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2049353647 | ||
|
|
845652cbfe | ||
|
|
ceafa06efc | ||
|
|
e6f487474b | ||
|
|
d8461bb44f | ||
|
|
e25d366728 | ||
|
|
2abf0b98ac | ||
|
|
2e914c61d1 | ||
|
|
50f7e2084c | ||
|
|
67cc5402cf | ||
|
|
2259d4f309 | ||
|
|
f8d903e7d2 | ||
|
|
805cde8ae8 | ||
|
|
b23906e327 | ||
|
|
2052afdb66 | ||
|
|
e749346f0c | ||
|
|
45629386bb | ||
|
|
ffec9d64d5 | ||
|
|
3e9f17af86 | ||
|
|
03ff2fc007 | ||
|
|
4492c00840 | ||
|
|
e15319ac9b | ||
|
|
fa012aefe1 | ||
|
|
e681d2d24d | ||
|
|
76e54762d8 | ||
|
|
3b7d517be2 | ||
|
|
f4da64e3fa | ||
|
|
384acf8e31 | ||
|
|
a423451383 | ||
|
|
66cfceedaf | ||
|
|
fe9107fa9d | ||
|
|
e4f2db54e7 | ||
|
|
2f5fe01ae0 | ||
|
|
1bb7bd0abc | ||
|
|
a84ec88bc3 | ||
|
|
4a2e78081a | ||
|
|
d09d2cb445 | ||
|
|
1faa585e83 | ||
|
|
7479c82691 | ||
|
|
cfab2236da | ||
|
|
d2ee344b22 | ||
|
|
b22737223e | ||
|
|
578158c060 | ||
|
|
8eda0f78f7 | ||
|
|
2c2c82dc1a | ||
|
|
d8c9522ec9 | ||
|
|
492aef2165 | ||
|
|
fc0409e967 | ||
|
|
8a89b57e48 | ||
|
|
0f6b9ba181 | ||
|
|
8f1b4004c9 | ||
|
|
bee5250940 | ||
|
|
c61a2e6ba2 | ||
|
|
d293bb9672 | ||
|
|
68cb96ab97 | ||
|
|
78b642cf2d | ||
|
|
a9209a4887 | ||
|
|
0a3e7ba09f |
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/* backtrace.h -- Public header file for stack backtrace library.
|
||||
Copyright (C) 2012-2024 Free Software Foundation, Inc.
|
||||
Copyright (C) 2012-2020 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Google.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,14 +54,13 @@ struct backtrace_state;
|
||||
invalid after this function returns.
|
||||
|
||||
As a special case, the ERRNUM argument will be passed as -1 if no
|
||||
debug info can be found for the executable, or if the debug info
|
||||
exists but has an unsupported version, but the function requires
|
||||
debug info (e.g., backtrace_full, backtrace_pcinfo). The MSG in
|
||||
this case will be something along the lines of "no debug info".
|
||||
Similarly, ERRNUM will be passed as -1 if there is no symbol table,
|
||||
but the function requires a symbol table (e.g., backtrace_syminfo).
|
||||
This may be used as a signal that some other approach should be
|
||||
tried. */
|
||||
debug info can be found for the executable, but the function
|
||||
requires debug info (e.g., backtrace_full, backtrace_pcinfo). The
|
||||
MSG in this case will be something along the lines of "no debug
|
||||
info". Similarly, ERRNUM will be passed as -1 if there is no
|
||||
symbol table, but the function requires a symbol table (e.g.,
|
||||
backtrace_syminfo). This may be used as a signal that some other
|
||||
approach should be tried. */
|
||||
|
||||
typedef void (*backtrace_error_callback) (void *data, const char *msg,
|
||||
int errnum);
|
||||
|
||||
Binary file not shown.
+35
-14
@@ -816,12 +816,17 @@ static void COM_Help_f(void)
|
||||
cvar = CV_FindVar(help);
|
||||
if (cvar)
|
||||
{
|
||||
boolean floatmode = false;
|
||||
const char *cvalue = NULL;
|
||||
CONS_Printf("\x82""Variable %s:\n", cvar->name);
|
||||
CONS_Printf(M_GetText(" flags: "));
|
||||
if (cvar->flags & CV_SAVE)
|
||||
CONS_Printf("AUTOSAVE ");
|
||||
if (cvar->flags & CV_FLOAT)
|
||||
{
|
||||
CONS_Printf("FLOAT ");
|
||||
floatmode = true;
|
||||
}
|
||||
if (cvar->flags & CV_NETVAR)
|
||||
CONS_Printf("NETVAR ");
|
||||
if (cvar->flags & CV_CALL)
|
||||
@@ -831,30 +836,43 @@ static void COM_Help_f(void)
|
||||
CONS_Printf("\n");
|
||||
if (cvar->PossibleValue)
|
||||
{
|
||||
if (!stricmp(cvar->PossibleValue[0].strvalue, "MIN") && !stricmp(cvar->PossibleValue[1].strvalue, "MAX"))
|
||||
{
|
||||
CONS_Printf(" range from %d to %d\n", cvar->PossibleValue[0].value,
|
||||
cvar->PossibleValue[1].value);
|
||||
i = 2;
|
||||
}
|
||||
if (!stricmp(cvar->PossibleValue[0].strvalue, "MIN") && !stricmp(cvar->PossibleValue[1].strvalue, "MAX"))
|
||||
{
|
||||
if (floatmode)
|
||||
{
|
||||
float fu = FIXED_TO_FLOAT(cvar->PossibleValue[0].value);
|
||||
float ck = FIXED_TO_FLOAT(cvar->PossibleValue[1].value);
|
||||
CONS_Printf(" range from %ld%s to %ld%s\n",
|
||||
(long)fu, M_Ftrim(fu),
|
||||
(long)ck, M_Ftrim(ck));
|
||||
}
|
||||
else
|
||||
CONS_Printf(" range from %d to %d\n", cvar->PossibleValue[0].value,
|
||||
cvar->PossibleValue[1].value);
|
||||
i = 2;
|
||||
}
|
||||
|
||||
{
|
||||
const char *cvalue = NULL;
|
||||
//CONS_Printf(M_GetText(" possible value : %s\n"), cvar->name);
|
||||
while (cvar->PossibleValue[i].strvalue)
|
||||
{
|
||||
CONS_Printf(" %-2d : %s\n", cvar->PossibleValue[i].value,
|
||||
cvar->PossibleValue[i].strvalue);
|
||||
if (floatmode)
|
||||
CONS_Printf(" %-2f : %s\n", FIXED_TO_FLOAT(cvar->PossibleValue[i].value),
|
||||
cvar->PossibleValue[i].strvalue);
|
||||
else
|
||||
CONS_Printf(" %-2d : %s\n", cvar->PossibleValue[i].value,
|
||||
cvar->PossibleValue[i].strvalue);
|
||||
if (cvar->PossibleValue[i].value == cvar->value)
|
||||
cvalue = cvar->PossibleValue[i].strvalue;
|
||||
i++;
|
||||
}
|
||||
if (cvalue)
|
||||
CONS_Printf(" Current value: %s\n", cvalue);
|
||||
else
|
||||
CONS_Printf(" Current value: %d\n", cvar->value);
|
||||
}
|
||||
}
|
||||
|
||||
if (cvalue)
|
||||
CONS_Printf(" Current value: %s\n", cvalue);
|
||||
else if (cvar->string)
|
||||
CONS_Printf(" Current value: %s\n", cvar->string);
|
||||
else
|
||||
CONS_Printf(" Current value: %d\n", cvar->value);
|
||||
}
|
||||
@@ -1025,7 +1043,10 @@ static void COM_Add_f(void)
|
||||
}
|
||||
|
||||
if (( cvar->flags & CV_FLOAT ))
|
||||
CV_Set(cvar, va("%f", FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2))));
|
||||
{
|
||||
float n =FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2));
|
||||
CV_Set(cvar, va("%ld%s", (long)n, M_Ftrim(n)));
|
||||
}
|
||||
else
|
||||
CV_AddValue(cvar, atoi(COM_Argv(2)));
|
||||
}
|
||||
|
||||
+31
-6
@@ -95,7 +95,7 @@ UINT8 playernode[MAXPLAYERS];
|
||||
tic_t jointimeout = (3*TICRATE);
|
||||
static boolean sendingsavegame[MAXNETNODES]; // Are we sending the savegame?
|
||||
#ifdef SATURNPAK
|
||||
static boolean resendingsavegame[MAXNETNODES]; // Are we resending the savegame?
|
||||
static tic_t resendingsavegame[MAXNETNODES]; // Are we resending the savegame?
|
||||
static tic_t savegameresendcooldown[MAXNETNODES]; // How long before we can resend again?
|
||||
#endif
|
||||
static tic_t freezetimeout[MAXNETNODES]; // Until when can this node freeze the server before getting a timeout?
|
||||
@@ -4244,7 +4244,7 @@ static void ResetNode(INT32 node)
|
||||
// SATURN
|
||||
#ifdef SATURNPAK
|
||||
is_client_saturn[node] = false;
|
||||
resendingsavegame[node] = false;
|
||||
resendingsavegame[node] = 0;
|
||||
savegameresendcooldown[node] = 0;
|
||||
gamestate_resend_counter[node] = 0;
|
||||
#endif
|
||||
@@ -4945,7 +4945,7 @@ static void PT_CanReceiveGamestate(SINT8 node)
|
||||
CONS_Printf(M_GetText("Resending game state to %s...\n"), player_names[nodetoplayer[node]]);
|
||||
|
||||
SV_SendSaveGame(node, true); // Resend a complete game state
|
||||
resendingsavegame[node] = true;
|
||||
resendingsavegame[node] = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -5392,7 +5392,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
&& consistancy[realstart%TICQUEUE] != SHORT(netbuffer->u.clientpak.consistancy)
|
||||
&& (!UseSaturnSynch(node) || (!resendingsavegame[node] && savegameresendcooldown[node] <= I_GetTime() && !SV_ResendingSavegameToAnyone())))
|
||||
{
|
||||
resendingsavegame[node] = false; // reset this before just in case
|
||||
resendingsavegame[node] = 0; // reset this before just in case
|
||||
|
||||
// Check if a client is saturn before sending ANYTHING!
|
||||
// this way we only send stuff to clients we know can use the gamestate resend
|
||||
@@ -5402,7 +5402,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
// Tell the client we are about to resend them the gamestate
|
||||
netbuffer->packettype = PT_WILLRESENDGAMESTATE;
|
||||
HSendPacket(node, true, 0, 0);
|
||||
resendingsavegame[node] = true;
|
||||
resendingsavegame[node] = 1;
|
||||
}
|
||||
else if (UseVanillaSynch(node))
|
||||
{
|
||||
@@ -5732,7 +5732,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
break;
|
||||
case PT_RECEIVEDGAMESTATE:
|
||||
sendingsavegame[node] = false;
|
||||
resendingsavegame[node] = false;
|
||||
resendingsavegame[node] = 0;
|
||||
savegameresendcooldown[node] = I_GetTime() + cv_resynchcooldown.value * TICRATE; // I_GetTime() + 5 * TICRATE;
|
||||
break;
|
||||
case PT_WILLRESENDGAMESTATE:
|
||||
@@ -6362,10 +6362,35 @@ static void SV_Maketic(void)
|
||||
maketic++;
|
||||
}
|
||||
|
||||
#ifdef SATURNPAK
|
||||
static void SV_UpdateResendGamestateTimeout(void)
|
||||
{
|
||||
for (INT32 i = 0; i < MAXNETNODES; ++i)
|
||||
{
|
||||
if (!resendingsavegame[i])
|
||||
continue;
|
||||
|
||||
resendingsavegame[i]++;
|
||||
|
||||
// Resending savegame took too long
|
||||
if (resendingsavegame[i] > (tic_t)TICRATE*cv_pingtimeout.value)
|
||||
{
|
||||
resendingsavegame[i] = 0;
|
||||
SendKick(i, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
boolean TryRunTics(tic_t realtics)
|
||||
{
|
||||
boolean ticking;
|
||||
|
||||
#ifdef SATURNPAK
|
||||
if (server)
|
||||
SV_UpdateResendGamestateTimeout();
|
||||
#endif
|
||||
|
||||
// the machine has lagged but it is not so bad
|
||||
if (realtics > TICRATE/7) // FIXME: consistency failure!!
|
||||
{
|
||||
|
||||
+142
-128
@@ -149,6 +149,8 @@ boolean dedicated = false;
|
||||
|
||||
boolean loaded_config = false; // true once config.cfg loaded AND executed
|
||||
|
||||
static void D_CleanFile(char **filearray);
|
||||
|
||||
//
|
||||
// D_PostEvent
|
||||
// Called by the I/O functions when input is detected
|
||||
@@ -197,10 +199,12 @@ static void D_PadMenuScrollInput(UINT8 input)
|
||||
// and pass it to the eventlist
|
||||
static void D_GamePadMenuScrollTicker(void)
|
||||
{
|
||||
UINT8 i;
|
||||
static UINT8 menuInputDelayTimer = 0;
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
if (dedicated)
|
||||
return;
|
||||
|
||||
for (UINT8 i = 0; i < 4; i++)
|
||||
{
|
||||
if (dpadscrollstate[i])
|
||||
{
|
||||
@@ -220,10 +224,10 @@ static void D_GamePadMenuScrollTicker(void)
|
||||
static void D_DeviceLEDTick(void)
|
||||
{
|
||||
UINT8 i;
|
||||
static UINT16 color[MAXSPLITSCREENPLAYERS] = {0};
|
||||
static UINT16 curcolor[MAXSPLITSCREENPLAYERS] = {0};
|
||||
static UINT16 color[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
|
||||
static UINT16 curcolor[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
|
||||
|
||||
if (numcontrollers == 0)
|
||||
if (dedicated || numcontrollers == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -250,6 +254,7 @@ static void D_DeviceLEDTick(void)
|
||||
void D_ProcessEvents(void)
|
||||
{
|
||||
event_t *ev;
|
||||
|
||||
boolean eaten;
|
||||
|
||||
for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1))
|
||||
@@ -288,10 +293,8 @@ void D_ProcessEvents(void)
|
||||
|
||||
// Demo input:
|
||||
if (demo.playback)
|
||||
{
|
||||
if (M_DemoResponder(ev))
|
||||
continue; // demo ate the event
|
||||
}
|
||||
|
||||
// console input
|
||||
#ifdef HAVE_THREADS
|
||||
@@ -316,88 +319,6 @@ void D_ProcessEvents(void)
|
||||
// draw current display, possibly wiping it from the previous
|
||||
//
|
||||
|
||||
static void D_Renderview(void)
|
||||
{
|
||||
UINT8 i;
|
||||
|
||||
if (automapactive)
|
||||
return;
|
||||
|
||||
R_ApplyLevelInterpolators(rendertimefrac);
|
||||
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
const boolean issplitscreen = (i > 0);
|
||||
|
||||
if (!P_MobjWasRemoved(players[displayplayers[i]].mo) || players[displayplayers[i]].playerstate == PST_DEAD)
|
||||
{
|
||||
viewssnum = i;
|
||||
|
||||
if (!issplitscreen) // Initialize for P1
|
||||
{
|
||||
viewwindowy = viewwindowx = 0;
|
||||
topleft = screens[0];
|
||||
objectsdrawn = 0;
|
||||
}
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
HWR_RenderPlayerView();
|
||||
R_RestoreLevelInterpolators();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (issplitscreen) // Splitscreen-specific
|
||||
{
|
||||
const INT32 len = viewheight*sizeof(ylookup[0]);
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
if (splitscreen > 1)
|
||||
{
|
||||
viewwindowx = viewwidth;
|
||||
viewwindowy = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewwindowx = 0;
|
||||
viewwindowy = viewheight;
|
||||
}
|
||||
M_Memcpy(ylookup, ylookup2, len);
|
||||
break;
|
||||
case 2:
|
||||
viewwindowx = 0;
|
||||
viewwindowy = viewheight;
|
||||
M_Memcpy(ylookup, ylookup3, len);
|
||||
break;
|
||||
case 3:
|
||||
viewwindowx = viewwidth;
|
||||
viewwindowy = viewheight;
|
||||
M_Memcpy(ylookup, ylookup4, len);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
topleft = screens[0] + viewwindowy*vid.width + viewwindowx;
|
||||
}
|
||||
|
||||
R_RenderPlayerView(&players[displayplayers[i]]);
|
||||
|
||||
if (issplitscreen)
|
||||
M_Memcpy(ylookup, ylookup1, viewheight*sizeof (ylookup[0]));
|
||||
}
|
||||
|
||||
if (!issplitscreen)
|
||||
R_ApplyViewMorph();
|
||||
|
||||
V_DoPostProcessor(i, postimgparam[i]);
|
||||
}
|
||||
|
||||
R_RestoreLevelInterpolators();
|
||||
}
|
||||
|
||||
// wipegamestate can be set to -1 to force a wipe on the next draw
|
||||
// added comment : there is a wipe eatch change of the gamestate
|
||||
gamestate_t wipegamestate = GS_LEVEL;
|
||||
@@ -408,6 +329,7 @@ static boolean D_Display(void)
|
||||
boolean forcerefresh = false;
|
||||
static boolean wipe = false;
|
||||
INT32 wipedefindex = 0;
|
||||
UINT8 i;
|
||||
|
||||
if (!dedicated)
|
||||
{
|
||||
@@ -446,7 +368,6 @@ static boolean D_Display(void)
|
||||
{
|
||||
// set for all later
|
||||
wipedefindex = gamestate; // wipe_xxx_toblack
|
||||
|
||||
if (gamestate == GS_TITLESCREEN && wipegamestate != GS_INTRO)
|
||||
wipedefindex = wipe_timeattack_toblack;
|
||||
else if (gamestate == GS_INTERMISSION)
|
||||
@@ -459,28 +380,26 @@ static boolean D_Display(void)
|
||||
|
||||
if (!dedicated)
|
||||
{
|
||||
if (gamestate != GS_LEVEL)
|
||||
// Fade to black first
|
||||
if (gamestate != GS_LEVEL // fades to black on its own timing, always
|
||||
&& wipedefs[wipedefindex] != UINT8_MAX)
|
||||
{
|
||||
// Fade to black first
|
||||
if (wipedefs[wipedefindex] != UINT8_MAX) // fades to black on its own timing, always
|
||||
{
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
||||
ranwipe = true;
|
||||
}
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
||||
ranwipe = true;
|
||||
}
|
||||
|
||||
if (rendermode != render_none)
|
||||
{
|
||||
V_SetPaletteLump("PLAYPAL"); // Reset the palette
|
||||
R_ReInitColormaps(0, LUMPERROR);
|
||||
}
|
||||
if (gamestate != GS_LEVEL && rendermode != render_none)
|
||||
{
|
||||
V_SetPaletteLump("PLAYPAL"); // Reset the palette
|
||||
R_ReInitColormaps(0, LUMPERROR);
|
||||
}
|
||||
|
||||
F_WipeStartScreen();
|
||||
}
|
||||
else // dedicated servers
|
||||
else //dedicated servers
|
||||
{
|
||||
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
||||
ranwipe = true;
|
||||
@@ -488,7 +407,7 @@ static boolean D_Display(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (dedicated) // bail out after wipe logic
|
||||
if (dedicated) //bail out after wipe logic
|
||||
return false;
|
||||
|
||||
// do buffered drawing
|
||||
@@ -513,6 +432,9 @@ static boolean D_Display(void)
|
||||
HU_Drawer();
|
||||
break;
|
||||
|
||||
case GS_TIMEATTACK:
|
||||
break;
|
||||
|
||||
case GS_INTRO:
|
||||
F_IntroDrawer();
|
||||
if (wipegamestate == (gamestate_t)-1)
|
||||
@@ -564,7 +486,6 @@ static boolean D_Display(void)
|
||||
HU_Erase();
|
||||
HU_Drawer();
|
||||
}
|
||||
case GS_TIMEATTACK:
|
||||
case GS_DEDICATEDSERVER:
|
||||
case GS_NULL:
|
||||
break;
|
||||
@@ -573,10 +494,89 @@ static boolean D_Display(void)
|
||||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
// draw the view directly
|
||||
if (cv_renderview.value)
|
||||
if (cv_renderview.value && !automapactive)
|
||||
{
|
||||
PS_START_TIMING(ps_rendercalltime);
|
||||
D_Renderview();
|
||||
|
||||
R_ApplyLevelInterpolators(rendertimefrac);
|
||||
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (!P_MobjWasRemoved(players[displayplayers[i]].mo) || players[displayplayers[i]].playerstate == PST_DEAD)
|
||||
{
|
||||
viewssnum = i;
|
||||
|
||||
if (i == 0) // Initialize for P1
|
||||
{
|
||||
viewwindowy = 0;
|
||||
viewwindowx = 0;
|
||||
|
||||
topleft = screens[0] + viewwindowy*vid.width + viewwindowx;
|
||||
objectsdrawn = 0;
|
||||
}
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
HWR_RenderPlayerView();
|
||||
else
|
||||
#endif
|
||||
if (rendermode != render_none)
|
||||
{
|
||||
if (i > 0) // Splitscreen-specific
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
if (splitscreen > 1)
|
||||
{
|
||||
viewwindowx = viewwidth;
|
||||
viewwindowy = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewwindowx = 0;
|
||||
viewwindowy = viewheight;
|
||||
}
|
||||
M_Memcpy(ylookup, ylookup2, viewheight*sizeof (ylookup[0]));
|
||||
break;
|
||||
case 2:
|
||||
viewwindowx = 0;
|
||||
viewwindowy = viewheight;
|
||||
M_Memcpy(ylookup, ylookup3, viewheight*sizeof (ylookup[0]));
|
||||
break;
|
||||
case 3:
|
||||
viewwindowx = viewwidth;
|
||||
viewwindowy = viewheight;
|
||||
M_Memcpy(ylookup, ylookup4, viewheight*sizeof (ylookup[0]));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
topleft = screens[0] + viewwindowy*vid.width + viewwindowx;
|
||||
}
|
||||
|
||||
R_RenderPlayerView(&players[displayplayers[i]]);
|
||||
|
||||
if (i > 0)
|
||||
M_Memcpy(ylookup, ylookup1, viewheight*sizeof (ylookup[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
if (!splitscreen)
|
||||
R_ApplyViewMorph();
|
||||
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
V_DoPostProcessor(i, postimgparam[i]);
|
||||
}
|
||||
}
|
||||
|
||||
R_RestoreLevelInterpolators();
|
||||
|
||||
PS_STOP_TIMING(ps_rendercalltime);
|
||||
}
|
||||
|
||||
@@ -586,7 +586,6 @@ static boolean D_Display(void)
|
||||
{
|
||||
VID_BlitLinearScreen(screens[0], screens[1], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes);
|
||||
}
|
||||
|
||||
lastdraw = false;
|
||||
}
|
||||
|
||||
@@ -609,8 +608,13 @@ static boolean D_Display(void)
|
||||
// draw pause pic
|
||||
if (paused && cv_showhud.value && !demo.playback)
|
||||
{
|
||||
INT32 py = (automapactive) ? 4 : (viewwindowy + 4);
|
||||
patch_t *patch = W_CachePatchName("M_PAUSE", PU_PATCH);
|
||||
INT32 py;
|
||||
patch_t *patch;
|
||||
if (automapactive)
|
||||
py = 4;
|
||||
else
|
||||
py = viewwindowy + 4;
|
||||
patch = W_CachePatchName("M_PAUSE", PU_PATCH);
|
||||
V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - patch->width)/2, py, V_SNAPTOTOP, patch);
|
||||
}
|
||||
|
||||
@@ -752,7 +756,7 @@ void D_SRB2Loop(void)
|
||||
|
||||
// Casting the return value of a function is bad practice (apparently)
|
||||
double budget = ((R_GetFramerateCap() == 0) ? 0.0 : round((1.0 / R_GetFramerateCap()) * I_GetPrecisePrecision()));
|
||||
capbudget = (precise_t)budget;
|
||||
capbudget = (precise_t) budget;
|
||||
|
||||
boolean ranwipe = false;
|
||||
|
||||
@@ -822,15 +826,12 @@ void D_SRB2Loop(void)
|
||||
doDisplay = true;
|
||||
}
|
||||
|
||||
if (!dedicated)
|
||||
if (menuactive)
|
||||
{
|
||||
if (menuactive)
|
||||
{
|
||||
D_GamePadMenuScrollTicker();
|
||||
}
|
||||
|
||||
D_DeviceLEDTick();
|
||||
D_GamePadMenuScrollTicker();
|
||||
}
|
||||
|
||||
D_DeviceLEDTick();
|
||||
}
|
||||
|
||||
if (interp)
|
||||
@@ -842,9 +843,7 @@ void D_SRB2Loop(void)
|
||||
ps_interp_frac.value.p = (precise_t)((FIXED_TO_FLOAT(g_time.timefrac)) * 1000.0f);
|
||||
ps_interp_lag.value.p = (precise_t)((deltasecs) * 1000.0f);
|
||||
|
||||
const boolean lagging = ((deltatics >= 1.0) || hu_stopped);
|
||||
|
||||
if (!(paused || P_AutoPause()) && !lagging)
|
||||
if (!(paused || P_AutoPause()) && deltatics < 1.0 && !hu_stopped)
|
||||
{
|
||||
rendertimefrac = g_time.timefrac;
|
||||
}
|
||||
@@ -853,7 +852,7 @@ void D_SRB2Loop(void)
|
||||
rendertimefrac = FRACUNIT;
|
||||
}
|
||||
|
||||
if (!lagging)
|
||||
if ((deltatics < 1.0) && !hu_stopped)
|
||||
{
|
||||
rendertimefrac_unpaused = g_time.timefrac;
|
||||
}
|
||||
@@ -869,9 +868,24 @@ void D_SRB2Loop(void)
|
||||
rendertimefrac_unpaused = FRACUNIT;
|
||||
}
|
||||
|
||||
if ((interp || doDisplay) && !frameskip)
|
||||
if (interp || doDisplay)
|
||||
{
|
||||
ranwipe = D_Display();
|
||||
if (!frameskip)
|
||||
{
|
||||
ranwipe = D_Display();
|
||||
}
|
||||
else if (!dedicated)
|
||||
{
|
||||
// always update console and hud
|
||||
// otherwise it may take minutes to open it
|
||||
CON_Drawer();
|
||||
|
||||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
ST_Drawer();
|
||||
HU_Drawer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Only take screenshots after drawing.
|
||||
@@ -1188,7 +1202,7 @@ void D_AddPostloadFiles(void)
|
||||
postautoloaded = true;
|
||||
}
|
||||
|
||||
void D_CleanFile(char **filearray)
|
||||
static void D_CleanFile(char **filearray)
|
||||
{
|
||||
size_t pnumwadfiles;
|
||||
for (pnumwadfiles = 0; filearray[pnumwadfiles]; pnumwadfiles++)
|
||||
|
||||
@@ -81,8 +81,6 @@ void D_PostEvent(const event_t *ev);
|
||||
|
||||
void D_ProcessEvents(void);
|
||||
|
||||
void D_CleanFile(char **filearray);
|
||||
|
||||
const char *D_Home(void);
|
||||
|
||||
//
|
||||
|
||||
@@ -1183,6 +1183,18 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
|
||||
if (cv_addons_option.value == 3 && *cv_addons_folder.string != '\0')
|
||||
{
|
||||
// next, check any custom directory if specified
|
||||
homecheck = filesearch(filename, cv_addons_folder.string, wantedmd5sum, completepath, 10);
|
||||
|
||||
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
|
||||
return FS_FOUND;
|
||||
else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
}
|
||||
|
||||
// finally check "." directory
|
||||
homecheck = filesearch(filename, ".", wantedmd5sum, completepath, 10);
|
||||
|
||||
|
||||
+2
-2
@@ -113,8 +113,8 @@ extern char logfilename[1024];
|
||||
#else
|
||||
#define VERSION 1 // Game version
|
||||
#define SUBVERSION 6 // more precise version number
|
||||
#define VERSIONSTRING "Saturn v8.2"
|
||||
#define VERSIONSTRINGW L"Saturn v8.2"
|
||||
#define VERSIONSTRING "Saturn v8.3"
|
||||
#define VERSIONSTRINGW L"Saturn v8.3"
|
||||
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
||||
// And change CMakeLists.txt (not src/, but in root), for CMake users!
|
||||
// AND appveyor.yml, for the build bots!
|
||||
|
||||
@@ -540,6 +540,8 @@ static const char *credits[] = {
|
||||
"\"Jin\"",
|
||||
"\"riomccloud\"",
|
||||
"\"chromaticpipe\"",
|
||||
"\"PAS\"",
|
||||
"\"$HOME\"",
|
||||
"\"Achii\"",
|
||||
"\"Anonimus\"",
|
||||
"\"scizor300\"",
|
||||
|
||||
+62
-56
@@ -124,7 +124,7 @@ boolean addedtogame;
|
||||
player_t players[MAXPLAYERS];
|
||||
|
||||
INT32 consoleplayer; // player taking events and displaying
|
||||
INT32 displayplayers[MAXSPLITSCREENPLAYERS]; // view being displayed
|
||||
INT32 displayplayers[MAXSPLITSCREENPLAYERS] = {0}; // view being displayed
|
||||
|
||||
tic_t gametic;
|
||||
tic_t levelstarttic; // gametic at level start
|
||||
@@ -751,47 +751,49 @@ INT32 JoyAxis(axis_input_e axissel, UINT8 player)
|
||||
INT32 axisval;
|
||||
boolean flp = false;
|
||||
|
||||
UINT8 pnum = player-1;
|
||||
|
||||
//find what axis to get
|
||||
switch (axissel)
|
||||
{
|
||||
case AXISTURN:
|
||||
axisval = cv_turnaxis[player-1].value;
|
||||
axisval = cv_turnaxis[pnum].value;
|
||||
break;
|
||||
case AXISMOVE:
|
||||
axisval = cv_moveaxis[player-1].value;
|
||||
axisval = cv_moveaxis[pnum].value;
|
||||
break;
|
||||
case AXISCAMTURN:
|
||||
axisval = cv_camturnaxis[player-1].value;
|
||||
axisval = cv_camturnaxis[pnum].value;
|
||||
break;
|
||||
case AXISCAMSTRAFE:
|
||||
axisval = cv_camstrafeaxis[player-1].value;
|
||||
axisval = cv_camstrafeaxis[pnum].value;
|
||||
break;
|
||||
case AXISBRAKE:
|
||||
axisval = cv_brakeaxis[player-1].value;
|
||||
axisval = cv_brakeaxis[pnum].value;
|
||||
break;
|
||||
case AXISAIM:
|
||||
axisval = cv_aimaxis[player-1].value;
|
||||
axisval = cv_aimaxis[pnum].value;
|
||||
break;
|
||||
case AXISLOOK:
|
||||
axisval = cv_lookaxis[player-1].value;
|
||||
axisval = cv_lookaxis[pnum].value;
|
||||
break;
|
||||
case AXISFIRE:
|
||||
axisval = cv_fireaxis[player-1].value;
|
||||
axisval = cv_fireaxis[pnum].value;
|
||||
break;
|
||||
case AXISDRIFT:
|
||||
axisval = cv_driftaxis[player-1].value;
|
||||
axisval = cv_driftaxis[pnum].value;
|
||||
break;
|
||||
case AXISLOOKBACK:
|
||||
axisval = cv_lookbackaxis[player-1].value;
|
||||
axisval = cv_lookbackaxis[pnum].value;
|
||||
break;
|
||||
case AXISCUSTOM1:
|
||||
axisval = cv_custom1axis[player-1].value;
|
||||
axisval = cv_custom1axis[pnum].value;
|
||||
break;
|
||||
case AXISCUSTOM2:
|
||||
axisval = cv_custom2axis[player-1].value;
|
||||
axisval = cv_custom2axis[pnum].value;
|
||||
break;
|
||||
case AXISCUSTOM3:
|
||||
axisval = cv_custom3axis[player-1].value;
|
||||
axisval = cv_custom3axis[pnum].value;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
@@ -802,44 +804,51 @@ INT32 JoyAxis(axis_input_e axissel, UINT8 player)
|
||||
axisval = -axisval;
|
||||
flp = true;
|
||||
}
|
||||
|
||||
if (axisval > JOYAXISSET*2 || axisval == 0) //not there in array or None
|
||||
return 0;
|
||||
|
||||
if (axisval%2)
|
||||
if (axisval % 2)
|
||||
{
|
||||
axisval /= 2;
|
||||
retaxis = joyxmove[axisval];
|
||||
retaxis = joyxmove[pnum][axisval];
|
||||
|
||||
if (retaxis < (-JOYAXISRANGE))
|
||||
retaxis = -JOYAXISRANGE;
|
||||
if (retaxis > (+JOYAXISRANGE))
|
||||
retaxis = +JOYAXISRANGE;
|
||||
if (!Joystick[player-1].bGamepadStyle && axissel < AXISDEAD)
|
||||
if (!Joystick[pnum].bGamepadStyle && axissel < AXISDEAD)
|
||||
{
|
||||
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_xdeadzone[player-1].value) >> FRACBITS;
|
||||
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_xdeadzone[pnum].value) >> FRACBITS;
|
||||
if (abs(retaxis) <= jdeadzone)
|
||||
return 0;
|
||||
}
|
||||
if (flp) retaxis = -retaxis; //flip it around
|
||||
|
||||
if (flp)
|
||||
retaxis = -retaxis; // flip it around
|
||||
|
||||
return retaxis;
|
||||
}
|
||||
else
|
||||
{
|
||||
axisval--;
|
||||
axisval /= 2;
|
||||
retaxis = joyymove[axisval];
|
||||
retaxis = joyymove[pnum][axisval];
|
||||
|
||||
if (retaxis < (-JOYAXISRANGE))
|
||||
retaxis = -JOYAXISRANGE;
|
||||
if (retaxis > (+JOYAXISRANGE))
|
||||
retaxis = +JOYAXISRANGE;
|
||||
if (!Joystick[player-1].bGamepadStyle && axissel < AXISDEAD)
|
||||
if (!Joystick[pnum].bGamepadStyle && axissel < AXISDEAD)
|
||||
{
|
||||
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_ydeadzone[player-1].value) >> FRACBITS;
|
||||
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_ydeadzone[pnum].value) >> FRACBITS;
|
||||
if (abs(retaxis) <= jdeadzone)
|
||||
return 0;
|
||||
}
|
||||
if (flp) retaxis = -retaxis; //flip it around
|
||||
|
||||
if (flp)
|
||||
retaxis = -retaxis; // flip it around
|
||||
|
||||
return retaxis;
|
||||
}
|
||||
}
|
||||
@@ -1286,15 +1295,9 @@ static void G_DoLoadLevel(boolean resetplayer)
|
||||
}
|
||||
|
||||
// clear cmd building stuff
|
||||
memset(gamekeydown, 0, sizeof (gamekeydown));
|
||||
|
||||
for (i = 0; i < JOYAXISSET; i++)
|
||||
{
|
||||
joyxmove[i] = joyymove[i] = 0;
|
||||
joy2xmove[i] = joy2ymove[i] = 0;
|
||||
joy3xmove[i] = joy3ymove[i] = 0;
|
||||
joy4xmove[i] = joy4ymove[i] = 0;
|
||||
}
|
||||
memset(gamekeydown, 0, sizeof(gamekeydown));
|
||||
memset(joyxmove, 0, sizeof(joyxmove));
|
||||
memset(joyymove, 0, sizeof(joyymove));
|
||||
mousex = mousey = 0;
|
||||
|
||||
// clear hud messages remains (usually from game startup)
|
||||
@@ -5464,33 +5467,36 @@ void G_GhostTicker(void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (type == MT_GHOST)
|
||||
if (type != -1)
|
||||
{
|
||||
mobj = P_SpawnGhostMobj(g->mo); // does a large portion of the work for us
|
||||
mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|tr_trans60<<FF_TRANSSHIFT; // P_SpawnGhostMobj sets trans50, we want trans60
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj = P_SpawnMobj(g->mo->x, g->mo->y, g->mo->z - FixedDiv(FixedMul(g->mo->info->height, g->mo->scale) - g->mo->height,3*FRACUNIT), MT_THOK);
|
||||
mobj->sprite = states[mobjinfo[type].spawnstate].sprite;
|
||||
mobj->frame = (states[mobjinfo[type].spawnstate].frame & FF_FRAMEMASK) | tr_trans60<<FF_TRANSSHIFT;
|
||||
mobj->tics = -1; // nope.
|
||||
mobj->color = g->mo->color;
|
||||
if (g->mo->eflags & MFE_VERTICALFLIP)
|
||||
if (type == MT_GHOST)
|
||||
{
|
||||
mobj->flags2 |= MF2_OBJECTFLIP;
|
||||
mobj->eflags |= MFE_VERTICALFLIP;
|
||||
mobj = P_SpawnGhostMobj(g->mo); // does a large portion of the work for us
|
||||
mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|tr_trans60<<FF_TRANSSHIFT; // P_SpawnGhostMobj sets trans50, we want trans60
|
||||
}
|
||||
P_SetScale(mobj, g->mo->scale);
|
||||
mobj->destscale = g->mo->scale;
|
||||
else
|
||||
{
|
||||
mobj = P_SpawnMobj(g->mo->x, g->mo->y, g->mo->z - FixedDiv(FixedMul(g->mo->info->height, g->mo->scale) - g->mo->height,3*FRACUNIT), MT_THOK);
|
||||
mobj->sprite = states[mobjinfo[type].spawnstate].sprite;
|
||||
mobj->frame = (states[mobjinfo[type].spawnstate].frame & FF_FRAMEMASK) | tr_trans60<<FF_TRANSSHIFT;
|
||||
mobj->tics = -1; // nope.
|
||||
mobj->color = g->mo->color;
|
||||
if (g->mo->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
mobj->flags2 |= MF2_OBJECTFLIP;
|
||||
mobj->eflags |= MFE_VERTICALFLIP;
|
||||
}
|
||||
P_SetScale(mobj, g->mo->scale);
|
||||
mobj->destscale = g->mo->scale;
|
||||
}
|
||||
mobj->floorz = mobj->z;
|
||||
mobj->ceilingz = mobj->z+mobj->height;
|
||||
P_UnsetThingPosition(mobj);
|
||||
mobj->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY; // make an ATTEMPT to curb crazy SOCs fucking stuff up...
|
||||
P_SetThingPosition(mobj);
|
||||
mobj->fuse = 8;
|
||||
P_SetTarget(&mobj->target, g->mo);
|
||||
}
|
||||
mobj->floorz = mobj->z;
|
||||
mobj->ceilingz = mobj->z+mobj->height;
|
||||
P_UnsetThingPosition(mobj);
|
||||
mobj->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY; // make an ATTEMPT to curb crazy SOCs fucking stuff up...
|
||||
P_SetThingPosition(mobj);
|
||||
mobj->fuse = 8;
|
||||
P_SetTarget(&mobj->target, g->mo);
|
||||
}
|
||||
if (ziptic & EZT_HIT)
|
||||
{ // Spawn hit poofs for killing things!
|
||||
@@ -8143,7 +8149,7 @@ void G_SaveDemo(void)
|
||||
size_t i, strindex = 0;
|
||||
boolean dash = true;
|
||||
|
||||
for (i = 0; i < 127 && demo.titlename[i]; i++)
|
||||
for (i = 0; demo.titlename[i] && i < 127; i++)
|
||||
{
|
||||
if ((demo.titlename[i] >= 'a' && demo.titlename[i] <= 'z') ||
|
||||
(demo.titlename[i] >= '0' && demo.titlename[i] <= '9'))
|
||||
|
||||
+10
-20
@@ -114,8 +114,7 @@ INT32 mousex, mousey;
|
||||
INT32 mlooky; // like mousey but with a custom sensitivity for mlook
|
||||
|
||||
// joystick values are repeated
|
||||
INT32 joyxmove[JOYAXISSET], joyymove[JOYAXISSET], joy2xmove[JOYAXISSET], joy2ymove[JOYAXISSET],
|
||||
joy3xmove[JOYAXISSET], joy3ymove[JOYAXISSET], joy4xmove[JOYAXISSET], joy4ymove[JOYAXISSET];
|
||||
INT32 joyxmove[MAXSPLITSCREENPLAYERS][JOYAXISSET], joyymove[MAXSPLITSCREENPLAYERS][JOYAXISSET];
|
||||
|
||||
// current state of the keys: true if pushed
|
||||
UINT8 gamekeydown[NUMINPUTS];
|
||||
@@ -187,32 +186,32 @@ void G_MapEventsToControls(event_t *ev)
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET || menuactive || CON_Ready() || chat_on)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[0][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[0][i] = ev->data3;
|
||||
break;
|
||||
|
||||
case ev_joystick2: // buttons are virtual keys
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET || menuactive)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joy2xmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joy2ymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[1][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[1][i] = ev->data3;
|
||||
break;
|
||||
|
||||
case ev_joystick3:
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joy3xmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joy3ymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[2][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[2][i] = ev->data3;
|
||||
break;
|
||||
|
||||
case ev_joystick4:
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joy4xmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joy4ymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[3][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[3][i] = ev->data3;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -258,15 +257,6 @@ void G_ResetControls(void)
|
||||
memset(joyxmove, 0, sizeof(joyxmove));
|
||||
memset(joyymove, 0, sizeof(joyymove));
|
||||
|
||||
memset(joy2xmove, 0, sizeof(joy2xmove));
|
||||
memset(joy2ymove, 0, sizeof(joy2ymove));
|
||||
|
||||
memset(joy3xmove, 0, sizeof(joy3xmove));
|
||||
memset(joy3ymove, 0, sizeof(joy3ymove));
|
||||
|
||||
memset(joy4xmove, 0, sizeof(joy4xmove));
|
||||
memset(joy4ymove, 0, sizeof(joy4ymove));
|
||||
|
||||
// reset those just in case the game missed the keyup event
|
||||
memset(dpadscrollstate, false, sizeof(dpadscrollstate));
|
||||
}
|
||||
@@ -1030,7 +1020,7 @@ INT32 G_KeyStringtoNum(const char *keystr)
|
||||
if (!keystr[0])
|
||||
return 0;
|
||||
|
||||
if (!keystr[0] || (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z'))
|
||||
if (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z')
|
||||
return keystr[0];
|
||||
|
||||
if (!strncmp(keystr, "KEY", 3) && keystr[3] >= '0' && keystr[3] <= '9')
|
||||
|
||||
+8
-5
@@ -41,10 +41,12 @@ typedef enum
|
||||
KEY_DBLJOY1 = KEY_DBLMOUSE1 + MOUSEBUTTONS,
|
||||
KEY_DBLHAT1 = KEY_DBLJOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_2JOY1 = KEY_DBLHAT1 + MOUSEBUTTONS,
|
||||
KEY_2MOUSE1 = KEY_DBLHAT1 + JOYHATS*4,
|
||||
KEY_2JOY1 = KEY_2MOUSE1 + MOUSEBUTTONS,
|
||||
KEY_2HAT1 = KEY_2JOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_DBL2JOY1 = KEY_2HAT1 + MOUSEBUTTONS,
|
||||
KEY_DBL2MOUSE1 = KEY_2HAT1 + JOYHATS*4,
|
||||
KEY_DBL2JOY1 = KEY_DBL2MOUSE1 + MOUSEBUTTONS,
|
||||
KEY_DBL2HAT1 = KEY_DBL2JOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_3JOY1 = KEY_DBL2HAT1 + JOYHATS*4,
|
||||
@@ -61,8 +63,10 @@ typedef enum
|
||||
|
||||
KEY_MOUSEWHEELUP = KEY_DBL4HAT1 + JOYHATS*4,
|
||||
KEY_MOUSEWHEELDOWN = KEY_MOUSEWHEELUP + 1,
|
||||
KEY_2MOUSEWHEELUP = KEY_MOUSEWHEELDOWN + 1,
|
||||
KEY_2MOUSEWHEELDOWN = KEY_2MOUSEWHEELUP + 1,
|
||||
|
||||
NUMINPUTS = KEY_MOUSEWHEELDOWN + 1,
|
||||
NUMINPUTS = KEY_2MOUSEWHEELDOWN + 1, // FIXME: all the mouse 2 stuff should be removed, but it screws up mappings somehow
|
||||
} key_input_e;
|
||||
|
||||
typedef enum
|
||||
@@ -113,8 +117,7 @@ extern consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS];
|
||||
extern INT32 mousex, mousey;
|
||||
extern INT32 mlooky; //mousey with mlookSensitivity
|
||||
|
||||
extern INT32 joyxmove[JOYAXISSET], joyymove[JOYAXISSET], joy2xmove[JOYAXISSET], joy2ymove[JOYAXISSET],
|
||||
joy3xmove[JOYAXISSET], joy3ymove[JOYAXISSET], joy4xmove[JOYAXISSET], joy4ymove[JOYAXISSET];
|
||||
extern INT32 joyxmove[MAXSPLITSCREENPLAYERS][JOYAXISSET], joyymove[MAXSPLITSCREENPLAYERS][JOYAXISSET];
|
||||
|
||||
// current state of the keys: true if pushed
|
||||
extern UINT8 gamekeydown[NUMINPUTS];
|
||||
|
||||
@@ -318,8 +318,6 @@ enum hwdsetspecialstate
|
||||
HWD_SET_TEXTUREFILTERMODE,
|
||||
HWD_SET_TEXTUREANISOTROPICMODE,
|
||||
|
||||
HWD_SET_WIREFRAME,
|
||||
|
||||
HWD_SET_MSAA,
|
||||
|
||||
HWD_SET_SCREEN_TEXTURES,
|
||||
|
||||
+23
-28
@@ -226,8 +226,6 @@ consvar_t cv_glsolvetjoin = {"gr_solvetjoin", "On", 0, CV_OnOff, NULL, 0, NULL,
|
||||
|
||||
consvar_t cv_glbatching = {"gr_batching", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_glwireframe = {"gr_wireframe", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_glrenderdistance = {"gr_renderdistance", "Max", CV_SAVE, glrenderdistance_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_glhorizonlines = {"gr_horizonlines", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -340,11 +338,6 @@ static void HWR_SetShaderState(void)
|
||||
GL_SetSpecialState(HWD_SET_SHADERS, HWR_UseShader() ? 1 : 0);
|
||||
}
|
||||
|
||||
static boolean HWR_IsWireframeMode(void)
|
||||
{
|
||||
return (cv_glwireframe.value /*&& cv_debug*/);
|
||||
}
|
||||
|
||||
static boolean HWR_OverrideObjectLightLevel(mobj_t *thing, INT32 *lightlevel)
|
||||
{
|
||||
if (R_ThingIsFullBright(thing))
|
||||
@@ -3714,6 +3707,9 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
||||
blend = HWR_GetBlendModeFlag(blendmode)|PF_Occlude;
|
||||
}
|
||||
|
||||
if (cv_playerfade.value && spr->mobj->player)
|
||||
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
shader = SHADER_SPRITE;
|
||||
@@ -4001,6 +3997,9 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||
blend = HWR_GetBlendModeFlag(blendmode)|PF_Occlude;
|
||||
}
|
||||
|
||||
if (cv_playerfade.value && spr->mobj->player)
|
||||
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
shader = SHADER_SPRITE;
|
||||
@@ -4234,6 +4233,7 @@ static void *HWR_CreateDrawNode(gl_drawnode_type_t type)
|
||||
Z_Realloc(drawnodes, alloceddrawnodes * sizeof(gl_drawnode_t), PU_LEVEL, &drawnodes);
|
||||
}
|
||||
|
||||
|
||||
drawnode = &drawnodes[numdrawnodes++];
|
||||
drawnode->type = type;
|
||||
|
||||
@@ -4464,7 +4464,10 @@ static void HWR_DrawModels(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||
if (!spr->mobj)
|
||||
continue;
|
||||
|
||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||
{
|
||||
md2_t *md2;
|
||||
|
||||
@@ -5265,9 +5268,6 @@ static void HWR_DrawSkyBackground(void)
|
||||
if (drewsky)
|
||||
return;
|
||||
|
||||
if (HWR_IsWireframeMode())
|
||||
return;
|
||||
|
||||
GL_SetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated);
|
||||
|
||||
memcpy(&dometransform, &atransform, sizeof(FTransform));
|
||||
@@ -5470,8 +5470,8 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, player_t *pl
|
||||
HWR_PortalClipping(rootportal);
|
||||
}
|
||||
|
||||
if (HWR_IsWireframeMode())
|
||||
GL_SetSpecialState(HWD_SET_WIREFRAME, 1);
|
||||
// Set transform.
|
||||
GL_SetTransform(&atransform);
|
||||
|
||||
ps_numbspcalls.value.i = 0;
|
||||
ps_numpolyobjects.value.i = 0;
|
||||
@@ -5536,9 +5536,6 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, player_t *pl
|
||||
ps_hw_nodedrawtime.value.p = 0;
|
||||
HWR_RenderDrawNodes();
|
||||
|
||||
if (HWR_IsWireframeMode())
|
||||
GL_SetSpecialState(HWD_SET_WIREFRAME, 0);
|
||||
|
||||
HWR_FreePortalList(portallist);
|
||||
}
|
||||
|
||||
@@ -5813,8 +5810,6 @@ void HWR_AddCommands(void)
|
||||
|
||||
CV_RegisterVar(&cv_glbatching);
|
||||
|
||||
CV_RegisterVar(&cv_glwireframe);
|
||||
|
||||
CV_RegisterVar(&cv_glrenderdistance);
|
||||
|
||||
CV_RegisterVar(&cv_glhorizonlines);
|
||||
@@ -5887,6 +5882,7 @@ static void COM_HWR_glinfo(void)
|
||||
CONS_Printf("Unrecognized argument: %s\n", argv);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CONS_Printf("\x88OpenGL %s\x80\n", gl_version);
|
||||
@@ -6006,19 +6002,19 @@ static void HWR_DoPostProcessor(player_t *player)
|
||||
if (cv_glscreentextures.value != 2) // screen textures are needed for the rest of the effects
|
||||
return;
|
||||
|
||||
//UINT8 viewnum = R_GetViewNumber(); // see below
|
||||
// Capture the screen for intermission and screen waving
|
||||
if (gamestate != GS_INTERMISSION)
|
||||
GL_MakeScreenTexture(HWD_SCREENTEXTURE_GENERIC1);
|
||||
|
||||
if (splitscreen) // Not supported in splitscreen - someone want to add support?
|
||||
return;
|
||||
|
||||
//UINT8 viewnum = R_GetViewNumber(); // see above
|
||||
//camera_t *thiscam = &camera[viewnum];
|
||||
camera_t *thiscam = &camera[0];
|
||||
|
||||
// Not supported in splitscreen - someone want to add support?
|
||||
const boolean screenwave = (!splitscreen && (thiscam->postimg & POSTIMG_WATER || thiscam->postimg & POSTIMG_HEAT));
|
||||
|
||||
// Capture the screen for intermission and screen waving
|
||||
if ((lastdraw || screenwave) && gamestate != GS_INTERMISSION)
|
||||
GL_MakeScreenTexture(HWD_SCREENTEXTURE_GENERIC1);
|
||||
|
||||
// Drunken vision! WooOOooo~
|
||||
if (screenwave)
|
||||
if (thiscam->postimg & POSTIMG_WATER || thiscam->postimg & POSTIMG_HEAT)
|
||||
{
|
||||
// 10 by 10 grid. 2 coordinates (xy)
|
||||
float v[SCREENVERTS][SCREENVERTS][2];
|
||||
@@ -6052,7 +6048,6 @@ static void HWR_DoPostProcessor(player_t *player)
|
||||
v[x][y][1] = (y/((float)(SCREENVERTS-1.0f)/9.0f))-4.5f;
|
||||
}
|
||||
}
|
||||
|
||||
GL_PostImgRedraw(v);
|
||||
|
||||
// Capture the screen again for screen waving on the intermission
|
||||
|
||||
@@ -202,8 +202,6 @@ extern consvar_t cv_glsolvetjoin;
|
||||
|
||||
extern consvar_t cv_glbatching;
|
||||
|
||||
extern consvar_t cv_glwireframe;
|
||||
|
||||
extern consvar_t cv_glrenderdistance;
|
||||
|
||||
extern consvar_t cv_glhorizonlines;
|
||||
|
||||
@@ -1227,6 +1227,9 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
Surf.PolyFlags = HWR_GetBlendModeFlag(blendmode);
|
||||
}
|
||||
|
||||
if (cv_playerfade.value && spr->mobj->player)
|
||||
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
|
||||
|
||||
// dont forget to enabled the depth test because we can't do this like
|
||||
// before: polygons models are not sorted
|
||||
|
||||
@@ -1241,7 +1244,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
else
|
||||
{
|
||||
md2s = md2_playermodels;
|
||||
skinnum = (skin_t *)spr->mobj->localskin - skins;
|
||||
skinnum = (skin_t *)spr->mobj->localskin - skins;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1266,6 +1269,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
|
||||
if (md2->error)
|
||||
return; // we already failed loading this before :(
|
||||
|
||||
if (!md2->model)
|
||||
{
|
||||
CONS_Debug(DBG_RENDER, "Loading model... (%s, %s)", sprnames[spr->mobj->sprite], md2->filename);
|
||||
@@ -1284,6 +1288,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Hurdler: arf, I don't like that implementation at all... too much crappy
|
||||
gpatch = md2->glpatch;
|
||||
if (gpatch)
|
||||
|
||||
@@ -350,8 +350,6 @@ typedef void (APIENTRY * PFNglDisable) (GLenum cap);
|
||||
static PFNglDisable pglDisable;
|
||||
typedef void (APIENTRY * PFNglGetFloatv) (GLenum pname, GLfloat *params);
|
||||
static PFNglGetFloatv pglGetFloatv;
|
||||
typedef void (APIENTRY * PFNglPolygonMode) (GLenum, GLenum);
|
||||
static PFNglPolygonMode pglPolygonMode;
|
||||
|
||||
/* Depth Buffer */
|
||||
typedef void (APIENTRY * PFNglClearDepth) (GLclampd depth);
|
||||
@@ -551,7 +549,6 @@ boolean SetupGLfunc(void)
|
||||
GETOPENGLFUNC(pglGetFloatv, glGetFloatv)
|
||||
GETOPENGLFUNC(pglGetIntegerv, glGetIntegerv)
|
||||
GETOPENGLFUNC(pglGetString, glGetString)
|
||||
GETOPENGLFUNC(pglPolygonMode, glPolygonMode)
|
||||
|
||||
GETOPENGLFUNC(pglClearDepth, glClearDepth)
|
||||
GETOPENGLFUNC(pglDepthFunc, glDepthFunc)
|
||||
@@ -2367,10 +2364,6 @@ void GL_SetSpecialState(hwdspecialstate_t IdState, INT32 Value)
|
||||
GL_Flush(); //??? if we want to change filter mode by texture, remove this
|
||||
break;
|
||||
|
||||
case HWD_SET_WIREFRAME:
|
||||
pglPolygonMode(GL_FRONT_AND_BACK, Value ? GL_LINE : GL_FILL);
|
||||
break;
|
||||
|
||||
case HWD_SET_TEXTURE_FORMAT:
|
||||
gltexformat = (Value == 32) ? GL_RGBA : GL_RGB5_A1;
|
||||
GL_Flush();
|
||||
|
||||
+4
-4
@@ -220,9 +220,9 @@ HMS_connect (const char *format, ...)
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
|
||||
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, (long)CURL_IPRESOLVE_V4);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, cv_masterserver_timeout.value);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)cv_masterserver_timeout.value);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HMS_on_read);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer);
|
||||
|
||||
@@ -339,8 +339,8 @@ HMS_unlist (void)
|
||||
if (! hms)
|
||||
return 0;
|
||||
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POST, 1);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDSIZE, 0);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POST, (long)1);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDSIZE, (long)0);
|
||||
|
||||
okay = HMS_do(hms);
|
||||
HMS_end(hms);
|
||||
|
||||
+8
-8
@@ -259,6 +259,8 @@ INT32 HU_FallBackFrSpecialLetter(INT32 key)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static char cechotext[1024];
|
||||
static tic_t cechotimer = 0;
|
||||
static tic_t cechoduration = 5*TICRATE;
|
||||
@@ -309,7 +311,7 @@ void HU_LoadGraphics(void)
|
||||
lt_font[0] = (patch_t *)W_CachePatchName("LTFNT039", PU_HUDGFX); /// \note fake start hack
|
||||
|
||||
// Number support
|
||||
lt_font[9] = (patch_t *)W_CachePatchName("LTFNT048", PU_HUDGFX);
|
||||
lt_font[9] = (patch_t *)W_CachePatchName("LTFNT048", PU_HUDGFX);
|
||||
lt_font[10] = (patch_t *)W_CachePatchName("LTFNT049", PU_HUDGFX);
|
||||
lt_font[11] = (patch_t *)W_CachePatchName("LTFNT050", PU_HUDGFX);
|
||||
lt_font[12] = (patch_t *)W_CachePatchName("LTFNT051", PU_HUDGFX);
|
||||
@@ -746,7 +748,7 @@ static void Command_CSay_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if(!server && !IsPlayerAdmin(consoleplayer))
|
||||
if (!server && !IsPlayerAdmin(consoleplayer))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Only servers and admins can use csay.\n"));
|
||||
return;
|
||||
@@ -2787,13 +2789,11 @@ void HU_DoCEcho(const char *msg)
|
||||
*p = '\n';
|
||||
|
||||
CONS_Printf("%s\n", temp);
|
||||
|
||||
return;
|
||||
}
|
||||
else if (cv_cechotoggle.value)
|
||||
cechotimer = cechoduration;
|
||||
|
||||
I_OutputMsg("%s\n", msg); // print to log
|
||||
|
||||
if (!cv_cechotoggle.value)
|
||||
return;
|
||||
|
||||
cechotimer = cechoduration;
|
||||
I_OutputMsg("%s\n", msg); // ALWAYS print to log
|
||||
}
|
||||
@@ -141,6 +141,8 @@ boolean I_UseNativeKeyboard(void);
|
||||
|
||||
boolean I_CheckNativeRes(void);
|
||||
|
||||
void I_SetBorderlessWindow(void);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
|
||||
void RefreshOGLSDLSurface(void);
|
||||
|
||||
+3
-2
@@ -10525,11 +10525,12 @@ static void K_drawKartWanted(void)
|
||||
{
|
||||
INT32 x = basex+(splitscreen > 1 ? 13 : 8), y = basey+(splitscreen > 1 ? 16 : 21);
|
||||
fixed_t scale = FRACUNIT/2;
|
||||
player_t *p = &players[battlewanted[i]];
|
||||
|
||||
if (battlewanted[i] == -1)
|
||||
break;
|
||||
|
||||
player_t *p = &players[battlewanted[i]];
|
||||
|
||||
if (numwanted == 1)
|
||||
scale = FRACUNIT;
|
||||
else
|
||||
@@ -10540,7 +10541,7 @@ static void K_drawKartWanted(void)
|
||||
y += 16;
|
||||
}
|
||||
|
||||
if (players[battlewanted[i]].skincolor)
|
||||
if (p->skincolor)
|
||||
{
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, p->skincolor, GTC_CACHE);
|
||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, V_HUDTRANS|(splitscreen < 3 ? V_SNAPTORIGHT : 0)|V_SNAPTOBOTTOM, (scale == FRACUNIT ? R_GetSkinFaceWant(p) : R_GetSkinFaceRank(p)), colormap);
|
||||
|
||||
+16
-4
@@ -1260,10 +1260,15 @@ extern int lib_hudadd(lua_State *L);
|
||||
|
||||
static int lib_hudsetvotebackground(lua_State *L)
|
||||
{
|
||||
memset(VoteScreen.luaPrefix, 0, sizeof(VoteScreen.luaPrefix));
|
||||
|
||||
if (lua_isnoneornil(L, 1))
|
||||
{
|
||||
if (luaVoteScreen)
|
||||
{
|
||||
free(luaVoteScreen);
|
||||
}
|
||||
|
||||
luaVoteScreen = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1274,8 +1279,15 @@ static int lib_hudsetvotebackground(lua_State *L)
|
||||
return luaL_argerror(L, 1, "prefix should 4 characters wide");
|
||||
}
|
||||
|
||||
strncpy(VoteScreen.luaPrefix, prefix, 4);
|
||||
strupr(VoteScreen.luaPrefix);
|
||||
if (!luaVoteScreen)
|
||||
{
|
||||
luaVoteScreen = (char*)malloc(5);
|
||||
luaVoteScreen[4] = 0;
|
||||
}
|
||||
|
||||
strncpy(luaVoteScreen, prefix, 4);
|
||||
|
||||
strupr(luaVoteScreen);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+43
-28
@@ -1521,6 +1521,7 @@ enum
|
||||
//op_exp_dirlight,
|
||||
op_exp_skybox,
|
||||
op_exp_accuratefps,
|
||||
op_exp_votescrn,
|
||||
#ifdef HWRENDER
|
||||
op_exp_glscrtx,
|
||||
#ifdef USE_FBO_OGL
|
||||
@@ -2464,32 +2465,38 @@ static menuitem_t OP_HudOffsetMenu[] =
|
||||
{IT_STRING | IT_CVAR, NULL, "Vertical Offset", &cv_stat_yoffset, 185},
|
||||
};
|
||||
|
||||
// FIXME: WE EFFECTIVELY HAVE NO MORE SPACE FOR GREEN RES
|
||||
// i had to put multiple names into single lines at this point
|
||||
// we ought to really do something better for this at this point
|
||||
// absolutely crazy how many people put work into this at this point <3
|
||||
static menuitem_t OP_SaturnCreditsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "Saturn Credits", NULL, 0},
|
||||
{IT_HEADER, NULL, "Thanks to all contributers <3", NULL, 0},
|
||||
|
||||
{IT_HEADER, NULL, "Thanks to all contributers <3", NULL, 7},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Alug", NULL, 10},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Indev", NULL, 20},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Haya", NULL, 30},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Nepdisk", NULL, 40},
|
||||
{IT_STRING2+IT_SPACE, NULL, "GenericHeroGuy", NULL, 50},
|
||||
{IT_STRING2+IT_SPACE, NULL, "xyzzy", NULL, 60},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Chearii", NULL, 70},
|
||||
{IT_STRING2+IT_SPACE, NULL, "riomccloud", NULL, 80},
|
||||
{IT_STRING2+IT_SPACE, NULL, "chromaticpipe", NULL, 90},
|
||||
{IT_STRING2+IT_SPACE, NULL, "PAS", NULL, 100},
|
||||
{IT_STRING2+IT_SPACE, NULL, "$HOME", NULL, 110},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Achii", NULL, 120},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Anonimus", NULL, 130},
|
||||
{IT_STRING2+IT_SPACE, NULL, "scizor300", NULL, 140},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Lugent", NULL, 150},
|
||||
|
||||
{IT_STRING2+IT_SPACE, NULL, "Alug", NULL, 17},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Indev", NULL, 27},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Haya", NULL, 37},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Nepdisk", NULL, 47},
|
||||
{IT_STRING2+IT_SPACE, NULL, "GenericHeroGuy", NULL, 57},
|
||||
{IT_STRING2+IT_SPACE, NULL, "xyzzy", NULL, 67},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Chearii", NULL, 77},
|
||||
{IT_HEADER, NULL, "", NULL, 124},
|
||||
|
||||
{IT_STRING2+IT_SPACE, NULL, "Sunflower aka AnimeSonic", NULL, 87},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Yuz aka Yuzler", NULL, 97},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Democrab", NULL, 107},
|
||||
{IT_STRING2+IT_SPACE, NULL, "EXpand", NULL, 117},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Nexit", NULL, 127},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Spee", NULL, 137},
|
||||
{IT_STRING2+IT_SPACE, NULL, "jin", NULL, 147},
|
||||
{IT_STRING2+IT_SPACE, NULL, "riomccloud", NULL, 157},
|
||||
{IT_STRING2+IT_SPACE, NULL, "chromaticpipe", NULL, 167},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Achii", NULL, 177},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Anonimus", NULL, 187},
|
||||
{IT_STRING2+IT_SPACE, NULL, "scizor300", NULL, 197},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Sunflower Yuz", NULL, 180},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Democrab EXpand", NULL, 190},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Nexit Spee", NULL, 200},
|
||||
{IT_STRING2+IT_SPACE, NULL, "jin", NULL, 210},
|
||||
|
||||
{IT_HEADER, NULL, "Special Thanks <3", NULL, 168},
|
||||
|
||||
{IT_HEADER, NULL, "Special Thanks <3", NULL, 167},
|
||||
|
||||
@@ -2501,7 +2508,7 @@ static menuitem_t OP_SaturnCreditsMenu[] =
|
||||
{IT_STRING, NULL, "", NULL, 267}, // dummy text II
|
||||
};
|
||||
|
||||
// sry we dont have space for this anymore :/
|
||||
// sry we dont have space for this anymore :c
|
||||
/*static const char* OP_CreditTooltips[] =
|
||||
{
|
||||
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||
@@ -3600,8 +3607,8 @@ static void M_ChangeCvar(INT32 choice)
|
||||
char s[20];
|
||||
float increment;
|
||||
|
||||
increment = (currentMenu->menuitems[itemOn].status & IT_CV_BIGFLOAT) ? 0.5f : (1.0f/16.0f);
|
||||
sprintf(s, "%f",FIXED_TO_FLOAT(cv->value)+(choice)*increment);
|
||||
increment = FIXED_TO_FLOAT(cv->value)+(choice)*((currentMenu->menuitems[itemOn].status & IT_CV_BIGFLOAT) ? 0.5f : (1.0f/16.0f));
|
||||
sprintf(s,"%ld%s",(long)increment,M_Ftrim(increment));
|
||||
CV_Set(cv, s);
|
||||
}
|
||||
else
|
||||
@@ -5716,8 +5723,16 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
|
||||
{
|
||||
case LLM_CREATESERVER:
|
||||
// Should the map be hidden? <-- well imma wanna toggle it, its just annoying being unable to select hell maps in mapselect
|
||||
if ((mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU && mapnum+1 != gamemap) && (gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE))) // map hell
|
||||
return cv_showallmaps.value;
|
||||
|
||||
if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU && mapnum+1 != gamemap)
|
||||
{
|
||||
if (cv_showallmaps.value &&
|
||||
((gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE)) || // race map hell
|
||||
((gt == GT_MATCH || gt == GT_TEAMMATCH) && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH)))) // battle map hell
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
// same goes here, just show every map if i want to
|
||||
if (M_MapLocked(mapnum+1)) // not unlocked
|
||||
@@ -6059,8 +6074,8 @@ static void M_AddonsOptions(INT32 choice)
|
||||
M_SetupNextMenu(&OP_AddonsOptionsDef);
|
||||
}
|
||||
|
||||
#define LOCATIONSTRING1 "Visit \x83SRB2.ORG/MODS\x80 to get & make addons!"
|
||||
#define LOCATIONSTRING2 "Visit \x88SRB2.ORG/MODS\x80 to get & make addons!"
|
||||
#define LOCATIONSTRING1 "Visit \x83mb.srb2.org/addons\x80 to get & make addons!"
|
||||
#define LOCATIONSTRING2 "Visit \x88mb.srb2.org/addons\x80 to get & make addons!"
|
||||
|
||||
static void M_AddonsInternal(void)
|
||||
{
|
||||
|
||||
@@ -1965,6 +1965,25 @@ char *M_GetToken(const char *inputString)
|
||||
return texturesToken;
|
||||
}
|
||||
|
||||
|
||||
const char * M_Ftrim (double f)
|
||||
{
|
||||
static char dig[9];/* "0." + 6 digits (6 is printf's default) */
|
||||
int i;
|
||||
/* I know I said it's the default, but just in case... */
|
||||
sprintf(dig, "%.6f", fabs(modf(f, &f)));
|
||||
/* trim trailing zeroes */
|
||||
for (i = strlen(dig)-1; dig[i] == '0'; --i)
|
||||
;
|
||||
if (dig[i] == '.')/* :NOTHING: */
|
||||
return "";
|
||||
else
|
||||
{
|
||||
dig[i + 1] = '\0';
|
||||
return &dig[1];/* skip the 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/** Count bits in a number.
|
||||
*/
|
||||
UINT8 M_CountBits(UINT32 num, UINT8 size)
|
||||
|
||||
@@ -104,6 +104,12 @@ boolean M_IsPathAbsolute (const char *path);
|
||||
void M_MkdirEach (const char *path, int start, int mode);
|
||||
void M_MkdirEachUntil (const char *path, int start, int end, int mode);
|
||||
|
||||
/*
|
||||
Return dot and then the fractional part of a float, without
|
||||
trailing zeros, or "" if the fractional part is zero.
|
||||
*/
|
||||
const char * M_Ftrim (double);
|
||||
|
||||
// counting bits, for weapon ammo code, usually
|
||||
FUNCMATH UINT8 M_CountBits(UINT32 num, UINT8 size);
|
||||
|
||||
|
||||
@@ -26,6 +26,12 @@
|
||||
|
||||
#if defined (STDC_HEADERS) || defined (_LIBC)
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#ifndef HAVE_MEMCPY
|
||||
#if !(defined (_WIN32) && !defined (__CYGWIN__)) && !defined (__APPLE__)
|
||||
#define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "md5.h"
|
||||
|
||||
+3
-1
@@ -1542,15 +1542,17 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
{
|
||||
if (target->target->hnext)
|
||||
K_KillBananaChain(target->target->hnext, inflictor, source);
|
||||
|
||||
target->target->player->kartstuff[k_itemamount] = 0;
|
||||
}
|
||||
else if (target->target->player->kartstuff[k_itemamount])
|
||||
else
|
||||
target->target->player->kartstuff[k_itemamount]--;
|
||||
}
|
||||
else if ((target->type == MT_ORBINAUT_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) // orbit items
|
||||
|| (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ))
|
||||
{
|
||||
target->target->player->kartstuff[k_itemamount]--;
|
||||
|
||||
if (target->lastlook != 0)
|
||||
{
|
||||
K_RepairOrbitChain(target);
|
||||
|
||||
@@ -158,6 +158,8 @@ extern consvar_t cv_tiltsmoothing;
|
||||
|
||||
extern consvar_t cv_actionmovie;
|
||||
|
||||
extern consvar_t cv_screenquake;
|
||||
|
||||
extern consvar_t cv_lookbackmom[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern consvar_t cv_verticallook[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
+109
-143
@@ -67,8 +67,6 @@
|
||||
#include "lua_script.h"
|
||||
#include "lua_hook.h"
|
||||
|
||||
#include "y_inter.h"
|
||||
|
||||
#if !defined (UNDER_CE)
|
||||
#include <time.h>
|
||||
#endif
|
||||
@@ -2749,8 +2747,6 @@ static void P_SetupPlayer(void)
|
||||
I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755);
|
||||
I_mkdir(va("%s"PATHSEP"replay"PATHSEP"online", srb2home), 0755);
|
||||
G_RecordDemo(buf);
|
||||
if (dedicated)
|
||||
G_BeginRecording(); //this has to move here, since dedicated servers dont run got_mapcmd
|
||||
}
|
||||
|
||||
wantedcalcdelay = wantedfrequency*2;
|
||||
@@ -3108,128 +3104,11 @@ boolean P_AddWadFile(const char *wadfilename, boolean local)
|
||||
return true;
|
||||
}
|
||||
|
||||
static size_t sreplaces = 0, mreplaces = 0, digmreplaces = 0;
|
||||
|
||||
//
|
||||
// search for sound replacements
|
||||
//
|
||||
static boolean P_CheckSoundReplacements(UINT16 wadnum, char *name, size_t i)
|
||||
{
|
||||
size_t j;
|
||||
lumpnum_t lumpnum = (i|(wadnum<<16));
|
||||
|
||||
if (name[0] == 'D')
|
||||
{
|
||||
if (name[1] == 'S')
|
||||
{
|
||||
for (j = 1; j < NUMSFX; j++)
|
||||
{
|
||||
if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6)
|
||||
&& (S_sfx[j].lumpnum != lumpnum) && (S_sfx[j].lumpnum != LUMPERROR))
|
||||
{
|
||||
// the sound will be reloaded when needed,
|
||||
// since sfx->data will be NULL
|
||||
CONS_Debug(DBG_SETUP, "Sound %.8s replaced\n", name);
|
||||
|
||||
I_FreeSfx(&S_sfx[j]);
|
||||
|
||||
// Re-cache it
|
||||
if (S_PrecacheSound())
|
||||
S_sfx[j].data = I_GetSfx(&S_sfx[j]);
|
||||
|
||||
sreplaces++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (name[1] == '_')
|
||||
{
|
||||
CONS_Debug(DBG_SETUP, "Music %.8s ignored\n", name);
|
||||
mreplaces++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (name[0] == 'O' && name[1] == '_')
|
||||
{
|
||||
CONS_Debug(DBG_SETUP, "Music %.8s replaced\n", name);
|
||||
digmreplaces++;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// search for maps
|
||||
//
|
||||
static boolean P_CheckMapReplacements(char *name)
|
||||
{
|
||||
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
||||
{
|
||||
INT16 num;
|
||||
|
||||
if (name[5] != '\0')
|
||||
return false;
|
||||
|
||||
num = (INT16)M_MapNumber(name[3], name[4]);
|
||||
|
||||
// we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant
|
||||
if (num <= NUMMAPS && mapheaderinfo[num-1])
|
||||
{
|
||||
if (mapheaderinfo[num-1]->menuflags & LF2_EXISTSHACK)
|
||||
G_SetGameModified(multiplayer, true); // oops, double-defined - no record attack privileges for you
|
||||
mapheaderinfo[num-1]->menuflags |= LF2_EXISTSHACK;
|
||||
}
|
||||
|
||||
if (num == gamemap)
|
||||
partadd_replacescurrentmap = true;
|
||||
|
||||
CONS_Printf("%s\n", name);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// check for non Lua votescreen replacements
|
||||
//
|
||||
static boolean P_CheckVoteReplacements(char *name)
|
||||
{
|
||||
// widescreen patch Race
|
||||
if (!VoteScreen.replaced.widerace && !memcmp(name, "INTERSCW", 8))
|
||||
{
|
||||
VoteScreen.replaced.widerace = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!VoteScreen.replaced.race && !memcmp(name, "INTERSCR", 8))
|
||||
{
|
||||
VoteScreen.replaced.race = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// widescreen patch Battle
|
||||
if (!VoteScreen.replaced.widebattle && !memcmp(name, "BATTLSCW", 8))
|
||||
{
|
||||
VoteScreen.replaced.widebattle = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!VoteScreen.replaced.battle && !memcmp(name, "BATTLSCR", 8))
|
||||
{
|
||||
VoteScreen.replaced.battle = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (VoteScreen.replaced.widerace && VoteScreen.replaced.race
|
||||
&& VoteScreen.replaced.widebattle && VoteScreen.replaced.battle)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
// check for replacement votescreen backgrounds
|
||||
boolean wideracereplaced = false;
|
||||
boolean racereplaced = false;
|
||||
boolean widebattlereplaced = false;
|
||||
boolean battlereplaced = false;
|
||||
|
||||
//
|
||||
// Add a WAD file and do the per-WAD setup stages.
|
||||
@@ -3237,15 +3116,12 @@ static boolean P_CheckVoteReplacements(char *name)
|
||||
//
|
||||
UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
||||
{
|
||||
size_t i;
|
||||
size_t i, j, sreplaces = 0, mreplaces = 0, digmreplaces = 0;
|
||||
UINT16 numlumps, wadnum;
|
||||
char *name;
|
||||
boolean mapsadded = false;
|
||||
static boolean allvotereplaced = false;
|
||||
lumpinfo_t *lumpinfo;
|
||||
|
||||
sreplaces = mreplaces = digmreplaces = 0;
|
||||
|
||||
if ((numlumps = W_InitFile(wadfilename, local)) == INT16_MAX)
|
||||
{
|
||||
refreshdirmenu |= REFRESHDIR_NOTLOADED;
|
||||
@@ -3260,24 +3136,46 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
||||
|
||||
wadfiles[wadnum]->localfile = local;
|
||||
|
||||
//
|
||||
// search for sound replacements
|
||||
//
|
||||
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
||||
for (i = 0; i < numlumps; i++, lumpinfo++)
|
||||
{
|
||||
name = lumpinfo->name;
|
||||
lumpnum_t lumpnum = i|(wadnum<<16);
|
||||
|
||||
if (P_CheckSoundReplacements(wadnum, name, i))
|
||||
continue;
|
||||
|
||||
if (P_CheckMapReplacements(name))
|
||||
if (name[0] == 'D')
|
||||
{
|
||||
mapsadded = true;
|
||||
continue;
|
||||
if (name[1] == 'S') for (j = 1; j < NUMSFX; j++)
|
||||
{
|
||||
if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6) && S_sfx[j].lumpnum != lumpnum && S_sfx[j].lumpnum != LUMPERROR)
|
||||
{
|
||||
// the sound will be reloaded when needed,
|
||||
// since sfx->data will be NULL
|
||||
CONS_Debug(DBG_SETUP, "Sound %.8s replaced\n", name);
|
||||
|
||||
I_FreeSfx(&S_sfx[j]);
|
||||
|
||||
// Re-cache it
|
||||
if (S_PrecacheSound())
|
||||
S_sfx[j].data = I_GetSfx(&S_sfx[j]);
|
||||
|
||||
sreplaces++;
|
||||
}
|
||||
}
|
||||
else if (name[1] == '_')
|
||||
{
|
||||
CONS_Debug(DBG_SETUP, "Music %.8s ignored\n", name);
|
||||
mreplaces++;
|
||||
}
|
||||
}
|
||||
else if (name[0] == 'O' && name[1] == '_')
|
||||
{
|
||||
CONS_Debug(DBG_SETUP, "Music %.8s replaced\n", name);
|
||||
digmreplaces++;
|
||||
}
|
||||
|
||||
if (!allvotereplaced && P_CheckVoteReplacements(name))
|
||||
allvotereplaced = true;
|
||||
}
|
||||
|
||||
if (!devparm && sreplaces)
|
||||
CONS_Printf(M_GetText("%s sounds replaced\n"), sizeu1(sreplaces));
|
||||
if (!devparm && mreplaces)
|
||||
@@ -3285,9 +3183,6 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
||||
if (!devparm && digmreplaces)
|
||||
CONS_Printf(M_GetText("%s digital musics replaced\n"), sizeu1(digmreplaces));
|
||||
|
||||
if (!mapsadded)
|
||||
CONS_Printf(M_GetText("No maps added\n"));
|
||||
|
||||
//
|
||||
// search for sprite replacements
|
||||
//
|
||||
@@ -3312,9 +3207,80 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
||||
//
|
||||
S_LoadMusicDefs(wadnum);
|
||||
|
||||
//
|
||||
// search for maps
|
||||
//
|
||||
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
||||
for (i = 0; i < numlumps; i++, lumpinfo++)
|
||||
{
|
||||
name = lumpinfo->name;
|
||||
|
||||
if (name[0] == 'M' && name[1] == 'A' && name[2] == 'P') // Ignore the headers
|
||||
{
|
||||
INT16 num;
|
||||
if (name[5]!='\0')
|
||||
continue;
|
||||
num = (INT16)M_MapNumber(name[3], name[4]);
|
||||
|
||||
// we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant
|
||||
if (num <= NUMMAPS && mapheaderinfo[num-1])
|
||||
{
|
||||
if (mapheaderinfo[num-1]->menuflags & LF2_EXISTSHACK)
|
||||
G_SetGameModified(multiplayer, true); // oops, double-defined - no record attack privileges for you
|
||||
mapheaderinfo[num-1]->menuflags |= LF2_EXISTSHACK;
|
||||
}
|
||||
|
||||
if (num == gamemap)
|
||||
partadd_replacescurrentmap = true;
|
||||
|
||||
CONS_Printf("%s\n", name);
|
||||
mapsadded = true;
|
||||
}
|
||||
}
|
||||
if (!mapsadded)
|
||||
CONS_Printf(M_GetText("No maps added\n"));
|
||||
|
||||
// TODO: Experimental SPRTINFO support, test first
|
||||
R_LoadSpriteInfoLumps(wadnum, wadfiles[wadnum]->numlumps);
|
||||
|
||||
//
|
||||
// check for votescreen replacements
|
||||
//
|
||||
if (!wideracereplaced && !racereplaced && !widebattlereplaced && !battlereplaced)
|
||||
{
|
||||
lumpinfo = wadfiles[wadnum]->lumpinfo;
|
||||
for (i = 0; i < numlumps; i++, lumpinfo++)
|
||||
{
|
||||
name = lumpinfo->name;
|
||||
|
||||
// widescreen patch Race
|
||||
if (!wideracereplaced && !strncmp(name, "INTERSCW", 8))
|
||||
{
|
||||
wideracereplaced = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!racereplaced && !strncmp(name, "INTERSCR", 8))
|
||||
{
|
||||
racereplaced = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
// widescreen patch Battle
|
||||
if (!widebattlereplaced && !strncmp(name, "BATTLSCW", 8))
|
||||
{
|
||||
widebattlereplaced = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!battlereplaced && !strncmp(name, "BATTLSCR", 8))
|
||||
{
|
||||
battlereplaced = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
refreshdirmenu &= ~REFRESHDIR_GAMEDATA; // Under usual circumstances we'd wait for REFRESHDIR_GAMEDATA to disappear the next frame, but it's a bit too dangerous for that...
|
||||
partadd_stage = 0;
|
||||
return wadnum;
|
||||
|
||||
@@ -68,6 +68,11 @@ void HWR_LoadLevel(boolean reloadinggamestate);
|
||||
|
||||
boolean P_AddWadFile(const char *wadfilename, boolean local);
|
||||
|
||||
extern boolean wideracereplaced;
|
||||
extern boolean racereplaced;
|
||||
extern boolean widebattlereplaced;
|
||||
extern boolean battlereplaced;
|
||||
|
||||
// WARNING: The following functions should be grouped as follows:
|
||||
// any amount of PartialAdds followed by MultiSetups until returned true,
|
||||
// as soon as possible.
|
||||
|
||||
+4
-3
@@ -573,7 +573,7 @@ static void P_RunQuakes(void)
|
||||
{
|
||||
fixed_t ir;
|
||||
|
||||
if (quake.time <= 0)
|
||||
if (!cv_screenquake.value || quake.time <= 0)
|
||||
{
|
||||
quake.x = quake.y = quake.z = quake.roll = 0;
|
||||
return;
|
||||
@@ -618,8 +618,8 @@ static inline void P_ResetSpriteStuff(void)
|
||||
if (!mo || (mo->sprite == SPR_NULL) || (mo->flags2 & MF2_DONTDRAW) || (mo->type == MT_SHADOW))
|
||||
continue;
|
||||
|
||||
mo->spritexscale = mo->realxscale;
|
||||
mo->spriteyscale = mo->realyscale;
|
||||
mo->spritexscale = mo->realxscale;
|
||||
mo->spriteyscale = mo->realyscale;
|
||||
mo->spritexoffset = mo->realxoffset;
|
||||
mo->spriteyoffset = mo->realyoffset;
|
||||
}
|
||||
@@ -654,6 +654,7 @@ void P_Ticker(boolean run)
|
||||
{
|
||||
P_MapStart();
|
||||
R_UpdateMobjInterpolators();
|
||||
R_UpdateLevelInterpolators();
|
||||
OP_ObjectplaceMovement(&players[0]);
|
||||
P_MoveChaseCamera(&players[0], &camera[0], false);
|
||||
R_UpdateViewInterpolation();
|
||||
|
||||
@@ -3044,6 +3044,8 @@ consvar_t cv_tiltsmoothing = {"tiltsmoothing", "32", CV_SAVE, CV_Natural, NULL,
|
||||
|
||||
consvar_t cv_actionmovie = {"actionmovie", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_screenquake = {"quakescreenshake", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t lookbackmom_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Double"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_lookbackmom[MAXSPLITSCREENPLAYERS] = {
|
||||
|
||||
+5
-5
@@ -264,12 +264,12 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
|
||||
mobj_t *pviewmobj = viewplayer->mo;
|
||||
INT32 heightsec;
|
||||
boolean underwater;
|
||||
UINT8 i = R_GetViewNumber();
|
||||
camera_t *thiscam = &camera[R_GetViewNumber()];
|
||||
|
||||
if (viewplayer == &players[displayplayers[i]] && camera[i].chase)
|
||||
heightsec = R_PointInSubsector(camera[i].x, camera[i].y)->sector->heightsec;
|
||||
else if (i > splitscreen && viewmobj)
|
||||
heightsec = R_PointInSubsector(pviewmobj->x, pviewmobj->y)->sector->heightsec;
|
||||
if (thiscam->chase)
|
||||
heightsec = thiscam->subsector->sector->heightsec;
|
||||
else if (viewmobj)
|
||||
heightsec = pviewmobj->subsector->sector->heightsec;
|
||||
else
|
||||
return sec;
|
||||
|
||||
|
||||
+16
-5
@@ -690,12 +690,15 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||
|
||||
// Patch identifier
|
||||
texturesToken = M_GetToken(NULL);
|
||||
|
||||
if (texturesToken == NULL)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch name should be");
|
||||
}
|
||||
|
||||
texturesTokenLength = strlen(texturesToken);
|
||||
if (texturesTokenLength>8)
|
||||
|
||||
if (texturesTokenLength > 8)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Patch name \"%s\" exceeds 8 characters",texturesToken);
|
||||
}
|
||||
@@ -713,10 +716,12 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||
// Comma 1
|
||||
Z_Free(texturesToken);
|
||||
texturesToken = M_GetToken(NULL);
|
||||
|
||||
if (texturesToken == NULL)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Unexpected end of file where comma after \"%s\"'s patch name should be",patchName);
|
||||
}
|
||||
|
||||
if (strcmp(texturesToken,",")!=0)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Expected \",\" after %s's patch name, got \"%s\"",patchName,texturesToken);
|
||||
@@ -725,14 +730,17 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||
// XPos
|
||||
Z_Free(texturesToken);
|
||||
texturesToken = M_GetToken(NULL);
|
||||
|
||||
if (texturesToken == NULL)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch \"%s\"'s x coordinate should be",patchName);
|
||||
}
|
||||
|
||||
endPos = NULL;
|
||||
#ifndef AVOID_ERRNO
|
||||
errno = 0;
|
||||
#endif
|
||||
|
||||
patchXPos = strtol(texturesToken,&endPos,10);
|
||||
(void)patchXPos; //unused for now
|
||||
if (endPos == texturesToken // Empty string
|
||||
@@ -748,10 +756,12 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||
// Comma 2
|
||||
Z_Free(texturesToken);
|
||||
texturesToken = M_GetToken(NULL);
|
||||
|
||||
if (texturesToken == NULL)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Unexpected end of file where comma after patch \"%s\"'s x coordinate should be",patchName);
|
||||
}
|
||||
|
||||
if (strcmp(texturesToken,",")!=0)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Expected \",\" after patch \"%s\"'s x coordinate, got \"%s\"",patchName,texturesToken);
|
||||
@@ -760,6 +770,7 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||
// YPos
|
||||
Z_Free(texturesToken);
|
||||
texturesToken = M_GetToken(NULL);
|
||||
|
||||
if (texturesToken == NULL)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch \"%s\"'s y coordinate should be",patchName);
|
||||
@@ -1131,9 +1142,9 @@ static void R_InitExtraColormaps(void)
|
||||
lumpnum_t R_GetFlatNumForName(const char *name)
|
||||
{
|
||||
INT32 i;
|
||||
lumpnum_t lump;
|
||||
lumpnum_t start;
|
||||
lumpnum_t end;
|
||||
lumpnum_t lump = LUMPERROR;
|
||||
lumpnum_t start = LUMPERROR;
|
||||
lumpnum_t end = LUMPERROR;
|
||||
|
||||
// Scan wad files backwards so patched flats take preference.
|
||||
for (i = numwadfiles - 1; i >= 0; i--)
|
||||
@@ -1608,7 +1619,7 @@ const char *R_ColormapNameForNum(INT32 num)
|
||||
if (num == -1)
|
||||
return "NONE";
|
||||
|
||||
if (num < 0 || num > MAXCOLORMAPS)
|
||||
if (num < 0 || num >= MAXCOLORMAPS)
|
||||
I_Error("R_ColormapNameForNum: num %d is invalid!\n", num);
|
||||
|
||||
if (foundcolormaps[num] == LUMPERROR)
|
||||
|
||||
+8
-20
@@ -42,13 +42,13 @@ static CV_PossibleValue_t fpscap_cons_t[] = {
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_fpscap = {"fpscap", "Match refresh rate", CV_SAVE, fpscap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_fpscap = {"fpscap", "Match refresh rate", CV_SAVE, fpscap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_fpscapbg = {"fpscapbackground", "Match refresh rate", CV_SAVE, fpscap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_precipinterp = {"precipinterpolation", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
ps_metric_t ps_interp_frac = {0};
|
||||
ps_metric_t ps_interp_lag = {0};
|
||||
ps_metric_t ps_interp_lag = {0};
|
||||
|
||||
static boolean R_UseBackgroundFramerateCap(void)
|
||||
{
|
||||
@@ -67,21 +67,21 @@ static boolean R_UseBackgroundFramerateCap(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
static UINT32 R_GetBackgroundFramerateCap(void)
|
||||
static UINT32 R_GetFrameCap(INT32 val)
|
||||
{
|
||||
if (cv_fpscapbg.value == 0)
|
||||
if (val == 0)
|
||||
{
|
||||
// 0: Match refresh rate
|
||||
return I_GetRefreshRate();
|
||||
}
|
||||
|
||||
if (cv_fpscapbg.value < 0)
|
||||
if (val < 0)
|
||||
{
|
||||
// -1: Unlimited
|
||||
return 0;
|
||||
}
|
||||
|
||||
return cv_fpscapbg.value;
|
||||
return val;
|
||||
}
|
||||
|
||||
UINT32 R_GetFramerateCap(void)
|
||||
@@ -95,22 +95,10 @@ UINT32 R_GetFramerateCap(void)
|
||||
|
||||
if (R_UseBackgroundFramerateCap())
|
||||
{
|
||||
return R_GetBackgroundFramerateCap();
|
||||
return R_GetFrameCap(cv_fpscapbg.value);
|
||||
}
|
||||
|
||||
if (cv_fpscap.value == 0)
|
||||
{
|
||||
// 0: Match refresh rate
|
||||
return I_GetRefreshRate();
|
||||
}
|
||||
|
||||
if (cv_fpscap.value < 0)
|
||||
{
|
||||
// -1: Unlimited
|
||||
return 0;
|
||||
}
|
||||
|
||||
return cv_fpscap.value;
|
||||
return R_GetFrameCap(cv_fpscap.value);
|
||||
}
|
||||
|
||||
boolean R_UsingFrameInterpolation(void)
|
||||
|
||||
+31
-28
@@ -125,24 +125,23 @@ static CV_PossibleValue_t drawdist_cons_t[] = {
|
||||
{8192, "8192"}, {12288, "12288"}, {20480, "20480"},
|
||||
{24576, "24576"},{0, "Infinite"}, {0, NULL}};
|
||||
|
||||
#if __SIZEOF_POINTER__ < 8 // only for 64bit
|
||||
#if defined(__x86_64__) || defined(__amd64__) || defined(__aarch64__) || defined(__arm64__) // only for 64bit (idk how else to proper check lmao)
|
||||
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
||||
{256, "256"}, {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{0, "None"}, {0, NULL}};
|
||||
|
||||
#else
|
||||
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
||||
{256, "256"}, {512, "512"}, {768, "768"},
|
||||
{256, "256"}, {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{3072, "3072"}, {4096, "4096"}, {0, "None"}, {0, NULL}};
|
||||
#else
|
||||
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
||||
{256, "256"}, {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{0, "None"}, {0, NULL}};
|
||||
#endif
|
||||
|
||||
static CV_PossibleValue_t maxinterpdist_cons_t[] = {
|
||||
/*{256, "256"},*/ {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{3072, "3072"}, {4096, "4096"}, {6144, "6144"},
|
||||
{8192, "8192"}, {0, "Infinite"}, {0, NULL}};
|
||||
/*{256, "256"},*/ {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{3072, "3072"}, {4096, "4096"}, {6144, "6144"},
|
||||
{8192, "8192"}, {0, "Infinite"}, {0, NULL}};
|
||||
|
||||
static CV_PossibleValue_t fov_cons_t[] = {{MINFOV*FRACUNIT, "MIN"}, {MAXFOV*FRACUNIT, "MAX"}, {0, NULL}};
|
||||
|
||||
@@ -172,14 +171,14 @@ consvar_t cv_tailspickup = {"tailspickup", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnO
|
||||
consvar_t cv_precachetextures = {"precachetextures", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_chasecam[MAXSPLITSCREENPLAYERS] = {
|
||||
{"chasecam", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam2", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam3", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam4", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_flipcam[MAXSPLITSCREENPLAYERS] = {
|
||||
{"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam2", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam2_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam3", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam3_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam4", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam4_OnChange, 0, NULL, NULL, 0, 0, NULL}
|
||||
@@ -201,6 +200,7 @@ consvar_t cv_drawdist = {"drawdist", "Infinite", CV_SAVE, drawdist_cons_t, NULL,
|
||||
consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE|CV_CALL|CV_NOINIT, drawdist_precip_cons_t, Precipstuff_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_lessprecip = {"lessweathereffects", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Precipstuff_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_mobjscaleprecip = {"scaleprecipmobjscale", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Precipstuff_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_playerfade = {"playerfade", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_maxinterpdist = {"maxinterpdist", "Infinite", CV_SAVE, maxinterpdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
@@ -403,7 +403,8 @@ angle_t R_PlayerSliptideAngle(player_t *player)
|
||||
sprframe = &sprdef->spriteframes[rot];
|
||||
|
||||
// No sprite frame? I guess it is possible
|
||||
if (!sprframe) return 0;
|
||||
if (!sprframe)
|
||||
return 0;
|
||||
|
||||
if (sprframe->rotate != SRF_SINGLE || (mo->frame & FF_PAPERSPRITE))
|
||||
ang = R_PointToAngle(mo->x, mo->y) - mo->angle;
|
||||
@@ -463,6 +464,7 @@ boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixe
|
||||
return false;
|
||||
|
||||
cullplane = cullheight->frontsector->floorheight;
|
||||
|
||||
if (cullheight->flags & ML_NOCLIMB) // Group culling
|
||||
{
|
||||
if (!viewcullheight)
|
||||
@@ -1063,7 +1065,7 @@ static void R_SetupCommonFrame(player_t * player, sector_t * sector)
|
||||
|
||||
static void R_SetupAimingFrame(player_t *player, camera_t *thiscam)
|
||||
{
|
||||
if (player->awayviewtics)
|
||||
if (player->awayviewtics && player->awayviewmobj)
|
||||
{
|
||||
newview->aim = player->awayviewaiming;
|
||||
newview->angle = player->awayviewmobj->angle;
|
||||
@@ -1169,7 +1171,7 @@ void R_SkyboxFrame(int s)
|
||||
{
|
||||
mapheader_t *mh = mapheaderinfo[gamemap-1];
|
||||
|
||||
if (player->awayviewtics)
|
||||
if (player->awayviewtics && player->awayviewmobj)
|
||||
{
|
||||
SETUPSKYVIEW(player->awayviewmobj, (player->awayviewmobj->z + 20*FRACUNIT));
|
||||
}
|
||||
@@ -1226,7 +1228,7 @@ void R_SetupFrame(int s, boolean skybox)
|
||||
|
||||
R_SetupAimingFrame(player, thiscam);
|
||||
|
||||
if (player->awayviewtics) // cut-away view stuff
|
||||
if (player->awayviewtics && player->awayviewmobj) // cut-away view stuff
|
||||
{
|
||||
viewmobj = player->awayviewmobj; // should be a MT_ALTVIEWMAN
|
||||
I_Assert(viewmobj != NULL);
|
||||
@@ -1235,7 +1237,7 @@ void R_SetupFrame(int s, boolean skybox)
|
||||
newview->y = viewmobj->y;
|
||||
newview->z = viewmobj->z + 20*FRACUNIT;
|
||||
|
||||
if (!P_MobjWasRemoved(viewmobj) && viewmobj->subsector && viewmobj->subsector->sector)
|
||||
if (viewmobj->subsector && viewmobj->subsector->sector)
|
||||
sector = viewmobj->subsector->sector;
|
||||
|
||||
R_SetupCommonFrame(player, sector);
|
||||
@@ -1253,7 +1255,7 @@ void R_SetupFrame(int s, boolean skybox)
|
||||
|
||||
R_SetupCommonFrame(player, sector);
|
||||
}
|
||||
else // use the player's eyes view
|
||||
else if (player->mo) // use the player's eyes view
|
||||
{
|
||||
viewmobj = player->mo;
|
||||
I_Assert(viewmobj != NULL);
|
||||
@@ -1262,7 +1264,7 @@ void R_SetupFrame(int s, boolean skybox)
|
||||
newview->y = viewmobj->y;
|
||||
newview->z = player->viewz;
|
||||
|
||||
if (!P_MobjWasRemoved(viewmobj) && viewmobj->subsector && viewmobj->subsector->sector)
|
||||
if (viewmobj->subsector && viewmobj->subsector->sector)
|
||||
sector = viewmobj->subsector->sector;
|
||||
|
||||
R_SetupCommonFrame(player, sector);
|
||||
@@ -1350,10 +1352,10 @@ void R_RenderPlayerView(player_t *player)
|
||||
|
||||
for (UINT8 j = 0; j <= splitscreen; j++)
|
||||
{
|
||||
if (player == &players[displayplayers[i]]
|
||||
&& viewfov[i] != fov)
|
||||
if (player == &players[displayplayers[j]]
|
||||
&& viewfov[j] != fov)
|
||||
{
|
||||
viewfov[i] = fov;
|
||||
viewfov[j] = fov;
|
||||
R_SetFov(fov);
|
||||
}
|
||||
}
|
||||
@@ -1523,10 +1525,6 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_fovchange);
|
||||
CV_RegisterVar(&cv_fov);
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_chasecam[i]);
|
||||
}
|
||||
CV_RegisterVar(&cv_shadow);
|
||||
CV_RegisterVar(&cv_shadowoffs);
|
||||
CV_RegisterVar(&cv_skybox);
|
||||
@@ -1535,6 +1533,8 @@ void R_RegisterEngineStuff(void)
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_chasecam[i]);
|
||||
|
||||
CV_RegisterVar(&cv_cam_dist[i]);
|
||||
CV_RegisterVar(&cv_cam_still[i]);
|
||||
CV_RegisterVar(&cv_cam_height[i]);
|
||||
@@ -1551,6 +1551,8 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_tiltsmoothing);
|
||||
CV_RegisterVar(&cv_actionmovie);
|
||||
|
||||
CV_RegisterVar(&cv_screenquake);
|
||||
|
||||
CV_RegisterVar(&cv_driftsparkpulse);
|
||||
CV_RegisterVar(&cv_gravstretch);
|
||||
CV_RegisterVar(&cv_sloperoll);
|
||||
@@ -1568,6 +1570,7 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_randomdirlight);
|
||||
|
||||
CV_RegisterVar(&cv_maxinterpdist);
|
||||
CV_RegisterVar(&cv_playerfade);
|
||||
|
||||
CV_RegisterVar(&cv_ripplewater);
|
||||
|
||||
|
||||
@@ -213,6 +213,7 @@ extern consvar_t cv_fov, cv_fovchange;
|
||||
extern consvar_t cv_skybox;
|
||||
extern consvar_t cv_tailspickup;
|
||||
extern consvar_t cv_maxinterpdist;
|
||||
extern consvar_t cv_playerfade;
|
||||
extern consvar_t cv_ripplewater;
|
||||
|
||||
extern consvar_t cv_randomdirlight;
|
||||
|
||||
+38
-2
@@ -716,6 +716,13 @@ static void R_DrawFlippedMaskedColumn(column_t *column)
|
||||
dc_texturemid = basetexturemid;
|
||||
}
|
||||
|
||||
|
||||
// Based off of R_GetLinedefTransTable
|
||||
static transnum_t R_GetThingTransTable(fixed_t alpha, transnum_t transmap)
|
||||
{
|
||||
return (20*(FRACUNIT - ((alpha * (10 - transmap))/10) - 1) + FRACUNIT) >> (FRACBITS+1);
|
||||
}
|
||||
|
||||
//
|
||||
// R_DrawVisSprite
|
||||
// mfloorclip and mceilingclip should also be set.
|
||||
@@ -823,8 +830,8 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
||||
frac = vis->startfrac;
|
||||
windowtop = windowbottom = sprbotscreen = INT32_MAX;
|
||||
|
||||
if ((vis->mobj->skin || vis->mobj->localskin) && K_GetMobjSkin(vis->mobj)->flags & SF_HIRES)
|
||||
this_scale = FixedMul(this_scale, K_GetMobjSkin(vis->mobj)->highresscale);
|
||||
//if ((vis->mobj->skin || vis->mobj->localskin) && K_GetMobjSkin(vis->mobj)->flags & SF_HIRES)
|
||||
// this_scale = FixedMul(this_scale, K_GetMobjSkin(vis->mobj)->highresscale);
|
||||
|
||||
if (this_scale <= 0)
|
||||
this_scale = 1;
|
||||
@@ -1579,6 +1586,9 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||
else
|
||||
trans = 0;
|
||||
|
||||
if (cv_playerfade.value && oldthing->player)
|
||||
trans = R_GetThingTransTable(R_DoPlayerFade(oldthing), trans);
|
||||
|
||||
//SoM: 3/17/2000: Disregard sprites that are out of view..
|
||||
if (vflip)
|
||||
{
|
||||
@@ -2888,6 +2898,32 @@ boolean R_ThingWithinDist(mobj_t *thing, INT32 limit_dist)
|
||||
return true;
|
||||
}
|
||||
|
||||
fixed_t R_DoPlayerFade(mobj_t *thing)
|
||||
{
|
||||
fixed_t fadealpha = FRACUNIT;
|
||||
static const tic_t countdownstarttime = (15 * TICRATE) / 4; // starttime - (3*TICRATE)
|
||||
|
||||
if (thing->player == viewplayer || viewplayer->exiting || camera[R_GetViewNumber()].freecam || leveltime < countdownstarttime)
|
||||
return fadealpha;
|
||||
|
||||
const INT32 playerdist = (FixedMul((thing->x - viewx), viewcos) + FixedMul((thing->y - viewy), viewsin)) >> FRACBITS;
|
||||
const INT32 viewplayerdist = (FixedMul((viewplayer->mo->x - viewx), viewcos) + FixedMul((viewplayer->mo->y - viewy), viewsin)) >> FRACBITS;
|
||||
|
||||
if (playerdist < viewplayerdist)
|
||||
{
|
||||
if (playerdist < viewplayerdist / 2) // stronger fade when very close
|
||||
{
|
||||
fadealpha = (playerdist * FRACUNIT) / (viewplayerdist / 2) / 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
fadealpha = (playerdist * FRACUNIT) / viewplayerdist;
|
||||
}
|
||||
}
|
||||
|
||||
return fadealpha;
|
||||
}
|
||||
|
||||
boolean R_ThingIsFullBright(mobj_t *thing)
|
||||
{
|
||||
return ((thing->frame & FF_BRIGHTMASK) == FF_FULLBRIGHT);
|
||||
|
||||
@@ -76,6 +76,8 @@ void R_InitSprites(void);
|
||||
void R_ClearSprites(void);
|
||||
void R_DrawMasked(void);
|
||||
|
||||
fixed_t R_DoPlayerFade(mobj_t *thing);
|
||||
|
||||
boolean R_ThingVisible (mobj_t *thing);
|
||||
boolean R_ThingWithinDist (mobj_t *thing, INT32 limit_dist);
|
||||
|
||||
|
||||
+9
-8
@@ -2010,7 +2010,7 @@ void S_KeepMusic(void)
|
||||
}
|
||||
|
||||
// Sets up the map music in case it should be reloaded
|
||||
// Special case for keep music
|
||||
// Special case for keepmusic
|
||||
void S_HandleReloadResetMusic(void)
|
||||
{
|
||||
if (!(mapmusic.flags & MUSIC_RELOADRESET))
|
||||
@@ -2035,23 +2035,24 @@ void S_HandleReloadResetMusic(void)
|
||||
|
||||
static boolean S_SkipIntroMusic(void)
|
||||
{
|
||||
boolean skip = cv_skipintromusic.value;
|
||||
if (!cv_skipintromusic.value)
|
||||
return false;
|
||||
|
||||
if (!skip)
|
||||
// check if menu music is playing, otherwise it may continue playing
|
||||
if (!stricmp(music.name, "titles"))
|
||||
return false;
|
||||
|
||||
char *maptitle = G_BuildMapTitle(gamemap); // Zzz...
|
||||
|
||||
if (maptitle)
|
||||
if (maptitle && !stricmp(maptitle, "Wandering Falls")) // wandering balls changes its song when the race starts Zzz...
|
||||
{
|
||||
// check if menu music is playing, otherwise it may continue playing
|
||||
if (!stricmp(music.name, "titles") || (maptitle && (!stricmp(maptitle, "Wandering Falls")))) // wandering balls changes its song when the race starts Zzz...
|
||||
skip = false;
|
||||
Z_Free(maptitle);
|
||||
return false;
|
||||
}
|
||||
|
||||
Z_Free(maptitle);
|
||||
|
||||
return skip;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
+5
-1
@@ -80,7 +80,9 @@ static void Highreshudscale_OnChange(void)
|
||||
|
||||
static void SCR_ChangeFullscreen (void);
|
||||
|
||||
consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, CV_YesNo, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t fullscreen_cons_t[] = {{0, "No"}, {1, "Yes"}, {2, "Borderless Window"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, fullscreen_cons_t, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t accuratefps_cons_t[] = {{0, "Inaccurate"}, {1, "Accurate"}, {0, NULL}};
|
||||
consvar_t cv_accuratefps = {"fpssampling", "1", CV_SAVE, accuratefps_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -310,6 +312,8 @@ void SCR_SetDefaultMode(void)
|
||||
void SCR_ChangeFullscreen(void)
|
||||
{
|
||||
#ifdef DIRECTFULLSCREEN
|
||||
I_SetBorderlessWindow(); // Running this here so we can have borderless window at startup
|
||||
|
||||
// allow_fullscreen is set by VID_PrepareModeList
|
||||
// it is used to prevent switching to fullscreen during startup
|
||||
if (!allow_fullscreen)
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __unix__
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
|
||||
+4
-1
@@ -110,8 +110,11 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__))
|
||||
#if defined(UNIXCOMMON)
|
||||
#include <poll.h>
|
||||
#endif
|
||||
|
||||
#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__))
|
||||
#include <errno.h>
|
||||
#include <sys/wait.h>
|
||||
#define NEWSIGNALHANDLER
|
||||
|
||||
+8
-1
@@ -150,7 +150,7 @@ UINT8 graphics_started = 0; // Is used in console.c and screen.c
|
||||
// To disable fullscreen at startup; is set in VID_PrepareModeList
|
||||
boolean allow_fullscreen = false;
|
||||
static SDL_bool disable_fullscreen = SDL_FALSE;
|
||||
#define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)?0:cv_fullscreen.value
|
||||
#define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)? 0: (cv_fullscreen.value == 1)
|
||||
static SDL_bool disable_mouse = SDL_FALSE;
|
||||
#define USE_MOUSEINPUT (!disable_mouse && cv_usemouse.value && havefocus)
|
||||
#define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN)
|
||||
@@ -273,6 +273,7 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
|
||||
{
|
||||
wasfullscreen = SDL_TRUE;
|
||||
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
I_SetBorderlessWindow();
|
||||
}
|
||||
else // windowed mode
|
||||
{
|
||||
@@ -2289,4 +2290,10 @@ static void Impl_SetVsync(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void I_SetBorderlessWindow(void)
|
||||
{
|
||||
SDL_bool borderless = (cv_fullscreen.value == 2) ? SDL_FALSE : SDL_TRUE;
|
||||
SDL_SetWindowBordered(window, borderless);
|
||||
}
|
||||
|
||||
#endif
|
||||
+3
-13
@@ -213,20 +213,10 @@ void I_StartupSound(void)
|
||||
// call to start audio failed -- we do not have it
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_version SDLmixcompiled;
|
||||
const SDL_version *SDLmixlinked;
|
||||
SDL_MIXER_VERSION(&SDLmixcompiled)
|
||||
SDLmixlinked = Mix_Linked_Version();
|
||||
|
||||
I_OutputMsg("Compiled for SDL_mixer version: %d.%d.%d\n",
|
||||
SDLmixcompiled.major, SDLmixcompiled.minor, SDLmixcompiled.patch);
|
||||
I_OutputMsg("Linked with SDL_mixer version: %d.%d.%d\n",
|
||||
SDLmixlinked->major, SDLmixlinked->minor, SDLmixlinked->patch);
|
||||
|
||||
|
||||
#ifdef HAVE_OPENMPT
|
||||
I_OutputMsg("libopenmpt version: %s\n", openmpt_get_string("library_version"));
|
||||
I_OutputMsg("libopenmpt build date: %s\n", openmpt_get_string("build"));
|
||||
CONS_Printf("libopenmpt version: %s\n", openmpt_get_string("library_version"));
|
||||
CONS_Printf("libopenmpt build date: %s\n", openmpt_get_string("build"));
|
||||
#endif
|
||||
|
||||
sound_started = true;
|
||||
|
||||
@@ -1037,6 +1037,7 @@ sfxenum_t S_AddSoundFx(const char *name, boolean singular, INT32 flags, boolean
|
||||
S_sfx[i].data = I_GetSfx(&S_sfx[i]);
|
||||
else
|
||||
S_sfx[i].data = NULL;
|
||||
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
+17
-16
@@ -418,27 +418,28 @@ static void ST_drawDebugInfo(void)
|
||||
|
||||
static void ST_drawLevelTitle(void)
|
||||
{
|
||||
char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl;
|
||||
char *subttl = mapheaderinfo[gamemap-1]->subttl;
|
||||
char *zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart
|
||||
char *actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
INT32 lvlttlxpos;
|
||||
INT32 ttlnumxpos;
|
||||
INT32 zonexpos;
|
||||
INT32 dupcalc = (vid.width/vid.dupx);
|
||||
UINT8 gtc = G_GetGametypeColor(gametype);
|
||||
char *lvlttl, *subttl, *zonttl, *actnum;
|
||||
INT32 lvlttlxpos, ttlnumxpos, zonexpos;
|
||||
INT32 dupcalc;
|
||||
UINT8 gtc;
|
||||
INT32 sub = 0;
|
||||
INT32 bary = (splitscreen)
|
||||
? BASEVIDHEIGHT/2
|
||||
: 163;
|
||||
INT32 bary;
|
||||
INT32 lvlw;
|
||||
|
||||
if (!cv_stagetitle.value)
|
||||
if (!cv_stagetitle.value || (timeinmap > 113))
|
||||
return;
|
||||
|
||||
if (timeinmap > 113)
|
||||
if (*mapheaderinfo[gamemap-1]->lvlttl == '\0')
|
||||
return;
|
||||
|
||||
lvlttl = mapheaderinfo[gamemap-1]->lvlttl;
|
||||
subttl = mapheaderinfo[gamemap-1]->subttl;
|
||||
zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart
|
||||
actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
dupcalc = (vid.width/vid.dupx);
|
||||
gtc = G_GetGametypeColor(gametype);
|
||||
bary = (splitscreen) ? BASEVIDHEIGHT/2 : 163;
|
||||
|
||||
lvlw = V_LevelNameWidth(lvlttl);
|
||||
|
||||
if (actnum[0])
|
||||
@@ -602,7 +603,7 @@ static void ST_overlayDrawer(void)
|
||||
}
|
||||
|
||||
// draw level title Tails
|
||||
if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer) && !mapreset) && LUA_HudEnabled(hud_stagetitle) && !forceshowhud)
|
||||
if (!(hu_showscores && (netgame || multiplayer) && !mapreset) && LUA_HudEnabled(hud_stagetitle) && !forceshowhud)
|
||||
ST_drawLevelTitle();
|
||||
|
||||
if (!hu_showscores && netgame && !mapreset)
|
||||
@@ -739,7 +740,7 @@ void ST_Drawer(void)
|
||||
UINT8 i;
|
||||
|
||||
#ifdef SEENAMES
|
||||
if (cv_seenames.value && cv_allowseenames.value && displayplayers[0] == consoleplayer && seenplayer && seenplayer->mo && !mapreset)
|
||||
if (UNLIKELY(cv_seenames.value && cv_allowseenames.value && displayplayers[0] == consoleplayer && seenplayer && seenplayer->mo && !mapreset))
|
||||
{
|
||||
if (cv_seenames.value == 1)
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, player_names[seenplayer-players]);
|
||||
|
||||
+35
-2
@@ -2039,8 +2039,7 @@ static lumpchecklist_t folderblacklist[] =
|
||||
{NULL, 0},
|
||||
};
|
||||
|
||||
static int
|
||||
W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||
static int W_VerifyPK3(FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||
{
|
||||
int verified = true;
|
||||
|
||||
@@ -2082,7 +2081,10 @@ W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||
char *cdir = (char*)(malloc(LONG(zend.cdirsize)));
|
||||
|
||||
if (fread(cdir, 1, LONG(zend.cdirsize), fp) < (UINT32)(LONG(zend.cdirsize)))
|
||||
{
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t offset = 0;
|
||||
|
||||
@@ -2094,7 +2096,10 @@ W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||
char* dotpos;
|
||||
|
||||
if (memcmp(zentry->signature, pat_central, 4) != 0)
|
||||
{
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (verified == true)
|
||||
{
|
||||
@@ -2132,10 +2137,16 @@ W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||
sizeof *zentry + SHORT(zentry->namelen) + SHORT(zentry->xtralen) + SHORT(zentry->commlen);
|
||||
|
||||
if (fseek(fp, LONG(zentry->offset), SEEK_SET) != 0)
|
||||
{
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (fread(&zlentry, 1, sizeof(zlentry_t), fp) < sizeof (zlentry_t))
|
||||
{
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
data_size +=
|
||||
sizeof zlentry + SHORT(zlentry.namelen) + SHORT(zlentry.xtralen) + LONG(zlentry.compsize);
|
||||
@@ -2186,7 +2197,9 @@ static int W_VerifyFile(const char *filename, lumpchecklist_t *checklist,
|
||||
goodfile = W_VerifyWAD(handle, checklist, status);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(handle);
|
||||
|
||||
return goodfile;
|
||||
}
|
||||
|
||||
@@ -2341,7 +2354,10 @@ static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist)
|
||||
char *cdir = (char*)(malloc(LONG(zend.cdirsize)));
|
||||
|
||||
if (fread(cdir, 1, LONG(zend.cdirsize), fp) < (UINT32)(LONG(zend.cdirsize)))
|
||||
{
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t offset = 0;
|
||||
|
||||
@@ -2353,7 +2369,10 @@ static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist)
|
||||
char* dotpos;
|
||||
|
||||
if (memcmp(zentry->signature, pat_central, 4) != 0)
|
||||
{
|
||||
free(cdir);
|
||||
return false;
|
||||
}
|
||||
|
||||
fullname = (char*)(malloc(SHORT(zentry->namelen) + 1));
|
||||
strlcpy(fullname, (char*)(zentry + 1), SHORT(zentry->namelen) + 1);
|
||||
@@ -2373,11 +2392,19 @@ static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist)
|
||||
strncpy(lumpname, trimname, min(8, dotpos - trimname));
|
||||
|
||||
if (W_NameStartsWith(lumpname, checklist))
|
||||
{
|
||||
free(fullname);
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (W_NameStartsWith(fullname, checklist))
|
||||
{
|
||||
free(fullname);
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
free(fullname);
|
||||
|
||||
@@ -2387,10 +2414,16 @@ static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist)
|
||||
sizeof *zentry + SHORT(zentry->namelen) + SHORT(zentry->xtralen) + SHORT(zentry->commlen);
|
||||
|
||||
if (fseek(fp, LONG(zentry->offset), SEEK_SET) != 0)
|
||||
{
|
||||
free(cdir);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fread(&zlentry, 1, sizeof(zlentry_t), fp) < sizeof (zlentry_t))
|
||||
{
|
||||
free(cdir);
|
||||
return false;
|
||||
}
|
||||
|
||||
data_size +=
|
||||
sizeof zlentry + SHORT(zlentry.namelen) + SHORT(zlentry.xtralen) + LONG(zlentry.compsize);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#include <winuser.h>
|
||||
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
+134
-146
@@ -57,15 +57,30 @@ typedef struct
|
||||
|
||||
static y_data_t data;
|
||||
|
||||
// graphics
|
||||
static patch_t *bgtile = NULL; // SPECTILE/SRB2BACK
|
||||
|
||||
// graphics
|
||||
static patch_t *bgpatch = NULL; // INTERSCR
|
||||
static patch_t *widebgpatch = NULL; // INTERSCW
|
||||
static patch_t *bgtile = NULL; // SPECTILE/SRB2BACK
|
||||
static INT32 timer;
|
||||
|
||||
static INT32 intertic;
|
||||
static INT32 endtic = -1;
|
||||
static INT32 sorttic = -1;
|
||||
|
||||
patch_t *animVoteFramesPatches = NULL;
|
||||
// VEXTRN - Vote (V) Extra (EXT) Race (R) Normal (N - Normal sized patch)
|
||||
// VEXTBN - Vote (V) Extra (EXT) Battle (B) Normal (N - Normal sized patch)
|
||||
// VEXTBW - Vote (V) Extra (EXT) Battle (B) Normal (W - Wide patch used in software)
|
||||
// VEXTRW - Vote (V) Extra (EXT) Race (R) Normal (W - Wide patch used in software)
|
||||
char animPrefix[] = "INTSC";
|
||||
char animWidePrefix[] = "INTSW";
|
||||
char *luaVoteScreen = NULL;
|
||||
|
||||
INT32 currentAnimFrame = 0;
|
||||
static INT32 foundAnimVoteFrames = 0;
|
||||
static INT32 foundAnimVoteWideFrames = 0;
|
||||
|
||||
intertype_t intertype = int_none;
|
||||
|
||||
static huddrawlist_h luahuddrawlist_intermission = NULL;
|
||||
@@ -103,13 +118,17 @@ typedef struct
|
||||
boolean loaded;
|
||||
} y_voteclient;
|
||||
|
||||
// votescreen stuff
|
||||
votescreen_t VoteScreen = {0};
|
||||
|
||||
static y_votelvlinfo levelinfo[5];
|
||||
static y_voteclient voteclient;
|
||||
static INT32 votetic;
|
||||
static INT32 voteendtic = -1;
|
||||
static patch_t *cursor = NULL;
|
||||
static patch_t *cursor1 = NULL;
|
||||
static patch_t *cursor2 = NULL;
|
||||
static patch_t *cursor3 = NULL;
|
||||
static patch_t *cursor4 = NULL;
|
||||
static patch_t *randomlvl = NULL;
|
||||
static patch_t *rubyicon = NULL;
|
||||
|
||||
static void Y_UnloadVoteData(void);
|
||||
|
||||
@@ -268,6 +287,49 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Y_AnimatedVoteScreenCheck
|
||||
//
|
||||
// Check if the lumps exist (checking for VEXTR(N|W)xx for race and VEXTRB(N|W)xx for battle)
|
||||
static void Y_AnimatedVoteScreenCheck(void)
|
||||
{
|
||||
char tmpPrefix[] = "INTS";
|
||||
|
||||
if (luaVoteScreen)
|
||||
strncpy(tmpPrefix, luaVoteScreen, 4);
|
||||
else if (G_BattleGametype())
|
||||
strcpy(tmpPrefix, "BTLS");
|
||||
|
||||
strncpy(animPrefix, tmpPrefix, 4);
|
||||
animPrefix[4] = 'C';
|
||||
strncpy(animWidePrefix, tmpPrefix, 4);
|
||||
animWidePrefix[4] = 'W';
|
||||
|
||||
foundAnimVoteFrames = foundAnimVoteWideFrames = 0;
|
||||
currentAnimFrame = 0;
|
||||
|
||||
INT32 i = 1;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
boolean normalLumpExists = W_LumpExists(va("%sC%d", tmpPrefix, i));
|
||||
boolean wideLumpExists = W_LumpExists(va("%sW%d", tmpPrefix, i));
|
||||
|
||||
if (normalLumpExists || wideLumpExists)
|
||||
{
|
||||
if (normalLumpExists)
|
||||
foundAnimVoteFrames++;
|
||||
|
||||
if (wideLumpExists)
|
||||
foundAnimVoteWideFrames++;
|
||||
}
|
||||
else // If we don't find at least frame 1 (e.g VEXTRN1), let's just stop looking
|
||||
break;
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// Y_PlayerStandingsDrawer
|
||||
//
|
||||
// Handles drawing the center-of-screen player standings.
|
||||
@@ -801,8 +863,7 @@ void Y_StartIntermission(void)
|
||||
//
|
||||
void Y_EndIntermission(void)
|
||||
{
|
||||
if (!dedicated)
|
||||
Y_UnloadData();
|
||||
Y_UnloadData();
|
||||
|
||||
endtic = -1;
|
||||
sorttic = -1;
|
||||
@@ -820,72 +881,28 @@ static void Y_FollowIntermission(void)
|
||||
G_AfterIntermission();
|
||||
}
|
||||
|
||||
#define UNLOAD(x) {if ((x) != NULL) {Patch_Free(x);} x = NULL;}
|
||||
#define UNLOAD(x) if (x) {Patch_Free(x);} x = NULL;
|
||||
|
||||
//
|
||||
// Y_UnloadData
|
||||
//
|
||||
static void Y_UnloadData(void)
|
||||
{
|
||||
// In hardware mode, don't Z_ChangeTag a pointer returned by W_CachePatchName().
|
||||
// It doesn't work and is unnecessary.
|
||||
if (rendermode != render_soft)
|
||||
return;
|
||||
|
||||
// unload the background patches
|
||||
UNLOAD(VoteScreen.bgpatch);
|
||||
UNLOAD(VoteScreen.widebgpatch);
|
||||
UNLOAD(bgpatch);
|
||||
UNLOAD(widebgpatch);
|
||||
UNLOAD(bgtile);
|
||||
//UNLOAD(interpic);
|
||||
}
|
||||
|
||||
// SRB2Kart: Voting!
|
||||
|
||||
//
|
||||
// Y_VoteScreenCheck
|
||||
//
|
||||
static void Y_VoteScreenCheck(void)
|
||||
{
|
||||
strcpy(VoteScreen.Prefix, "INTS");
|
||||
|
||||
if (VoteScreen.luaPrefix[0] != 0)
|
||||
strlcpy(VoteScreen.Prefix, VoteScreen.luaPrefix, sizeof(VoteScreen.Prefix));
|
||||
else if (G_BattleGametype())
|
||||
strcpy(VoteScreen.Prefix, "BTLS");
|
||||
|
||||
VoteScreen.foundLuaVoteFrames = VoteScreen.foundLuaVoteWideFrames = 0;
|
||||
VoteScreen.currentAnimFrame = 0;
|
||||
|
||||
INT32 i = 1;
|
||||
|
||||
// check for lua vote background replacements
|
||||
for (;;)
|
||||
{
|
||||
// Check if the lumps exist (checking for VEXTR(N|W)xx for race and VEXTRB(N|W)xx for battle)
|
||||
boolean normalLumpExists = W_LumpExists(va("%sC%d", VoteScreen.Prefix, i));
|
||||
boolean wideLumpExists = W_LumpExists(va("%sW%d", VoteScreen.Prefix, i));
|
||||
|
||||
if (normalLumpExists || wideLumpExists)
|
||||
{
|
||||
if (normalLumpExists)
|
||||
VoteScreen.foundLuaVoteFrames++;
|
||||
|
||||
if (wideLumpExists)
|
||||
VoteScreen.foundLuaVoteWideFrames++;
|
||||
}
|
||||
else // If we don't find at least frame 1 (e.g VEXTRN1), let's just stop looking
|
||||
break;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
// non lua vote background handling
|
||||
boolean prefbattletype = ((votelevels[0][1] & ~0x80) == GT_MATCH);
|
||||
VoteScreen.widebgpatch = W_CachePatchName((prefbattletype ? "BATTLSCW" : "INTERSCW"), PU_PATCH);
|
||||
VoteScreen.bgpatch = W_CachePatchName((prefbattletype ? "BATTLSCR" : "INTERSCR"), PU_PATCH);
|
||||
}
|
||||
|
||||
//
|
||||
// Y_VoteBackgroundDrawer
|
||||
//
|
||||
// Determines which patch drawer to use for scaling
|
||||
//
|
||||
static void Y_VoteBackgroundDrawer(patch_t *patch)
|
||||
static void Y_DrawVoteBackground(patch_t *patch)
|
||||
{
|
||||
switch (cv_votebgscaling.value)
|
||||
{
|
||||
@@ -907,74 +924,57 @@ static void Y_VoteBackgroundDrawer(patch_t *patch)
|
||||
}
|
||||
}
|
||||
|
||||
// Y_DrawAnimatedVoteScreenPatch
|
||||
//
|
||||
// Y_DrawLuaVoteScreenPatch
|
||||
// Draw animated patch based on frame counter on vote screen
|
||||
//
|
||||
// Handles votebackgrounds set by "setVoteBackground"
|
||||
// Aswell as animated patches
|
||||
//
|
||||
static void Y_DrawLuaVoteScreenPatch(boolean widePatch)
|
||||
static void Y_DrawAnimatedVoteScreenPatch(boolean widePatch)
|
||||
{
|
||||
INT32 nextframe = 0;
|
||||
patch_t *votebg = NULL;
|
||||
char tempPrefix[6];
|
||||
const INT32 tempfoundAnimLuaVoteFrames = ((widePatch ? VoteScreen.foundLuaVoteWideFrames : VoteScreen.foundLuaVoteFrames) - 1);
|
||||
char tempAnimPrefix[7];
|
||||
const INT32 tempFoundAnimVoteFrames = ((widePatch ? foundAnimVoteWideFrames : foundAnimVoteFrames) - 1);
|
||||
|
||||
strcpy(tempPrefix, va("%s%s", VoteScreen.Prefix, (widePatch ? "W" : "C")));
|
||||
|
||||
// Draw non animated patch
|
||||
if (!tempfoundAnimLuaVoteFrames)
|
||||
{
|
||||
votebg = W_CachePatchName(va("%s1", tempPrefix), PU_PATCH);
|
||||
Y_VoteBackgroundDrawer(votebg);
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw animated patch based on frame counter on vote screen
|
||||
strcpy(tempAnimPrefix, (widePatch ? animWidePrefix : animPrefix));
|
||||
|
||||
// Just in case someone provides LESS widescreen frames than normal frames or vice versa, reset the frame counter to 0
|
||||
if (VoteScreen.currentAnimFrame > tempfoundAnimLuaVoteFrames)
|
||||
VoteScreen.currentAnimFrame = 0;
|
||||
if (currentAnimFrame > tempFoundAnimVoteFrames)
|
||||
currentAnimFrame = 0;
|
||||
|
||||
nextframe = (VoteScreen.currentAnimFrame + 1);
|
||||
nextframe = (currentAnimFrame + 1);
|
||||
|
||||
votebg = W_CachePatchName(va("%s%d", tempPrefix, nextframe), PU_PATCH);
|
||||
votebg = W_CachePatchName(va("%s%d", (widePatch ? animWidePrefix : animPrefix), nextframe), PU_PATCH);
|
||||
|
||||
Y_VoteBackgroundDrawer(votebg);
|
||||
Y_DrawVoteBackground(votebg);
|
||||
|
||||
if (renderisnewtic && (votetic % 2 == 0) && !paused)
|
||||
VoteScreen.currentAnimFrame = (nextframe > tempfoundAnimLuaVoteFrames) ? 0 : nextframe;
|
||||
currentAnimFrame = (nextframe > tempFoundAnimVoteFrames) ? 0 : nextframe;
|
||||
}
|
||||
|
||||
//
|
||||
// Y_DrawVoteScreenPatch
|
||||
//
|
||||
static void Y_DrawVoteScreenPatch(void)
|
||||
{
|
||||
patch_t *votebg = NULL;
|
||||
const boolean widescreen = (vid.width / vid.dupx > 320);
|
||||
|
||||
if (VoteScreen.foundLuaVoteWideFrames || VoteScreen.foundLuaVoteFrames)
|
||||
if (foundAnimVoteWideFrames || foundAnimVoteFrames)
|
||||
{
|
||||
Y_DrawLuaVoteScreenPatch(((widescreen && VoteScreen.foundLuaVoteWideFrames) || !VoteScreen.foundLuaVoteFrames));
|
||||
Y_DrawAnimatedVoteScreenPatch((foundAnimVoteWideFrames && widescreen));
|
||||
return;
|
||||
}
|
||||
|
||||
// non widescreen patch
|
||||
votebg = VoteScreen.bgpatch;
|
||||
votebg = bgpatch; // non widescreen patch
|
||||
|
||||
UINT8 prefgametype = (votelevels[0][1] & ~0x80);
|
||||
const boolean widebgreplaced = (prefgametype == GT_MATCH) ? VoteScreen.replaced.widebattle : VoteScreen.replaced.widerace;
|
||||
const boolean bgreplaced = (prefgametype == GT_MATCH) ? VoteScreen.replaced.battle : VoteScreen.replaced.race;
|
||||
const boolean widebgreplaced = (prefgametype == GT_MATCH) ? widebattlereplaced : wideracereplaced;
|
||||
const boolean bgreplaced = (prefgametype == GT_MATCH) ? battlereplaced : racereplaced;
|
||||
|
||||
// we check a bunch of stuff to always have a "valid" fallback
|
||||
if ((widescreen && (widebgreplaced || !bgreplaced))
|
||||
|| (!widescreen && (widebgreplaced && !bgreplaced)))
|
||||
{
|
||||
votebg = VoteScreen.widebgpatch; // widescreen patch
|
||||
votebg = widebgpatch;
|
||||
}
|
||||
|
||||
Y_VoteBackgroundDrawer(votebg);
|
||||
Y_DrawVoteBackground(votebg);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1037,7 +1037,7 @@ void Y_VoteDrawer(void)
|
||||
if (i == 3)
|
||||
{
|
||||
str = "RANDOM";
|
||||
pic = VoteScreen.randomlvl;
|
||||
pic = randomlvl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1061,7 +1061,7 @@ void Y_VoteDrawer(void)
|
||||
|
||||
if (!splitscreen)
|
||||
{
|
||||
thiscurs = VoteScreen.cursor[0];
|
||||
thiscurs = cursor;
|
||||
p = consoleplayer;
|
||||
color = levelinfo[i].gtc;
|
||||
colormap = NULL;
|
||||
@@ -1071,19 +1071,19 @@ void Y_VoteDrawer(void)
|
||||
switch (j)
|
||||
{
|
||||
case 1:
|
||||
thiscurs = VoteScreen.cursor[2];
|
||||
thiscurs = cursor2;
|
||||
p = displayplayers[1];
|
||||
break;
|
||||
case 2:
|
||||
thiscurs = VoteScreen.cursor[3];
|
||||
thiscurs = cursor3;
|
||||
p = displayplayers[2];
|
||||
break;
|
||||
case 3:
|
||||
thiscurs = VoteScreen.cursor[4];
|
||||
thiscurs = cursor4;
|
||||
p = displayplayers[3];
|
||||
break;
|
||||
default:
|
||||
thiscurs = VoteScreen.cursor[1];
|
||||
thiscurs = cursor1;
|
||||
p = displayplayers[0];
|
||||
break;
|
||||
}
|
||||
@@ -1111,7 +1111,7 @@ void Y_VoteDrawer(void)
|
||||
else
|
||||
{
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/2, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-60)<<FRACBITS, ((y+25)<<FRACBITS) - (rubyheight<<1), FRACUNIT, V_SNAPTORIGHT, VoteScreen.rubyicon, NULL);
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-60)<<FRACBITS, ((y+25)<<FRACBITS) - (rubyheight<<1), FRACUNIT, V_SNAPTORIGHT, rubyicon, NULL);
|
||||
}
|
||||
|
||||
V_DrawRightAlignedThinString(BASEVIDWIDTH-21, 40+y, V_SNAPTORIGHT|V_6WIDTHSPACE, str);
|
||||
@@ -1135,7 +1135,7 @@ void Y_VoteDrawer(void)
|
||||
else
|
||||
{
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-20)<<FRACBITS, y<<FRACBITS, FRACUNIT/4, V_FLIP|V_SNAPTORIGHT, pic, 0);
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-40)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTORIGHT, VoteScreen.rubyicon, NULL);
|
||||
V_DrawFixedPatch((BASEVIDWIDTH-40)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTORIGHT, rubyicon, NULL);
|
||||
}
|
||||
|
||||
if (levelinfo[i].gts)
|
||||
@@ -1164,13 +1164,13 @@ void Y_VoteDrawer(void)
|
||||
patch_t *pic;
|
||||
|
||||
if (votes[i] >= 3 && (i != pickedvote || voteendtic == -1))
|
||||
pic = VoteScreen.randomlvl;
|
||||
pic = randomlvl;
|
||||
else
|
||||
pic = levelinfo[votes[i]].pic;
|
||||
|
||||
if (!timer && i == voteclient.ranim)
|
||||
{
|
||||
V_DrawScaledPatch(x-18, y+9, V_SNAPTOLEFT, VoteScreen.cursor[0]);
|
||||
V_DrawScaledPatch(x-18, y+9, V_SNAPTOLEFT, cursor);
|
||||
if (voteendtic != -1 && !(votetic % 4))
|
||||
V_DrawFill(x-1, y-1, 42, 27, 120|V_SNAPTOLEFT);
|
||||
else
|
||||
@@ -1182,7 +1182,7 @@ void Y_VoteDrawer(void)
|
||||
else
|
||||
{
|
||||
V_DrawFixedPatch((x+40)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/4, V_SNAPTOLEFT|V_FLIP, pic, 0);
|
||||
V_DrawFixedPatch((x+20)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTOLEFT, VoteScreen.rubyicon, NULL);
|
||||
V_DrawFixedPatch((x+20)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTOLEFT, rubyicon, NULL);
|
||||
}
|
||||
|
||||
if (levelinfo[votes[i]].gts)
|
||||
@@ -1471,28 +1471,10 @@ void Y_VoteTicker(void)
|
||||
//
|
||||
// MK online style voting screen, appears after intermission
|
||||
//
|
||||
|
||||
static void Y_InitVoteDrawing(void)
|
||||
{
|
||||
if (dedicated)
|
||||
return;
|
||||
|
||||
// setup the background patches
|
||||
Y_VoteScreenCheck();
|
||||
|
||||
VoteScreen.cursor[0] = W_CachePatchName("M_CURSOR", PU_PATCH);
|
||||
VoteScreen.cursor[1] = W_CachePatchName("P1CURSOR", PU_PATCH);
|
||||
VoteScreen.cursor[2] = W_CachePatchName("P2CURSOR", PU_PATCH);
|
||||
VoteScreen.cursor[3] = W_CachePatchName("P3CURSOR", PU_PATCH);
|
||||
VoteScreen.cursor[4] = W_CachePatchName("P4CURSOR", PU_PATCH);
|
||||
|
||||
VoteScreen.randomlvl = W_CachePatchName("RANDOMLV", PU_PATCH);
|
||||
VoteScreen.rubyicon = W_CachePatchName("RUBYICON", PU_PATCH);
|
||||
}
|
||||
|
||||
void Y_StartVote(void)
|
||||
{
|
||||
INT32 i = 0;
|
||||
UINT8 prefgametype = (votelevels[0][1] & ~0x80);
|
||||
|
||||
votetic = -1;
|
||||
|
||||
@@ -1501,8 +1483,17 @@ void Y_StartVote(void)
|
||||
I_Error("voteendtic is dirty");
|
||||
#endif
|
||||
|
||||
// cache vote patches
|
||||
Y_InitVoteDrawing();
|
||||
Y_AnimatedVoteScreenCheck();
|
||||
|
||||
widebgpatch = W_CachePatchName(((prefgametype == GT_MATCH) ? "BATTLSCW" : "INTERSCW"), PU_PATCH);
|
||||
bgpatch = W_CachePatchName(((prefgametype == GT_MATCH) ? "BATTLSCR" : "INTERSCR"), PU_PATCH);
|
||||
cursor = W_CachePatchName("M_CURSOR", PU_PATCH);
|
||||
cursor1 = W_CachePatchName("P1CURSOR", PU_PATCH);
|
||||
cursor2 = W_CachePatchName("P2CURSOR", PU_PATCH);
|
||||
cursor3 = W_CachePatchName("P3CURSOR", PU_PATCH);
|
||||
cursor4 = W_CachePatchName("P4CURSOR", PU_PATCH);
|
||||
randomlvl = W_CachePatchName("RANDOMLV", PU_PATCH);
|
||||
rubyicon = W_CachePatchName("RUBYICON", PU_PATCH);
|
||||
|
||||
timer = cv_votetime.value*TICRATE;
|
||||
pickedvote = -1;
|
||||
@@ -1568,14 +1559,11 @@ void Y_StartVote(void)
|
||||
levelinfo[i].gts = NULL;
|
||||
|
||||
// set up the pic
|
||||
if (!dedicated)
|
||||
{
|
||||
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(votelevels[i][0]+1)));
|
||||
if (lumpnum != LUMPERROR)
|
||||
levelinfo[i].pic = W_CachePatchName(va("%sP", G_BuildMapName(votelevels[i][0]+1)), PU_PATCH);
|
||||
else
|
||||
levelinfo[i].pic = W_CachePatchName("BLANKLVL", PU_PATCH);
|
||||
}
|
||||
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(votelevels[i][0]+1)));
|
||||
if (lumpnum != LUMPERROR)
|
||||
levelinfo[i].pic = W_CachePatchName(va("%sP", G_BuildMapName(votelevels[i][0]+1)), PU_PATCH);
|
||||
else
|
||||
levelinfo[i].pic = W_CachePatchName("BLANKLVL", PU_PATCH);
|
||||
}
|
||||
|
||||
voteclient.loaded = true;
|
||||
@@ -1600,18 +1588,18 @@ static void Y_UnloadVoteData(void)
|
||||
{
|
||||
voteclient.loaded = false;
|
||||
|
||||
if (dedicated)
|
||||
if (rendermode != render_soft)
|
||||
return;
|
||||
|
||||
UNLOAD(VoteScreen.widebgpatch);
|
||||
UNLOAD(VoteScreen.bgpatch);
|
||||
UNLOAD(VoteScreen.cursor[0]);
|
||||
UNLOAD(VoteScreen.cursor[1]);
|
||||
UNLOAD(VoteScreen.cursor[2]);
|
||||
UNLOAD(VoteScreen.cursor[3]);
|
||||
UNLOAD(VoteScreen.cursor[4]);
|
||||
UNLOAD(VoteScreen.randomlvl);
|
||||
UNLOAD(VoteScreen.rubyicon);
|
||||
UNLOAD(widebgpatch);
|
||||
UNLOAD(bgpatch);
|
||||
UNLOAD(cursor);
|
||||
UNLOAD(cursor1);
|
||||
UNLOAD(cursor2);
|
||||
UNLOAD(cursor3);
|
||||
UNLOAD(cursor4);
|
||||
UNLOAD(randomlvl);
|
||||
UNLOAD(rubyicon);
|
||||
|
||||
UNLOAD(levelinfo[3].pic);
|
||||
UNLOAD(levelinfo[2].pic);
|
||||
|
||||
+1
-34
@@ -10,6 +10,7 @@
|
||||
/// \brief Tally screens, or "Intermissions" as they were formally called in Doom
|
||||
|
||||
extern boolean usebuffer;
|
||||
extern char *luaVoteScreen;
|
||||
|
||||
void Y_IntermissionDrawer(void);
|
||||
void Y_Ticker(void);
|
||||
@@ -54,37 +55,3 @@ typedef enum
|
||||
int_classicrace, // Competition
|
||||
} intertype_t;
|
||||
extern intertype_t intertype;
|
||||
|
||||
// Votescreen stuff
|
||||
typedef struct
|
||||
{
|
||||
boolean race; // non lua race patch replaced
|
||||
boolean widerace; // non lua widescreen race patch replaced
|
||||
boolean battle; // non lua battle patch replaced
|
||||
boolean widebattle; // non lua widescreen battle patch replaced
|
||||
} votereplace_t;
|
||||
|
||||
// VEXTRN - Vote (V) Extra (EXT) Race (R) Normal (N - Normal sized patch)
|
||||
// VEXTRW - Vote (V) Extra (EXT) Race (R) Normal (W - Wide patch)
|
||||
// VEXTBN - Vote (V) Extra (EXT) Battle (B) Normal (N - Normal sized patch)
|
||||
// VEXTBW - Vote (V) Extra (EXT) Battle (B) Normal (W - Wide patch)
|
||||
typedef struct
|
||||
{
|
||||
char Prefix[5]; // Race = INTSX, Battle = BTLSX
|
||||
char luaPrefix[5]; // prefix for lua votescreens
|
||||
|
||||
INT32 currentAnimFrame; // current animated background frame
|
||||
|
||||
INT32 foundLuaVoteFrames; // normal lua patch frames
|
||||
INT32 foundLuaVoteWideFrames; // widescreen lua patch frames
|
||||
|
||||
votereplace_t replaced; // checks which non lua patch has been replaced
|
||||
|
||||
patch_t *bgpatch; // votebackground patch
|
||||
patch_t *widebgpatch; // wide votebackground patch
|
||||
|
||||
patch_t *cursor[5]; // cursor patches
|
||||
patch_t *randomlvl; // randomlevel patch
|
||||
patch_t *rubyicon; // encore ruby patch
|
||||
} votescreen_t;
|
||||
extern votescreen_t VoteScreen;
|
||||
+63
-10
@@ -149,9 +149,12 @@ void Z_Free(void *ptr)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ZDEBUG
|
||||
#ifdef ZDEBUG2
|
||||
// Write every Z_Free call to a debug file.
|
||||
CONS_Debug(DBG_MEMORY, "Z_Free at %s:%d\n", file, line);
|
||||
#elif defined(ZDEBUG)
|
||||
(void)file;
|
||||
(void)line;
|
||||
#endif
|
||||
|
||||
// anything that isn't by lua gets passed to lua just in case.
|
||||
@@ -358,8 +361,10 @@ void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignb
|
||||
return NULL;
|
||||
|
||||
#ifdef ZDEBUG
|
||||
#ifdef ZDEBUG2
|
||||
// Write every Z_Realloc call to a debug file.
|
||||
DEBFILE(va("Z_Realloc at %s:%d\n", file, line));
|
||||
#endif
|
||||
rez = Z_Malloc2(size, tag, user, alignbits, file, line);
|
||||
#else
|
||||
rez = Z_MallocAlign(size, tag, user, alignbits);
|
||||
@@ -394,11 +399,19 @@ void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignb
|
||||
* \param lowtag The lowest tag to consider.
|
||||
* \param hightag The highest tag to consider.
|
||||
*/
|
||||
#ifdef ZDEBUG
|
||||
void Z_FreeTags2(INT32 lowtag, INT32 hightag, const char *file, INT32 line)
|
||||
#else
|
||||
void Z_FreeTags(INT32 lowtag, INT32 hightag)
|
||||
#endif
|
||||
{
|
||||
memblock_t *block, *next;
|
||||
|
||||
#ifdef ZDEBUG
|
||||
Z_CheckHeap2(file, line);
|
||||
#else
|
||||
Z_CheckHeap(420);
|
||||
#endif
|
||||
for (block = head.next; block != &head; block = next)
|
||||
{
|
||||
next = block->next; // get link before freeing
|
||||
@@ -468,12 +481,20 @@ void Z_CheckMemCleanup(void)
|
||||
* \param i Identifies from where in the code Z_CheckHeap was called.
|
||||
* \author Graue <graue@oceanbase.org>
|
||||
*/
|
||||
void Z_CheckHeap(INT32 i)
|
||||
#ifdef ZDEBUG
|
||||
void Z_CheckHeap2(const char *file, INT32 line)
|
||||
#else
|
||||
void Z_CheckHeap(INT32 tag)
|
||||
#endif
|
||||
{
|
||||
memblock_t *block;
|
||||
UINT32 blocknumon = 0;
|
||||
void *given;
|
||||
|
||||
#ifndef ZDEBUG
|
||||
(void)tag;
|
||||
#endif
|
||||
|
||||
for (block = head.next; block != &head; block = block->next)
|
||||
{
|
||||
blocknumon++;
|
||||
@@ -498,11 +519,19 @@ void Z_CheckHeap(INT32 i)
|
||||
#endif
|
||||
if (block->user != NULL && *(block->user) != given)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" doesn't have a proper user", i, blocknumon
|
||||
" doesn't have a proper user"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
@@ -510,11 +539,19 @@ void Z_CheckHeap(INT32 i)
|
||||
}
|
||||
if (block->next->prev != block)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" lacks proper backlink", i, blocknumon
|
||||
" lacks proper backlink"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
@@ -522,11 +559,19 @@ void Z_CheckHeap(INT32 i)
|
||||
}
|
||||
if (block->prev->next != block)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" lacks proper forward link", i, blocknumon
|
||||
" lacks proper forward link"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
@@ -534,11 +579,19 @@ void Z_CheckHeap(INT32 i)
|
||||
}
|
||||
if (block->id != ZONEID)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" have the wrong ID", i, blocknumon
|
||||
" have the wrong ID"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
|
||||
+14
-2
@@ -28,7 +28,7 @@
|
||||
#define FUNCALLOC(x)
|
||||
#endif
|
||||
|
||||
//#define ZDEBUG
|
||||
#define ZDEBUG
|
||||
|
||||
//
|
||||
// Purge tags
|
||||
@@ -110,8 +110,14 @@ void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignb
|
||||
// Free all memory by tag
|
||||
// these don't give line numbers for ZDEBUG currently though
|
||||
// (perhaps this should be changed in future?)
|
||||
#ifdef ZDEBUG
|
||||
#define Z_FreeTag(tagnum) Z_FreeTags2(tagnum, tagnum, __FILE__, __LINE__)
|
||||
#define Z_FreeTags(tagnum, tagnum2) Z_FreeTags2(tagnum, tagnum2, __FILE__, __LINE__)
|
||||
void Z_FreeTags2(INT32 lowtag, INT32 hightag, const char *file, INT32 line);
|
||||
#else
|
||||
#define Z_FreeTag(tagnum) Z_FreeTags(tagnum, tagnum)
|
||||
void Z_FreeTags(INT32 lowtag, INT32 hightag);
|
||||
#endif
|
||||
|
||||
// Iterate memory by tag
|
||||
#define Z_IterateTag(tagnum, func) Z_IterateTags(tagnum, tagnum, func)
|
||||
@@ -121,7 +127,13 @@ void Z_IterateTags(INT32 lowtag, INT32 hightag, boolean (*iterfunc)(void *));
|
||||
// Utility functions
|
||||
//
|
||||
void Z_CheckMemCleanup(void);
|
||||
void Z_CheckHeap(INT32 i);
|
||||
|
||||
#ifdef ZDEBUG
|
||||
#define Z_CheckHeap(tag) Z_CheckHeap2(__FILE__, __LINE__)
|
||||
void Z_CheckHeap2(const char *file, INT32 line);
|
||||
#else
|
||||
void Z_CheckHeap(INT32 tag);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Zone memory modification
|
||||
|
||||
Reference in new issue
Block a user