Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00bc8bc149 | ||
|
|
f12b55f63b | ||
|
|
3e476d7658 |
No files matched your search
+42
-17
@@ -100,6 +100,10 @@ static int map_icon_request_count; // current count of icon requests sent
|
|||||||
static UINT8 *map_icon_data;
|
static UINT8 *map_icon_data;
|
||||||
static patch_t *map_icon;
|
static patch_t *map_icon;
|
||||||
|
|
||||||
|
// if true, signals the game to only load addons AND gamestate
|
||||||
|
// instead of fully joining a server
|
||||||
|
static boolean cl_addonsonly = false;
|
||||||
|
|
||||||
plrinfo playerinfo[MAXPLAYERS] = {};
|
plrinfo playerinfo[MAXPLAYERS] = {};
|
||||||
SINT8 joinnode = 0; // used for CL_VIEWSERVER
|
SINT8 joinnode = 0; // used for CL_VIEWSERVER
|
||||||
|
|
||||||
@@ -1438,6 +1442,7 @@ static void CL_DrawConnectionStatus(void)
|
|||||||
// Buttons
|
// Buttons
|
||||||
V_DrawFill(8, BASEVIDHEIGHT - 14, BASEVIDWIDTH - 16, 12, 239);
|
V_DrawFill(8, BASEVIDHEIGHT - 14, BASEVIDWIDTH - 16, 12, 239);
|
||||||
V_DrawThinString(16, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sESC%s] = Abort", "\x82", "\x80"));
|
V_DrawThinString(16, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sESC%s] = Abort", "\x82", "\x80"));
|
||||||
|
V_DrawCenteredThinString(BASEVIDWIDTH/2, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sSPACE%s] = Load Addons", "\x82", "\x80"));
|
||||||
V_DrawRightAlignedThinString(BASEVIDWIDTH - 12, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sENTER%s] = Join", "\x82", "\x80"));
|
V_DrawRightAlignedThinString(BASEVIDWIDTH - 12, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sENTER%s] = Join", "\x82", "\x80"));
|
||||||
}
|
}
|
||||||
else if (filedownload.current != -1)
|
else if (filedownload.current != -1)
|
||||||
@@ -2579,7 +2584,7 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cl_mode = (cv_serverinfoscreen.value) ? CL_VIEWSERVER : CL_CHECKFILES;
|
cl_mode = cv_serverinfoscreen.value ? CL_VIEWSERVER : CL_CHECKFILES;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2600,6 +2605,17 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void FreeMapIcon(void)
|
||||||
|
{
|
||||||
|
if (map_icon != NULL)
|
||||||
|
Patch_Free(map_icon);
|
||||||
|
map_icon = NULL;
|
||||||
|
if (map_icon_data != NULL)
|
||||||
|
Z_Free(map_icon_data);
|
||||||
|
map_icon_data = NULL;
|
||||||
|
map_icon_request_count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/** Called by CL_ConnectToServer
|
/** Called by CL_ConnectToServer
|
||||||
*
|
*
|
||||||
* \param tmpsave The name of the gamestate file???
|
* \param tmpsave The name of the gamestate file???
|
||||||
@@ -2624,7 +2640,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
|||||||
|
|
||||||
case CL_ASKFULLFILELIST:
|
case CL_ASKFULLFILELIST:
|
||||||
if (cl_lastcheckedfilecount == UINT16_MAX) // All files retrieved
|
if (cl_lastcheckedfilecount == UINT16_MAX) // All files retrieved
|
||||||
cl_mode = (cv_serverinfoscreen.value) ? CL_VIEWSERVER : CL_CHECKFILES;
|
cl_mode = cv_serverinfoscreen.value ? CL_VIEWSERVER : CL_CHECKFILES;
|
||||||
else if (fileneedednum != cl_lastcheckedfilecount || I_GetTime() >= *asksent)
|
else if (fileneedednum != cl_lastcheckedfilecount || I_GetTime() >= *asksent)
|
||||||
{
|
{
|
||||||
if (CL_AskFileList(fileneedednum))
|
if (CL_AskFileList(fileneedednum))
|
||||||
@@ -2757,7 +2773,19 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
|||||||
{
|
{
|
||||||
// Gamestate is now handled within CL_LoadReceivedSavegame()
|
// Gamestate is now handled within CL_LoadReceivedSavegame()
|
||||||
CL_LoadReceivedSavegame(false);
|
CL_LoadReceivedSavegame(false);
|
||||||
cl_mode = CL_CONNECTED;
|
|
||||||
|
if (cl_addonsonly)
|
||||||
|
{
|
||||||
|
// close connection after savegame load
|
||||||
|
// we want the actual server state
|
||||||
|
// in case theres some stuff like records to be synched
|
||||||
|
cl_mode = CL_ABORTED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cl_mode = CL_CONNECTED;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
} // don't break case continue to CL_CONNECTED
|
} // don't break case continue to CL_CONNECTED
|
||||||
else
|
else
|
||||||
@@ -2771,7 +2799,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
|||||||
case CL_ABORTED:
|
case CL_ABORTED:
|
||||||
cl_mode = CL_SEARCHING;
|
cl_mode = CL_SEARCHING;
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GetPackets();
|
GetPackets();
|
||||||
@@ -2793,24 +2820,21 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
|||||||
{
|
{
|
||||||
if (key == KEY_ENTER || key == KEY_JOY1)
|
if (key == KEY_ENTER || key == KEY_JOY1)
|
||||||
{
|
{
|
||||||
|
cl_addonsonly = false;
|
||||||
cl_mode = CL_CHECKFILES;
|
cl_mode = CL_CHECKFILES;
|
||||||
if (map_icon != NULL)
|
FreeMapIcon();
|
||||||
Patch_Free(map_icon);
|
|
||||||
map_icon = NULL;
|
|
||||||
if (map_icon_data != NULL)
|
|
||||||
Z_Free(map_icon_data);
|
|
||||||
map_icon_data = NULL;
|
|
||||||
}
|
}
|
||||||
else if (key == KEY_ESCAPE || key == KEY_JOY1+1)
|
else if (key == KEY_ESCAPE || key == KEY_JOY1+1)
|
||||||
{
|
{
|
||||||
cl_mode = CL_ABORTED;
|
cl_mode = CL_ABORTED;
|
||||||
if (map_icon != NULL)
|
cl_addonsonly = false;
|
||||||
Patch_Free(map_icon);
|
FreeMapIcon();
|
||||||
map_icon = NULL;
|
}
|
||||||
if (map_icon_data != NULL)
|
else if (key == KEY_SPACE || key == KEY_JOY1+2)
|
||||||
Z_Free(map_icon_data);
|
{
|
||||||
map_icon_data = NULL;
|
cl_addonsonly = true;
|
||||||
map_icon_request_count = 0;
|
cl_mode = CL_CHECKFILES;
|
||||||
|
FreeMapIcon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2819,6 +2843,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
|||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("Network game synchronization aborted.\n"));
|
CONS_Printf(M_GetText("Network game synchronization aborted.\n"));
|
||||||
CL_AbortConnection();
|
CL_AbortConnection();
|
||||||
|
cl_addonsonly = false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-70
@@ -653,68 +653,6 @@ static boolean D_Display(void)
|
|||||||
return ranwipe;
|
return ranwipe;
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT64 precision = 0;
|
|
||||||
static precise_t sleeptime = 0;
|
|
||||||
|
|
||||||
static void D_LimitFps(void)
|
|
||||||
{
|
|
||||||
static precise_t curtime = 0, lasttime = 0;
|
|
||||||
static precise_t start;
|
|
||||||
precise_t elapsed = 0;
|
|
||||||
|
|
||||||
sleeptime = 0;
|
|
||||||
|
|
||||||
// timedemo runs uncapped!
|
|
||||||
if (singletics)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// in the case of "match refresh rate" + vsync, don't sleep at all
|
|
||||||
if (cv_vidwait.value && cv_fpscap.value == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const UINT32 framecap = R_GetFramerateCap();
|
|
||||||
|
|
||||||
// uncapped obviously does not need to be... capped...
|
|
||||||
if (framecap == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
start = I_GetPreciseTime();
|
|
||||||
|
|
||||||
// frametarget in precise_t ticks (ex. 60fps = ~16,666,666)
|
|
||||||
const precise_t frametarget = precision / framecap;
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
// check the current time against the "time of the old frame""
|
|
||||||
curtime = I_GetPreciseTime();
|
|
||||||
elapsed = curtime - lasttime;
|
|
||||||
|
|
||||||
// done waiting!
|
|
||||||
// continue as normal
|
|
||||||
if (elapsed >= frametarget)
|
|
||||||
{
|
|
||||||
lasttime = curtime;
|
|
||||||
|
|
||||||
// time we spent :chaosleep:ing or doing absolutely nothing
|
|
||||||
// for frameskip calculations
|
|
||||||
sleeptime = curtime - start;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if we have more than 1ms to wait
|
|
||||||
// sleep for a bit to not trash the cpu lul
|
|
||||||
precise_t remaining = frametarget - elapsed;
|
|
||||||
|
|
||||||
if (remaining > (precise_t)(precision / 1000))
|
|
||||||
{
|
|
||||||
// sleep for 90% of the time we gotta wait for the next frame
|
|
||||||
// since we dont wanna oversleep :chaosleep:
|
|
||||||
I_SleepDuration(9 * remaining / 10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// the rest we just be waitin until we meet our frametime target
|
|
||||||
}
|
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// D_SRB2Loop
|
// D_SRB2Loop
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
@@ -726,6 +664,7 @@ void D_SRB2Loop(void)
|
|||||||
tic_t entertic = 0, oldentertics = 0, realtics = 0, rendertimeout = INFTICS;
|
tic_t entertic = 0, oldentertics = 0, realtics = 0, rendertimeout = INFTICS;
|
||||||
double deltatics = 0.0;
|
double deltatics = 0.0;
|
||||||
double deltasecs = 0.0;
|
double deltasecs = 0.0;
|
||||||
|
UINT64 precision = 0;
|
||||||
|
|
||||||
boolean interp = false;
|
boolean interp = false;
|
||||||
boolean doDisplay = false;
|
boolean doDisplay = false;
|
||||||
@@ -765,16 +704,22 @@ void D_SRB2Loop(void)
|
|||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
// capbudget is the minimum precise_t duration of a single loop iteration
|
||||||
|
precise_t capbudget;
|
||||||
precise_t elapsed;
|
precise_t elapsed;
|
||||||
precise_t enterprecise, finishprecise;
|
precise_t enterprecise, finishprecise;
|
||||||
|
|
||||||
enterprecise = I_GetPreciseTime();
|
enterprecise = I_GetPreciseTime();
|
||||||
|
|
||||||
boolean ranwipe = false;
|
|
||||||
|
|
||||||
memset(&g_dc, 0, sizeof(g_dc));
|
memset(&g_dc, 0, sizeof(g_dc));
|
||||||
Z_Frame_Reset();
|
Z_Frame_Reset();
|
||||||
|
|
||||||
|
// Casting the return value of a function is bad practice (apparently)
|
||||||
|
const UINT32 framecap = R_GetFramerateCap();
|
||||||
|
capbudget = (framecap == 0) ? 0 : (precise_t)((double)precision / (double)framecap + 0.5); // + 0.5 instead of round
|
||||||
|
|
||||||
|
boolean ranwipe = false;
|
||||||
|
|
||||||
I_UpdateTime(cv_timescale.value);
|
I_UpdateTime(cv_timescale.value);
|
||||||
|
|
||||||
if (lastwipetic)
|
if (lastwipetic)
|
||||||
@@ -864,10 +809,6 @@ void D_SRB2Loop(void)
|
|||||||
R_SetTimeFrac(FRACUNIT);
|
R_SetTimeFrac(FRACUNIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// be sure to limit our fps *before* drawing
|
|
||||||
// so we can properly "pace" our frames
|
|
||||||
D_LimitFps();
|
|
||||||
|
|
||||||
if (interp || doDisplay)
|
if (interp || doDisplay)
|
||||||
{
|
{
|
||||||
if (!frameskip)
|
if (!frameskip)
|
||||||
@@ -902,9 +843,9 @@ void D_SRB2Loop(void)
|
|||||||
// Fully completed frame made.
|
// Fully completed frame made.
|
||||||
finishprecise = I_GetPreciseTime();
|
finishprecise = I_GetPreciseTime();
|
||||||
|
|
||||||
// Use the time without sleep for frameskip calculations:
|
// Use the time before sleep for frameskip calculations:
|
||||||
// post-sleep time is literally being intentionally wasted
|
// post-sleep time is literally being intentionally wasted
|
||||||
elapsed = (finishprecise - enterprecise) - sleeptime;
|
elapsed = finishprecise - enterprecise;
|
||||||
deltasecs = (double)elapsed / (double)precision;
|
deltasecs = (double)elapsed / (double)precision;
|
||||||
deltatics = deltasecs * (double)NEWTICRATE;
|
deltatics = deltasecs * (double)NEWTICRATE;
|
||||||
|
|
||||||
@@ -932,6 +873,19 @@ void D_SRB2Loop(void)
|
|||||||
frameskip = 0;
|
frameskip = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!singletics)
|
||||||
|
{
|
||||||
|
// in the case of "match refresh rate" + vsync, don't sleep at all
|
||||||
|
const boolean vsync_with_match_refresh = cv_vidwait.value && cv_fpscap.value == 0;
|
||||||
|
|
||||||
|
if ((elapsed > 0) && (capbudget > elapsed) && !vsync_with_match_refresh)
|
||||||
|
{
|
||||||
|
I_SleepDuration(capbudget - elapsed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Capture the time once more to get the real delta time.
|
||||||
|
finishprecise = I_GetPreciseTime();
|
||||||
elapsed = finishprecise - enterprecise;
|
elapsed = finishprecise - enterprecise;
|
||||||
deltasecs = (double)elapsed / (double)precision;
|
deltasecs = (double)elapsed / (double)precision;
|
||||||
deltatics = deltasecs * (double)NEWTICRATE;
|
deltatics = deltasecs * (double)NEWTICRATE;
|
||||||
|
|||||||
@@ -1009,9 +1009,6 @@ void D_RegisterClientCommands(void)
|
|||||||
CV_RegisterVar(&cv_gamepadled[i]);
|
CV_RegisterVar(&cv_gamepadled[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
CV_RegisterVar(&cv_gamepadledifunfocused);
|
|
||||||
CV_RegisterVar(&cv_rumbleifunfocused);
|
|
||||||
|
|
||||||
CV_RegisterVar(&cv_usemouse);
|
CV_RegisterVar(&cv_usemouse);
|
||||||
CV_RegisterVar(&cv_invertmouse);
|
CV_RegisterVar(&cv_invertmouse);
|
||||||
CV_RegisterVar(&cv_mousexsens);
|
CV_RegisterVar(&cv_mousexsens);
|
||||||
|
|||||||
+3
-1
@@ -1172,7 +1172,9 @@ void F_StartWaitingPlayers(void)
|
|||||||
randskin = M_RandomKey(numskins);
|
randskin = M_RandomKey(numskins);
|
||||||
boolean waithires = skins[randskin].flags && SF_HIRES;
|
boolean waithires = skins[randskin].flags && SF_HIRES;
|
||||||
|
|
||||||
Z_Free(waitcolormap);
|
if (waitcolormap)
|
||||||
|
Z_Free(waitcolormap);
|
||||||
|
|
||||||
waitcolormap = R_GetTranslationColormap(randskin, skins[randskin].prefcolor, 0);
|
waitcolormap = R_GetTranslationColormap(randskin, skins[randskin].prefcolor, 0);
|
||||||
|
|
||||||
if (waithires)
|
if (waithires)
|
||||||
|
|||||||
+8
-6
@@ -317,7 +317,8 @@ void closefilemenu(boolean validsize)
|
|||||||
coredirmenu = NULL;
|
coredirmenu = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_Free(refreshdirname);
|
if (refreshdirname)
|
||||||
|
Z_Free(refreshdirname);
|
||||||
refreshdirname = NULL;
|
refreshdirname = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +346,8 @@ void searchfilemenu(char *tempname)
|
|||||||
|
|
||||||
if (!menusearch.length)
|
if (!menusearch.length)
|
||||||
{
|
{
|
||||||
Z_Free(dirmenu);
|
if (dirmenu)
|
||||||
|
Z_Free(dirmenu);
|
||||||
dirmenu = coredirmenu;
|
dirmenu = coredirmenu;
|
||||||
sizedirmenu = sizecoredirmenu;
|
sizedirmenu = sizecoredirmenu;
|
||||||
|
|
||||||
@@ -387,8 +389,8 @@ void searchfilemenu(char *tempname)
|
|||||||
I_Error("searchfilemenu(): could not create \"No results...\".");
|
I_Error("searchfilemenu(): could not create \"No results...\".");
|
||||||
sizedirmenu = 1;
|
sizedirmenu = 1;
|
||||||
dir_on[menudepthleft] = 0;
|
dir_on[menudepthleft] = 0;
|
||||||
Z_Free(tempname);
|
if (tempname)
|
||||||
|
Z_Free(tempname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -503,8 +505,8 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
|
|||||||
{
|
{
|
||||||
closedir(dirhandle);
|
closedir(dirhandle);
|
||||||
closefilemenu(false);
|
closefilemenu(false);
|
||||||
Z_Free(tempname);
|
if (tempname)
|
||||||
|
Z_Free(tempname);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+9
-6
@@ -456,10 +456,10 @@ consvar_t cv_litesteer[MAXSPLITSCREENPLAYERS] = {
|
|||||||
|
|
||||||
//static CV_PossibleValue_t autoaccelcons_t[] = {{0, "Off"}, {1, "Manual"}, {2, "Automatic"}, {0, NULL}};
|
//static CV_PossibleValue_t autoaccelcons_t[] = {{0, "Off"}, {1, "Manual"}, {2, "Automatic"}, {0, NULL}};
|
||||||
consvar_t cv_autoaccel[MAXSPLITSCREENPLAYERS] = {
|
consvar_t cv_autoaccel[MAXSPLITSCREENPLAYERS] = {
|
||||||
{"kartautoaccel", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
{"autoaccel", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||||
{"kartautoaccel2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
{"autoaccel2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||||
{"kartautoaccel3", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
{"autoaccel3", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||||
{"kartautoaccel4", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
|
{"autoaccel4", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
static CV_PossibleValue_t driftsparkpulse_t[] = {{0, "MIN"}, {FRACUNIT*3, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t driftsparkpulse_t[] = {{0, "MIN"}, {FRACUNIT*3, "MAX"}, {0, NULL}};
|
||||||
@@ -523,8 +523,11 @@ void G_ClearRecords(void)
|
|||||||
INT16 i;
|
INT16 i;
|
||||||
for (i = 0; i < NUMMAPS; ++i)
|
for (i = 0; i < NUMMAPS; ++i)
|
||||||
{
|
{
|
||||||
Z_Free(mainrecords[i]);
|
if (mainrecords[i])
|
||||||
mainrecords[i] = NULL;
|
{
|
||||||
|
Z_Free(mainrecords[i]);
|
||||||
|
mainrecords[i] = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -81,9 +81,6 @@ consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS] = {
|
|||||||
{"gamepadled4", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle4, 0, NULL, NULL, 0, 0, NULL}
|
{"gamepadled4", "Skincolor", CV_SAVE|CV_CALL|CV_NOINIT, gamepadled_cons_t, led_off_handle4, 0, NULL, NULL, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
consvar_t cv_gamepadledifunfocused = {"gamepadledunfocused", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
|
||||||
consvar_t cv_rumbleifunfocused = {"rumbleifunfocused", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
|
||||||
|
|
||||||
static void rumble_off_handle(void)
|
static void rumble_off_handle(void)
|
||||||
{
|
{
|
||||||
if (!cv_rumble[0].value)
|
if (!cv_rumble[0].value)
|
||||||
@@ -933,7 +930,7 @@ void G_SetPlayerGamepadIndicatorColor(INT32 playernum, UINT8 color)
|
|||||||
|
|
||||||
I_Assert(playernum >= 0 && playernum < MAXSPLITSCREENPLAYERS);
|
I_Assert(playernum >= 0 && playernum < MAXSPLITSCREENPLAYERS);
|
||||||
|
|
||||||
if (cv_gamepadled[playernum].value == 0 || (window_notinfocus && cv_gamepadledifunfocused.value == 0)
|
if (cv_gamepadled[playernum].value == 0
|
||||||
|| color >= MAXTRANSLATIONS)
|
|| color >= MAXTRANSLATIONS)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -1012,7 +1009,7 @@ void G_PlayerDeviceRumble(INT32 playernum, UINT16 low_strength, UINT16 high_stre
|
|||||||
{
|
{
|
||||||
I_Assert(playernum >= 0 && playernum < MAXSPLITSCREENPLAYERS);
|
I_Assert(playernum >= 0 && playernum < MAXSPLITSCREENPLAYERS);
|
||||||
|
|
||||||
if (cv_rumble[playernum].value == 0 || (window_notinfocus && cv_rumbleifunfocused.value == 0))
|
if (cv_rumble[playernum].value == 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,9 +116,6 @@ extern consvar_t cv_rumble[MAXSPLITSCREENPLAYERS];
|
|||||||
extern consvar_t cv_rumblestrength[MAXSPLITSCREENPLAYERS];
|
extern consvar_t cv_rumblestrength[MAXSPLITSCREENPLAYERS];
|
||||||
extern consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS];
|
extern consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS];
|
||||||
|
|
||||||
extern consvar_t cv_gamepadledifunfocused;
|
|
||||||
extern consvar_t cv_rumbleifunfocused;
|
|
||||||
|
|
||||||
extern INT32 mousex, mousey;
|
extern INT32 mousex, mousey;
|
||||||
|
|
||||||
extern INT32 joyxmove[MAXSPLITSCREENPLAYERS][JOYAXISSET], joyymove[MAXSPLITSCREENPLAYERS][JOYAXISSET];
|
extern INT32 joyxmove[MAXSPLITSCREENPLAYERS][JOYAXISSET], joyymove[MAXSPLITSCREENPLAYERS][JOYAXISSET];
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ angle_t gld_FrustumAngle(angle_t tiltangle)
|
|||||||
floatangle = 2.0 + (45.0 + ((double)tilt / 1.9)) * clipfov / 90.0;
|
floatangle = 2.0 + (45.0 + ((double)tilt / 1.9)) * clipfov / 90.0;
|
||||||
if (floatangle >= 180.0)
|
if (floatangle >= 180.0)
|
||||||
return 0xffffffff;
|
return 0xffffffff;
|
||||||
a1 = (angle_t)lrint(ANG1 * floatangle);
|
a1 = (angle_t)xs_CRoundToInt(ANG1 * floatangle);
|
||||||
return a1;
|
return a1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -579,7 +579,7 @@ md2found:
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HWR_AddPlayerMD2(INT32 skin, boolean local) // For MD2's that were added after startup
|
void HWR_AddPlayerMD2(int skin, boolean local) // For MD2's that were added after startup
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
char name[20], filename[32];
|
char name[20], filename[32];
|
||||||
|
|||||||
+1
-2
@@ -225,10 +225,9 @@ HMS_connect (const char *format, ...)
|
|||||||
{
|
{
|
||||||
cc = curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
cc = curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
|
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
|
||||||
#ifdef LOGMESSAGES
|
|
||||||
cc = curl_easy_setopt(curl, CURLOPT_STDERR, logstream);
|
cc = curl_easy_setopt(curl, CURLOPT_STDERR, logstream);
|
||||||
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
|
if (cc != CURLE_OK) I_OutputMsg("libcurl: %s\n", buffer->errbuf);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (M_CheckParm("-bindaddr") && M_IsNextParm())
|
if (M_CheckParm("-bindaddr") && M_IsNextParm())
|
||||||
|
|||||||
+12
-15
@@ -1072,7 +1072,8 @@ static void Got_Saycmd(const UINT8 **p, INT32 playernum)
|
|||||||
|
|
||||||
HU_AddChatText(va(fmt2, prefix, cstart, dispname, textcolor, msg), cv_chatnotifications.value); // add to chat
|
HU_AddChatText(va(fmt2, prefix, cstart, dispname, textcolor, msg), cv_chatnotifications.value); // add to chat
|
||||||
|
|
||||||
Z_Free(tempchar);
|
if (tempchar)
|
||||||
|
Z_Free(tempchar);
|
||||||
}
|
}
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// I just want to point out while I'm here that because the data is still
|
// I just want to point out while I'm here that because the data is still
|
||||||
@@ -1483,7 +1484,6 @@ static char *CHAT_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)
|
|||||||
x = 0;
|
x = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return newstring;
|
return newstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1522,7 +1522,7 @@ static void HU_drawMiniChat(void)
|
|||||||
emote_t *emote = NULL;
|
emote_t *emote = NULL;
|
||||||
int emotelen = 0;
|
int emotelen = 0;
|
||||||
|
|
||||||
while (msg[j]) // iterate through msg
|
while(msg[j]) // iterate through msg
|
||||||
{
|
{
|
||||||
if (msg[j] < HU_FONTSTART) // don't draw
|
if (msg[j] < HU_FONTSTART) // don't draw
|
||||||
{
|
{
|
||||||
@@ -1554,21 +1554,19 @@ static void HU_drawMiniChat(void)
|
|||||||
{
|
{
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
prev_linereturn = false;
|
prev_linereturn = false;
|
||||||
dx += charwidth;
|
dx += charwidth;
|
||||||
|
|
||||||
if (dx >= boxw)
|
if (dx >= boxw)
|
||||||
{
|
{
|
||||||
dx = 0;
|
dx = 0;
|
||||||
linescount += 1;
|
linescount += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dy = 0;
|
dy = 0;
|
||||||
dx = 0;
|
dx = 0;
|
||||||
msglines += linescount+1;
|
msglines += linescount+1;
|
||||||
Z_Free(msg);
|
if (msg)
|
||||||
|
Z_Free(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
y = chaty - charheight*(msglines+1);
|
y = chaty - charheight*(msglines+1);
|
||||||
@@ -1600,7 +1598,7 @@ static void HU_drawMiniChat(void)
|
|||||||
emote_t *emote = NULL;
|
emote_t *emote = NULL;
|
||||||
int emotelen = 0;
|
int emotelen = 0;
|
||||||
|
|
||||||
while (msg[j]) // iterate through msg
|
while(msg[j]) // iterate through msg
|
||||||
{
|
{
|
||||||
if (msg[j] < HU_FONTSTART) // don't draw
|
if (msg[j] < HU_FONTSTART) // don't draw
|
||||||
{
|
{
|
||||||
@@ -1645,17 +1643,16 @@ static void HU_drawMiniChat(void)
|
|||||||
|
|
||||||
dx += charwidth;
|
dx += charwidth;
|
||||||
prev_linereturn = false;
|
prev_linereturn = false;
|
||||||
|
|
||||||
if (dx >= boxw)
|
if (dx >= boxw)
|
||||||
{
|
{
|
||||||
dx = 0;
|
dx = 0;
|
||||||
dy += charheight;
|
dy += charheight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dy += charheight;
|
dy += charheight;
|
||||||
dx = 0;
|
dx = 0;
|
||||||
Z_Free(msg);
|
if (msg)
|
||||||
|
Z_Free(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// decrement addy and make that shit smooth:
|
// decrement addy and make that shit smooth:
|
||||||
@@ -1707,7 +1704,7 @@ static void HU_drawChatLog(INT32 offset)
|
|||||||
|
|
||||||
V_DrawFillConsoleMap(chatx, chat_topy, boxw, boxh*charheight +2, 239|V_SNAPTOBOTTOM|V_SNAPTOLEFT); // log box
|
V_DrawFillConsoleMap(chatx, chat_topy, boxw, boxh*charheight +2, 239|V_SNAPTOBOTTOM|V_SNAPTOLEFT); // log box
|
||||||
|
|
||||||
for (i = 0; i < chat_nummsg_log; i++) // iterate through our chatlog
|
for (i=0; i<chat_nummsg_log; i++) // iterate through our chatlog
|
||||||
{
|
{
|
||||||
INT32 clrflag = 0;
|
INT32 clrflag = 0;
|
||||||
INT32 j = 0;
|
INT32 j = 0;
|
||||||
@@ -1716,7 +1713,7 @@ static void HU_drawChatLog(INT32 offset)
|
|||||||
emote_t *emote = NULL;
|
emote_t *emote = NULL;
|
||||||
int emotelen = 0;
|
int emotelen = 0;
|
||||||
|
|
||||||
while (msg[j]) // iterate through msg
|
while(msg[j]) // iterate through msg
|
||||||
{
|
{
|
||||||
if (msg[j] < HU_FONTSTART) // don't draw
|
if (msg[j] < HU_FONTSTART) // don't draw
|
||||||
{
|
{
|
||||||
@@ -1761,10 +1758,10 @@ static void HU_drawChatLog(INT32 offset)
|
|||||||
dy += charheight;
|
dy += charheight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dy += charheight;
|
dy += charheight;
|
||||||
dx = 0;
|
dx = 0;
|
||||||
Z_Free(msg);
|
if (msg)
|
||||||
|
Z_Free(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((chat_scroll >= chat_maxscroll) || (chat_scrollmedown)) && !(justscrolleddown || justscrolledup || chat_scrolltime)) // was already at the bottom of the page before new maxscroll calculation and was NOT scrolling.
|
if (((chat_scroll >= chat_maxscroll) || (chat_scrollmedown)) && !(justscrolleddown || justscrolledup || chat_scrolltime)) // was already at the bottom of the page before new maxscroll calculation and was NOT scrolling.
|
||||||
|
|||||||
+10
-4
@@ -1510,8 +1510,11 @@ static boolean SOCK_SetBanUsername(const char *username)
|
|||||||
username = "Direct IP ban";
|
username = "Direct IP ban";
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_Free(banned[numbans - 1].username);
|
if (banned[numbans - 1].username)
|
||||||
banned[numbans - 1].username = NULL;
|
{
|
||||||
|
Z_Free(banned[numbans - 1].username);
|
||||||
|
banned[numbans - 1].username = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
banned[numbans - 1].username = Z_StrDup(username);
|
banned[numbans - 1].username = Z_StrDup(username);
|
||||||
|
|
||||||
@@ -1525,8 +1528,11 @@ static boolean SOCK_SetBanReason(const char *reason)
|
|||||||
reason = "No reason given";
|
reason = "No reason given";
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_Free(banned[numbans - 1].reason);
|
if (banned[numbans - 1].reason)
|
||||||
banned[numbans - 1].reason = NULL;
|
{
|
||||||
|
Z_Free(banned[numbans - 1].reason);
|
||||||
|
banned[numbans - 1].reason = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
banned[numbans - 1].reason = Z_StrDup(reason);
|
banned[numbans - 1].reason = Z_StrDup(reason);
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -99,7 +99,8 @@ void K_EraseStats(void)
|
|||||||
// The only field we want to remember
|
// The only field we want to remember
|
||||||
boolean vanilla = kartstats.vanilla;
|
boolean vanilla = kartstats.vanilla;
|
||||||
|
|
||||||
Z_Free(kartstats.copy);
|
if (kartstats.copy)
|
||||||
|
Z_Free(kartstats.copy);
|
||||||
|
|
||||||
memset(&kartstats, 0, sizeof(kartstats_t));
|
memset(&kartstats, 0, sizeof(kartstats_t));
|
||||||
|
|
||||||
|
|||||||
@@ -136,9 +136,18 @@ void LUA_HUD_DestroyDrawList(huddrawlist_h list)
|
|||||||
{
|
{
|
||||||
if (list == NULL) return;
|
if (list == NULL) return;
|
||||||
|
|
||||||
Z_Free(list->items);
|
if (list->items)
|
||||||
Z_Free(list->olditems);
|
{
|
||||||
Z_Free(list->strbuf);
|
Z_Free(list->items);
|
||||||
|
}
|
||||||
|
if (list->olditems)
|
||||||
|
{
|
||||||
|
Z_Free(list->olditems);
|
||||||
|
}
|
||||||
|
if (list->strbuf)
|
||||||
|
{
|
||||||
|
Z_Free(list->strbuf);
|
||||||
|
}
|
||||||
Z_Free(list);
|
Z_Free(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-3
@@ -695,13 +695,16 @@ INT32 GIF_close(void)
|
|||||||
fclose(gif_out);
|
fclose(gif_out);
|
||||||
gif_out = NULL;
|
gif_out = NULL;
|
||||||
|
|
||||||
Z_Free(gifbwr_buf);
|
if (gifbwr_buf)
|
||||||
|
Z_Free(gifbwr_buf);
|
||||||
gifbwr_buf = gifbwr_cur = NULL;
|
gifbwr_buf = gifbwr_cur = NULL;
|
||||||
|
|
||||||
Z_Free(gifframe_data);
|
if (gifframe_data)
|
||||||
|
Z_Free(gifframe_data);
|
||||||
gifframe_data = NULL;
|
gifframe_data = NULL;
|
||||||
|
|
||||||
Z_Free(giflzw_hashTable);
|
if (giflzw_hashTable)
|
||||||
|
Z_Free(giflzw_hashTable);
|
||||||
giflzw_hashTable = NULL;
|
giflzw_hashTable = NULL;
|
||||||
|
|
||||||
Z_Free(scrbuf_screens);
|
Z_Free(scrbuf_screens);
|
||||||
|
|||||||
+6
-3
@@ -248,9 +248,12 @@ void M_AddRawCondition(UINT8 set, UINT8 id, conditiontype_t c, INT32 r, INT16 x1
|
|||||||
|
|
||||||
void M_ClearConditionSet(UINT8 set)
|
void M_ClearConditionSet(UINT8 set)
|
||||||
{
|
{
|
||||||
Z_Free(conditionSets[set - 1].condition);
|
if (conditionSets[set - 1].numconditions)
|
||||||
conditionSets[set - 1].condition = NULL;
|
{
|
||||||
conditionSets[set - 1].numconditions = 0;
|
Z_Free(conditionSets[set - 1].condition);
|
||||||
|
conditionSets[set - 1].condition = NULL;
|
||||||
|
conditionSets[set - 1].numconditions = 0;
|
||||||
|
}
|
||||||
conditionSets[set - 1].achieved = false;
|
conditionSets[set - 1].achieved = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -265,6 +265,35 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedRound(fixed_t x)
|
|||||||
return INT32_MAX;
|
return INT32_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief The xs_CRoundToInt function
|
||||||
|
|
||||||
|
\param val double number
|
||||||
|
|
||||||
|
\return Round toward nearest, but ties round toward even
|
||||||
|
*/
|
||||||
|
#if defined(SRB2_BIG_ENDIAN)
|
||||||
|
#define _xs_iexp_ 0
|
||||||
|
#define _xs_iman_ 1
|
||||||
|
#else
|
||||||
|
#define _xs_iexp_ 1 //intel is little endian
|
||||||
|
#define _xs_iman_ 0
|
||||||
|
#endif //BigEndian_
|
||||||
|
|
||||||
|
typedef double real64;
|
||||||
|
|
||||||
|
typedef union _xs_doubleints
|
||||||
|
{
|
||||||
|
real64 val;
|
||||||
|
unsigned ival[2];
|
||||||
|
} _xs_doubleints;
|
||||||
|
|
||||||
|
FUNCMATH FUNCINLINE static ATTRINLINE int xs_CRoundToInt(real64 val)
|
||||||
|
{
|
||||||
|
_xs_doubleints uval;
|
||||||
|
uval.val = val + 6755399441055744.0;
|
||||||
|
return uval.ival[_xs_iman_];
|
||||||
|
}
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
fixed_t x;
|
fixed_t x;
|
||||||
|
|||||||
+30
-24
@@ -186,8 +186,8 @@ static INT16 itemOn = 1; // menu item skull is on, Hack by Tails 09-18-2002
|
|||||||
static INT16 skullAnimCounter = 10; // skull animation counter
|
static INT16 skullAnimCounter = 10; // skull animation counter
|
||||||
static boolean interpTimerHackAllow = 0;
|
static boolean interpTimerHackAllow = 0;
|
||||||
|
|
||||||
static UINT8 setupcontrolplayer;
|
static UINT8 setupcontrolplayer;
|
||||||
static INT32 (*setupcontrols)[2]; // pointer to the gamecontrols of the player being edited
|
static INT32 (*setupcontrols)[2]; // pointer to the gamecontrols of the player being edited
|
||||||
|
|
||||||
// shhh... what am I doing... nooooo!
|
// shhh... what am I doing... nooooo!
|
||||||
static INT32 vidm_testingmode = 0;
|
static INT32 vidm_testingmode = 0;
|
||||||
@@ -201,8 +201,8 @@ static char setupm_ip[64];
|
|||||||
static textinput_t setupm_input_ip;
|
static textinput_t setupm_input_ip;
|
||||||
|
|
||||||
|
|
||||||
static fixed_t multi_tics;
|
static fixed_t multi_tics;
|
||||||
static state_t *multi_state;
|
static state_t *multi_state;
|
||||||
|
|
||||||
// this is set before entering the MultiPlayer setup menu,
|
// this is set before entering the MultiPlayer setup menu,
|
||||||
// for either player 1 or 2
|
// for either player 1 or 2
|
||||||
@@ -1024,9 +1024,9 @@ boolean M_Responder(event_t *ev)
|
|||||||
//case KEY_JOY1 + 2:
|
//case KEY_JOY1 + 2:
|
||||||
ch = KEY_ENTER;
|
ch = KEY_ENTER;
|
||||||
break;
|
break;
|
||||||
/*case KEY_JOY1 + 3: // Brake can function as 'n' for message boxes now.
|
/*case KEY_JOY1 + 3: // Brake can function as 'n' for message boxes now.
|
||||||
ch = 'n';
|
ch = 'n';
|
||||||
break;*/
|
break;*/
|
||||||
case KEY_MOUSE1 + 1:
|
case KEY_MOUSE1 + 1:
|
||||||
//case KEY_JOY1 + 1:
|
//case KEY_JOY1 + 1:
|
||||||
ch = KEY_BACKSPACE;
|
ch = KEY_BACKSPACE;
|
||||||
@@ -1305,12 +1305,21 @@ boolean M_Responder(event_t *ev)
|
|||||||
{
|
{
|
||||||
playback_last_menu_interaction_leveltime = leveltime;
|
playback_last_menu_interaction_leveltime = leveltime;
|
||||||
// Flip left/right with up/down for the playback menu, since it's a horizontal icon row.
|
// Flip left/right with up/down for the playback menu, since it's a horizontal icon row.
|
||||||
|
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case KEY_LEFTARROW: ch = KEY_UPARROW; break;
|
case KEY_LEFTARROW:
|
||||||
case KEY_UPARROW: ch = KEY_RIGHTARROW; break;
|
ch = KEY_UPARROW;
|
||||||
case KEY_RIGHTARROW: ch = KEY_DOWNARROW; break;
|
break;
|
||||||
case KEY_DOWNARROW: ch = KEY_LEFTARROW; break;
|
case KEY_UPARROW:
|
||||||
|
ch = KEY_RIGHTARROW;
|
||||||
|
break;
|
||||||
|
case KEY_RIGHTARROW:
|
||||||
|
ch = KEY_DOWNARROW;
|
||||||
|
break;
|
||||||
|
case KEY_DOWNARROW:
|
||||||
|
ch = KEY_LEFTARROW;
|
||||||
|
break;
|
||||||
|
|
||||||
// arbitrary keyboard shortcuts because fuck you
|
// arbitrary keyboard shortcuts because fuck you
|
||||||
|
|
||||||
@@ -1361,7 +1370,8 @@ boolean M_Responder(event_t *ev)
|
|||||||
G_AdjustView(4, 1, true);
|
G_AdjustView(4, 1, true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1486,6 +1496,7 @@ boolean M_Responder(event_t *ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
CON_Responder(ev);
|
CON_Responder(ev);
|
||||||
@@ -4719,7 +4730,7 @@ static void M_DrawReplayHut(void)
|
|||||||
if (y > scaledviewheight-80)
|
if (y > scaledviewheight-80)
|
||||||
{
|
{
|
||||||
V_DrawFill(BASEVIDWIDTH-4, 75, 4, scaledviewheight-80, V_SNAPTOTOP|V_SNAPTORIGHT|239);
|
V_DrawFill(BASEVIDWIDTH-4, 75, 4, scaledviewheight-80, V_SNAPTOTOP|V_SNAPTORIGHT|239);
|
||||||
V_DrawFill(BASEVIDWIDTH-3, 76 + (scaledviewheight-80) * replayhutmenuy / y, 2, max((((scaledviewheight-80) * (scaledviewheight-80))-1) / y - 1, 1), V_SNAPTOTOP|V_SNAPTORIGHT|229);
|
V_DrawFill(BASEVIDWIDTH-3, 76 + (scaledviewheight-80) * replayhutmenuy / y, 2, (((scaledviewheight-80) * (scaledviewheight-80))-1) / y - 1, V_SNAPTOTOP|V_SNAPTORIGHT|229);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the cursor
|
// Draw the cursor
|
||||||
@@ -5356,7 +5367,7 @@ void M_PopupMasterServerRules(void)
|
|||||||
{
|
{
|
||||||
firstDismissedRulesThisBoot = false;
|
firstDismissedRulesThisBoot = false;
|
||||||
M_StartMessage(va("%s\n(press any key)", rules), NULL, MM_NOTHING);
|
M_StartMessage(va("%s\n(press any key)", rules), NULL, MM_NOTHING);
|
||||||
free(rules);
|
Z_Free(rules);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -6560,22 +6571,17 @@ static void M_EraseGuest(INT32 choice)
|
|||||||
|
|
||||||
static void M_OverwriteGuest(const char *which)
|
static void M_OverwriteGuest(const char *which)
|
||||||
{
|
{
|
||||||
char *rguest;
|
char *rguest = Z_StrDup(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value)));
|
||||||
UINT8 *buf;
|
UINT8 *buf;
|
||||||
size_t len;
|
size_t len;
|
||||||
len = FIL_ReadFile(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), cv_chooseskin.string, which), &buf);
|
len = FIL_ReadFile(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), cv_chooseskin.string, which), &buf);
|
||||||
|
if (!len) {
|
||||||
if (!len)
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
rguest = Z_StrDup(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value)));
|
if (FIL_FileExists(rguest)) {
|
||||||
|
|
||||||
if (FIL_FileExists(rguest))
|
|
||||||
{
|
|
||||||
M_StopMessage(0);
|
M_StopMessage(0);
|
||||||
remove(rguest);
|
remove(rguest);
|
||||||
}
|
}
|
||||||
|
|
||||||
FIL_WriteFile(rguest, buf, len);
|
FIL_WriteFile(rguest, buf, len);
|
||||||
Z_Free(rguest);
|
Z_Free(rguest);
|
||||||
|
|
||||||
@@ -7592,6 +7598,7 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade)
|
|||||||
|
|
||||||
static void M_DrawServerMenu(void)
|
static void M_DrawServerMenu(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
M_DrawLevelSelectOnly(false, false);
|
M_DrawLevelSelectOnly(false, false);
|
||||||
#ifdef MASTERSERVER
|
#ifdef MASTERSERVER
|
||||||
if (currentMenu == &MP_ServerDef && cv_advertise.value) // Remind players where they're hosting.
|
if (currentMenu == &MP_ServerDef && cv_advertise.value) // Remind players where they're hosting.
|
||||||
@@ -10050,7 +10057,6 @@ static void M_DrawVideoMode(void)
|
|||||||
va("Wait %d second%s", testtime, (testtime > 1) ? "s" : ""));
|
va("Wait %d second%s", testtime, (testtime > 1) ? "s" : ""));
|
||||||
M_CentreText(OP_VideoModeDef.y + 158,
|
M_CentreText(OP_VideoModeDef.y + 158,
|
||||||
"or press ESC to return");
|
"or press ESC to return");
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1205,10 +1205,6 @@ static menuitem_t OP_FocusOptionsMenu[] =
|
|||||||
{IT_STRING|IT_CVAR, NULL, "Show \"FOCUS LOST\"", &cv_showfocuslost, 100},
|
{IT_STRING|IT_CVAR, NULL, "Show \"FOCUS LOST\"", &cv_showfocuslost, 100},
|
||||||
|
|
||||||
{IT_STRING|IT_CVAR, NULL, "Visible Mouse", &cv_mousevisible, 120},
|
{IT_STRING|IT_CVAR, NULL, "Visible Mouse", &cv_mousevisible, 120},
|
||||||
|
|
||||||
{IT_STRING|IT_CVAR, NULL, "Gamepad LED Color While Unfocused ", &cv_gamepadledifunfocused, 140},
|
|
||||||
{IT_STRING|IT_CVAR, NULL, "Gamepad Rumble While Unfocused", &cv_rumbleifunfocused, 150},
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* OP_FocusOptionsTooltips[] =
|
static const char* OP_FocusOptionsTooltips[] =
|
||||||
@@ -1220,8 +1216,6 @@ static const char* OP_FocusOptionsTooltips[] =
|
|||||||
"Set manual framerate cap while the game is unfocused.",
|
"Set manual framerate cap while the game is unfocused.",
|
||||||
"Should the FOCUS LOST window appear\n while the game is unfocused?",
|
"Should the FOCUS LOST window appear\n while the game is unfocused?",
|
||||||
"Displays the mouse cursor while the game is in focus.",
|
"Displays the mouse cursor while the game is in focus.",
|
||||||
"Should gamepad LED indicator change color when unfocused?",
|
|
||||||
"Should gamepad rumble apply when unfocused?",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static menuitem_t OP_DataOptionsMenu[] =
|
static menuitem_t OP_DataOptionsMenu[] =
|
||||||
|
|||||||
+2
-2
@@ -540,7 +540,7 @@ static boolean M_BackupConfig(const char *filename)
|
|||||||
void M_SaveConfig(const char *filename)
|
void M_SaveConfig(const char *filename)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
CLEANUP(Z_Pfree) char *filepath = NULL;
|
char *filepath;
|
||||||
|
|
||||||
// make sure not to write back the config until it's been correctly loaded
|
// make sure not to write back the config until it's been correctly loaded
|
||||||
if (!loaded_config)
|
if (!loaded_config)
|
||||||
@@ -558,7 +558,7 @@ void M_SaveConfig(const char *filename)
|
|||||||
// append srb2home to beginning of filename
|
// append srb2home to beginning of filename
|
||||||
// but check if srb2home isn't already there, first
|
// but check if srb2home isn't already there, first
|
||||||
if (!strstr(filename, srb2home))
|
if (!strstr(filename, srb2home))
|
||||||
filepath = Z_StrDup(va(pandf, srb2home, filename));
|
filepath = va(pandf,srb2home, filename);
|
||||||
else
|
else
|
||||||
filepath = Z_StrDup(filename);
|
filepath = Z_StrDup(filename);
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -219,9 +219,8 @@ static void Get_masterserver_rules(boolean checkfirst)
|
|||||||
if (HMS_fetch_rules(rules, sizeof rules))
|
if (HMS_fetch_rules(rules, sizeof rules))
|
||||||
{
|
{
|
||||||
Lock_state();
|
Lock_state();
|
||||||
if (MSRules)
|
Z_Free(MSRules);
|
||||||
free(MSRules);
|
MSRules = Z_StrDup(rules);
|
||||||
MSRules = strdup(rules);
|
|
||||||
|
|
||||||
if (MSRegistered == true)
|
if (MSRegistered == true)
|
||||||
{
|
{
|
||||||
@@ -508,7 +507,7 @@ char *GetMasterServerRules(void)
|
|||||||
char *rules;
|
char *rules;
|
||||||
|
|
||||||
Lock_state();
|
Lock_state();
|
||||||
rules = MSRules ? strdup(MSRules) : NULL;
|
rules = MSRules ? Z_StrDup(MSRules) : NULL;
|
||||||
Unlock_state();
|
Unlock_state();
|
||||||
|
|
||||||
return rules;
|
return rules;
|
||||||
|
|||||||
+3
-1
@@ -320,7 +320,9 @@ void P_AddGradesForMare(INT16 i, UINT8 mare, char *gtext)
|
|||||||
*/
|
*/
|
||||||
void P_DeleteGrades(INT16 i)
|
void P_DeleteGrades(INT16 i)
|
||||||
{
|
{
|
||||||
Z_Free(mapheaderinfo[i]->grades);
|
if (mapheaderinfo[i]->grades)
|
||||||
|
Z_Free(mapheaderinfo[i]->grades);
|
||||||
|
|
||||||
mapheaderinfo[i]->grades = NULL;
|
mapheaderinfo[i]->grades = NULL;
|
||||||
mapheaderinfo[i]->numGradedMares = 0;
|
mapheaderinfo[i]->numGradedMares = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -6221,7 +6221,8 @@ void P_SpawnSpecials(INT32 fromnetsave, boolean reloadinggamestate)
|
|||||||
|
|
||||||
// Allocate each list
|
// Allocate each list
|
||||||
for (i = 0; i < numsectors; i++)
|
for (i = 0; i < numsectors; i++)
|
||||||
Z_Free(secthinkers[i].thinkers);
|
if(secthinkers[i].thinkers)
|
||||||
|
Z_Free(secthinkers[i].thinkers);
|
||||||
|
|
||||||
Z_Free(secthinkers);
|
Z_Free(secthinkers);
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -1720,7 +1720,8 @@ void R_InitData(void)
|
|||||||
|
|
||||||
void R_ClearTextureNumCache(boolean btell)
|
void R_ClearTextureNumCache(boolean btell)
|
||||||
{
|
{
|
||||||
Z_Free(tidcache);
|
if (tidcache)
|
||||||
|
Z_Free(tidcache);
|
||||||
tidcache = NULL;
|
tidcache = NULL;
|
||||||
if (btell)
|
if (btell)
|
||||||
CONS_Debug(DBG_SETUP, "Fun Fact: There are %d textures used in this map.\n", tidcachelen);
|
CONS_Debug(DBG_SETUP, "Fun Fact: There are %d textures used in this map.\n", tidcachelen);
|
||||||
|
|||||||
+12
-8
@@ -925,11 +925,11 @@ void R_ExecuteSetViewSize(void)
|
|||||||
viewheight = vid.height;
|
viewheight = vid.height;
|
||||||
|
|
||||||
if (splitscreen)
|
if (splitscreen)
|
||||||
{
|
|
||||||
viewheight >>= 1;
|
viewheight >>= 1;
|
||||||
|
|
||||||
if (splitscreen > 1)
|
if (splitscreen > 1)
|
||||||
viewwidth >>= 1;
|
{
|
||||||
|
viewwidth >>= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
centerx = viewwidth/2;
|
centerx = viewwidth/2;
|
||||||
@@ -956,9 +956,13 @@ void R_ExecuteSetViewSize(void)
|
|||||||
screenheightarray[i] = (INT16)viewheight;
|
screenheightarray[i] = (INT16)viewheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_Free(ds_su);
|
if (ds_su)
|
||||||
Z_Free(ds_sv);
|
Z_Free(ds_su);
|
||||||
Z_Free(ds_sz);
|
if (ds_sv)
|
||||||
|
Z_Free(ds_sv);
|
||||||
|
if (ds_sz)
|
||||||
|
Z_Free(ds_sz);
|
||||||
|
|
||||||
ds_su = ds_sv = ds_sz = NULL;
|
ds_su = ds_sv = ds_sz = NULL;
|
||||||
|
|
||||||
memset(scalelight, 0xFF, sizeof(scalelight));
|
memset(scalelight, 0xFF, sizeof(scalelight));
|
||||||
@@ -1014,8 +1018,8 @@ static void R_InitViewMapping(void)
|
|||||||
|
|
||||||
for (INT32 i = 0; i < j; i++)
|
for (INT32 i = 0; i < j; i++)
|
||||||
{
|
{
|
||||||
fixed_t dy = abs(i - viewheight*8) << FRACBITS;
|
fixed_t dy = (i - viewheight*8)<<FRACBITS;
|
||||||
dy = FixedMul(dy, fovtan);
|
dy = FixedMul(abs(dy), fovtan);
|
||||||
yslopetab[i] = FixedDiv(centerx*FRACUNIT, dy);
|
yslopetab[i] = FixedDiv(centerx*FRACUNIT, dy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -405,8 +405,10 @@ static void Patch_FreeData(patch_t *patch)
|
|||||||
}*/
|
}*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Z_Free(patch->columnofs);
|
if (patch->columnofs)
|
||||||
Z_Free(patch->columns);
|
Z_Free(patch->columnofs);
|
||||||
|
if (patch->columns)
|
||||||
|
Z_Free(patch->columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Patch_Free(patch_t *patch)
|
void Patch_Free(patch_t *patch)
|
||||||
|
|||||||
+5
-8
@@ -57,11 +57,8 @@ visffloor_t visffloor[MAXFFLOORS] = {};
|
|||||||
INT32 numffloors = 0;
|
INT32 numffloors = 0;
|
||||||
|
|
||||||
//SoM: 3/23/2000: Boom visplane hashing routine.
|
//SoM: 3/23/2000: Boom visplane hashing routine.
|
||||||
constexpr unsigned int visplane_hash(const unsigned int picnum, const unsigned int lightlevel,
|
#define visplane_hash(picnum,lightlevel,height) \
|
||||||
const unsigned int height)
|
((unsigned)((picnum)*3+(lightlevel)+(height)*7) & VISPLANEHASHMASK)
|
||||||
{
|
|
||||||
return ((picnum * 3) + lightlevel + (height * 7)) & VISPLANEHASHMASK;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Clip values are the solid pixel bounding the range.
|
// Clip values are the solid pixel bounding the range.
|
||||||
@@ -139,7 +136,7 @@ void R_AllocPlaneMemory(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
yslopetab = static_cast<fixed_t*>(Z_Realloc(yslopetab, sizeof(*yslopetab) * (viewheight * 16), PU_STATIC, NULL));
|
yslopetab = static_cast<fixed_t*>(Z_Realloc(yslopetab, sizeof(*yslopetab) * (viewheight * 16), PU_STATIC, NULL));
|
||||||
spanstart = static_cast<INT32*>(Z_Realloc(spanstart, sizeof(*spanstart) * viewheight, PU_STATIC, NULL));
|
spanstart = static_cast<fixed_t*>(Z_Realloc(spanstart, sizeof(*spanstart) * viewheight, PU_STATIC, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -454,7 +451,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hash = visplane_hash(picnum, lightlevel, height >> FRACBITS);
|
hash = visplane_hash(picnum, lightlevel, height);
|
||||||
|
|
||||||
for (check = visplanes[hash]; check; check = check->next)
|
for (check = visplanes[hash]; check; check = check->next)
|
||||||
{
|
{
|
||||||
@@ -565,7 +562,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned hash = visplane_hash(pl->picnum, pl->lightlevel, pl->height >> FRACBITS);
|
unsigned hash = visplane_hash(pl->picnum, pl->lightlevel, pl->height);
|
||||||
new_pl = new_visplane(hash);
|
new_pl = new_visplane(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -2880,7 +2880,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||||||
if (markceiling)
|
if (markceiling)
|
||||||
{
|
{
|
||||||
if (ceilingplane) //SoM: 3/29/2000: Check for null ceiling planes
|
if (ceilingplane) //SoM: 3/29/2000: Check for null ceiling planes
|
||||||
ceilingplane = R_CheckPlane(ceilingplane, rw_x, rw_stopx-1);
|
ceilingplane = R_CheckPlane (ceilingplane, rw_x, rw_stopx-1);
|
||||||
else
|
else
|
||||||
markceiling = false;
|
markceiling = false;
|
||||||
|
|
||||||
@@ -2894,7 +2894,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||||||
if (markfloor)
|
if (markfloor)
|
||||||
{
|
{
|
||||||
if (floorplane) //SoM: 3/29/2000: Check for null planes
|
if (floorplane) //SoM: 3/29/2000: Check for null planes
|
||||||
floorplane = R_CheckPlane(floorplane, rw_x, rw_stopx-1);
|
floorplane = R_CheckPlane (floorplane, rw_x, rw_stopx-1);
|
||||||
else
|
else
|
||||||
markfloor = false;
|
markfloor = false;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -391,7 +391,7 @@ boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16
|
|||||||
|
|
||||||
// allocate space for the frames present and copy sprtemp to it
|
// allocate space for the frames present and copy sprtemp to it
|
||||||
if (spritedef->numframes && // has been allocated
|
if (spritedef->numframes && // has been allocated
|
||||||
spritedef->numframes < maxframe) // more frames are defined ?
|
spritedef->numframes < maxframe) // more frames are defined ?
|
||||||
{
|
{
|
||||||
|
|
||||||
Z_Free(spritedef->spriteframes);
|
Z_Free(spritedef->spriteframes);
|
||||||
|
|||||||
@@ -1841,15 +1841,18 @@ static void I_Fork(void)
|
|||||||
I_RegisterChildSignals();
|
I_RegisterChildSignals();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
#ifdef LOGMESSAGES
|
|
||||||
if (logstream)
|
if (logstream)
|
||||||
fclose(logstream);/* the child has this */
|
fclose(logstream);/* the child has this */
|
||||||
#endif
|
|
||||||
c = wait(&status);
|
c = wait(&status);
|
||||||
|
|
||||||
#ifdef LOGMESSAGES
|
#ifdef LOGMESSAGES
|
||||||
/* By the way, exit closes files. */
|
/* By the way, exit closes files. */
|
||||||
logstream = fopen(logfilename, "at");
|
logstream = fopen(logfilename, "at");
|
||||||
|
#else
|
||||||
|
logstream = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
{
|
{
|
||||||
kill(child, SIGKILL);
|
kill(child, SIGKILL);
|
||||||
|
|||||||
+3
-1
@@ -3716,7 +3716,9 @@ void V_DoPostProcessor(INT32 view, INT32 param)
|
|||||||
// Make sure table is built
|
// Make sure table is built
|
||||||
if (heatshifter == NULL || lastheight != viewheight)
|
if (heatshifter == NULL || lastheight != viewheight)
|
||||||
{
|
{
|
||||||
Z_Free(heatshifter);
|
if (heatshifter)
|
||||||
|
Z_Free(heatshifter);
|
||||||
|
|
||||||
heatshifter = Z_Calloc(viewheight * sizeof(boolean), PU_STATIC, NULL);
|
heatshifter = Z_Calloc(viewheight * sizeof(boolean), PU_STATIC, NULL);
|
||||||
|
|
||||||
for (y = 0; y < viewheight; y++)
|
for (y = 0; y < viewheight; y++)
|
||||||
|
|||||||
+4
-3
@@ -122,9 +122,7 @@ void W_Shutdown(void)
|
|||||||
|
|
||||||
if (wad->handle)
|
if (wad->handle)
|
||||||
fclose(wad->handle);
|
fclose(wad->handle);
|
||||||
|
|
||||||
Z_Free(wad->filename);
|
Z_Free(wad->filename);
|
||||||
|
|
||||||
while (wad->numlumps--)
|
while (wad->numlumps--)
|
||||||
{
|
{
|
||||||
Z_Free(wad->lumpinfo[wad->numlumps].longname);
|
Z_Free(wad->lumpinfo[wad->numlumps].longname);
|
||||||
@@ -2732,7 +2730,10 @@ void vres_Free(virtres_t* vres)
|
|||||||
|
|
||||||
while (vres->numlumps--)
|
while (vres->numlumps--)
|
||||||
{
|
{
|
||||||
Z_Free(vres->vlumps[vres->numlumps].data);
|
if (vres->vlumps[vres->numlumps].data)
|
||||||
|
{
|
||||||
|
Z_Free(vres->vlumps[vres->numlumps].data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_Free(vres->vlumps);
|
Z_Free(vres->vlumps);
|
||||||
|
|||||||
+1
-1
@@ -91,7 +91,7 @@ void Z_Init(void);
|
|||||||
|
|
||||||
// Z_Free and alloc with alignment
|
// Z_Free and alloc with alignment
|
||||||
#ifdef ZDEBUG
|
#ifdef ZDEBUG
|
||||||
#define Z_Free(p) Z_Free2(p, __FILE__, __LINE__)
|
#define Z_Free(p) Z_Free2(p, __FILE__, __LINE__)
|
||||||
#define Z_Malloc(s,t,u) Z_Malloc2(s, t, u, __FILE__, __LINE__)
|
#define Z_Malloc(s,t,u) Z_Malloc2(s, t, u, __FILE__, __LINE__)
|
||||||
#define Z_Calloc(s,t,u) Z_Calloc2(s, t, u, __FILE__, __LINE__)
|
#define Z_Calloc(s,t,u) Z_Calloc2(s, t, u, __FILE__, __LINE__)
|
||||||
#define Z_Realloc(p,s,t,u) Z_Realloc2(p,s, t, u, __FILE__, __LINE__)
|
#define Z_Realloc(p,s,t,u) Z_Realloc2(p,s, t, u, __FILE__, __LINE__)
|
||||||
|
|||||||
Reference in new issue
Block a user