engine.cpp: fix crash when calling setrendermode 3 where PolymostProcessVoxels would be called before Polymost is initialized.

PolymostProcessVoxels would call videoNextPage during processing which would attempt to render the OSD and lead to a segfault due to Polymost not being properly initialized.

git-svn-id: https://svn.eduke32.com/eduke32@7067 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
pogokeen 2018-10-10 21:04:42 +00:00
parent 7b1cdb6f12
commit 4b89c095e2

View file

@ -9954,13 +9954,13 @@ int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daups
if (searchx < 0) { searchx = halfxdimen; searchy = (ydimen>>1); } if (searchx < 0) { searchx = halfxdimen; searchy = (ydimen>>1); }
#ifdef USE_OPENGL #ifdef USE_OPENGL
if (videoGetRenderMode() == REND_POLYMOST)
PolymostProcessVoxels();
if (videoGetRenderMode() >= REND_POLYMOST) if (videoGetRenderMode() >= REND_POLYMOST)
{ {
polymost_glreset(); polymost_glreset();
polymost_glinit(); polymost_glinit();
if (videoGetRenderMode() == REND_POLYMOST)
PolymostProcessVoxels();
} }
# ifdef POLYMER # ifdef POLYMER
if (videoGetRenderMode() == REND_POLYMER) if (videoGetRenderMode() == REND_POLYMER)