make texture precache toggable

This commit is contained in:
Alug committed 2025-02-16 15:38:08 +01:00
1 parent 4ef6c2ea34
commit 83b242a727
7 files changed
+12 -15

No files matched your search

+1 -5
View File
@@ -2968,9 +2968,6 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
CON_LogMessage(M_GetText("Speeding off to level...\n"));
}
if (demo.playback && !demo.timing)
precachetextures = false;
if (resetplayer)
{
if (!FLS || (netgame || multiplayer))
@@ -2986,8 +2983,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
demo.savemode = (cv_recordmultiplayerdemos.value == 2) ? DSM_WILLAUTOSAVE : DSM_NOTSAVING;
demo.savebutton = 0;
G_InitNew(pencoremode, mapname, resetplayer, skipprecutscene);
if (demo.playback && !demo.timing)
precachetextures = true;
if (demo.timing)
G_DoneLevelLoad();
-3
View File
@@ -541,9 +541,6 @@ extern FILE *debugfile;
extern INT32 debugload;
#endif
// if true, load all graphics at level load
extern boolean precachetextures;
// wipegamestate can be set to -1
// to force a wipe on the next draw
extern gamestate_t wipegamestate;
-2
View File
@@ -330,8 +330,6 @@ static struct {
// There is no conflict here.
demoghost *ghosts = NULL;
boolean precachetextures = true; // if true, load all graphics at start
INT16 prevmap, nextmap;
// save if director is enabled
+1 -1
View File
@@ -2972,7 +2972,7 @@ boolean P_SetupLevel(boolean skipprecip, boolean reloadinggamestate)
if (rendermode != render_none && !reloadinggamestate)
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
if (precachetextures)
if (cv_precachetextures.value)
R_PrecacheLevel();
nextmapoverride = 0;
+4 -4
View File
@@ -1632,6 +1632,10 @@ void R_PrecacheLevel(void)
thinker_t *th;
spriteframe_t *sf;
// do not flush the memory, Z_Malloc twice with same user will cause error in Z_CheckHeap()
if (rendermode == render_none)
return;
if (demo.playback)
return;
@@ -1643,10 +1647,6 @@ void R_PrecacheLevel(void)
}
#endif
// do not flush the memory, Z_Malloc twice with same user will cause error in Z_CheckHeap()
if (rendermode != render_soft)
return;
// Precache flats.
flatmemory = P_PrecacheLevelFlats();
+5
View File
@@ -164,6 +164,9 @@ static void Precipstuff_OnChange(void);
consvar_t cv_tailspickup = {"tailspickup", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// if enabled, load all graphics at level load
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},
{"chasecam2", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
@@ -1532,6 +1535,8 @@ void R_RegisterEngineStuff(void)
if (dedicated)
return;
CV_RegisterVar(&cv_precachetextures);
CV_RegisterVar(&cv_translucency);
CV_RegisterVar(&cv_drawdist);
CV_RegisterVar(&cv_drawdist_precip);
+1
View File
@@ -174,6 +174,7 @@ extern ps_metric_t ps_numpolyobjects;
// REFRESH - the actual rendering functions.
//
extern consvar_t cv_precachetextures;
extern consvar_t cv_showhud, cv_translucenthud, cv_uncappedhud;
extern consvar_t cv_homremoval;
extern consvar_t cv_chasecam[MAXSPLITSCREENPLAYERS];