Update birdslopes to use args

This commit is contained in:
Sally Coolatta 2022-10-10 10:16:40 -04:00
parent c2cc847746
commit 983304f361
5 changed files with 70 additions and 38 deletions

View file

@ -11648,7 +11648,7 @@ static boolean P_SpawnNonMobjMapThing(mapthing_t *mthing)
return true; return true;
} }
else if (mthing->type == 750 // Slope vertex point (formerly chaos spawn) else if (mthing->type == 750 // Slope vertex point (formerly chaos spawn)
|| (mthing->type == 777 || mthing->type == 778) // Slope anchors || (mthing->type == FLOOR_SLOPE_THING || mthing->type == CEILING_SLOPE_THING) // Slope anchors
|| (mthing->type >= 600 && mthing->type <= 611) // Special placement patterns || (mthing->type >= 600 && mthing->type <= 611) // Special placement patterns
|| mthing->type == 1713) // Hoops || mthing->type == 1713) // Hoops
{ {

View file

@ -5751,6 +5751,29 @@ static void P_ConvertBinaryLinedefTypes(void)
case 799: //Set dynamic slope vertex to front sector height case 799: //Set dynamic slope vertex to front sector height
lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB); lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB);
break; break;
case LT_SLOPE_ANCHORS_OLD_FLOOR: //Slope front sector floor by 3 tagged vertices
case LT_SLOPE_ANCHORS_OLD_CEILING: //Slope front sector ceiling by 3 tagged vertices
case LT_SLOPE_ANCHORS_OLD: //Slope back sector floor by 3 tagged vertices
{
if (lines[i].special == LT_SLOPE_ANCHORS_OLD_FLOOR)
lines[i].args[0] = TMSA_FLOOR;
else if (lines[i].special == LT_SLOPE_ANCHORS_OLD_CEILING)
lines[i].args[0] = TMSA_CEILING;
else if (lines[i].special == LT_SLOPE_ANCHORS_OLD)
lines[i].args[0] = (TMSA_FLOOR|TMSA_CEILING);
if (lines[i].flags & ML_NETONLY)
lines[i].args[1] |= TMSAF_NOPHYSICS;
if (lines[i].flags & ML_NONET)
lines[i].args[1] |= TMSAF_DYNAMIC;
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[1] |= TMSAF_BACKSIDE;
if (lines[i].flags & ML_BLOCKMONSTERS)
lines[i].args[1] |= TMSAF_MIRROR;
lines[i].special = LT_SLOPE_ANCHORS;
break;
}
case 909: //Fog wall case 909: //Fog wall
lines[i].blendmode = AST_FOG; lines[i].blendmode = AST_FOG;
break; break;
@ -6545,6 +6568,10 @@ static void P_ConvertBinaryThingTypes(void)
mapthings[i].args[2] |= TMBCF_BACKANDFORTH; mapthings[i].args[2] |= TMBCF_BACKANDFORTH;
} }
break; break;
case FLOOR_SLOPE_THING:
case CEILING_SLOPE_THING:
Tag_FSet(&mapthings[i].tags, mapthings[i].extrainfo);
break;
default: default:
break; break;
} }

View file

@ -48,6 +48,20 @@ typedef enum
TMSL_COPY = 1<<2, TMSL_COPY = 1<<2,
} textmapslopeflags_t; } textmapslopeflags_t;
typedef enum
{
TMSA_FLOOR = 1,
TMSA_CEILING = 1<<1,
} textmapslopeanchor_t;
typedef enum
{
TMSAF_NOPHYSICS = 1,
TMSAF_DYNAMIC = 1<<1,
TMSAF_BACKSIDE = 1<<2,
TMSAF_MIRROR = 1<<3,
} textmapslopeanchorflags_t;
void P_LinkSlopeThinkers (void); void P_LinkSlopeThinkers (void);
void P_UpdateSlopeLightOffset(pslope_t *slope); void P_UpdateSlopeLightOffset(pslope_t *slope);

View file

@ -1119,9 +1119,12 @@ void P_CalcHeight(player_t *player);
/* line specials */ /* line specials */
enum enum
{ {
LT_SLOPE_ANCHORS_FLOOR = 777, LT_SLOPE_ANCHORS = 777,
LT_SLOPE_ANCHORS_CEILING = 778,
LT_SLOPE_ANCHORS = 779, // binary converter
LT_SLOPE_ANCHORS_OLD_FLOOR = 777,
LT_SLOPE_ANCHORS_OLD_CEILING = 778,
LT_SLOPE_ANCHORS_OLD = 779,
}; };
#endif #endif

