More EDUKE32_STANDALONE guarding. Next commit will merge some of the guarded blocks together for simplicity.

git-svn-id: https://svn.eduke32.com/eduke32@6799 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-04-04 20:47:48 +00:00
parent d9b24b8f5c
commit d10dcd971c
3 changed files with 71 additions and 52 deletions

View file

@ -1436,11 +1436,13 @@ int A_Spawn(int spriteNum, int tileNum)
#endif
if ((pSprite->cstat & 48)
#ifndef EDUKE32_STANDALONE
&& pSprite->picnum != SPEAKER
&& pSprite->picnum != LETTER
&& pSprite->picnum != DUCK
&& pSprite->picnum != TARGET
&& pSprite->picnum != TRIPBOMB
#endif
&& pSprite->picnum != VIEWSCREEN
&& pSprite->picnum != VIEWSCREEN2
&& (!(pSprite->picnum >= CRACK1 && pSprite->picnum <= CRACK4)))
@ -1448,6 +1450,7 @@ int A_Spawn(int spriteNum, int tileNum)
if (pSprite->shade == 127)
goto SPAWN_END;
#ifndef EDUKE32_STANDALONE
if (A_CheckSwitchTile(newSprite) && (pSprite->cstat & 16))
{
if (pSprite->pal && pSprite->picnum != ACCESSSWITCH && pSprite->picnum != ACCESSSWITCH2)
@ -1468,6 +1471,7 @@ int A_Spawn(int spriteNum, int tileNum)
goto SPAWN_END;
}
#endif
if (pSprite->hitag)
{
@ -1490,6 +1494,7 @@ int A_Spawn(int spriteNum, int tileNum)
sectNum = pSprite->sectnum;
//some special cases that can't be handled through the dynamictostatic system.
#ifndef EDUKE32_STANDALONE
if ((pSprite->picnum >= BOLT1 && pSprite->picnum <= BOLT1 + 3) || (pSprite->picnum >= SIDEBOLT1 && pSprite->picnum <= SIDEBOLT1 + 3))
{
T1(newSprite) = pSprite->xrepeat;
@ -1526,6 +1531,7 @@ int A_Spawn(int spriteNum, int tileNum)
}
}
else
#endif
switch (DYNAMICTILEMAP(pSprite->picnum))
{
default:
@ -1587,6 +1593,7 @@ int A_Spawn(int spriteNum, int tileNum)
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
#ifndef EDUKE32_STANDALONE
case WATERSPLASH2__STATIC:
if (spriteNum >= 0)
{
@ -1690,6 +1697,7 @@ int A_Spawn(int spriteNum, int tileNum)
case FRAMEEFFECT1_13__STATIC:
if (PLUTOPAK) break;
fallthrough__;
#endif
case FRAMEEFFECT1__STATIC:
if (spriteNum >= 0)
{
@ -1702,7 +1710,7 @@ int A_Spawn(int spriteNum, int tileNum)
changespritestat(newSprite, STAT_MISC);
break;
#ifndef EDUKE32_STANDALONE
case LASERLINE__STATIC:
pSprite->yrepeat = 6;
pSprite->xrepeat = 32;
@ -1842,7 +1850,6 @@ int A_Spawn(int spriteNum, int tileNum)
pSprite->cstat |= 257;
changespritestat(newSprite, STAT_ZOMBIEACTOR);
break;
case HYDRENT__STATIC:
case PANNEL1__STATIC:
case PANNEL2__STATIC:
@ -1850,7 +1857,6 @@ int A_Spawn(int spriteNum, int tileNum)
case FUELPOD__STATIC:
case SOLARPANNEL__STATIC:
case ANTENNA__STATIC:
case GRATE1__STATIC:
case CHAIR1__STATIC:
case CHAIR2__STATIC:
case CHAIR3__STATIC:
@ -1882,7 +1888,6 @@ int A_Spawn(int spriteNum, int tileNum)
case JURYGUY__STATIC:
case SCALE__STATIC:
case VACUUM__STATIC:
case FANSPRITE__STATIC:
case CACTUS__STATIC:
case CACTUSBROKE__STATIC:
case HANGLIGHT__STATIC:
@ -1908,12 +1913,16 @@ int A_Spawn(int spriteNum, int tileNum)
case PIPE4__STATIC:
case PIPE5__STATIC:
case PIPE6__STATIC:
#endif
case GRATE1__STATIC:
case FANSPRITE__STATIC:
pSprite->clipdist = 32;
pSprite->cstat |= 257;
fallthrough__;
case OCEANSPRITE4__STATIC:
changespritestat(newSprite, STAT_DEFAULT);
break;
#ifndef EDUKE32_STANDALONE
case FEMMAG1__STATIC:
case FEMMAG2__STATIC:
pSprite->cstat &= ~257;
@ -1951,6 +1960,7 @@ int A_Spawn(int spriteNum, int tileNum)
changespritestat(newSprite, STAT_DEFAULT);
break;
}
#endif
case FOOTPRINTS__STATIC:
case FOOTPRINTS2__STATIC:
case FOOTPRINTS3__STATIC:
@ -1999,7 +2009,7 @@ int A_Spawn(int spriteNum, int tileNum)
A_AddToDeleteQueue(newSprite);
changespritestat(newSprite, STAT_MISC);
break;
#ifndef EDUKE32_STANDALONE
case PODFEM1__STATIC:
pSprite->extra <<= 1;
fallthrough__;
@ -2096,14 +2106,14 @@ int A_Spawn(int spriteNum, int tileNum)
changespritestat(newSprite, STAT_MISC);
break;
#endif
case VIEWSCREEN__STATIC:
case VIEWSCREEN2__STATIC:
pSprite->owner = newSprite;
pSprite->lotag = pSprite->extra = 1;
changespritestat(newSprite, STAT_STANDABLE);
break;
#ifndef EDUKE32_STANDALONE
case SHELL__STATIC: //From the player
case SHOTGUNSHELL__STATIC:
if (spriteNum >= 0)
@ -2152,7 +2162,7 @@ int A_Spawn(int spriteNum, int tileNum)
changespritestat(newSprite, STAT_MISC);
}
break;
#endif
case RESPAWN__STATIC:
pSprite->extra = 66-13;
fallthrough__;
@ -2242,7 +2252,7 @@ int A_Spawn(int spriteNum, int tileNum)
? STAT_MISC
: STAT_PLAYER);
break;
#ifndef EDUKE32_STANDALONE
case WATERBUBBLE__STATIC:
if (spriteNum >= 0)
{
@ -2338,7 +2348,7 @@ int A_Spawn(int spriteNum, int tileNum)
pSprite->lotag = 9999;
changespritestat(newSprite, STAT_STANDABLE);
break;
#endif
case TOUCHPLATE__STATIC:
T3(newSprite) = sector[sectNum].floorz;
@ -2351,6 +2361,7 @@ int A_Spawn(int spriteNum, int tileNum)
changespritestat(newSprite, STAT_MISC);
break;
}
#ifndef EDUKE32_STANDALONE
fallthrough__;
case WATERBUBBLEMAKER__STATIC:
if (EDUKE32_PREDICT_FALSE(pSprite->hitag && pSprite->picnum == WATERBUBBLEMAKER))
@ -2360,6 +2371,7 @@ int A_Spawn(int spriteNum, int tileNum)
newSprite,TrackerCast(pSprite->x),TrackerCast(pSprite->y));
pSprite->hitag = 0;
}
#endif
pSprite->cstat |= 32768;
changespritestat(newSprite, STAT_STANDABLE);
break;
@ -2370,7 +2382,7 @@ int A_Spawn(int spriteNum, int tileNum)
pSprite->yvel = 0;
changespritestat(newSprite, STAT_STANDABLE);
break;
#ifndef EDUKE32_STANDALONE
case TARGET__STATIC:
case DUCK__STATIC:
case LETTER__STATIC:
@ -2512,7 +2524,7 @@ int A_Spawn(int spriteNum, int tileNum)
pSprite->zvel = 0;
break;
#endif
case LOCATORS__STATIC:
pSprite->cstat |= 32768;
changespritestat(newSprite, STAT_LOCATOR);
@ -2556,7 +2568,7 @@ int A_Spawn(int spriteNum, int tileNum)
break;
}
#ifndef EDUKE32_STANDALONE
case REACTOR2__STATIC:
case REACTOR__STATIC:
pSprite->extra = g_impactDamage;
@ -2751,7 +2763,7 @@ int A_Spawn(int spriteNum, int tileNum)
case CEILINGSTEAM__STATIC:
changespritestat(newSprite, STAT_STANDABLE);
break;
#endif
case SECTOREFFECTOR__STATIC:
pSprite->cstat |= 32768;
pSprite->xrepeat = pSprite->yrepeat = 0;
@ -3363,7 +3375,7 @@ int A_Spawn(int spriteNum, int tileNum)
changespritestat(newSprite, STAT_STANDABLE);
A_SetSprite(newSprite,CLIPMASK0);
break;
#ifndef EDUKE32_STANDALONE
case TOILET__STATIC:
case STALL__STATIC:
pSprite->lotag = 1;
@ -3414,6 +3426,7 @@ int A_Spawn(int spriteNum, int tileNum)
pSprite->shade = -16;
changespritestat(newSprite, STAT_STANDABLE);
break;
#endif
}
SPAWN_END:
@ -5711,6 +5724,7 @@ static void G_PostLoadPalette(void)
// Has to be after setting the dynamic names (e.g. SHARK).
static void A_InitEnemyFlags(void)
{
#ifndef EDUKE32_STANDALONE
int DukeEnemies[] = {
SHARK, RECON, DRONE,
LIZTROOPONTOILET, LIZTROOPJUSTSIT, LIZTROOPSTAYPUT, LIZTROOPSHOOT,
@ -5737,6 +5751,7 @@ static void A_InitEnemyFlags(void)
for (bssize_t i=ARRAY_SIZE(GreenSlimeFoodEnemies)-1; i>=0; i--)
SETFLAG(GreenSlimeFoodEnemies[i], SFLAG_GREENSLIMEFOOD);
#endif
}
#undef SETFLAG

View file

@ -5956,6 +5956,7 @@ void A_Execute(int spriteNum, int playerNum, int playerDist)
if (vm.pSprite->statnum != STAT_ACTOR)
{
#ifndef EDUKE32_STANDALONE
if (vm.pSprite->statnum == STAT_STANDABLE)
{
switch (DYNAMICTILEMAP(vm.pSprite->picnum))
@ -5978,6 +5979,7 @@ void A_Execute(int spriteNum, int playerNum, int playerDist)
default: break;
}
}
#endif
return;
}
@ -5996,8 +5998,10 @@ void A_Execute(int spriteNum, int playerNum, int playerDist)
else if (vm.pActor->timetosleep == 1)
{
// hack for 1.3D fire sprites
#ifndef EDUKE32_STANDALONE
if (EDUKE32_PREDICT_FALSE(g_scriptVersion == 13 && (vm.pSprite->picnum == FIRE || vm.pSprite->picnum == FIRE2)))
return;
#endif
changespritestat(vm.spriteNum, STAT_ZOMBIEACTOR);
}
}

