CON: #ifdef out deactivated stuff that should not be half-in, half-out

git-svn-id: https://svn.eduke32.com/eduke32@7355 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-02-28 07:21:37 +00:00
parent f84cbd9a1a
commit 328e771636
3 changed files with 24 additions and 6 deletions

View file

@ -708,6 +708,7 @@ static const vec2_t globalvartable[] =
{ CON_XORVAR, CON_XORVAR_GLOBAL }, { CON_XORVAR, CON_XORVAR_GLOBAL },
}; };
#ifdef INCOMPLETE_STRUCT_ACCESS
static const vec2_t playervartable[] = static const vec2_t playervartable[] =
{ {
{ CON_IFVARA, CON_IFVARA_PLAYER }, { CON_IFVARA, CON_IFVARA_PLAYER },
@ -775,17 +776,22 @@ static const vec2_t actorvartable[] =
{ CON_SUBVAR, CON_SUBVAR_ACTOR }, { CON_SUBVAR, CON_SUBVAR_ACTOR },
{ CON_XORVAR, CON_XORVAR_ACTOR }, { CON_XORVAR, CON_XORVAR_ACTOR },
}; };
#endif
static inthashtable_t h_varvar = { NULL, INTHASH_SIZE(ARRAY_SIZE(varvartable)) }; static inthashtable_t h_varvar = { NULL, INTHASH_SIZE(ARRAY_SIZE(varvartable)) };
static inthashtable_t h_globalvar = { NULL, INTHASH_SIZE(ARRAY_SIZE(globalvartable)) }; static inthashtable_t h_globalvar = { NULL, INTHASH_SIZE(ARRAY_SIZE(globalvartable)) };
#ifdef INCOMPLETE_STRUCT_ACCESS
static inthashtable_t h_playervar = { NULL, INTHASH_SIZE(ARRAY_SIZE(playervartable)) }; static inthashtable_t h_playervar = { NULL, INTHASH_SIZE(ARRAY_SIZE(playervartable)) };
static inthashtable_t h_actorvar = { NULL, INTHASH_SIZE(ARRAY_SIZE(actorvartable)) }; static inthashtable_t h_actorvar = { NULL, INTHASH_SIZE(ARRAY_SIZE(actorvartable)) };
#endif
static inthashtable_t *const inttables[] = { static inthashtable_t *const inttables[] = {
&h_varvar, &h_varvar,
&h_globalvar, &h_globalvar,
#ifdef INCOMPLETE_STRUCT_ACCESS
&h_playervar, &h_playervar,
&h_actorvar, &h_actorvar,
#endif
}; };
@ -2453,14 +2459,14 @@ static void scriptUpdateOpcodeForVariableType(intptr_t *ins)
case 0: case 0:
opcode = inthash_find(&h_globalvar, *ins & VM_INSTMASK); opcode = inthash_find(&h_globalvar, *ins & VM_INSTMASK);
break; break;
/* #ifdef INCOMPLETE_STRUCT_ACCESS
case GAMEVAR_PERACTOR: case GAMEVAR_PERACTOR:
opcode = inthash_find(&h_actorvar, *ins & VM_INSTMASK); opcode = inthash_find(&h_actorvar, *ins & VM_INSTMASK);
break; break;
case GAMEVAR_PERPLAYER: case GAMEVAR_PERPLAYER:
opcode = inthash_find(&h_playervar, *ins & VM_INSTMASK); opcode = inthash_find(&h_playervar, *ins & VM_INSTMASK);
break; break;
*/ #endif
} }
} }
@ -6180,11 +6186,13 @@ void scriptInitTables()
for (auto &globalvar : globalvartable) for (auto &globalvar : globalvartable)
inthash_add(&h_globalvar, globalvar.x, globalvar.y, 0); inthash_add(&h_globalvar, globalvar.x, globalvar.y, 0);
#ifdef INCOMPLETE_STRUCT_ACCESS
for (auto &playervar : playervartable) for (auto &playervar : playervartable)
inthash_add(&h_playervar, playervar.x, playervar.y, 0); inthash_add(&h_playervar, playervar.x, playervar.y, 0);
for (auto &actorvar : actorvartable) for (auto &actorvar : actorvartable)
inthash_add(&h_actorvar, actorvar.x, actorvar.y, 0); inthash_add(&h_actorvar, actorvar.x, actorvar.y, 0);
#endif
} }
void C_Compile(const char *fileName) void C_Compile(const char *fileName)
@ -6319,8 +6327,10 @@ void C_Compile(const char *fileName)
inthash_free(&h_varvar); inthash_free(&h_varvar);
inthash_free(&h_globalvar); inthash_free(&h_globalvar);
#ifdef INCOMPLETE_STRUCT_ACCESS
inthash_free(&h_playervar); inthash_free(&h_playervar);
inthash_free(&h_actorvar); inthash_free(&h_actorvar);
#endif
freehashnames(); freehashnames();
freesoundhashnames(); freesoundhashnames();

