diff --git a/src/d_main.c b/src/d_main.c index da2c7bd7d..a6a38d413 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -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(); diff --git a/src/dehacked.c b/src/dehacked.c index 44f0b5275..442e6d0d4 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -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")) { diff --git a/src/doomdef.h b/src/doomdef.h index 73184c26f..4ba11d590 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -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 diff --git a/src/info.c b/src/info.c index faf52b057..f7e0306da 100644 --- a/src/info.c +++ b/src/info.c @@ -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 -} diff --git a/src/info.h b/src/info.h index 69a0a9dcf..4ee851cee 100644 --- a/src/info.h +++ b/src/info.h @@ -5147,8 +5147,4 @@ extern mobjinfo_t mobjinfo[NUMMOBJTYPES]; void P_PatchInfoTables(void); -void P_BackupTables(void); - -void P_ResetData(INT32 flags); - #endif