View file

@ -1481,7 +1481,7 @@ static void G_BreakWall(int tileNum, int spriteNum, int wallNum)
A_SpawnWallGlass(spriteNum,wallNum,10);
}
void A_DamageWall_Internal(int spriteNum, int wallNum, const vec3_t *UNUSED(vPos), int weaponNum)
void A_DamageWall_Internal(int spriteNum, int wallNum, const vec3_t *vPos, int weaponNum)
{
int16_t sectNum = -1;
walltype *pWall = &wall[wallNum];
@ -1530,7 +1530,6 @@ void A_DamageWall_Internal(int spriteNum, int wallNum, const vec3_t *UNUSED(vPos
}
}
#ifndef EDUKE32_STANDALONE
if ((((pWall->cstat & 16) || pWall->overpicnum == BIGFORCE) && pWall->nextsector >= 0) &&
(sector[pWall->nextsector].floorz > vPos->z) &&
(sector[pWall->nextsector].floorz != sector[pWall->nextsector].ceilingz))
@ -1539,6 +1538,19 @@ void A_DamageWall_Internal(int spriteNum, int wallNum, const vec3_t *UNUSED(vPos
switch (DYNAMICTILEMAP(switchPic))
{
case FANSPRITE__STATIC:
pWall->overpicnum = FANSPRITEBROKE;
pWall->cstat &= 65535 - 65;
if (pWall->nextwall >= 0)
{
wall[pWall->nextwall].overpicnum = FANSPRITEBROKE;
wall[pWall->nextwall].cstat &= 65535 - 65;
}
A_PlaySound(VENT_BUST, spriteNum);
A_PlaySound(GLASS_BREAKING, spriteNum);
return;
#ifndef EDUKE32_STANDALONE
case W_FORCEFIELD__STATIC:
pWall->extra = 1; // tell the forces to animate
/* fall-through */
@ -1569,18 +1581,6 @@ void A_DamageWall_Internal(int spriteNum, int wallNum, const vec3_t *UNUSED(vPos
}
return;
case FANSPRITE__STATIC:
pWall->overpicnum = FANSPRITEBROKE;
pWall->cstat &= 65535 - 65;
if (pWall->nextwall >= 0)
{
wall[pWall->nextwall].overpicnum = FANSPRITEBROKE;
wall[pWall->nextwall].cstat &= 65535 - 65;
}
A_PlaySound(VENT_BUST, spriteNum);
A_PlaySound(GLASS_BREAKING, spriteNum);
return;
case GLASS__STATIC:
updatesector(vPos->x, vPos->y, &sectNum);
if (sectNum < 0)
@ -1613,9 +1613,9 @@ void A_DamageWall_Internal(int spriteNum, int wallNum, const vec3_t *UNUSED(vPos
A_PlaySound(VENT_BUST, spriteNum);
A_PlaySound(GLASS_BREAKING, spriteNum);
return;
#endif
}
}
#endif
switch (DYNAMICTILEMAP(pWall->picnum))
{
@ -1899,6 +1899,28 @@ void A_DamageObject_Internal(int spriteNum, int const dmgSrc)
switch (DYNAMICTILEMAP(PN(spriteNum)))
{
case GRATE1__STATIC:
PN(spriteNum) = BGRATE1;
CS(spriteNum) &= (65535-256-1);
A_PlaySound(VENT_BUST, spriteNum);
break;
case FANSPRITE__STATIC:
PN(spriteNum) = FANSPRITEBROKE;
CS(spriteNum) &= (65535-257);
if (sector[SECT(spriteNum)].floorpicnum == FANSHADOW)
sector[SECT(spriteNum)].floorpicnum = FANSHADOWBROKE;
A_PlaySound(GLASS_HEAVYBREAK, spriteNum);
for (bssize_t j=16; j>0; j--)
{
spritetype * const pSprite = &sprite[spriteNum];
RANDOMSCRAP(pSprite, spriteNum);
}
break;
#ifndef EDUKE32_STANDALONE
case OCEANSPRITE1__STATIC:
case OCEANSPRITE2__STATIC:
@ -1999,22 +2021,6 @@ void A_DamageObject_Internal(int spriteNum, int const dmgSrc)
A_DeleteSprite(spriteNum);
break;
case FANSPRITE__STATIC:
PN(spriteNum) = FANSPRITEBROKE;
CS(spriteNum) &= (65535-257);
if (sector[SECT(spriteNum)].floorpicnum == FANSHADOW)
sector[SECT(spriteNum)].floorpicnum = FANSHADOWBROKE;
A_PlaySound(GLASS_HEAVYBREAK,spriteNum);
for (bssize_t j=16; j>0; j--)
{
spritetype * const pSprite = &sprite[spriteNum];
RANDOMSCRAP(pSprite, spriteNum);
}
break;
case WATERFOUNTAIN__STATIC:
// case WATERFOUNTAIN+1:
// case WATERFOUNTAIN+2:
@ -2149,12 +2155,6 @@ void A_DamageObject_Internal(int spriteNum, int const dmgSrc)
A_PlaySound(GLASS_HEAVYBREAK,spriteNum);
break;
case GRATE1__STATIC:
PN(spriteNum) = BGRATE1;
CS(spriteNum) &= (65535-256-1);
A_PlaySound(VENT_BUST,spriteNum);
break;
case CIRCLEPANNEL__STATIC:
PN(spriteNum) = CIRCLEPANNELBROKE;
CS(spriteNum) &= (65535-256-1);