View file

@ -878,6 +878,7 @@ enum ScriptKeywords_t
CON_WHILEVARN_GLOBAL, CON_WHILEVARN_GLOBAL,
CON_XORVAR_GLOBAL, CON_XORVAR_GLOBAL,
#ifdef INCOMPLETE_STRUCT_ACCESS
CON_IFVARA_PLAYER, CON_IFVARA_PLAYER,
CON_IFVARAE_PLAYER, CON_IFVARAE_PLAYER,
CON_IFVARAND_PLAYER, CON_IFVARAND_PLAYER,
@ -939,6 +940,7 @@ enum ScriptKeywords_t
CON_WHILEVARL_ACTOR, CON_WHILEVARL_ACTOR,
CON_WHILEVARN_ACTOR, CON_WHILEVARN_ACTOR,
CON_XORVAR_ACTOR, CON_XORVAR_ACTOR,
#endif
CON_IFVARVARA, CON_IFVARVARA,
CON_IFVARVARAE, CON_IFVARVARAE,

View file

@ -1424,8 +1424,8 @@ next_instruction:
insptr = tempscrptr; insptr = tempscrptr;
} }
continue; continue;
/*
#ifdef INCOMPLETE_STRUCT_ACCESS
case CON_IFVARE_ACTOR: case CON_IFVARE_ACTOR:
insptr++; insptr++;
tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)]; tw = aGameVars[*insptr++].pValues[vm.spriteNum & (MAXSPRITES-1)];
@ -1669,7 +1669,7 @@ next_instruction:
aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] >>= insptr[1]; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] >>= insptr[1];
insptr += 2; insptr += 2;
continue; continue;
*/ #endif
case CON_WHILEVARN_GLOBAL: case CON_WHILEVARN_GLOBAL:
{ {
@ -1695,6 +1695,7 @@ next_instruction:
continue; continue;
} }
#ifdef INCOMPLETE_STRUCT_ACCESS
case CON_WHILEVARN_ACTOR: case CON_WHILEVARN_ACTOR:
{ {
auto const savedinsptr = &insptr[2]; auto const savedinsptr = &insptr[2];
@ -1750,12 +1751,14 @@ next_instruction:
continue; continue;
} }
#endif
case CON_MODVAR_GLOBAL: case CON_MODVAR_GLOBAL:
insptr++; insptr++;
aGameVars[*insptr].global %= insptr[1]; aGameVars[*insptr].global %= insptr[1];
insptr += 2; insptr += 2;
continue; continue;
#ifdef INCOMPLETE_STRUCT_ACCESS
case CON_MODVAR_ACTOR: case CON_MODVAR_ACTOR:
insptr++; insptr++;
aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] %= insptr[1]; aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] %= insptr[1];
@ -1766,6 +1769,7 @@ next_instruction:
aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] %= insptr[1]; aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] %= insptr[1];
insptr += 2; insptr += 2;
continue; continue;
#endif
case CON_IFVARAND: case CON_IFVARAND:
insptr++; insptr++;
@ -1916,7 +1920,7 @@ next_instruction:
insptr += 2; insptr += 2;
continue; continue;
/* #ifdef INCOMPLETE_STRUCT_ACCESS
case CON_DIVVAR_PLAYER: case CON_DIVVAR_PLAYER:
{ {
insptr++; insptr++;
@ -1936,7 +1940,7 @@ next_instruction:
insptr += 2; insptr += 2;
continue; continue;
} }
*/ #endif
case CON_DIVVARVAR: case CON_DIVVARVAR:
insptr++; insptr++;
@ -2234,6 +2238,7 @@ next_instruction:
insptr += 2; insptr += 2;
continue; continue;
#ifdef INCOMPLETE_STRUCT_ACCESS
case CON_RANDVAR_PLAYER: case CON_RANDVAR_PLAYER:
insptr++; insptr++;
aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] = mulscale16(krand(), insptr[1] + 1); aGameVars[*insptr].pValues[vm.playerNum & (MAXPLAYERS-1)] = mulscale16(krand(), insptr[1] + 1);
@ -2245,6 +2250,7 @@ next_instruction:
aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] = mulscale16(krand(), insptr[1] + 1); aGameVars[*insptr].pValues[vm.spriteNum & (MAXSPRITES-1)] = mulscale16(krand(), insptr[1] + 1);
insptr += 2; insptr += 2;
continue; continue;
#endif
case CON_RANDVARVAR: case CON_RANDVARVAR:
insptr++; insptr++;