Merge branch 'dontdothisinsoftwarelol' into 'next'

don't HWR_ClearAllTextures() in software (fixes #389)

Closes #389

See merge request STJr/SRB2!1440
This commit is contained in:
LJ Sonic 2021-03-31 16:19:18 -04:00
commit 99c773f39e
2 changed files with 11 additions and 2 deletions

View file

@ -4135,7 +4135,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
#ifdef HWRENDER
// Free GPU textures before freeing patches.
if (vid.glstate == VID_GL_LIBRARY_LOADED)
if (rendermode == render_opengl && (vid.glstate == VID_GL_LIBRARY_LOADED))
HWR_ClearAllTextures();
#endif
@ -4500,7 +4500,7 @@ boolean P_AddWadFile(const char *wadfilename)
#ifdef HWRENDER
// Free GPU textures before freeing patches.
if (vid.glstate == VID_GL_LIBRARY_LOADED)
if (rendermode == render_opengl && (vid.glstate == VID_GL_LIBRARY_LOADED))
HWR_ClearAllTextures();
#endif

View file

@ -33,6 +33,11 @@
#include "s_sound.h" // ditto
#include "g_game.h" // ditto
#include "p_local.h" // P_AutoPause()
#ifdef HWRENDER
#include "hardware/hw_main.h"
#include "hardware/hw_light.h"
#include "hardware/hw_model.h"
#endif
#if defined (USEASM) && !defined (NORUSEASM)//&& (!defined (_MSC_VER) || (_MSC_VER <= 1200))
@ -423,6 +428,10 @@ void SCR_ChangeRenderer(void)
CONS_Alert(CONS_ERROR, "OpenGL never loaded\n");
return;
}
if (rendermode == render_opengl && (vid.glstate == VID_GL_LIBRARY_LOADED)) // Clear these out before switching to software
HWR_ClearAllTextures();
#endif
// Set the new render mode