From aa8ce8d42accbcd793f0f4147b460045b1b5d333 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 8 Sep 2019 01:01:22 +0000 Subject: [PATCH] Fix USE_OPENGL=0 builds git-svn-id: https://svn.eduke32.com/eduke32@8082 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/baselayer.h | 1 + source/build/include/build.h | 7 ++++--- source/build/src/engine.cpp | 5 ++--- source/duke3d/src/game.cpp | 4 ++++ source/duke3d/src/startwin.game.cpp | 2 ++ 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/source/build/include/baselayer.h b/source/build/include/baselayer.h index 82ed71556..6c0656b98 100644 --- a/source/build/include/baselayer.h +++ b/source/build/include/baselayer.h @@ -26,6 +26,7 @@ extern int32_t g_maskDrawMode; extern char quitevent, appactive; extern char modechange; +extern char nogl; extern int32_t vsync; extern int32_t r_borderless; diff --git a/source/build/include/build.h b/source/build/include/build.h index 2fd9602cc..a9c45ecb5 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -1364,6 +1364,8 @@ enum cutsceneflags { CUTSCENE_TEXTUREFILTER = 4, }; +extern int32_t benchmarkScreenshot; + #ifdef USE_OPENGL extern int32_t glanisotropy; extern int32_t gltexfiltermode; @@ -1380,8 +1382,6 @@ extern int32_t gltexmaxsize; void gltexapplyprops (void); void texcache_invalidate(void); -extern int32_t benchmarkScreenshot; - # ifdef USE_GLEXT extern int32_t r_detailmapping; extern int32_t r_glowmapping; @@ -1455,8 +1455,9 @@ static FORCE_INLINE int32_t md_tilehasmodel(int32_t const tilenume, int32_t cons } #endif // defined USE_OPENGL -static FORCE_INLINE bool tilehasmodelorvoxel(int const tilenume, int const pal) +static FORCE_INLINE bool tilehasmodelorvoxel(int const tilenume, int pal) { + UNREFERENCED_PARAMETER(pal); return #ifdef USE_OPENGL (videoGetRenderMode() >= REND_POLYMOST && mdinited && usemodels && tile2model[Ptile2tile(tilenume, pal)].modelid != -1) || diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 9149d3ecd..4c72fbccf 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -8812,6 +8812,7 @@ void renderDrawMasks(void) int32_t i = spritesortcnt-1; int32_t numSprites = spritesortcnt; +#ifdef USE_OPENGL if (videoGetRenderMode() == REND_POLYMOST) { spritesortcnt = 0; @@ -8829,6 +8830,7 @@ void renderDrawMasks(void) } } } else +#endif { for (; i >= 0; --i) { @@ -10368,7 +10370,6 @@ static void videoAllocateBuffers(void) if (videoGetRenderMode() == REND_CLASSIC) { # ifdef USE_OPENGL - extern char nogl; if (!nogl) { glsurface_initialize({ xdim, ydim }); @@ -10417,8 +10418,6 @@ int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daups int32_t j; #ifdef USE_OPENGL - extern char nogl; - if (nogl) dabpp = 8; #endif daupscaledxdim = max(320, daupscaledxdim); diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 1f4e61382..c20c6f5a5 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -801,7 +801,9 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) CAMERA(q16ang) = fix16_from_int(actor[ud.camerasprite].tempang + mulscale16(((pSprite->ang + 1024 - actor[ud.camerasprite].tempang) & 2047) - 1024, smoothRatio)); +#ifdef USE_OPENGL renderSetRollAngle(0); +#endif int const noDraw = VM_OnEventWithReturn(EVENT_DISPLAYROOMSCAMERA, ud.camerasprite, playerNum, 0); @@ -951,10 +953,12 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) #endif pPlayer->orotscrnang = pPlayer->rotscrnang; } +#ifdef USE_OPENGL else { renderSetRollAngle(0); } +#endif } if (pPlayer->newowner < 0) diff --git a/source/duke3d/src/startwin.game.cpp b/source/duke3d/src/startwin.game.cpp index 65713419e..ac6bd3a58 100644 --- a/source/duke3d/src/startwin.game.cpp +++ b/source/duke3d/src/startwin.game.cpp @@ -702,7 +702,9 @@ int32_t startwin_run(void) if (done) { ud.setup = settings.shared; +#ifdef USE_OPENGL glrendmode = (settings.polymer) ? REND_POLYMER : REND_POLYMOST; +#endif g_selectedGrp = settings.grp; Bstrcpy(g_modDir, (g_noSetup == 0 && settings.gamedir != NULL) ? settings.gamedir : "/"); }