View file

@ -199,7 +199,7 @@ get_anchor
for (i = 0; i < list->count; ++i) for (i = 0; i < list->count; ++i)
{ {
if (list->points[i] == v && list->anchors[i]->extrainfo == tag) if (list->points[i] == v && Tag_FGet(&list->anchors[i]->tags) == tag)
{ {
for (k = 0; k < 3; ++k) for (k = 0; k < 3; ++k)
{ {
@ -347,12 +347,12 @@ new_vertex_slope
{anchors[2]->x << FRACBITS, anchors[2]->y << FRACBITS, anchors[2]->z << FRACBITS} {anchors[2]->x << FRACBITS, anchors[2]->y << FRACBITS, anchors[2]->z << FRACBITS}
}; };
if (flags & ML_NETONLY) if (flags & TMSAF_NOPHYSICS)
{ {
slope->flags |= SL_NOPHYSICS; slope->flags |= SL_NOPHYSICS;
} }
if (flags & ML_NONET) if (flags & TMSAF_DYNAMIC)
{ {
slope->flags |= SL_DYNAMIC; slope->flags |= SL_DYNAMIC;
} }
@ -410,8 +410,8 @@ slope_sector
{ {
(*slope) = new_vertex_slope(anchors, flags); (*slope) = new_vertex_slope(anchors, flags);
/* Effect 6 - invert slope to opposite side */ /* invert slope to opposite side */
if (flags & ML_BLOCKMONSTERS) if (flags & TMSAF_MIRROR)
{ {
(*alt) = new_vertex_slope(flip_slope(anchors, sector), flags); (*alt) = new_vertex_slope(flip_slope(anchors, sector), flags);
} }
@ -426,36 +426,30 @@ make_anchored_slope
const line_t * line, const line_t * line,
const int plane const int plane
){ ){
enum INT16 flags = line->args[1];
{
FLOOR = 0x1,
CEILING = 0x2,
};
INT16 flags = line->flags; const int side = ( flags & TMSAF_BACKSIDE ) != 0;
const int side = ( flags & ML_NOCLIMB ) != 0;
sector_t * s; sector_t * s;
mtag_t tag = Tag_FGet(&line->tags); mtag_t tag = Tag_FGet(&line->tags);
if (side == 0 || flags & ML_TWOSIDED) if (side == 0 || (line->flags & ML_TWOSIDED))
{ {
s = sides[line->sidenum[side]].sector; s = sides[line->sidenum[side]].sector;
if (plane == (FLOOR|CEILING)) if (plane == (TMSA_FLOOR|TMSA_CEILING))
{ {
flags &= ~ML_BLOCKMONSTERS; flags &= ~TMSAF_MIRROR;
} }
if (plane & FLOOR) if (plane & TMSA_FLOOR)
{ {
slope_sector slope_sector
(&s->f_slope, &s->c_slope, s, flags, &floor_anchors, tag); (&s->f_slope, &s->c_slope, s, flags, &floor_anchors, tag);
} }
if (plane & CEILING) if (plane & TMSA_CEILING)
{ {
slope_sector slope_sector
(&s->c_slope, &s->f_slope, s, flags, &ceiling_anchors, tag); (&s->c_slope, &s->f_slope, s, flags, &ceiling_anchors, tag);
@ -469,27 +463,21 @@ static void P_BuildSlopeAnchorList (void) {
} }
static void P_SetupAnchoredSlopes (void) { static void P_SetupAnchoredSlopes (void) {
enum
{
FLOOR = 0x1,
CEILING = 0x2,
};
size_t i; size_t i;
for (i = 0; i < numlines; ++i) for (i = 0; i < numlines; ++i)
{ {
if (lines[i].special == LT_SLOPE_ANCHORS_FLOOR) if (lines[i].special == LT_SLOPE_ANCHORS)
{ {
make_anchored_slope(&lines[i], FLOOR); int plane = (lines[i].args[0] & (TMSA_FLOOR|TMSA_CEILING));
}
else if (lines[i].special == LT_SLOPE_ANCHORS_CEILING) if (plane == 0)
{ {
make_anchored_slope(&lines[i], CEILING); CONS_Alert(CONS_WARNING, "Slope anchor linedef %u has no planes set.\n", i);
} continue;
else if (lines[i].special == LT_SLOPE_ANCHORS) }
{
make_anchored_slope(&lines[i], FLOOR|CEILING); make_anchored_slope(&lines[i], plane);
} }
} }
} }