From b3cd9a73fe804d1497c13b1c4bba6d20629dd543 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 20 Jan 2011 21:46:15 +0000 Subject: [PATCH] fix non-Polymer build git-svn-id: https://svn.eduke32.com/eduke32@1778 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/defs.c | 12 ++++++++---- polymer/eduke32/build/src/hightile.c | 7 ++++--- polymer/eduke32/build/src/polymost.c | 3 ++- polymer/eduke32/source/m32vars.c | 17 +++++++++++++++++ 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index 5cd9c4076..1037df1e9 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -1432,11 +1432,13 @@ static int32_t defsparser(scriptfile *script) case T_HIGHPALOOKUP: { char *highpaltokptr = script->ltextptr; - int32_t pal=-1, oldpathsearchmode, fd; + int32_t pal=-1, oldpathsearchmode; char *fn = NULL, *tfn = NULL; char *highpalend; +#ifdef POLYMER + int32_t fd; char *highpaldata; - +#endif static const tokenlist highpaltokens[] = { { "pal", T_PAL }, @@ -1486,6 +1488,7 @@ static int32_t defsparser(scriptfile *script) else Bfree(tfn); pathsearchmode = oldpathsearchmode; +#ifdef POLYMER fd = kopen4load(fn, 0); // load the highpalookup and send it to polymer @@ -1498,11 +1501,11 @@ static int32_t defsparser(scriptfile *script) filesize = kfilelength(fd); filebuf = Bmalloc(filesize); - if (!filebuf) { Bfree(highpaldata); break; } + if (!filebuf) { kclose(fd); Bfree(highpaldata); break; } klseek(fd, 0, SEEK_SET); if (kread(fd, filebuf, filesize)!=filesize) - { Bfree(highpaldata); initprintf("Error: didn't read all of '%s'.\n", fn); break; } + { kclose(fd); Bfree(highpaldata); initprintf("Error: didn't read all of '%s'.\n", fn); break; } kclose(fd); kpgetdim(filebuf, filesize, &xsiz, &ysiz); @@ -1524,6 +1527,7 @@ static int32_t defsparser(scriptfile *script) polymer_definehighpalookup(pal, highpaldata); Bfree(highpaldata); +#endif } break; case T_TINT: diff --git a/polymer/eduke32/build/src/hightile.c b/polymer/eduke32/build/src/hightile.c index b3df18ff2..435dac2d9 100644 --- a/polymer/eduke32/build/src/hightile.c +++ b/polymer/eduke32/build/src/hightile.c @@ -10,6 +10,7 @@ #include "compat.h" #include "kplib.h" #include "hightile.h" +#include "baselayer.h" palette_t hictinting[MAXPALOOKUPS]; @@ -166,13 +167,13 @@ int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, const char *filen, float if (tilesizx[picnum]<=0 || tilesizy[picnum]<=0) { static int32_t first=1; - OSD_Printf("warning: defined hightile replacement for empty tile %d.", picnum); + initprintf("Warning: defined hightile replacement for empty tile %d.", picnum); if (first) { - OSD_Printf(" Maybe some tiles???.art are not loaded?"); + initprintf(" Maybe some tilesXXX.art are not loaded?"); first = 0; } - OSD_Printf("\n"); + initprintf("\n"); } //printf("Replacement [%d,%d]: %s\n", picnum, palnum, hicreplc[i]->filename); diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index e8637f006..6015b3b99 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -5376,6 +5376,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 if (!nofog) bglDisable(GL_FOG); if (rendmode < 4) mddraw(&tspr); +# ifdef POLYMER else { tspriteptr[MAXSPRITESONSCREEN] = &tspr; @@ -5394,7 +5395,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 bglDisable(GL_BLEND); bglDisable(GL_ALPHA_TEST); } - +# endif if (!nofog) bglEnable(GL_FOG); #else mddraw(&tspr); diff --git a/polymer/eduke32/source/m32vars.c b/polymer/eduke32/source/m32vars.c index b98f32794..93e324309 100644 --- a/polymer/eduke32/source/m32vars.c +++ b/polymer/eduke32/source/m32vars.c @@ -630,6 +630,23 @@ static void Gv_AddSystemVars(void) Gv_NewVar("pr_overridespecular",(intptr_t)&pr_overridespecular, GAMEVAR_INTPTR | GAMEVAR_SYSTEM); Gv_NewVar("pr_specularpower",(intptr_t)&pr_specularpower, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM); Gv_NewVar("pr_specularfactor",(intptr_t)&pr_specularfactor, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM); +#else + { + // dummy Polymer variables for non-Polymer builds + static int32_t pr_overrideparallax = 0; + static float pr_parallaxscale = 0.1f; + static float pr_parallaxbias = 0.0f; + static int32_t pr_overridespecular = 0; + static float pr_specularpower = 15.0f; + static float pr_specularfactor = 1.0f; + + Gv_NewVar("pr_overrideparallax",(intptr_t)&pr_overrideparallax, GAMEVAR_INTPTR | GAMEVAR_SYSTEM); + Gv_NewVar("pr_parallaxscale",(intptr_t)&pr_parallaxscale, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM); + Gv_NewVar("pr_parallaxbias",(intptr_t)&pr_parallaxbias, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM); + Gv_NewVar("pr_overridespecular",(intptr_t)&pr_overridespecular, GAMEVAR_INTPTR | GAMEVAR_SYSTEM); + Gv_NewVar("pr_specularpower",(intptr_t)&pr_specularpower, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM); + Gv_NewVar("pr_specularfactor",(intptr_t)&pr_specularfactor, GAMEVAR_FLOATPTR | GAMEVAR_SYSTEM); + } #endif g_systemVarCount = g_gameVarCount;