Replace most other literal SEs/STs by symbolic enumeration values.

Have fun researching Duke3D's hardcoded weirdness!!!

git-svn-id: https://svn.eduke32.com/eduke32@3008 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-09-08 22:18:44 +00:00
parent fba2556f9b
commit eb4848fe05
9 changed files with 153 additions and 117 deletions

View file

@ -1269,7 +1269,7 @@ ACTOR_STATIC void G_MoveFX(void)
T1 = 0; T1 = 0;
} }
} }
else if (s->lotag < 999 && (unsigned)sector[s->sectnum].lotag < 9 && else if (s->lotag < 999 && (unsigned)sector[s->sectnum].lotag < 9 && // ST_9_SLIDING_ST_DOOR
ud.config.AmbienceToggle && sector[SECT].floorz != sector[SECT].ceilingz) ud.config.AmbienceToggle && sector[SECT].floorz != sector[SECT].ceilingz)
{ {
if (g_sounds[s->lotag].m&2) if (g_sounds[s->lotag].m&2)
@ -2028,14 +2028,14 @@ DETONATE:
{ {
if (s->hitag == sprite[j].hitag) if (s->hitag == sprite[j].hitag)
{ {
if (sprite[j].lotag == 13) if (sprite[j].lotag == SE_13_EXPLOSIVE)
{ {
if (actor[j].t_data[2] == 0) if (actor[j].t_data[2] == 0)
actor[j].t_data[2] = 1; actor[j].t_data[2] = 1;
} }
else if (sprite[j].lotag == 8) else if (sprite[j].lotag == SE_8_UP_OPEN_DOOR_LIGHTS)
actor[j].t_data[4] = 1; actor[j].t_data[4] = 1;
else if (sprite[j].lotag == 18) else if (sprite[j].lotag == SE_18_INCREMENTAL_SECTOR_RISE_FALL)
{ {
if (actor[j].t_data[0] == 0) if (actor[j].t_data[0] == 0)
actor[j].t_data[0] = 1; actor[j].t_data[0] = 1;
@ -2081,14 +2081,14 @@ DETONATE:
{ {
switch (sprite[j].lotag) switch (sprite[j].lotag)
{ {
case 2: case SE_2_EARTHQUAKE:
case SE_21_DROP_FLOOR: case SE_21_DROP_FLOOR:
case SE_31_FLOOR_RISE_FALL: case SE_31_FLOOR_RISE_FALL:
case SE_32_CEILING_RISE_FALL: case SE_32_CEILING_RISE_FALL:
case SE_36_PROJ_SHOOTER: case SE_36_PROJ_SHOOTER:
actor[j].t_data[0] = 1; actor[j].t_data[0] = 1;
break; break;
case 3: case SE_3_RANDOM_LIGHTS_AFTER_SHOT_OUT:
actor[j].t_data[4] = 1; actor[j].t_data[4] = 1;
break; break;
} }
@ -4750,7 +4750,7 @@ DETONATEB:
{ {
if( sprite[j].lotag == 3 ) if( sprite[j].lotag == 3 )
Actor[j].t_data[4]=1; Actor[j].t_data[4]=1;
else if(sprite[j].lotag == 12) else if(sprite[j].lotag == SE_12_LIGHT_SWITCH)
{ {
Actor[j].t_data[4] = 1; Actor[j].t_data[4] = 1;
sprite[j].lotag = 3; sprite[j].lotag = 3;
@ -5744,7 +5744,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
j = headspritestat[STAT_EFFECTOR]; j = headspritestat[STAT_EFFECTOR];
while (j >= 0) while (j >= 0)
{ {
if (sprite[j].lotag == 19 && sprite[j].hitag == sh) if (sprite[j].lotag == SE_19_EXPLOSION_LOWERS_CEILING && sprite[j].hitag == sh)
{ {
t[0] = 0; t[0] = 0;
break; break;
@ -5777,7 +5777,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
j = headspritestat[STAT_EFFECTOR]; j = headspritestat[STAT_EFFECTOR];
while (j >= 0) while (j >= 0)
{ {
if ((sprite[j].lotag == 14) && (sh == sprite[j].hitag) && (actor[j].t_data[0] == t[0])) if ((sprite[j].lotag == SE_14_SUBWAY_CAR) && (sh == sprite[j].hitag) && (actor[j].t_data[0] == t[0]))
{ {
sprite[j].xvel = s->xvel; sprite[j].xvel = s->xvel;
// if( t[4] == 1 ) // if( t[4] == 1 )
@ -5796,7 +5796,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
x = 0; x = 0;
case 14: case SE_14_SUBWAY_CAR:
if (s->owner==-1) if (s->owner==-1)
s->owner = A_FindLocator((int16_t)t[3],(int16_t)t[0]); s->owner = A_FindLocator((int16_t)t[3],(int16_t)t[0]);
@ -6375,8 +6375,8 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
break; break;
} }
case 8: case SE_8_UP_OPEN_DOOR_LIGHTS:
case 9: case SE_9_DOWN_OPEN_DOOR_LIGHTS:
// work only if its moving // work only if its moving
@ -6448,14 +6448,15 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
} }
break; break;
case 10: case SE_10_DOOR_AUTO_CLOSE:
if ((sc->lotag&0xff) == 27 || (sc->floorz > sc->ceilingz && (sc->lotag&0xff) != 23) || sc->lotag == (int16_t) 32791) // XXX: 32791, what the hell?
if ((sc->lotag&0xff) == ST_27_STRETCH_BRIDGE || (sc->floorz > sc->ceilingz && (sc->lotag&0xff) != ST_23_SWINGING_DOOR) || sc->lotag == (int16_t) 32791)
{ {
int32_t p; int32_t p;
j = 1; j = 1;
if ((sc->lotag&0xff) != 27) if ((sc->lotag&0xff) != ST_27_STRETCH_BRIDGE)
for (TRAVERSE_CONNECT(p)) for (TRAVERSE_CONNECT(p))
if (sc->lotag != ST_30_ROTATE_RISE_BRIDGE && sc->lotag != ST_31_TWO_WAY_TRAIN && sc->lotag != 0) if (sc->lotag != ST_30_ROTATE_RISE_BRIDGE && sc->lotag != ST_31_TWO_WAY_TRAIN && sc->lotag != 0)
if (s->sectnum == sprite[g_player[p].ps->i].sectnum) if (s->sectnum == sprite[g_player[p].ps->i].sectnum)
@ -6482,7 +6483,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
} }
else t[0]=0; else t[0]=0;
break; break;
case 11: //Swingdoor case SE_11_SWINGING_DOOR: //Swingdoor
if (t[5] > 0) if (t[5] > 0)
{ {
@ -6537,7 +6538,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
} }
} }
break; break;
case 12: case SE_12_LIGHT_SWITCH:
if (t[0] == 3 || t[3] == 1) //Lights going off if (t[0] == 3 || t[3] == 1) //Lights going off
{ {
sc->floorpal = 0; sc->floorpal = 0;
@ -6606,7 +6607,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
break; break;
case 13: case SE_13_EXPLOSIVE:
if (t[2]) if (t[2])
{ {
// t[0]: ceiling z // t[0]: ceiling z
@ -6696,7 +6697,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
break; break;
case 15: case SE_15_SLIDING_DOOR:
if (t[4]) if (t[4])
{ {
@ -6882,7 +6883,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
break; break;
} }
case 18: case SE_18_INCREMENTAL_SECTOR_RISE_FALL:
if (t[0]) if (t[0])
{ {
if (s->pal) if (s->pal)
@ -6963,7 +6964,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
} }
break; break;
case 19: //Battlestar galactia shields case SE_19_EXPLOSION_LOWERS_CEILING: //Battlestar galactia shields
if (t[0]) if (t[0])
{ {
@ -7022,7 +7023,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
x = sprite[l].lotag&0x7fff; x = sprite[l].lotag&0x7fff;
switch (x) switch (x)
{ {
case 0: case SE_0_ROTATING_SECTOR:
if (sprite[l].hitag == sh) if (sprite[l].hitag == sh)
{ {
int32_t ow = sprite[l].owner; int32_t ow = sprite[l].owner;
@ -7032,10 +7033,10 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
} }
break; break;
case 1: case SE_1_PIVOT:
case 12: case SE_12_LIGHT_SWITCH:
// case 18: // case SE_18_INCREMENTAL_SECTOR_RISE_FALL:
case 19: case SE_19_EXPLOSION_LOWERS_CEILING:
if (sh == sprite[l].hitag) if (sh == sprite[l].hitag)
if (actor[l].t_data[0] == 0) if (actor[l].t_data[0] == 0)
{ {
@ -7052,7 +7053,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
break; break;
case 20: //Extend-o-bridge case SE_20_STRETCH_BRIDGE: //Extend-o-bridge
if (t[0] == 0) break; if (t[0] == 0) break;
if (t[0] == 1) s->xvel = 8; if (t[0] == 1) s->xvel = 8;
else s->xvel = -8; else s->xvel = -8;
@ -7156,7 +7157,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
break; break;
} }
case 22: case SE_22_TEETH_DOOR:
if (t[1]) if (t[1])
{ {
if (GetAnimationGoal(&sector[t[0]].ceilingz) >= 0) if (GetAnimationGoal(&sector[t[0]].ceilingz) >= 0)
@ -7166,7 +7167,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
break; break;
case SE_24_CONVEYOR: case SE_24_CONVEYOR:
case 34: case SE_34:
{ {
int32_t p; int32_t p;

View file

@ -5390,13 +5390,13 @@ int32_t A_Spawn(int32_t j, int32_t pn)
case SE_28_LIGHTNING: case SE_28_LIGHTNING:
T6 = 65;// Delay for lightning T6 = 65;// Delay for lightning
break; break;
case 7: // Transporters!!!! case SE_7_TELEPORT: // Transporters!!!!
case 23:// XPTR END case SE_23_ONE_WAY_TELEPORT:// XPTR END
if (sp->lotag != 23) if (sp->lotag != SE_23_ONE_WAY_TELEPORT)
{ {
for (j=0; j<MAXSPRITES; j++) for (j=0; j<MAXSPRITES; j++)
if (sprite[j].statnum < MAXSTATUS && sprite[j].picnum == SECTOREFFECTOR && if (sprite[j].statnum < MAXSTATUS && sprite[j].picnum == SECTOREFFECTOR &&
(sprite[j].lotag == 7 || sprite[j].lotag == 23) && i != j && sprite[j].hitag == SHT) (sprite[j].lotag == SE_7_TELEPORT || sprite[j].lotag == SE_23_ONE_WAY_TELEPORT) && i != j && sprite[j].hitag == SHT)
{ {
OW = j; OW = j;
break; break;
@ -5408,11 +5408,11 @@ int32_t A_Spawn(int32_t j, int32_t pn)
sp->cstat = 0; sp->cstat = 0;
changespritestat(i, STAT_TRANSPORT); changespritestat(i, STAT_TRANSPORT);
goto SPAWN_END; goto SPAWN_END;
case 1: case SE_1_PIVOT:
sp->owner = -1; sp->owner = -1;
T1 = 1; T1 = 1;
break; break;
case 18: case SE_18_INCREMENTAL_SECTOR_RISE_FALL:
if (sp->ang == 512) if (sp->ang == 512)
{ {
@ -5430,7 +5430,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
sp->hitag <<= 2; sp->hitag <<= 2;
break; break;
case 19: case SE_19_EXPLOSION_LOWERS_CEILING:
sp->owner = -1; sp->owner = -1;
break; break;
case SE_25_PISTON: // Pistons case SE_25_PISTON: // Pistons
@ -5439,7 +5439,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
sector[sect].ceilingz = sp->z; sector[sect].ceilingz = sp->z;
G_SetInterpolation(&sector[sect].ceilingz); G_SetInterpolation(&sector[sect].ceilingz);
break; break;
case 35: case SE_35:
sector[sect].ceilingz = sp->z; sector[sect].ceilingz = sp->z;
break; break;
case SE_27_DEMO_CAM: case SE_27_DEMO_CAM:
@ -5449,13 +5449,13 @@ int32_t A_Spawn(int32_t j, int32_t pn)
sp->cstat &= 32768; sp->cstat &= 32768;
} }
break; break;
case 12: case SE_12_LIGHT_SWITCH:
T2 = sector[sect].floorshade; T2 = sector[sect].floorshade;
T3 = sector[sect].ceilingshade; T3 = sector[sect].ceilingshade;
break; break;
case 13: case SE_13_EXPLOSIVE:
T1 = sector[sect].ceilingz; T1 = sector[sect].ceilingz;
T2 = sector[sect].floorz; T2 = sector[sect].floorz;
@ -5567,7 +5567,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
case SE_36_PROJ_SHOOTER: case SE_36_PROJ_SHOOTER:
break; break;
case 20: case SE_20_STRETCH_BRIDGE:
{ {
int32_t q; int32_t q;
@ -5694,11 +5694,11 @@ int32_t A_Spawn(int32_t j, int32_t pn)
break; break;
case 9: case SE_9_DOWN_OPEN_DOOR_LIGHTS:
if (sector[sect].lotag && if (sector[sect].lotag &&
labs(sector[sect].ceilingz-sp->z) > 1024) labs(sector[sect].ceilingz-sp->z) > 1024)
sector[sect].lotag |= 32768; //If its open sector[sect].lotag |= 32768; //If its open
case 8: case SE_8_UP_OPEN_DOOR_LIGHTS:
//First, get the ceiling-floor shade //First, get the ceiling-floor shade
T1 = sector[sect].floorshade; T1 = sector[sect].floorshade;
@ -5715,15 +5715,15 @@ int32_t A_Spawn(int32_t j, int32_t pn)
break; break;
case 11://Pivitor rotater case SE_11_SWINGING_DOOR://Pivitor rotater
if (sp->ang>1024) T4 = 2; if (sp->ang>1024) T4 = 2;
else T4 = -2; else T4 = -2;
case 0: case SE_0_ROTATING_SECTOR:
case 2://Earthquakemakers case SE_2_EARTHQUAKE://Earthquakemakers
case 5://Boss Creature case SE_5://Boss Creature
case 6://Subway case SE_6_SUBWAY://Subway
case 14://Caboos case SE_14_SUBWAY_CAR://Caboos
case 15://Subwaytype sliding door case SE_15_SLIDING_DOOR://Subwaytype sliding door
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
@ -5782,7 +5782,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
} }
} }
if (sp->lotag == SE_30_TWO_WAY_TRAIN || sp->lotag == 6 || sp->lotag == 14 || sp->lotag == 5) if (sp->lotag == SE_30_TWO_WAY_TRAIN || sp->lotag == SE_6_SUBWAY || sp->lotag == SE_14_SUBWAY_CAR || sp->lotag == SE_5)
{ {
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
int32_t outerwall=-1; int32_t outerwall=-1;
@ -5869,18 +5869,18 @@ int32_t A_Spawn(int32_t j, int32_t pn)
switch (sp->lotag) switch (sp->lotag)
{ {
case 6: case SE_6_SUBWAY:
case 14: case SE_14_SUBWAY_CAR:
j = A_CallSound(sect,i); j = A_CallSound(sect,i);
if (j == -1) j = SUBWAY; if (j == -1) j = SUBWAY;
actor[i].lastvx = j; actor[i].lastvx = j;
case SE_30_TWO_WAY_TRAIN: case SE_30_TWO_WAY_TRAIN:
if (g_netServer || numplayers > 1) break; if (g_netServer || numplayers > 1) break;
case 0: case SE_0_ROTATING_SECTOR:
case 1: case SE_1_PIVOT:
case 5: case SE_5:
case 11: case SE_11_SWINGING_DOOR:
case 15: case SE_15_SLIDING_DOOR:
case SE_16_REACTOR: case SE_16_REACTOR:
case SE_26: case SE_26:
Sect_SetInterpolation(sprite[i].sectnum); Sect_SetInterpolation(sprite[i].sectnum);

View file

@ -347,9 +347,32 @@ static inline int32_t calc_smoothratio(int32_t totalclk, int32_t ototalclk)
// sector effector lotags // sector effector lotags
enum { enum {
SE_0_ROTATING_SECTOR = 0,
SE_1_PIVOT = 1,
SE_2_EARTHQUAKE = 2,
SE_3_RANDOM_LIGHTS_AFTER_SHOT_OUT = 3,
SE_4_RANDOM_LIGHTS = 4,
SE_5 = 5,
SE_6_SUBWAY = 6,
// ^^ potentially incomplete substitution in code
// vv almost surely complete substitution
SE_7_TELEPORT = 7,
SE_8_UP_OPEN_DOOR_LIGHTS = 8,
SE_9_DOWN_OPEN_DOOR_LIGHTS = 9,
SE_10_DOOR_AUTO_CLOSE = 10,
SE_11_SWINGING_DOOR = 11,
SE_12_LIGHT_SWITCH = 12,
SE_13_EXPLOSIVE = 13,
SE_14_SUBWAY_CAR = 14,
SE_15_SLIDING_DOOR = 15,
SE_16_REACTOR = 16, SE_16_REACTOR = 16,
SE_17_WARP_ELEVATOR = 17, SE_17_WARP_ELEVATOR = 17,
SE_18_INCREMENTAL_SECTOR_RISE_FALL = 18,
SE_19_EXPLOSION_LOWERS_CEILING = 19,
SE_20_STRETCH_BRIDGE = 20,
SE_21_DROP_FLOOR = 21, SE_21_DROP_FLOOR = 21,
SE_22_TEETH_DOOR = 22,
SE_23_ONE_WAY_TELEPORT = 23,
SE_24_CONVEYOR = 24, SE_24_CONVEYOR = 24,
SE_25_PISTON = 25, SE_25_PISTON = 25,
SE_26 = 26, SE_26 = 26,
@ -360,20 +383,32 @@ enum {
SE_31_FLOOR_RISE_FALL = 31, SE_31_FLOOR_RISE_FALL = 31,
SE_32_CEILING_RISE_FALL = 32, SE_32_CEILING_RISE_FALL = 32,
SE_33_QUAKE_DEBRIS = 33, SE_33_QUAKE_DEBRIS = 33,
SE_34 = 34, // XXX
SE_35 = 35, // XXX
SE_36_PROJ_SHOOTER = 36, SE_36_PROJ_SHOOTER = 36,
}; };
// sector lotags // sector lotags
enum { enum {
// left: ST 1 and 2
ST_9_SLIDING_ST_DOOR = 9,
ST_15_WARP_ELEVATOR = 15, ST_15_WARP_ELEVATOR = 15,
ST_16_PLATFORM_DOWN = 16,
ST_17_PLATFORM_UP = 17,
ST_18_ELEVATOR_DOWN = 18,
ST_19_ELEVATOR_UP = 19,
ST_20_CEILING_DOOR = 20, ST_20_CEILING_DOOR = 20,
ST_21_FLOOR_DOOR = 21, ST_21_FLOOR_DOOR = 21,
ST_22_SPLITTING_DOOR = 22, ST_22_SPLITTING_DOOR = 22,
ST_23_SWINGING_DOOR = 23,
ST_25_SLIDING_DOOR = 25,
ST_26_SPLITTING_ST_DOOR = 26, ST_26_SPLITTING_ST_DOOR = 26,
ST_27_STRETCH_BRIDGE = 27,
ST_28_DROP_FLOOR = 28, ST_28_DROP_FLOOR = 28,
ST_29_TEETH_DOOR = 29, ST_29_TEETH_DOOR = 29,
ST_30_ROTATE_RISE_BRIDGE = 30, ST_30_ROTATE_RISE_BRIDGE = 30,
ST_31_TWO_WAY_TRAIN = 31, ST_31_TWO_WAY_TRAIN = 31,
// left: ST 32767, 65534, 65535
}; };
// Cheats // Cheats

View file

@ -152,7 +152,7 @@ static inline int32_t VM_CheckSquished(void)
{ {
sectortype *sc = &sector[vm.g_sp->sectnum]; sectortype *sc = &sector[vm.g_sp->sectnum];
if ((vm.g_sp->picnum == APLAYER && ud.noclip) || sc->lotag == 23) if ((vm.g_sp->picnum == APLAYER && ud.noclip) || sc->lotag == ST_23_SWINGING_DOOR)
return 0; return 0;
{ {
@ -3374,7 +3374,7 @@ nullquote:
&neartagsector,&neartagwall,&neartagsprite,&neartaghitdist, 768, 4+1, NULL); &neartagsector,&neartagwall,&neartagsprite,&neartaghitdist, 768, 4+1, NULL);
if (neartagsector >= 0 && isanearoperator(sector[neartagsector].lotag)) if (neartagsector >= 0 && isanearoperator(sector[neartagsector].lotag))
if ((sector[neartagsector].lotag&0xff) == 23 || sector[neartagsector].floorz == sector[neartagsector].ceilingz) if ((sector[neartagsector].lotag&0xff) == ST_23_SWINGING_DOOR || sector[neartagsector].floorz == sector[neartagsector].ceilingz)
if ((sector[neartagsector].lotag&16384) == 0) if ((sector[neartagsector].lotag&16384) == 0)
if ((sector[neartagsector].lotag&32768) == 0) if ((sector[neartagsector].lotag&32768) == 0)
{ {

View file

@ -517,7 +517,7 @@ int32_t A_Shoot(int32_t i, int32_t atwith)
k = headspritesect[wall[hit.wall].nextsector]; k = headspritesect[wall[hit.wall].nextsector];
while (k >= 0) while (k >= 0)
{ {
if (sprite[k].statnum == 3 && sprite[k].lotag == 13) if (sprite[k].statnum == 3 && sprite[k].lotag == SE_13_EXPLOSIVE)
return -1; return -1;
k = nextspritesect[k]; k = nextspritesect[k];
} }
@ -862,7 +862,7 @@ int32_t A_Shoot(int32_t i, int32_t atwith)
l = headspritesect[wall[hit.wall].nextsector]; l = headspritesect[wall[hit.wall].nextsector];
while (l >= 0) while (l >= 0)
{ {
if (sprite[l].statnum == 3 && sprite[l].lotag == 13) if (sprite[l].statnum == 3 && sprite[l].lotag == SE_13_EXPLOSIVE)
goto DOSKIPBULLETHOLE; goto DOSKIPBULLETHOLE;
l = nextspritesect[l]; l = nextspritesect[l];
} }
@ -1102,7 +1102,7 @@ DOSKIPBULLETHOLE:
k = headspritesect[wall[hit.wall].nextsector]; k = headspritesect[wall[hit.wall].nextsector];
while (k >= 0) while (k >= 0)
{ {
if (sprite[k].statnum == 3 && sprite[k].lotag == 13) if (sprite[k].statnum == 3 && sprite[k].lotag == SE_13_EXPLOSIVE)
return -1; return -1;
k = nextspritesect[k]; k = nextspritesect[k];
} }
@ -1354,7 +1354,7 @@ DOSKIPBULLETHOLE:
l = headspritesect[wall[hit.wall].nextsector]; l = headspritesect[wall[hit.wall].nextsector];
while (l >= 0) while (l >= 0)
{ {
if (sprite[l].statnum == 3 && sprite[l].lotag == 13) if (sprite[l].statnum == 3 && sprite[l].lotag == SE_13_EXPLOSIVE)
goto SKIPBULLETHOLE; goto SKIPBULLETHOLE;
l = nextspritesect[l]; l = nextspritesect[l];
} }

View file

@ -1076,7 +1076,7 @@ static void premap_setup_fixed_sprites(void)
j = nextspritesect[j]; j = nextspritesect[j];
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
if (j<0 && firstrun) if (j<0 && firstrun)
if (sprite[i].lotag==6 || sprite[i].lotag==14) if (sprite[i].lotag==SE_6_SUBWAY || sprite[i].lotag==SE_14_SUBWAY_CAR)
{ {
firstrun = 0; firstrun = 0;
j = actor[i].t_data[9]; j = actor[i].t_data[9];
@ -1203,7 +1203,7 @@ static inline void prelevel(char g)
{ {
if (sprite[i].statnum < MAXSTATUS) if (sprite[i].statnum < MAXSTATUS)
{ {
if (PN == SECTOREFFECTOR && SLT == 14) if (PN == SECTOREFFECTOR && SLT == SE_14_SUBWAY_CAR)
continue; continue;
A_Spawn(-1,i); A_Spawn(-1,i);
} }
@ -1212,7 +1212,7 @@ static inline void prelevel(char g)
for (i=0; i < MAXSPRITES; i++) for (i=0; i < MAXSPRITES; i++)
if (sprite[i].statnum < MAXSTATUS) if (sprite[i].statnum < MAXSTATUS)
{ {
if (PN == SECTOREFFECTOR && SLT == 14) if (PN == SECTOREFFECTOR && SLT == SE_14_SUBWAY_CAR)
A_Spawn(-1,i); A_Spawn(-1,i);
} }
@ -1257,7 +1257,7 @@ static inline void prelevel(char g)
{ {
int32_t t = sprite[j].hitag+32768; int32_t t = sprite[j].hitag+32768;
if (sprite[j].lotag == 12 && tagbitmap[t>>3]&(1<<(t&7))) if (sprite[j].lotag == SE_12_LIGHT_SWITCH && tagbitmap[t>>3]&(1<<(t&7)))
actor[j].t_data[0] = 1; actor[j].t_data[0] = 1;
} }

View file

@ -82,12 +82,12 @@ void G_ResetInterpolations(void)
G_SetInterpolation(&sector[sprite[k].sectnum].floorz); G_SetInterpolation(&sector[sprite[k].sectnum].floorz);
G_SetInterpolation(&sector[sprite[k].sectnum].ceilingz); G_SetInterpolation(&sector[sprite[k].sectnum].ceilingz);
break; break;
case 0: case SE_0_ROTATING_SECTOR:
case 5: case SE_5:
case 6: case SE_6_SUBWAY:
case 11: case SE_11_SWINGING_DOOR:
case 14: case SE_14_SUBWAY_CAR:
case 15: case SE_15_SLIDING_DOOR:
case SE_16_REACTOR: case SE_16_REACTOR:
case SE_26: case SE_26:
case SE_30_TWO_WAY_TRAIN: case SE_30_TWO_WAY_TRAIN:

View file

@ -101,15 +101,15 @@ int32_t G_CheckActivatorMotion(int32_t lotag)
if (s->sectnum == sprite[j].sectnum) if (s->sectnum == sprite[j].sectnum)
switch (sprite[j].lotag) switch (sprite[j].lotag)
{ {
case 11: case SE_11_SWINGING_DOOR:
case SE_30_TWO_WAY_TRAIN: case SE_30_TWO_WAY_TRAIN:
if (actor[j].t_data[4]) if (actor[j].t_data[4])
return(1); return(1);
break; break;
case 20: case SE_20_STRETCH_BRIDGE:
case SE_31_FLOOR_RISE_FALL: case SE_31_FLOOR_RISE_FALL:
case SE_32_CEILING_RISE_FALL: case SE_32_CEILING_RISE_FALL:
case 18: case SE_18_INCREMENTAL_SECTOR_RISE_FALL:
if (actor[j].t_data[0]) if (actor[j].t_data[0])
return(1); return(1);
break; break;
@ -158,11 +158,11 @@ int32_t isanunderoperator(int32_t lotag)
{ {
switch (lotag&0xff) switch (lotag&0xff)
{ {
case 15: case ST_15_WARP_ELEVATOR:
case 16: case ST_16_PLATFORM_DOWN:
case 17: case ST_17_PLATFORM_UP:
case 18: case ST_18_ELEVATOR_DOWN:
case 19: case ST_19_ELEVATOR_UP:
case ST_22_SPLITTING_DOOR: case ST_22_SPLITTING_DOOR:
case ST_26_SPLITTING_ST_DOOR: case ST_26_SPLITTING_ST_DOOR:
return 1; return 1;
@ -174,17 +174,17 @@ int32_t isanearoperator(int32_t lotag)
{ {
switch (lotag&0xff) switch (lotag&0xff)
{ {
case 9: case ST_9_SLIDING_ST_DOOR:
case 15: case ST_15_WARP_ELEVATOR:
case 16: case ST_16_PLATFORM_DOWN:
case 17: case ST_17_PLATFORM_UP:
case 18: case ST_18_ELEVATOR_DOWN:
case 19: case ST_19_ELEVATOR_UP:
case ST_20_CEILING_DOOR: case ST_20_CEILING_DOOR:
case ST_21_FLOOR_DOOR: case ST_21_FLOOR_DOOR:
case ST_22_SPLITTING_DOOR: case ST_22_SPLITTING_DOOR:
case 23: case ST_23_SWINGING_DOOR:
case 25: case ST_25_SLIDING_DOOR:
case ST_26_SPLITTING_ST_DOOR: case ST_26_SPLITTING_ST_DOOR:
case ST_29_TEETH_DOOR://Toothed door case ST_29_TEETH_DOOR://Toothed door
return 1; return 1;
@ -293,7 +293,7 @@ void G_DoSectorAnimations(void)
animategoal[i] = animategoal[g_animateCount]; animategoal[i] = animategoal[g_animateCount];
animatevel[i] = animatevel[g_animateCount]; animatevel[i] = animatevel[g_animateCount];
animatesect[i] = animatesect[g_animateCount]; animatesect[i] = animatesect[g_animateCount];
if (sector[animatesect[i]].lotag == 18 || sector[animatesect[i]].lotag == 19) if (sector[animatesect[i]].lotag == ST_18_ELEVATOR_DOWN || sector[animatesect[i]].lotag == ST_19_ELEVATOR_UP)
if (animateptr[i] == &sector[animatesect[i]].ceilingz) if (animateptr[i] == &sector[animatesect[i]].ceilingz)
continue; continue;
@ -506,7 +506,7 @@ int32_t G_ActivateWarpElevators(int32_t s,int32_t d) //Parm = sectoreffectornum
while (i >= 0) while (i >= 0)
{ {
if (SLT == 17 && SHT == sprite[s].hitag) if (SLT == SE_17_WARP_ELEVATOR && SHT == sprite[s].hitag)
if ((klabs(sector[sn].floorz-actor[s].t_data[2]) > SP) || if ((klabs(sector[sn].floorz-actor[s].t_data[2]) > SP) ||
(sector[SECT].hitag == (sector[sn].hitag-d))) (sector[SECT].hitag == (sector[sn].hitag-d)))
break; break;
@ -521,7 +521,7 @@ int32_t G_ActivateWarpElevators(int32_t s,int32_t d) //Parm = sectoreffectornum
i = headspritestat[STAT_EFFECTOR]; i = headspritestat[STAT_EFFECTOR];
do do
{ {
if (SLT == 17 && SHT == sprite[s].hitag) if (SLT == SE_17_WARP_ELEVATOR && SHT == sprite[s].hitag)
T1 = T2 = d; //Make all check warp T1 = T2 = d; //Make all check warp
i = nextspritestat[i]; i = nextspritestat[i];
} }
@ -562,17 +562,17 @@ void G_OperateSectors(int32_t sn, int32_t ii)
{ {
g_haltSoundHack = 1; g_haltSoundHack = 1;
sptr->lotag &= 0xff00; sptr->lotag &= 0xff00;
sptr->lotag |= 22; // ST_22_SPLITTING_DOOR? sptr->lotag |= ST_22_SPLITTING_DOOR;
G_OperateSectors(sn,ii); G_OperateSectors(sn,ii);
sptr->lotag &= 0xff00; sptr->lotag &= 0xff00;
sptr->lotag |= 9; sptr->lotag |= ST_9_SLIDING_ST_DOOR;
G_OperateSectors(sn,ii); G_OperateSectors(sn,ii);
sptr->lotag &= 0xff00; sptr->lotag &= 0xff00;
sptr->lotag |= 26; // ST_26_SPLITTING_ST_DOOR? sptr->lotag |= ST_26_SPLITTING_ST_DOOR;
} }
return; return;
case 9: case ST_9_SLIDING_ST_DOOR:
{ {
int32_t dax,day,dax2,day2,sp; int32_t dax,day,dax2,day2,sp;
int32_t wallfind[2]; int32_t wallfind[2];
@ -667,7 +667,7 @@ void G_OperateSectors(int32_t sn, int32_t ii)
i = headspritesect[sn]; i = headspritesect[sn];
while (i >= 0) while (i >= 0)
{ {
if (PN==SECTOREFFECTOR && SLT == 17) break; if (PN==SECTOREFFECTOR && SLT == SE_17_WARP_ELEVATOR) break;
i = nextspritesect[i]; i = nextspritesect[i];
} }
@ -689,8 +689,8 @@ void G_OperateSectors(int32_t sn, int32_t ii)
return; return;
case 16: case ST_16_PLATFORM_DOWN:
case 17: case ST_17_PLATFORM_UP:
i = GetAnimationGoal(&sptr->floorz); i = GetAnimationGoal(&sptr->floorz);
@ -714,8 +714,8 @@ void G_OperateSectors(int32_t sn, int32_t ii)
return; return;
case 18: case ST_18_ELEVATOR_DOWN:
case 19: case ST_19_ELEVATOR_UP:
i = GetAnimationGoal(&sptr->floorz); i = GetAnimationGoal(&sptr->floorz);
@ -738,7 +738,7 @@ void G_OperateSectors(int32_t sn, int32_t ii)
i = headspritestat[STAT_EFFECTOR]; //Effectors i = headspritestat[STAT_EFFECTOR]; //Effectors
while (i >= 0) while (i >= 0)
{ {
if ((SLT == 22) && if ((SLT == SE_22_TEETH_DOOR) &&
(SHT == sptr->hitag)) (SHT == sptr->hitag))
{ {
sector[SECT].extra = -sector[SECT].extra; sector[SECT].extra = -sector[SECT].extra;
@ -789,7 +789,7 @@ REDODOOR:
i = headspritesect[sn]; i = headspritesect[sn];
while (i >= 0) while (i >= 0)
{ {
if (sprite[i].statnum == STAT_EFFECTOR && SLT==9) if (sprite[i].statnum == STAT_EFFECTOR && SLT==SE_9_DOWN_OPEN_DOOR_LIGHTS)
{ {
j = SZ; j = SZ;
break; break;
@ -874,7 +874,7 @@ REDODOOR:
return; return;
case 23: //Swingdoor case ST_23_SWINGING_DOOR: //Swingdoor
j = -1; j = -1;
q = 0; q = 0;
@ -882,7 +882,7 @@ REDODOOR:
i = headspritestat[STAT_EFFECTOR]; i = headspritestat[STAT_EFFECTOR];
while (i >= 0) while (i >= 0)
{ {
if (SLT == 11 && SECT == sn && !T5) if (SLT == SE_11_SWINGING_DOOR && SECT == sn && !T5)
{ {
j = i; j = i;
break; break;
@ -901,7 +901,7 @@ REDODOOR:
i = headspritestat[STAT_EFFECTOR]; i = headspritestat[STAT_EFFECTOR];
while (i >= 0) while (i >= 0)
{ {
if (l == (sector[SECT].lotag&0x8000) && SLT == 11 && sprite[j].hitag == SHT && !T5) if (l == (sector[SECT].lotag&0x8000) && SLT == SE_11_SWINGING_DOOR && sprite[j].hitag == SHT && !T5)
{ {
if (sector[SECT].lotag&0x8000) sector[SECT].lotag &= 0x7fff; if (sector[SECT].lotag&0x8000) sector[SECT].lotag &= 0x7fff;
else sector[SECT].lotag |= 0x8000; else sector[SECT].lotag |= 0x8000;
@ -918,12 +918,12 @@ REDODOOR:
} }
return; return;
case 25: //Subway type sliding doors case ST_25_SLIDING_DOOR: //Subway type sliding doors
j = headspritestat[STAT_EFFECTOR]; j = headspritestat[STAT_EFFECTOR];
while (j >= 0)//Find the sprite while (j >= 0)//Find the sprite
{ {
if ((sprite[j].lotag) == 15 && sprite[j].sectnum == sn) if ((sprite[j].lotag) == SE_15_SLIDING_DOOR && sprite[j].sectnum == sn)
break; //Found the sectoreffector. break; //Found the sectoreffector.
j = nextspritestat[j]; j = nextspritestat[j];
} }
@ -936,7 +936,7 @@ REDODOOR:
{ {
if (SHT==sprite[j].hitag) if (SHT==sprite[j].hitag)
{ {
if (SLT == 15) if (SLT == SE_15_SLIDING_DOOR)
{ {
sector[SECT].lotag ^= 0x8000; // Toggle the open or close sector[SECT].lotag ^= 0x8000; // Toggle the open or close
SA += 1024; SA += 1024;
@ -950,12 +950,12 @@ REDODOOR:
} }
return; return;
case 27: //Extended bridge case ST_27_STRETCH_BRIDGE: //Extended bridge
j = headspritestat[STAT_EFFECTOR]; j = headspritestat[STAT_EFFECTOR];
while (j >= 0) while (j >= 0)
{ {
if ((sprite[j].lotag&0xff)==20 && sprite[j].sectnum == sn) //Bridge if ((sprite[j].lotag&0xff)==SE_20_STRETCH_BRIDGE && sprite[j].sectnum == sn) //Bridge
{ {
sector[sn].lotag ^= 0x8000; sector[sn].lotag ^= 0x8000;
@ -1095,7 +1095,7 @@ void G_OperateActivators(int32_t low,int32_t snum)
case SE_36_PROJ_SHOOTER: case SE_36_PROJ_SHOOTER:
case SE_31_FLOOR_RISE_FALL: case SE_31_FLOOR_RISE_FALL:
case SE_32_CEILING_RISE_FALL: case SE_32_CEILING_RISE_FALL:
case 18: case SE_18_INCREMENTAL_SECTOR_RISE_FALL:
actor[j].t_data[0] = 1-actor[j].t_data[0]; actor[j].t_data[0] = 1-actor[j].t_data[0];
A_CallSound(SECT,j); A_CallSound(SECT,j);
break; break;
@ -1567,7 +1567,7 @@ int32_t P_ActivateSwitch(int32_t snum,int32_t w,int32_t switchissprite)
{ {
switch (sprite[x].lotag) switch (sprite[x].lotag)
{ {
case 12: case SE_12_LIGHT_SWITCH:
sector[sprite[x].sectnum].floorpal = 0; sector[sprite[x].sectnum].floorpal = 0;
actor[x].t_data[0]++; actor[x].t_data[0]++;
if (actor[x].t_data[0] == 2) if (actor[x].t_data[0] == 2)
@ -1575,7 +1575,7 @@ int32_t P_ActivateSwitch(int32_t snum,int32_t w,int32_t switchissprite)
break; break;
case SE_24_CONVEYOR: case SE_24_CONVEYOR:
case 34: case SE_34:
case SE_25_PISTON: case SE_25_PISTON:
actor[x].t_data[4] = !actor[x].t_data[4]; actor[x].t_data[4] = !actor[x].t_data[4];
if (actor[x].t_data[4]) if (actor[x].t_data[4])
@ -1945,7 +1945,7 @@ int32_t Sect_DamageCeiling(int32_t sn)
i = headspritesect[sn]; i = headspritesect[sn];
while (i >= 0) while (i >= 0)
{ {
if (PN == SECTOREFFECTOR && SLT == 12) if (PN == SECTOREFFECTOR && SLT == SE_12_LIGHT_SWITCH)
{ {
j = headspritestat[STAT_EFFECTOR]; j = headspritestat[STAT_EFFECTOR];
while (j >= 0) while (j >= 0)
@ -2445,7 +2445,7 @@ void allignwarpelevators(void)
while (i >= 0) while (i >= 0)
{ {
if (SLT == 17 && SS > 16) if (SLT == SE_17_WARP_ELEVATOR && SS > 16)
{ {
j = headspritestat[STAT_EFFECTOR]; j = headspritestat[STAT_EFFECTOR];
while (j >= 0) while (j >= 0)

View file

@ -451,7 +451,7 @@ static int32_t S_CalcDistAndAng(int32_t i, int32_t num, int32_t camsect, int32_t
} }
} }
if ((g_sounds[num].m&16) == 0 && PN == MUSICANDSFX && SLT < 999 && (sector[SECT].lotag&0xff) < 9) if ((g_sounds[num].m&16) == 0 && PN == MUSICANDSFX && SLT < 999 && (sector[SECT].lotag&0xff) < 9) // ST_9_SLIDING_ST_DOOR
sndist = divscale14(sndist, SHT+1); sndist = divscale14(sndist, SHT+1);
sound_further_processing: sound_further_processing: