git-svn-id: https://svn.eduke32.com/eduke32@570 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2007-08-31 06:18:56 +00:00
parent 93f6f0a33f
commit 92ef761289
8 changed files with 378 additions and 365 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8,00" Version="8.00"
Name="eduke32" Name="eduke32"
ProjectGUID="{8E7A6179-0B72-4073-8A4C-E8682D481DAE}" ProjectGUID="{8E7A6179-0B72-4073-8A4C-E8682D481DAE}"
RootNamespace="eduke32" RootNamespace="eduke32"
@ -461,50 +461,14 @@
RelativePath=".\source\anim.c" RelativePath=".\source\anim.c"
> >
</File> </File>
<File
RelativePath=".\source\jmact\animlib.c"
>
</File>
<File <File
RelativePath=".\source\astub.c" RelativePath=".\source\astub.c"
> >
</File> </File>
<File
RelativePath=".\source\jaudiolib\audiolib_fx_fmod.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\audiolib_fxstub.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\audiolib_musicstub.c"
>
</File>
<File <File
RelativePath=".\source\config.c" RelativePath=".\source\config.c"
> >
</File> </File>
<File
RelativePath=".\source\jmact\control.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\dsl.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\dsoundout.c"
>
</File>
<File
RelativePath=".\source\jmact\file_lib.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\fx_man.c"
>
</File>
<File <File
RelativePath=".\source\game.c" RelativePath=".\source\game.c"
> >
@ -533,42 +497,10 @@
RelativePath=".\source\jfaud_sounds.cpp" RelativePath=".\source\jfaud_sounds.cpp"
> >
</File> </File>
<File
RelativePath=".\source\jmact\keyboard.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\ll_man.c"
>
</File>
<File
RelativePath=".\source\jmact\mathutil.c"
>
</File>
<File <File
RelativePath=".\source\menus.c" RelativePath=".\source\menus.c"
> >
</File> </File>
<File
RelativePath=".\source\jaudiolib\midi.c"
>
</File>
<File
RelativePath=".\source\jmact\mouse.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\mpu401.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\multivoc.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\music.c"
>
</File>
<File <File
RelativePath=".\source\namesdyn.c" RelativePath=".\source\namesdyn.c"
> >
@ -581,10 +513,6 @@
RelativePath=".\source\osdfuncs.c" RelativePath=".\source\osdfuncs.c"
> >
</File> </File>
<File
RelativePath=".\source\jaudiolib\pitch.c"
>
</File>
<File <File
RelativePath=".\source\player.c" RelativePath=".\source\player.c"
> >
@ -601,18 +529,6 @@
RelativePath=".\source\savegame.c" RelativePath=".\source\savegame.c"
> >
</File> </File>
<File
RelativePath=".\source\jmact\scriplib.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\sdlmusic.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\sdlout.c"
>
</File>
<File <File
RelativePath=".\source\sector.c" RelativePath=".\source\sector.c"
> >
@ -633,14 +549,6 @@
RelativePath=".\source\testcd.c" RelativePath=".\source\testcd.c"
> >
</File> </File>
<File
RelativePath=".\source\jaudiolib\unixglob.c"
>
</File>
<File
RelativePath=".\source\jmact\util_lib.c"
>
</File>
<File <File
RelativePath=".\source\winbits.c" RelativePath=".\source\winbits.c"
> >
@ -653,70 +561,26 @@
<Filter <Filter
Name="Header Files" Name="Header Files"
> >
<File
RelativePath=".\source\jmact\_control.h"
>
</File>
<File <File
RelativePath=".\source\_functio.h" RelativePath=".\source\_functio.h"
> >
</File> </File>
<File
RelativePath=".\source\jaudiolib\_midi.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\_multivc.h"
>
</File>
<File <File
RelativePath=".\source\_rts.h" RelativePath=".\source\_rts.h"
> >
</File> </File>
<File
RelativePath=".\source\jmact\_scrplib.h"
>
</File>
<File
RelativePath=".\source\jmact\animlib.h"
>
</File>
<File <File
RelativePath=".\source\config.h" RelativePath=".\source\config.h"
> >
</File> </File>
<File
RelativePath=".\source\jmact\control.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\debugio.h"
>
</File>
<File
RelativePath=".\source\jmact\develop.h"
>
</File>
<File <File
RelativePath=".\source\develop.h" RelativePath=".\source\develop.h"
> >
</File> </File>
<File
RelativePath=".\source\jaudiolib\dsl.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\dsoundout.h"
>
</File>
<File <File
RelativePath=".\source\duke3d.h" RelativePath=".\source\duke3d.h"
> >
</File> </File>
<File
RelativePath=".\source\jmact\file_lib.h"
>
</File>
<File <File
RelativePath=".\source\funct.h" RelativePath=".\source\funct.h"
> >
@ -725,14 +589,6 @@
RelativePath=".\source\function.h" RelativePath=".\source\function.h"
> >
</File> </File>
<File
RelativePath=".\source\jaudiolib\fx_man.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\fx_man_fmod.h"
>
</File>
<File <File
RelativePath=".\source\gamedef.h" RelativePath=".\source\gamedef.h"
> >
@ -745,54 +601,14 @@
RelativePath=".\source\grpscan.h" RelativePath=".\source\grpscan.h"
> >
</File> </File>
<File
RelativePath=".\source\jaudiolib\interrup.h"
>
</File>
<File
RelativePath=".\source\jmact\keyboard.h"
>
</File>
<File <File
RelativePath=".\source\keys.h" RelativePath=".\source\keys.h"
> >
</File> </File>
<File
RelativePath=".\source\jaudiolib\linklist.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\ll_man.h"
>
</File>
<File <File
RelativePath=".\source\mapster32.h" RelativePath=".\source\mapster32.h"
> >
</File> </File>
<File
RelativePath=".\source\jmact\mathutil.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\midi.h"
>
</File>
<File
RelativePath=".\source\jmact\mouse.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\mpu401.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\multivoc.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\music.h"
>
</File>
<File <File
RelativePath=".\source\names.h" RelativePath=".\source\names.h"
> >
@ -809,26 +625,10 @@
RelativePath=".\source\osdfuncs.h" RelativePath=".\source\osdfuncs.h"
> >
</File> </File>
<File
RelativePath=".\source\jaudiolib\pitch.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\platform.h"
>
</File>
<File <File
RelativePath=".\source\rts.h" RelativePath=".\source\rts.h"
> >
</File> </File>
<File
RelativePath=".\source\jmact\scriplib.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\sdlout.h"
>
</File>
<File <File
RelativePath=".\source\soundefs.h" RelativePath=".\source\soundefs.h"
> >
@ -837,12 +637,204 @@
RelativePath=".\source\sounds.h" RelativePath=".\source\sounds.h"
> >
</File> </File>
<File
RelativePath=".\source\startwin.game.h"
>
</File>
<File
RelativePath=".\source\wtf.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="Audiolib"
>
<Filter
Name="Header Files"
>
<File
RelativePath=".\source\jaudiolib\_midi.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\_multivc.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\debugio.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\dsl.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\dsoundout.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\fx_man.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\fx_man_fmod.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\interrup.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\linklist.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\ll_man.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\midi.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\mpu401.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\multivoc.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\music.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\pitch.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\platform.h"
>
</File>
<File
RelativePath=".\source\jaudiolib\sdlout.h"
>
</File>
<File <File
RelativePath=".\source\jaudiolib\standard.h" RelativePath=".\source\jaudiolib\standard.h"
> >
</File> </File>
<File <File
RelativePath=".\source\startwin.game.h" RelativePath=".\source\jaudiolib\usrhooks.h"
>
</File>
</Filter>
<Filter
Name="Source Files"
>
<File
RelativePath=".\source\jaudiolib\audiolib_fx_fmod.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\audiolib_fxstub.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\audiolib_musicstub.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\dsl.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\dsoundout.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\fx_man.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\ll_man.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\midi.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\mpu401.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\multivoc.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\music.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\pitch.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\sdlmusic.c"
>
</File>
<File
RelativePath=".\source\jaudiolib\sdlout.c"
>
</File>
</Filter>
</Filter>
<Filter
Name="Mact"
>
<Filter
Name="Header Files"
>
<File
RelativePath=".\source\jmact\_control.h"
>
</File>
<File
RelativePath=".\source\jmact\_scrplib.h"
>
</File>
<File
RelativePath=".\source\jmact\animlib.h"
>
</File>
<File
RelativePath=".\source\jmact\control.h"
>
</File>
<File
RelativePath=".\source\jmact\develop.h"
>
</File>
<File
RelativePath=".\source\jmact\file_lib.h"
>
</File>
<File
RelativePath=".\source\jmact\keyboard.h"
>
</File>
<File
RelativePath=".\source\jmact\mathutil.h"
>
</File>
<File
RelativePath=".\source\jmact\mouse.h"
>
</File>
<File
RelativePath=".\source\jmact\scriplib.h"
> >
</File> </File>
<File <File
@ -850,11 +842,43 @@
> >
</File> </File>
<File <File
RelativePath=".\source\jaudiolib\usrhooks.h" RelativePath=".\source\jmact\util_lib.h"
>
</File>
</Filter>
<Filter
Name="Source Files"
>
<File
RelativePath=".\source\jmact\animlib.c"
> >
</File> </File>
<File <File
RelativePath=".\source\jmact\util_lib.h" RelativePath=".\source\jmact\control.c"
>
</File>
<File
RelativePath=".\source\jmact\file_lib.c"
>
</File>
<File
RelativePath=".\source\jmact\keyboard.c"
>
</File>
<File
RelativePath=".\source\jmact\mathutil.c"
>
</File>
<File
RelativePath=".\source\jmact\mouse.c"
>
</File>
<File
RelativePath=".\source\jmact\scriplib.c"
>
</File>
<File
RelativePath=".\source\jmact\util_lib.c"
> >
</File> </File>
</Filter> </Filter>

