diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index 1cb29d255..afde7062e 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -304,7 +304,9 @@ static int32_t defsparser(scriptfile *script) if (check_file_exist(fn)) break; +#ifdef USE_OPENGL hicsetsubsttex(tile,pal,fn,-1.0,1.0,1.0,1.0,1.0,0); +#endif } break; case T_DEFINESKYBOX: @@ -323,7 +325,9 @@ static int32_t defsparser(scriptfile *script) happy = 0; } if (i < 6 || !happy) break; +#ifdef USE_OPENGL hicsetskybox(tile,pal,fn); +#endif } break; case T_DEFINETINT: @@ -335,7 +339,9 @@ static int32_t defsparser(scriptfile *script) if (scriptfile_getnumber(script,&g)) break; if (scriptfile_getnumber(script,&b)) break; if (scriptfile_getnumber(script,&f)) break; //effects +#ifdef USE_OPENGL hicsetpalettetint(pal,r,g,b,f); +#endif } break; case T_ALPHAHACK: @@ -353,8 +359,11 @@ static int32_t defsparser(scriptfile *script) break; case T_ALPHAHACKRANGE: { - int32_t tilenume1,tilenume2,i; + int32_t tilenume1,tilenume2; double alpha; +#ifdef USE_OPENGL + int32_t i; +#endif if (scriptfile_getsymbol(script,&tilenume1)) break; if (scriptfile_getsymbol(script,&tilenume2)) break; @@ -702,8 +711,9 @@ static int32_t defsparser(scriptfile *script) char *framename; #ifdef USE_OPENGL char happy=1; + int32_t tilex; #endif - int32_t ftilenume, ltilenume, tilex; + int32_t ftilenume, ltilenume; if (scriptfile_getstring(script,&framename)) break; if (scriptfile_getnumber(script,&ftilenume)) break; //first tile number @@ -943,8 +953,12 @@ static int32_t defsparser(scriptfile *script) case T_FRAME: { char *frametokptr = script->ltextptr; - char *frameend, *framename = 0, happy=1; - int32_t ftilenume = -1, ltilenume = -1, tilex = 0, framei; + char *frameend, *framename = 0; +#ifdef USE_OPENGL + char happy=1; + int32_t tilex = 0, framei; +#endif + int32_t ftilenume = -1, ltilenume = -1; double smoothduration = 0.1f; static const tokenlist modelframetokens[] = @@ -1188,8 +1202,12 @@ static int32_t defsparser(scriptfile *script) case T_HUD: { char *hudtokptr = script->ltextptr; - char happy=1, *frameend; - int32_t ftilenume = -1, ltilenume = -1, tilex = 0, flags = 0, fov = -1; + char *frameend; +#ifdef USE_OPENGL + char happy=1; + int32_t tilex = 0; +#endif + int32_t ftilenume = -1, ltilenume = -1, flags = 0, fov = -1; double xadd = 0.0, yadd = 0.0, zadd = 0.0, angadd = 0.0; static const tokenlist modelhudtokens[] = @@ -1444,7 +1462,9 @@ static int32_t defsparser(scriptfile *script) } if (!happy) break; +#ifdef USE_OPENGL hicsetskybox(tile,pal,fn); +#endif } break; case T_HIGHPALOOKUP: @@ -1583,7 +1603,9 @@ static int32_t defsparser(scriptfile *script) break; } +#ifdef USE_OPENGL hicsetpalettetint(pal,red,green,blue,flags); +#endif } break; case T_MAKEPALOOKUP: @@ -1704,7 +1726,9 @@ static int32_t defsparser(scriptfile *script) int32_t pal=-1; char *fn = NULL; double alphacut = -1.0, xscale = 1.0, yscale = 1.0, specpower = 1.0, specfactor = 1.0; +#ifdef USE_OPENGL char flags = 0; +#endif static const tokenlist texturetokens_pal[] = { @@ -1736,10 +1760,12 @@ static int32_t defsparser(scriptfile *script) scriptfile_getdouble(script,&specpower); break; case T_SPECFACTOR: scriptfile_getdouble(script,&specfactor); break; +#ifdef USE_OPENGL case T_NOCOMPRESS: flags |= 1; break; case T_NODOWNSIZE: flags |= 16; break; +#endif default: break; } @@ -1762,19 +1788,23 @@ static int32_t defsparser(scriptfile *script) if (check_file_exist(fn)) break; +#ifdef USE_OPENGL xscale = 1.0f / xscale; yscale = 1.0f / yscale; hicsetsubsttex(tile,pal,fn,alphacut,xscale,yscale, specpower, specfactor,flags); +#endif } break; case T_DETAIL: case T_GLOW: case T_SPECULAR: case T_NORMAL: { char *detailtokptr = script->ltextptr, *detailend; +#ifdef USE_OPENGL int32_t pal = 0; + char flags = 0; +#endif char *fn = NULL; double xscale = 1.0, yscale = 1.0, specpower = 1.0, specfactor = 1.0; - char flags = 0; static const tokenlist texturetokens_pal[] = { @@ -1803,10 +1833,12 @@ static int32_t defsparser(scriptfile *script) scriptfile_getdouble(script,&specpower); break; case T_SPECFACTOR: scriptfile_getdouble(script,&specfactor); break; +#ifdef USE_OPENGL case T_NOCOMPRESS: flags |= 1; break; case T_NODOWNSIZE: flags |= 16; break; +#endif default: break; } @@ -1823,6 +1855,7 @@ static int32_t defsparser(scriptfile *script) if (check_file_exist(fn)) break; +#ifdef USE_OPENGL switch (token) { case T_DETAIL: @@ -1841,6 +1874,7 @@ static int32_t defsparser(scriptfile *script) break; } hicsetsubsttex(tile,pal,fn,-1.0f,xscale,yscale, specpower, specfactor,flags); +#endif } break; default: @@ -1911,7 +1945,10 @@ static int32_t defsparser(scriptfile *script) case T_UNDEFTEXTURE: case T_UNDEFTEXTURERANGE: { - int32_t r0,r1,i; + int32_t r0,r1; +#ifdef USE_OPENGL + int32_t i; +#endif if (scriptfile_getsymbol(script,&r0)) break; if (tokn == T_UNDEFTEXTURERANGE) @@ -1929,9 +1966,11 @@ static int32_t defsparser(scriptfile *script) break; } +#ifdef USE_OPENGL for (; r0 <= r1; r0++) for (i=MAXPALOOKUPS-1; i>=0; i--) hicclearsubst(r0,i); +#endif } break; diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index d8938a241..e03293588 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -9414,6 +9414,10 @@ static void finish_loadboard(const vec3_t *dapos, int16_t *dacursectnum, int16_t { int32_t i; +#if !defined USE_OPENGL || !defined POLYMER + UNREFERENCED_PARAMETER(myflags); +#endif + for (i=0; i= basepalcount) dapalid = 0; +#ifdef USE_OPENGL paldidchange = (curbasepal != dapalid || basepalreset); +#endif curbasepal = dapalid; basepalreset = 0; diff --git a/polymer/eduke32/build/src/hightile.c b/polymer/eduke32/build/src/hightile.c index 8b640f374..464920f26 100644 --- a/polymer/eduke32/build/src/hightile.c +++ b/polymer/eduke32/build/src/hightile.c @@ -294,12 +294,37 @@ int32_t hicclearsubst(int32_t picnum, int32_t palnum) #else /* USE_OPENGL */ -#include "inttypes.h" +#include "compat.h" -void hicsetpalettetint(int32_t palnum, char r, char g, char b, char effect) { } -int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, const char *filen, float alphacut) { return 0; } -int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6]) { return 0; } -int32_t hicclearsubst(int32_t picnum, int32_t palnum) { return 0; } +void hicsetpalettetint(int32_t palnum, char r, char g, char b, char effect) +{ + UNREFERENCED_PARAMETER(palnum); + UNREFERENCED_PARAMETER(r); + UNREFERENCED_PARAMETER(g); + UNREFERENCED_PARAMETER(b); + UNREFERENCED_PARAMETER(effect); +} +int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, const char *filen, float alphacut) +{ + UNREFERENCED_PARAMETER(picnum); + UNREFERENCED_PARAMETER(palnum); + UNREFERENCED_PARAMETER(filen); + UNREFERENCED_PARAMETER(alphacut); + return 0; +} +int32_t hicsetskybox(int32_t picnum, int32_t palnum, char *faces[6]) +{ + UNREFERENCED_PARAMETER(picnum); + UNREFERENCED_PARAMETER(palnum); + UNREFERENCED_PARAMETER(faces); + return 0; +} +int32_t hicclearsubst(int32_t picnum, int32_t palnum) +{ + UNREFERENCED_PARAMETER(picnum); + UNREFERENCED_PARAMETER(palnum); + return 0; +} #endif diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index fe4b7a92f..b69542f97 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -6547,10 +6547,10 @@ int32_t dxtfilter(int32_t fil, const texcachepicture *pict, const char *pic, voi uint32_t j, k, offs, stride, cleng; char *cptr; - if ((pict->format == B_LITTLE32(GL_COMPRESSED_RGB_S3TC_DXT1_EXT)) || - (pict->format == B_LITTLE32(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT))) { offs = 0; stride = 8; } - else if ((pict->format == B_LITTLE32(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT)) || - (pict->format == B_LITTLE32(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT))) { offs = 8; stride = 16; } + if ((pict->format == (signed) B_LITTLE32(GL_COMPRESSED_RGB_S3TC_DXT1_EXT)) || + (pict->format == (signed) B_LITTLE32(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT))) { offs = 0; stride = 8; } + else if ((pict->format == (signed) B_LITTLE32(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT)) || + (pict->format == (signed) B_LITTLE32(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT))) { offs = 8; stride = 16; } else { offs = 0; stride = 8; } if (stride == 16) //If DXT3... @@ -6647,10 +6647,10 @@ int32_t dedxtfilter(int32_t fil, const texcachepicture *pict, char *pic, void *m if (ispacked) inbuf = packbuf; else inbuf = midbuf; - if ((pict->format == GL_COMPRESSED_RGB_S3TC_DXT1_EXT) || - (pict->format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)) { offs = 0; stride = 8; } - else if ((pict->format == GL_COMPRESSED_RGBA_S3TC_DXT3_EXT) || - (pict->format == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)) { offs = 8; stride = 16; } + if ((pict->format == (signed) B_LITTLE32(GL_COMPRESSED_RGB_S3TC_DXT1_EXT)) || + (pict->format == (signed) B_LITTLE32(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT))) { offs = 0; stride = 8; } + else if ((pict->format == (signed) B_LITTLE32(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT)) || + (pict->format == (signed) B_LITTLE32(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT))) { offs = 8; stride = 16; } else { offs = 0; stride = 8; } if (stride == 16) //If DXT3... @@ -6811,10 +6811,17 @@ int32_t dedxtfilter(int32_t fil, const texcachepicture *pict, char *pic, void *m #else /* if !defined USE_OPENGL */ -#include "inttypes.h" +#include "compat.h" + int32_t polymost_drawtilescreen(int32_t tilex, int32_t tiley, int32_t wallnum, int32_t dimen, int32_t usehitile, uint8_t *loadedhitile) { + UNREFERENCED_PARAMETER(tilex); + UNREFERENCED_PARAMETER(tiley); + UNREFERENCED_PARAMETER(wallnum); + UNREFERENCED_PARAMETER(dimen); + UNREFERENCED_PARAMETER(usehitile); + UNREFERENCED_PARAMETER(loadedhitile); return -1; } diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index dcf9c348a..264b49f08 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -205,7 +205,9 @@ void wm_setapptitle(char *name) int32_t main(int32_t argc, char *argv[]) { int32_t r; +#ifdef USE_OPENGL char *argp; +#endif buildkeytranslationtable(); diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index 43d20fb01..ec45b40e7 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -117,9 +117,11 @@ static inline void DI_PollJoysticks(void); static int32_t SetupDirectDraw(int32_t width, int32_t height); static void UninitDIB(void); static int32_t SetupDIB(int32_t width, int32_t height); +#ifdef USE_OPENGL static void ReleaseOpenGL(void); static void UninitOpenGL(void); static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp); +#endif static BOOL RegisterWindowClass(void); static BOOL CreateAppWindow(int32_t modenum); static void DestroyAppWindow(void); @@ -315,7 +317,9 @@ static void divcommon(int32_t *ap, int32_t *bp) int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int32_t nCmdShow) { int32_t r; +#ifdef USE_OPENGL char *argp; +#endif HDC hdc; UNREFERENCED_PARAMETER(lpCmdLine); diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index e9e162682..dc86f2f69 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -9206,9 +9206,10 @@ static int32_t osdcmd_tint(const osdfuncparm_t *parm) } else if (parm->numparms==0) { + palette_t empty = { 0xFF, 0xFF, 0xFF, 0x00 }; OSD_Printf("Hightile tintings:\n"); for (i=0,p=&hictinting[0]; i<=M32_MAXPALOOKUPS; i++,p++) - if (*(int32_t *)&hictinting[i] != B_LITTLE32(0x00ffffff)) + if (*(int32_t *)&hictinting[i] != *(int32_t *)&empty) OSD_Printf("pal %d: rgb %3d %3d %3d f %d\n", i, p->r, p->g, p->b, p->f); } else if (parm->numparms>=2)