From 260bbc1f926041fc37a5621d4b6b8afb552bd963 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 15 Jan 2012 22:39:38 +0000 Subject: [PATCH] cleanup: - 'whitecol' was defined in the engine and in build.c, use only the engine one - make cachesize, artsize, artversion static in engine.c - undo some formatting havoc presumably done by astyle git-svn-id: https://svn.eduke32.com/eduke32@2260 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/editor.h | 1 + polymer/eduke32/build/src/build.c | 14 ++------ polymer/eduke32/build/src/engine.c | 49 +++++++++++++------------- polymer/eduke32/source/astub.c | 2 -- polymer/eduke32/source/mapster32.h | 1 - polymer/eduke32/source/premap.c | 1 - 6 files changed, 29 insertions(+), 39 deletions(-) diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index 316609fbb..1c5733b1f 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -194,6 +194,7 @@ extern void showspritedata(int16_t spritenum, int16_t small); extern void drawsmallabel(const char *text, char col, char backcol, int32_t dax, int32_t day, int32_t daz); +extern int32_t whitecol; extern int32_t circlewall; int32_t loadsetup(const char *fn); // from config.c diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 2da8d9d94..57c65b930 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -63,11 +63,10 @@ int32_t xdim2d = 640, ydim2d = 480, xdimgame = 640, ydimgame = 480, bppgame = 8; int32_t forcesetup = 1; int32_t g_maxCacheSize = 24<<20; -//extern int32_t cachesize, artsize; static int16_t oldmousebstatus = 0; char game_executable[BMAX_PATH] = DEFAULT_GAME_LOCAL_EXEC; -int32_t zlock = 0x7fffffff, zmode = 0, whitecol, kensplayerheight = 32; +int32_t zlock = 0x7fffffff, zmode = 0, kensplayerheight = 32; //int16_t defaultspritecstat = 0; int16_t localartfreq[MAXTILES]; @@ -445,7 +444,7 @@ int32_t app_main(int32_t argc, const char **argv) char cmdsetup = 0; #endif char quitflag; - int32_t i, j, k; + int32_t i, k; pathsearchmode = 1; // unrestrict findfrompath so that full access to the filesystem can be had @@ -584,12 +583,7 @@ int32_t app_main(int32_t argc, const char **argv) Bfree (g_defModules); g_defModules = NULL; // be defensive... - k = 0; - for (i=0; i<256; i++) - { - j = ((int32_t)palette[i*3])+((int32_t)palette[i*3+1])+((int32_t)palette[i*3+2]); - if (j > k) { k = j; whitecol = i; } - } + // Here used to be the 'whitecol' calculation k = clipmapinfo_load("_clipshape0.map"); if (k>0) @@ -779,8 +773,6 @@ CANCEL: // clearfilenames(); uninitengine(); -// Bprintf("Memory status: %d(%d) bytes\n",cachesize,artsize); -// Bprintf("%s\n",kensig); return(0); } diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index b61b116a6..f97b348c1 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -124,7 +124,8 @@ static intptr_t slopalookup[16384]; // was 2048 palette_t palookupfog[MAXPALOOKUPS]; #endif -int32_t artversion, mapversion=7; // JBF 20040211: default mapversion to 7 +static int32_t artversion; +int32_t mapversion=7; // JBF 20040211: default mapversion to 7 char picsiz[MAXTILES]; static void *pic = NULL; static char permanentlock = 255; @@ -132,7 +133,7 @@ static char tilefilenum[MAXTILES]; static int32_t tilefileoffs[MAXTILES]; static int32_t lastageclock; -int32_t artsize = 0, cachesize = 0; +static int32_t artsize = 0, cachesize = 0; // maximum number of ART files static char *artptrs[MAXTILEFILES]; @@ -164,7 +165,7 @@ int32_t showfirstwall=0; int32_t showheightindicators=2; int32_t circlewall=-1; -char cachedebug = 0; +//char cachedebug = 0; qlz_state_compress *state_compress = NULL; qlz_state_decompress *state_decompress = NULL; @@ -5040,32 +5041,32 @@ static void drawvox(int32_t dasprx, int32_t daspry, int32_t dasprz, int32_t dasp switch (i) { case 6: - case 7: - x1 = 0; y1 = 0; break; + case 7: + x1 = 0; y1 = 0; break; case 8: - case 5: - x1 = gxinc; y1 = gyinc; break; + case 5: + x1 = gxinc; y1 = gyinc; break; case 0: - case 3: - x1 = gyinc; y1 = -gxinc; break; + case 3: + x1 = gyinc; y1 = -gxinc; break; case 2: - case 1: - x1 = gxinc+gyinc; y1 = gyinc-gxinc; break; + case 1: + x1 = gxinc+gyinc; y1 = gyinc-gxinc; break; } switch (i) { case 2: - case 5: - x2 = 0; y2 = 0; break; + case 5: + x2 = 0; y2 = 0; break; case 0: - case 1: - x2 = gxinc; y2 = gyinc; break; + case 1: + x2 = gxinc; y2 = gyinc; break; case 8: - case 7: - x2 = gyinc; y2 = -gxinc; break; + case 7: + x2 = gyinc; y2 = -gxinc; break; case 6: - case 3: - x2 = gxinc+gyinc; y2 = gyinc-gxinc; break; + case 3: + x2 = gxinc+gyinc; y2 = gyinc-gxinc; break; } oand = pow2char[(xs k) { k = j; whitecol = i; } } } @@ -10275,7 +10276,7 @@ int32_t loadpics(const char *filename, int32_t askedsize) while ((pic = Bmalloc(cachesize)) == NULL) { - cachesize -= 65536L; + cachesize -= 65536; if (cachesize < 65536) return(-1); } initcache((intptr_t)pic, cachesize); @@ -10332,7 +10333,7 @@ void loadtile(int16_t tilenume) faketimerhandler(); } - if (cachedebug) OSD_Printf("Tile:%d\n",tilenume); +// if (cachedebug) OSD_Printf("Tile:%d\n",tilenume); // dummy tiles for highres replacements and tilefromtexture definitions if (faketilesiz[tilenume]) diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 8f8565572..17f4b5a6e 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -8545,8 +8545,6 @@ static void G_CheckCommandLine(int32_t argc, const char **argv) if (argc > i+1) { #ifdef USE_OPENGL - extern char TEXCACHEFILE[BMAX_PATH]; - Bsnprintf(tempbuf,sizeof(tempbuf),"%s/%s",argv[i+1],TEXCACHEFILE); Bstrncpy(TEXCACHEFILE,tempbuf, sizeof(TEXCACHEFILE)); TEXCACHEFILE[sizeof(TEXCACHEFILE)-1] = 0; diff --git a/polymer/eduke32/source/mapster32.h b/polymer/eduke32/source/mapster32.h index d8be0abe8..e1f67023a 100644 --- a/polymer/eduke32/source/mapster32.h +++ b/polymer/eduke32/source/mapster32.h @@ -39,7 +39,6 @@ uint8_t default_buildkeys[NUMBUILDKEYS] = 0x9c,0x1c,0xd,0xc,0xf,0x29 }; -extern int32_t whitecol; extern char changechar(char dachar, int32_t dadir, char smooshyalign, char boundcheck); extern void updatenumsprites(void); diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index b9d2ee171..5f444d79e 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -2033,7 +2033,6 @@ int32_t G_EnterLevel(int32_t g) allignwarpelevators(); resetpspritevars(g); - //cachedebug = 0; // automapping = 0; G_FadeLoad(0,0,0, 63,0, -7, 4);