diff --git a/polymer/build/src/build.c b/polymer/build/src/build.c index 5e5bf2db7..3ec9726c5 100644 --- a/polymer/build/src/build.c +++ b/polymer/build/src/build.c @@ -5714,6 +5714,7 @@ void overheadeditor(void) { if ((keystatus[0x1d]|keystatus[0x9d]) > 0) //Ctrl { +nextmap: // bad = 0; i = menuselect_pk(keystatus[0x2a]>0 ? 0:1); // Left Shift: prev map if (i < 0) @@ -5744,7 +5745,8 @@ void overheadeditor(void) oposz = posz; if (i < 0) { - printmessage16("Invalid map format."); +// printmessage16("Invalid map format."); + goto nextmap; } else { diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index ddeeb5816..2eee58c5b 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -2888,7 +2888,7 @@ void drawtileinfo(char *title,int x,int y,int picnum,int shade,int pal,int cstat { char buf[64]; int i,j; - int scale=65526; + int scale=65536; int x1; j = xdimgame>640?0:1; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 125056505..5b60e8ec4 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -4070,9 +4070,9 @@ void displayrooms(int snum,int smoothratio) #endif if (((gotpic[MIRROR>>3]&(1<<(MIRROR&7))) > 0) #if defined(POLYMOST) && defined(USE_OPENGL) - && (rendmode != 4) + && (rendmode != 4) #endif - ) + ) { dst = 0x7fffffff; i = 0; @@ -8285,7 +8285,7 @@ static void comlinehelp(void) "-xFILE\t\tLoad CON script FILE (default EDUKE.CON/GAME.CON)\n" "-zNUM,\n-condebug\tLine-by-line CON compilation debugging, NUM is verbosity\n" "\n-?, -help\tDisplay this help message and exit" -; + ; #if defined RENDERTYPEWIN wm_msgbox(HEAD2,s); #else diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 2fd98fc76..db31da0ac 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -453,6 +453,8 @@ static const char *keyw[] = "starttrackvar", // 321 "qgetsysstr", // 322 "getticks", // 323 + "gettspr", // 324 + "settspr", // 325 "" }; @@ -564,6 +566,11 @@ const memberlabel_t actorlabels[]= { "xpanning", ACTOR_XPANNING, 0, 0 }, { "ypanning", ACTOR_YPANNING, 0, 0 }, + { "", -1, 0, 0 } // END OF LIST +}; + +const memberlabel_t tsprlabels[]= +{ // tsprite access { "tsprx", ACTOR_TSPRX, 0, 0 }, @@ -3303,6 +3310,76 @@ static int parsecommand(void) break; } + case CON_GETTSPR: + case CON_SETTSPR: + { + int lLabelID; + + if (current_event != EVENT_ANIMATESPRITES) + { + ReportError(-1); + initprintf("%s:%d: warning: found `%s' outside of EVENT_ANIMATESPRITES\n",compilefile,line_number,tempbuf); + } + + // syntax getwall[].x + // gets the value of wall[].xxx into + + // now get name of .xxx + while ((*textptr != '[')) + { + textptr++; + } + if (*textptr == '[') + textptr++; + + // get the ID of the DEF +// labelsonly = 1; + transvar(); + labelsonly = 0; + // now get name of .xxx + while (*textptr != '.') + { + if (*textptr == 0xa) + break; + if (!*textptr) + break; + + textptr++; + } + if (*textptr!='.') + { + error++; + ReportError(ERROR_SYNTAXERROR); + return 0; + } + textptr++; + /// now pointing at 'xxx' + getlabel(); + //printf("found xxx label of '%s'\n", label+(labelcnt<<6)); + + lLabelID=getlabeloffset(tsprlabels,label+(labelcnt<<6)); + //printf("LabelID is %d\n",lLabelID); + if (lLabelID == -1) + { + error++; + ReportError(ERROR_SYMBOLNOTRECOGNIZED); + return 0; + } + + *scriptptr++=tsprlabels[lLabelID].lId; + + //printf("member's flags are: %02Xh\n",actorlabels[lLabelID].flags); + + // now at target VAR... + + // get the ID of the DEF + if (tw == CON_GETTSPR) + transvartype(GAMEVAR_FLAG_READONLY); + else + transvar(); + break; + } + case CON_GETTICKS: if (CheckEventSync(current_event)) ReportError(WARNING_REVEVENTSYNC); @@ -5193,10 +5270,10 @@ void loadefs(const char *filenam) loadfromgrouponly = 1; return; } - else + else { #if (defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2)) - while(!quitevent) // keep the window open so people can copy CON errors out of it + while (!quitevent) // keep the window open so people can copy CON errors out of it handleevents(); #endif gameexit(""); diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index eb0fcc8b6..6212b3644 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -443,6 +443,10 @@ enum actorlabels ACTOR_MDFLAGS, ACTOR_XPANNING, ACTOR_YPANNING, +}; + +enum tsprlabels +{ ACTOR_TSPRX, ACTOR_TSPRY, ACTOR_TSPRZ, @@ -825,5 +829,7 @@ enum keywords CON_READARRAYFROMFILE, // 320 CON_STARTTRACKVAR, // 321 CON_QGETSYSSTR, // 322 - CON_GETTICKS // 323 + CON_GETTICKS, // 323 + CON_GETTSPR, // 324 + CON_SETTSPR, // 325 }; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 836c351f9..4f19e5ef3 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -3433,6 +3433,30 @@ static void DoActor(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) SetGameVarID(lVar2, spriteext[iActor].ypanning,g_i,g_p); return; + default: + return; + } +} + +static void DoTsprite(int iSet, int lVar1, int lLabelID, int lVar2) +{ + int lValue; + int iActor=g_i; + + if (lVar1 != g_iThisActorID) + iActor=GetGameVarID(lVar1, g_i, g_p); + + if (iActor < 0 || iActor >= MAXSPRITES) + { + OSD_Printf("DoTsprite(): invalid target sprite (%d) %d %d\n",iActor,g_i,g_sp->picnum); + insptr += (lVar2 == MAXGAMEVARS); + return; + } + + lValue=GetGameVarID(lVar2, g_i, g_p); + + switch (lLabelID) + { case ACTOR_TSPRX: if (!spriteext[iActor].tspr) return; @@ -5750,9 +5774,9 @@ static int parse(void) #endif if (((gotpic[MIRROR>>3]&(1<<(MIRROR&7))) > 0) #if defined(POLYMOST) && defined(USE_OPENGL) - && (rendmode != 4) + && (rendmode != 4) #endif - ) + ) { int j, i = 0, k, dst = 0x7fffffff; @@ -6920,6 +6944,21 @@ static int parse(void) break; } + case CON_SETTSPR: + case CON_GETTSPR: + insptr++; + { + // syntax [gs]etactor[].x + // + + int lVar1=*insptr++, lLabelID=*insptr++, lVar2; + + lVar2=*insptr++; + + DoTsprite(tw==CON_SETTSPR, lVar1, lLabelID, lVar2); + break; + } + case CON_GETANGLETOTARGET: insptr++; // hittype[g_i].lastvx and lastvy are last known location of target.