View file

@ -460,8 +460,9 @@ BOLT:
int movesprite(int spritenum, long xchange, long ychange, long zchange, unsigned long cliptype) int movesprite(int spritenum, long xchange, long ychange, long zchange, unsigned long cliptype)
{ {
long daz,h, oldx, oldy; long daz, oldx, oldy;
short retval, dasectnum, cd; int retval;
short dasectnum, cd;
int bg = badguy(&sprite[spritenum]); int bg = badguy(&sprite[spritenum]);
if (sprite[spritenum].statnum == 5 || (bg && sprite[spritenum].xrepeat < 4)) if (sprite[spritenum].statnum == 5 || (bg && sprite[spritenum].xrepeat < 4))
@ -476,9 +477,7 @@ int movesprite(int spritenum, long xchange, long ychange, long zchange, unsigned
dasectnum = sprite[spritenum].sectnum; dasectnum = sprite[spritenum].sectnum;
daz = sprite[spritenum].z; daz = sprite[spritenum].z - ((tilesizy[sprite[spritenum].picnum]*sprite[spritenum].yrepeat)<<1);
h = ((tilesizy[sprite[spritenum].picnum]*sprite[spritenum].yrepeat)<<1);
daz -= h;
if (bg) if (bg)
{ {
@ -1429,8 +1428,8 @@ static void movestandables(void)
{ {
if (s->owner==-2) if (s->owner==-2)
{ {
spritesound(DUKE_GRUNT,g_player[p].ps->i);
p = findplayer(s,&x); p = findplayer(s,&x);
spritesound(DUKE_GRUNT,g_player[p].ps->i);
if (g_player[p].ps->on_crane == i) if (g_player[p].ps->on_crane == i)
g_player[p].ps->on_crane = -1; g_player[p].ps->on_crane = -1;
} }

View file

@ -208,6 +208,7 @@ void CONFIG_SetDefaults(void)
ud.automsg = 0; ud.automsg = 0;
ud.autovote = 0; ud.autovote = 0;
ud.brightness = 8; ud.brightness = 8;
ud.camerasprite = -1;
ud.color = 0; ud.color = 0;
ud.crosshair = 2; ud.crosshair = 2;
ud.deathmsgs = 1; ud.deathmsgs = 1;

View file

@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#define VERSION " 1.4.0 rc1" #define VERSION " 1.4.0 svn"
#define HEAD "EDuke32"VERSION" (shareware mode)" #define HEAD "EDuke32"VERSION" (shareware mode)"
#define HEAD2 "EDuke32"VERSION #define HEAD2 "EDuke32"VERSION

View file

@ -840,9 +840,10 @@ LABELS inputlabels[]=
{ "", -1, 0, 0 } // END OF LIST { "", -1, 0, 0 } // END OF LIST
}; };
static void skipcomments(void) static int skipcomments(void)
{ {
char c; char c;
int i,j;
while ((c = *textptr)) while ((c = *textptr))
{ {
@ -887,6 +888,120 @@ static void skipcomments(void)
} }
else break; else break;
} }
if ((unsigned)(scriptptr-script) > (unsigned)(g_ScriptSize-32))
{
long oscriptptr = (unsigned)(scriptptr-script);
long ocasescriptptr = (unsigned)(casescriptptr-script);
long oparsing_event = (unsigned)(parsing_event-script);
long oparsing_actor = (unsigned)(parsing_actor-script);
char *scriptptrs;
long *newscript;
for (i=0;i<MAXSECTORS;i++)
{
if (labelcode[i] && labeltype[i] != LABEL_DEFINE)
{
labelcode[i] -= (long)&script[0];
}
}
scriptptrs = Bcalloc(1,g_ScriptSize * sizeof(char));
for (i=0;i<g_ScriptSize;i++)
{
// initprintf("%ld\n",i);
if ((long)script[i] >= (long)(&script[0]) && (long)script[i] < (long)(&script[g_ScriptSize]))
{
scriptptrs[i] = 1;
j = (long)script[i] - (long)&script[0];
script[i] = j;
}
else scriptptrs[i] = 0;
}
for (i=0;i<MAXTILES;i++)
if (actorscrptr[i])
{
j = (long)actorscrptr[i]-(long)&script[0];
actorscrptr[i] = (long *)j;
}
for (i=0;i<MAXTILES;i++)
if (actorLoadEventScrptr[i])
{
j = (long)actorLoadEventScrptr[i]-(long)&script[0];
actorLoadEventScrptr[i] = (long *)j;
}
for (i=0;i<MAXGAMEEVENTS;i++)
if (apScriptGameEvent[i])
{
j = (long)apScriptGameEvent[i]-(long)&script[0];
apScriptGameEvent[i] = (long *)j;
}
//initprintf("offset: %ld\n",(unsigned)(scriptptr-script));
g_ScriptSize += 16384;
initprintf("Increasing script buffer size to %ld bytes...\n",g_ScriptSize);
newscript = (long *)Brealloc(script, g_ScriptSize * sizeof(long));
if (newscript == NULL)
{
ReportError(-1);
initprintf("%s:%ld: out of memory: Aborted (%ud)\n",compilefile,line_number,(unsigned)(scriptptr-script));
initprintf(tempbuf);
error++;
return 1;
}
script = newscript;
scriptptr = (long *)(script+oscriptptr);
//initprintf("offset: %ld\n",(unsigned)(scriptptr-script));
if (casescriptptr != NULL)
casescriptptr = (long *)(script+ocasescriptptr);
if (parsing_event != NULL)
parsing_event = (long *)(script+oparsing_event);
if (parsing_actor != NULL)
parsing_actor = (long *)(script+oparsing_actor);
for (i=0;i<MAXSECTORS;i++)
{
if (labelcode[i] && labeltype[i] != LABEL_DEFINE)
{
labelcode[i] += (long)&script[0];
}
}
for (i=0;i<g_ScriptSize-16384;i++)
if (scriptptrs[i])
{
j = (long)script[i]+(long)&script[0];
script[i] = j;
}
for (i=0;i<MAXTILES;i++)
if (actorscrptr[i])
{
j = (long)actorscrptr[i]+(long)&script[0];
actorscrptr[i] = (long *)j;
}
for (i=0;i<MAXTILES;i++)
if (actorLoadEventScrptr[i])
{
j = (long)actorLoadEventScrptr[i]+(long)&script[0];
actorLoadEventScrptr[i] = (long *)j;
}
for (i=0;i<MAXGAMEEVENTS;i++)
if (apScriptGameEvent[i])
{
j = (long)apScriptGameEvent[i]+(long)&script[0];
apScriptGameEvent[i] = (long *)j;
}
Bfree(scriptptrs);
}
return 0;
} }
static void DefineProjectile(long lVar1, long lLabelID, long lVar2) static void DefineProjectile(long lVar1, long lLabelID, long lVar2)
@ -1444,8 +1559,9 @@ static long CountCaseStatements()
long lCount; long lCount;
char *temptextptr = textptr; char *temptextptr = textptr;
int temp_line_number = line_number; int temp_line_number = line_number;
long tempscriptptr = (unsigned)(scriptptr-script); long scriptoffset = (unsigned)(scriptptr-script);
long tempsavecase = (unsigned)(casescriptptr-script); long caseoffset = (unsigned)(casescriptptr-script);
int i;
casecount=0; casecount=0;
casescriptptr=NULL; casescriptptr=NULL;
@ -1461,13 +1577,14 @@ static long CountCaseStatements()
checking_switch++; checking_switch++;
textptr=temptextptr; textptr=temptextptr;
scriptptr = (long *)(script+tempscriptptr); scriptptr = (long *)(script+scriptoffset);
line_number = temp_line_number; line_number = temp_line_number;
lCount=casecount; lCount=casecount;
casecount=0; casecount=0;
casescriptptr = (long *)(script+tempsavecase); casescriptptr = (long *)(script+caseoffset);
casecount = 0;
return lCount; return lCount;
} }
@ -1477,122 +1594,12 @@ static int parsecommand(void)
char *temptextptr; char *temptextptr;
long *tempscrptr; long *tempscrptr;
#if (defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2))
if (quitevent) if (quitevent)
{ {
initprintf("Aborted.\n"); initprintf("Aborted.\n");
Shutdown(); Shutdown();
exit(0); exit(0);
} }
#endif
if ((unsigned)(scriptptr-script) > (unsigned)(g_ScriptSize-128))
{
long oscriptptr = (unsigned)(scriptptr-script);
long ocasescriptptr = (unsigned)(casescriptptr-script);
long oparsing_event = (unsigned)(parsing_event-script);
long oparsing_actor = (unsigned)(parsing_actor-script);
long *scriptptrs;
for (i=0;i<MAXSECTORS;i++)
{
if (labelcode[i] && labeltype[i] != LABEL_DEFINE)
{
labelcode[i] -= (long)&script[0];
}
}
scriptptrs = Bcalloc(1,g_ScriptSize * sizeof(long));
for (i=0;i<g_ScriptSize-1;i++)
{
if ((long)script[i] >= (long)(&script[0]) && (long)script[i] < (long)(&script[g_ScriptSize]))
{
scriptptrs[i] = 1;
j = (long)script[i] - (long)&script[0];
script[i] = j;
}
else scriptptrs[i] = 0;
}
for (i=0;i<MAXTILES;i++)
if (actorscrptr[i])
{
j = (long)actorscrptr[i]-(long)&script[0];
actorscrptr[i] = (long *)j;
}
for (i=0;i<MAXTILES;i++)
if (actorLoadEventScrptr[i])
{
j = (long)actorLoadEventScrptr[i]-(long)&script[0];
actorLoadEventScrptr[i] = (long *)j;
}
for (i=0;i<MAXGAMEEVENTS;i++)
if (apScriptGameEvent[i])
{
j = (long)apScriptGameEvent[i]-(long)&script[0];
apScriptGameEvent[i] = (long *)j;
}
//initprintf("offset: %ld\n",(unsigned)(scriptptr-script));
g_ScriptSize += 16384;
initprintf("Increasing script buffer size to %ld bytes...\n",g_ScriptSize);
script = (long *)realloc(script, g_ScriptSize * sizeof(long));
if (script == NULL)
{
ReportError(-1);
initprintf("%s:%ld: out of memory: Aborted (%ud)\n",compilefile,line_number,(unsigned)(scriptptr-script));
initprintf(tempbuf);
error++;
return 1;
}
scriptptr = (long *)(script+oscriptptr);
//initprintf("offset: %ld\n",(unsigned)(scriptptr-script));
if (casescriptptr != NULL)
casescriptptr = (long *)(script+ocasescriptptr);
if (parsing_event != NULL)
parsing_event = (long *)(script+oparsing_event);
if (parsing_actor != NULL)
parsing_actor = (long *)(script+oparsing_actor);
for (i=0;i<MAXSECTORS;i++)
{
if (labelcode[i] && labeltype[i] != LABEL_DEFINE)
{
labelcode[i] += (long)&script[0];
}
}
for (i=0;i<g_ScriptSize-16384;i++)
if (scriptptrs[i])
{
j = (long)script[i]+(long)&script[0];
script[i] = j;
}
for (i=0;i<MAXTILES;i++)
if (actorscrptr[i])
{
j = (long)actorscrptr[i]+(long)&script[0];
actorscrptr[i] = (long *)j;
}
for (i=0;i<MAXTILES;i++)
if (actorLoadEventScrptr[i])
{
j = (long)actorLoadEventScrptr[i]+(long)&script[0];
actorLoadEventScrptr[i] = (long *)j;
}
for (i=0;i<MAXGAMEEVENTS;i++)
if (apScriptGameEvent[i])
{
j = (long)apScriptGameEvent[i]+(long)&script[0];
apScriptGameEvent[i] = (long *)j;
}
Bfree(scriptptrs);
}
if ((error+warning) > 63 || (*textptr == '\0') || (*(textptr+1) == '\0')) return 1; if ((error+warning) > 63 || (*textptr == '\0') || (*(textptr+1) == '\0')) return 1;
@ -1608,7 +1615,8 @@ static int parsecommand(void)
// Bsprintf(tempbuf,"%s",keyw[tw]); // Bsprintf(tempbuf,"%s",keyw[tw]);
// AddLog(tempbuf); // AddLog(tempbuf);
skipcomments(); // yes? no? if (skipcomments())
return 1;
switch (tw) switch (tw)
{ {
@ -3653,7 +3661,9 @@ static int parsecommand(void)
//AddLog("Counting Case Statements..."); //AddLog("Counting Case Statements...");
j=CountCaseStatements(); j=CountCaseStatements();
//Bsprintf(g_szBuf,"Done Counting Case Statements: found %d.", j); // initprintf("Done Counting Case Statements for switch %d: found %d.\n", checking_switch,j);
tempscrptr = (long *)(script+tempoffset);
//AddLog(g_szBuf); //AddLog(g_szBuf);
if (checking_switch>1) if (checking_switch>1)
{ {
@ -3666,7 +3676,6 @@ static int parsecommand(void)
} }
if (tempscrptr) if (tempscrptr)
{ {
tempscrptr = (long *)(script+tempoffset);
tempscrptr[1]=(long)j; // save count of cases tempscrptr[1]=(long)j; // save count of cases
} }
else else
@ -3695,7 +3704,7 @@ static int parsecommand(void)
//Bsprintf(g_szBuf,"SWITCHXX: '%.22s'",textptr); //Bsprintf(g_szBuf,"SWITCHXX: '%.22s'",textptr);
//AddLog(g_szBuf); //AddLog(g_szBuf);
// done processing switch. clean up. // done processing switch. clean up.
if (checking_switch!=1) if (checking_switch<1)
{ {
// Bsprintf(g_szBuf,"ERROR::%s %d: Checking_switch=%d",__FILE__,__LINE__, checking_switch); // Bsprintf(g_szBuf,"ERROR::%s %d: Checking_switch=%d",__FILE__,__LINE__, checking_switch);
// AddLog(g_szBuf); // AddLog(g_szBuf);
@ -3724,6 +3733,8 @@ static int parsecommand(void)
break; break;
case CON_CASE: case CON_CASE:
{
long tempoffset;
//AddLog("Found Case"); //AddLog("Found Case");
repeatcase: repeatcase:
scriptptr--; // don't save in code scriptptr--; // don't save in code
@ -3765,6 +3776,7 @@ repeatcase:
} }
//Bsprintf(g_szBuf,"case4: '%.12s'",textptr); //Bsprintf(g_szBuf,"case4: '%.12s'",textptr);
//AddLog(g_szBuf); //AddLog(g_szBuf);
tempoffset = (unsigned)(tempscrptr-script);
while (parsecommand() == 0) while (parsecommand() == 0)
{ {
//Bsprintf(g_szBuf,"case5 '%.25s'",textptr); //Bsprintf(g_szBuf,"case5 '%.25s'",textptr);
@ -3774,12 +3786,15 @@ repeatcase:
{ {
//AddLog("Found Repeat Case"); //AddLog("Found Repeat Case");
transword(); // eat 'case' transword(); // eat 'case'
tempscrptr = (long *)(script+tempoffset);
goto repeatcase; goto repeatcase;
} }
} }
tempscrptr = (long *)(script+tempoffset);
//AddLog("End Case"); //AddLog("End Case");
return 0; return 0;
// break; // break;
}
case CON_DEFAULT: case CON_DEFAULT:
scriptptr--; // don't save scriptptr--; // don't save
if (checking_switch<1) if (checking_switch<1)
@ -3819,30 +3834,6 @@ repeatcase:
ReportError(-1); ReportError(-1);
initprintf("%s:%ld: error: found `endswitch' without matching `switch'\n",compilefile,line_number); initprintf("%s:%ld: error: found `endswitch' without matching `switch'\n",compilefile,line_number);
} }
if (casescriptptr)
{
int i;
//Bsprintf(g_szBuf,"Default Offset is %ld\n Total of %ld cases",casescriptptr[0],(long)casecount/2);
//AddLog(g_szBuf);
for (i=1;i<=casecount;i++)
{
if (i & 1)
{
//Bsprintf(g_szBuf,"Case Value %d is %ld",i/2+1,casescriptptr[i]);
//AddLog(g_szBuf);
}
else
{
//Bsprintf(g_szBuf,"Offset %d is %ld",i/2+1,casescriptptr[i]);
//AddLog(g_szBuf);
}
}
}
else
{
//AddLog("Not saving case value: just counting");
}
return 1; // end of block return 1; // end of block
break; break;
@ -4937,21 +4928,21 @@ void loadefs(const char *filenam)
} }
else else
{ {
int j, k; int j=0, k=0;
total_lines += line_number; total_lines += line_number;
for (i=j=0;i<MAXGAMEEVENTS;i++) for (i=0;i<MAXGAMEEVENTS;i++)
{ {
if (apScriptGameEvent[i]) if (apScriptGameEvent[i])
j++; j++;
} }
for (i=k=0;i<MAXTILES;i++) for (i=0;i<MAXTILES;i++)
{ {
if (actorscrptr[i]) if (actorscrptr[i])
k++; k++;
} }
initprintf("\nCompiled code size: %ld/%ld bytes\n",(unsigned)(scriptptr-script),g_ScriptSize); initprintf("\nCompiled code size: %ld bytes\n",(unsigned)(scriptptr-script));
initprintf("%ld/%ld labels, %d/%d variables\n",labelcnt,min((sizeof(sector)/sizeof(long)),(sizeof(sprite)/(1<<6))),iGameVarCount,MAXGAMEVARS); initprintf("%ld/%ld labels, %d/%d variables\n",labelcnt,min((sizeof(sector)/sizeof(long)),(sizeof(sprite)/(1<<6))),iGameVarCount,MAXGAMEVARS);
initprintf("%ld event definitions, %ld defined actors\n\n",j,k); initprintf("%ld event definitions, %ld defined actors\n\n",j,k);

View file

@ -4428,7 +4428,7 @@ static int parse(void)
// script offset to default case (null if none) // script offset to default case (null if none)
// For each case: value, ptr to code // For each case: value, ptr to code
//AddLog("Processing Switch..."); //AddLog("Processing Switch...");
long lVarID=*insptr++, lValue=GetGameVarID(lVarID, g_i, g_p), lEnd=*insptr++, lCases=*insptr++; long lValue=GetGameVarID(*insptr++, g_i, g_p), lEnd=*insptr++, lCases=*insptr++;
long *lpDefault=insptr++, *lpCases=insptr, bMatched=0, *lTempInsPtr, lCheckCase; long *lpDefault=insptr++, *lpCases=insptr, bMatched=0, *lTempInsPtr, lCheckCase;
insptr+=lCases*2; insptr+=lCases*2;
lTempInsPtr=insptr; lTempInsPtr=insptr;

View file

@ -123,8 +123,7 @@ int loadplayer(int spot)
int k; int k;
char fn[13]; char fn[13];
char mpfn[13]; char mpfn[13];
char *fnptr; char *fnptr, *scriptptrs;
long *scriptptrs;
long fil, bv, i, j, x; long fil, bv, i, j, x;
int32 nump; int32 nump;
@ -265,7 +264,7 @@ int loadplayer(int spot)
if (kdfread(&cloudy[0],sizeof(short)<<7,1,fil) != 1) goto corrupt; if (kdfread(&cloudy[0],sizeof(short)<<7,1,fil) != 1) goto corrupt;
if (kdfread(&g_ScriptSize,sizeof(g_ScriptSize),1,fil) != 1) goto corrupt; if (kdfread(&g_ScriptSize,sizeof(g_ScriptSize),1,fil) != 1) goto corrupt;
scriptptrs = Bcalloc(1,g_ScriptSize * sizeof(g_ScriptSize)); scriptptrs = Bcalloc(1,g_ScriptSize * sizeof(scriptptrs));
if (kdfread(&scriptptrs[0],sizeof(scriptptrs),g_ScriptSize,fil) != g_ScriptSize) goto corrupt; if (kdfread(&scriptptrs[0],sizeof(scriptptrs),g_ScriptSize,fil) != g_ScriptSize) goto corrupt;
if (script != NULL) if (script != NULL)
Bfree(script); Bfree(script);
@ -521,8 +520,7 @@ int saveplayer(int spot)
long i, j; long i, j;
char fn[13]; char fn[13];
char mpfn[13]; char mpfn[13];
char *fnptr; char *fnptr, *scriptptrs;
long *scriptptrs;
FILE *fil; FILE *fil;
long bv = BYTEVERSION; long bv = BYTEVERSION;

View file

@ -1030,7 +1030,7 @@ void operateactivators(int low,int snum)
else else
sector[SECT].lotag |= 16384; sector[SECT].lotag |= 16384;
if (snum >= 0) if (snum >= 0 && snum < ud.multimode)
{ {
if (sector[SECT].lotag&16384) if (sector[SECT].lotag&16384)
FTA(4,g_player[snum].ps); FTA(4,g_player[snum].ps);