From 7a893b8ec42d422f7578bc9d43f20711b1c7eafb Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 20 Jan 2012 13:24:15 +0000 Subject: [PATCH] minor engine cleanup. - enclose glbuild.h in #idndef ... sentinels - engine.c: remove unused variable 'pageoffset', make 'lastx' static - formatting git-svn-id: https://svn.eduke32.com/eduke32@2272 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/glbuild.h | 6 ++++++ polymer/eduke32/build/src/engine.c | 22 +++++++++++++--------- polymer/eduke32/build/src/engine_priv.h | 5 +++++ polymer/eduke32/build/src/polymost.c | 2 -- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/polymer/eduke32/build/include/glbuild.h b/polymer/eduke32/build/include/glbuild.h index f743e2326..bc3128fd3 100644 --- a/polymer/eduke32/build/include/glbuild.h +++ b/polymer/eduke32/build/include/glbuild.h @@ -1,3 +1,7 @@ + +#ifndef BGLBUILD_H_INCLUDED_ +#define BGLBUILD_H_INCLUDED_ + #ifdef USE_OPENGL #ifdef RENDERTYPEWIN @@ -340,3 +344,5 @@ int32_t unloadgldriver(void); int32_t loadglulibrary(const char *driver); int32_t unloadglulibrary(void); + +#endif diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 72ac31f84..92cf520c7 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -2161,11 +2161,15 @@ int32_t globalx, globaly, globalz; int16_t sectorborder[256], sectorbordercnt; static char tablesloaded = 0; -int32_t pageoffset, ydim16, qsetmode = 0; +int32_t ydim16, qsetmode = 0; int32_t startposx, startposy, startposz; int16_t startang, startsectnum; int16_t pointhighlight=-1, linehighlight=-1, highlightcnt=0; +#ifndef OBSOLETE_RENDMODES +static int32_t lastx[MAXYDIM]; +#else int32_t lastx[MAXYDIM]; +#endif char *transluc = NULL, paletteloaded = 0; int32_t halfxdim16, midydim16; @@ -5916,20 +5920,20 @@ static void drawsprite(int32_t snum) switch (smostwalltype[i]) { case 0: - if (dalx2 <= darx2) - { - if ((dalx2 == lx) && (darx2 == rx)) return; - //clearbufbyte(&dwall[dalx2],(darx2-dalx2+1)*sizeof(dwall[0]),0L); - for (x=dalx2; x<=darx2; x++) dwall[x] = 0; - } + if (dalx2 <= darx2) + { + if ((dalx2 == lx) && (darx2 == rx)) return; + //clearbufbyte(&dwall[dalx2],(darx2-dalx2+1)*sizeof(dwall[0]),0L); + for (x=dalx2; x<=darx2; x++) dwall[x] = 0; + } break; case 1: - k = smoststart[i] - xb1[j]; + k = smoststart[i] - xb1[j]; for (x=dalx2; x<=darx2; x++) if (smost[k+x] > uwall[x]) uwall[x] = smost[k+x]; break; case 2: - k = smoststart[i] - xb1[j]; + k = smoststart[i] - xb1[j]; for (x=dalx2; x<=darx2; x++) if (smost[k+x] < dwall[x]) dwall[x] = smost[k+x]; break; diff --git a/polymer/eduke32/build/src/engine_priv.h b/polymer/eduke32/build/src/engine_priv.h index 669a66e65..160526db3 100644 --- a/polymer/eduke32/build/src/engine_priv.h +++ b/polymer/eduke32/build/src/engine_priv.h @@ -17,6 +17,9 @@ # define YAX_MAXDRAWS 8 #endif +//#define OBSOLETE_RENDMODES + + extern uint8_t **basepaltableptr; extern uint8_t basepalcount; extern uint8_t curbasepal; @@ -54,7 +57,9 @@ extern char inpreparemirror; extern int32_t curbrightness, gammabrightness; extern char britable[16][256]; extern char picsiz[MAXTILES]; +#ifdef OBSOLETE_RENDMODES extern int32_t lastx[MAXYDIM]; +#endif extern char *transluc; extern int16_t sectorborder[256], sectorbordercnt; extern int32_t qsetmode; diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index eb1d972ab..96d755d80 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -91,8 +91,6 @@ Low priority: extern int32_t filelength(int h); // kplib.c #endif -//#define OBSOLETE_RENDMODES - extern char textfont[2048], smalltextfont[2048]; int32_t rendmode=0;