From d097ebc8e3c11a85e0428435ee00f36da675a562 Mon Sep 17 00:00:00 2001 From: plagman Date: Thu, 7 May 2009 16:00:49 +0000 Subject: [PATCH] Fix the build with USE_OPENGL=0 and/or POLYMER=0. git-svn-id: https://svn.eduke32.com/eduke32@1365 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/Makefile | 11 +++++++++-- polymer/eduke32/build/src/baselayer.c | 2 ++ polymer/eduke32/build/src/engine.c | 6 +++--- polymer/eduke32/build/src/polymost.c | 10 ++++++++-- polymer/eduke32/source/gamedef.c | 6 +++--- polymer/eduke32/source/menus.c | 4 ++-- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/polymer/eduke32/build/Makefile b/polymer/eduke32/build/Makefile index 93a7d6f07..8b9c5879b 100644 --- a/polymer/eduke32/build/Makefile +++ b/polymer/eduke32/build/Makefile @@ -29,6 +29,10 @@ LINKED_GTK ?= 0 BUILD32_ON_64 ?= 0 RANCID_NETWORKING ?= 0 +ifeq (0,$(USE_OPENGL)) + POLYMER = 0 +endif + # Debugging/Build options # RELEASE - 1 = no debugging # EFENCE - 1 = compile with Electric Fence for malloc() debugging @@ -121,10 +125,8 @@ ENGINEOBJS+= \ $(OBJ)/engine.$o \ $(OBJ)/polymost.$o \ $(OBJ)/hightile.$o \ - $(OBJ)/mdsprite.$o \ $(OBJ)/textfont.$o \ $(OBJ)/smalltextfont.$o \ - $(OBJ)/glbuild.$o \ $(OBJ)/kplib.$o \ $(OBJ)/lzf_c.$o \ $(OBJ)/lzf_d.$o \ @@ -133,6 +135,11 @@ ENGINEOBJS+= \ $(OBJ)/pragmas.$o \ $(OBJ)/scriptfile.$o +ifeq (1,$(USE_OPENGL)) + ENGINEOBJS+= $(OBJ)/mdsprite.$o + ENGINEOBJS+= $(OBJ)/glbuild.$o +endif + ifeq (1,$(POLYMER)) ENGINEOBJS+= $(OBJ)/polymer.$o endif diff --git a/polymer/eduke32/build/src/baselayer.c b/polymer/eduke32/build/src/baselayer.c index 061b4a518..17a11cdf8 100644 --- a/polymer/eduke32/build/src/baselayer.c +++ b/polymer/eduke32/build/src/baselayer.c @@ -252,7 +252,9 @@ int32_t baselayer_init(void) OSD_RegisterFunction("hicsetpalettetint","hicsetpalettetint: sets palette tinting values",osdcmd_hicsetpalettetint); #endif +#ifdef USE_OPENGL OSD_RegisterFunction("glinfo","glinfo: shows OpenGL information about the current OpenGL mode",osdcmd_glinfo); +#endif polymost_initosdfuncs(); #endif diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 1eaa4b5ff..b8e7dc14c 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -24,12 +24,12 @@ #ifdef POLYMOST # ifdef USE_OPENGL # include "glbuild.h" +# include "mdsprite.h" # ifdef POLYMER # include "polymer.h" # endif # endif # include "hightile.h" -# include "mdsprite.h" # include "polymost.h" # ifdef _WIN32 # define WIN32_LEAN_AND_MEAN @@ -7787,7 +7787,7 @@ int32_t setgamemode(char davidoption, int32_t daxdim, int32_t daydim, int32_t da j = bpp; if (setvideomode(daxdim,daydim,dabpp,davidoption) < 0) return(-1); -#ifdef POLYMOST +#if defined(POLYMOST) && defined(USE_OPENGL) if (dabpp > 8) rendmode = glrendmode; // GL renderer else if (dabpp == 8 && j > 8) rendmode = 0; // going from GL to software activates softpolymost #endif @@ -12032,7 +12032,7 @@ int32_t screencapture(char *filename, char inverseit) int32_t setrendermode(int32_t renderer) { UNREFERENCED_PARAMETER(renderer); -#ifdef POLYMOST +#if defined(POLYMOST) && defined(USE_OPENGL) if (bpp == 8) renderer = 0; else renderer = min(4,max(3,renderer)); # ifdef POLYMER diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index ddec1bf6f..6d79d99e0 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -70,13 +70,17 @@ Low priority: #include "compat.h" #include "build.h" -#include "glbuild.h" + +#ifdef USE_OPENGL +# include "glbuild.h" +# include "mdsprite.h" +#endif + #include "pragmas.h" #include "baselayer.h" #include "osd.h" #include "engine_priv.h" #include "hightile.h" -#include "mdsprite.h" #include "polymost.h" #include "scriptfile.h" #include "cache1d.h" @@ -4254,6 +4258,7 @@ void polymost_drawrooms() vec3_t vect; double ratio = 1.05; +#ifdef USE_OPENGL if (glwidescreen == 1) ratio = 1.2f; else if (glprojectionhacks == 1) @@ -4268,6 +4273,7 @@ void polymost_drawrooms() if (gshang < -0.7f) ratio += 4.f*(-gshang-0.7f); } +#endif ox2 = (searchx-ghalfx)/ratio; oy2 = (searchy-ghoriz)/ ratio; oz2 = ghalfx; diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index d32880201..43db47c4a 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -5111,7 +5111,7 @@ repeatcase: int32_t fullscreen = ud.config.ScreenMode; int32_t xdim = ud.config.ScreenWidth, ydim = ud.config.ScreenHeight, bpp = ud.config.ScreenBPP; int32_t usemouse = ud.config.UseMouse, usejoy = ud.config.UseJoystick; -#ifdef POLYMOST +#if defined(POLYMOST) && defined(USE_OPENGL) int32_t glrm = glrendmode; #endif @@ -5155,9 +5155,9 @@ repeatcase: ud.config.ScreenBPP = bpp; ud.config.UseMouse = usemouse; ud.config.UseJoystick = usejoy; -#ifdef POLYMOST +#if defined(POLYMOST) && defined(USE_OPENGL) glrendmode = glrm; -#endif // POLYMOST +#endif } } diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index ad78e3419..4497c18a4 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -3326,11 +3326,11 @@ cheat_for_port_credits: nfs = newfullscreen; nbpp = (newvidmode==validmodecnt)?bpp:validmode[newvidmode].bpp; nrend = (vidsets[newvidset] & 0x20000) ? (nbpp==8?2: -#ifdef POLYMOST +#if defined(POLYMOST) && defined(USE_OPENGL) glrendmode #else 0 -#endif // POLYMOST +#endif ) : 0;