mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
Use bit packing for the bytecode pointer map
git-svn-id: https://svn.eduke32.com/eduke32@1064 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0b38803fb6
commit
18f4481d86
9 changed files with 133 additions and 92 deletions
|
@ -19,7 +19,7 @@ typedef struct hicreplc_t {
|
||||||
typedef struct pthtyp_t
|
typedef struct pthtyp_t
|
||||||
{
|
{
|
||||||
struct pthtyp_t *next;
|
struct pthtyp_t *next;
|
||||||
GLuint glpic;
|
unsigned int glpic;
|
||||||
short picnum;
|
short picnum;
|
||||||
char palnum;
|
char palnum;
|
||||||
char effects;
|
char effects;
|
||||||
|
|
|
@ -4624,7 +4624,8 @@ CANCEL:
|
||||||
}
|
}
|
||||||
else if (ch == 's' || ch == 'S') //S
|
else if (ch == 's' || ch == 'S') //S
|
||||||
{
|
{
|
||||||
char *f;int res;
|
char *f;
|
||||||
|
int res;
|
||||||
bad = 0;
|
bad = 0;
|
||||||
printmessage16("Saving board...");
|
printmessage16("Saving board...");
|
||||||
showframe(1);
|
showframe(1);
|
||||||
|
|
|
@ -70,7 +70,9 @@ void hicinit(void)
|
||||||
int i,j;
|
int i,j;
|
||||||
hicreplctyp *hr, *next;
|
hicreplctyp *hr, *next;
|
||||||
|
|
||||||
|
#if defined(USE_OPENGL)
|
||||||
clearconv();
|
clearconv();
|
||||||
|
#endif
|
||||||
for (i=0;i<MAXPALOOKUPS;i++) // all tints should be 100%
|
for (i=0;i<MAXPALOOKUPS;i++) // all tints should be 100%
|
||||||
{
|
{
|
||||||
hictinting[i].r = hictinting[i].g = hictinting[i].b = 0xff;
|
hictinting[i].r = hictinting[i].g = hictinting[i].b = 0xff;
|
||||||
|
|
|
@ -170,10 +170,6 @@ int r_vbocount = 64;
|
||||||
// model animation smoothing cvar
|
// model animation smoothing cvar
|
||||||
int r_animsmoothing = 1;
|
int r_animsmoothing = 1;
|
||||||
|
|
||||||
// polymost ART sky control
|
|
||||||
int r_parallaxskyclamping = 1;
|
|
||||||
int r_parallaxskypanning = 0;
|
|
||||||
|
|
||||||
// line of sight checks before mddraw()
|
// line of sight checks before mddraw()
|
||||||
int r_modelocclusionchecking = 0;
|
int r_modelocclusionchecking = 0;
|
||||||
|
|
||||||
|
@ -199,6 +195,10 @@ static float fogresult, fogcol[4];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// polymost ART sky control
|
||||||
|
int r_parallaxskyclamping = 1;
|
||||||
|
int r_parallaxskypanning = 0;
|
||||||
|
|
||||||
#if defined(USE_MSC_PRAGMAS)
|
#if defined(USE_MSC_PRAGMAS)
|
||||||
static inline void ftol(float f, int *a)
|
static inline void ftol(float f, int *a)
|
||||||
{
|
{
|
||||||
|
@ -915,7 +915,9 @@ void resizeglcheck()
|
||||||
bglMatrixMode(GL_MODELVIEW);
|
bglMatrixMode(GL_MODELVIEW);
|
||||||
bglLoadIdentity();
|
bglLoadIdentity();
|
||||||
|
|
||||||
|
#ifdef USE_OPENGL
|
||||||
if (!nofog) bglEnable(GL_FOG);
|
if (!nofog) bglEnable(GL_FOG);
|
||||||
|
#endif
|
||||||
|
|
||||||
//bglEnable(GL_TEXTURE_2D);
|
//bglEnable(GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
|
@ -5095,9 +5097,13 @@ void polymost_dorotatesprite(int sx, int sy, int z, short a, short picnum,
|
||||||
}
|
}
|
||||||
mddraw(&tspr);
|
mddraw(&tspr);
|
||||||
#else
|
#else
|
||||||
|
#ifdef USE_OPENGL
|
||||||
if (!nofog) bglDisable(GL_FOG);
|
if (!nofog) bglDisable(GL_FOG);
|
||||||
mddraw(&tspr);
|
mddraw(&tspr);
|
||||||
if (!nofog) bglEnable(GL_FOG);
|
if (!nofog) bglEnable(GL_FOG);
|
||||||
|
#else
|
||||||
|
mddraw(&tspr);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
viewingrange = oldviewingrange;
|
viewingrange = oldviewingrange;
|
||||||
gxyaspect = ogxyaspect;
|
gxyaspect = ogxyaspect;
|
||||||
|
@ -5251,9 +5257,13 @@ void polymost_dorotatesprite(int sx, int sy, int z, short a, short picnum,
|
||||||
z = zz;
|
z = zz;
|
||||||
}
|
}
|
||||||
while (z);
|
while (z);
|
||||||
|
#ifdef USE_OPENGL
|
||||||
if (!nofog) bglDisable(GL_FOG);
|
if (!nofog) bglDisable(GL_FOG);
|
||||||
pow2xsplit = 0; drawpoly(px,py,n,method);
|
pow2xsplit = 0; drawpoly(px,py,n,method);
|
||||||
if (!nofog) bglEnable(GL_FOG);
|
if (!nofog) bglEnable(GL_FOG);
|
||||||
|
#else
|
||||||
|
pow2xsplit = 0; drawpoly(px,py,n,method);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
|
|
|
@ -114,7 +114,9 @@ static char defaultconfilename[BMAX_PATH] = {"EDUKE.CON"};
|
||||||
static char *confilename = defaultconfilename;
|
static char *confilename = defaultconfilename;
|
||||||
char *duke3ddef = "duke3d.def";
|
char *duke3ddef = "duke3d.def";
|
||||||
char mod_dir[BMAX_PATH] = "/";
|
char mod_dir[BMAX_PATH] = "/";
|
||||||
|
#if defined(POLYMOST)
|
||||||
extern char TEXCACHEDIR[BMAX_PATH];
|
extern char TEXCACHEDIR[BMAX_PATH];
|
||||||
|
#endif
|
||||||
extern int lastvisinc;
|
extern int lastvisinc;
|
||||||
|
|
||||||
int g_Shareware = 0;
|
int g_Shareware = 0;
|
||||||
|
@ -3530,10 +3532,12 @@ void SetCrosshairColor(int r, int g, int b)
|
||||||
tempbuf[i] = i;
|
tempbuf[i] = i;
|
||||||
makepalookup(CROSSHAIR_PAL,tempbuf,crosshair_colors.r>>2, crosshair_colors.g>>2, crosshair_colors.b>>2,1);
|
makepalookup(CROSSHAIR_PAL,tempbuf,crosshair_colors.r>>2, crosshair_colors.g>>2, crosshair_colors.b>>2,1);
|
||||||
|
|
||||||
|
#if defined(USE_OPENGL) && defined(POLYMOST)
|
||||||
hictinting[CROSSHAIR_PAL].r = crosshair_colors.r;
|
hictinting[CROSSHAIR_PAL].r = crosshair_colors.r;
|
||||||
hictinting[CROSSHAIR_PAL].g = crosshair_colors.g;
|
hictinting[CROSSHAIR_PAL].g = crosshair_colors.g;
|
||||||
hictinting[CROSSHAIR_PAL].b = crosshair_colors.b;
|
hictinting[CROSSHAIR_PAL].b = crosshair_colors.b;
|
||||||
hictinting[CROSSHAIR_PAL].f = 17;
|
hictinting[CROSSHAIR_PAL].f = 17;
|
||||||
|
#endif
|
||||||
invalidatetile(CROSSHAIR, -1, -1);
|
invalidatetile(CROSSHAIR, -1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10887,8 +10891,10 @@ void app_main(int argc,const char **argv)
|
||||||
Bstrcat(root,mod_dir);
|
Bstrcat(root,mod_dir);
|
||||||
addsearchpath(root);
|
addsearchpath(root);
|
||||||
addsearchpath(mod_dir);
|
addsearchpath(mod_dir);
|
||||||
|
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||||
Bsprintf(tempbuf,"%s/%s",mod_dir,TEXCACHEDIR);
|
Bsprintf(tempbuf,"%s/%s",mod_dir,TEXCACHEDIR);
|
||||||
Bstrcpy(TEXCACHEDIR,tempbuf);
|
Bstrcpy(TEXCACHEDIR,tempbuf);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
i = initgroupfile(duke3dgrp);
|
i = initgroupfile(duke3dgrp);
|
||||||
|
@ -11050,7 +11056,7 @@ void app_main(int argc,const char **argv)
|
||||||
|
|
||||||
if (setgamemode(ud.config.ScreenMode,ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP) < 0)
|
if (setgamemode(ud.config.ScreenMode,ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP) < 0)
|
||||||
{
|
{
|
||||||
int i = 0, j = 0;
|
int i = 0;
|
||||||
int xres[] = {ud.config.ScreenWidth,800,640,320};
|
int xres[] = {ud.config.ScreenWidth,800,640,320};
|
||||||
int yres[] = {ud.config.ScreenHeight,600,480,240};
|
int yres[] = {ud.config.ScreenHeight,600,480,240};
|
||||||
int bpp[] = {32,16,8};
|
int bpp[] = {32,16,8};
|
||||||
|
@ -11059,17 +11065,20 @@ void app_main(int argc,const char **argv)
|
||||||
ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP,ud.config.ScreenMode?"fullscreen":"windowed");
|
ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP,ud.config.ScreenMode?"fullscreen":"windowed");
|
||||||
|
|
||||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||||
while (setgamemode(0,xres[i],yres[i],bpp[j]) < 0)
|
|
||||||
{
|
{
|
||||||
initprintf("Failure setting video mode %dx%dx%d windowed! Attempting safer mode...\n",xres[i],yres[i],bpp[i]);
|
int j = 0;
|
||||||
j++;
|
while (setgamemode(0,xres[i],yres[i],bpp[j]) < 0)
|
||||||
if (j == 3)
|
|
||||||
{
|
{
|
||||||
i++;
|
initprintf("Failure setting video mode %dx%dx%d windowed! Attempting safer mode...\n",xres[i],yres[i],bpp[i]);
|
||||||
j = 0;
|
j++;
|
||||||
|
if (j == 3)
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
j = 0;
|
||||||
|
}
|
||||||
|
if (i == 4)
|
||||||
|
gameexit("Unable to set failsafe video mode!");
|
||||||
}
|
}
|
||||||
if (i == 4)
|
|
||||||
gameexit("Unable to set failsafe video mode!");
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
while (setgamemode(0,xres[i],yres[i],8) < 0)
|
while (setgamemode(0,xres[i],yres[i],8) < 0)
|
||||||
|
|
|
@ -925,9 +925,7 @@ const memberlabel_t inputlabels[]=
|
||||||
{ "", -1, 0, 0 } // END OF LIST
|
{ "", -1, 0, 0 } // END OF LIST
|
||||||
};
|
};
|
||||||
|
|
||||||
char *bitptr;
|
char *bitptr; // pointer to bitmap of which bytecode positions contain pointers
|
||||||
|
|
||||||
#define BITPTR_DONTFUCKWITHIT 0
|
|
||||||
#define BITPTR_POINTER 1
|
#define BITPTR_POINTER 1
|
||||||
|
|
||||||
/*struct HASH_item // size is 12/24 bits.
|
/*struct HASH_item // size is 12/24 bits.
|
||||||
|
@ -1025,6 +1023,7 @@ static int increasescriptsize(int size)
|
||||||
intptr_t *newscript;
|
intptr_t *newscript;
|
||||||
intptr_t i, j;
|
intptr_t i, j;
|
||||||
int osize = g_ScriptSize;
|
int osize = g_ScriptSize;
|
||||||
|
char *newbitptr;
|
||||||
|
|
||||||
for (i=MAXSECTORS-1;i>=0;i--)
|
for (i=MAXSECTORS-1;i>=0;i--)
|
||||||
{
|
{
|
||||||
|
@ -1038,11 +1037,14 @@ static int increasescriptsize(int size)
|
||||||
for (i=g_ScriptSize-1;i>=0;i--)
|
for (i=g_ScriptSize-1;i>=0;i--)
|
||||||
{
|
{
|
||||||
// initprintf("%d\n",i);
|
// initprintf("%d\n",i);
|
||||||
if (bitptr[i] == BITPTR_POINTER && !((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_ScriptSize])))
|
if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)) && !((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_ScriptSize])))
|
||||||
|
{
|
||||||
|
error++;
|
||||||
initprintf("Internal compiler error at %d (0x%x)\n",i,i);
|
initprintf("Internal compiler error at %d (0x%x)\n",i,i);
|
||||||
|
}
|
||||||
// if (bitptr[i] == 0 && ((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_ScriptSize])))
|
// if (bitptr[i] == 0 && ((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_ScriptSize])))
|
||||||
// initprintf("oh no!\n");
|
// initprintf("oh no!\n");
|
||||||
if (bitptr[i] == BITPTR_POINTER /*&& ((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_ScriptSize]))*/)
|
if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)) /*&& ((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_ScriptSize]))*/)
|
||||||
{
|
{
|
||||||
scriptptrs[i] = 1;
|
scriptptrs[i] = 1;
|
||||||
script[i] -= (intptr_t)&script[0];
|
script[i] -= (intptr_t)&script[0];
|
||||||
|
@ -1094,14 +1096,22 @@ static int increasescriptsize(int size)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bitptr = (char *)Brealloc(bitptr, g_ScriptSize * sizeof(char));
|
// bitptr = (char *)Brealloc(bitptr, g_ScriptSize * sizeof(char));
|
||||||
|
newbitptr = Bcalloc(1,((size+7)>>3) * sizeof(char));
|
||||||
|
|
||||||
if (size > osize)
|
if (size > osize)
|
||||||
{
|
{
|
||||||
Bmemset(&newscript[osize],0,(size-osize) * sizeof(intptr_t));
|
Bmemset(&newscript[osize],0,(size-osize) * sizeof(intptr_t));
|
||||||
Bmemset(&bitptr[osize],0,size-osize);
|
// Bmemset(&bitptr[osize],0,size-osize);
|
||||||
|
Bmemcpy(newbitptr,bitptr,sizeof(char) * ((osize+7)>>3));
|
||||||
|
}
|
||||||
|
else if (size < osize)
|
||||||
|
{
|
||||||
|
Bmemcpy(newbitptr,bitptr,sizeof(char) * ((size+7)>>3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bfree(bitptr);
|
||||||
|
bitptr = newbitptr;
|
||||||
script = newscript;
|
script = newscript;
|
||||||
scriptptr = (intptr_t *)(script+oscriptptr);
|
scriptptr = (intptr_t *)(script+oscriptptr);
|
||||||
// initprintf("script: %d, bitptr: %d\n",script,bitptr);
|
// initprintf("script: %d, bitptr: %d\n",script,bitptr);
|
||||||
|
@ -1540,7 +1550,7 @@ static int transword(void) //Returns its code #
|
||||||
if (i>=0)
|
if (i>=0)
|
||||||
{
|
{
|
||||||
*scriptptr = i + (line_number<<12);
|
*scriptptr = i + (line_number<<12);
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
textptr += l;
|
textptr += l;
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
if (!(error || warning) && g_ScriptDebug)
|
if (!(error || warning) && g_ScriptDebug)
|
||||||
|
@ -1574,13 +1584,13 @@ static void transvartype(int type)
|
||||||
{
|
{
|
||||||
if (!(error || warning) && g_ScriptDebug)
|
if (!(error || warning) && g_ScriptDebug)
|
||||||
initprintf("%s:%d: debug: accepted constant %d in place of gamevar.\n",compilefile,line_number,atol(textptr));
|
initprintf("%s:%d: debug: accepted constant %d in place of gamevar.\n",compilefile,line_number,atol(textptr));
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=MAXGAMEVARS;
|
*scriptptr++=MAXGAMEVARS;
|
||||||
if (tolower(textptr[1])=='x')
|
if (tolower(textptr[1])=='x')
|
||||||
sscanf(textptr+2,"%" PRIxPTR "",scriptptr);
|
sscanf(textptr+2,"%" PRIxPTR "",scriptptr);
|
||||||
else
|
else
|
||||||
*scriptptr=atol(textptr);
|
*scriptptr=atol(textptr);
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
getlabel();
|
getlabel();
|
||||||
return;
|
return;
|
||||||
|
@ -1624,7 +1634,7 @@ static void transvartype(int type)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=(i|f);
|
*scriptptr++=(i|f);
|
||||||
transvartype(0);
|
transvartype(0);
|
||||||
skipcomments(); //skip comments and whitespace
|
skipcomments(); //skip comments and whitespace
|
||||||
|
@ -1659,9 +1669,9 @@ static void transvartype(int type)
|
||||||
{
|
{
|
||||||
if (!(error || warning) && g_ScriptDebug)
|
if (!(error || warning) && g_ScriptDebug)
|
||||||
initprintf("%s:%d: debug: accepted defined label `%s' instead of gamevar.\n",compilefile,line_number,label+(i<<6));
|
initprintf("%s:%d: debug: accepted defined label `%s' instead of gamevar.\n",compilefile,line_number,label+(i<<6));
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=MAXGAMEVARS;
|
*scriptptr++=MAXGAMEVARS;
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=labelcode[i];
|
*scriptptr++=labelcode[i];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1697,7 +1707,7 @@ static void transvartype(int type)
|
||||||
if (!(error || warning) && g_ScriptDebug > 1)
|
if (!(error || warning) && g_ScriptDebug > 1)
|
||||||
initprintf("%s:%d: debug: accepted gamevar `%s'.\n",compilefile,line_number,label+(labelcnt<<6));
|
initprintf("%s:%d: debug: accepted gamevar `%s'.\n",compilefile,line_number,label+(labelcnt<<6));
|
||||||
|
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=(i|f);
|
*scriptptr++=(i|f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1761,13 +1771,13 @@ static int transnum(int type)
|
||||||
Bfree(gl);
|
Bfree(gl);
|
||||||
}
|
}
|
||||||
if (labeltype[i] != LABEL_DEFINE && labelcode[i] >= (intptr_t)&script[0] && labelcode[i] < (intptr_t)&script[g_ScriptSize])
|
if (labeltype[i] != LABEL_DEFINE && labelcode[i] >= (intptr_t)&script[0] && labelcode[i] < (intptr_t)&script[g_ScriptSize])
|
||||||
bitptr[(scriptptr-script)] = BITPTR_POINTER;
|
bitptr[(scriptptr-script)>>3] |= (BITPTR_POINTER<<((scriptptr-script)&7));
|
||||||
else bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
else bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*(scriptptr++) = labelcode[i];
|
*(scriptptr++) = labelcode[i];
|
||||||
textptr += l;
|
textptr += l;
|
||||||
return labeltype[i];
|
return labeltype[i];
|
||||||
}
|
}
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*(scriptptr++) = 0;
|
*(scriptptr++) = 0;
|
||||||
textptr += l;
|
textptr += l;
|
||||||
el = (char *)translatelabeltype(type);
|
el = (char *)translatelabeltype(type);
|
||||||
|
@ -1795,7 +1805,7 @@ static int transnum(int type)
|
||||||
}
|
}
|
||||||
if (!(error || warning) && g_ScriptDebug > 1)
|
if (!(error || warning) && g_ScriptDebug > 1)
|
||||||
initprintf("%s:%d: debug: accepted constant %d.\n",compilefile,line_number,atol(textptr));
|
initprintf("%s:%d: debug: accepted constant %d.\n",compilefile,line_number,atol(textptr));
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
if (tolower(textptr[1])=='x')sscanf(textptr+2,"%" PRIxPTR "",scriptptr);
|
if (tolower(textptr[1])=='x')sscanf(textptr+2,"%" PRIxPTR "",scriptptr);
|
||||||
else
|
else
|
||||||
*scriptptr = atol(textptr);
|
*scriptptr = atol(textptr);
|
||||||
|
@ -1917,8 +1927,8 @@ static int parsecommand(void)
|
||||||
initprintf("%s:%d: debug: accepted state label `%s'.\n",compilefile,line_number,label+(j<<6));
|
initprintf("%s:%d: debug: accepted state label `%s'.\n",compilefile,line_number,label+(j<<6));
|
||||||
*scriptptr = labelcode[j];
|
*scriptptr = labelcode[j];
|
||||||
if (labelcode[j] >= (intptr_t)&script[0] && labelcode[j] < (intptr_t)&script[g_ScriptSize])
|
if (labelcode[j] >= (intptr_t)&script[0] && labelcode[j] < (intptr_t)&script[g_ScriptSize])
|
||||||
bitptr[(scriptptr-script)] = BITPTR_POINTER;
|
bitptr[(scriptptr-script)>>3] |= (BITPTR_POINTER<<((scriptptr-script)&7));
|
||||||
else bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
else bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1930,7 +1940,7 @@ static int parsecommand(void)
|
||||||
warning++;
|
warning++;
|
||||||
Bfree(gl);
|
Bfree(gl);
|
||||||
*(scriptptr-1) = CON_NULLOP; // get rid of the state, leaving a nullop to satisfy if conditions
|
*(scriptptr-1) = CON_NULLOP; // get rid of the state, leaving a nullop to satisfy if conditions
|
||||||
bitptr[(scriptptr-script-1)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script-1)>>3] &= ~(1<<((scriptptr-script-1)&7));
|
||||||
return 0; // valid label name, but wrong type
|
return 0; // valid label name, but wrong type
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2030,7 +2040,7 @@ static int parsecommand(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=projectilelabels[lLabelID].lId;
|
*scriptptr++=projectilelabels[lLabelID].lId;
|
||||||
|
|
||||||
//printf("member's flags are: %02Xh\n",playerlabels[lLabelID].flags);
|
//printf("member's flags are: %02Xh\n",playerlabels[lLabelID].flags);
|
||||||
|
@ -2196,7 +2206,7 @@ static int parsecommand(void)
|
||||||
|
|
||||||
while (j>-1)
|
while (j>-1)
|
||||||
{
|
{
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr = 0;
|
*scriptptr = 0;
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
j--;
|
j--;
|
||||||
|
@ -2215,7 +2225,7 @@ static int parsecommand(void)
|
||||||
if ((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
|
if ((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
|
||||||
{
|
{
|
||||||
ReportError(-1);
|
ReportError(-1);
|
||||||
bitptr[(scriptptr-script-1)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script-1)>>3] &= ~(1<<((scriptptr-script-1)&7));
|
||||||
*(scriptptr-1) = 0;
|
*(scriptptr-1) = 0;
|
||||||
initprintf("%s:%d: warning: expected a move, found a constant.\n",compilefile,line_number);
|
initprintf("%s:%d: warning: expected a move, found a constant.\n",compilefile,line_number);
|
||||||
warning++;
|
warning++;
|
||||||
|
@ -2228,7 +2238,7 @@ static int parsecommand(void)
|
||||||
scriptptr--;
|
scriptptr--;
|
||||||
j |= *scriptptr;
|
j |= *scriptptr;
|
||||||
}
|
}
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr = j;
|
*scriptptr = j;
|
||||||
|
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
|
@ -2272,7 +2282,7 @@ static int parsecommand(void)
|
||||||
}
|
}
|
||||||
for (k=j;k>=0;k--)
|
for (k=j;k>=0;k--)
|
||||||
{
|
{
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr = 0;
|
*scriptptr = 0;
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
}
|
}
|
||||||
|
@ -2479,7 +2489,7 @@ static int parsecommand(void)
|
||||||
if ((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
|
if ((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
|
||||||
{
|
{
|
||||||
ReportError(-1);
|
ReportError(-1);
|
||||||
bitptr[(scriptptr-script-1)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script-1)>>3] &= ~(1<<((scriptptr-script-1)&7));
|
||||||
*(scriptptr-1) = 0;
|
*(scriptptr-1) = 0;
|
||||||
initprintf("%s:%d: warning: expected a move, found a constant.\n",compilefile,line_number);
|
initprintf("%s:%d: warning: expected a move, found a constant.\n",compilefile,line_number);
|
||||||
warning++;
|
warning++;
|
||||||
|
@ -2491,7 +2501,7 @@ static int parsecommand(void)
|
||||||
scriptptr--;
|
scriptptr--;
|
||||||
k |= *scriptptr;
|
k |= *scriptptr;
|
||||||
}
|
}
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr = k;
|
*scriptptr = k;
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2499,7 +2509,7 @@ static int parsecommand(void)
|
||||||
}
|
}
|
||||||
for (k=j;k<3;k++)
|
for (k=j;k<3;k++)
|
||||||
{
|
{
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr = 0;
|
*scriptptr = 0;
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
}
|
}
|
||||||
|
@ -2558,7 +2568,7 @@ static int parsecommand(void)
|
||||||
}
|
}
|
||||||
for (k=j;k>=0;k--)
|
for (k=j;k>=0;k--)
|
||||||
{
|
{
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr = 0;
|
*scriptptr = 0;
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
}
|
}
|
||||||
|
@ -2591,7 +2601,7 @@ static int parsecommand(void)
|
||||||
|
|
||||||
for (j=0;j<4;j++)
|
for (j=0;j<4;j++)
|
||||||
{
|
{
|
||||||
bitptr[(parsing_actor+j-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(parsing_actor+j-script)>>3] &= ~(1<<((parsing_actor+j-script)&7));
|
||||||
*(parsing_actor+j) = 0;
|
*(parsing_actor+j) = 0;
|
||||||
if (j == 3)
|
if (j == 3)
|
||||||
{
|
{
|
||||||
|
@ -2602,7 +2612,7 @@ static int parsecommand(void)
|
||||||
scriptptr--;
|
scriptptr--;
|
||||||
j |= *scriptptr;
|
j |= *scriptptr;
|
||||||
}
|
}
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr = j;
|
*scriptptr = j;
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
break;
|
break;
|
||||||
|
@ -2613,7 +2623,7 @@ static int parsecommand(void)
|
||||||
{
|
{
|
||||||
for (i=4-j; i; i--)
|
for (i=4-j; i; i--)
|
||||||
{
|
{
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*(scriptptr++) = 0;
|
*(scriptptr++) = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2630,17 +2640,16 @@ static int parsecommand(void)
|
||||||
if ((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
|
if ((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
|
||||||
{
|
{
|
||||||
ReportError(-1);
|
ReportError(-1);
|
||||||
bitptr[(scriptptr-script-1)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script-1)>>3] &= ~(1<<((scriptptr-script-1)&7));
|
||||||
*(scriptptr-1) = 0;
|
*(scriptptr-1) = 0;
|
||||||
initprintf("%s:%d: warning: expected a move, found a constant.\n",compilefile,line_number);
|
initprintf("%s:%d: warning: expected a move, found a constant.\n",compilefile,line_number);
|
||||||
warning++;
|
warning++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// bitptr[(parsing_actor+j-script)] = BITPTR_DONTFUCKWITHIT;
|
|
||||||
if (*(scriptptr-1) >= (intptr_t)&script[0] && *(scriptptr-1) < (intptr_t)&script[g_ScriptSize])
|
if (*(scriptptr-1) >= (intptr_t)&script[0] && *(scriptptr-1) < (intptr_t)&script[g_ScriptSize])
|
||||||
bitptr[(parsing_actor+j-script)] = BITPTR_POINTER;
|
bitptr[(parsing_actor+j-script)>>3] |= (BITPTR_POINTER<<((parsing_actor+j-script)&7));
|
||||||
else bitptr[(parsing_actor+j-script)] = BITPTR_DONTFUCKWITHIT;
|
else bitptr[(parsing_actor+j-script)>>3] &= ~(1<<((parsing_actor+j-script)&7));
|
||||||
*(parsing_actor+j) = *(scriptptr-1);
|
*(parsing_actor+j) = *(scriptptr-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2763,7 +2772,7 @@ static int parsecommand(void)
|
||||||
|
|
||||||
for (j=0;j<4;j++)
|
for (j=0;j<4;j++)
|
||||||
{
|
{
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*(parsing_actor+j) = 0;
|
*(parsing_actor+j) = 0;
|
||||||
if (j == 3)
|
if (j == 3)
|
||||||
{
|
{
|
||||||
|
@ -2774,7 +2783,7 @@ static int parsecommand(void)
|
||||||
scriptptr--;
|
scriptptr--;
|
||||||
j |= *scriptptr;
|
j |= *scriptptr;
|
||||||
}
|
}
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr = j;
|
*scriptptr = j;
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
break;
|
break;
|
||||||
|
@ -2785,7 +2794,7 @@ static int parsecommand(void)
|
||||||
{
|
{
|
||||||
for (i=4-j; i; i--)
|
for (i=4-j; i; i--)
|
||||||
{
|
{
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*(scriptptr++) = 0;
|
*(scriptptr++) = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2802,17 +2811,16 @@ static int parsecommand(void)
|
||||||
if ((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
|
if ((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
|
||||||
{
|
{
|
||||||
ReportError(-1);
|
ReportError(-1);
|
||||||
bitptr[(scriptptr-script-1)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script-1)>>3] &= ~(1<<((scriptptr-script-1)&7));
|
||||||
*(scriptptr-1) = 0;
|
*(scriptptr-1) = 0;
|
||||||
initprintf("%s:%d: warning: expected a move, found a constant.\n",compilefile,line_number);
|
initprintf("%s:%d: warning: expected a move, found a constant.\n",compilefile,line_number);
|
||||||
warning++;
|
warning++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// bitptr[(parsing_actor+j-script)] = BITPTR_DONTFUCKWITHIT;
|
|
||||||
if (*(scriptptr-1) >= (intptr_t)&script[0] && *(scriptptr-1) < (intptr_t)&script[g_ScriptSize])
|
if (*(scriptptr-1) >= (intptr_t)&script[0] && *(scriptptr-1) < (intptr_t)&script[g_ScriptSize])
|
||||||
bitptr[(parsing_actor+j-script)] = BITPTR_POINTER;
|
bitptr[(parsing_actor+j-script)>>3] |= (BITPTR_POINTER<<((parsing_actor+j-script)&7));
|
||||||
else bitptr[(parsing_actor+j-script)] = BITPTR_DONTFUCKWITHIT;
|
else bitptr[(parsing_actor+j-script)>>3] &= ~(1<<((parsing_actor+j-script)&7));
|
||||||
*(parsing_actor+j) = *(scriptptr-1);
|
*(parsing_actor+j) = *(scriptptr-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2839,7 +2847,7 @@ static int parsecommand(void)
|
||||||
|
|
||||||
while (j > -1)
|
while (j > -1)
|
||||||
{
|
{
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr = 0;
|
*scriptptr = 0;
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
j--;
|
j--;
|
||||||
|
@ -2941,7 +2949,7 @@ static int parsecommand(void)
|
||||||
parsecommand();
|
parsecommand();
|
||||||
tempscrptr = (intptr_t *)script+offset;
|
tempscrptr = (intptr_t *)script+offset;
|
||||||
*tempscrptr = (intptr_t) scriptptr;
|
*tempscrptr = (intptr_t) scriptptr;
|
||||||
bitptr[(tempscrptr-script)] = 1;
|
bitptr[(tempscrptr-script)>>3] |= (BITPTR_POINTER<<((tempscrptr-script)&7));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3006,7 +3014,7 @@ static int parsecommand(void)
|
||||||
ReportError(ERROR_SYMBOLNOTRECOGNIZED);
|
ReportError(ERROR_SYMBOLNOTRECOGNIZED);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=lLabelID;
|
*scriptptr++=lLabelID;
|
||||||
|
|
||||||
// now at target VAR...
|
// now at target VAR...
|
||||||
|
@ -3141,7 +3149,7 @@ static int parsecommand(void)
|
||||||
ReportError(ERROR_SYMBOLNOTRECOGNIZED);
|
ReportError(ERROR_SYMBOLNOTRECOGNIZED);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=lLabelID;
|
*scriptptr++=lLabelID;
|
||||||
|
|
||||||
// now at target VAR...
|
// now at target VAR...
|
||||||
|
@ -3209,7 +3217,7 @@ static int parsecommand(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=playerlabels[lLabelID].lId;
|
*scriptptr++=playerlabels[lLabelID].lId;
|
||||||
|
|
||||||
//printf("member's flags are: %02Xh\n",playerlabels[lLabelID].flags);
|
//printf("member's flags are: %02Xh\n",playerlabels[lLabelID].flags);
|
||||||
|
@ -3290,7 +3298,7 @@ static int parsecommand(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=inputlabels[lLabelID].lId;
|
*scriptptr++=inputlabels[lLabelID].lId;
|
||||||
|
|
||||||
// now at target VAR...
|
// now at target VAR...
|
||||||
|
@ -3340,7 +3348,7 @@ static int parsecommand(void)
|
||||||
ReportError(ERROR_SYMBOLNOTRECOGNIZED);
|
ReportError(ERROR_SYMBOLNOTRECOGNIZED);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=lLabelID;
|
*scriptptr++=lLabelID;
|
||||||
|
|
||||||
// now at target VAR...
|
// now at target VAR...
|
||||||
|
@ -3475,7 +3483,7 @@ static int parsecommand(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=i; // the ID of the DEF (offset into array...)
|
*scriptptr++=i; // the ID of the DEF (offset into array...)
|
||||||
|
|
||||||
switch (tw)
|
switch (tw)
|
||||||
|
@ -3546,7 +3554,7 @@ static int parsecommand(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=actorlabels[lLabelID].lId;
|
*scriptptr++=actorlabels[lLabelID].lId;
|
||||||
|
|
||||||
//printf("member's flags are: %02Xh\n",actorlabels[lLabelID].flags);
|
//printf("member's flags are: %02Xh\n",actorlabels[lLabelID].flags);
|
||||||
|
@ -3629,7 +3637,7 @@ static int parsecommand(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=tsprlabels[lLabelID].lId;
|
*scriptptr++=tsprlabels[lLabelID].lId;
|
||||||
|
|
||||||
//printf("member's flags are: %02Xh\n",actorlabels[lLabelID].flags);
|
//printf("member's flags are: %02Xh\n",actorlabels[lLabelID].flags);
|
||||||
|
@ -3756,7 +3764,7 @@ static int parsecommand(void)
|
||||||
i=GetADefID(label+(labelcnt<<6));
|
i=GetADefID(label+(labelcnt<<6));
|
||||||
if (i > (-1))
|
if (i > (-1))
|
||||||
{
|
{
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=i;
|
*scriptptr++=i;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3785,7 +3793,7 @@ static int parsecommand(void)
|
||||||
i=GetADefID(label+(labelcnt<<6));
|
i=GetADefID(label+(labelcnt<<6));
|
||||||
if (i > (-1))
|
if (i > (-1))
|
||||||
{
|
{
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=i;
|
*scriptptr++=i;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -4025,7 +4033,7 @@ static int parsecommand(void)
|
||||||
|
|
||||||
tempscrptr = (intptr_t *)script+offset;
|
tempscrptr = (intptr_t *)script+offset;
|
||||||
*tempscrptr = (intptr_t) scriptptr;
|
*tempscrptr = (intptr_t) scriptptr;
|
||||||
bitptr[(tempscrptr-script)] = 1;
|
bitptr[(tempscrptr-script)>>3] |= (BITPTR_POINTER<<((tempscrptr-script)&7));
|
||||||
|
|
||||||
if (tw != CON_WHILEVARVARN) checking_ifelse++;
|
if (tw != CON_WHILEVARVARN) checking_ifelse++;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -4070,7 +4078,7 @@ static int parsecommand(void)
|
||||||
|
|
||||||
tempscrptr = (intptr_t *)script+offset;
|
tempscrptr = (intptr_t *)script+offset;
|
||||||
*tempscrptr = (intptr_t) scriptptr;
|
*tempscrptr = (intptr_t) scriptptr;
|
||||||
bitptr[(tempscrptr-script)] = 1;
|
bitptr[(tempscrptr-script)>>3] |= (BITPTR_POINTER<<((tempscrptr-script)&7));
|
||||||
|
|
||||||
if (tw != CON_WHILEVARN) checking_ifelse++;
|
if (tw != CON_WHILEVARN) checking_ifelse++;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -4247,12 +4255,12 @@ static int parsecommand(void)
|
||||||
|
|
||||||
tempscrptr= scriptptr;
|
tempscrptr= scriptptr;
|
||||||
tempoffset = (unsigned)(tempscrptr-script);
|
tempoffset = (unsigned)(tempscrptr-script);
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=0; // leave spot for end location (for after processing)
|
*scriptptr++=0; // leave spot for end location (for after processing)
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=0; // count of case statements
|
*scriptptr++=0; // count of case statements
|
||||||
casescriptptr=scriptptr; // the first case's pointer.
|
casescriptptr=scriptptr; // the first case's pointer.
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=0; // leave spot for 'default' location (null if none)
|
*scriptptr++=0; // leave spot for 'default' location (null if none)
|
||||||
|
|
||||||
j = keyword();
|
j = keyword();
|
||||||
|
@ -4291,9 +4299,9 @@ static int parsecommand(void)
|
||||||
while (j--)
|
while (j--)
|
||||||
{
|
{
|
||||||
// leave room for statements
|
// leave room for statements
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=0; // value check
|
*scriptptr++=0; // value check
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=0; // code offset
|
*scriptptr++=0; // code offset
|
||||||
skipcomments();
|
skipcomments();
|
||||||
}
|
}
|
||||||
|
@ -4334,7 +4342,7 @@ static int parsecommand(void)
|
||||||
}
|
}
|
||||||
// for (j=3;j<3+tempscrptr[1]*2;j+=2)initprintf("%5d %8x\n",tempscrptr[j],tempscrptr[j+1]);
|
// for (j=3;j<3+tempscrptr[1]*2;j+=2)initprintf("%5d %8x\n",tempscrptr[j],tempscrptr[j+1]);
|
||||||
tempscrptr[0]= (intptr_t)scriptptr - (intptr_t)&script[0]; // save 'end' location
|
tempscrptr[0]= (intptr_t)scriptptr - (intptr_t)&script[0]; // save 'end' location
|
||||||
// bitptr[(tempscrptr-script)] = 1;
|
// bitptr[(tempscrptr-script)>>3] |= (BITPTR_POINTER<<((tempscrptr-script)&7));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -4443,7 +4451,7 @@ repeatcase:
|
||||||
if (casescriptptr)
|
if (casescriptptr)
|
||||||
{
|
{
|
||||||
casescriptptr[0]=(intptr_t)(scriptptr-&script[0]); // save offset
|
casescriptptr[0]=(intptr_t)(scriptptr-&script[0]); // save offset
|
||||||
// bitptr[(casescriptptr-script)] = 1;
|
// bitptr[(casescriptptr-script)>>3] |= (BITPTR_POINTER<<((casescriptptr-script)&7));
|
||||||
}
|
}
|
||||||
//Bsprintf(g_szBuf,"default: '%.22s'",textptr);
|
//Bsprintf(g_szBuf,"default: '%.22s'",textptr);
|
||||||
//AddLog(g_szBuf);
|
//AddLog(g_szBuf);
|
||||||
|
@ -4608,7 +4616,7 @@ repeatcase:
|
||||||
j |= *scriptptr;
|
j |= *scriptptr;
|
||||||
}
|
}
|
||||||
while (keyword() == -1);
|
while (keyword() == -1);
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr = j;
|
*scriptptr = j;
|
||||||
scriptptr++;
|
scriptptr++;
|
||||||
}
|
}
|
||||||
|
@ -4622,7 +4630,7 @@ repeatcase:
|
||||||
parsecommand();
|
parsecommand();
|
||||||
tempscrptr = (intptr_t *)script+offset;
|
tempscrptr = (intptr_t *)script+offset;
|
||||||
*tempscrptr = (intptr_t) scriptptr;
|
*tempscrptr = (intptr_t) scriptptr;
|
||||||
bitptr[(tempscrptr-script)] = 1;
|
bitptr[(tempscrptr-script)>>3] |= (BITPTR_POINTER<<((tempscrptr-script)&7));
|
||||||
|
|
||||||
checking_ifelse++;
|
checking_ifelse++;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -5080,7 +5088,7 @@ repeatcase:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*(redefined_quotes[redefined_quote_count]+i) = '\0';
|
*(redefined_quotes[redefined_quote_count]+i) = '\0';
|
||||||
bitptr[(scriptptr-script)] = BITPTR_DONTFUCKWITHIT;
|
bitptr[(scriptptr-script)>>3] &= ~(1<<((scriptptr-script)&7));
|
||||||
*scriptptr++=redefined_quote_count;
|
*scriptptr++=redefined_quote_count;
|
||||||
redefined_quote_count++;
|
redefined_quote_count++;
|
||||||
}
|
}
|
||||||
|
@ -5667,7 +5675,7 @@ void loadefs(const char *filenam)
|
||||||
Bfree(script);
|
Bfree(script);
|
||||||
|
|
||||||
script = Bcalloc(1,g_ScriptSize * sizeof(intptr_t));
|
script = Bcalloc(1,g_ScriptSize * sizeof(intptr_t));
|
||||||
bitptr = Bcalloc(1,g_ScriptSize * sizeof(char));
|
bitptr = Bcalloc(1,((g_ScriptSize+7)>>3) * sizeof(char));
|
||||||
// initprintf("script: %d, bitptr: %d\n",script,bitptr);
|
// initprintf("script: %d, bitptr: %d\n",script,bitptr);
|
||||||
|
|
||||||
labelcnt = defaultlabelcnt = 0;
|
labelcnt = defaultlabelcnt = 0;
|
||||||
|
@ -5764,6 +5772,7 @@ void loadefs(const char *filenam)
|
||||||
initprintf("Compile completed in %dms\n",getticks()-startcompiletime);
|
initprintf("Compile completed in %dms\n",getticks()-startcompiletime);
|
||||||
|
|
||||||
initprintf("Compiled code size: %ld*%d bytes, version %s\n",(unsigned)(scriptptr-script),sizeof(intptr_t),(g_ScriptVersion == 14?"1.4+":"1.3D"));
|
initprintf("Compiled code size: %ld*%d bytes, version %s\n",(unsigned)(scriptptr-script),sizeof(intptr_t),(g_ScriptVersion == 14?"1.4+":"1.3D"));
|
||||||
|
initprintf("Pointer bitmap size: %ld bytes\n",(g_ScriptSize+7)>>3);
|
||||||
initprintf("%ld/%ld labels, %d/%d variables\n",labelcnt,min((MAXSECTORS * sizeof(sectortype)/sizeof(int)),(MAXSPRITES * sizeof(spritetype)/(1<<6))),iGameVarCount,MAXGAMEVARS);
|
initprintf("%ld/%ld labels, %d/%d variables\n",labelcnt,min((MAXSECTORS * sizeof(sectortype)/sizeof(int)),(MAXSPRITES * sizeof(spritetype)/(1<<6))),iGameVarCount,MAXGAMEVARS);
|
||||||
|
|
||||||
for (i=MAXQUOTES-1;i>=0;i--)
|
for (i=MAXQUOTES-1;i>=0;i--)
|
||||||
|
|
|
@ -8,6 +8,9 @@ int osdhightile = 0;
|
||||||
void GAME_drawosdchar(int x, int y, char ch, int shade, int pal)
|
void GAME_drawosdchar(int x, int y, char ch, int shade, int pal)
|
||||||
{
|
{
|
||||||
short ac;
|
short ac;
|
||||||
|
#if !defined(POLYMOST) || !defined(USE_OPENGL)
|
||||||
|
int usehightile = 0;
|
||||||
|
#endif
|
||||||
int ht = usehightile;
|
int ht = usehightile;
|
||||||
|
|
||||||
if (ch == 32) return;
|
if (ch == 32) return;
|
||||||
|
@ -23,6 +26,9 @@ void GAME_drawosdstr(int x, int y, char *ch, int len, int shade, int pal)
|
||||||
short ac;
|
short ac;
|
||||||
char *ptr = OSD_GetTextPtr();
|
char *ptr = OSD_GetTextPtr();
|
||||||
char *fmt = OSD_GetFmtPtr();
|
char *fmt = OSD_GetFmtPtr();
|
||||||
|
#if !defined(POLYMOST) || !defined(USE_OPENGL)
|
||||||
|
int usehightile = 0;
|
||||||
|
#endif
|
||||||
int ht = usehightile;
|
int ht = usehightile;
|
||||||
|
|
||||||
usehightile = (osdhightile && ht);
|
usehightile = (osdhightile && ht);
|
||||||
|
|
|
@ -276,13 +276,13 @@ int loadplayer(int spot)
|
||||||
if (kdfread(&g_ScriptSize,sizeof(g_ScriptSize),1,fil) != 1) goto corrupt;
|
if (kdfread(&g_ScriptSize,sizeof(g_ScriptSize),1,fil) != 1) goto corrupt;
|
||||||
if (!g_ScriptSize) goto corrupt;
|
if (!g_ScriptSize) goto corrupt;
|
||||||
scriptptrs = Bcalloc(1,g_ScriptSize * sizeof(scriptptrs));
|
scriptptrs = Bcalloc(1,g_ScriptSize * sizeof(scriptptrs));
|
||||||
if (kdfread(&scriptptrs[0],sizeof(scriptptrs),g_ScriptSize,fil) != g_ScriptSize) goto corrupt;
|
if (kdfread(&bitptr[0],sizeof(bitptr),(g_ScriptSize+7)>>3,fil) != ((g_ScriptSize+7)>>3)) goto corrupt;
|
||||||
if (script != NULL)
|
if (script != NULL)
|
||||||
Bfree(script);
|
Bfree(script);
|
||||||
script = Bcalloc(1,g_ScriptSize * sizeof(intptr_t));
|
script = Bcalloc(1,g_ScriptSize * sizeof(intptr_t));
|
||||||
if (kdfread(&script[0],sizeof(script),g_ScriptSize,fil) != g_ScriptSize) goto corrupt;
|
if (kdfread(&script[0],sizeof(script),g_ScriptSize,fil) != g_ScriptSize) goto corrupt;
|
||||||
for (i=0;i<g_ScriptSize;i++)
|
for (i=0;i<g_ScriptSize;i++)
|
||||||
if (scriptptrs[i])
|
if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)))
|
||||||
{
|
{
|
||||||
j = (intptr_t)script[i]+(intptr_t)&script[0];
|
j = (intptr_t)script[i]+(intptr_t)&script[0];
|
||||||
script[i] = j;
|
script[i] = j;
|
||||||
|
@ -651,21 +651,21 @@ int saveplayer(int spot)
|
||||||
scriptptrs = Bcalloc(1, g_ScriptSize * sizeof(scriptptrs));
|
scriptptrs = Bcalloc(1, g_ScriptSize * sizeof(scriptptrs));
|
||||||
for (i=0;i<g_ScriptSize;i++)
|
for (i=0;i<g_ScriptSize;i++)
|
||||||
{
|
{
|
||||||
if (bitptr[i] == BITPTR_POINTER)
|
if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)))
|
||||||
// if ((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_ScriptSize]))
|
|
||||||
{
|
{
|
||||||
scriptptrs[i] = 1;
|
// scriptptrs[i] = 1;
|
||||||
j = (intptr_t)script[i] - (intptr_t)&script[0];
|
j = (intptr_t)script[i] - (intptr_t)&script[0];
|
||||||
script[i] = j;
|
script[i] = j;
|
||||||
}
|
}
|
||||||
else scriptptrs[i] = 0;
|
// else scriptptrs[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
dfwrite(&scriptptrs[0],sizeof(scriptptrs),g_ScriptSize,fil);
|
// dfwrite(&scriptptrs[0],sizeof(scriptptrs),g_ScriptSize,fil);
|
||||||
|
dfwrite(&bitptr[0],sizeof(bitptr),(g_ScriptSize+7)>>3,fil);
|
||||||
dfwrite(&script[0],sizeof(script),g_ScriptSize,fil);
|
dfwrite(&script[0],sizeof(script),g_ScriptSize,fil);
|
||||||
|
|
||||||
for (i=0;i<g_ScriptSize;i++)
|
for (i=0;i<g_ScriptSize;i++)
|
||||||
if (scriptptrs[i])
|
if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)))
|
||||||
{
|
{
|
||||||
j = script[i]+(intptr_t)&script[0];
|
j = script[i]+(intptr_t)&script[0];
|
||||||
script[i] = j;
|
script[i] = j;
|
||||||
|
|
|
@ -71,7 +71,9 @@ static int getfilenames(char *path)
|
||||||
#define POPULATE_GAME 4
|
#define POPULATE_GAME 4
|
||||||
#define POPULATE_GAMEDIRS 8
|
#define POPULATE_GAMEDIRS 8
|
||||||
|
|
||||||
|
#if defined(POLYMOST)
|
||||||
extern char TEXCACHEDIR[];
|
extern char TEXCACHEDIR[];
|
||||||
|
#endif
|
||||||
|
|
||||||
static void PopulateForm(int pgs)
|
static void PopulateForm(int pgs)
|
||||||
{
|
{
|
||||||
|
@ -186,7 +188,9 @@ static void PopulateForm(int pgs)
|
||||||
(void)ComboBox_SetCurSel(hwnd, j);
|
(void)ComboBox_SetCurSel(hwnd, j);
|
||||||
for (dirs=finddirs,i=1; dirs != NULL; dirs=dirs->next,i++)
|
for (dirs=finddirs,i=1; dirs != NULL; dirs=dirs->next,i++)
|
||||||
{
|
{
|
||||||
|
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||||
if (Bstrcasecmp(TEXCACHEDIR,dirs->name) == 0) continue;
|
if (Bstrcasecmp(TEXCACHEDIR,dirs->name) == 0) continue;
|
||||||
|
#endif
|
||||||
j = ComboBox_AddString(hwnd, dirs->name);
|
j = ComboBox_AddString(hwnd, dirs->name);
|
||||||
(void)ComboBox_SetItemData(hwnd, j, i);
|
(void)ComboBox_SetItemData(hwnd, j, i);
|
||||||
if (Bstrcasecmp(dirs->name,settings.gamedir) == 0)
|
if (Bstrcasecmp(dirs->name,settings.gamedir) == 0)
|
||||||
|
|
Loading…
Reference in a new issue