Fix USE_OPENGL=0 builds

git-svn-id: https://svn.eduke32.com/eduke32@8082 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-09-08 01:01:22 +00:00 committed by Christoph Oelckers
parent 0baced1d6c
commit aa8ce8d42a
5 changed files with 13 additions and 6 deletions

View file

@ -26,6 +26,7 @@ extern int32_t g_maskDrawMode;
extern char quitevent, appactive; extern char quitevent, appactive;
extern char modechange; extern char modechange;
extern char nogl;
extern int32_t vsync; extern int32_t vsync;
extern int32_t r_borderless; extern int32_t r_borderless;

View file

@ -1364,6 +1364,8 @@ enum cutsceneflags {
CUTSCENE_TEXTUREFILTER = 4, CUTSCENE_TEXTUREFILTER = 4,
}; };
extern int32_t benchmarkScreenshot;
#ifdef USE_OPENGL #ifdef USE_OPENGL
extern int32_t glanisotropy; extern int32_t glanisotropy;
extern int32_t gltexfiltermode; extern int32_t gltexfiltermode;
@ -1380,8 +1382,6 @@ extern int32_t gltexmaxsize;
void gltexapplyprops (void); void gltexapplyprops (void);
void texcache_invalidate(void); void texcache_invalidate(void);
extern int32_t benchmarkScreenshot;
# ifdef USE_GLEXT # ifdef USE_GLEXT
extern int32_t r_detailmapping; extern int32_t r_detailmapping;
extern int32_t r_glowmapping; 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 #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 return
#ifdef USE_OPENGL #ifdef USE_OPENGL
(videoGetRenderMode() >= REND_POLYMOST && mdinited && usemodels && tile2model[Ptile2tile(tilenume, pal)].modelid != -1) || (videoGetRenderMode() >= REND_POLYMOST && mdinited && usemodels && tile2model[Ptile2tile(tilenume, pal)].modelid != -1) ||

View file

@ -8812,6 +8812,7 @@ void renderDrawMasks(void)
int32_t i = spritesortcnt-1; int32_t i = spritesortcnt-1;
int32_t numSprites = spritesortcnt; int32_t numSprites = spritesortcnt;
#ifdef USE_OPENGL
if (videoGetRenderMode() == REND_POLYMOST) if (videoGetRenderMode() == REND_POLYMOST)
{ {
spritesortcnt = 0; spritesortcnt = 0;
@ -8829,6 +8830,7 @@ void renderDrawMasks(void)
} }
} }
} else } else
#endif
{ {
for (; i >= 0; --i) for (; i >= 0; --i)
{ {
@ -10368,7 +10370,6 @@ static void videoAllocateBuffers(void)
if (videoGetRenderMode() == REND_CLASSIC) if (videoGetRenderMode() == REND_CLASSIC)
{ {
# ifdef USE_OPENGL # ifdef USE_OPENGL
extern char nogl;
if (!nogl) if (!nogl)
{ {
glsurface_initialize({ xdim, ydim }); glsurface_initialize({ xdim, ydim });
@ -10417,8 +10418,6 @@ int32_t videoSetGameMode(char davidoption, int32_t daupscaledxdim, int32_t daups
int32_t j; int32_t j;
#ifdef USE_OPENGL #ifdef USE_OPENGL
extern char nogl;
if (nogl) dabpp = 8; if (nogl) dabpp = 8;
#endif #endif
daupscaledxdim = max(320, daupscaledxdim); daupscaledxdim = max(320, daupscaledxdim);

View file

@ -801,7 +801,9 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
CAMERA(q16ang) = fix16_from_int(actor[ud.camerasprite].tempang CAMERA(q16ang) = fix16_from_int(actor[ud.camerasprite].tempang
+ mulscale16(((pSprite->ang + 1024 - actor[ud.camerasprite].tempang) & 2047) - 1024, smoothRatio)); + mulscale16(((pSprite->ang + 1024 - actor[ud.camerasprite].tempang) & 2047) - 1024, smoothRatio));
#ifdef USE_OPENGL
renderSetRollAngle(0); renderSetRollAngle(0);
#endif
int const noDraw = VM_OnEventWithReturn(EVENT_DISPLAYROOMSCAMERA, ud.camerasprite, playerNum, 0); 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 #endif
pPlayer->orotscrnang = pPlayer->rotscrnang; pPlayer->orotscrnang = pPlayer->rotscrnang;
} }
#ifdef USE_OPENGL
else else
{ {
renderSetRollAngle(0); renderSetRollAngle(0);
} }
#endif
} }
if (pPlayer->newowner < 0) if (pPlayer->newowner < 0)

View file

@ -702,7 +702,9 @@ int32_t startwin_run(void)
if (done) if (done)
{ {
ud.setup = settings.shared; ud.setup = settings.shared;
#ifdef USE_OPENGL
glrendmode = (settings.polymer) ? REND_POLYMER : REND_POLYMOST; glrendmode = (settings.polymer) ? REND_POLYMER : REND_POLYMOST;
#endif
g_selectedGrp = settings.grp; g_selectedGrp = settings.grp;
Bstrcpy(g_modDir, (g_noSetup == 0 && settings.gamedir != NULL) ? settings.gamedir : "/"); Bstrcpy(g_modDir, (g_noSetup == 0 && settings.gamedir != NULL) ? settings.gamedir : "/");
} }