From ac12a06de40a1f4e7f4c5c6845efdd6d1ec98507 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 25 Nov 2011 09:49:22 +0000 Subject: [PATCH] Fix calling glEnable() without checking for the rendering mode in the tile selector. This could lead to a crash when OpenGL wasn't initialized before. git-svn-id: https://svn.eduke32.com/eduke32@2117 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/astub.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 89123b8ba..93d76fe9b 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -4202,12 +4202,16 @@ static int32_t DrawTiles(int32_t iTopLeft, int32_t iSelected, int32_t nXTiles, i int32_t runi=0, usehitile; static uint8_t loadedhitile[(MAXTILES+7)>>3]; - setpolymost2dview(); #ifdef USE_OPENGL - bglEnable(GL_TEXTURE_2D); + setpolymost2dview(); - if (rendmode >= 3 && g_lazy_tileselector) - bglDrawBuffer(GL_FRONT_AND_BACK); + if (rendmode >= 3) + { + bglEnable(GL_TEXTURE_2D); + + if (g_lazy_tileselector) + bglDrawBuffer(GL_FRONT_AND_BACK); + } #endif clearview(0);