Fix warnings that appear if big-endian || USE_OPENGL=0.

git-svn-id: https://svn.eduke32.com/eduke32@3382 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2013-01-08 06:17:10 +00:00
parent 05161ea4d8
commit 8bb14fa13e
7 changed files with 111 additions and 24 deletions

View file

@ -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;

View file

@ -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<numsprites; i++)
{
if ((sprite[i].cstat & 48) == 48)
@ -13775,14 +13779,19 @@ void setbrightness(char dabrightness, uint8_t dapalid, uint8_t flags)
int32_t i, j, nohwgamma;
const uint8_t *dapal;
int32_t paldidchange, palsumdidchange;
#ifdef USE_OPENGL
int32_t paldidchange;
#endif
int32_t palsumdidchange;
// uint32_t lastbright = curbrightness;
Bassert((flags&4)==0);
if (dapalid >= basepalcount)
dapalid = 0;
#ifdef USE_OPENGL
paldidchange = (curbasepal != dapalid || basepalreset);
#endif
curbasepal = dapalid;
basepalreset = 0;

View file

@ -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

View file

@ -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;
}

View file

@ -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();

View file

@ -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);

View file

@ -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)