Store custom FOF flags directly in back toptexture field at map load instead of re-reading the sidedefs data later on
This commit is contained in:
parent
b333770a3b
commit
abdfe60aa7
|
@ -1179,6 +1179,20 @@ static void P_LoadSidedefs(UINT8 *data)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 259: // Custom FOF
|
||||||
|
if (!isfrontside)
|
||||||
|
{
|
||||||
|
if ((msd->toptexture[0] >= '0' && msd->toptexture[0] <= '9')
|
||||||
|
|| (msd->toptexture[0] >= 'A' && msd->toptexture[0] <= 'F'))
|
||||||
|
sd->toptexture = axtoi(msd->toptexture);
|
||||||
|
else
|
||||||
|
I_Error("Custom FOF (tag %d) needs a value in the linedef's back side upper texture field.", sd->line->tag);
|
||||||
|
|
||||||
|
sd->midtexture = R_TextureNumForName(msd->midtexture);
|
||||||
|
sd->bottomtexture = R_TextureNumForName(msd->bottomtexture);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// FALLTHRU
|
||||||
default: // normal cases
|
default: // normal cases
|
||||||
if (msd->toptexture[0] == '#')
|
if (msd->toptexture[0] == '#')
|
||||||
{
|
{
|
||||||
|
|
32
src/p_spec.c
32
src/p_spec.c
|
@ -7179,38 +7179,14 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
EV_AddLaserThinker(§ors[s], §ors[sec], lines + i, secthinkers);
|
EV_AddLaserThinker(§ors[s], §ors[sec], lines + i, secthinkers);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 259: // Make-Your-Own FOF!
|
case 259: // Custom FOF
|
||||||
if (lines[i].sidenum[1] != 0xffff)
|
if (lines[i].sidenum[1] != 0xffff)
|
||||||
{
|
{
|
||||||
UINT8 *data;
|
ffloortype_e fofflags = sides[lines[i].sidenum[1]].toptexture;
|
||||||
UINT16 b;
|
P_AddFakeFloorsByLine(i, fofflags, secthinkers);
|
||||||
|
|
||||||
if (!virt)
|
|
||||||
virt = vres_GetMap(lastloadedmaplumpnum);
|
|
||||||
|
|
||||||
data = (UINT8*) vres_Find(virt, "SIDEDEFS")->data;
|
|
||||||
|
|
||||||
for (b = 0; b < (INT16)numsides; b++)
|
|
||||||
{
|
|
||||||
register mapsidedef_t *msd = (mapsidedef_t *)data + b;
|
|
||||||
|
|
||||||
if (b == lines[i].sidenum[1])
|
|
||||||
{
|
|
||||||
if ((msd->toptexture[0] >= '0' && msd->toptexture[0] <= '9')
|
|
||||||
|| (msd->toptexture[0] >= 'A' && msd->toptexture[0] <= 'F'))
|
|
||||||
{
|
|
||||||
ffloortype_e FOF_Flags = axtoi(msd->toptexture);
|
|
||||||
|
|
||||||
P_AddFakeFloorsByLine(i, FOF_Flags, secthinkers);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
I_Error("Make-Your-Own-FOF (tag %d) needs a value in the linedef's second side upper texture field.", lines[i].tag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
I_Error("Make-Your-Own FOF (tag %d) found without a 2nd linedef side!", lines[i].tag);
|
I_Error("Custom FOF (tag %d) found without a linedef back side!", lines[i].tag);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 300: // Linedef executor (combines with sector special 974/975) and commands
|
case 300: // Linedef executor (combines with sector special 974/975) and commands
|
||||||
|
|
Loading…
Reference in a new issue