From 92ef761289d747b4a777e3d6d50a845e52f07cdb Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 31 Aug 2007 06:18:56 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@570 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/eduke32.vcproj | 432 ++++++++++++++++-------------- polymer/eduke32/source/actors.c | 11 +- polymer/eduke32/source/config.c | 1 + polymer/eduke32/source/duke3d.h | 2 +- polymer/eduke32/source/gamedef.c | 285 ++++++++++---------- polymer/eduke32/source/gameexec.c | 2 +- polymer/eduke32/source/savegame.c | 8 +- polymer/eduke32/source/sector.c | 2 +- 8 files changed, 378 insertions(+), 365 deletions(-) diff --git a/polymer/eduke32/eduke32.vcproj b/polymer/eduke32/eduke32.vcproj index 37a222f0b..c59604872 100644 --- a/polymer/eduke32/eduke32.vcproj +++ b/polymer/eduke32/eduke32.vcproj @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - @@ -533,42 +497,10 @@ RelativePath=".\source\jfaud_sounds.cpp" > - - - - - - - - - - - - - - - - @@ -581,10 +513,6 @@ RelativePath=".\source\osdfuncs.c" > - - @@ -601,18 +529,6 @@ RelativePath=".\source\savegame.c" > - - - - - - @@ -633,14 +549,6 @@ RelativePath=".\source\testcd.c" > - - - - @@ -653,70 +561,26 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -725,14 +589,6 @@ RelativePath=".\source\function.h" > - - - - @@ -745,54 +601,14 @@ RelativePath=".\source\grpscan.h" > - - - - - - - - - - - - - - - - - - - - @@ -809,26 +625,10 @@ RelativePath=".\source\osdfuncs.h" > - - - - - - - - @@ -837,12 +637,204 @@ RelativePath=".\source\sounds.h" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index ebeefec4b..67c84eff8 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -460,8 +460,9 @@ BOLT: int movesprite(int spritenum, long xchange, long ychange, long zchange, unsigned long cliptype) { - long daz,h, oldx, oldy; - short retval, dasectnum, cd; + long daz, oldx, oldy; + int retval; + short dasectnum, cd; int bg = badguy(&sprite[spritenum]); 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; - daz = sprite[spritenum].z; - h = ((tilesizy[sprite[spritenum].picnum]*sprite[spritenum].yrepeat)<<1); - daz -= h; + daz = sprite[spritenum].z - ((tilesizy[sprite[spritenum].picnum]*sprite[spritenum].yrepeat)<<1); if (bg) { @@ -1429,8 +1428,8 @@ static void movestandables(void) { if (s->owner==-2) { - spritesound(DUKE_GRUNT,g_player[p].ps->i); p = findplayer(s,&x); + spritesound(DUKE_GRUNT,g_player[p].ps->i); if (g_player[p].ps->on_crane == i) g_player[p].ps->on_crane = -1; } diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index a47ee3d29..f73839657 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -208,6 +208,7 @@ void CONFIG_SetDefaults(void) ud.automsg = 0; ud.autovote = 0; ud.brightness = 8; + ud.camerasprite = -1; ud.color = 0; ud.crosshair = 2; ud.deathmsgs = 1; diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 01d1f72f6..84d34d92b 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -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 HEAD2 "EDuke32"VERSION diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index ec8e7e93b..f00687a19 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -840,9 +840,10 @@ LABELS inputlabels[]= { "", -1, 0, 0 } // END OF LIST }; -static void skipcomments(void) +static int skipcomments(void) { char c; + int i,j; while ((c = *textptr)) { @@ -887,6 +888,120 @@ static void skipcomments(void) } 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= (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 (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= (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 63 || (*textptr == '\0') || (*(textptr+1) == '\0')) return 1; @@ -1608,7 +1615,8 @@ static int parsecommand(void) // Bsprintf(tempbuf,"%s",keyw[tw]); // AddLog(tempbuf); - skipcomments(); // yes? no? + if (skipcomments()) + return 1; switch (tw) { @@ -3653,7 +3661,9 @@ static int parsecommand(void) //AddLog("Counting Case Statements..."); 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); if (checking_switch>1) { @@ -3666,7 +3676,6 @@ static int parsecommand(void) } if (tempscrptr) { - tempscrptr = (long *)(script+tempoffset); tempscrptr[1]=(long)j; // save count of cases } else @@ -3695,7 +3704,7 @@ static int parsecommand(void) //Bsprintf(g_szBuf,"SWITCHXX: '%.22s'",textptr); //AddLog(g_szBuf); // 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); // AddLog(g_szBuf); @@ -3724,6 +3733,8 @@ static int parsecommand(void) break; case CON_CASE: + { + long tempoffset; //AddLog("Found Case"); repeatcase: scriptptr--; // don't save in code @@ -3765,6 +3776,7 @@ repeatcase: } //Bsprintf(g_szBuf,"case4: '%.12s'",textptr); //AddLog(g_szBuf); + tempoffset = (unsigned)(tempscrptr-script); while (parsecommand() == 0) { //Bsprintf(g_szBuf,"case5 '%.25s'",textptr); @@ -3774,12 +3786,15 @@ repeatcase: { //AddLog("Found Repeat Case"); transword(); // eat 'case' + tempscrptr = (long *)(script+tempoffset); goto repeatcase; } } + tempscrptr = (long *)(script+tempoffset); //AddLog("End Case"); return 0; // break; + } case CON_DEFAULT: scriptptr--; // don't save if (checking_switch<1) @@ -3819,30 +3834,6 @@ repeatcase: ReportError(-1); 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 break; @@ -4937,21 +4928,21 @@ void loadefs(const char *filenam) } else { - int j, k; + int j=0, k=0; total_lines += line_number; - for (i=j=0;i= 0) + if (snum >= 0 && snum < ud.multimode) { if (sector[SECT].lotag&16384) FTA(4,g_player[snum].ps);