- hooked up the original CON parser for instruction-by-instruction substitution.

# Conflicts:
#	source/games/duke/src/zz_gamedef.cpp
This commit is contained in:
Christoph Oelckers 2020-05-12 15:39:35 +02:00
parent 358d1a460f
commit 3ab19a2f0d
7 changed files with 1832 additions and 316 deletions

File diff suppressed because it is too large Load diff

View file

@ -55,7 +55,7 @@ enum
do \
{ \
C_ReportError(-1); \
Printf("%s:%d: error: " Text "\n", g_scriptFileName, line_count, ##__VA_ARGS__); \
Printf("%s:%d: error: " Text "\n", g_scriptFileName, line_number, ##__VA_ARGS__); \
g_errorCnt++; \
} while (0)
@ -63,7 +63,7 @@ enum
do \
{ \
C_ReportError(-1); \
Printf("%s:%d: warning: " Text "\n", g_scriptFileName, line_count, ##__VA_ARGS__); \
Printf("%s:%d: warning: " Text "\n", g_scriptFileName, line_number, ##__VA_ARGS__); \
g_warningCnt++; \
} while (0)
@ -91,14 +91,14 @@ extern const uint32_t CheatFunctionFlags[];
extern const uint8_t CheatFunctionIDs[];
extern int32_t g_errorCnt;
extern int32_t line_count;
extern int32_t line_number;
extern int32_t g_scriptVersion;
extern int32_t g_totalLines;
extern int32_t g_warningCnt;
extern uint32_t g_scriptcrc;
extern int32_t otherp;
extern intptr_t *g_scriptPtr;
extern intptr_t *scriptptr;
typedef struct
{

View file

@ -64,7 +64,7 @@ G_EXTERN actor_t actor[MAXSPRITES];
// g_tile: tile-specific data THAT DOES NOT CHANGE during the course of a game
G_EXTERN tiledata_t g_tile[MAXTILES];
G_EXTERN animwalltype animwall[MAXANIMWALLS];
G_EXTERN char *label;
extern char *label;
G_EXTERN char g_loadFromGroupOnly;
G_EXTERN char g_skillCnt;
G_EXTERN char pus,pub;
@ -127,7 +127,7 @@ G_EXTERN int32_t g_globalRandom;
#define global_random g_globalRandom
G_EXTERN int32_t g_impactDamage;
#define impact_damage g_impactDamage
G_EXTERN int32_t g_labelCnt;
extern int32_t labelcnt;
G_EXTERN int32_t g_maxPlayerHealth;
G_EXTERN int32_t g_mirrorCount;
G_EXTERN int32_t g_mostConcurrentPlayers;
@ -200,7 +200,7 @@ G_EXTERN int16_t g_ambientHitag[64];
G_EXTERN uint32_t g_ambientCnt;
G_EXTERN intptr_t *apScript;
G_EXTERN intptr_t *g_scriptPtr;
G_EXTERN intptr_t *scriptptr;
G_EXTERN map_t g_mapInfo[(MAXVOLUMES + 1) * MAXLEVELS]; // +1 volume for "intro", "briefing" and "loading" music
G_EXTERN vec2_t g_origins[MAXANIMPOINTS];

View file

@ -6548,7 +6548,7 @@ static void G_CompileScripts(void)
C_Compile(G_ConFile());
if ((uint32_t)g_labelCnt > MAXSPRITES*sizeof(spritetype)/64) // see the arithmetic above for why
if ((uint32_t)labelcnt > MAXSPRITES*sizeof(spritetype)/64) // see the arithmetic above for why
G_GameExit("Error: too many labels defined!");
{
@ -6556,13 +6556,13 @@ static void G_CompileScripts(void)
int32_t *newlabelcode;
int32_t *newlabeltype;
newlabel = (char *)Xmalloc(g_labelCnt << 6);
newlabelcode = (int32_t *)Xmalloc(g_labelCnt * sizeof(int32_t));
newlabeltype = (int32_t *)Xmalloc(g_labelCnt * sizeof(int32_t));
newlabel = (char *)Xmalloc(labelcnt << 6);
newlabelcode = (int32_t *)Xmalloc(labelcnt * sizeof(int32_t));
newlabeltype = (int32_t *)Xmalloc(labelcnt * sizeof(int32_t));
Bmemcpy(newlabel, label, g_labelCnt*64);
Bmemcpy(newlabelcode, labelcode, g_labelCnt*sizeof(int32_t));
Bmemcpy(newlabeltype, labeltype, g_labelCnt*sizeof(int32_t));
Bmemcpy(newlabel, label, labelcnt*64);
Bmemcpy(newlabelcode, labelcode, labelcnt*sizeof(int32_t));
Bmemcpy(newlabeltype, labeltype, labelcnt*sizeof(int32_t));
label = newlabel;
labelcode = newlabelcode;

File diff suppressed because it is too large Load diff

View file

@ -275,7 +275,7 @@ void Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags)
{
g_errorCnt++;
C_ReportError(-1);
Printf("%s:%d: error: too many gamevars!\n",g_scriptFileName,line_count);
Printf("%s:%d: error: too many gamevars!\n",g_scriptFileName,line_number);
return;
}
@ -283,7 +283,7 @@ void Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags)
{
g_errorCnt++;
C_ReportError(-1);
Printf("%s:%d: error: variable name `%s' exceeds limit of %d characters.\n",g_scriptFileName,line_count,pszLabel, MAXVARLABEL);
Printf("%s:%d: error: variable name `%s' exceeds limit of %d characters.\n",g_scriptFileName,line_number,pszLabel, MAXVARLABEL);
return;
}
@ -295,7 +295,7 @@ void Gv_NewVar(const char *pszLabel, intptr_t lValue, uint32_t dwFlags)
if (EDUKE32_PREDICT_FALSE(aGameVars[gV].flags & (GAMEVAR_PTR_MASK)))
{
C_ReportError(-1);
Printf("%s:%d: warning: cannot redefine internal gamevar `%s'.\n",g_scriptFileName,line_count,label+(g_labelCnt<<6));
Printf("%s:%d: warning: cannot redefine internal gamevar `%s'.\n",g_scriptFileName,line_number,label+(labelcnt<<6));
return;
}
else if (EDUKE32_PREDICT_FALSE(!(aGameVars[gV].flags & GAMEVAR_SYSTEM)))

View file

@ -271,7 +271,7 @@ static int osdcmd_spawn(CCmdFuncPtr parm)
for (j=0; j<2; j++)
{
for (i=0; i<g_labelCnt; i++)
for (i=0; i<labelcnt; i++)
{
if ((j == 0 && !Bstrcmp(label+(i<<6), parm->parms[0])) ||
(j == 1 && !Bstrcasecmp(label+(i<<6), parm->parms[0])))
@ -281,10 +281,10 @@ static int osdcmd_spawn(CCmdFuncPtr parm)
}
}
if (i < g_labelCnt)
if (i < labelcnt)
break;
}
if (i==g_labelCnt)
if (i==labelcnt)
{
Printf("spawn: Invalid tile label given\n");
return OSDCMD_OK;
@ -425,7 +425,7 @@ static int osdcmd_printtimes(CCmdFuncPtr UNUSED(parm))
buf[0] = 0;
for (int ii=0; ii<g_labelCnt; ii++)
for (int ii=0; ii<labelcnt; ii++)
{
if (labelcode[ii] == i && labeltype[ii] & LABEL_ACTOR)
{