Kill RESETDATA

This commit is contained in:
Gustaf Alhäll authored and Alug committed 2025-09-15 14:07:21 +02:00
1 parent a80f702bb8
commit dee91ed1ef
5 files changed
+1 -85

No files matched your search

-3
View File
@@ -1794,9 +1794,6 @@ void D_SRB2Main(void)
I_InitializeTime();
setlocale(LC_TIME, "");
// Make backups of some SOCcable tables.
P_BackupTables();
// Setup default unlockable conditions
M_SetupDefaultConditionSets();
+1 -1
View File
@@ -2631,7 +2631,7 @@ static void readmaincfg(MYFILE *f)
}
else if (fastcmp(word, "RESETDATA"))
{
P_ResetData(value);
CONS_Alert(CONS_WARNING, M_GetText("RESETDATA is obsolete and no longer has any effect.\n"));
}
else if (fastcmp(word, "CUSTOMVERSION"))
{
-7
View File
@@ -626,13 +626,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// Most modifications should probably enable this.
//#define SAVEGAME_OTHERVERSIONS
/// Allow the use of the SOC RESETINFO command.
/// \note Builds that are tight on memory should disable this.
/// This stops the game from storing backups of the states, sprites, and mobjinfo tables.
/// Though this info is compressed under normal circumstances, it's still a lot of extra
/// memory that never gets touched.
#define ALLOW_RESETDATA
#ifndef NONET
/// Display a connection screen on join attempts.
#define CLIENT_LOADINGSCREEN
-70
View File
@@ -20176,73 +20176,3 @@ void P_PatchInfoTables(void)
for (i = MT_FIRSTFREESLOT; i <= MT_LASTFREESLOT; i++)
mobjinfo[i].doomednum = -1;
}
#ifdef ALLOW_RESETDATA
static char *sprnamesbackup;
static state_t *statesbackup;
static mobjinfo_t *mobjinfobackup;
static size_t sprnamesbackupsize, statesbackupsize, mobjinfobackupsize;
#endif
void P_BackupTables(void)
{
#ifdef ALLOW_RESETDATA
// Allocate buffers in size equal to that of the uncompressed data to begin with
sprnamesbackup = Z_Malloc(sizeof(sprnames), PU_STATIC, NULL);
statesbackup = Z_Malloc(sizeof(states), PU_STATIC, NULL);
mobjinfobackup = Z_Malloc(sizeof(mobjinfo), PU_STATIC, NULL);
// Sprite names
sprnamesbackupsize = lzf_compress(sprnames, sizeof(sprnames), sprnamesbackup, sizeof(sprnames));
if (sprnamesbackupsize > 0)
sprnamesbackup = Z_Realloc(sprnamesbackup, sprnamesbackupsize, PU_STATIC, NULL);
else
M_Memcpy(sprnamesbackup, sprnames, sizeof(sprnames));
// States
statesbackupsize = lzf_compress(states, sizeof(states), statesbackup, sizeof(states));
if (statesbackupsize > 0)
statesbackup = Z_Realloc(statesbackup, statesbackupsize, PU_STATIC, NULL);
else
M_Memcpy(statesbackup, states, sizeof(states));
// Mobj info
mobjinfobackupsize = lzf_compress(mobjinfo, sizeof(mobjinfo), mobjinfobackup, sizeof(mobjinfo));
if (mobjinfobackupsize > 0)
mobjinfobackup = Z_Realloc(mobjinfobackup, mobjinfobackupsize, PU_STATIC, NULL);
else
M_Memcpy(mobjinfobackup, mobjinfo, sizeof(mobjinfo));
#endif
}
void P_ResetData(INT32 flags)
{
#ifndef ALLOW_RESETDATA
(void)flags;
CONS_Alert(CONS_NOTICE, M_GetText("P_ResetData(): not supported in this build.\n"));
#else
if (flags & 1)
{
if (sprnamesbackupsize > 0)
lzf_decompress(sprnamesbackup, sprnamesbackupsize, sprnames, sizeof(sprnames));
else
M_Memcpy(sprnames, sprnamesbackup, sizeof(sprnamesbackup));
}
if (flags & 2)
{
if (statesbackupsize > 0)
lzf_decompress(statesbackup, statesbackupsize, states, sizeof(states));
else
M_Memcpy(states, statesbackup, sizeof(statesbackup));
}
if (flags & 4)
{
if (mobjinfobackupsize > 0)
lzf_decompress(mobjinfobackup, mobjinfobackupsize, mobjinfo, sizeof(mobjinfo));
else
M_Memcpy(mobjinfo, mobjinfobackup, sizeof(mobjinfobackup));
}
#endif
}
-4
View File
@@ -5147,8 +5147,4 @@ extern mobjinfo_t mobjinfo[NUMMOBJTYPES];
void P_PatchInfoTables(void);
void P_BackupTables(void);
void P_ResetData(INT32 flags);
#endif