Adapt setup of vertex-based slopes to UDMF

This commit is contained in:
MascaraSnake 2020-01-06 15:34:28 +01:00
parent f13abd5400
commit ddb1a19490
2 changed files with 51 additions and 24 deletions

View file

@ -2678,6 +2678,48 @@ static void P_ConvertBinaryMap(void)
lines[i].special = 700;
break;
}
case 704: //Slope front sector floor by 3 tagged vertices
case 705: //Slope front sector ceiling by 3 tagged vertices
case 714: //Slope back sector floor by 3 tagged vertices
case 715: //Slope back sector ceiling by 3 tagged vertices
{
if (lines[i].special == 704)
lines[i].args[0] = 0;
else if (lines[i].special == 705)
lines[i].args[0] = 1;
else if (lines[i].special == 714)
lines[i].args[0] = 2;
else if (lines[i].special == 715)
lines[i].args[0] = 3;
lines[i].args[1] = lines[i].tag;
if (lines[i].flags & ML_EFFECT6)
{
UINT8 side = lines[i].special >= 714;
if (side == 1 && lines[i].sidenum[1] == 0xffff)
CONS_Debug(DBG_GAMELOGIC, "P_ConvertBinaryMap: Line special %d (line #%s) missing 2nd side!\n", lines[i].special, sizeu1(i));
else
{
lines[i].args[2] = sides[lines[i].sidenum[side]].textureoffset >> FRACBITS;
lines[i].args[3] = sides[lines[i].sidenum[side]].rowoffset >> FRACBITS;
}
}
else
{
lines[i].args[2] = lines[i].args[1];
lines[i].args[3] = lines[i].args[1];
}
if (lines[i].flags & ML_NETONLY)
lines[i].args[4] |= SL_NOPHYSICS;
if (lines[i].flags & ML_NONET)
lines[i].args[4] |= SL_DYNAMIC;
lines[i].special = 704;
break;
}
default:
break;
}

View file

@ -458,44 +458,32 @@ static void line_SpawnViaVertexes(const int linenum, const boolean spawnthinker)
line_t *line = lines + linenum;
side_t *side;
pslope_t **slopetoset;
UINT16 tag1, tag2, tag3;
UINT16 tag1 = line->args[1];
UINT16 tag2 = line->args[2];
UINT16 tag3 = line->args[3];
UINT8 flags = line->args[4];
UINT8 flags = 0;
if (line->flags & ML_NETONLY)
flags |= SL_NOPHYSICS;
if (line->flags & ML_NONET)
flags |= SL_DYNAMIC;
switch(line->special)
switch(line->args[0])
{
case 704:
case 0:
slopetoset = &line->frontsector->f_slope;
side = &sides[line->sidenum[0]];
break;
case 705:
case 1:
slopetoset = &line->frontsector->c_slope;
side = &sides[line->sidenum[0]];
break;
case 714:
case 2:
slopetoset = &line->backsector->f_slope;
side = &sides[line->sidenum[1]];
break;
case 715:
case 3:
slopetoset = &line->backsector->c_slope;
side = &sides[line->sidenum[1]];
default:
return;
}
if (line->flags & ML_EFFECT6)
{
tag1 = line->tag;
tag2 = side->textureoffset >> FRACBITS;
tag3 = side->rowoffset >> FRACBITS;
}
else
tag1 = tag2 = tag3 = line->tag;
*slopetoset = MakeViaMapthings(tag1, tag2, tag3, flags, spawnthinker);
side->sector->hasslope = true;
@ -561,9 +549,6 @@ void P_ResetDynamicSlopes(const boolean fromsave) {
break;
case 704:
case 705:
case 714:
case 715:
line_SpawnViaVertexes(i, !fromsave);
break;