A few stylistic tweaks, like substituting missed SE_* enum constants.

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4353 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2014-02-22 19:38:54 +00:00
parent f077d57547
commit f346e46ed8
2 changed files with 23 additions and 18 deletions

View file

@ -6702,8 +6702,8 @@ int32_t A_Spawn(int32_t j, int32_t pn)
break; break;
case SE_11_SWINGING_DOOR://Pivitor rotater case SE_11_SWINGING_DOOR://Pivitor rotater
if (sp->ang>1024) T4 = 2; T4 = (sp->ang > 1024) ? 2 : -2;
else T4 = -2; /* fall-through */
case SE_0_ROTATING_SECTOR: case SE_0_ROTATING_SECTOR:
case SE_2_EARTHQUAKE://Earthquakemakers case SE_2_EARTHQUAKE://Earthquakemakers
case SE_5://Boss Creature case SE_5://Boss Creature
@ -6713,12 +6713,11 @@ int32_t A_Spawn(int32_t j, int32_t pn)
case SE_16_REACTOR://That rotating blocker reactor thing case SE_16_REACTOR://That rotating blocker reactor thing
case SE_26://ESCELATOR case SE_26://ESCELATOR
case SE_30_TWO_WAY_TRAIN://No rotational subways case SE_30_TWO_WAY_TRAIN://No rotational subways
if (sp->lotag == 0) if (sp->lotag == SE_0_ROTATING_SECTOR)
{ {
if (sector[sect].lotag == ST_30_ROTATE_RISE_BRIDGE) if (sector[sect].lotag == ST_30_ROTATE_RISE_BRIDGE)
{ {
if (sp->pal) sprite[i].clipdist = 1; sprite[i].clipdist = (sp->pal) ? 1 : 0;
else sprite[i].clipdist = 0;
T4 = sector[sect].floorz; T4 = sector[sect].floorz;
sector[sect].hitag = i; sector[sect].hitag = i;
} }
@ -6727,7 +6726,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
{ {
if (sprite[j].statnum < MAXSTATUS) if (sprite[j].statnum < MAXSTATUS)
if (sprite[j].picnum == SECTOREFFECTOR && if (sprite[j].picnum == SECTOREFFECTOR &&
sprite[j].lotag == 1 && sprite[j].lotag == SE_1_PIVOT &&
sprite[j].hitag == sp->hitag) sprite[j].hitag == sp->hitag)
{ {
if (sp->ang == 512) if (sp->ang == 512)
@ -6759,12 +6758,14 @@ int32_t A_Spawn(int32_t j, int32_t pn)
tempwallptr++; tempwallptr++;
if (tempwallptr > 2047) if (tempwallptr > 2047)
{ {
Bsprintf_nowarn(tempbuf,"Too many moving sectors at (%d,%d).\n",TrackerCast(wall[s].x),TrackerCast(wall[s].y)); Bsprintf_nowarn(tempbuf, "Too many moving sectors at (%d,%d).\n",
TrackerCast(wall[s].x),TrackerCast(wall[s].y));
G_GameExit(tempbuf); G_GameExit(tempbuf);
} }
} }
if (sp->lotag == SE_30_TWO_WAY_TRAIN || sp->lotag == SE_6_SUBWAY || sp->lotag == SE_14_SUBWAY_CAR || sp->lotag == SE_5) if (sp->lotag == SE_5 || sp->lotag == SE_30_TWO_WAY_TRAIN ||
sp->lotag == SE_6_SUBWAY || sp->lotag == SE_14_SUBWAY_CAR)
{ {
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
int32_t outerwall=-1; int32_t outerwall=-1;
@ -6772,9 +6773,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
startwall = sector[sect].wallptr; startwall = sector[sect].wallptr;
endwall = startwall+sector[sect].wallnum; endwall = startwall+sector[sect].wallnum;
if (sector[sect].hitag == UINT16_MAX) sp->extra = (sector[sect].hitag != UINT16_MAX);
sp->extra = 0;
else sp->extra = 1;
// TRAIN_SECTOR_TO_SE_INDEX // TRAIN_SECTOR_TO_SE_INDEX
sector[sect].hitag = i; sector[sect].hitag = i;

View file

@ -953,8 +953,11 @@ static void resetprestat(int32_t snum,int32_t g)
} }
// tweak moving sectors with these SE lotags // Tweak sprites contained in moving sectors with these SE lotags.
#define FIXSPR_SELOTAGP(k) ((k==0) || (k==6) || (k==14)) #define FIXSPR_SELOTAGP(k) \
((k)==SE_0_ROTATING_SECTOR \
|| (k)==SE_6_SUBWAY \
|| (k)==SE_14_SUBWAY_CAR)
// Set up sprites in moving sectors that are to be fixed wrt a certain pivot // Set up sprites in moving sectors that are to be fixed wrt a certain pivot
// position and should not diverge from it due to roundoff error in the future. // position and should not diverge from it due to roundoff error in the future.
@ -971,13 +974,16 @@ static void G_SetupRotfixedSprites(void)
int32_t firstrun = 1; int32_t firstrun = 1;
#endif #endif
int32_t j = headspritesect[sprite[i].sectnum]; int32_t j = headspritesect[sprite[i].sectnum];
while (j>=0) while (j>=0)
{ {
const spritetype *const spr = &sprite[j];
// TRIPBOMB uses t_data[7] for its own purposes. Wouldn't be // TRIPBOMB uses t_data[7] for its own purposes. Wouldn't be
// too useful with moving sectors anyway // too useful with moving sectors anyway
if ((ROTFIXSPR_STATNUMP(sprite[j].statnum) && sprite[j].picnum!=TRIPBOMB) || if ((ROTFIXSPR_STATNUMP(spr->statnum) && spr->picnum!=TRIPBOMB) ||
((sprite[j].statnum==STAT_ACTOR || sprite[j].statnum==STAT_ZOMBIEACTOR) && ((spr->statnum==STAT_ACTOR || spr->statnum==STAT_ZOMBIEACTOR) &&
A_CheckSpriteTileFlags(sprite[j].picnum, SFLAG_ROTFIXED))) A_CheckSpriteTileFlags(spr->picnum, SFLAG_ROTFIXED)))
{ {
int32_t pivot = i; int32_t pivot = i;
@ -987,8 +993,8 @@ static void G_SetupRotfixedSprites(void)
{ {
// let's hope we don't step on anyone's toes here // let's hope we don't step on anyone's toes here
actor[j].t_data[7] = ROTFIXSPR_MAGIC | pivot; // 'rs' magic + pivot SE sprite index actor[j].t_data[7] = ROTFIXSPR_MAGIC | pivot; // 'rs' magic + pivot SE sprite index
actor[j].t_data[8] = sprite[j].x - sprite[pivot].x; actor[j].t_data[8] = spr->x - sprite[pivot].x;
actor[j].t_data[9] = sprite[j].y - sprite[pivot].y; actor[j].t_data[9] = spr->y - sprite[pivot].y;
} }
} }