Always reload texture arrays on renderer switch and bring back ingame renderer hotswapping
All this texture load blocking var does is cause issues due to order of operations and what not. Lets just kill it. Thanks Alug for looking at this stuff for me!
This commit is contained in:
parent
0115ac230d
commit
03b26a0723
6 changed files with 1 additions and 20 deletions
|
|
@ -595,14 +595,11 @@ static void D_Display(void)
|
|||
// STUPID race condition...
|
||||
{
|
||||
wipegamestate = gamestate;
|
||||
cansetrender = true;
|
||||
|
||||
// clean up border stuff
|
||||
// see if the border needs to be initially drawn
|
||||
if (gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction && curbghide && (!hidetitlemap)))
|
||||
{
|
||||
// Rendering a level; don't allow renderer changes!
|
||||
cansetrender = false;
|
||||
|
||||
D_RenderLevel();
|
||||
|
||||
|
|
|
|||
|
|
@ -620,7 +620,6 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm
|
|||
static size_t gl_numtextures = 0; // Texture count
|
||||
static GLMapTexture_t *gl_textures; // For all textures
|
||||
static GLMapTexture_t *gl_flats; // For all (texture) flats, as normal flats don't need to be cached
|
||||
boolean gl_maptexturesloaded = false;
|
||||
|
||||
void HWR_FreeTextureData(patch_t *patch)
|
||||
{
|
||||
|
|
@ -748,7 +747,6 @@ void HWR_InitMapTextures(void)
|
|||
{
|
||||
gl_textures = NULL;
|
||||
gl_flats = NULL;
|
||||
gl_maptexturesloaded = false;
|
||||
}
|
||||
|
||||
static void FreeMapTexture(GLMapTexture_t *tex)
|
||||
|
|
@ -778,7 +776,6 @@ void HWR_FreeMapTextures(void)
|
|||
gl_textures = NULL;
|
||||
gl_flats = NULL;
|
||||
gl_numtextures = 0;
|
||||
gl_maptexturesloaded = false;
|
||||
}
|
||||
|
||||
static void HWR_PrecacheLevelFlats(void)
|
||||
|
|
@ -1025,8 +1022,6 @@ void HWR_LoadMapTextures(size_t pnumtextures)
|
|||
|
||||
if (gl_textures == NULL || gl_flats == NULL)
|
||||
I_Error("HWR_LoadMapTextures: ran out of memory for OpenGL textures");
|
||||
|
||||
gl_maptexturesloaded = true;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -6519,8 +6519,7 @@ void HWR_Switch(void)
|
|||
HWD.pfnSetSpecialState(HWD_SET_TEXTUREANISOTROPICMODE, cv_glanisotropicmode.value);
|
||||
|
||||
// Load textures
|
||||
if (!gl_maptexturesloaded)
|
||||
HWR_LoadMapTextures(numtextures);
|
||||
HWR_LoadMapTextures(numtextures);
|
||||
|
||||
// Create plane polygons
|
||||
if (!gl_maploaded && levelloaded)
|
||||
|
|
|
|||
|
|
@ -147,7 +147,6 @@ extern precise_t ps_hw_batchdrawtime;
|
|||
|
||||
extern boolean gl_init;
|
||||
extern boolean gl_maploaded;
|
||||
extern boolean gl_maptexturesloaded;
|
||||
extern boolean gl_sessioncommandsadded;
|
||||
extern boolean gl_shadersavailable;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@
|
|||
viddef_t vid;
|
||||
INT32 setmodeneeded; //video mode change needed if > 0 (the mode number to set + 1)
|
||||
UINT8 setrenderneeded = 0;
|
||||
boolean cansetrender = true;
|
||||
|
||||
//added : 03-02-98: default screen mode, as loaded/saved in config
|
||||
consvar_t cv_scr_width = CVAR_INIT ("scr_width", "640", CV_SAVE, CV_Unsigned, NULL);
|
||||
|
|
@ -497,13 +496,6 @@ void SCR_ChangeRenderer(void)
|
|||
|| (signed)rendermode == cv_renderer.value)
|
||||
return;
|
||||
|
||||
if (!cansetrender)
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, "You cannot change renderers at the moment.\n");
|
||||
CV_SetValue(&cv_renderer, (signed)rendermode);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HWRENDER
|
||||
// Check if OpenGL loaded successfully (or wasn't disabled) before switching to it.
|
||||
if ((vid.glstate == VID_GL_LIBRARY_ERROR)
|
||||
|
|
|
|||
|
|
@ -88,7 +88,6 @@ enum
|
|||
extern viddef_t vid;
|
||||
extern INT32 setmodeneeded; // mode number to set if needed, or 0
|
||||
extern UINT8 setrenderneeded;
|
||||
extern boolean cansetrender;
|
||||
|
||||
extern double averageFPS;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue