From 37bce2588fa494e24a052a78ebc589c548d98e25 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 23 Aug 2008 23:37:01 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1010 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/Makefile | 2 +- polymer/build/include/build.h | 1 + polymer/eduke32/Makefile | 2 +- polymer/eduke32/source/config.c | 12 +++-- polymer/eduke32/source/game.c | 10 +++-- polymer/eduke32/source/gamedef.c | 75 ++++++++++++++++++++------------ polymer/eduke32/source/gamedef.h | 6 +-- polymer/eduke32/source/premap.c | 1 + 8 files changed, 69 insertions(+), 40 deletions(-) diff --git a/polymer/build/Makefile b/polymer/build/Makefile index ff6b748ef..d63ef074d 100644 --- a/polymer/build/Makefile +++ b/polymer/build/Makefile @@ -55,7 +55,7 @@ asm=nasm # ifneq ($(RELEASE),0) # Debugging disabled - debug=-fomit-frame-pointer -ftree-vectorize -finline-small-functions -O$(OPTLEVEL) + debug=-fomit-frame-pointer -ftree-vectorize -finline-small-functions -fpredictive-commoning -funswitch-loops -O$(OPTLEVEL) else # Debugging enabled debug=-ggdb -O0 -DDEBUGGINGAIDS -DNOSDLPARACHUTE diff --git a/polymer/build/include/build.h b/polymer/build/include/build.h index 2c235264b..019527b03 100644 --- a/polymer/build/include/build.h +++ b/polymer/build/include/build.h @@ -185,6 +185,7 @@ typedef struct BPACK { #define SPREXT_NOMDANIM 2 #define SPREXT_AWAY1 4 #define SPREXT_AWAY2 8 +#define SPREXT_TSPRACCESS 16 EXTERN spriteexttype *spriteext; EXTERN spritesmoothtype *spritesmooth; diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index e48f51aa6..79e4df080 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -36,7 +36,7 @@ o=o ifneq (0,$(RELEASE)) # Debugging disabled - debug=-fomit-frame-pointer -ftree-vectorize -finline-small-functions -O$(OPTLEVEL) + debug=-fomit-frame-pointer -ftree-vectorize -finline-small-functions -fpredictive-commoning -funswitch-loops -O$(OPTLEVEL) else # Debugging enabled debug=-ggdb -O0 -DDEBUGGINGAIDS diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index fd64b7eaf..acf3f8640 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -652,8 +652,10 @@ int32 CONFIG_ReadSetup(void) SCRIPT_GetString(ud.config.scripthandle, "Setup","SelectedGRP",&duke3dgrp[0]); } -// if (mod_dir[0] == '/') -// SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]); +#ifdef _WIN32 + if (mod_dir[0] == '/') + SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]); +#endif SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Shadows",&ud.shadows); @@ -1120,7 +1122,11 @@ void CONFIG_WriteSetup(void) SCRIPT_PutString(ud.config.scripthandle, "Setup","SelectedGRP",&duke3dgrp[0]); -// SCRIPT_PutString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]); + +#ifdef _WIN32 + SCRIPT_PutString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]); +#endif + { char commmacro[] = "CommbatMacro# "; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 70167dbc2..ebf2dcf11 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -50,7 +50,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include extern int getversionfromwebsite(char *buffer); -#define BUILDDATE 20080822 // this is checked against http://eduke32.com/VERSION +#define BUILDDATE 20080823 // this is checked against http://eduke32.com/VERSION #define UPDATEINTERVAL 604800 // 1w #else static int usecwd = 0; @@ -7430,10 +7430,14 @@ PALONLY: if (sector[t->sectnum].floorpicnum == MIRROR) t->xrepeat = t->yrepeat = 0; } - for (j=0;j < spritesortcnt; j++) + for (j=spritesortcnt-1;j>=0; j--) { if (display_mirror) tsprite[j].statnum = TSPR_MIRROR; - OnEvent(EVENT_ANIMATESPRITES, j, myconnectindex, -1); + if (tsprite[j].owner > 0 && tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS) OnEvent(EVENT_ANIMATESPRITES, j, myconnectindex, -1); + { + OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1); + spriteext[tsprite[j].owner].tspr = NULL; + } } } #ifdef _MSC_VER diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 2ec63a0fd..b226c7a35 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -1823,9 +1823,9 @@ static int parsecommand(void) if (aGameVars[i].szLabel) if (Bstrcmp(label+(labelcnt<<6),aGameVars[i].szLabel) == 0) { - error++; - ReportError(ERROR_NAMEMATCHESVAR); - return 0; +// warning++; + ReportError(WARNING_NAMEMATCHESVAR); + break; } } @@ -2067,9 +2067,9 @@ static int parsecommand(void) if (aGameVars[i].szLabel) if (Bstrcmp(label+(labelcnt<<6),aGameVars[i].szLabel) == 0) { - error++; - ReportError(ERROR_NAMEMATCHESVAR); - return 0; +// warning++; + ReportError(WARNING_NAMEMATCHESVAR); + break; } } @@ -2100,9 +2100,9 @@ static int parsecommand(void) if (aGameVars[i].szLabel) if (Bstrcmp(label+(labelcnt<<6),aGameVars[i].szLabel) == 0) { - error++; - ReportError(ERROR_NAMEMATCHESVAR); - return 0; +// warning++; + ReportError(WARNING_NAMEMATCHESVAR); + break; } } @@ -2196,9 +2196,9 @@ static int parsecommand(void) if (aGameVars[i].szLabel) if (Bstrcmp(label+(labelcnt<<6),aGameVars[i].szLabel) == 0) { - error++; - ReportError(ERROR_NAMEMATCHESVAR); - return 0; +// warning++; + ReportError(WARNING_NAMEMATCHESVAR); + break; } } @@ -2400,9 +2400,9 @@ static int parsecommand(void) if (aGameVars[i].szLabel) if (Bstrcmp(label+(labelcnt<<6),aGameVars[i].szLabel) == 0) { - error++; - ReportError(ERROR_NAMEMATCHESVAR); - return 0; +// warning++; + ReportError(WARNING_NAMEMATCHESVAR); + break; } } @@ -2482,9 +2482,9 @@ static int parsecommand(void) if (aGameVars[i].szLabel) if (Bstrcmp(label+(labelcnt<<6),aGameVars[i].szLabel) == 0) { - error++; - ReportError(ERROR_NAMEMATCHESVAR); - return 0; +// warning++; + ReportError(WARNING_NAMEMATCHESVAR); + break; } } @@ -4708,10 +4708,27 @@ repeatcase: if (Bstrcmp(setupfilename,"duke3d.cfg") == 0) // not set to something else via -cfg { char temp[BMAX_PATH]; - j = Bmkdir(mod_dir, S_IRWXU); - if (j < 0 && errno != EEXIST) + struct stat st; + if (stat(mod_dir, &st) < 0) { - initprintf("Unable to create directory for configuration files...\n"); + if (errno == ENOENT) // path doesn't exist + { + if (Bmkdir(mod_dir, S_IRWXU) < 0) + { + OSD_Printf("Failed to create configuration file directory %s\n", mod_dir); + return 0; + } + else OSD_Printf("Created configuration file directory %s\n", mod_dir); + } + else + { + // another type of failure + return 0; + } + } + else if ((st.st_mode & S_IFDIR) != S_IFDIR) + { + // directory isn't a directory return 0; } Bstrcpy(temp,tempbuf); @@ -5718,9 +5735,6 @@ void ReportError(int iError) case ERROR_ISAKEYWORD: initprintf("%s:%d: error: symbol `%s' is a keyword.\n",compilefile,line_number,label+(labelcnt<<6)); break; - case ERROR_NAMEMATCHESVAR: - initprintf("%s:%d: error: symbol `%s' is a game variable.\n",compilefile,line_number,label+(labelcnt<<6)); - break; case ERROR_NOENDSWITCH: initprintf("%s:%d: error: did not find `endswitch' before `%s'.\n",compilefile,line_number,label+(labelcnt<<6)); break; @@ -5760,6 +5774,12 @@ void ReportError(int iError) case ERROR_VARTYPEMISMATCH: initprintf("%s:%d: error: variable `%s' is of the wrong type.\n",compilefile,line_number,label+(labelcnt<<6)); break; + case WARNING_BADGAMEVAR: + initprintf("%s:%ld: warning: variable `%s' should be either per-player OR per-actor, not both.\n",compilefile,line_number,label+(labelcnt<<6)); + break; + case WARNING_DUPLICATECASE: + initprintf("%s:%ld: warning: duplicate case ignored.\n",compilefile,line_number); + break; case WARNING_DUPLICATEDEFINITION: initprintf("%s:%d: warning: duplicate game definition `%s' ignored.\n",compilefile,line_number,label+(labelcnt<<6)); break; @@ -5769,11 +5789,8 @@ void ReportError(int iError) case WARNING_LABELSONLY: initprintf("%s:%d: warning: expected a label, found a constant.\n",compilefile,line_number); break; - case WARNING_BADGAMEVAR: - initprintf("%s:%ld: warning: variable `%s' should be either per-player OR per-actor, not both.\n",compilefile,line_number,label+(labelcnt<<6)); - break; - case WARNING_DUPLICATECASE: - initprintf("%s:%ld: warning: duplicate case ignored.\n",compilefile,line_number); + case WARNING_NAMEMATCHESVAR: + initprintf("%s:%d: warning: symbol `%s' is a game variable.\n",compilefile,line_number,label+(labelcnt<<6)); break; case WARNING_REVEVENTSYNC: initprintf("%s:%d: warning: found `%s' outside of a local event.\n",compilefile,line_number,tempbuf); diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index ab44a17b5..487b6a4e9 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -80,7 +80,6 @@ enum errors ERROR_EXPECTEDKEYWORD, ERROR_FOUNDWITHIN, ERROR_ISAKEYWORD, - ERROR_NAMEMATCHESVAR, ERROR_NOENDSWITCH, ERROR_NOTAGAMEDEF, ERROR_NOTAGAMEVAR, @@ -94,11 +93,12 @@ enum errors ERROR_SYNTAXERROR, ERROR_VARREADONLY, ERROR_VARTYPEMISMATCH, + WARNING_BADGAMEVAR, + WARNING_DUPLICATECASE, WARNING_DUPLICATEDEFINITION, WARNING_EVENTSYNC, WARNING_LABELSONLY, - WARNING_BADGAMEVAR, - WARNING_DUPLICATECASE, + WARNING_NAMEMATCHESVAR, WARNING_REVEVENTSYNC }; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index cde4b47d9..b235c2a95 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -273,6 +273,7 @@ static void cachegoodsprites(void) for (i=GROWSPARK; i