mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Run engine source through new version of astyle, add printf() call to OSD_Printf() to facilitate console access through stdin/stdout for dedicated server mode, minor changes to sdlayer to allow operating without actually initializing SDL
git-svn-id: https://svn.eduke32.com/eduke32@1762 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
1579d2edd3
commit
ef912658a0
24 changed files with 3513 additions and 3445 deletions
|
@ -59,12 +59,12 @@ void setupslopevlin(int32_t logylogx, intptr_t bufplc, int32_t pinc)
|
|||
}
|
||||
void slopevlin(intptr_t p, int32_t i, intptr_t slopaloffs, int32_t cnt, int32_t bx, int32_t by)
|
||||
{
|
||||
intptr_t* slopalptr;
|
||||
intptr_t *slopalptr;
|
||||
int32_t bz, bzinc;
|
||||
uint32_t u, v;
|
||||
|
||||
bz = asm3; bzinc = (asm1>>3);
|
||||
slopalptr = (intptr_t*)slopaloffs;
|
||||
slopalptr = (intptr_t *)slopaloffs;
|
||||
for (; cnt>0; cnt--)
|
||||
{
|
||||
i = krecip(bz>>6); bz += bzinc;
|
||||
|
|
|
@ -279,22 +279,22 @@ static int32_t osdcmd_cvar_set_baselayer(const osdfuncparm_t *parm)
|
|||
|
||||
if (r != OSDCMD_OK) return r;
|
||||
|
||||
/*
|
||||
if (!Bstrcasecmp(parm->name, "r_scrcaptureformat"))
|
||||
{
|
||||
const char *fmts[] = {"TGA", "PCX"};
|
||||
if (showval) { OSD_Printf("r_scrcaptureformat is %s\n", fmts[captureformat]); }
|
||||
else
|
||||
/*
|
||||
if (!Bstrcasecmp(parm->name, "r_scrcaptureformat"))
|
||||
{
|
||||
int32_t j;
|
||||
for (j=0; j<2; j++)
|
||||
if (!Bstrcasecmp(parm->parms[0], fmts[j])) break;
|
||||
if (j == 2) return OSDCMD_SHOWHELP;
|
||||
captureformat = j;
|
||||
const char *fmts[] = {"TGA", "PCX"};
|
||||
if (showval) { OSD_Printf("r_scrcaptureformat is %s\n", fmts[captureformat]); }
|
||||
else
|
||||
{
|
||||
int32_t j;
|
||||
for (j=0; j<2; j++)
|
||||
if (!Bstrcasecmp(parm->parms[0], fmts[j])) break;
|
||||
if (j == 2) return OSDCMD_SHOWHELP;
|
||||
captureformat = j;
|
||||
}
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
else */
|
||||
else */
|
||||
|
||||
if (!Bstrcasecmp(parm->name, "vid_gamma") || !Bstrcasecmp(parm->name, "vid_brightness") || !Bstrcasecmp(parm->name, "vid_contrast"))
|
||||
{
|
||||
|
@ -313,17 +313,17 @@ int32_t baselayer_init(void)
|
|||
cvar_t cvars_engine[] =
|
||||
{
|
||||
#ifdef SUPERBUILD
|
||||
{ "r_usenewaspect","r_usenewaspect: enable/disable new screen aspect ratio determination code",(void *)&r_usenewaspect, CVAR_BOOL, 0, 1 },
|
||||
{ "r_screenaspect","r_screenaspect: if using the new aspect code and in fullscreen, screen aspect ratio in the form XXYY, e.g. 1609 for 16:9",(void *)&r_screenxy, CVAR_UINT, 100, 9999 },
|
||||
{ "r_novoxmips","r_novoxmips: turn off/on the use of mipmaps when rendering 8-bit voxels",(void *)&novoxmips, CVAR_BOOL, 0, 1 },
|
||||
{ "r_voxels","r_voxels: enable/disable automatic sprite->voxel rendering",(void *)&usevoxels, CVAR_BOOL, 0, 1 },
|
||||
/* { "r_scrcaptureformat","r_scrcaptureformat: sets the output format for screenshots (TGA or PCX)",osdcmd_vars, CVAR_FUNCPTR, 0, 0 },*/
|
||||
{ "vid_gamma","vid_gamma <gamma>: adjusts gamma ramp",(void *)&vid_gamma, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
{ "vid_contrast","vid_contrast <gamma>: adjusts gamma ramp",(void *)&vid_contrast, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
{ "vid_brightness","vid_brightness <gamma>: adjusts gamma ramp",(void *)&vid_brightness, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
{ "r_usenewaspect","r_usenewaspect: enable/disable new screen aspect ratio determination code",(void *) &r_usenewaspect, CVAR_BOOL, 0, 1 },
|
||||
{ "r_screenaspect","r_screenaspect: if using the new aspect code and in fullscreen, screen aspect ratio in the form XXYY, e.g. 1609 for 16:9",(void *) &r_screenxy, CVAR_UINT, 100, 9999 },
|
||||
{ "r_novoxmips","r_novoxmips: turn off/on the use of mipmaps when rendering 8-bit voxels",(void *) &novoxmips, CVAR_BOOL, 0, 1 },
|
||||
{ "r_voxels","r_voxels: enable/disable automatic sprite->voxel rendering",(void *) &usevoxels, CVAR_BOOL, 0, 1 },
|
||||
/* { "r_scrcaptureformat","r_scrcaptureformat: sets the output format for screenshots (TGA or PCX)",osdcmd_vars, CVAR_FUNCPTR, 0, 0 },*/
|
||||
{ "vid_gamma","vid_gamma <gamma>: adjusts gamma ramp",(void *) &vid_gamma, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
{ "vid_contrast","vid_contrast <gamma>: adjusts gamma ramp",(void *) &vid_contrast, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
{ "vid_brightness","vid_brightness <gamma>: adjusts gamma ramp",(void *) &vid_brightness, CVAR_DOUBLE|CVAR_FUNCPTR, 0, 10 },
|
||||
#endif
|
||||
{ "debug1","debug counter",(void *)&debug1, CVAR_FLOAT, -100000, 100000 },
|
||||
{ "debug2","debug counter",(void *)&debug2, CVAR_FLOAT, -100000, 100000 },
|
||||
{ "debug1","debug counter",(void *) &debug1, CVAR_FLOAT, -100000, 100000 },
|
||||
{ "debug2","debug counter",(void *) &debug2, CVAR_FLOAT, -100000, 100000 },
|
||||
};
|
||||
|
||||
for (i=0; i<sizeof(cvars_engine)/sizeof(cvars_engine[0]); i++)
|
||||
|
@ -332,7 +332,7 @@ int32_t baselayer_init(void)
|
|||
continue;
|
||||
|
||||
OSD_RegisterFunction(cvars_engine[i].name, cvars_engine[i].helpstr,
|
||||
(cvars_engine[i].type & CVAR_FUNCPTR) ? osdcmd_cvar_set_baselayer : osdcmd_cvar_set);
|
||||
(cvars_engine[i].type & CVAR_FUNCPTR) ? osdcmd_cvar_set_baselayer : osdcmd_cvar_set);
|
||||
}
|
||||
|
||||
#ifdef POLYMOST
|
||||
|
|
|
@ -1361,7 +1361,7 @@ static int32_t restore_highlighted_map(mapinfofull_t *mapinfo)
|
|||
|
||||
updatenumsprites();
|
||||
if (numsectors+mapinfo->numsectors>MAXSECTORS || numwalls+mapinfo->numwalls>MAXWALLS
|
||||
|| numsprites+mapinfo->numsprites>MAXSPRITES)
|
||||
|| numsprites+mapinfo->numsprites>MAXSPRITES)
|
||||
{
|
||||
mapinfofull_free(mapinfo);
|
||||
return -1;
|
||||
|
@ -1735,9 +1735,9 @@ void overheadeditor(void)
|
|||
while ((keystatus[buildkeys[BK_MODE2D_3D]]>>1) == 0)
|
||||
{
|
||||
if (!((vel|angvel|svel) //DOWN_BK(MOVEFORWARD) || DOWN_BK(MOVEBACKWARD) || DOWN_BK(TURNLEFT) || DOWN_BK(TURNRIGHT)
|
||||
|| DOWN_BK(MOVEUP) || DOWN_BK(MOVEDOWN) || keystatus[0x10] || keystatus[0x11]
|
||||
|| keystatus[0x48] || keystatus[0x4b] || keystatus[0x4d] || keystatus[0x50] // keypad keys
|
||||
|| bstatus || OSD_IsMoving()))
|
||||
|| DOWN_BK(MOVEUP) || DOWN_BK(MOVEDOWN) || keystatus[0x10] || keystatus[0x11]
|
||||
|| keystatus[0x48] || keystatus[0x4b] || keystatus[0x4d] || keystatus[0x50] // keypad keys
|
||||
|| bstatus || OSD_IsMoving()))
|
||||
{
|
||||
if (totalclock > waitdelay)
|
||||
{
|
||||
|
@ -1855,8 +1855,8 @@ void overheadeditor(void)
|
|||
if (numwalls < 0) numwalls = tempint;
|
||||
|
||||
if ((getticks() - lastdraw) >= 5 || (vel|angvel|svel) || DOWN_BK(MOVEUP) || DOWN_BK(MOVEDOWN)
|
||||
|| mousx || mousy || bstatus || keystatus[0x10] || keystatus[0x11]
|
||||
|| newnumwalls>=0 || OSD_IsMoving())
|
||||
|| mousx || mousy || bstatus || keystatus[0x10] || keystatus[0x11]
|
||||
|| newnumwalls>=0 || OSD_IsMoving())
|
||||
{
|
||||
lastdraw = getticks();
|
||||
|
||||
|
@ -2186,8 +2186,8 @@ void overheadeditor(void)
|
|||
|
||||
if (gridlock && grid > 0)
|
||||
locktogrid(&dax, &day);
|
||||
// dax = ((dax+(GRIDMAX>>grid))&(0xffffffff-(GRIDMAX>>(grid-1))+1));
|
||||
// day = ((day+(GRIDMAX>>grid))&(0xffffffff-(GRIDMAX>>(grid-1))+1));
|
||||
// dax = ((dax+(GRIDMAX>>grid))&(0xffffffff-(GRIDMAX>>(grid-1))+1));
|
||||
// day = ((day+(GRIDMAX>>grid))&(0xffffffff-(GRIDMAX>>(grid-1))+1));
|
||||
|
||||
for (i=0; i<highlightsectorcnt; i++)
|
||||
{
|
||||
|
@ -2709,7 +2709,7 @@ void overheadeditor(void)
|
|||
|
||||
for (i=0; i<numwalls; i++)
|
||||
if (wall[i].x >= highlightx1 && wall[i].x <= highlightx2 &&
|
||||
wall[i].y >= highlighty1 && wall[i].y <= highlighty2)
|
||||
wall[i].y >= highlighty1 && wall[i].y <= highlighty2)
|
||||
{
|
||||
if (!sub)
|
||||
show2dwall[i>>3] |= (1<<(i&7));
|
||||
|
@ -2719,8 +2719,8 @@ void overheadeditor(void)
|
|||
|
||||
for (i=0; i<MAXSPRITES; i++)
|
||||
if (sprite[i].statnum < MAXSTATUS &&
|
||||
sprite[i].x >= highlightx1 && sprite[i].x <= highlightx2 &&
|
||||
sprite[i].y >= highlighty1 && sprite[i].y <= highlighty2)
|
||||
sprite[i].x >= highlightx1 && sprite[i].x <= highlightx2 &&
|
||||
sprite[i].y >= highlighty1 && sprite[i].y <= highlighty2)
|
||||
{
|
||||
if (!sub)
|
||||
{
|
||||
|
@ -2834,7 +2834,8 @@ void overheadeditor(void)
|
|||
// visitedwall[j>>3] |= (1<<(j&7));
|
||||
n--;
|
||||
}
|
||||
} while (j!=refwall && n>0);
|
||||
}
|
||||
while (j!=refwall && n>0);
|
||||
if (j!=refwall)
|
||||
{
|
||||
message("internal error while trying to trace outer loop: j!=refwall");
|
||||
|
@ -3051,7 +3052,7 @@ outtathis:
|
|||
for (i=0; i<numwalls; i++) //make new red lines?
|
||||
{
|
||||
if ((wall[i].x == dax && wall[i].y == day)
|
||||
|| (POINT2(i).x == dax && POINT2(i).y == day))
|
||||
|| (POINT2(i).x == dax && POINT2(i).y == day))
|
||||
{
|
||||
checksectorpointer((int16_t)i,sectorofwall((int16_t)i));
|
||||
fixrepeats((int16_t)i);
|
||||
|
@ -3220,21 +3221,21 @@ SKIP:
|
|||
vec.z = sprite[daspr].z;
|
||||
if (setsprite(daspr, &vec) == -1 && osec>=0)
|
||||
Bmemcpy(&sprite[daspr], &ovec, sizeof(vec3_t));
|
||||
/*
|
||||
daz = ((tilesizy[sprite[daspr].picnum]*sprite[daspr].yrepeat)<<2);
|
||||
/*
|
||||
daz = ((tilesizy[sprite[daspr].picnum]*sprite[daspr].yrepeat)<<2);
|
||||
|
||||
for (i=0; i<numsectors; i++)
|
||||
if (inside(dax,day,i) == 1)
|
||||
if (sprite[daspr].z >= getceilzofslope(i,dax,day))
|
||||
if (sprite[daspr].z-daz <= getflorzofslope(i,dax,day))
|
||||
{
|
||||
sprite[daspr].x = dax;
|
||||
sprite[daspr].y = day;
|
||||
if (sprite[daspr].sectnum != i)
|
||||
changespritesect(daspr,(int16_t)i);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
for (i=0; i<numsectors; i++)
|
||||
if (inside(dax,day,i) == 1)
|
||||
if (sprite[daspr].z >= getceilzofslope(i,dax,day))
|
||||
if (sprite[daspr].z-daz <= getflorzofslope(i,dax,day))
|
||||
{
|
||||
sprite[daspr].x = dax;
|
||||
sprite[daspr].y = day;
|
||||
if (sprite[daspr].sectnum != i)
|
||||
changespritesect(daspr,(int16_t)i);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
asksave = 1;
|
||||
|
@ -3873,7 +3874,7 @@ SKIP:
|
|||
if ((split == 0) && (firstx == mousxplc) && (firsty == mousyplc) && (newnumwalls >= numwalls+3))
|
||||
{
|
||||
if (suckwall == -1) //if no connections to other sectors
|
||||
{ /* No problem... */ }
|
||||
{ /* No problem... */ }
|
||||
else
|
||||
{
|
||||
if (newnumwalls>=MAXWALLS) // still too optimistic since we can have more than one new red wall
|
||||
|
@ -5863,7 +5864,7 @@ int32_t _getnumber256(const char *namestart, int32_t num, int32_t maxnumber, cha
|
|||
// defaultstr: can be NULL
|
||||
// NO overflow checks are done when copying them!
|
||||
// maxlen: maximum length of entry string, if ==1, enter single char
|
||||
const char* getstring_simple(const char *querystr, const char *defaultstr, int32_t maxlen)
|
||||
const char *getstring_simple(const char *querystr, const char *defaultstr, int32_t maxlen)
|
||||
{
|
||||
static char buf[128];
|
||||
int32_t ei=0, qrylen=0;
|
||||
|
|
|
@ -274,12 +274,12 @@ int32_t addsearchpath(const char *p)
|
|||
}
|
||||
if (!(st.st_mode & BS_IFDIR)) return -1;
|
||||
|
||||
srch = (searchpath_t*)Bmalloc(sizeof(searchpath_t));
|
||||
srch = (searchpath_t *)Bmalloc(sizeof(searchpath_t));
|
||||
if (!srch) return -1;
|
||||
|
||||
srch->next = searchpathhead;
|
||||
srch->pathlen = strlen(p)+1;
|
||||
srch->path = (char*)Bmalloc(srch->pathlen + 1);
|
||||
srch->path = (char *)Bmalloc(srch->pathlen + 1);
|
||||
if (!srch->path)
|
||||
{
|
||||
Bfree(srch);
|
||||
|
@ -337,7 +337,7 @@ int32_t findfrompath(const char *fn, char **where)
|
|||
}
|
||||
}
|
||||
|
||||
for (pfn = (char*)fn; toupperlookup[*pfn] == '/'; pfn++);
|
||||
for (pfn = (char *)fn; toupperlookup[*pfn] == '/'; pfn++);
|
||||
ffn = Bstrdup(pfn);
|
||||
if (!ffn) return -1;
|
||||
Bcorrectfilename(ffn,0); // compress relative paths
|
||||
|
@ -415,7 +415,7 @@ int32_t openfrompath(const char *fn, int32_t flags, int32_t mode)
|
|||
return h;
|
||||
}
|
||||
|
||||
BFILE* fopenfrompath(const char *fn, const char *mode)
|
||||
BFILE *fopenfrompath(const char *fn, const char *mode)
|
||||
{
|
||||
int32_t fh;
|
||||
BFILE *h;
|
||||
|
@ -894,7 +894,7 @@ static int32_t klistaddentry(CACHE1D_FIND_REC **rec, char *name, int32_t type, i
|
|||
|
||||
r = (CACHE1D_FIND_REC *)Bmalloc(sizeof(CACHE1D_FIND_REC)+strlen(name)+1);
|
||||
if (!r) return -1;
|
||||
r->name = (char*)r + sizeof(CACHE1D_FIND_REC); strcpy(r->name, name);
|
||||
r->name = (char *)r + sizeof(CACHE1D_FIND_REC); strcpy(r->name, name);
|
||||
r->type = type;
|
||||
r->source = source;
|
||||
r->usera = r->userb = NULL;
|
||||
|
|
|
@ -119,47 +119,47 @@ int32_t Blseek(int32_t fildes, int32_t offset, int32_t whence)
|
|||
|
||||
BFILE *Bfopen(const char *path, const char *mode)
|
||||
{
|
||||
return (BFILE*)fopen(path,mode);
|
||||
return (BFILE *)fopen(path,mode);
|
||||
}
|
||||
|
||||
int32_t Bfclose(BFILE *stream)
|
||||
{
|
||||
return fclose((FILE*)stream);
|
||||
return fclose((FILE *)stream);
|
||||
}
|
||||
|
||||
void Brewind(BFILE *stream)
|
||||
{
|
||||
rewind((FILE*)stream);
|
||||
rewind((FILE *)stream);
|
||||
}
|
||||
|
||||
int32_t Bfgetc(BFILE *stream)
|
||||
{
|
||||
return fgetc((FILE*)stream);
|
||||
return fgetc((FILE *)stream);
|
||||
}
|
||||
|
||||
char *Bfgets(char *s, int32_t size, BFILE *stream)
|
||||
{
|
||||
return fgets(s,size,(FILE*)stream);
|
||||
return fgets(s,size,(FILE *)stream);
|
||||
}
|
||||
|
||||
int32_t Bfputc(int32_t c, BFILE *stream)
|
||||
{
|
||||
return fputc(c,(FILE*)stream);
|
||||
return fputc(c,(FILE *)stream);
|
||||
}
|
||||
|
||||
int32_t Bfputs(const char *s, BFILE *stream)
|
||||
{
|
||||
return fputs(s,(FILE*)stream);
|
||||
return fputs(s,(FILE *)stream);
|
||||
}
|
||||
|
||||
bsize_t Bfread(void *ptr, bsize_t size, bsize_t nmemb, BFILE *stream)
|
||||
{
|
||||
return fread(ptr,size,nmemb,(FILE*)stream);
|
||||
return fread(ptr,size,nmemb,(FILE *)stream);
|
||||
}
|
||||
|
||||
bsize_t Bfwrite(const void *ptr, bsize_t size, bsize_t nmemb, BFILE *stream)
|
||||
{
|
||||
return fwrite(ptr,size,nmemb,(FILE*)stream);
|
||||
return fwrite(ptr,size,nmemb,(FILE *)stream);
|
||||
}
|
||||
|
||||
|
||||
|
@ -387,7 +387,7 @@ char *Bgethomedir(void)
|
|||
str = CFURLCopyFileSystemPath(base, kCFURLPOSIXPathStyle);
|
||||
CFRelease(base);
|
||||
if (!str) return NULL;
|
||||
s = (char*)CFStringGetCStringPtr(str,CFStringGetSystemEncoding());
|
||||
s = (char *)CFStringGetCStringPtr(str,CFStringGetSystemEncoding());
|
||||
if (s) s = Bstrdup(s);
|
||||
CFRelease(str);
|
||||
return s;
|
||||
|
@ -417,7 +417,7 @@ char *Bgetsupportdir(int32_t global)
|
|||
str = CFURLCopyFileSystemPath(base, kCFURLPOSIXPathStyle);
|
||||
CFRelease(base);
|
||||
if (!str) return NULL;
|
||||
s = (char*)CFStringGetCStringPtr(str,CFStringGetSystemEncoding());
|
||||
s = (char *)CFStringGetCStringPtr(str,CFStringGetSystemEncoding());
|
||||
if (s) s = Bstrdup(s);
|
||||
CFRelease(str);
|
||||
return s;
|
||||
|
@ -585,16 +585,16 @@ typedef struct
|
|||
char name[1];
|
||||
} BDIR_real;
|
||||
|
||||
BDIR* Bopendir(const char *name)
|
||||
BDIR *Bopendir(const char *name)
|
||||
{
|
||||
BDIR_real *dirr;
|
||||
#ifdef _MSC_VER
|
||||
char *t,*tt;
|
||||
t = (char*)Bmalloc(strlen(name)+1+4);
|
||||
t = (char *)Bmalloc(strlen(name)+1+4);
|
||||
if (!t) return NULL;
|
||||
#endif
|
||||
|
||||
dirr = (BDIR_real*)Bmalloc(sizeof(BDIR_real) + strlen(name));
|
||||
dirr = (BDIR_real *)Bmalloc(sizeof(BDIR_real) + strlen(name));
|
||||
if (!dirr)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
|
@ -632,12 +632,12 @@ BDIR* Bopendir(const char *name)
|
|||
dirr->status = 0;
|
||||
strcpy(dirr->name, name);
|
||||
|
||||
return (BDIR*)dirr;
|
||||
return (BDIR *)dirr;
|
||||
}
|
||||
|
||||
struct Bdirent* Breaddir(BDIR *dir)
|
||||
struct Bdirent *Breaddir(BDIR *dir)
|
||||
{
|
||||
BDIR_real *dirr = (BDIR_real*)dir;
|
||||
BDIR_real *dirr = (BDIR_real *)dir;
|
||||
struct dirent *de;
|
||||
struct stat st;
|
||||
char *fn;
|
||||
|
@ -694,7 +694,7 @@ struct Bdirent* Breaddir(BDIR *dir)
|
|||
|
||||
int32_t Bclosedir(BDIR *dir)
|
||||
{
|
||||
BDIR_real *dirr = (BDIR_real*)dir;
|
||||
BDIR_real *dirr = (BDIR_real *)dir;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_findclose(dirr->dir);
|
||||
|
@ -798,7 +798,7 @@ uint32_t Bgetsysmemsize(void)
|
|||
|
||||
if (lib)
|
||||
{
|
||||
BOOL (WINAPI *aGlobalMemoryStatusEx)(LPMEMORYSTATUSEX) =
|
||||
BOOL (WINAPI *aGlobalMemoryStatusEx)(LPMEMORYSTATUSEX) =
|
||||
(void *)GetProcAddress(lib, "GlobalMemoryStatusEx");
|
||||
|
||||
if (aGlobalMemoryStatusEx)
|
||||
|
|
|
@ -1502,12 +1502,12 @@ static int32_t defsparser(scriptfile *script)
|
|||
|
||||
klseek(fd, 0, SEEK_SET);
|
||||
if (kread(fd, filebuf, filesize)!=filesize)
|
||||
{ Bfree(highpaldata); initprintf("Error: didn't read all of '%s'.\n", fn); break; }
|
||||
{ Bfree(highpaldata); initprintf("Error: didn't read all of '%s'.\n", fn); break; }
|
||||
|
||||
kclose(fd);
|
||||
kpgetdim(filebuf, filesize, &xsiz, &ysiz);
|
||||
|
||||
if (xsiz != PR_HIGHPALOOKUP_DIM*PR_HIGHPALOOKUP_DIM || ysiz != PR_HIGHPALOOKUP_DIM)
|
||||
if (xsiz != PR_HIGHPALOOKUP_DIM *PR_HIGHPALOOKUP_DIM || ysiz != PR_HIGHPALOOKUP_DIM)
|
||||
{
|
||||
initprintf("Error: image dimensions of '%s' must be %dx%d.\n",
|
||||
fn, PR_HIGHPALOOKUP_DIM*PR_HIGHPALOOKUP_DIM, PR_HIGHPALOOKUP_DIM);
|
||||
|
@ -1518,7 +1518,7 @@ static int32_t defsparser(scriptfile *script)
|
|||
i = kprender(filebuf, filesize, (intptr_t)highpaldata, xsiz*sizeof(coltype), xsiz, ysiz, 0, 0);
|
||||
Bfree(filebuf);
|
||||
if (i)
|
||||
{ Bfree(highpaldata); initprintf("Error: failed rendering '%s'.\n", fn); break; }
|
||||
{ Bfree(highpaldata); initprintf("Error: failed rendering '%s'.\n", fn); break; }
|
||||
}
|
||||
|
||||
polymer_definehighpalookup(pal, highpaldata);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -11,277 +11,277 @@
|
|||
#include "sdl_inc.h"
|
||||
#endif
|
||||
|
||||
void (APIENTRY * bglClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
void (APIENTRY * bglClear)(GLbitfield mask);
|
||||
void (APIENTRY * bglColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
void (APIENTRY * bglAlphaFunc)(GLenum func, GLclampf ref);
|
||||
void (APIENTRY * bglBlendFunc)(GLenum sfactor, GLenum dfactor);
|
||||
void (APIENTRY * bglCullFace)(GLenum mode);
|
||||
void (APIENTRY * bglFrontFace)(GLenum mode);
|
||||
void (APIENTRY * bglPolygonOffset)(GLfloat factor, GLfloat units);
|
||||
void (APIENTRY * bglPolygonMode)(GLenum face, GLenum mode);
|
||||
void (APIENTRY * bglEnable)(GLenum cap);
|
||||
void (APIENTRY * bglDisable)(GLenum cap);
|
||||
void (APIENTRY * bglGetDoublev)(GLenum pname, GLdouble *params);
|
||||
void (APIENTRY * bglGetFloatv)(GLenum pname, GLfloat *params);
|
||||
void (APIENTRY * bglGetIntegerv)(GLenum pname, GLint *params);
|
||||
void (APIENTRY * bglPushAttrib)(GLbitfield mask);
|
||||
void (APIENTRY * bglPopAttrib)(void);
|
||||
GLenum(APIENTRY * bglGetError)(void);
|
||||
const GLubyte*(APIENTRY * bglGetString)(GLenum name);
|
||||
void (APIENTRY * bglHint)(GLenum target, GLenum mode);
|
||||
void (APIENTRY * bglDrawBuffer)(GLenum mode);
|
||||
void (APIENTRY * bglReadBuffer)(GLenum mode);
|
||||
void (APIENTRY * bglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (APIENTRY * bglClipPlane)(GLenum plane, const GLdouble *equation);
|
||||
void (APIENTRY *bglClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
void (APIENTRY *bglClear)(GLbitfield mask);
|
||||
void (APIENTRY *bglColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
void (APIENTRY *bglAlphaFunc)(GLenum func, GLclampf ref);
|
||||
void (APIENTRY *bglBlendFunc)(GLenum sfactor, GLenum dfactor);
|
||||
void (APIENTRY *bglCullFace)(GLenum mode);
|
||||
void (APIENTRY *bglFrontFace)(GLenum mode);
|
||||
void (APIENTRY *bglPolygonOffset)(GLfloat factor, GLfloat units);
|
||||
void (APIENTRY *bglPolygonMode)(GLenum face, GLenum mode);
|
||||
void (APIENTRY *bglEnable)(GLenum cap);
|
||||
void (APIENTRY *bglDisable)(GLenum cap);
|
||||
void (APIENTRY *bglGetDoublev)(GLenum pname, GLdouble *params);
|
||||
void (APIENTRY *bglGetFloatv)(GLenum pname, GLfloat *params);
|
||||
void (APIENTRY *bglGetIntegerv)(GLenum pname, GLint *params);
|
||||
void (APIENTRY *bglPushAttrib)(GLbitfield mask);
|
||||
void (APIENTRY *bglPopAttrib)(void);
|
||||
GLenum(APIENTRY *bglGetError)(void);
|
||||
const GLubyte *(APIENTRY *bglGetString)(GLenum name);
|
||||
void (APIENTRY *bglHint)(GLenum target, GLenum mode);
|
||||
void (APIENTRY *bglDrawBuffer)(GLenum mode);
|
||||
void (APIENTRY *bglReadBuffer)(GLenum mode);
|
||||
void (APIENTRY *bglScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (APIENTRY *bglClipPlane)(GLenum plane, const GLdouble *equation);
|
||||
|
||||
// Depth
|
||||
void (APIENTRY * bglDepthFunc)(GLenum func);
|
||||
void (APIENTRY * bglDepthMask)(GLboolean flag);
|
||||
void (APIENTRY * bglDepthRange)(GLclampd near_val, GLclampd far_val);
|
||||
void (APIENTRY *bglDepthFunc)(GLenum func);
|
||||
void (APIENTRY *bglDepthMask)(GLboolean flag);
|
||||
void (APIENTRY *bglDepthRange)(GLclampd near_val, GLclampd far_val);
|
||||
|
||||
// Matrix
|
||||
void (APIENTRY * bglMatrixMode)(GLenum mode);
|
||||
void (APIENTRY * bglOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
|
||||
void (APIENTRY * bglFrustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
|
||||
void (APIENTRY * bglViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (APIENTRY * bglPushMatrix)(void);
|
||||
void (APIENTRY * bglPopMatrix)(void);
|
||||
void (APIENTRY * bglLoadIdentity)(void);
|
||||
void (APIENTRY * bglLoadMatrixf)(const GLfloat *m);
|
||||
void (APIENTRY * bglLoadMatrixd)(const GLdouble *m);
|
||||
void (APIENTRY * bglMultMatrixf)(const GLfloat *m);
|
||||
void (APIENTRY * bglMultMatrixd)(const GLdouble *m);
|
||||
void (APIENTRY * bglRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
void (APIENTRY * bglScalef)(GLfloat x, GLfloat y, GLfloat z);
|
||||
void (APIENTRY * bglTranslatef)(GLfloat x, GLfloat y, GLfloat z);
|
||||
void (APIENTRY *bglMatrixMode)(GLenum mode);
|
||||
void (APIENTRY *bglOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
|
||||
void (APIENTRY *bglFrustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val);
|
||||
void (APIENTRY *bglViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (APIENTRY *bglPushMatrix)(void);
|
||||
void (APIENTRY *bglPopMatrix)(void);
|
||||
void (APIENTRY *bglLoadIdentity)(void);
|
||||
void (APIENTRY *bglLoadMatrixf)(const GLfloat *m);
|
||||
void (APIENTRY *bglLoadMatrixd)(const GLdouble *m);
|
||||
void (APIENTRY *bglMultMatrixf)(const GLfloat *m);
|
||||
void (APIENTRY *bglMultMatrixd)(const GLdouble *m);
|
||||
void (APIENTRY *bglRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
void (APIENTRY *bglScalef)(GLfloat x, GLfloat y, GLfloat z);
|
||||
void (APIENTRY *bglTranslatef)(GLfloat x, GLfloat y, GLfloat z);
|
||||
|
||||
// Drawing
|
||||
void (APIENTRY * bglBegin)(GLenum mode);
|
||||
void (APIENTRY * bglEnd)(void);
|
||||
void (APIENTRY * bglVertex2f)(GLfloat x, GLfloat y);
|
||||
void (APIENTRY * bglVertex2i)(GLint x, GLint y);
|
||||
void (APIENTRY * bglVertex3f)(GLfloat x, GLfloat y, GLfloat z);
|
||||
void (APIENTRY * bglVertex3d)(GLdouble x, GLdouble y, GLdouble z);
|
||||
void (APIENTRY * bglVertex3fv)(const GLfloat *v);
|
||||
void (APIENTRY * bglVertex3dv)(const GLdouble *v);
|
||||
void (APIENTRY * bglColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
void (APIENTRY * bglColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
|
||||
void (APIENTRY * bglTexCoord2d)(GLdouble s, GLdouble t);
|
||||
void (APIENTRY * bglTexCoord2f)(GLfloat s, GLfloat t);
|
||||
void (APIENTRY * bglTexCoord2i)(GLint s, GLint t);
|
||||
void (APIENTRY * bglNormal3f)(GLfloat x, GLfloat y, GLfloat z);
|
||||
void (APIENTRY *bglBegin)(GLenum mode);
|
||||
void (APIENTRY *bglEnd)(void);
|
||||
void (APIENTRY *bglVertex2f)(GLfloat x, GLfloat y);
|
||||
void (APIENTRY *bglVertex2i)(GLint x, GLint y);
|
||||
void (APIENTRY *bglVertex3f)(GLfloat x, GLfloat y, GLfloat z);
|
||||
void (APIENTRY *bglVertex3d)(GLdouble x, GLdouble y, GLdouble z);
|
||||
void (APIENTRY *bglVertex3fv)(const GLfloat *v);
|
||||
void (APIENTRY *bglVertex3dv)(const GLdouble *v);
|
||||
void (APIENTRY *bglColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
void (APIENTRY *bglColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
|
||||
void (APIENTRY *bglTexCoord2d)(GLdouble s, GLdouble t);
|
||||
void (APIENTRY *bglTexCoord2f)(GLfloat s, GLfloat t);
|
||||
void (APIENTRY *bglTexCoord2i)(GLint s, GLint t);
|
||||
void (APIENTRY *bglNormal3f)(GLfloat x, GLfloat y, GLfloat z);
|
||||
|
||||
// Lighting
|
||||
void (APIENTRY * bglShadeModel)(GLenum mode);
|
||||
void (APIENTRY * bglLightfv)(GLenum light, GLenum pname, const GLfloat * params);
|
||||
void (APIENTRY *bglShadeModel)(GLenum mode);
|
||||
void (APIENTRY *bglLightfv)(GLenum light, GLenum pname, const GLfloat *params);
|
||||
|
||||
// Raster funcs
|
||||
void (APIENTRY * bglReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
|
||||
void (APIENTRY * bglRasterPos4i)(GLint x, GLint y, GLint z, GLint w);
|
||||
void (APIENTRY * bglDrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void (APIENTRY *bglReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
|
||||
void (APIENTRY *bglRasterPos4i)(GLint x, GLint y, GLint z, GLint w);
|
||||
void (APIENTRY *bglDrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
|
||||
// Texture mapping
|
||||
void (APIENTRY * bglTexEnvf)(GLenum target, GLenum pname, GLfloat param);
|
||||
void (APIENTRY * bglGenTextures)(GLsizei n, GLuint *textures); // 1.1
|
||||
void (APIENTRY * bglDeleteTextures)(GLsizei n, const GLuint *textures); // 1.1
|
||||
void (APIENTRY * bglBindTexture)(GLenum target, GLuint texture); // 1.1
|
||||
void (APIENTRY * bglTexImage2D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void (APIENTRY * bglTexImage3D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void (APIENTRY * bglCopyTexImage2D)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void (APIENTRY * bglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (APIENTRY * bglTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); // 1.1
|
||||
void (APIENTRY * bglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
|
||||
void (APIENTRY * bglTexParameteri)(GLenum target, GLenum pname, GLint param);
|
||||
void (APIENTRY * bglGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void (APIENTRY * bglCompressedTexImage2DARB)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
void (APIENTRY * bglGetCompressedTexImageARB)(GLenum, GLint, GLvoid *);
|
||||
void (APIENTRY * bglTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void (APIENTRY *bglTexEnvf)(GLenum target, GLenum pname, GLfloat param);
|
||||
void (APIENTRY *bglGenTextures)(GLsizei n, GLuint *textures); // 1.1
|
||||
void (APIENTRY *bglDeleteTextures)(GLsizei n, const GLuint *textures); // 1.1
|
||||
void (APIENTRY *bglBindTexture)(GLenum target, GLuint texture); // 1.1
|
||||
void (APIENTRY *bglTexImage2D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void (APIENTRY *bglTexImage3D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void (APIENTRY *bglCopyTexImage2D)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void (APIENTRY *bglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (APIENTRY *bglTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); // 1.1
|
||||
void (APIENTRY *bglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
|
||||
void (APIENTRY *bglTexParameteri)(GLenum target, GLenum pname, GLint param);
|
||||
void (APIENTRY *bglGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void (APIENTRY *bglCompressedTexImage2DARB)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
void (APIENTRY *bglGetCompressedTexImageARB)(GLenum, GLint, GLvoid *);
|
||||
void (APIENTRY *bglTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
|
||||
// Fog
|
||||
void (APIENTRY * bglFogf)(GLenum pname, GLfloat param);
|
||||
void (APIENTRY * bglFogi)(GLenum pname, GLint param);
|
||||
void (APIENTRY * bglFogfv)(GLenum pname, const GLfloat *params);
|
||||
void (APIENTRY *bglFogf)(GLenum pname, GLfloat param);
|
||||
void (APIENTRY *bglFogi)(GLenum pname, GLint param);
|
||||
void (APIENTRY *bglFogfv)(GLenum pname, const GLfloat *params);
|
||||
|
||||
// Display Lists
|
||||
void (APIENTRY * bglNewList)(GLuint list, GLenum mode);
|
||||
void (APIENTRY * bglEndList)(void);
|
||||
void (APIENTRY * bglCallList)(GLuint list);
|
||||
void (APIENTRY * bglDeleteLists)(GLuint list, GLsizei range);
|
||||
void (APIENTRY *bglNewList)(GLuint list, GLenum mode);
|
||||
void (APIENTRY *bglEndList)(void);
|
||||
void (APIENTRY *bglCallList)(GLuint list);
|
||||
void (APIENTRY *bglDeleteLists)(GLuint list, GLsizei range);
|
||||
|
||||
// Vertex Arrays
|
||||
void (APIENTRY * bglEnableClientState)(GLenum cap);
|
||||
void (APIENTRY * bglDisableClientState)(GLenum cap);
|
||||
void (APIENTRY * bglVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void (APIENTRY * bglNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void (APIENTRY * bglTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void (APIENTRY * bglDrawArrays)(GLenum mode, GLint first, GLsizei count);
|
||||
void (APIENTRY * bglDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
void (APIENTRY *bglEnableClientState)(GLenum cap);
|
||||
void (APIENTRY *bglDisableClientState)(GLenum cap);
|
||||
void (APIENTRY *bglVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void (APIENTRY *bglNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void (APIENTRY *bglTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void (APIENTRY *bglDrawArrays)(GLenum mode, GLint first, GLsizei count);
|
||||
void (APIENTRY *bglDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
|
||||
// Stencil Buffer
|
||||
void (APIENTRY * bglClearStencil)(GLint s);
|
||||
void (APIENTRY * bglStencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
|
||||
void (APIENTRY * bglStencilFunc)(GLenum func, GLint ref, GLuint mask);
|
||||
void (APIENTRY *bglClearStencil)(GLint s);
|
||||
void (APIENTRY *bglStencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
|
||||
void (APIENTRY *bglStencilFunc)(GLenum func, GLint ref, GLuint mask);
|
||||
|
||||
// GPU Programs
|
||||
void (APIENTRY * bglGenProgramsARB)(GLsizei, GLuint *);
|
||||
void (APIENTRY * bglBindProgramARB)(GLenum, GLuint);
|
||||
void (APIENTRY * bglProgramStringARB)(GLenum, GLenum, GLsizei, const GLvoid *);
|
||||
void (APIENTRY * bglDeleteProgramsARB)(GLsizei n, const GLuint *programs);
|
||||
void (APIENTRY *bglGenProgramsARB)(GLsizei, GLuint *);
|
||||
void (APIENTRY *bglBindProgramARB)(GLenum, GLuint);
|
||||
void (APIENTRY *bglProgramStringARB)(GLenum, GLenum, GLsizei, const GLvoid *);
|
||||
void (APIENTRY *bglDeleteProgramsARB)(GLsizei n, const GLuint *programs);
|
||||
|
||||
// Multitexturing
|
||||
void (APIENTRY * bglActiveTextureARB)(GLenum texture);
|
||||
void (APIENTRY * bglClientActiveTextureARB)(GLenum texture);
|
||||
void (APIENTRY * bglMultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t);
|
||||
void (APIENTRY * bglMultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t);
|
||||
void (APIENTRY *bglActiveTextureARB)(GLenum texture);
|
||||
void (APIENTRY *bglClientActiveTextureARB)(GLenum texture);
|
||||
void (APIENTRY *bglMultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t);
|
||||
void (APIENTRY *bglMultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t);
|
||||
|
||||
// Frame Buffer Objects
|
||||
void (APIENTRY * bglGenFramebuffersEXT)(GLsizei n, GLuint *framebuffers);
|
||||
void (APIENTRY * bglBindFramebufferEXT)(GLenum target, GLuint framebuffer);
|
||||
void (APIENTRY * bglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
GLenum(APIENTRY * bglCheckFramebufferStatusEXT)(GLenum target);
|
||||
void (APIENTRY * bglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers);
|
||||
void (APIENTRY *bglGenFramebuffersEXT)(GLsizei n, GLuint *framebuffers);
|
||||
void (APIENTRY *bglBindFramebufferEXT)(GLenum target, GLuint framebuffer);
|
||||
void (APIENTRY *bglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
GLenum(APIENTRY *bglCheckFramebufferStatusEXT)(GLenum target);
|
||||
void (APIENTRY *bglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers);
|
||||
|
||||
// Vertex Buffer Objects
|
||||
void (APIENTRY * bglGenBuffersARB)(GLsizei n, GLuint * buffers);
|
||||
void (APIENTRY * bglBindBufferARB)(GLenum target, GLuint buffer);
|
||||
void (APIENTRY * bglDeleteBuffersARB)(GLsizei n, const GLuint * buffers);
|
||||
void (APIENTRY * bglBufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage);
|
||||
void (APIENTRY * bglBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data);
|
||||
void*(APIENTRY * bglMapBufferARB)(GLenum target, GLenum access);
|
||||
GLboolean(APIENTRY * bglUnmapBufferARB)(GLenum target);
|
||||
void (APIENTRY *bglGenBuffersARB)(GLsizei n, GLuint *buffers);
|
||||
void (APIENTRY *bglBindBufferARB)(GLenum target, GLuint buffer);
|
||||
void (APIENTRY *bglDeleteBuffersARB)(GLsizei n, const GLuint *buffers);
|
||||
void (APIENTRY *bglBufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
|
||||
void (APIENTRY *bglBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
|
||||
void *(APIENTRY *bglMapBufferARB)(GLenum target, GLenum access);
|
||||
GLboolean(APIENTRY *bglUnmapBufferARB)(GLenum target);
|
||||
|
||||
// Occlusion queries
|
||||
void (APIENTRY * bglGenQueriesARB)(GLsizei n, GLuint *ids);
|
||||
void (APIENTRY * bglDeleteQueriesARB)(GLsizei n, const GLuint *ids);
|
||||
GLboolean(APIENTRY * bglIsQueryARB)(GLuint id);
|
||||
void (APIENTRY * bglBeginQueryARB)(GLenum target, GLuint id);
|
||||
void (APIENTRY * bglEndQueryARB)(GLenum target);
|
||||
void (APIENTRY * bglGetQueryivARB)(GLenum target, GLenum pname, GLint *params);
|
||||
void (APIENTRY * bglGetQueryObjectivARB)(GLuint id, GLenum pname, GLint *params);
|
||||
void (APIENTRY * bglGetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint *params);
|
||||
void (APIENTRY *bglGenQueriesARB)(GLsizei n, GLuint *ids);
|
||||
void (APIENTRY *bglDeleteQueriesARB)(GLsizei n, const GLuint *ids);
|
||||
GLboolean(APIENTRY *bglIsQueryARB)(GLuint id);
|
||||
void (APIENTRY *bglBeginQueryARB)(GLenum target, GLuint id);
|
||||
void (APIENTRY *bglEndQueryARB)(GLenum target);
|
||||
void (APIENTRY *bglGetQueryivARB)(GLenum target, GLenum pname, GLint *params);
|
||||
void (APIENTRY *bglGetQueryObjectivARB)(GLuint id, GLenum pname, GLint *params);
|
||||
void (APIENTRY *bglGetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint *params);
|
||||
|
||||
// Shader Objects
|
||||
void (APIENTRY * bglDeleteObjectARB)(GLhandleARB);
|
||||
GLhandleARB(APIENTRY * bglGetHandleARB)(GLenum);
|
||||
void (APIENTRY * bglDetachObjectARB)(GLhandleARB, GLhandleARB);
|
||||
GLhandleARB(APIENTRY * bglCreateShaderObjectARB)(GLenum);
|
||||
void (APIENTRY * bglShaderSourceARB)(GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
|
||||
void (APIENTRY * bglCompileShaderARB)(GLhandleARB);
|
||||
GLhandleARB(APIENTRY * bglCreateProgramObjectARB)(void);
|
||||
void (APIENTRY * bglAttachObjectARB)(GLhandleARB, GLhandleARB);
|
||||
void (APIENTRY * bglLinkProgramARB)(GLhandleARB);
|
||||
void (APIENTRY * bglUseProgramObjectARB)(GLhandleARB);
|
||||
void (APIENTRY * bglValidateProgramARB)(GLhandleARB);
|
||||
void (APIENTRY * bglUniform1fARB)(GLint, GLfloat);
|
||||
void (APIENTRY * bglUniform2fARB)(GLint, GLfloat, GLfloat);
|
||||
void (APIENTRY * bglUniform3fARB)(GLint, GLfloat, GLfloat, GLfloat);
|
||||
void (APIENTRY * bglUniform4fARB)(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
void (APIENTRY * bglUniform1iARB)(GLint, GLint);
|
||||
void (APIENTRY * bglUniform2iARB)(GLint, GLint, GLint);
|
||||
void (APIENTRY * bglUniform3iARB)(GLint, GLint, GLint, GLint);
|
||||
void (APIENTRY * bglUniform4iARB)(GLint, GLint, GLint, GLint, GLint);
|
||||
void (APIENTRY * bglUniform1fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
void (APIENTRY * bglUniform2fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
void (APIENTRY * bglUniform3fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
void (APIENTRY * bglUniform4fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
void (APIENTRY * bglUniform1ivARB)(GLint, GLsizei, const GLint *);
|
||||
void (APIENTRY * bglUniform2ivARB)(GLint, GLsizei, const GLint *);
|
||||
void (APIENTRY * bglUniform3ivARB)(GLint, GLsizei, const GLint *);
|
||||
void (APIENTRY * bglUniform4ivARB)(GLint, GLsizei, const GLint *);
|
||||
void (APIENTRY * bglUniformMatrix2fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
void (APIENTRY * bglUniformMatrix3fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
void (APIENTRY * bglUniformMatrix4fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
void (APIENTRY * bglGetObjectParameterfvARB)(GLhandleARB, GLenum, GLfloat *);
|
||||
void (APIENTRY * bglGetObjectParameterivARB)(GLhandleARB, GLenum, GLint *);
|
||||
void (APIENTRY * bglGetInfoLogARB)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
|
||||
void (APIENTRY * bglGetAttachedObjectsARB)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
|
||||
GLint(APIENTRY * bglGetUniformLocationARB)(GLhandleARB, const GLcharARB *);
|
||||
void (APIENTRY * bglGetActiveUniformARB)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
|
||||
void (APIENTRY * bglGetUniformfvARB)(GLhandleARB, GLint, GLfloat *);
|
||||
void (APIENTRY * bglGetUniformivARB)(GLhandleARB, GLint, GLint *);
|
||||
void (APIENTRY * bglGetShaderSourceARB)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
|
||||
void (APIENTRY *bglDeleteObjectARB)(GLhandleARB);
|
||||
GLhandleARB(APIENTRY *bglGetHandleARB)(GLenum);
|
||||
void (APIENTRY *bglDetachObjectARB)(GLhandleARB, GLhandleARB);
|
||||
GLhandleARB(APIENTRY *bglCreateShaderObjectARB)(GLenum);
|
||||
void (APIENTRY *bglShaderSourceARB)(GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
|
||||
void (APIENTRY *bglCompileShaderARB)(GLhandleARB);
|
||||
GLhandleARB(APIENTRY *bglCreateProgramObjectARB)(void);
|
||||
void (APIENTRY *bglAttachObjectARB)(GLhandleARB, GLhandleARB);
|
||||
void (APIENTRY *bglLinkProgramARB)(GLhandleARB);
|
||||
void (APIENTRY *bglUseProgramObjectARB)(GLhandleARB);
|
||||
void (APIENTRY *bglValidateProgramARB)(GLhandleARB);
|
||||
void (APIENTRY *bglUniform1fARB)(GLint, GLfloat);
|
||||
void (APIENTRY *bglUniform2fARB)(GLint, GLfloat, GLfloat);
|
||||
void (APIENTRY *bglUniform3fARB)(GLint, GLfloat, GLfloat, GLfloat);
|
||||
void (APIENTRY *bglUniform4fARB)(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
void (APIENTRY *bglUniform1iARB)(GLint, GLint);
|
||||
void (APIENTRY *bglUniform2iARB)(GLint, GLint, GLint);
|
||||
void (APIENTRY *bglUniform3iARB)(GLint, GLint, GLint, GLint);
|
||||
void (APIENTRY *bglUniform4iARB)(GLint, GLint, GLint, GLint, GLint);
|
||||
void (APIENTRY *bglUniform1fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
void (APIENTRY *bglUniform2fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
void (APIENTRY *bglUniform3fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
void (APIENTRY *bglUniform4fvARB)(GLint, GLsizei, const GLfloat *);
|
||||
void (APIENTRY *bglUniform1ivARB)(GLint, GLsizei, const GLint *);
|
||||
void (APIENTRY *bglUniform2ivARB)(GLint, GLsizei, const GLint *);
|
||||
void (APIENTRY *bglUniform3ivARB)(GLint, GLsizei, const GLint *);
|
||||
void (APIENTRY *bglUniform4ivARB)(GLint, GLsizei, const GLint *);
|
||||
void (APIENTRY *bglUniformMatrix2fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
void (APIENTRY *bglUniformMatrix3fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
void (APIENTRY *bglUniformMatrix4fvARB)(GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
void (APIENTRY *bglGetObjectParameterfvARB)(GLhandleARB, GLenum, GLfloat *);
|
||||
void (APIENTRY *bglGetObjectParameterivARB)(GLhandleARB, GLenum, GLint *);
|
||||
void (APIENTRY *bglGetInfoLogARB)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
|
||||
void (APIENTRY *bglGetAttachedObjectsARB)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
|
||||
GLint(APIENTRY *bglGetUniformLocationARB)(GLhandleARB, const GLcharARB *);
|
||||
void (APIENTRY *bglGetActiveUniformARB)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
|
||||
void (APIENTRY *bglGetUniformfvARB)(GLhandleARB, GLint, GLfloat *);
|
||||
void (APIENTRY *bglGetUniformivARB)(GLhandleARB, GLint, GLint *);
|
||||
void (APIENTRY *bglGetShaderSourceARB)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
|
||||
|
||||
// Vertex Shaders
|
||||
void (APIENTRY * bglVertexAttrib1dARB)(GLuint, GLdouble);
|
||||
void (APIENTRY * bglVertexAttrib1dvARB)(GLuint, const GLdouble *);
|
||||
void (APIENTRY * bglVertexAttrib1fARB)(GLuint, GLfloat);
|
||||
void (APIENTRY * bglVertexAttrib1fvARB)(GLuint, const GLfloat *);
|
||||
void (APIENTRY * bglVertexAttrib1sARB)(GLuint, GLshort);
|
||||
void (APIENTRY * bglVertexAttrib1svARB)(GLuint, const GLshort *);
|
||||
void (APIENTRY * bglVertexAttrib2dARB)(GLuint, GLdouble, GLdouble);
|
||||
void (APIENTRY * bglVertexAttrib2dvARB)(GLuint, const GLdouble *);
|
||||
void (APIENTRY * bglVertexAttrib2fARB)(GLuint, GLfloat, GLfloat);
|
||||
void (APIENTRY * bglVertexAttrib2fvARB)(GLuint, const GLfloat *);
|
||||
void (APIENTRY * bglVertexAttrib2sARB)(GLuint, GLshort, GLshort);
|
||||
void (APIENTRY * bglVertexAttrib2svARB)(GLuint, const GLshort *);
|
||||
void (APIENTRY * bglVertexAttrib3dARB)(GLuint, GLdouble, GLdouble, GLdouble);
|
||||
void (APIENTRY * bglVertexAttrib3dvARB)(GLuint, const GLdouble *);
|
||||
void (APIENTRY * bglVertexAttrib3fARB)(GLuint, GLfloat, GLfloat, GLfloat);
|
||||
void (APIENTRY * bglVertexAttrib3fvARB)(GLuint, const GLfloat *);
|
||||
void (APIENTRY * bglVertexAttrib3sARB)(GLuint, GLshort, GLshort, GLshort);
|
||||
void (APIENTRY * bglVertexAttrib3svARB)(GLuint, const GLshort *);
|
||||
void (APIENTRY * bglVertexAttrib4NbvARB)(GLuint, const GLbyte *);
|
||||
void (APIENTRY * bglVertexAttrib4NivARB)(GLuint, const GLint *);
|
||||
void (APIENTRY * bglVertexAttrib4NsvARB)(GLuint, const GLshort *);
|
||||
void (APIENTRY * bglVertexAttrib4NubARB)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
|
||||
void (APIENTRY * bglVertexAttrib4NubvARB)(GLuint, const GLubyte *);
|
||||
void (APIENTRY * bglVertexAttrib4NuivARB)(GLuint, const GLuint *);
|
||||
void (APIENTRY * bglVertexAttrib4NusvARB)(GLuint, const GLushort *);
|
||||
void (APIENTRY * bglVertexAttrib4bvARB)(GLuint, const GLbyte *);
|
||||
void (APIENTRY * bglVertexAttrib4dARB)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
|
||||
void (APIENTRY * bglVertexAttrib4dvARB)(GLuint, const GLdouble *);
|
||||
void (APIENTRY * bglVertexAttrib4fARB)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
void (APIENTRY * bglVertexAttrib4fvARB)(GLuint, const GLfloat *);
|
||||
void (APIENTRY * bglVertexAttrib4ivARB)(GLuint, const GLint *);
|
||||
void (APIENTRY * bglVertexAttrib4sARB)(GLuint, GLshort, GLshort, GLshort, GLshort);
|
||||
void (APIENTRY * bglVertexAttrib4svARB)(GLuint, const GLshort *);
|
||||
void (APIENTRY * bglVertexAttrib4ubvARB)(GLuint, const GLubyte *);
|
||||
void (APIENTRY * bglVertexAttrib4uivARB)(GLuint, const GLuint *);
|
||||
void (APIENTRY * bglVertexAttrib4usvARB)(GLuint, const GLushort *);
|
||||
void (APIENTRY * bglVertexAttribPointerARB)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
|
||||
void (APIENTRY * bglEnableVertexAttribArrayARB)(GLuint);
|
||||
void (APIENTRY * bglDisableVertexAttribArrayARB)(GLuint);
|
||||
void (APIENTRY * bglGetVertexAttribdvARB)(GLuint, GLenum, GLdouble *);
|
||||
void (APIENTRY * bglGetVertexAttribfvARB)(GLuint, GLenum, GLfloat *);
|
||||
void (APIENTRY * bglGetVertexAttribivARB)(GLuint, GLenum, GLint *);
|
||||
void (APIENTRY * bglGetVertexAttribPointervARB)(GLuint, GLenum, GLvoid* *);
|
||||
void (APIENTRY * bglBindAttribLocationARB)(GLhandleARB, GLuint, const GLcharARB *);
|
||||
void (APIENTRY * bglGetActiveAttribARB)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
|
||||
GLint(APIENTRY * bglGetAttribLocationARB)(GLhandleARB, const GLcharARB *);
|
||||
void (APIENTRY *bglVertexAttrib1dARB)(GLuint, GLdouble);
|
||||
void (APIENTRY *bglVertexAttrib1dvARB)(GLuint, const GLdouble *);
|
||||
void (APIENTRY *bglVertexAttrib1fARB)(GLuint, GLfloat);
|
||||
void (APIENTRY *bglVertexAttrib1fvARB)(GLuint, const GLfloat *);
|
||||
void (APIENTRY *bglVertexAttrib1sARB)(GLuint, GLshort);
|
||||
void (APIENTRY *bglVertexAttrib1svARB)(GLuint, const GLshort *);
|
||||
void (APIENTRY *bglVertexAttrib2dARB)(GLuint, GLdouble, GLdouble);
|
||||
void (APIENTRY *bglVertexAttrib2dvARB)(GLuint, const GLdouble *);
|
||||
void (APIENTRY *bglVertexAttrib2fARB)(GLuint, GLfloat, GLfloat);
|
||||
void (APIENTRY *bglVertexAttrib2fvARB)(GLuint, const GLfloat *);
|
||||
void (APIENTRY *bglVertexAttrib2sARB)(GLuint, GLshort, GLshort);
|
||||
void (APIENTRY *bglVertexAttrib2svARB)(GLuint, const GLshort *);
|
||||
void (APIENTRY *bglVertexAttrib3dARB)(GLuint, GLdouble, GLdouble, GLdouble);
|
||||
void (APIENTRY *bglVertexAttrib3dvARB)(GLuint, const GLdouble *);
|
||||
void (APIENTRY *bglVertexAttrib3fARB)(GLuint, GLfloat, GLfloat, GLfloat);
|
||||
void (APIENTRY *bglVertexAttrib3fvARB)(GLuint, const GLfloat *);
|
||||
void (APIENTRY *bglVertexAttrib3sARB)(GLuint, GLshort, GLshort, GLshort);
|
||||
void (APIENTRY *bglVertexAttrib3svARB)(GLuint, const GLshort *);
|
||||
void (APIENTRY *bglVertexAttrib4NbvARB)(GLuint, const GLbyte *);
|
||||
void (APIENTRY *bglVertexAttrib4NivARB)(GLuint, const GLint *);
|
||||
void (APIENTRY *bglVertexAttrib4NsvARB)(GLuint, const GLshort *);
|
||||
void (APIENTRY *bglVertexAttrib4NubARB)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
|
||||
void (APIENTRY *bglVertexAttrib4NubvARB)(GLuint, const GLubyte *);
|
||||
void (APIENTRY *bglVertexAttrib4NuivARB)(GLuint, const GLuint *);
|
||||
void (APIENTRY *bglVertexAttrib4NusvARB)(GLuint, const GLushort *);
|
||||
void (APIENTRY *bglVertexAttrib4bvARB)(GLuint, const GLbyte *);
|
||||
void (APIENTRY *bglVertexAttrib4dARB)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
|
||||
void (APIENTRY *bglVertexAttrib4dvARB)(GLuint, const GLdouble *);
|
||||
void (APIENTRY *bglVertexAttrib4fARB)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
void (APIENTRY *bglVertexAttrib4fvARB)(GLuint, const GLfloat *);
|
||||
void (APIENTRY *bglVertexAttrib4ivARB)(GLuint, const GLint *);
|
||||
void (APIENTRY *bglVertexAttrib4sARB)(GLuint, GLshort, GLshort, GLshort, GLshort);
|
||||
void (APIENTRY *bglVertexAttrib4svARB)(GLuint, const GLshort *);
|
||||
void (APIENTRY *bglVertexAttrib4ubvARB)(GLuint, const GLubyte *);
|
||||
void (APIENTRY *bglVertexAttrib4uivARB)(GLuint, const GLuint *);
|
||||
void (APIENTRY *bglVertexAttrib4usvARB)(GLuint, const GLushort *);
|
||||
void (APIENTRY *bglVertexAttribPointerARB)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
|
||||
void (APIENTRY *bglEnableVertexAttribArrayARB)(GLuint);
|
||||
void (APIENTRY *bglDisableVertexAttribArrayARB)(GLuint);
|
||||
void (APIENTRY *bglGetVertexAttribdvARB)(GLuint, GLenum, GLdouble *);
|
||||
void (APIENTRY *bglGetVertexAttribfvARB)(GLuint, GLenum, GLfloat *);
|
||||
void (APIENTRY *bglGetVertexAttribivARB)(GLuint, GLenum, GLint *);
|
||||
void (APIENTRY *bglGetVertexAttribPointervARB)(GLuint, GLenum, GLvoid* *);
|
||||
void (APIENTRY *bglBindAttribLocationARB)(GLhandleARB, GLuint, const GLcharARB *);
|
||||
void (APIENTRY *bglGetActiveAttribARB)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
|
||||
GLint(APIENTRY *bglGetAttribLocationARB)(GLhandleARB, const GLcharARB *);
|
||||
|
||||
// GLU
|
||||
void (APIENTRY * bgluTessBeginContour)(GLUtesselator* tess);
|
||||
void (APIENTRY * bgluTessBeginPolygon)(GLUtesselator* tess, GLvoid* data);
|
||||
void (APIENTRY * bgluTessCallback)(GLUtesselator* tess, GLenum which, void (PR_CALLBACK CallBackFunc)());
|
||||
void (APIENTRY * bgluTessEndContour)(GLUtesselator* tess);
|
||||
void (APIENTRY * bgluTessEndPolygon)(GLUtesselator* tess);
|
||||
void (APIENTRY * bgluTessNormal)(GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
|
||||
void (APIENTRY * bgluTessProperty)(GLUtesselator* tess, GLenum which, GLdouble data);
|
||||
void (APIENTRY * bgluTessVertex)(GLUtesselator* tess, GLdouble *location, GLvoid* data);
|
||||
GLUtesselator*(APIENTRY * bgluNewTess)(void);
|
||||
void (APIENTRY *bgluTessBeginContour)(GLUtesselator *tess);
|
||||
void (APIENTRY *bgluTessBeginPolygon)(GLUtesselator *tess, GLvoid *data);
|
||||
void (APIENTRY *bgluTessCallback)(GLUtesselator *tess, GLenum which, void (PR_CALLBACK CallBackFunc)());
|
||||
void (APIENTRY *bgluTessEndContour)(GLUtesselator *tess);
|
||||
void (APIENTRY *bgluTessEndPolygon)(GLUtesselator *tess);
|
||||
void (APIENTRY *bgluTessNormal)(GLUtesselator *tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
|
||||
void (APIENTRY *bgluTessProperty)(GLUtesselator *tess, GLenum which, GLdouble data);
|
||||
void (APIENTRY *bgluTessVertex)(GLUtesselator *tess, GLdouble *location, GLvoid *data);
|
||||
GLUtesselator *(APIENTRY *bgluNewTess)(void);
|
||||
|
||||
void (APIENTRY * bgluPerspective)(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
void (APIENTRY *bgluPerspective)(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
|
||||
const GLubyte *(APIENTRY * bgluErrorString)(GLenum error);
|
||||
const GLubyte *(APIENTRY *bgluErrorString)(GLenum error);
|
||||
|
||||
GLint(APIENTRY * bgluProject)(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
|
||||
GLint (APIENTRY * bgluUnProject)(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
|
||||
GLint(APIENTRY *bgluProject)(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble *winX, GLdouble *winY, GLdouble *winZ);
|
||||
GLint(APIENTRY *bgluUnProject)(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble *objX, GLdouble *objY, GLdouble *objZ);
|
||||
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
// Windows
|
||||
HGLRC(WINAPI * bwglCreateContext)(HDC);
|
||||
BOOL (WINAPI * bwglDeleteContext)(HGLRC);
|
||||
PROC(WINAPI * bwglGetProcAddress)(LPCSTR);
|
||||
BOOL (WINAPI * bwglMakeCurrent)(HDC,HGLRC);
|
||||
HGLRC(WINAPI *bwglCreateContext)(HDC);
|
||||
BOOL (WINAPI *bwglDeleteContext)(HGLRC);
|
||||
PROC(WINAPI *bwglGetProcAddress)(LPCSTR);
|
||||
BOOL (WINAPI *bwglMakeCurrent)(HDC,HGLRC);
|
||||
|
||||
BOOL (WINAPI * bwglSwapBuffers)(HDC);
|
||||
int32_t (WINAPI * bwglChoosePixelFormat)(HDC,CONST PIXELFORMATDESCRIPTOR*);
|
||||
int32_t (WINAPI * bwglDescribePixelFormat)(HDC,int32_t,UINT,LPPIXELFORMATDESCRIPTOR);
|
||||
int32_t (WINAPI * bwglGetPixelFormat)(HDC);
|
||||
BOOL (WINAPI * bwglSetPixelFormat)(HDC,int32_t,const PIXELFORMATDESCRIPTOR*);
|
||||
BOOL (WINAPI * bwglSwapIntervalEXT)(int32_t);
|
||||
BOOL (WINAPI *bwglSwapBuffers)(HDC);
|
||||
int32_t (WINAPI *bwglChoosePixelFormat)(HDC,CONST PIXELFORMATDESCRIPTOR *);
|
||||
int32_t (WINAPI *bwglDescribePixelFormat)(HDC,int32_t,UINT,LPPIXELFORMATDESCRIPTOR);
|
||||
int32_t (WINAPI *bwglGetPixelFormat)(HDC);
|
||||
BOOL (WINAPI *bwglSetPixelFormat)(HDC,int32_t,const PIXELFORMATDESCRIPTOR *);
|
||||
BOOL (WINAPI *bwglSwapIntervalEXT)(int32_t);
|
||||
|
||||
static HANDLE hGLDLL, hGLUDLL;
|
||||
#else
|
||||
|
@ -292,15 +292,15 @@ static void *gluhandle = NULL;
|
|||
|
||||
char *gldriver = NULL, *glulibrary = NULL;
|
||||
|
||||
static void * getproc_(const char *s, int32_t *err, int32_t fatal, int32_t extension)
|
||||
static void *getproc_(const char *s, int32_t *err, int32_t fatal, int32_t extension)
|
||||
{
|
||||
void *t;
|
||||
#if defined RENDERTYPESDL
|
||||
UNREFERENCED_PARAMETER(extension);
|
||||
t = (void*)SDL_GL_GetProcAddress(s);
|
||||
t = (void *)SDL_GL_GetProcAddress(s);
|
||||
#elif defined _WIN32
|
||||
if (extension) t = (void*)bwglGetProcAddress(s);
|
||||
else t = (void*)GetProcAddress(hGLDLL,s);
|
||||
if (extension) t = (void *)bwglGetProcAddress(s);
|
||||
else t = (void *)GetProcAddress(hGLDLL,s);
|
||||
#else
|
||||
#error Need a dynamic loader for this platform...
|
||||
#endif
|
||||
|
@ -889,13 +889,13 @@ int32_t unloadgldriver(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void * glugetproc_(const char *s, int32_t *err, int32_t fatal)
|
||||
static void *glugetproc_(const char *s, int32_t *err, int32_t fatal)
|
||||
{
|
||||
void *t;
|
||||
#if defined _WIN32
|
||||
t = (void*)GetProcAddress(hGLUDLL,s);
|
||||
t = (void *)GetProcAddress(hGLUDLL,s);
|
||||
#else
|
||||
t = (void*)dlsym(gluhandle,s);
|
||||
t = (void *)dlsym(gluhandle,s);
|
||||
#endif
|
||||
if (!t && fatal)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ char hicfirstinit = 0;
|
|||
//
|
||||
// find the index into hicreplc[] which contains the replacement tile particulars
|
||||
//
|
||||
hicreplctyp * hicfindsubst(int32_t picnum, int32_t palnum, int32_t skybox)
|
||||
hicreplctyp *hicfindsubst(int32_t picnum, int32_t palnum, int32_t skybox)
|
||||
{
|
||||
if (!hicfirstinit || (uint32_t)picnum >= (uint32_t)MAXTILES) return NULL;
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ static _inline int32_t bitrev(int32_t b, int32_t c)
|
|||
mov edx, b
|
||||
mov ecx, c
|
||||
xor eax, eax
|
||||
beg: shr edx, 1
|
||||
beg: shr edx, 1
|
||||
adc eax, eax
|
||||
sub ecx, 1
|
||||
jnz short beg
|
||||
|
@ -230,7 +230,7 @@ static _inline int32_t testflag(int32_t c)
|
|||
mov eax, 1
|
||||
jne menostinx
|
||||
xor eax, eax
|
||||
menostinx:
|
||||
menostinx:
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -256,7 +256,7 @@ static _inline void cpuid(int32_t a, int32_t *s)
|
|||
|
||||
static inline uint32_t bswap(uint32_t a)
|
||||
{
|
||||
__asm__ __volatile__("bswap %0" : "+r"(a) : : "cc");
|
||||
__asm__ __volatile__("bswap %0" : "+r"(a) : : "cc");
|
||||
return a;
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ static inline int32_t bitrev(int32_t b, int32_t c)
|
|||
int32_t a = 0;
|
||||
__asm__ __volatile__(
|
||||
"xorl %%eax, %%eax\n\t0:\n\tshrl $1, %%ebx\n\tadcl %%eax, %%eax\n\tsubl $1, %%ecx\n\tjnz 0b"
|
||||
: "+a"(a), "+b"(b), "+c"(c) : : "cc");
|
||||
: "+a"(a), "+b"(b), "+c"(c) : : "cc");
|
||||
return a;
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ static inline int32_t testflag(int32_t c)
|
|||
"pushf\n\tpopl %%eax\n\tmovl %%eax, %%ebx\n\txorl %%ecx, %%eax\n\tpushl %%eax\n\t"
|
||||
"popf\n\tpushf\n\tpopl %%eax\n\txorl %%ebx, %%eax\n\tmovl $1, %%eax\n\tjne 0f\n\t"
|
||||
"xorl %%eax, %%eax\n\t0:"
|
||||
: "=a"(a) : "c"(c) : "ebx","cc");
|
||||
: "=a"(a) : "c"(c) : "ebx","cc");
|
||||
return a;
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,7 @@ static inline void cpuid(int32_t a, int32_t *s)
|
|||
__asm__ __volatile__(
|
||||
"cpuid\n\tmovl %%eax, (%%esi)\n\tmovl %%ebx, 4(%%esi)\n\t"
|
||||
"movl %%ecx, 8(%%esi)\n\tmovl %%edx, 12(%%esi)"
|
||||
: "+a"(a) : "S"(s) : "ebx","ecx","edx","memory","cc");
|
||||
: "+a"(a) : "S"(s) : "ebx","ecx","edx","memory","cc");
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -337,7 +337,8 @@ static void suckbitsnextblock()
|
|||
if (!zipfilmode)
|
||||
{
|
||||
if (!nfilptr)
|
||||
{ //|===|===|crc|lng|typ|===|===|
|
||||
{
|
||||
//|===|===|crc|lng|typ|===|===|
|
||||
// \ fakebuf: /
|
||||
// |===|===|
|
||||
//----x O---x O--------
|
||||
|
@ -568,26 +569,26 @@ static _inline void rgbhlineasm(int32_t c, int32_t d, int32_t t, int32_t b)
|
|||
add edx, offset olinbuf
|
||||
cmp dword ptr trnsrgb, 0
|
||||
jz short begit2
|
||||
begit:
|
||||
begit:
|
||||
mov eax, dword ptr [ecx+edx]
|
||||
or eax, 0xff000000
|
||||
cmp eax, dword ptr trnsrgb
|
||||
jne short skipit
|
||||
and eax, 0xffffff
|
||||
skipit:
|
||||
skipit:
|
||||
sub ecx, 3
|
||||
mov [edi], eax
|
||||
lea edi, [edi+ebx]
|
||||
jnz short begit
|
||||
jmp short endit
|
||||
begit2:
|
||||
begit2:
|
||||
mov eax, dword ptr [ecx+edx]
|
||||
or eax, 0xff000000
|
||||
sub ecx, 3
|
||||
mov [edi], eax
|
||||
lea edi, [edi+ebx]
|
||||
jnz short begit2
|
||||
endit:
|
||||
endit:
|
||||
pop edi
|
||||
pop ebx
|
||||
}
|
||||
|
@ -607,7 +608,7 @@ static _inline void pal8hlineasm(int32_t c, int32_t d, int32_t t, int32_t b)
|
|||
mov edi, t
|
||||
mov ebx, b
|
||||
add edx, offset olinbuf
|
||||
begit:movzx eax, byte ptr [ecx+edx]
|
||||
begit:movzx eax, byte ptr [ecx+edx]
|
||||
mov eax, dword ptr palcol[eax*4]
|
||||
sub ecx, 1
|
||||
mov [edi], eax
|
||||
|
@ -615,7 +616,7 @@ begit:movzx eax, byte ptr [ecx+edx]
|
|||
jnz short begit
|
||||
pop edi
|
||||
pop ebx
|
||||
endit:
|
||||
endit:
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -635,8 +636,8 @@ static inline int32_t Paeth686(int32_t a, int32_t b, int32_t c)
|
|||
"cmovgel %%ebx, %%ecx \n"
|
||||
"cmpl (%%edx,%%eax,4), %%edi \n"
|
||||
"cmovgel %%eax, %%ecx \n"
|
||||
: "+c"(c) : "a"(a), "b"(b) : "edx","esi","edi","memory","cc"
|
||||
);
|
||||
: "+c"(c) : "a"(a), "b"(b) : "edx","esi","edi","memory","cc"
|
||||
);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
@ -666,8 +667,8 @@ static inline void rgbhlineasm(int32_t c, int32_t d, int32_t t, int32_t b)
|
|||
"leal (%%edi,%%ebx,1), %%edi \n"
|
||||
"jnz 2b \n"
|
||||
"3: \n"
|
||||
: "+c"(c), "+d"(d), "+D"(t) : "b"(b) : "eax","memory","cc"
|
||||
);
|
||||
: "+c"(c), "+d"(d), "+D"(t) : "b"(b) : "eax","memory","cc"
|
||||
);
|
||||
}
|
||||
|
||||
static inline void pal8hlineasm(int32_t c, int32_t d, int32_t t, int32_t b)
|
||||
|
@ -683,8 +684,8 @@ static inline void pal8hlineasm(int32_t c, int32_t d, int32_t t, int32_t b)
|
|||
"leal (%%edi,%%ebx,1), %%edi \n"
|
||||
"jnz 0b \n"
|
||||
"1: \n"
|
||||
: "+c"(c), "+d"(d), "+D"(t) : "b"(b) : "eax","memory","cc"
|
||||
);
|
||||
: "+c"(c), "+d"(d), "+D"(t) : "b"(b) : "eax","memory","cc"
|
||||
);
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -747,42 +748,42 @@ static void putbuf(const uint8_t *buf, int32_t leng)
|
|||
switch (filt)
|
||||
{
|
||||
case 0:
|
||||
while (i < x) { olinbuf[xplc] = buf[i]; xplc--; i++; }
|
||||
while (i < x) { olinbuf[xplc] = buf[i]; xplc--; i++; }
|
||||
break;
|
||||
case 1:
|
||||
while (i < x)
|
||||
{
|
||||
olinbuf[xplc] = (uint8_t)(opixbuf1[xm] += buf[i]);
|
||||
xm = xmn[xm]; xplc--; i++;
|
||||
}
|
||||
while (i < x)
|
||||
{
|
||||
olinbuf[xplc] = (uint8_t)(opixbuf1[xm] += buf[i]);
|
||||
xm = xmn[xm]; xplc--; i++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while (i < x) { olinbuf[xplc] += (uint8_t)buf[i]; xplc--; i++; }
|
||||
while (i < x) { olinbuf[xplc] += (uint8_t)buf[i]; xplc--; i++; }
|
||||
break;
|
||||
case 3:
|
||||
while (i < x)
|
||||
{
|
||||
opixbuf1[xm] = olinbuf[xplc] = (uint8_t)(((opixbuf1[xm]+olinbuf[xplc])>>1)+buf[i]);
|
||||
xm = xmn[xm]; xplc--; i++;
|
||||
}
|
||||
while (i < x)
|
||||
{
|
||||
opixbuf1[xm] = olinbuf[xplc] = (uint8_t)(((opixbuf1[xm]+olinbuf[xplc])>>1)+buf[i]);
|
||||
xm = xmn[xm]; xplc--; i++;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while (i < x)
|
||||
{
|
||||
opixbuf1[xm] = (uint8_t)(Paeth(opixbuf1[xm],olinbuf[xplc],opixbuf0[xm])+buf[i]);
|
||||
opixbuf0[xm] = olinbuf[xplc];
|
||||
olinbuf[xplc] = opixbuf1[xm];
|
||||
xm = xmn[xm]; xplc--; i++;
|
||||
}
|
||||
while (i < x)
|
||||
{
|
||||
opixbuf1[xm] = (uint8_t)(Paeth(opixbuf1[xm],olinbuf[xplc],opixbuf0[xm])+buf[i]);
|
||||
opixbuf0[xm] = olinbuf[xplc];
|
||||
olinbuf[xplc] = opixbuf1[xm];
|
||||
xm = xmn[xm]; xplc--; i++;
|
||||
}
|
||||
break;
|
||||
case 5: //Special hack for Paeth686 (Doesn't have to be case 5)
|
||||
while (i < x)
|
||||
{
|
||||
opixbuf1[xm] = (uint8_t)(Paeth686(opixbuf1[xm],olinbuf[xplc],opixbuf0[xm])+buf[i]);
|
||||
opixbuf0[xm] = olinbuf[xplc];
|
||||
olinbuf[xplc] = opixbuf1[xm];
|
||||
xm = xmn[xm]; xplc--; i++;
|
||||
}
|
||||
while (i < x)
|
||||
{
|
||||
opixbuf1[xm] = (uint8_t)(Paeth686(opixbuf1[xm],olinbuf[xplc],opixbuf0[xm])+buf[i]);
|
||||
opixbuf0[xm] = olinbuf[xplc];
|
||||
olinbuf[xplc] = opixbuf1[xm];
|
||||
xm = xmn[xm]; xplc--; i++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -796,26 +797,26 @@ static void putbuf(const uint8_t *buf, int32_t leng)
|
|||
{
|
||||
case 2: rgbhlineasm(x,xr1,p,ixstp); break;
|
||||
case 4:
|
||||
for (; x>xr1; p+=ixstp,x-=2)
|
||||
*(int32_t *)p = (palcol[olinbuf[x]]&LSWAPIB(0xffffff))|LSWAPIL((int32_t)olinbuf[x-1]);
|
||||
for (; x>xr1; p+=ixstp,x-=2)
|
||||
*(int32_t *)p = (palcol[olinbuf[x]]&LSWAPIB(0xffffff))|LSWAPIL((int32_t)olinbuf[x-1]);
|
||||
break;
|
||||
case 6:
|
||||
for (; x>xr1; p+=ixstp,x-=4)
|
||||
{
|
||||
*(char *)(p) = olinbuf[x ]; //B
|
||||
*(char *)(p+1) = olinbuf[x+1]; //G
|
||||
*(char *)(p+2) = olinbuf[x+2]; //R
|
||||
*(char *)(p+3) = olinbuf[x-1]; //A
|
||||
}
|
||||
for (; x>xr1; p+=ixstp,x-=4)
|
||||
{
|
||||
*(char *)(p) = olinbuf[x ]; //B
|
||||
*(char *)(p+1) = olinbuf[x+1]; //G
|
||||
*(char *)(p+2) = olinbuf[x+2]; //R
|
||||
*(char *)(p+3) = olinbuf[x-1]; //A
|
||||
}
|
||||
break;
|
||||
default:
|
||||
switch (bitdepth)
|
||||
{
|
||||
case 1: for (; x>xr1; p+=ixstp,x--) *(int32_t *)p = palcol[olinbuf[x>>3]>>(x&7)]; break;
|
||||
case 2: for (; x>xr1; p+=ixstp,x-=2) *(int32_t *)p = palcol[olinbuf[x>>3]>>(x&6)]; break;
|
||||
case 4: for (; x>xr1; p+=ixstp,x-=4) *(int32_t *)p = palcol[olinbuf[x>>3]>>(x&4)]; break;
|
||||
case 8: pal8hlineasm(x,xr1,p,ixstp); break; //for(;x>xr1;p+=ixstp,x-- ) *(int32_t *)p = palcol[olinbuf[x]]; break;
|
||||
}
|
||||
switch (bitdepth)
|
||||
{
|
||||
case 1: for (; x>xr1; p+=ixstp,x--) *(int32_t *)p = palcol[olinbuf[x>>3]>>(x&7)]; break;
|
||||
case 2: for (; x>xr1; p+=ixstp,x-=2) *(int32_t *)p = palcol[olinbuf[x>>3]>>(x&6)]; break;
|
||||
case 4: for (; x>xr1; p+=ixstp,x-=4) *(int32_t *)p = palcol[olinbuf[x>>3]>>(x&4)]; break;
|
||||
case 8: pal8hlineasm(x,xr1,p,ixstp); break; //for(;x>xr1;p+=ixstp,x-- ) *(int32_t *)p = palcol[olinbuf[x]]; break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
nfplace += nbpl;
|
||||
|
@ -916,19 +917,19 @@ static int32_t kpngrend(const char *kfilebuf, int32_t kfilength,
|
|||
switch (coltype)
|
||||
{
|
||||
case 0: case 4:
|
||||
bakcol = (((int32_t)filptr[0]<<8)+(int32_t)filptr[1])*255/((1<<bitdepth)-1);
|
||||
bakcol = (((int32_t)filptr[0]<<8)+(int32_t)filptr[1])*255/((1<<bitdepth)-1);
|
||||
bakcol = bakcol*0x10101+0xff000000; break;
|
||||
case 2: case 6:
|
||||
if (bitdepth == 8)
|
||||
{ bakcol = (((int32_t)filptr[1])<<16)+(((int32_t)filptr[3])<<8)+((int32_t)filptr[5])+0xff000000; }
|
||||
else
|
||||
{
|
||||
for (i=0,bakcol=0xff000000; i<3; i++)
|
||||
bakcol += ((((((int32_t)filptr[i<<1])<<8)+((int32_t)filptr[(i<<1)+1]))/257)<<(16-(i<<3)));
|
||||
}
|
||||
if (bitdepth == 8)
|
||||
{ bakcol = (((int32_t)filptr[1])<<16)+(((int32_t)filptr[3])<<8)+((int32_t)filptr[5])+0xff000000; }
|
||||
else
|
||||
{
|
||||
for (i=0,bakcol=0xff000000; i<3; i++)
|
||||
bakcol += ((((((int32_t)filptr[i<<1])<<8)+((int32_t)filptr[(i<<1)+1]))/257)<<(16-(i<<3)));
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
bakcol = palcol[filptr[0]]; break;
|
||||
bakcol = palcol[filptr[0]]; break;
|
||||
}
|
||||
bakr = ((bakcol>>16)&255);
|
||||
bakg = ((bakcol>>8)&255);
|
||||
|
@ -940,18 +941,18 @@ static int32_t kpngrend(const char *kfilebuf, int32_t kfilength,
|
|||
switch (coltype)
|
||||
{
|
||||
case 0:
|
||||
if (bitdepth <= 8)
|
||||
palcol[(int32_t)filptr[1]] &= LSWAPIB(0xffffff);
|
||||
if (bitdepth <= 8)
|
||||
palcol[(int32_t)filptr[1]] &= LSWAPIB(0xffffff);
|
||||
//else {} // /c0 /d16 not yet supported
|
||||
break;
|
||||
case 2:
|
||||
if (bitdepth == 8)
|
||||
{ trnsrgb = LSWAPIB((((int32_t)filptr[1])<<16)+(((int32_t)filptr[3])<<8)+((int32_t)filptr[5])+0xff000000); }
|
||||
if (bitdepth == 8)
|
||||
{ trnsrgb = LSWAPIB((((int32_t)filptr[1])<<16)+(((int32_t)filptr[3])<<8)+((int32_t)filptr[5])+0xff000000); }
|
||||
//else {} //WARNING: PNG docs say: MUST compare all 48 bits :(
|
||||
break;
|
||||
case 3:
|
||||
for (i=min(leng,paleng)-1; i>=0; i--)
|
||||
palcol[i] &= LSWAPIB((((int32_t)filptr[i])<<24)|0xffffff);
|
||||
for (i=min(leng,paleng)-1; i>=0; i--)
|
||||
palcol[i] &= LSWAPIB((((int32_t)filptr[i])<<24)|0xffffff);
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
|
@ -1107,7 +1108,7 @@ static int32_t kpngrend(const char *kfilebuf, int32_t kfilength,
|
|||
putbuf(slidebuf,slidew&32767);
|
||||
}
|
||||
|
||||
kpngrend_goodret:;
|
||||
kpngrend_goodret:;
|
||||
if (!(filterest&~(1<<filter1st))) filtype = (int8_t)filter1st;
|
||||
else if ((filter1st == 1) && (!(filterest&~(1<<3)))) filtype = 3;
|
||||
else filtype = 5;
|
||||
|
@ -1187,7 +1188,7 @@ static inline int32_t mulshr32(int32_t a, int32_t b)
|
|||
#endif
|
||||
|
||||
static int32_t cosqr16[8] = //cosqr16[i] = ((cos(PI*i/16)*sqrt(2))<<24);
|
||||
{23726566,23270667,21920489,19727919,16777216,13181774,9079764,4628823};
|
||||
{23726566,23270667,21920489,19727919,16777216,13181774,9079764,4628823};
|
||||
static int32_t crmul[4096], cbmul[4096];
|
||||
|
||||
static void initkpeg()
|
||||
|
@ -1431,8 +1432,8 @@ static int32_t kpegrend(const char *kfilebuf, int32_t kfilength,
|
|||
switch (marker)
|
||||
{
|
||||
case 0xc0: case 0xc1: case 0xc2:
|
||||
//processit!
|
||||
kfileptr++; //numbits = *kfileptr++;
|
||||
//processit!
|
||||
kfileptr++; //numbits = *kfileptr++;
|
||||
|
||||
ydim = SSWAPIL(*(uint16_t *)&kfileptr[0]);
|
||||
xdim = SSWAPIL(*(uint16_t *)&kfileptr[2]);
|
||||
|
@ -1463,64 +1464,64 @@ static int32_t kpegrend(const char *kfilebuf, int32_t kfilength,
|
|||
|
||||
break;
|
||||
case 0xc4: //Huffman table
|
||||
do
|
||||
{
|
||||
ch = *kfileptr++; leng--;
|
||||
if (ch >= 16) { index = ch-12; }
|
||||
else { index = ch; }
|
||||
Bmemcpy((void *)&hufnumatbit[index][1],(void *)kfileptr,16); kfileptr += 16;
|
||||
leng -= 16;
|
||||
|
||||
v = 0; hufcnt[index] = 0;
|
||||
hufquickcnt[index] = 0;
|
||||
for (i=1; i<=16; i++)
|
||||
do
|
||||
{
|
||||
hufmaxatbit[index][i] = v+hufnumatbit[index][i];
|
||||
hufvalatbit[index][i] = hufcnt[index]-v;
|
||||
Bmemcpy((void *)&huftable[index][hufcnt[index]],(void *)kfileptr,(int32_t)hufnumatbit[index][i]);
|
||||
if (i <= 10)
|
||||
for (c=0; c<hufnumatbit[index][i]; c++)
|
||||
for (j=(1<<(10-i)); j>0; j--)
|
||||
{
|
||||
hufquickval[index][hufquickcnt[index]] = huftable[index][hufcnt[index]+c];
|
||||
hufquickbits[index][hufquickcnt[index]] = i;
|
||||
hufquickcnt[index]++;
|
||||
}
|
||||
kfileptr += hufnumatbit[index][i];
|
||||
leng -= hufnumatbit[index][i];
|
||||
hufcnt[index] += hufnumatbit[index][i];
|
||||
v = ((v+hufnumatbit[index][i])<<1);
|
||||
}
|
||||
ch = *kfileptr++; leng--;
|
||||
if (ch >= 16) { index = ch-12; }
|
||||
else { index = ch; }
|
||||
Bmemcpy((void *)&hufnumatbit[index][1],(void *)kfileptr,16); kfileptr += 16;
|
||||
leng -= 16;
|
||||
|
||||
}
|
||||
while (leng > 0);
|
||||
v = 0; hufcnt[index] = 0;
|
||||
hufquickcnt[index] = 0;
|
||||
for (i=1; i<=16; i++)
|
||||
{
|
||||
hufmaxatbit[index][i] = v+hufnumatbit[index][i];
|
||||
hufvalatbit[index][i] = hufcnt[index]-v;
|
||||
Bmemcpy((void *)&huftable[index][hufcnt[index]],(void *)kfileptr,(int32_t)hufnumatbit[index][i]);
|
||||
if (i <= 10)
|
||||
for (c=0; c<hufnumatbit[index][i]; c++)
|
||||
for (j=(1<<(10-i)); j>0; j--)
|
||||
{
|
||||
hufquickval[index][hufquickcnt[index]] = huftable[index][hufcnt[index]+c];
|
||||
hufquickbits[index][hufquickcnt[index]] = i;
|
||||
hufquickcnt[index]++;
|
||||
}
|
||||
kfileptr += hufnumatbit[index][i];
|
||||
leng -= hufnumatbit[index][i];
|
||||
hufcnt[index] += hufnumatbit[index][i];
|
||||
v = ((v+hufnumatbit[index][i])<<1);
|
||||
}
|
||||
|
||||
}
|
||||
while (leng > 0);
|
||||
break;
|
||||
case 0xdb:
|
||||
do
|
||||
{
|
||||
ch = *kfileptr++; leng--;
|
||||
index = (ch&15);
|
||||
prec = (ch>>4);
|
||||
for (z=0; z<64; z++)
|
||||
do
|
||||
{
|
||||
v = (int32_t)(*kfileptr++);
|
||||
if (prec) v = (v<<8)+((int32_t)(*kfileptr++));
|
||||
v <<= 19;
|
||||
if (unzig[z]&7) v = mulshr24(v,cosqr16[unzig[z]&7 ]);
|
||||
if (unzig[z]>>3) v = mulshr24(v,cosqr16[unzig[z]>>3]);
|
||||
quantab[index][unzig[z]] = v;
|
||||
ch = *kfileptr++; leng--;
|
||||
index = (ch&15);
|
||||
prec = (ch>>4);
|
||||
for (z=0; z<64; z++)
|
||||
{
|
||||
v = (int32_t)(*kfileptr++);
|
||||
if (prec) v = (v<<8)+((int32_t)(*kfileptr++));
|
||||
v <<= 19;
|
||||
if (unzig[z]&7) v = mulshr24(v,cosqr16[unzig[z]&7 ]);
|
||||
if (unzig[z]>>3) v = mulshr24(v,cosqr16[unzig[z]>>3]);
|
||||
quantab[index][unzig[z]] = v;
|
||||
}
|
||||
leng -= 64;
|
||||
if (prec) leng -= 64;
|
||||
}
|
||||
leng -= 64;
|
||||
if (prec) leng -= 64;
|
||||
}
|
||||
while (leng > 0);
|
||||
while (leng > 0);
|
||||
break;
|
||||
case 0xdd:
|
||||
restartinterval = SSWAPIL(*(uint16_t *)&kfileptr[0]);
|
||||
restartinterval = SSWAPIL(*(uint16_t *)&kfileptr[0]);
|
||||
kfileptr += leng;
|
||||
break;
|
||||
case 0xda:
|
||||
if ((xdim <= 0) || (ydim <= 0)) { if (dctbuf) Bfree(dctbuf); return(-1); }
|
||||
if ((xdim <= 0) || (ydim <= 0)) { if (dctbuf) Bfree(dctbuf); return(-1); }
|
||||
|
||||
lnumcomponents = (int32_t)(*kfileptr++); if (!lnumcomponents) { if (dctbuf) Bfree(dctbuf); return(-1); }
|
||||
if (lnumcomponents > 1) coltype = 2;
|
||||
|
@ -1603,7 +1604,8 @@ static int32_t kpegrend(const char *kfilebuf, int32_t kfilength,
|
|||
if (!dctbuf) quanptr = &quantab[lcompquantab[c]][0];
|
||||
for (yy=0; yy<(lcompvsamp[c]<<3); yy+=8)
|
||||
for (xx=0; xx<(lcomphsamp[c]<<3); xx+=8)
|
||||
{ //NOTE: Might help to split this code into firstime vs. refinement (!Ah vs. Ah!=0)
|
||||
{
|
||||
//NOTE: Might help to split this code into firstime vs. refinement (!Ah vs. Ah!=0)
|
||||
|
||||
if (dctbuf) dcs = &ldctptr[c][(((y+yy)>>lshy[c])*ldctx[c] + ((x+xx)>>lshx[c]))<<6];
|
||||
|
||||
|
@ -1663,11 +1665,11 @@ static int32_t kpegrend(const char *kfilebuf, int32_t kfilength,
|
|||
{
|
||||
if (Ah)
|
||||
{
|
||||
if (curbits < 8) //Getbits
|
||||
{
|
||||
ch = *kfileptr++; if (ch == 255) kfileptr++;
|
||||
num = (num<<8)+((long)ch); curbits += 8;
|
||||
}
|
||||
if (curbits < 8) //Getbits
|
||||
{
|
||||
ch = *kfileptr++; if (ch == 255) kfileptr++;
|
||||
num = (num<<8)+((long)ch); curbits += 8;
|
||||
}
|
||||
if (num&(pow2long[--curbits])) daval = Alut[0]; else daval = Alut[1];
|
||||
}
|
||||
}
|
||||
|
@ -1758,7 +1760,7 @@ static int32_t kpegrend(const char *kfilebuf, int32_t kfilength,
|
|||
eobrun = 0;
|
||||
}
|
||||
}
|
||||
kpegrend_break2:;
|
||||
kpegrend_break2:;
|
||||
if (!dctbuf) return(0);
|
||||
passcnt++; kfileptr -= ((curbits>>3)+1); break;
|
||||
case 0xd9: break;
|
||||
|
@ -1825,7 +1827,8 @@ static int32_t kgifrend(const char *kfilebuf, int32_t kfilelength,
|
|||
if (kfilebuf[10]&128) { cptr = ptr; ptr += paleng*3; }
|
||||
transcol = -1;
|
||||
while ((chunkind = *ptr++) == '!')
|
||||
{ //! 0xf9 leng flags ? ? transcol
|
||||
{
|
||||
//! 0xf9 leng flags ? ? transcol
|
||||
if (ptr[0] == 0xf9) { if (ptr[2]&1) transcol = (int32_t)(((uint8_t)ptr[5])); }
|
||||
ptr++;
|
||||
do { i = *ptr++; ptr += i; }
|
||||
|
@ -2181,20 +2184,20 @@ static int32_t kbmprend(const char *buf, int32_t fleng,
|
|||
case 4: for (x=x0; x<x1; x++) lptr[x] = palcol[(int32_t)((cptr[x>>1]>>(((x&1)^1)<<2))&15)]; break;
|
||||
case 8: for (x=x0; x<x1; x++) lptr[x] = palcol[(int32_t)(cptr[x])]; break;
|
||||
case 16: for (x=x0; x<x1; x++)
|
||||
{
|
||||
i = ((int32_t)(*(int16_t *)&cptr[x<<1]));
|
||||
lptr[x] = (_lrotl(i,palcol[0])&palcol[3]) +
|
||||
(_lrotl(i,palcol[1])&palcol[4]) +
|
||||
(_lrotl(i,palcol[2])&palcol[5]) + LSWAPIB(0xff000000);
|
||||
} break;
|
||||
{
|
||||
i = ((int32_t)(*(int16_t *)&cptr[x<<1]));
|
||||
lptr[x] = (_lrotl(i,palcol[0])&palcol[3]) +
|
||||
(_lrotl(i,palcol[1])&palcol[4]) +
|
||||
(_lrotl(i,palcol[2])&palcol[5]) + LSWAPIB(0xff000000);
|
||||
} break;
|
||||
case 24: for (x=x0; x<x1; x++) lptr[x] = ((*(int32_t *)&cptr[x*3])|LSWAPIB(0xff000000)); break;
|
||||
case 32: for (x=x0; x<x1; x++)
|
||||
{
|
||||
i = (*(int32_t *)&cptr[x<<2]);
|
||||
lptr[x] = (_lrotl(i,palcol[0])&palcol[3]) +
|
||||
(_lrotl(i,palcol[1])&palcol[4]) +
|
||||
(_lrotl(i,palcol[2])&palcol[5]) + LSWAPIB(0xff000000);
|
||||
} break;
|
||||
{
|
||||
i = (*(int32_t *)&cptr[x<<2]);
|
||||
lptr[x] = (_lrotl(i,palcol[0])&palcol[3]) +
|
||||
(_lrotl(i,palcol[1])&palcol[4]) +
|
||||
(_lrotl(i,palcol[2])&palcol[5]) + LSWAPIB(0xff000000);
|
||||
} break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2479,7 +2482,8 @@ void kpgetdim(const char *buf, int32_t leng, int32_t *xsiz, int32_t *ysiz)
|
|||
(*ysiz) = LSWAPIB(*(int32_t *)&buf[12]);
|
||||
}
|
||||
else
|
||||
{ //Unreliable .TGA identification - this MUST be final case!
|
||||
{
|
||||
//Unreliable .TGA identification - this MUST be final case!
|
||||
if ((leng >= 19) && (!(ubuf[1]&0xfe)))
|
||||
if ((ubuf[2] < 12) && ((1<<ubuf[2])&0xe0e))
|
||||
if ((!(ubuf[16]&7)) && (ubuf[16] != 0) && (ubuf[16] <= 32))
|
||||
|
@ -2818,7 +2822,7 @@ intptr_t kzopen(const char *filnam)
|
|||
{
|
||||
case 0: kzfs.i = 0; return((intptr_t)kzfs.fil);
|
||||
case 8:
|
||||
if (!pnginited) { pnginited = 1; initpngtables(); }
|
||||
if (!pnginited) { pnginited = 1; initpngtables(); }
|
||||
kzfs.comptell = 0;
|
||||
kzfs.compleng = LSWAPIB(*(int32_t *)&tempbuf[18]);
|
||||
|
||||
|
@ -2896,7 +2900,7 @@ int32_t kzfindfile(char *filnam)
|
|||
{
|
||||
int32_t i;
|
||||
|
||||
kzfindfile_beg:;
|
||||
kzfindfile_beg:;
|
||||
filnam[0] = 0;
|
||||
if (srchstat == 0)
|
||||
{
|
||||
|
@ -3091,7 +3095,7 @@ int32_t kzread(void *buffer, int32_t leng)
|
|||
case 2: goto kzreadplc2;
|
||||
case 3: goto kzreadplc3;
|
||||
}
|
||||
kzreadplc0:;
|
||||
kzreadplc0:;
|
||||
do
|
||||
{
|
||||
bfinal = getbits(1); btype = getbits(2);
|
||||
|
@ -3131,7 +3135,7 @@ kzreadplc0:;
|
|||
{
|
||||
kzfs.jmpplc = 1; kzfs.i = i; kzfs.bfinal = bfinal;
|
||||
goto retkzread;
|
||||
kzreadplc1:; i = kzfs.i; bfinal = kzfs.bfinal;
|
||||
kzreadplc1:; i = kzfs.i; bfinal = kzfs.bfinal;
|
||||
}
|
||||
}
|
||||
slidebuf[(gslidew++)&32767] = (uint8_t)getbits(8);
|
||||
|
@ -3185,7 +3189,7 @@ kzreadplc1:; i = kzfs.i; bfinal = kzfs.bfinal;
|
|||
if (gslider-16384 >= kzfs.endpos)
|
||||
{
|
||||
kzfs.jmpplc = 2; kzfs.bfinal = bfinal; goto retkzread;
|
||||
kzreadplc2:; bfinal = kzfs.bfinal;
|
||||
kzreadplc2:; bfinal = kzfs.bfinal;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3215,10 +3219,10 @@ kzreadplc2:; bfinal = kzfs.bfinal;
|
|||
putbuf4zip(&slidebuf[gslider&32767],gslider,gslidew&~32767);
|
||||
putbuf4zip(slidebuf,gslidew&~32767,gslidew);
|
||||
}
|
||||
kzreadplc3:; kzfs.jmpplc = 3;
|
||||
kzreadplc3:; kzfs.jmpplc = 3;
|
||||
}
|
||||
|
||||
retkzread:;
|
||||
retkzread:;
|
||||
i = kzfs.pos;
|
||||
kzfs.pos += leng; if (kzfs.pos > kzfs.leng) kzfs.pos = kzfs.leng;
|
||||
return(kzfs.pos-i);
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
documentation and/or software.
|
||||
*/
|
||||
|
||||
typedef unsigned char * POINTER;
|
||||
typedef unsigned char *POINTER;
|
||||
typedef unsigned short UINT2;
|
||||
typedef unsigned int UINT4;
|
||||
|
||||
|
|
|
@ -59,8 +59,8 @@ static int32_t maxmodeltris = 0, allocmodeltris = 0;
|
|||
static point3d *vertlist = NULL; //temp array to store interpolated vertices for drawing
|
||||
|
||||
static int32_t allocvbos = 0, curvbo = 0;
|
||||
static GLuint* vertvbos = NULL;
|
||||
static GLuint* indexvbos = NULL;
|
||||
static GLuint *vertvbos = NULL;
|
||||
static GLuint *indexvbos = NULL;
|
||||
|
||||
mdmodel_t *mdload(const char *);
|
||||
int32_t mddraw(spritetype *);
|
||||
|
@ -118,13 +118,13 @@ void freeallmodels()
|
|||
}
|
||||
freevbos();
|
||||
|
||||
/*
|
||||
if (model_data_pool)
|
||||
{
|
||||
neddestroypool(model_data_pool);
|
||||
model_data_pool = NULL;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
if (model_data_pool)
|
||||
{
|
||||
neddestroypool(model_data_pool);
|
||||
model_data_pool = NULL;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void clearskins()
|
||||
|
@ -137,27 +137,27 @@ void clearskins()
|
|||
m = models[i];
|
||||
if (m->mdnum == 1)
|
||||
{
|
||||
voxmodel_t *v = (voxmodel_t*)m;
|
||||
voxmodel_t *v = (voxmodel_t *)m;
|
||||
for (j=0; j<MAXPALOOKUPS; j++)
|
||||
{
|
||||
if (v->texid[j]) bglDeleteTextures(1,(GLuint*)&v->texid[j]);
|
||||
if (v->texid[j]) bglDeleteTextures(1,(GLuint *)&v->texid[j]);
|
||||
v->texid[j] = 0;
|
||||
}
|
||||
}
|
||||
else if (m->mdnum == 2 || m->mdnum == 3)
|
||||
{
|
||||
md2model_t *m2 = (md2model_t*)m;
|
||||
md2model_t *m2 = (md2model_t *)m;
|
||||
mdskinmap_t *sk;
|
||||
for (j=0; j<m2->numskins*(HICEFFECTMASK+1); j++)
|
||||
{
|
||||
if (m2->texid[j]) bglDeleteTextures(1,(GLuint*)&m2->texid[j]);
|
||||
if (m2->texid[j]) bglDeleteTextures(1,(GLuint *)&m2->texid[j]);
|
||||
m2->texid[j] = 0;
|
||||
}
|
||||
|
||||
for (sk=m2->skinmap; sk; sk=sk->next)
|
||||
for (j=0; j<(HICEFFECTMASK+1); j++)
|
||||
{
|
||||
if (sk->texid[j]) bglDeleteTextures(1,(GLuint*)&sk->texid[j]);
|
||||
if (sk->texid[j]) bglDeleteTextures(1,(GLuint *)&sk->texid[j]);
|
||||
sk->texid[j] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -165,10 +165,10 @@ void clearskins()
|
|||
|
||||
for (i=0; i<MAXVOXELS; i++)
|
||||
{
|
||||
voxmodel_t *v = (voxmodel_t*)voxmodels[i]; if (!v) continue;
|
||||
voxmodel_t *v = (voxmodel_t *)voxmodels[i]; if (!v) continue;
|
||||
for (j=0; j<MAXPALOOKUPS; j++)
|
||||
{
|
||||
if (v->texid[j]) bglDeleteTextures(1,(GLuint*)&v->texid[j]);
|
||||
if (v->texid[j]) bglDeleteTextures(1,(GLuint *)&v->texid[j]);
|
||||
v->texid[j] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ int32_t md_loadmodel(const char *fn)
|
|||
|
||||
if (nextmodelid >= nummodelsalloced)
|
||||
{
|
||||
ml = (mdmodel_t **)Brealloc(models,(nummodelsalloced+MODELALLOCGROUP)*sizeof(void*)); if (!ml) return(-1);
|
||||
ml = (mdmodel_t **)Brealloc(models,(nummodelsalloced+MODELALLOCGROUP)*sizeof(void *)); if (!ml) return(-1);
|
||||
models = ml; nummodelsalloced += MODELALLOCGROUP;
|
||||
}
|
||||
|
||||
|
@ -272,7 +272,7 @@ int32_t md_defineframe(int32_t modelid, const char *framename, int32_t tilenume,
|
|||
return 0;
|
||||
}
|
||||
|
||||
i = framename2index((mdmodel_t*)m,framename);
|
||||
i = framename2index((mdmodel_t *)m,framename);
|
||||
if (i == m->numframes) return(-3); // frame name invalid
|
||||
|
||||
tile2model[tilenume].modelid = modelid;
|
||||
|
@ -298,19 +298,19 @@ int32_t md_defineanimation(int32_t modelid, const char *framestart, const char *
|
|||
if (m->mdnum < 2) return 0;
|
||||
|
||||
//find index of start frame
|
||||
i = framename2index((mdmodel_t*)m,framestart);
|
||||
i = framename2index((mdmodel_t *)m,framestart);
|
||||
if (i == m->numframes) return -2;
|
||||
ma.startframe = i;
|
||||
|
||||
//find index of finish frame which must trail start frame
|
||||
i = framename2index((mdmodel_t*)m,frameend);
|
||||
i = framename2index((mdmodel_t *)m,frameend);
|
||||
if (i == m->numframes) return -3;
|
||||
ma.endframe = i;
|
||||
|
||||
ma.fpssc = fpssc;
|
||||
ma.flags = flags;
|
||||
|
||||
map = (mdanim_t*)Bcalloc(1,sizeof(mdanim_t));
|
||||
map = (mdanim_t *)Bcalloc(1,sizeof(mdanim_t));
|
||||
if (!map) return(-4);
|
||||
Bmemcpy(map, &ma, sizeof(ma));
|
||||
|
||||
|
@ -789,15 +789,15 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf)
|
|||
willprint = 1;
|
||||
|
||||
if (pal < (MAXPALOOKUPS - RESERVEDPALS)) m->usesalpha = hasalpha;
|
||||
if ((doalloc&3)==1) bglGenTextures(1,(GLuint*)texidx);
|
||||
if ((doalloc&3)==1) bglGenTextures(1,(GLuint *)texidx);
|
||||
bglBindTexture(GL_TEXTURE_2D,*texidx);
|
||||
|
||||
//gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGBA,xsiz,ysiz,GL_BGRA_EXT,GL_UNSIGNED_BYTE,(char *)fptr);
|
||||
if (glinfo.texcompr && glusetexcompr) intexfmt = hasalpha ? GL_COMPRESSED_RGBA_ARB : GL_COMPRESSED_RGB_ARB;
|
||||
else if (!hasalpha) intexfmt = GL_RGB;
|
||||
if (glinfo.bgra) texfmt = GL_BGRA;
|
||||
uploadtexture((doalloc&1), xsiz, ysiz, intexfmt, texfmt, (coltype*)fptr, xsiz, ysiz, 0|8192);
|
||||
Bfree((void*)fptr);
|
||||
uploadtexture((doalloc&1), xsiz, ysiz, intexfmt, texfmt, (coltype *)fptr, xsiz, ysiz, 0|8192);
|
||||
Bfree((void *)fptr);
|
||||
}
|
||||
|
||||
if (!m->skinloaded)
|
||||
|
@ -1088,20 +1088,20 @@ static md2model_t *md2load(int32_t fil, const char *filnam)
|
|||
{
|
||||
m->glcmds[i] = B_LITTLE32(m->glcmds[i]);
|
||||
}
|
||||
for (i = head.numtris-1; i>=0; i--)
|
||||
{
|
||||
m->tris[i].v[0] = B_LITTLE16(m->tris[i].v[0]);
|
||||
m->tris[i].v[1] = B_LITTLE16(m->tris[i].v[1]);
|
||||
m->tris[i].v[2] = B_LITTLE16(m->tris[i].v[2]);
|
||||
m->tris[i].u[0] = B_LITTLE16(m->tris[i].u[0]);
|
||||
m->tris[i].u[1] = B_LITTLE16(m->tris[i].u[1]);
|
||||
m->tris[i].u[2] = B_LITTLE16(m->tris[i].u[2]);
|
||||
}
|
||||
for(i = head.numuv-1; i>=0; i--)
|
||||
{
|
||||
m->uv[i].u = B_LITTLE16(m->uv[i].u);
|
||||
m->uv[i].v = B_LITTLE16(m->uv[i].v);
|
||||
}
|
||||
for (i = head.numtris-1; i>=0; i--)
|
||||
{
|
||||
m->tris[i].v[0] = B_LITTLE16(m->tris[i].v[0]);
|
||||
m->tris[i].v[1] = B_LITTLE16(m->tris[i].v[1]);
|
||||
m->tris[i].v[2] = B_LITTLE16(m->tris[i].v[2]);
|
||||
m->tris[i].u[0] = B_LITTLE16(m->tris[i].u[0]);
|
||||
m->tris[i].u[1] = B_LITTLE16(m->tris[i].u[1]);
|
||||
m->tris[i].u[2] = B_LITTLE16(m->tris[i].u[2]);
|
||||
}
|
||||
for (i = head.numuv-1; i>=0; i--)
|
||||
{
|
||||
m->uv[i].u = B_LITTLE16(m->uv[i].u);
|
||||
m->uv[i].v = B_LITTLE16(m->uv[i].v);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1408,8 +1408,8 @@ static md3model_t *md3load(int32_t fil)
|
|||
if (m->head.tags) Bfree(m->head.tags); Bfree(m->head.frames); Bfree(m); return(0);
|
||||
}
|
||||
s->shaders = (md3shader_t *)(((intptr_t)s->tris)+leng[0]);
|
||||
s->uv = (md3uv_t *)(((intptr_t)s->shaders)+leng[1]);
|
||||
s->xyzn = (md3xyzn_t *)(((intptr_t)s->uv)+leng[2]);
|
||||
s->uv = (md3uv_t *)(((intptr_t)s->shaders)+leng[1]);
|
||||
s->xyzn = (md3xyzn_t *)(((intptr_t)s->uv)+leng[2]);
|
||||
|
||||
klseek(fil,offs[0],SEEK_SET); kread(fil,s->tris ,leng[0]);
|
||||
klseek(fil,offs[1],SEEK_SET); kread(fil,s->shaders,leng[1]);
|
||||
|
@ -1430,7 +1430,7 @@ static md3model_t *md3load(int32_t fil)
|
|||
}
|
||||
for (i=s->numverts-1; i>=0; i--)
|
||||
{
|
||||
l = (int32_t*)&s->uv[i].u;
|
||||
l = (int32_t *)&s->uv[i].u;
|
||||
l[0] = B_LITTLE32(l[0]);
|
||||
l[1] = B_LITTLE32(l[1]);
|
||||
}
|
||||
|
@ -1490,7 +1490,7 @@ static md3model_t *md3load(int32_t fil)
|
|||
return(m);
|
||||
}
|
||||
|
||||
static inline void invertmatrix(float* m, float* out)
|
||||
static inline void invertmatrix(float *m, float *out)
|
||||
{
|
||||
float det;
|
||||
|
||||
|
@ -1513,7 +1513,7 @@ static inline void invertmatrix(float* m, float* out)
|
|||
out[8] = det * (m[0] * m[4] - m[1] * m[3]);
|
||||
}
|
||||
|
||||
static inline void normalize(float* vec)
|
||||
static inline void normalize(float *vec)
|
||||
{
|
||||
double norm;
|
||||
|
||||
|
@ -1526,7 +1526,7 @@ static inline void normalize(float* vec)
|
|||
vec[2] *= norm;
|
||||
}
|
||||
|
||||
static void md3postload_common(md3model_t* m)
|
||||
static void md3postload_common(md3model_t *m)
|
||||
{
|
||||
int framei, surfi, verti;
|
||||
md3frame_t *frame;
|
||||
|
@ -1643,8 +1643,9 @@ static int md3postload_polymer_check(md3model_t *m)
|
|||
{
|
||||
// let the vertices know they're being referenced by a triangle
|
||||
if (s->tris[trii].i[0] >= s->numverts || s->tris[trii].i[0] < 0 ||
|
||||
s->tris[trii].i[1] >= s->numverts || s->tris[trii].i[1] < 0 ||
|
||||
s->tris[trii].i[2] >= s->numverts || s->tris[trii].i[2] < 0) {
|
||||
s->tris[trii].i[1] >= s->numverts || s->tris[trii].i[1] < 0 ||
|
||||
s->tris[trii].i[2] >= s->numverts || s->tris[trii].i[2] < 0)
|
||||
{
|
||||
// corrupt model
|
||||
OSD_Printf("Triangle index out of bounds!\n");
|
||||
return 0;
|
||||
|
@ -1660,7 +1661,7 @@ static int md3postload_polymer_check(md3model_t *m)
|
|||
}
|
||||
#endif
|
||||
|
||||
int md3postload_polymer(md3model_t* m)
|
||||
int md3postload_polymer(md3model_t *m)
|
||||
{
|
||||
#ifdef POLYMER
|
||||
int framei, surfi, verti, trii, i;
|
||||
|
@ -1710,8 +1711,9 @@ int md3postload_polymer(md3model_t* m)
|
|||
{
|
||||
// let the vertices know they're being referenced by a triangle
|
||||
if (s->tris[trii].i[0] >= s->numverts || s->tris[trii].i[0] < 0 ||
|
||||
s->tris[trii].i[1] >= s->numverts || s->tris[trii].i[1] < 0 ||
|
||||
s->tris[trii].i[2] >= s->numverts || s->tris[trii].i[2] < 0) {
|
||||
s->tris[trii].i[1] >= s->numverts || s->tris[trii].i[1] < 0 ||
|
||||
s->tris[trii].i[2] >= s->numverts || s->tris[trii].i[2] < 0)
|
||||
{
|
||||
// corrupt model
|
||||
Bfree(numtris);
|
||||
OSD_Printf("Triangle index out of bounds!\n");
|
||||
|
@ -1816,9 +1818,9 @@ static int32_t md3draw(md3model_t *m, spritetype *tspr)
|
|||
int32_t texunits = GL_TEXTURE0_ARB;
|
||||
mdskinmap_t *sk;
|
||||
//PLAG : sorting stuff
|
||||
void* vbotemp;
|
||||
point3d* vertexhandle = NULL;
|
||||
uint16_t* indexhandle;
|
||||
void *vbotemp;
|
||||
point3d *vertexhandle = NULL;
|
||||
uint16_t *indexhandle;
|
||||
char lpal = (tspr->owner >= MAXSPRITES) ? tspr->pal : sprite[tspr->owner].pal;
|
||||
|
||||
if (r_vbos && (m->vbos == NULL))
|
||||
|
@ -2406,7 +2408,7 @@ uint32_t gloadtex(int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8bit, i
|
|||
|
||||
pic = (coltype *)picbuf; //Correct for GL's RGB order; also apply gamma here..
|
||||
pic2 = (coltype *)Bmalloc(xsiz*ysiz*sizeof(int32_t)); if (!pic2) return((unsigned)-1);
|
||||
cptr = (char*)&britable[gammabrightness ? 0 : curbrightness][0];
|
||||
cptr = (char *)&britable[gammabrightness ? 0 : curbrightness][0];
|
||||
if (!is8bit)
|
||||
{
|
||||
for (i=xsiz*ysiz-1; i>=0; i--)
|
||||
|
@ -2429,7 +2431,7 @@ uint32_t gloadtex(int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8bit, i
|
|||
}
|
||||
}
|
||||
|
||||
bglGenTextures(1,(GLuint*)&rtexid);
|
||||
bglGenTextures(1,(GLuint *)&rtexid);
|
||||
bglBindTexture(GL_TEXTURE_2D,rtexid);
|
||||
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
|
||||
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
|
||||
|
@ -3208,7 +3210,7 @@ mdmodel_t *mdload(const char *filnam)
|
|||
int32_t fil;
|
||||
int32_t i;
|
||||
|
||||
vm = (mdmodel_t*)voxload(filnam); if (vm) return(vm);
|
||||
vm = (mdmodel_t *)voxload(filnam); if (vm) return(vm);
|
||||
|
||||
fil = kopen4load((char *)filnam,0); if (fil < 0) return(0);
|
||||
kread(fil,&i,4); klseek(fil,0,SEEK_SET);
|
||||
|
@ -3217,30 +3219,30 @@ mdmodel_t *mdload(const char *filnam)
|
|||
{
|
||||
case 0x32504449:
|
||||
// initprintf("Warning: model '%s' is version IDP2; wanted version IDP3\n",filnam);
|
||||
vm = (mdmodel_t*)md2load(fil,filnam);
|
||||
vm = (mdmodel_t *)md2load(fil,filnam);
|
||||
break; //IDP2
|
||||
case 0x33504449:
|
||||
vm = (mdmodel_t*)md3load(fil);
|
||||
vm = (mdmodel_t *)md3load(fil);
|
||||
break; //IDP3
|
||||
default:
|
||||
vm = (mdmodel_t*)0; break;
|
||||
vm = (mdmodel_t *)0; break;
|
||||
}
|
||||
kclose(fil);
|
||||
|
||||
if (vm)
|
||||
{
|
||||
md3postload_common((md3model_t*)vm);
|
||||
md3postload_common((md3model_t *)vm);
|
||||
#ifdef POLYMER
|
||||
// implies defined(POLYMOST) && defined(USE_OPENGL)?
|
||||
if (glrendmode==4)
|
||||
i = md3postload_polymer((md3model_t*)vm);
|
||||
i = md3postload_polymer((md3model_t *)vm);
|
||||
else
|
||||
i = md3postload_polymer_check((md3model_t*)vm);
|
||||
i = md3postload_polymer_check((md3model_t *)vm);
|
||||
|
||||
if (!i)
|
||||
{
|
||||
mdfree(vm);
|
||||
vm = (mdmodel_t*)0;
|
||||
vm = (mdmodel_t *)0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -27,7 +27,7 @@ static int32_t _internal_osdfunc_alias(const osdfuncparm_t *);
|
|||
|
||||
static int32_t white=-1; // colour of white (used by default display routines)
|
||||
static void _internal_drawosdchar(int32_t, int32_t, char, int32_t, int32_t);
|
||||
static void _internal_drawosdstr(int32_t, int32_t, char*, int32_t, int32_t, int32_t);
|
||||
static void _internal_drawosdstr(int32_t, int32_t, char *, int32_t, int32_t, int32_t);
|
||||
static void _internal_drawosdcursor(int32_t,int32_t,int32_t,int32_t);
|
||||
static int32_t _internal_getcolumnwidth(int32_t);
|
||||
static int32_t _internal_getrowheight(int32_t);
|
||||
|
@ -105,7 +105,7 @@ static hashtable_t h_osd = { MAXSYMBOLS<<1, NULL };
|
|||
|
||||
// application callbacks
|
||||
static void (*drawosdchar)(int32_t, int32_t, char, int32_t, int32_t) = _internal_drawosdchar;
|
||||
static void (*drawosdstr)(int32_t, int32_t, char*, int32_t, int32_t, int32_t) = _internal_drawosdstr;
|
||||
static void (*drawosdstr)(int32_t, int32_t, char *, int32_t, int32_t, int32_t) = _internal_drawosdstr;
|
||||
static void (*drawosdcursor)(int32_t, int32_t, int32_t, int32_t) = _internal_drawosdcursor;
|
||||
static int32_t (*getcolumnwidth)(int32_t) = _internal_getcolumnwidth;
|
||||
static int32_t (*getrowheight)(int32_t) = _internal_getrowheight;
|
||||
|
@ -114,7 +114,7 @@ static int32_t (*gettime)(void) = _internal_gettime;
|
|||
static void (*onshowosd)(int32_t) = _internal_onshowosd;
|
||||
|
||||
static void (*_drawosdchar)(int32_t, int32_t, char, int32_t, int32_t) = _internal_drawosdchar;
|
||||
static void (*_drawosdstr)(int32_t, int32_t, char*, int32_t, int32_t, int32_t) = _internal_drawosdstr;
|
||||
static void (*_drawosdstr)(int32_t, int32_t, char *, int32_t, int32_t, int32_t) = _internal_drawosdstr;
|
||||
static void (*_drawosdcursor)(int32_t, int32_t, int32_t, int32_t) = _internal_drawosdcursor;
|
||||
static int32_t (*_getcolumnwidth)(int32_t) = _internal_getcolumnwidth;
|
||||
static int32_t (*_getrowheight)(int32_t) = _internal_getrowheight;
|
||||
|
@ -221,7 +221,7 @@ static int32_t OSD_CvarModified(const osdcvar_t *cvar)
|
|||
// ^S# sets a shade, range is 0-7 equiv to shades 0-14
|
||||
// ^O resets formatting to defaults
|
||||
|
||||
const char * OSD_StripColors(char *out, const char *in)
|
||||
const char *OSD_StripColors(char *out, const char *in)
|
||||
{
|
||||
const char *ptr = out;
|
||||
|
||||
|
@ -254,7 +254,7 @@ const char * OSD_StripColors(char *out, const char *in)
|
|||
|
||||
int32_t OSD_Exec(const char *szScript)
|
||||
{
|
||||
FILE* fp = fopenfrompath(szScript, "r");
|
||||
FILE *fp = fopenfrompath(szScript, "r");
|
||||
|
||||
if (fp != NULL)
|
||||
{
|
||||
|
@ -281,19 +281,19 @@ int32_t OSD_OSDKey(void)
|
|||
return osdkey;
|
||||
}
|
||||
|
||||
char * OSD_GetTextPtr(void)
|
||||
char *OSD_GetTextPtr(void)
|
||||
{
|
||||
return (&osdtext[0]);
|
||||
return osdtext;
|
||||
}
|
||||
|
||||
char * OSD_GetFmtPtr(void)
|
||||
char *OSD_GetFmtPtr(void)
|
||||
{
|
||||
return (&osdfmt[0]);
|
||||
return osdfmt;
|
||||
}
|
||||
|
||||
char * OSD_GetFmt(char *ptr)
|
||||
char *OSD_GetFmt(char *ptr)
|
||||
{
|
||||
return (ptr - &osdtext[0] + &osdfmt[0]);
|
||||
return (ptr - osdtext + osdfmt);
|
||||
}
|
||||
|
||||
int32_t OSD_GetCols(void)
|
||||
|
@ -393,9 +393,9 @@ static int32_t _internal_osdfunc_fileinfo(const osdfuncparm_t *parm)
|
|||
kclose(i);
|
||||
|
||||
OSD_Printf("fileinfo: %s\n"
|
||||
" File size: %d\n"
|
||||
" CRC-32: %08X\n",
|
||||
parm->parms[0], length, crc);
|
||||
" File size: %d\n"
|
||||
" CRC-32: %08X\n",
|
||||
parm->parms[0], length, crc);
|
||||
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -603,13 +603,9 @@ static int32_t _internal_osdfunc_help(const osdfuncparm_t *parm)
|
|||
if (parm->numparms != 1) return OSDCMD_SHOWHELP;
|
||||
symb = findexactsymbol(parm->parms[0]);
|
||||
if (!symb)
|
||||
{
|
||||
OSD_Printf("Help Error: \"%s\" is not a defined variable or function\n", parm->parms[0]);
|
||||
}
|
||||
OSD_Printf("Error: no help for undefined symbol \"%s\"\n", parm->parms[0]);
|
||||
else
|
||||
{
|
||||
OSD_Printf("%s\n", symb->help);
|
||||
}
|
||||
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
@ -653,8 +649,11 @@ void OSD_Cleanup(void)
|
|||
Bfree(symbols);
|
||||
}
|
||||
|
||||
if (osdlog) Bfclose(osdlog);
|
||||
osdlog = NULL;
|
||||
if (osdlog)
|
||||
{
|
||||
Bfclose(osdlog);
|
||||
osdlog = NULL;
|
||||
}
|
||||
|
||||
if (cvars)
|
||||
{
|
||||
|
@ -717,15 +716,15 @@ void OSD_Init(void)
|
|||
uint32_t i;
|
||||
cvar_t cvars_osd[] =
|
||||
{
|
||||
{ "osdeditpal","osdeditpal: sets the palette of the OSD input text",(void *)&osdeditpal, CVAR_INT, 0, MAXPALOOKUPS-1 },
|
||||
{ "osdpromptpal","osdpromptpal: sets the palette of the OSD prompt",(void *)&osdpromptpal, CVAR_INT, 0, MAXPALOOKUPS-1 },
|
||||
{ "osdtextpal","osdtextpal: sets the palette of the OSD text",(void *)&osdtextpal, CVAR_INT, 0, MAXPALOOKUPS-1 },
|
||||
{ "osdeditshade","osdeditshade: sets the shade of the OSD input text",(void *)&osdeditshade, CVAR_INT, 0, 7 },
|
||||
{ "osdtextshade","osdtextshade: sets the shade of the OSD text",(void *)&osdtextshade, CVAR_INT, 0, 7 },
|
||||
{ "osdpromptshade","osdpromptshade: sets the shade of the OSD prompt",(void *)&osdpromptshade, CVAR_INT, INT8_MIN, INT8_MAX },
|
||||
{ "osdrows","osdrows: sets the number of visible lines of the OSD",(void *)&osdrows, CVAR_INT|CVAR_FUNCPTR, 0, MAXPALOOKUPS-1 },
|
||||
{ "osdtextmode","osdtextmode: set OSD text mode (0:graphical, 1:fast)",(void *)&osdtextmode, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 },
|
||||
{ "logcutoff","logcutoff: sets the maximal line count of the log file",(void *)&logcutoff, CVAR_INT, 0, 262144 },
|
||||
{ "osdeditpal","osdeditpal: sets the palette of the OSD input text",(void *) &osdeditpal, CVAR_INT, 0, MAXPALOOKUPS-1 },
|
||||
{ "osdpromptpal","osdpromptpal: sets the palette of the OSD prompt",(void *) &osdpromptpal, CVAR_INT, 0, MAXPALOOKUPS-1 },
|
||||
{ "osdtextpal","osdtextpal: sets the palette of the OSD text",(void *) &osdtextpal, CVAR_INT, 0, MAXPALOOKUPS-1 },
|
||||
{ "osdeditshade","osdeditshade: sets the shade of the OSD input text",(void *) &osdeditshade, CVAR_INT, 0, 7 },
|
||||
{ "osdtextshade","osdtextshade: sets the shade of the OSD text",(void *) &osdtextshade, CVAR_INT, 0, 7 },
|
||||
{ "osdpromptshade","osdpromptshade: sets the shade of the OSD prompt",(void *) &osdpromptshade, CVAR_INT, INT8_MIN, INT8_MAX },
|
||||
{ "osdrows","osdrows: sets the number of visible lines of the OSD",(void *) &osdrows, CVAR_INT|CVAR_FUNCPTR, 0, MAXPALOOKUPS-1 },
|
||||
{ "osdtextmode","osdtextmode: set OSD text mode (0:graphical, 1:fast)",(void *) &osdtextmode, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 },
|
||||
{ "logcutoff","logcutoff: sets the maximal line count of the log file",(void *) &logcutoff, CVAR_INT, 0, 262144 },
|
||||
};
|
||||
|
||||
mutex_init(&m_osdprintf);
|
||||
|
@ -747,7 +746,7 @@ void OSD_Init(void)
|
|||
continue;
|
||||
|
||||
OSD_RegisterFunction(cvars_osd[i].name, cvars_osd[i].helpstr,
|
||||
cvars_osd[i].type & CVAR_FUNCPTR ? osdcmd_cvar_set_osd : osdcmd_cvar_set);
|
||||
cvars_osd[i].type & CVAR_FUNCPTR ? osdcmd_cvar_set_osd : osdcmd_cvar_set);
|
||||
}
|
||||
|
||||
OSD_RegisterFunction("alias","alias: creates an alias for calling multiple commands",_internal_osdfunc_alias);
|
||||
|
@ -770,10 +769,14 @@ void OSD_Init(void)
|
|||
//
|
||||
void OSD_SetLogFile(char *fn)
|
||||
{
|
||||
if (osdlog) Bfclose(osdlog);
|
||||
osdlog = NULL;
|
||||
if (osdlog)
|
||||
{
|
||||
Bfclose(osdlog);
|
||||
osdlog = NULL;
|
||||
}
|
||||
|
||||
if (fn) osdlog = Bfopen(fn,"w");
|
||||
if (osdlog) setvbuf(osdlog, (char*)NULL, _IONBF, 0);
|
||||
if (osdlog) setvbuf(osdlog, (char *)NULL, _IONBF, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -782,7 +785,7 @@ void OSD_SetLogFile(char *fn)
|
|||
//
|
||||
void OSD_SetFunctions(
|
||||
void (*drawchar)(int32_t,int32_t,char,int32_t,int32_t),
|
||||
void (*drawstr)(int32_t,int32_t,char*,int32_t,int32_t,int32_t),
|
||||
void (*drawstr)(int32_t,int32_t,char *,int32_t,int32_t,int32_t),
|
||||
void (*drawcursor)(int32_t,int32_t,int32_t,int32_t),
|
||||
int32_t (*colwidth)(int32_t),
|
||||
int32_t (*rowheight)(int32_t),
|
||||
|
@ -983,92 +986,92 @@ int32_t OSD_HandleChar(char ch)
|
|||
case 127: // handled in OSD_HandleScanCode (delete)
|
||||
return 0;
|
||||
case 9: // tab
|
||||
{
|
||||
int32_t commonsize = 512;
|
||||
|
||||
if (!lastmatch)
|
||||
{
|
||||
int32_t commonsize = 512;
|
||||
for (i=osdeditcursor; i>0; i--) if (osdeditbuf[i-1] == ' ') break;
|
||||
for (j=0; osdeditbuf[i] != ' ' && i < osdeditlen; j++,i++)
|
||||
osdedittmp[j] = osdeditbuf[i];
|
||||
osdedittmp[j] = 0;
|
||||
|
||||
if (!lastmatch)
|
||||
if (j > 0)
|
||||
{
|
||||
for (i=osdeditcursor; i>0; i--) if (osdeditbuf[i-1] == ' ') break;
|
||||
for (j=0; osdeditbuf[i] != ' ' && i < osdeditlen; j++,i++)
|
||||
osdedittmp[j] = osdeditbuf[i];
|
||||
osdedittmp[j] = 0;
|
||||
tabc = findsymbol(osdedittmp, NULL);
|
||||
|
||||
if (j > 0)
|
||||
if (tabc && tabc->next && findsymbol(osdedittmp, tabc->next))
|
||||
{
|
||||
tabc = findsymbol(osdedittmp, NULL);
|
||||
symbol_t *symb=tabc;
|
||||
int32_t maxwidth = 0, x = 0, num = 0, diffpt;
|
||||
|
||||
if (tabc && tabc->next && findsymbol(osdedittmp, tabc->next))
|
||||
while (symb && symb != lastmatch)
|
||||
{
|
||||
symbol_t *symb=tabc;
|
||||
int32_t maxwidth = 0, x = 0, num = 0, diffpt;
|
||||
num++;
|
||||
|
||||
while (symb && symb != lastmatch)
|
||||
if (lastmatch)
|
||||
{
|
||||
num++;
|
||||
|
||||
if (lastmatch)
|
||||
{
|
||||
diffpt = OSD_FindDiffPoint(symb->name,lastmatch->name);
|
||||
if (diffpt < commonsize)
|
||||
commonsize = diffpt;
|
||||
}
|
||||
|
||||
maxwidth = max((unsigned)maxwidth,Bstrlen(symb->name));
|
||||
lastmatch = symb;
|
||||
if (!lastmatch->next) break;
|
||||
symb=findsymbol(osdedittmp, lastmatch->next);
|
||||
diffpt = OSD_FindDiffPoint(symb->name,lastmatch->name);
|
||||
if (diffpt < commonsize)
|
||||
commonsize = diffpt;
|
||||
}
|
||||
OSD_Printf(OSDTEXT_RED "Found %d possible completions for '%s':\n",num,osdedittmp);
|
||||
maxwidth += 3;
|
||||
symb = tabc;
|
||||
OSD_Printf(" ");
|
||||
while (symb && (symb != lastmatch))
|
||||
{
|
||||
tabc = lastmatch = symb;
|
||||
OSD_Printf("%-*s",maxwidth,symb->name);
|
||||
if (!lastmatch->next) break;
|
||||
symb=findsymbol(osdedittmp, lastmatch->next);
|
||||
x += maxwidth;
|
||||
if (x > (osdcols - maxwidth))
|
||||
{
|
||||
x = 0;
|
||||
OSD_Printf("\n");
|
||||
if (symb && (symb != lastmatch))
|
||||
OSD_Printf(" ");
|
||||
}
|
||||
}
|
||||
if (x) OSD_Printf("\n");
|
||||
OSD_Printf(OSDTEXT_RED "Press TAB again to cycle through matches\n");
|
||||
|
||||
maxwidth = max((unsigned)maxwidth,Bstrlen(symb->name));
|
||||
lastmatch = symb;
|
||||
if (!lastmatch->next) break;
|
||||
symb=findsymbol(osdedittmp, lastmatch->next);
|
||||
}
|
||||
OSD_Printf(OSDTEXT_RED "Found %d possible completions for '%s':\n",num,osdedittmp);
|
||||
maxwidth += 3;
|
||||
symb = tabc;
|
||||
OSD_Printf(" ");
|
||||
while (symb && (symb != lastmatch))
|
||||
{
|
||||
tabc = lastmatch = symb;
|
||||
OSD_Printf("%-*s",maxwidth,symb->name);
|
||||
if (!lastmatch->next) break;
|
||||
symb=findsymbol(osdedittmp, lastmatch->next);
|
||||
x += maxwidth;
|
||||
if (x > (osdcols - maxwidth))
|
||||
{
|
||||
x = 0;
|
||||
OSD_Printf("\n");
|
||||
if (symb && (symb != lastmatch))
|
||||
OSD_Printf(" ");
|
||||
}
|
||||
}
|
||||
if (x) OSD_Printf("\n");
|
||||
OSD_Printf(OSDTEXT_RED "Press TAB again to cycle through matches\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tabc = findsymbol(osdedittmp, lastmatch->next);
|
||||
if (!tabc && lastmatch)
|
||||
tabc = findsymbol(osdedittmp, NULL); // wrap */
|
||||
}
|
||||
|
||||
if (tabc)
|
||||
{
|
||||
for (i=osdeditcursor; i>0; i--) if (osdeditbuf[i-1] == ' ') break;
|
||||
osdeditlen = i;
|
||||
for (j=0; tabc->name[j] && osdeditlen <= OSD_EDITLENGTH
|
||||
&& (osdeditlen < commonsize); i++,j++,osdeditlen++)
|
||||
osdeditbuf[i] = tabc->name[j];
|
||||
osdeditcursor = osdeditlen;
|
||||
osdeditwinend = osdeditcursor;
|
||||
osdeditwinstart = osdeditwinend-editlinewidth;
|
||||
if (osdeditwinstart<0)
|
||||
{
|
||||
osdeditwinstart=0;
|
||||
osdeditwinend = editlinewidth;
|
||||
}
|
||||
|
||||
lastmatch = tabc;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
tabc = findsymbol(osdedittmp, lastmatch->next);
|
||||
if (!tabc && lastmatch)
|
||||
tabc = findsymbol(osdedittmp, NULL); // wrap */
|
||||
}
|
||||
|
||||
if (tabc)
|
||||
{
|
||||
for (i=osdeditcursor; i>0; i--) if (osdeditbuf[i-1] == ' ') break;
|
||||
osdeditlen = i;
|
||||
for (j=0; tabc->name[j] && osdeditlen <= OSD_EDITLENGTH
|
||||
&& (osdeditlen < commonsize); i++,j++,osdeditlen++)
|
||||
osdeditbuf[i] = tabc->name[j];
|
||||
osdeditcursor = osdeditlen;
|
||||
osdeditwinend = osdeditcursor;
|
||||
osdeditwinstart = osdeditwinend-editlinewidth;
|
||||
if (osdeditwinstart<0)
|
||||
{
|
||||
osdeditwinstart=0;
|
||||
osdeditwinend = editlinewidth;
|
||||
}
|
||||
|
||||
lastmatch = tabc;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
case 11: // control k, delete all to end of line
|
||||
Bmemset(osdeditbuf+osdeditcursor,0,sizeof(osdeditbuf)-osdeditcursor);
|
||||
return 0;
|
||||
|
@ -1089,7 +1092,7 @@ int32_t OSD_HandleChar(char ch)
|
|||
osdhistorytotal++;
|
||||
if (osdexeccount == OSD_HISTORYDEPTH)
|
||||
OSD_Printf("Command Buffer Warning: Failed queueing command "
|
||||
"for execution. Buffer full.\n");
|
||||
"for execution. Buffer full.\n");
|
||||
else
|
||||
osdexeccount++;
|
||||
}
|
||||
|
@ -1097,7 +1100,7 @@ int32_t OSD_HandleChar(char ch)
|
|||
{
|
||||
if (osdexeccount == OSD_HISTORYDEPTH)
|
||||
OSD_Printf("Command Buffer Warning: Failed queueing command "
|
||||
"for execution. Buffer full.\n");
|
||||
"for execution. Buffer full.\n");
|
||||
else
|
||||
osdexeccount++;
|
||||
}
|
||||
|
@ -1478,7 +1481,7 @@ void OSD_Draw(void)
|
|||
|
||||
if (osdver[0])
|
||||
drawosdstr(osdcols-osdverlen,osdrowscur - (offset >= osdcols-osdverlen),
|
||||
osdver,osdverlen,(sintable[(totalclock<<4)&2047]>>11),osdverpal);
|
||||
osdver,osdverlen,(sintable[(totalclock<<4)&2047]>>11),osdverpal);
|
||||
}
|
||||
|
||||
enddrawing();
|
||||
|
@ -1505,11 +1508,6 @@ void OSD_Printf(const char *fmt, ...)
|
|||
char *chp, p=osdtextpal, s=osdtextshade;
|
||||
va_list va;
|
||||
|
||||
/*
|
||||
if ((osdflags & OSD_INITIALIZED) == 0)
|
||||
OSD_Init();
|
||||
*/
|
||||
|
||||
mutex_lock(&m_osdprintf);
|
||||
|
||||
va_start(va, fmt);
|
||||
|
@ -1518,28 +1516,30 @@ void OSD_Printf(const char *fmt, ...)
|
|||
|
||||
if (tmpstr[0]=='^' && tmpstr[1]=='1' && tmpstr[2]=='0' && ++OSD_errors > MAX_ERRORS)
|
||||
{
|
||||
if (OSD_errors == MAX_ERRORS+1) Bstrcpy(tmpstr,OSD_ERROR "\nToo many errors. Logging errors stopped.\n");
|
||||
if (OSD_errors == MAX_ERRORS + 1)
|
||||
Bstrcpy(tmpstr, OSD_ERROR "\nToo many errors. Logging errors stopped.\n");
|
||||
else
|
||||
{
|
||||
OSD_errors=MAX_ERRORS+2;
|
||||
OSD_errors = MAX_ERRORS + 2;
|
||||
mutex_unlock(&m_osdprintf);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (linecnt<logcutoff)
|
||||
if (linecnt < logcutoff)
|
||||
{
|
||||
if (osdlog&&(!logcutoff||linecnt<logcutoff))
|
||||
if (osdlog && (!logcutoff || linecnt < logcutoff))
|
||||
{
|
||||
chp = Bstrdup(tmpstr);
|
||||
Bfputs(OSD_StripColors(chp,tmpstr), osdlog);
|
||||
Bfputs(OSD_StripColors(chp, tmpstr), osdlog);
|
||||
Bprintf("%s", chp);
|
||||
Bfree(chp);
|
||||
}
|
||||
}
|
||||
else if (linecnt==logcutoff)
|
||||
else if (linecnt == logcutoff)
|
||||
{
|
||||
Bfputs("\nMaximal log size reached. Logging stopped.\nSet the \"logcutoff\" console variable to a higher value if you need a longer log.\n", osdlog);
|
||||
linecnt=logcutoff+1;
|
||||
linecnt = logcutoff + 1;
|
||||
}
|
||||
|
||||
chp = tmpstr;
|
||||
|
@ -1552,11 +1552,13 @@ void OSD_Printf(const char *fmt, ...)
|
|||
OSD_LineFeed();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (*chp == '\r')
|
||||
{
|
||||
osdpos=0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (*chp == '^')
|
||||
{
|
||||
if (isdigit(*(chp+1)))
|
||||
|
@ -1569,12 +1571,14 @@ void OSD_Printf(const char *fmt, ...)
|
|||
p = atol(smallbuf);
|
||||
continue;
|
||||
}
|
||||
|
||||
smallbuf[0] = *(chp++);
|
||||
smallbuf[1] = *(chp);
|
||||
smallbuf[2] = '\0';
|
||||
p = atol(smallbuf);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Btoupper(*(chp+1)) == 'S')
|
||||
{
|
||||
chp++;
|
||||
|
@ -1582,6 +1586,7 @@ void OSD_Printf(const char *fmt, ...)
|
|||
s = *chp;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Btoupper(*(chp+1)) == 'O')
|
||||
{
|
||||
chp++;
|
||||
|
@ -1590,8 +1595,10 @@ void OSD_Printf(const char *fmt, ...)
|
|||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
osdtext[osdpos] = *chp;
|
||||
osdfmt[osdpos++] = p+(s<<5);
|
||||
|
||||
if (osdpos == osdcols)
|
||||
{
|
||||
osdpos = 0;
|
||||
|
@ -1766,11 +1773,11 @@ int32_t OSD_Dispatch(const char *cmd)
|
|||
ofp.parms = (const char **)parms;
|
||||
ofp.raw = cmd;
|
||||
|
||||
switch((intptr_t)symb->func)
|
||||
switch ((intptr_t)symb->func)
|
||||
{
|
||||
case (intptr_t)OSD_ALIAS:
|
||||
case(intptr_t)OSD_ALIAS:
|
||||
OSD_Dispatch(symb->help);
|
||||
case (intptr_t)OSD_UNALIASED:
|
||||
case(intptr_t)OSD_UNALIASED:
|
||||
break;
|
||||
default:
|
||||
switch (symb->func(&ofp))
|
||||
|
@ -1797,7 +1804,7 @@ int32_t OSD_Dispatch(const char *cmd)
|
|||
//
|
||||
// OSD_RegisterFunction() -- Registers a new function
|
||||
//
|
||||
int32_t OSD_RegisterFunction(const char *name, const char *help, int32_t (*func)(const osdfuncparm_t*))
|
||||
int32_t OSD_RegisterFunction(const char *name, const char *help, int32_t (*func)(const osdfuncparm_t *))
|
||||
{
|
||||
symbol_t *symb;
|
||||
const char *cp;
|
||||
|
@ -1841,13 +1848,13 @@ int32_t OSD_RegisterFunction(const char *name, const char *help, int32_t (*func)
|
|||
|
||||
if (symb) // allow this now for reusing an alias name
|
||||
{
|
||||
/*
|
||||
if (symb->func != OSD_ALIAS && symb->func != OSD_UNALIASED)
|
||||
{
|
||||
OSD_Printf("OSD_RegisterFunction(): \"%s\" is already defined\n", name);
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
if (symb->func != OSD_ALIAS && symb->func != OSD_UNALIASED)
|
||||
{
|
||||
OSD_Printf("OSD_RegisterFunction(): \"%s\" is already defined\n", name);
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
// Bfree((char *)symb->help);
|
||||
symb->help = help;
|
||||
symb->func = func;
|
||||
|
@ -1998,7 +2005,7 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
float val;
|
||||
if (showval)
|
||||
{
|
||||
OSD_Printf("\"%s\" is \"%f\"\n%s\n",cvars[i].name,*(float*)cvars[i].var,(char*)cvars[i].helpstr);
|
||||
OSD_Printf("\"%s\" is \"%f\"\n%s\n",cvars[i].name,*(float *)cvars[i].var,(char *)cvars[i].helpstr);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
|
@ -2009,7 +2016,7 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
OSD_Printf("%s value out of range\n",cvars[i].name);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
*(float*)cvars[i].var = val;
|
||||
*(float *)cvars[i].var = val;
|
||||
if (!OSD_ParsingScript())
|
||||
OSD_Printf("%s %f",cvars[i].name,val);
|
||||
}
|
||||
|
@ -2019,7 +2026,7 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
double val;
|
||||
if (showval)
|
||||
{
|
||||
OSD_Printf("\"%s\" is \"%f\"\n%s\n",cvars[i].name,*(double*)cvars[i].var,(char*)cvars[i].helpstr);
|
||||
OSD_Printf("\"%s\" is \"%f\"\n%s\n",cvars[i].name,*(double *)cvars[i].var,(char *)cvars[i].helpstr);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
|
@ -2030,7 +2037,7 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
OSD_Printf("%s value out of range\n",cvars[i].name);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
*(double*)cvars[i].var = val;
|
||||
*(double *)cvars[i].var = val;
|
||||
if (!OSD_ParsingScript())
|
||||
OSD_Printf("%s %f",cvars[i].name,val);
|
||||
}
|
||||
|
@ -2042,7 +2049,7 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
int32_t val;
|
||||
if (showval)
|
||||
{
|
||||
OSD_Printf("\"%s\" is \"%d\"\n%s\n",cvars[i].name,*(int32_t*)cvars[i].var,(char*)cvars[i].helpstr);
|
||||
OSD_Printf("\"%s\" is \"%d\"\n%s\n",cvars[i].name,*(int32_t *)cvars[i].var,(char *)cvars[i].helpstr);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
|
@ -2054,7 +2061,7 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
OSD_Printf("%s value out of range\n",cvars[i].name);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
*(int32_t*)cvars[i].var = val;
|
||||
*(int32_t *)cvars[i].var = val;
|
||||
if (!OSD_ParsingScript())
|
||||
OSD_Printf("%s %d",cvars[i].name,val);
|
||||
}
|
||||
|
@ -2063,14 +2070,14 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
|
|||
{
|
||||
if (showval)
|
||||
{
|
||||
OSD_Printf("\"%s\" is \"%s\"\n%s\n",cvars[i].name,(char*)cvars[i].var,(char*)cvars[i].helpstr);
|
||||
OSD_Printf("\"%s\" is \"%s\"\n%s\n",cvars[i].name,(char *)cvars[i].var,(char *)cvars[i].helpstr);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
|
||||
Bstrncpy((char*)cvars[i].var, parm->parms[0], cvars[i].max-1);
|
||||
((char*)cvars[i].var)[cvars[i].max-1] = 0;
|
||||
Bstrncpy((char *)cvars[i].var, parm->parms[0], cvars[i].max-1);
|
||||
((char *)cvars[i].var)[cvars[i].max-1] = 0;
|
||||
if (!OSD_ParsingScript())
|
||||
OSD_Printf("%s %s",cvars[i].name,(char*)cvars[i].var);
|
||||
OSD_Printf("%s %s",cvars[i].name,(char *)cvars[i].var);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -2095,12 +2102,12 @@ void OSD_WriteCvars(FILE *fp)
|
|||
{
|
||||
if (!(cvars[i].type & CVAR_NOSAVE) && OSD_CvarModified(&cvars[i]))
|
||||
switch (cvars[i].type&(CVAR_FLOAT|CVAR_DOUBLE|CVAR_INT|CVAR_UINT|CVAR_BOOL|CVAR_STRING))
|
||||
{
|
||||
{
|
||||
case CVAR_FLOAT:
|
||||
fprintf(fp,"%s \"%f\"\n",cvars[i].name,*(float*)cvars[i].var);
|
||||
fprintf(fp,"%s \"%f\"\n",cvars[i].name,*(float *)cvars[i].var);
|
||||
break;
|
||||
case CVAR_DOUBLE:
|
||||
fprintf(fp,"%s \"%f\"\n",cvars[i].name,*(double*)cvars[i].var);
|
||||
fprintf(fp,"%s \"%f\"\n",cvars[i].name,*(double *)cvars[i].var);
|
||||
break;
|
||||
case CVAR_INT:
|
||||
case CVAR_UINT:
|
||||
|
@ -2108,11 +2115,11 @@ void OSD_WriteCvars(FILE *fp)
|
|||
fprintf(fp,"%s \"%d\"\n",cvars[i].name,*(int32_t *)cvars[i].var);
|
||||
break;
|
||||
case CVAR_STRING:
|
||||
fprintf(fp,"%s \"%s\"\n",cvars[i].name,(char*)cvars[i].var);
|
||||
fprintf(fp,"%s \"%s\"\n",cvars[i].name,(char *)cvars[i].var);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -300,10 +300,10 @@ pthtyp *gltexcachead[GLTEXCACHEADSIZ];
|
|||
|
||||
int32_t drawingskybox = 0;
|
||||
|
||||
int32_t gloadtile_art(int32_t,int32_t,int32_t,pthtyp*,int32_t);
|
||||
int32_t gloadtile_hi(int32_t,int32_t,int32_t,hicreplctyp*,int32_t,pthtyp*,int32_t,char);
|
||||
int32_t gloadtile_art(int32_t,int32_t,int32_t,pthtyp *,int32_t);
|
||||
int32_t gloadtile_hi(int32_t,int32_t,int32_t,hicreplctyp *,int32_t,pthtyp *,int32_t,char);
|
||||
static int32_t hicprecaching = 0;
|
||||
pthtyp * gltexcache(int32_t dapicnum, int32_t dapalnum, int32_t dameth)
|
||||
pthtyp *gltexcache(int32_t dapicnum, int32_t dapalnum, int32_t dameth)
|
||||
{
|
||||
int32_t i, j;
|
||||
hicreplctyp *si;
|
||||
|
@ -645,8 +645,8 @@ void polymost_glreset()
|
|||
cacheptrs[ii] = NULL;
|
||||
}
|
||||
|
||||
Bfree(cacheptrs[i]);
|
||||
cacheptrs[i] = NULL;
|
||||
Bfree(cacheptrs[i]);
|
||||
cacheptrs[i] = NULL;
|
||||
}
|
||||
|
||||
polymost_cachesync();
|
||||
|
@ -1199,7 +1199,7 @@ int32_t gloadtile_art(int32_t dapic, int32_t dapal, int32_t dameth, pthtyp *pth,
|
|||
}
|
||||
}
|
||||
|
||||
if (doalloc) bglGenTextures(1,(GLuint*)&pth->glpic); //# of textures (make OpenGL allocate structure)
|
||||
if (doalloc) bglGenTextures(1,(GLuint *)&pth->glpic); //# of textures (make OpenGL allocate structure)
|
||||
bglBindTexture(GL_TEXTURE_2D,pth->glpic);
|
||||
|
||||
fixtransparency(pic,tsizx,tsizy,xsiz,ysiz,dameth);
|
||||
|
@ -1558,7 +1558,7 @@ int32_t gloadtile_cached(int32_t fil, texcacheheader *head, int32_t *doalloc, pt
|
|||
|
||||
if (*doalloc&1)
|
||||
{
|
||||
bglGenTextures(1,(GLuint*)&pth->glpic); //# of textures (make OpenGL allocate structure)
|
||||
bglGenTextures(1,(GLuint *)&pth->glpic); //# of textures (make OpenGL allocate structure)
|
||||
*doalloc |= 2; // prevents bglGenTextures being called again if we fail in here
|
||||
}
|
||||
bglBindTexture(GL_TEXTURE_2D,pth->glpic);
|
||||
|
@ -1829,7 +1829,7 @@ int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp
|
|||
intexfmt = (hasalpha == 255) ? GL_COMPRESSED_RGB_ARB : GL_COMPRESSED_RGBA_ARB;
|
||||
else if (hasalpha == 255) intexfmt = GL_RGB;
|
||||
|
||||
if ((doalloc&3)==1) bglGenTextures(1,(GLuint*)&pth->glpic); //# of textures (make OpenGL allocate structure)
|
||||
if ((doalloc&3)==1) bglGenTextures(1,(GLuint *)&pth->glpic); //# of textures (make OpenGL allocate structure)
|
||||
bglBindTexture(GL_TEXTURE_2D,pth->glpic);
|
||||
|
||||
fixtransparency(pic,tsizx,tsizy,xsiz,ysiz,dameth);
|
||||
|
@ -2897,7 +2897,7 @@ void domost(float x0, float y0, float x1, float y1)
|
|||
{
|
||||
d = (y0-y1)*dx - (x0-x1)*cv[j];
|
||||
n = (y0-cy[j])*dx - (x0-nx0)*cv[j];
|
||||
if ((fabs(n) <= fabs(d)) && (d*n >= 0) && (d != 0))
|
||||
if ((fabs(n) <= fabs(d)) && (d *n >= 0) && (d != 0))
|
||||
{
|
||||
t = n/d; nx = (x1-x0)*t + x0;
|
||||
if ((nx > nx0) && (nx < nx1))
|
||||
|
@ -4168,7 +4168,7 @@ static void polymost_scansector(int32_t sectnum)
|
|||
if ((nextsectnum >= 0) && (!(wal->cstat&32)) && (!(gotsector[nextsectnum>>3]&pow2char[nextsectnum&7])))
|
||||
{
|
||||
d = (double)x1*(double)y2 - (double)x2*(double)y1; xp1 = (double)(x2-x1); yp1 = (double)(y2-y1);
|
||||
if (d*d <= (xp1*xp1 + yp1*yp1)*(SCISDIST*SCISDIST*260.0))
|
||||
if (d *d <= (xp1*xp1 + yp1*yp1)*(SCISDIST*SCISDIST*260.0))
|
||||
sectorborder[sectorbordercnt++] = nextsectnum;
|
||||
}
|
||||
|
||||
|
@ -4380,7 +4380,7 @@ void polymost_drawrooms()
|
|||
|
||||
hitallsprites = 1;
|
||||
hitscan((const vec3_t *)&vect,globalcursectnum, //Start position
|
||||
vx>>10,vy>>10,vz>>6,&hitinfo,0xffff0030);
|
||||
vx>>10,vy>>10,vz>>6,&hitinfo,0xffff0030);
|
||||
|
||||
if (hitinfo.hitsect != -1) // if hitsect is -1, hitscan overflowed somewhere
|
||||
{
|
||||
|
@ -5305,13 +5305,16 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
|
|||
if (dastat&4) { x1 = -x1; y1 = -y1; }
|
||||
|
||||
// In Polymost, we don't care if the model is very big
|
||||
if (rendmode < 4) {
|
||||
if (rendmode < 4)
|
||||
{
|
||||
tspr.xrepeat = tspr.yrepeat = 32;
|
||||
|
||||
tspr.x = (int32_t)(((double)gcosang*z1 - (double)gsinang*x1)*16384.0 + globalposx);
|
||||
tspr.y = (int32_t)(((double)gsinang*z1 + (double)gcosang*x1)*16384.0 + globalposy);
|
||||
tspr.z = (int32_t)(globalposz + y1*16384.0*0.8);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
float x, y, z;
|
||||
|
||||
tspr.xrepeat = tspr.yrepeat = 5;
|
||||
|
@ -5373,7 +5376,8 @@ 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);
|
||||
else {
|
||||
else
|
||||
{
|
||||
tspriteptr[MAXSPRITESONSCREEN] = &tspr;
|
||||
|
||||
bglEnable(GL_ALPHA_TEST);
|
||||
|
@ -5652,9 +5656,9 @@ static void tessectrap(float *px, float *py, int32_t *point2, int32_t numpoints)
|
|||
if (numpoints+16 > allocpoints) //16 for safety
|
||||
{
|
||||
allocpoints = numpoints+16;
|
||||
rst = (raster*)Brealloc(rst,allocpoints*sizeof(raster));
|
||||
slist = (int32_t*)Brealloc(slist,allocpoints*sizeof(int32_t));
|
||||
npoint2 = (int32_t*)Brealloc(npoint2,allocpoints*sizeof(int32_t));
|
||||
rst = (raster *)Brealloc(rst,allocpoints*sizeof(raster));
|
||||
slist = (int32_t *)Brealloc(slist,allocpoints*sizeof(int32_t));
|
||||
npoint2 = (int32_t *)Brealloc(npoint2,allocpoints*sizeof(int32_t));
|
||||
}
|
||||
|
||||
//Remove unnecessary collinear points:
|
||||
|
@ -5949,7 +5953,7 @@ int32_t polymost_printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t ba
|
|||
}
|
||||
Bmemset(tbuf, 0, 256*128);
|
||||
|
||||
cptr = (char*)textfont;
|
||||
cptr = (char *)textfont;
|
||||
for (h=0; h<256; h++)
|
||||
{
|
||||
tptr = tbuf + (h%32)*8 + (h/32)*256*8;
|
||||
|
@ -5963,7 +5967,7 @@ int32_t polymost_printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t ba
|
|||
}
|
||||
}
|
||||
|
||||
cptr = (char*)smalltextfont;
|
||||
cptr = (char *)smalltextfont;
|
||||
for (h=0; h<256; h++)
|
||||
{
|
||||
tptr = tbuf + 256*64 + (h%32)*8 + (h/32)*256*8;
|
||||
|
@ -5978,7 +5982,7 @@ int32_t polymost_printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t ba
|
|||
}
|
||||
|
||||
bglBindTexture(GL_TEXTURE_2D, polymosttext);
|
||||
bglTexImage2D(GL_TEXTURE_2D,0,GL_ALPHA,256,128,0,GL_ALPHA,GL_UNSIGNED_BYTE,(GLvoid*)tbuf);
|
||||
bglTexImage2D(GL_TEXTURE_2D,0,GL_ALPHA,256,128,0,GL_ALPHA,GL_UNSIGNED_BYTE,(GLvoid *)tbuf);
|
||||
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
|
||||
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
|
||||
Bfree(tbuf);
|
||||
|
@ -6160,73 +6164,73 @@ void polymost_initosdfuncs(void)
|
|||
cvar_t cvars_polymost[] =
|
||||
{
|
||||
#ifdef USE_OPENGL
|
||||
{ "r_animsmoothing","r_animsmoothing: enable/disable model animation smoothing",(void *)&r_animsmoothing, CVAR_BOOL, 0, 1 },
|
||||
{ "r_modelocclusionchecking","r_modelocclusionchecking: enable/disable hack to cull \"obstructed\" models",(void *)&r_modelocclusionchecking, CVAR_INT, 0, 2 },
|
||||
{ "r_detailmapping","r_detailmapping: enable/disable detail mapping",(void *)&r_detailmapping, CVAR_BOOL, 0, 1 },
|
||||
{ "r_downsize","r_downsize: controls downsizing factor for hires textures",(void *)&r_downsize, CVAR_INT|CVAR_FUNCPTR, 0, 5 },
|
||||
{ "r_fullbrights","r_fullbrights: enable/disable fullbright textures",(void *)&r_fullbrights, CVAR_BOOL, 0, 1 },
|
||||
{ "r_glowmapping","r_glowmapping: enable/disable glow mapping",(void *)&r_glowmapping, CVAR_BOOL, 0, 1 },
|
||||
{ "r_animsmoothing","r_animsmoothing: enable/disable model animation smoothing",(void *) &r_animsmoothing, CVAR_BOOL, 0, 1 },
|
||||
{ "r_modelocclusionchecking","r_modelocclusionchecking: enable/disable hack to cull \"obstructed\" models",(void *) &r_modelocclusionchecking, CVAR_INT, 0, 2 },
|
||||
{ "r_detailmapping","r_detailmapping: enable/disable detail mapping",(void *) &r_detailmapping, CVAR_BOOL, 0, 1 },
|
||||
{ "r_downsize","r_downsize: controls downsizing factor for hires textures",(void *) &r_downsize, CVAR_INT|CVAR_FUNCPTR, 0, 5 },
|
||||
{ "r_fullbrights","r_fullbrights: enable/disable fullbright textures",(void *) &r_fullbrights, CVAR_BOOL, 0, 1 },
|
||||
{ "r_glowmapping","r_glowmapping: enable/disable glow mapping",(void *) &r_glowmapping, CVAR_BOOL, 0, 1 },
|
||||
/*
|
||||
{ "r_multisample","r_multisample: sets the number of samples used for antialiasing (0 = off)",(void *)&r_glowmapping, CVAR_BOOL, 0, 1 }
|
||||
{ "r_nvmultisamplehint","r_nvmultisamplehint: enable/disable Nvidia multisampling hinting",(void *)&glnvmultisamplehint, CVAR_BOOL, 0, 1 }
|
||||
*/
|
||||
{
|
||||
"r_parallaxskyclamping","r_parallaxskyclamping: enable/disable parallaxed floor/ceiling sky texture clamping",
|
||||
(void *)&r_parallaxskyclamping, CVAR_BOOL, 0, 1
|
||||
(void *) &r_parallaxskyclamping, CVAR_BOOL, 0, 1
|
||||
},
|
||||
{
|
||||
"r_parallaxskypanning","r_parallaxskypanning: enable/disable parallaxed floor/ceiling panning when drawing a parallaxed sky",
|
||||
(void *)&r_parallaxskypanning, CVAR_BOOL, 0, 1
|
||||
(void *) &r_parallaxskypanning, CVAR_BOOL, 0, 1
|
||||
},
|
||||
{ "r_polygonmode","r_polygonmode: debugging feature",(void *)&glpolygonmode, CVAR_INT | CVAR_NOSAVE, 0, 3 },
|
||||
{ "r_redbluemode","r_redbluemode: enable/disable experimental OpenGL red-blue glasses mode",(void *)&glredbluemode, CVAR_BOOL, 0, 1 },
|
||||
{ "r_shadescale","r_shadescale: multiplier for lighting",(void *)&shadescale, CVAR_FLOAT, 0, 10 },
|
||||
{ "r_swapinterval","r_swapinterval: sets the GL swap interval (VSync)",(void *)&vsync, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 },
|
||||
{ "r_texcache","r_texcache: enable/disable OpenGL compressed texture cache",(void *)&glusetexcache, CVAR_INT, 0, 2 },
|
||||
{ "r_texcompr","r_texcompr: enable/disable OpenGL texture compression",(void *)&glusetexcompr, CVAR_BOOL, 0, 1 },
|
||||
{ "r_textureanisotropy", "r_textureanisotropy: changes the OpenGL texture anisotropy setting", (void *)&glanisotropy, CVAR_INT|CVAR_FUNCPTR, 0, 16 },
|
||||
{ "r_texturemaxsize","r_texturemaxsize: changes the maximum OpenGL texture size limit",(void *)&gltexmaxsize, CVAR_INT | CVAR_NOSAVE, 0, 4096 },
|
||||
{ "r_texturemiplevel","r_texturemiplevel: changes the highest OpenGL mipmap level used",(void *)&gltexmiplevel, CVAR_INT, 0, 6 },
|
||||
{ "r_texturemode", "r_texturemode: changes the texture filtering settings", (void *)&gltexfiltermode, CVAR_INT|CVAR_FUNCPTR, 0, 5 },
|
||||
{ "r_vbocount","r_vbocount: sets the number of Vertex Buffer Objects to use when drawing models",(void *)&r_vbocount, CVAR_INT, 1, 256 },
|
||||
{ "r_vbos","r_vbos: enable/disable using Vertex Buffer Objects when drawing models",(void *)&r_vbos, CVAR_BOOL, 0, 1 },
|
||||
{ "r_vertexarrays","r_vertexarrays: enable/disable using vertex arrays when drawing models",(void *)&r_vertexarrays, CVAR_BOOL, 0, 1 },
|
||||
{ "r_anamorphic", "r_anamorphic: enable/disable widescreen mode", (void*)&glwidescreen, CVAR_BOOL, 0, 1 },
|
||||
{ "r_projectionhack", "r_projectionhack: enable/disable projection hack", (void*)&glprojectionhacks, CVAR_INT, 0, 2 },
|
||||
{ "r_polygonmode","r_polygonmode: debugging feature",(void *) &glpolygonmode, CVAR_INT | CVAR_NOSAVE, 0, 3 },
|
||||
{ "r_redbluemode","r_redbluemode: enable/disable experimental OpenGL red-blue glasses mode",(void *) &glredbluemode, CVAR_BOOL, 0, 1 },
|
||||
{ "r_shadescale","r_shadescale: multiplier for lighting",(void *) &shadescale, CVAR_FLOAT, 0, 10 },
|
||||
{ "r_swapinterval","r_swapinterval: sets the GL swap interval (VSync)",(void *) &vsync, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 },
|
||||
{ "r_texcache","r_texcache: enable/disable OpenGL compressed texture cache",(void *) &glusetexcache, CVAR_INT, 0, 2 },
|
||||
{ "r_texcompr","r_texcompr: enable/disable OpenGL texture compression",(void *) &glusetexcompr, CVAR_BOOL, 0, 1 },
|
||||
{ "r_textureanisotropy", "r_textureanisotropy: changes the OpenGL texture anisotropy setting", (void *) &glanisotropy, CVAR_INT|CVAR_FUNCPTR, 0, 16 },
|
||||
{ "r_texturemaxsize","r_texturemaxsize: changes the maximum OpenGL texture size limit",(void *) &gltexmaxsize, CVAR_INT | CVAR_NOSAVE, 0, 4096 },
|
||||
{ "r_texturemiplevel","r_texturemiplevel: changes the highest OpenGL mipmap level used",(void *) &gltexmiplevel, CVAR_INT, 0, 6 },
|
||||
{ "r_texturemode", "r_texturemode: changes the texture filtering settings", (void *) &gltexfiltermode, CVAR_INT|CVAR_FUNCPTR, 0, 5 },
|
||||
{ "r_vbocount","r_vbocount: sets the number of Vertex Buffer Objects to use when drawing models",(void *) &r_vbocount, CVAR_INT, 1, 256 },
|
||||
{ "r_vbos","r_vbos: enable/disable using Vertex Buffer Objects when drawing models",(void *) &r_vbos, CVAR_BOOL, 0, 1 },
|
||||
{ "r_vertexarrays","r_vertexarrays: enable/disable using vertex arrays when drawing models",(void *) &r_vertexarrays, CVAR_BOOL, 0, 1 },
|
||||
{ "r_anamorphic", "r_anamorphic: enable/disable widescreen mode", (void *) &glwidescreen, CVAR_BOOL, 0, 1 },
|
||||
{ "r_projectionhack", "r_projectionhack: enable/disable projection hack", (void *) &glprojectionhacks, CVAR_INT, 0, 2 },
|
||||
|
||||
#ifdef POLYMER
|
||||
// polymer cvars
|
||||
{ "r_pr_lighting", "r_pr_lighting: enable/disable dynamic lights", (void*)&pr_lighting, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_normalmapping", "r_pr_normalmapping: enable/disable virtual displacement mapping", (void*)&pr_normalmapping, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_specularmapping", "r_pr_specularmapping: enable/disable specular mapping", (void*)&pr_specularmapping, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_shadows", "r_pr_shadows: enable/disable dynamic shadows", (void*)&pr_shadows, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_shadowcount", "r_pr_shadowcount: maximal amount of shadow emitting lights on screen - you need to restart the renderer for it to take effect", (void*)&pr_shadowcount, CVAR_INT, 0, 64 },
|
||||
{ "r_pr_shadowdetail", "r_pr_shadowdetail: sets the shadow map resolution - you need to restart the renderer for it to take effect", (void*)&pr_shadowdetail, CVAR_INT, 0, 5 },
|
||||
{ "r_pr_shadowfiltering", "r_pr_shadowfiltering: enable/disable shadow edges filtering - you need to restart the renderer for it to take effect", (void*)&pr_shadowfiltering, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_maxlightpasses", "r_pr_maxlightpasses: the maximal amount of lights a single object can by affected by", (void*)&r_pr_maxlightpasses, CVAR_INT|CVAR_FUNCPTR, 0, PR_MAXLIGHTS },
|
||||
{ "r_pr_maxlightpriority", "r_pr_maxlightpriority: lowering that value removes less meaningful lights from the scene", (void*)&pr_maxlightpriority, CVAR_INT, 0, PR_MAXLIGHTPRIORITY },
|
||||
{ "r_pr_fov", "r_pr_fov: sets the field of vision in build angle", (void*)&pr_fov, CVAR_INT, 0, 1023},
|
||||
{ "r_pr_customaspect", "r_pr_customaspect: if non-zero, forces the 3D view aspect ratio", (void*)&pr_customaspect, CVAR_FLOAT, 0, 3 },
|
||||
{ "r_pr_billboardingmode", "r_pr_billboardingmode: face sprite display method. 0: classic mode; 1: polymost mode", (void*)&pr_billboardingmode, CVAR_INT, 0, 1 },
|
||||
{ "r_pr_verbosity", "r_pr_verbosity: verbosity level of the polymer renderer", (void*)&pr_verbosity, CVAR_INT, 0, 3 },
|
||||
{ "r_pr_wireframe", "r_pr_wireframe: toggles wireframe mode", (void*)&pr_wireframe, CVAR_INT | CVAR_NOSAVE, 0, 1 },
|
||||
{ "r_pr_vbos", "r_pr_vbos: contols Vertex Buffer Object usage. 0: no VBOs. 1: VBOs for map data. 2: VBOs for model data.", (void*)&pr_vbos, CVAR_INT, 0, 2 },
|
||||
{ "r_pr_gpusmoothing", "r_pr_gpusmoothing: toggles model animation interpolation", (void*)&pr_gpusmoothing, CVAR_INT, 0, 1 },
|
||||
{ "r_pr_overrideparallax", "r_pr_overrideparallax: overrides parallax mapping scale and bias values with values from the pr_parallaxscale and pr_parallaxbias cvars; use it to fine-tune DEF tokens", (void*)&pr_overrideparallax, CVAR_BOOL | CVAR_NOSAVE, 0, 1 },
|
||||
{ "r_pr_parallaxscale", "r_pr_parallaxscale: overriden parallax mapping offset scale", (void*)&pr_parallaxscale, CVAR_FLOAT | CVAR_NOSAVE, -10, 10 },
|
||||
{ "r_pr_parallaxbias", "r_pr_parallaxbias: overriden parallax mapping offset bias", (void*)&pr_parallaxbias, CVAR_FLOAT | CVAR_NOSAVE, -10, 10 },
|
||||
{ "r_pr_overridespecular", "r_pr_overridespecular: overrides specular material power and factor values with values from the pr_specularpower and pr_specularfactor cvars; use it to fine-tune DEF tokens", (void*)&pr_overridespecular, CVAR_BOOL | CVAR_NOSAVE, 0, 1 },
|
||||
{ "r_pr_specularpower", "r_pr_specularpower: overriden specular material power", (void*)&pr_specularpower, CVAR_FLOAT | CVAR_NOSAVE, -10, 1000 },
|
||||
{ "r_pr_specularfactor", "r_pr_specularfactor: overriden specular material factor", (void*)&pr_specularfactor, CVAR_FLOAT | CVAR_NOSAVE, -10, 1000 },
|
||||
{ "r_pr_highpalookups", "r_pr_highpalookups: enable/disable highpalookups", (void*)&pr_highpalookups, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_ati_fboworkaround", "r_pr_ati_fboworkaround: enable this to workaround an ATI driver bug that causes sprite shadows to be square - you need to restart the renderer for it to take effect", (void*)&pr_ati_fboworkaround, CVAR_BOOL | CVAR_NOSAVE, 0, 1 },
|
||||
{ "r_pr_ati_nodepthoffset", "r_pr_ati_nodepthoffset: enable this to workaround an ATI driver bug that causes sprite drawing to freeze the game on Radeon X1x00 hardware - you need to restart the renderer for it to take effect", (void*)&pr_ati_nodepthoffset, CVAR_BOOL | CVAR_NOSAVE, 0, 1 },
|
||||
{ "r_pr_lighting", "r_pr_lighting: enable/disable dynamic lights", (void *) &pr_lighting, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_normalmapping", "r_pr_normalmapping: enable/disable virtual displacement mapping", (void *) &pr_normalmapping, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_specularmapping", "r_pr_specularmapping: enable/disable specular mapping", (void *) &pr_specularmapping, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_shadows", "r_pr_shadows: enable/disable dynamic shadows", (void *) &pr_shadows, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_shadowcount", "r_pr_shadowcount: maximal amount of shadow emitting lights on screen - you need to restart the renderer for it to take effect", (void *) &pr_shadowcount, CVAR_INT, 0, 64 },
|
||||
{ "r_pr_shadowdetail", "r_pr_shadowdetail: sets the shadow map resolution - you need to restart the renderer for it to take effect", (void *) &pr_shadowdetail, CVAR_INT, 0, 5 },
|
||||
{ "r_pr_shadowfiltering", "r_pr_shadowfiltering: enable/disable shadow edges filtering - you need to restart the renderer for it to take effect", (void *) &pr_shadowfiltering, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_maxlightpasses", "r_pr_maxlightpasses: the maximal amount of lights a single object can by affected by", (void *) &r_pr_maxlightpasses, CVAR_INT|CVAR_FUNCPTR, 0, PR_MAXLIGHTS },
|
||||
{ "r_pr_maxlightpriority", "r_pr_maxlightpriority: lowering that value removes less meaningful lights from the scene", (void *) &pr_maxlightpriority, CVAR_INT, 0, PR_MAXLIGHTPRIORITY },
|
||||
{ "r_pr_fov", "r_pr_fov: sets the field of vision in build angle", (void *) &pr_fov, CVAR_INT, 0, 1023},
|
||||
{ "r_pr_customaspect", "r_pr_customaspect: if non-zero, forces the 3D view aspect ratio", (void *) &pr_customaspect, CVAR_FLOAT, 0, 3 },
|
||||
{ "r_pr_billboardingmode", "r_pr_billboardingmode: face sprite display method. 0: classic mode; 1: polymost mode", (void *) &pr_billboardingmode, CVAR_INT, 0, 1 },
|
||||
{ "r_pr_verbosity", "r_pr_verbosity: verbosity level of the polymer renderer", (void *) &pr_verbosity, CVAR_INT, 0, 3 },
|
||||
{ "r_pr_wireframe", "r_pr_wireframe: toggles wireframe mode", (void *) &pr_wireframe, CVAR_INT | CVAR_NOSAVE, 0, 1 },
|
||||
{ "r_pr_vbos", "r_pr_vbos: contols Vertex Buffer Object usage. 0: no VBOs. 1: VBOs for map data. 2: VBOs for model data.", (void *) &pr_vbos, CVAR_INT, 0, 2 },
|
||||
{ "r_pr_gpusmoothing", "r_pr_gpusmoothing: toggles model animation interpolation", (void *) &pr_gpusmoothing, CVAR_INT, 0, 1 },
|
||||
{ "r_pr_overrideparallax", "r_pr_overrideparallax: overrides parallax mapping scale and bias values with values from the pr_parallaxscale and pr_parallaxbias cvars; use it to fine-tune DEF tokens", (void *) &pr_overrideparallax, CVAR_BOOL | CVAR_NOSAVE, 0, 1 },
|
||||
{ "r_pr_parallaxscale", "r_pr_parallaxscale: overriden parallax mapping offset scale", (void *) &pr_parallaxscale, CVAR_FLOAT | CVAR_NOSAVE, -10, 10 },
|
||||
{ "r_pr_parallaxbias", "r_pr_parallaxbias: overriden parallax mapping offset bias", (void *) &pr_parallaxbias, CVAR_FLOAT | CVAR_NOSAVE, -10, 10 },
|
||||
{ "r_pr_overridespecular", "r_pr_overridespecular: overrides specular material power and factor values with values from the pr_specularpower and pr_specularfactor cvars; use it to fine-tune DEF tokens", (void *) &pr_overridespecular, CVAR_BOOL | CVAR_NOSAVE, 0, 1 },
|
||||
{ "r_pr_specularpower", "r_pr_specularpower: overriden specular material power", (void *) &pr_specularpower, CVAR_FLOAT | CVAR_NOSAVE, -10, 1000 },
|
||||
{ "r_pr_specularfactor", "r_pr_specularfactor: overriden specular material factor", (void *) &pr_specularfactor, CVAR_FLOAT | CVAR_NOSAVE, -10, 1000 },
|
||||
{ "r_pr_highpalookups", "r_pr_highpalookups: enable/disable highpalookups", (void *) &pr_highpalookups, CVAR_BOOL, 0, 1 },
|
||||
{ "r_pr_ati_fboworkaround", "r_pr_ati_fboworkaround: enable this to workaround an ATI driver bug that causes sprite shadows to be square - you need to restart the renderer for it to take effect", (void *) &pr_ati_fboworkaround, CVAR_BOOL | CVAR_NOSAVE, 0, 1 },
|
||||
{ "r_pr_ati_nodepthoffset", "r_pr_ati_nodepthoffset: enable this to workaround an ATI driver bug that causes sprite drawing to freeze the game on Radeon X1x00 hardware - you need to restart the renderer for it to take effect", (void *) &pr_ati_nodepthoffset, CVAR_BOOL | CVAR_NOSAVE, 0, 1 },
|
||||
#endif
|
||||
|
||||
{ "r_models","r_models: enable/disable model rendering",(void *)&usemodels, CVAR_BOOL, 0, 1 },
|
||||
{ "r_hightile","r_hightile: enable/disable hightile texture rendering",(void *)&usehightile, CVAR_BOOL, 0, 1 },
|
||||
{ "r_models","r_models: enable/disable model rendering",(void *) &usemodels, CVAR_BOOL, 0, 1 },
|
||||
{ "r_hightile","r_hightile: enable/disable hightile texture rendering",(void *) &usehightile, CVAR_BOOL, 0, 1 },
|
||||
|
||||
{ "r_preview_mouseaim", "r_preview_mouseaim: toggles mouse aiming preview, use this to calibrate yxaspect in Polymost Mapster32", (void *)&preview_mouseaim, CVAR_BOOL, 0, 1 },
|
||||
{ "r_preview_mouseaim", "r_preview_mouseaim: toggles mouse aiming preview, use this to calibrate yxaspect in Polymost Mapster32", (void *) &preview_mouseaim, CVAR_BOOL, 0, 1 },
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -6273,7 +6277,7 @@ void polymost_precache(int32_t dapicnum, int32_t dapalnum, int32_t datype)
|
|||
|
||||
for (i=0; i<=j; i++)
|
||||
{
|
||||
mdloadskin((md2model_t*)models[mid], 0, dapalnum, i);
|
||||
mdloadskin((md2model_t *)models[mid], 0, dapalnum, i);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -6343,9 +6347,9 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
|||
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; }
|
||||
(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; }
|
||||
(pict->format == B_LITTLE32(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT))) { offs = 8; stride = 16; }
|
||||
else { offs = 0; stride = 8; }
|
||||
|
||||
if (stride == 16) //If DXT3...
|
||||
|
@ -6380,58 +6384,58 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
|||
cptr = midbuf;
|
||||
for (k=0; k<=2; k+=2)
|
||||
for (j=0; (unsigned)j<miplen; j+=stride)
|
||||
{ *(int16_t *)cptr = hicosub(*(int16_t *)(&pic[offs+j+k])); cptr += 2; }
|
||||
if (glusetexcache == 2)
|
||||
{ *(int16_t *)cptr = hicosub(*(int16_t *)(&pic[offs+j+k])); cptr += 2; }
|
||||
if (glusetexcache == 2)
|
||||
{
|
||||
j = (miplen/stride)<<2;
|
||||
cleng = qlz_compress(midbuf,packbuf,j,state_compress);
|
||||
if (cleng == 0 || cleng > j-1)
|
||||
{
|
||||
j = (miplen/stride)<<2;
|
||||
cleng = qlz_compress(midbuf,packbuf,j,state_compress);
|
||||
if (cleng == 0 || cleng > j-1)
|
||||
{
|
||||
cleng = j;
|
||||
writebuf = midbuf;
|
||||
}
|
||||
else writebuf = packbuf;
|
||||
}
|
||||
else
|
||||
{
|
||||
cleng = (miplen/stride)<<2;
|
||||
cleng = j;
|
||||
writebuf = midbuf;
|
||||
}
|
||||
j = B_LITTLE32(cleng);
|
||||
Bwrite(fil,&j,sizeof(j));
|
||||
Bwrite(fil,writebuf,cleng);
|
||||
else writebuf = packbuf;
|
||||
}
|
||||
else
|
||||
{
|
||||
cleng = (miplen/stride)<<2;
|
||||
writebuf = midbuf;
|
||||
}
|
||||
j = B_LITTLE32(cleng);
|
||||
Bwrite(fil,&j,sizeof(j));
|
||||
Bwrite(fil,writebuf,cleng);
|
||||
|
||||
//index_4x4
|
||||
cptr = midbuf;
|
||||
for (j=0; (unsigned)j<miplen; j+=stride)
|
||||
//index_4x4
|
||||
cptr = midbuf;
|
||||
for (j=0; (unsigned)j<miplen; j+=stride)
|
||||
{
|
||||
char *c2 = &pic[j+offs+4];
|
||||
cptr[0] = ((c2[0]>>0)&3) + (((c2[1]>>0)&3)<<2) + (((c2[2]>>0)&3)<<4) + (((c2[3]>>0)&3)<<6);
|
||||
cptr[1] = ((c2[0]>>2)&3) + (((c2[1]>>2)&3)<<2) + (((c2[2]>>2)&3)<<4) + (((c2[3]>>2)&3)<<6);
|
||||
cptr[2] = ((c2[0]>>4)&3) + (((c2[1]>>4)&3)<<2) + (((c2[2]>>4)&3)<<4) + (((c2[3]>>4)&3)<<6);
|
||||
cptr[3] = ((c2[0]>>6)&3) + (((c2[1]>>6)&3)<<2) + (((c2[2]>>6)&3)<<4) + (((c2[3]>>6)&3)<<6);
|
||||
cptr += 4;
|
||||
}
|
||||
if (glusetexcache == 2)
|
||||
{
|
||||
j = (miplen/stride)<<2;
|
||||
cleng = qlz_compress(midbuf,packbuf,j,state_compress);
|
||||
if (cleng == 0 || cleng > j-1)
|
||||
{
|
||||
char *c2 = &pic[j+offs+4];
|
||||
cptr[0] = ((c2[0]>>0)&3) + (((c2[1]>>0)&3)<<2) + (((c2[2]>>0)&3)<<4) + (((c2[3]>>0)&3)<<6);
|
||||
cptr[1] = ((c2[0]>>2)&3) + (((c2[1]>>2)&3)<<2) + (((c2[2]>>2)&3)<<4) + (((c2[3]>>2)&3)<<6);
|
||||
cptr[2] = ((c2[0]>>4)&3) + (((c2[1]>>4)&3)<<2) + (((c2[2]>>4)&3)<<4) + (((c2[3]>>4)&3)<<6);
|
||||
cptr[3] = ((c2[0]>>6)&3) + (((c2[1]>>6)&3)<<2) + (((c2[2]>>6)&3)<<4) + (((c2[3]>>6)&3)<<6);
|
||||
cptr += 4;
|
||||
}
|
||||
if (glusetexcache == 2)
|
||||
{
|
||||
j = (miplen/stride)<<2;
|
||||
cleng = qlz_compress(midbuf,packbuf,j,state_compress);
|
||||
if (cleng == 0 || cleng > j-1)
|
||||
{
|
||||
cleng = j;
|
||||
writebuf = midbuf;
|
||||
}
|
||||
else writebuf = packbuf;
|
||||
}
|
||||
else
|
||||
{
|
||||
cleng = (miplen/stride)<<2;
|
||||
cleng = j;
|
||||
writebuf = midbuf;
|
||||
}
|
||||
j = B_LITTLE32(cleng);
|
||||
Bwrite(fil,&j,sizeof(j));
|
||||
Bwrite(fil,writebuf,cleng);
|
||||
return 0;
|
||||
else writebuf = packbuf;
|
||||
}
|
||||
else
|
||||
{
|
||||
cleng = (miplen/stride)<<2;
|
||||
writebuf = midbuf;
|
||||
}
|
||||
j = B_LITTLE32(cleng);
|
||||
Bwrite(fil,&j,sizeof(j));
|
||||
Bwrite(fil,writebuf,cleng);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t dedxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, char *packbuf, int32_t ispacked)
|
||||
|
|
|
@ -40,9 +40,9 @@ int32_t boundmulscale(int32_t a, int32_t b, int32_t c)
|
|||
"xorl $0x7fffffff, %%eax\n\t" // xor eax, 0x7fffffff
|
||||
"1:" // skipboundit:
|
||||
: "+a"(a), "+b"(b), "+c"(c) // input eax ebx ecx
|
||||
:
|
||||
: "edx", "cc"
|
||||
);
|
||||
:
|
||||
: "edx", "cc"
|
||||
);
|
||||
return a;
|
||||
}
|
||||
|
||||
|
@ -84,8 +84,8 @@ void clearbufbyte(void *D, int32_t c, int32_t a)
|
|||
"stosb\n\t"
|
||||
"5:" // endit
|
||||
: "+D"(D), "+c"(c), "+a"(a) :
|
||||
: "ebx", "memory", "cc"
|
||||
);
|
||||
: "ebx", "memory", "cc"
|
||||
);
|
||||
}
|
||||
|
||||
void copybufbyte(void *S, void *D, int32_t c)
|
||||
|
@ -125,8 +125,8 @@ void copybufbyte(void *S, void *D, int32_t c)
|
|||
"movsb\n\t"
|
||||
"5:" // endit:
|
||||
: "+c"(c), "+S"(S), "+D"(D) :
|
||||
: "ebx", "memory", "cc"
|
||||
);
|
||||
: "ebx", "memory", "cc"
|
||||
);
|
||||
}
|
||||
|
||||
void copybufreverse(void *S, void *D, int32_t c)
|
||||
|
@ -159,8 +159,8 @@ void copybufreverse(void *S, void *D, int32_t c)
|
|||
"jnz 2b\n\t" // jnz begloop
|
||||
"3:"
|
||||
: "+S"(S), "+D"(D), "+c"(c) :
|
||||
: "eax", "memory", "cc"
|
||||
);
|
||||
: "eax", "memory", "cc"
|
||||
);
|
||||
}
|
||||
|
||||
#elif defined(_MSC_VER) && !defined(NOASM) // __GNUC__ && __i386__
|
||||
|
@ -191,19 +191,19 @@ void qinterpolatedown16short(intptr_t bufptr, int32_t num, int32_t val, int32_t
|
|||
|
||||
void clearbuf(void *d, int32_t c, int32_t a)
|
||||
{
|
||||
int32_t *p = (int32_t*)d;
|
||||
int32_t *p = (int32_t *)d;
|
||||
while ((c--) > 0) *(p++) = a;
|
||||
}
|
||||
|
||||
void copybuf(void *s, void *d, int32_t c)
|
||||
{
|
||||
int32_t *p = (int32_t*)s, *q = (int32_t*)d;
|
||||
int32_t *p = (int32_t *)s, *q = (int32_t *)d;
|
||||
while ((c--) > 0) *(q++) = *(p++);
|
||||
}
|
||||
|
||||
void swapbuf4(void *a, void *b, int32_t c)
|
||||
{
|
||||
int32_t *p = (int32_t*)a, *q = (int32_t*)b;
|
||||
int32_t *p = (int32_t *)a, *q = (int32_t *)b;
|
||||
int32_t x, y;
|
||||
while ((c--) > 0)
|
||||
{
|
||||
|
@ -217,7 +217,7 @@ void swapbuf4(void *a, void *b, int32_t c)
|
|||
void clearbufbyte(void *D, int32_t c, int32_t a)
|
||||
{
|
||||
// Cringe City
|
||||
char *p = (char*)D;
|
||||
char *p = (char *)D;
|
||||
int32_t m[4] = { 0xffl,0xff00l,0xff0000l,0xff000000l };
|
||||
int32_t n[4] = { 0,8,16,24 };
|
||||
int32_t z=0;
|
||||
|
@ -230,13 +230,13 @@ void clearbufbyte(void *D, int32_t c, int32_t a)
|
|||
|
||||
void copybufbyte(void *S, void *D, int32_t c)
|
||||
{
|
||||
char *p = (char*)S, *q = (char*)D;
|
||||
char *p = (char *)S, *q = (char *)D;
|
||||
while ((c--) > 0) *(q++) = *(p++);
|
||||
}
|
||||
|
||||
void copybufreverse(void *S, void *D, int32_t c)
|
||||
{
|
||||
char *p = (char*)S, *q = (char*)D;
|
||||
char *p = (char *)S, *q = (char *)D;
|
||||
while ((c--) > 0) *(q++) = *(p--);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -18,10 +18,10 @@ extern void SetKey(int32_t key, int32_t state);
|
|||
#define MASK_UP (MASK_DOWN<<1)
|
||||
#define MouseWheelFakePressTime 50
|
||||
#ifndef GET_RAWINPUT_CODE_WPARAM
|
||||
#define GET_RAWINPUT_CODE_WPARAM(wParam) ((wParam) & 0xff)
|
||||
#define GET_RAWINPUT_CODE_WPARAM(wParam) ((wParam) & 0xff)
|
||||
#endif
|
||||
|
||||
static inline void RI_ProcessMouse(const RAWMOUSE* rmouse)
|
||||
static inline void RI_ProcessMouse(const RAWMOUSE *rmouse)
|
||||
{
|
||||
int32_t i, mask;
|
||||
|
||||
|
@ -77,7 +77,7 @@ static inline void RI_ProcessMouse(const RAWMOUSE* rmouse)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void RI_ProcessKeyboard(const RAWKEYBOARD* rkbd)
|
||||
static inline void RI_ProcessKeyboard(const RAWKEYBOARD *rkbd)
|
||||
{
|
||||
uint8_t key = rkbd->MakeCode, VKey = rkbd->VKey;
|
||||
|
||||
|
|
|
@ -279,7 +279,7 @@ scriptfile *scriptfile_fromfile(const char *fn)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
sf = (scriptfile*) Bmalloc(sizeof(scriptfile));
|
||||
sf = (scriptfile *) Bmalloc(sizeof(scriptfile));
|
||||
if (!sf)
|
||||
{
|
||||
kclose(fp);
|
||||
|
@ -311,7 +311,7 @@ scriptfile *scriptfile_fromstring(const char *string)
|
|||
tx = (char *) Bmalloc(flen + 2);
|
||||
if (!tx) return NULL;
|
||||
|
||||
sf = (scriptfile*) Bmalloc(sizeof(scriptfile));
|
||||
sf = (scriptfile *) Bmalloc(sizeof(scriptfile));
|
||||
if (!sf)
|
||||
{
|
||||
Bfree(tx);
|
||||
|
@ -349,7 +349,7 @@ int32_t scriptfile_eof(scriptfile *sf)
|
|||
static int32_t symbtablength=0, symbtaballoclength=0;
|
||||
static char *symbtab = NULL;
|
||||
|
||||
static char * getsymbtabspace(int32_t reqd)
|
||||
static char *getsymbtabspace(int32_t reqd)
|
||||
{
|
||||
char *pos,*np;
|
||||
int32_t i;
|
||||
|
@ -375,7 +375,7 @@ int32_t scriptfile_getsymbolvalue(char *name, int32_t *val)
|
|||
{
|
||||
if (!Bstrcasecmp(name, scanner))
|
||||
{
|
||||
*val = *(int32_t*)(scanner + strlen(scanner) + 1);
|
||||
*val = *(int32_t *)(scanner + strlen(scanner) + 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -397,7 +397,7 @@ int32_t scriptfile_addsymbolvalue(char *name, int32_t val)
|
|||
{
|
||||
if (!Bstrcasecmp(name, scanner))
|
||||
{
|
||||
*(int32_t*)(scanner + strlen(scanner) + 1) = val;
|
||||
*(int32_t *)(scanner + strlen(scanner) + 1) = val;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -409,7 +409,7 @@ int32_t scriptfile_addsymbolvalue(char *name, int32_t val)
|
|||
if (!sp) return 0;
|
||||
strcpy(sp, name);
|
||||
sp += strlen(name)+1;
|
||||
*(int32_t*)sp = val;
|
||||
*(int32_t *)sp = val;
|
||||
return 1; // added
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ int32_t _buildargc = 1;
|
|||
const char **_buildargv = NULL;
|
||||
extern int32_t app_main(int32_t argc, const char *argv[]);
|
||||
|
||||
char quitevent=0, appactive=1;
|
||||
char quitevent=0, appactive=1, novideo=0;
|
||||
|
||||
// video
|
||||
static SDL_Surface *sdl_surface;
|
||||
|
@ -81,8 +81,8 @@ static char keytranslation[SDL_NUM_SCANCODES];
|
|||
static int32_t buildkeytranslationtable(void);
|
||||
|
||||
//static SDL_Surface * loadtarga(const char *fn); // for loading the icon
|
||||
static SDL_Surface * appicon = NULL;
|
||||
static SDL_Surface * loadappicon(void);
|
||||
static SDL_Surface *appicon = NULL;
|
||||
static SDL_Surface *loadappicon(void);
|
||||
|
||||
static mutex_t m_initprintf;
|
||||
|
||||
|
@ -183,7 +183,7 @@ int32_t main(int32_t argc, char *argv[])
|
|||
startwin_open();
|
||||
|
||||
_buildargc = argc;
|
||||
_buildargv = (const char**)argv;
|
||||
_buildargv = (const char **)argv;
|
||||
|
||||
// pipe standard outputs to files
|
||||
if ((argp = Bgetenv("BUILD_LOGSTDOUT")) != NULL)
|
||||
|
@ -228,7 +228,7 @@ void setvsync(int32_t sync)
|
|||
}
|
||||
#endif
|
||||
|
||||
static void attach_debugger_here(void){}
|
||||
static void attach_debugger_here(void) {}
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define PRINTSTACKONSEGV 1
|
||||
|
@ -295,8 +295,15 @@ int32_t initsystem(void)
|
|||
#endif
|
||||
))
|
||||
{
|
||||
initprintf("Initialization failed! (%s)\n", SDL_GetError());
|
||||
return -1;
|
||||
initprintf("Initialization failed! (%s)\nNon-interactive mode enabled\n", SDL_GetError());
|
||||
/* if (SDL_Init(0))
|
||||
{
|
||||
initprintf("Initialization failed! (%s)\n", SDL_GetError());
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
*/
|
||||
novideo = nogl = 1;
|
||||
}
|
||||
|
||||
signal(SIGSEGV, sighandler);
|
||||
|
@ -309,7 +316,7 @@ int32_t initsystem(void)
|
|||
lockcount = 0;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (loadgldriver(getenv("BUILD_GLDRV")))
|
||||
if (!novideo && loadgldriver(getenv("BUILD_GLDRV")))
|
||||
{
|
||||
initprintf("Failed loading OpenGL driver. GL modes will be unavailable.\n");
|
||||
nogl = 1;
|
||||
|
@ -319,13 +326,18 @@ int32_t initsystem(void)
|
|||
#ifndef __APPLE__
|
||||
|
||||
//icon = loadtarga("icon.tga");
|
||||
appicon = loadappicon();
|
||||
if (appicon)
|
||||
SDL_WM_SetIcon(appicon, 0);
|
||||
|
||||
if (!novideo)
|
||||
{
|
||||
appicon = loadappicon();
|
||||
if (appicon)
|
||||
SDL_WM_SetIcon(appicon, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (SDL_VideoDriverName(drvname, 32))
|
||||
initprintf("Using \"%s\" video driver\n", drvname);
|
||||
if (!novideo)
|
||||
if (SDL_VideoDriverName(drvname, 32))
|
||||
initprintf("Using \"%s\" video driver\n", drvname);
|
||||
|
||||
/*
|
||||
// dump a quick summary of the graphics hardware
|
||||
|
@ -384,8 +396,8 @@ void initprintf(const char *f, ...)
|
|||
Bvsnprintf(buf, sizeof(buf), f, va);
|
||||
va_end(va);
|
||||
|
||||
OSD_Printf(buf);
|
||||
Bprintf("%s", buf);
|
||||
OSD_Printf("%s", buf);
|
||||
// Bprintf("%s", buf);
|
||||
|
||||
mutex_lock(&m_initprintf);
|
||||
if (Bstrlen(dabuf) + Bstrlen(buf) > 1022)
|
||||
|
@ -495,7 +507,7 @@ int32_t initinput(void)
|
|||
joyhat = (int32_t *)Bcalloc(joynumhats, sizeof(int32_t));
|
||||
|
||||
for (i = 0; i < joynumhats; i++)
|
||||
joyhat[i] = -1; // centre
|
||||
joyhat[i] = -1; // centre
|
||||
|
||||
joydead = (uint16_t *)Bcalloc(joynumaxes, sizeof(uint16_t));
|
||||
joysatur = (uint16_t *)Bcalloc(joynumaxes, sizeof(uint16_t));
|
||||
|
@ -793,7 +805,7 @@ void getvalidmodes(void)
|
|||
#endif
|
||||
int32_t i, j, maxx=0, maxy=0;
|
||||
|
||||
if (modeschecked) return;
|
||||
if (modeschecked || novideo) return;
|
||||
|
||||
validmodecnt=0;
|
||||
// initprintf("Detecting video modes:\n");
|
||||
|
@ -879,7 +891,7 @@ void getvalidmodes(void)
|
|||
#undef CHECK
|
||||
#undef ADDMODE
|
||||
|
||||
qsort((void*)validmode, validmodecnt, sizeof(struct validmode_t), (int32_t(*)(const void*,const void*))sortmodes);
|
||||
qsort((void *)validmode, validmodecnt, sizeof(struct validmode_t), (int32_t( *)(const void *,const void *))sortmodes);
|
||||
|
||||
modeschecked=1;
|
||||
}
|
||||
|
@ -1131,28 +1143,33 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs)
|
|||
glinfo.extensions = (const char *)bglGetString(GL_EXTENSIONS);
|
||||
|
||||
#ifdef POLYMER
|
||||
if (!Bstrcmp(glinfo.vendor,"ATI Technologies Inc.")) {
|
||||
if (!Bstrcmp(glinfo.vendor,"ATI Technologies Inc."))
|
||||
{
|
||||
pr_ati_fboworkaround = 1;
|
||||
initprintf("Enabling ATI FBO color attachment workaround.\n");
|
||||
|
||||
if (!Bstrncmp(glinfo.renderer,"Radeon X1", 9)) {
|
||||
if (Bstrstr(glinfo.renderer,"Radeon X1"))
|
||||
{
|
||||
pr_ati_nodepthoffset = 1;
|
||||
initprintf("Enabling ATI R520 polygon offset workaround.\n");
|
||||
} else
|
||||
}
|
||||
else
|
||||
pr_ati_nodepthoffset = 0;
|
||||
#ifdef __APPLE__
|
||||
//See bug description at http://lists.apple.com/archives/mac-opengl/2005/Oct/msg00169.html
|
||||
if (!Bstrncmp(glinfo.renderer,"ATI Radeon 9600", 15)) {
|
||||
if (!Bstrncmp(glinfo.renderer,"ATI Radeon 9600", 15))
|
||||
{
|
||||
pr_ati_textureformat_one = 1;
|
||||
initprintf("Enabling ATI Radeon 9600 texture format workaround.\n");
|
||||
} else
|
||||
}
|
||||
else
|
||||
pr_ati_textureformat_one = 0;
|
||||
#endif
|
||||
} else
|
||||
}
|
||||
else
|
||||
pr_ati_fboworkaround = 0;
|
||||
#endif
|
||||
|
||||
|
||||
glinfo.maxanisotropy = 1.0;
|
||||
glinfo.bgra = 0;
|
||||
glinfo.texcompr = 0;
|
||||
|
@ -1160,7 +1177,7 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs)
|
|||
// process the extensions string and flag stuff we recognize
|
||||
p = Bstrdup(glinfo.extensions);
|
||||
p3 = p;
|
||||
while ((p2 = Bstrtoken(p3==p?p:NULL, " ", (char**)&p3, 1)) != NULL)
|
||||
while ((p2 = Bstrtoken(p3==p?p:NULL, " ", (char **)&p3, 1)) != NULL)
|
||||
{
|
||||
if (!Bstrcmp(p2, "GL_EXT_texture_filter_anisotropic"))
|
||||
{
|
||||
|
@ -1487,6 +1504,8 @@ int32_t setgamma(void)
|
|||
double invgamma = 1 / gamma;
|
||||
double norm = pow(255., invgamma - 1);
|
||||
|
||||
if (novideo) return 0;
|
||||
|
||||
// This formula is taken from Doomsday
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
|
@ -1502,11 +1521,11 @@ int32_t setgamma(void)
|
|||
|
||||
#ifndef __APPLE__
|
||||
extern struct sdlappicon sdlappicon;
|
||||
static SDL_Surface * loadappicon(void)
|
||||
static SDL_Surface *loadappicon(void)
|
||||
{
|
||||
SDL_Surface *surf;
|
||||
|
||||
surf = SDL_CreateRGBSurfaceFrom((void*)sdlappicon.pixels,
|
||||
surf = SDL_CreateRGBSurfaceFrom((void *)sdlappicon.pixels,
|
||||
sdlappicon.width, sdlappicon.height, 32, sdlappicon.width*4,
|
||||
0xffl,0xff00l,0xff0000l,0xff000000l);
|
||||
|
||||
|
@ -1750,15 +1769,15 @@ int32_t handleevents(void)
|
|||
{
|
||||
joyaxis[ev.jaxis.axis] = ev.jaxis.value * 10000 / 32767;
|
||||
if ((joyaxis[ev.jaxis.axis] < joydead[ev.jaxis.axis])
|
||||
&& (joyaxis[ev.jaxis.axis] > -joydead[ev.jaxis.axis]))
|
||||
&& (joyaxis[ev.jaxis.axis] > -joydead[ev.jaxis.axis]))
|
||||
joyaxis[ev.jaxis.axis] = 0;
|
||||
else if (joyaxis[ev.jaxis.axis] >= joysatur[ev.jaxis.axis])
|
||||
joyaxis[ev.jaxis.axis] = 10000;
|
||||
else if (joyaxis[ev.jaxis.axis] <= -joysatur[ev.jaxis.axis])
|
||||
joyaxis[ev.jaxis.axis] = -10000;
|
||||
else
|
||||
joyaxis[ev.jaxis.axis] = joyaxis[ev.jaxis.axis] *
|
||||
10000 / joysatur[ev.jaxis.axis];
|
||||
joyaxis[ev.jaxis.axis] = joyaxis[ev.jaxis.axis] *
|
||||
10000 / joysatur[ev.jaxis.axis];
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1850,26 +1869,30 @@ inline void idle_waitevent(void)
|
|||
|
||||
#if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) // SDL 1.2
|
||||
// from SDL HG, modified
|
||||
static int32_t SDL_WaitEventTimeout(SDL_Event * event, int32_t timeout)
|
||||
static int32_t SDL_WaitEventTimeout(SDL_Event *event, int32_t timeout)
|
||||
{
|
||||
uint32_t expiration = 0;
|
||||
|
||||
if (timeout > 0)
|
||||
expiration = SDL_GetTicks() + timeout;
|
||||
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
SDL_PumpEvents();
|
||||
switch (SDL_PeepEvents(event, 1, SDL_GETEVENT, ~0)) { //SDL_FIRSTEVENT, SDL_LASTEVENT)) {
|
||||
switch (SDL_PeepEvents(event, 1, SDL_GETEVENT, ~0)) //SDL_FIRSTEVENT, SDL_LASTEVENT)) {
|
||||
{
|
||||
case -1:
|
||||
return 0;
|
||||
case 1:
|
||||
return 1;
|
||||
case 0:
|
||||
if (timeout == 0) {
|
||||
if (timeout == 0)
|
||||
{
|
||||
/* Polling and no events, just return */
|
||||
return 0;
|
||||
}
|
||||
if (timeout > 0 && ((int32_t) (SDL_GetTicks() - expiration) >= 0)) {
|
||||
if (timeout > 0 && ((int32_t)(SDL_GetTicks() - expiration) >= 0))
|
||||
{
|
||||
/* Timeout expired and no events */
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
#if defined(LINKED_GTK)
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk-pixbuf/gdk-pixdata.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk-pixbuf/gdk-pixdata.h>
|
||||
#else
|
||||
#include "dynamicgtk.h"
|
||||
#include "dynamicgtk.h"
|
||||
#endif
|
||||
|
||||
#include "build.h"
|
||||
#include "editor.h"
|
||||
#include "baselayer.h"
|
||||
|
||||
enum {
|
||||
TAB_CONFIG,
|
||||
TAB_MESSAGES,
|
||||
enum
|
||||
{
|
||||
TAB_CONFIG,
|
||||
TAB_MESSAGES,
|
||||
};
|
||||
|
||||
static struct
|
||||
|
@ -145,8 +146,8 @@ static void SetPage(int32_t n)
|
|||
if (n == TAB_CONFIG) n = TRUE; else n = FALSE;
|
||||
gtk_widget_set_sensitive(stwidgets.startbutton, n);
|
||||
gtk_container_foreach(GTK_CONTAINER(stwidgets.configtlayout),
|
||||
(GtkCallback)gtk_widget_set_sensitive,
|
||||
(gpointer)&n);
|
||||
(GtkCallback)gtk_widget_set_sensitive,
|
||||
(gpointer)&n);
|
||||
}
|
||||
|
||||
static void PopulateForm(void)
|
||||
|
@ -246,13 +247,13 @@ static GtkWidget *create_window(void)
|
|||
gtk_container_set_border_width(GTK_CONTAINER(stwidgets.tabs), 4);
|
||||
|
||||
// layout table of config page
|
||||
stwidgets.configtlayout = gtk_table_new(4, 3, FALSE);
|
||||
gtk_container_add(GTK_CONTAINER(stwidgets.tabs), stwidgets.configtlayout);
|
||||
stwidgets.configtlayout = gtk_table_new(4, 3, FALSE);
|
||||
gtk_container_add(GTK_CONTAINER(stwidgets.tabs), stwidgets.configtlayout);
|
||||
|
||||
// 2D video mode label
|
||||
stwidgets.vmode2dlabel = gtk_label_new_with_mnemonic("_2D Video mode:");
|
||||
gtk_misc_set_alignment (GTK_MISC(stwidgets.vmode2dlabel), 0.3, 0);
|
||||
gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dlabel, 0,1, 0,1, GTK_FILL, 0, 4, 6);
|
||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode2dlabel), 0.3, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dlabel, 0,1, 0,1, GTK_FILL, 0, 4, 6);
|
||||
|
||||
// 2D video mode combo
|
||||
{
|
||||
|
@ -266,22 +267,22 @@ static GtkWidget *create_window(void)
|
|||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode2dcombo), cell, FALSE);
|
||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode2dcombo), cell, "text", 0, NULL);
|
||||
}
|
||||
gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, 0, 4, 6);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, 0, 4, 6);
|
||||
gtk_widget_add_accelerator(stwidgets.vmode2dcombo, "grab_focus", stwidgets.accel_group,
|
||||
GDK_2, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
// Fullscreen checkbox
|
||||
// Fullscreen checkbox
|
||||
stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen");
|
||||
gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.fullscreencheck, 2,3, 0,1, GTK_FILL, 0, 4, 6);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.fullscreencheck, 2,3, 0,1, GTK_FILL, 0, 4, 6);
|
||||
gtk_widget_add_accelerator(stwidgets.fullscreencheck, "grab_focus", stwidgets.accel_group,
|
||||
GDK_F, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
// 3D video mode label
|
||||
stwidgets.vmode3dlabel = gtk_label_new_with_mnemonic("_3D Video mode:");
|
||||
gtk_misc_set_alignment (GTK_MISC(stwidgets.vmode3dlabel), 0.3, 0);
|
||||
gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 1,2, GTK_FILL, 0, 4, 6);
|
||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode3dlabel), 0.3, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 1,2, GTK_FILL, 0, 4, 6);
|
||||
|
||||
// 3D video mode combo
|
||||
{
|
||||
|
@ -295,17 +296,17 @@ static GtkWidget *create_window(void)
|
|||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, FALSE);
|
||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, "text", 0, NULL);
|
||||
}
|
||||
gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 1,2, GTK_EXPAND | GTK_FILL, 0, 4, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 1,2, GTK_EXPAND | GTK_FILL, 0, 4, 0);
|
||||
gtk_widget_add_accelerator(stwidgets.vmode3dcombo, "grab_focus", stwidgets.accel_group,
|
||||
GDK_3, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
// Empty horizontal layout
|
||||
stwidgets.emptyhlayout = gtk_hbox_new(TRUE, 0);
|
||||
gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,1, 2,3, 0, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
// Empty horizontal layout
|
||||
stwidgets.emptyhlayout = gtk_hbox_new(TRUE, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,1, 2,3, 0, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
|
||||
// Always show config checkbox
|
||||
stwidgets.alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show configuration on start");
|
||||
gtk_table_attach (GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,2, 3,4, GTK_FILL, 0, 4, 6);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,2, 3,4, GTK_FILL, 0, 4, 6);
|
||||
gtk_widget_add_accelerator(stwidgets.alwaysshowcheck, "grab_focus", stwidgets.accel_group,
|
||||
GDK_A, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
|
|
@ -434,7 +434,7 @@ int32_t startwin_settitle(const char *str)
|
|||
int32_t startwin_idle(void *v)
|
||||
{
|
||||
if (!startupdlg || !IsWindow(startupdlg)) return 0;
|
||||
if (IsDialogMessage(startupdlg, (MSG*)v)) return 1;
|
||||
if (IsDialogMessage(startupdlg, (MSG *)v)) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -69,8 +69,8 @@ char forcegl=0;
|
|||
#endif
|
||||
|
||||
static LPTSTR GetWindowsErrorMsg(DWORD code);
|
||||
static const char * GetDDrawError(HRESULT code);
|
||||
static const char * GetDInputError(HRESULT code);
|
||||
static const char *GetDDrawError(HRESULT code);
|
||||
static const char *GetDInputError(HRESULT code);
|
||||
static void ShowErrorBox(const char *m);
|
||||
static void ShowDDrawErrorBox(const char *m, HRESULT r);
|
||||
static void ShowDInputErrorBox(const char *m, HRESULT r);
|
||||
|
@ -441,7 +441,7 @@ int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, in
|
|||
}
|
||||
*wp = 0;
|
||||
|
||||
_buildargv = (const char**)Bmalloc(sizeof(char*)*_buildargc);
|
||||
_buildargv = (const char **)Bmalloc(sizeof(char *)*_buildargc);
|
||||
wp = argvbuf;
|
||||
for (i=0; i<_buildargc; i++,wp++)
|
||||
{
|
||||
|
@ -586,7 +586,7 @@ static void win_printversion(void)
|
|||
}
|
||||
|
||||
initprintf("Windows %s (build %lu.%lu.%lu) %s", ver,
|
||||
osv.dwMajorVersion, osv.dwMinorVersion, osv.dwBuildNumber, osv.szCSDVersion);
|
||||
osv.dwMajorVersion, osv.dwMinorVersion, osv.dwBuildNumber, osv.szCSDVersion);
|
||||
|
||||
#ifdef NEDMALLOC
|
||||
initprintf("\n");
|
||||
|
@ -754,7 +754,7 @@ int32_t handleevents(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (startwin_idle((void*)&msg) > 0) continue;
|
||||
if (startwin_idle((void *)&msg) > 0) continue;
|
||||
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
|
@ -1010,7 +1010,7 @@ static BOOL CALLBACK InitDirectInput_enum(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRe
|
|||
|
||||
static BOOL CALLBACK InitDirectInput_enumobjects(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef)
|
||||
{
|
||||
int32_t *typecounts = (int32_t*)pvRef;
|
||||
int32_t *typecounts = (int32_t *)pvRef;
|
||||
|
||||
if (lpddoi->dwType & DIDFT_AXIS)
|
||||
{
|
||||
|
@ -1183,17 +1183,17 @@ static void UninitDirectInput(void)
|
|||
|
||||
if (axisdefs)
|
||||
{
|
||||
for (i=joynumaxes-1; i>=0; i--) if (axisdefs[i].name) Bfree((void*)axisdefs[i].name);
|
||||
for (i=joynumaxes-1; i>=0; i--) if (axisdefs[i].name) Bfree((void *)axisdefs[i].name);
|
||||
Bfree(axisdefs); axisdefs = NULL;
|
||||
}
|
||||
if (buttondefs)
|
||||
{
|
||||
for (i=joynumbuttons-1; i>=0; i--) if (buttondefs[i].name) Bfree((void*)buttondefs[i].name);
|
||||
for (i=joynumbuttons-1; i>=0; i--) if (buttondefs[i].name) Bfree((void *)buttondefs[i].name);
|
||||
Bfree(buttondefs); buttondefs = NULL;
|
||||
}
|
||||
if (hatdefs)
|
||||
{
|
||||
for (i=joynumhats-1; i>=0; i--) if (hatdefs[i].name) Bfree((void*)hatdefs[i].name);
|
||||
for (i=joynumhats-1; i>=0; i--) if (hatdefs[i].name) Bfree((void *)hatdefs[i].name);
|
||||
Bfree(hatdefs); hatdefs = NULL;
|
||||
}
|
||||
|
||||
|
@ -1396,7 +1396,7 @@ static void ShowDInputErrorBox(const char *m, HRESULT r)
|
|||
// GetDInputError() -- stinking huge list of error messages since MS didn't want to include
|
||||
// them in the DLL
|
||||
//
|
||||
static const char * GetDInputError(HRESULT code)
|
||||
static const char *GetDInputError(HRESULT code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
|
@ -1514,14 +1514,14 @@ int32_t inittimer(int32_t tickspersecond)
|
|||
// OpenWatcom seems to want us to query the value into a local variable
|
||||
// instead of the global 'timerfreq' or else it gets pissed with an
|
||||
// access violation
|
||||
if (!QueryPerformanceFrequency((LARGE_INTEGER*)&t))
|
||||
if (!QueryPerformanceFrequency((LARGE_INTEGER *)&t))
|
||||
{
|
||||
ShowErrorBox("Failed fetching timer frequency");
|
||||
return -1;
|
||||
}
|
||||
timerfreq = t;
|
||||
timerticspersec = tickspersecond;
|
||||
QueryPerformanceCounter((LARGE_INTEGER*)&t);
|
||||
QueryPerformanceCounter((LARGE_INTEGER *)&t);
|
||||
timerlastsample = (int32_t)(t*timerticspersec / timerfreq);
|
||||
|
||||
usertimercallback = NULL;
|
||||
|
@ -1550,7 +1550,7 @@ inline void sampletimer(void)
|
|||
|
||||
if (!timerfreq) return;
|
||||
|
||||
QueryPerformanceCounter((LARGE_INTEGER*)&i);
|
||||
QueryPerformanceCounter((LARGE_INTEGER *)&i);
|
||||
n = (int32_t)((i*timerticspersec / timerfreq) - timerlastsample);
|
||||
|
||||
if (n <= 0) return;
|
||||
|
@ -1569,7 +1569,7 @@ uint32_t getticks(void)
|
|||
{
|
||||
int64_t i;
|
||||
if (timerfreq == 0) return 0;
|
||||
QueryPerformanceCounter((LARGE_INTEGER*)&i);
|
||||
QueryPerformanceCounter((LARGE_INTEGER *)&i);
|
||||
return (uint32_t)(i*longlong(1000)/timerfreq);
|
||||
}
|
||||
|
||||
|
@ -1594,7 +1594,7 @@ static HMODULE hDDrawDLL = NULL;
|
|||
static LPDIRECTDRAW lpDD = NULL;
|
||||
static LPDIRECTDRAWSURFACE lpDDSPrimary = NULL;
|
||||
static LPDIRECTDRAWSURFACE lpDDSBack = NULL;
|
||||
static char * lpOffscreen = NULL;
|
||||
static char *lpOffscreen = NULL;
|
||||
static LPDIRECTDRAWPALETTE lpDDPalette = NULL;
|
||||
static BOOL bDDrawInited = FALSE;
|
||||
static DWORD DDdwCaps = 0, DDdwCaps2 = 0;
|
||||
|
@ -1909,7 +1909,7 @@ void getvalidmodes(void)
|
|||
ADDMODE(defaultres[i][0],defaultres[i][1],cdepths[j],0,-1)
|
||||
}
|
||||
|
||||
qsort((void*)validmode, validmodecnt, sizeof(struct validmode_t), (int32_t(*)(const void*,const void*))sortmodes);
|
||||
qsort((void *)validmode, validmodecnt, sizeof(struct validmode_t), (int32_t( *)(const void *,const void *))sortmodes);
|
||||
|
||||
modeschecked=1;
|
||||
}
|
||||
|
@ -2889,7 +2889,7 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp)
|
|||
// process the extensions string and flag stuff we recognize
|
||||
p = (GLubyte *)Bstrdup(glinfo.extensions);
|
||||
p3 = p;
|
||||
while ((p2 = (GLubyte *)Bstrtoken(p3==p?(char *)p:NULL, " ", (char**)&p3, 1)) != NULL)
|
||||
while ((p2 = (GLubyte *)Bstrtoken(p3==p?(char *)p:NULL, " ", (char **)&p3, 1)) != NULL)
|
||||
{
|
||||
if (!Bstrcmp((char *)p2, "GL_EXT_texture_filter_anisotropic"))
|
||||
{
|
||||
|
@ -3285,7 +3285,7 @@ static void ShowDDrawErrorBox(const char *m, HRESULT r)
|
|||
// GetDDrawError() -- stinking huge list of error messages since MS didn't want to include
|
||||
// them in the DLL
|
||||
//
|
||||
static const char * GetDDrawError(HRESULT code)
|
||||
static const char *GetDDrawError(HRESULT code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue