Add enums for textmap FOF values

This commit is contained in:
MascaraSnake 2020-04-18 18:02:43 +02:00
parent 8e5effa07b
commit 1d3aa7129a
5 changed files with 150 additions and 87 deletions

View file

@ -1689,7 +1689,7 @@ static void P_PushableCheckBustables(mobj_t *mo)
if (!(rover->flags & FF_BUSTUP)) continue;
// Bustable by pushables?
if (!(rover->master->args[3] & 1)) continue;
if (!(rover->master->args[3] & TMFB_PUSHABLES)) continue;
if (!rover->master->frontsector->crumblestate)
{

View file

@ -2810,24 +2810,24 @@ static void P_ConvertBinaryMap(void)
//Visibility
if (lines[i].special == 105)
lines[i].args[1] = 3;
lines[i].args[1] = TMFV_NOPLANES|TMFV_NOSIDES;
else if (lines[i].special == 104)
lines[i].args[1] = 2;
lines[i].args[1] = TMFV_NOSIDES;
else if (lines[i].special == 103)
lines[i].args[1] = 1;
lines[i].args[1] = TMFV_NOPLANES;
//Tangibility
if (lines[i].flags & ML_EFFECT1)
lines[i].args[2] |= 8;
lines[i].args[2] |= TMFT_DONTBLOCKOTHERS;
if (lines[i].flags & ML_EFFECT2)
lines[i].args[2] |= 4;
lines[i].args[2] |= TMFT_DONTBLOCKPLAYER;
//Translucency
if (lines[i].special == 102)
{
lines[i].args[3] |= 1;
lines[i].args[3] |= TMFA_TRANSLUCENT;
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[1] |= 4;
lines[i].args[1] |= TMFV_TOGGLEINSIDES;
if (sides[lines[i].sidenum[0]].toptexture > 0)
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS)/255;
else
@ -2836,7 +2836,7 @@ static void P_ConvertBinaryMap(void)
//Shadow?
if (lines[i].special != 100 && (lines[i].special != 104 || !(lines[i].flags & ML_NOCLIMB)))
lines[i].args[3] |= 1;
lines[i].args[3] |= TMFA_NOSHADE;
lines[i].special = 100;
break;
@ -2850,7 +2850,7 @@ static void P_ConvertBinaryMap(void)
//Opaque?
if (lines[i].special == 120 || lines[i].special == 122)
lines[i].args[1] |= 1;
lines[i].args[1] |= TMFW_OPAQUE;
else
{
if (sides[lines[i].sidenum[0]].toptexture > 0)
@ -2861,19 +2861,19 @@ static void P_ConvertBinaryMap(void)
//No sides?
if (lines[i].special == 122 || lines[i].special == 123 || lines[i].special == 125)
lines[i].args[1] |= 2;
lines[i].args[1] |= TMFW_NOSIDES;
//Flags
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[1] |= 4;
lines[i].args[1] |= TMFW_DOUBLESHADOW;
if (lines[i].flags & ML_EFFECT4)
lines[i].args[1] |= 8;
lines[i].args[1] |= TMFW_COLORMAPONLY;
if (!(lines[i].flags & ML_EFFECT5))
lines[i].args[1] |= 16;
lines[i].args[1] |= TMFW_NORIPPLE;
//Goo?
if (lines[i].special >= 124)
lines[i].args[1] |= 32;
lines[i].args[1] |= TMFW_GOOWATER;
lines[i].special = 120;
break;
@ -2888,29 +2888,29 @@ static void P_ConvertBinaryMap(void)
//Visibility
if (lines[i].special == 142 || lines[i].special == 145)
lines[i].args[1] = 2;
lines[i].args[1] = TMFV_NOSIDES;
else if (lines[i].special == 146)
lines[i].args[1] = 1;
lines[i].args[1] = TMFV_NOPLANES;
//Tangibility
if (lines[i].special <= 142)
lines[i].args[2] |= 2;
lines[i].args[2] |= TMFT_INTANGIBLEBOTTOM;
else if (lines[i].special <= 145)
lines[i].args[2] |= 1;
lines[i].args[2] |= TMFT_INTANGIBLETOP;
else
lines[i].args[2] |= 3;
lines[i].args[2] |= TMFT_INTANGIBLEBOTTOM|TMFT_INTANGIBLETOP;
if (lines[i].flags & ML_EFFECT1)
lines[i].args[2] |= 8;
lines[i].args[2] |= TMFT_DONTBLOCKOTHERS;
if (lines[i].flags & ML_EFFECT2)
lines[i].args[2] |= 4;
lines[i].args[2] |= TMFT_DONTBLOCKPLAYER;
//Translucency
if (lines[i].special == 141 || lines[i].special == 142 || lines[i].special == 144 || lines[i].special == 145)
{
lines[i].args[3] |= 1;
lines[i].args[3] |= TMFA_TRANSLUCENT;
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[1] |= 4;
lines[i].args[1] |= TMFV_TOGGLEINSIDES;
if (sides[lines[i].sidenum[0]].toptexture > 0)
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS)/255;
else
@ -2919,7 +2919,7 @@ static void P_ConvertBinaryMap(void)
//Shadow?
if (lines[i].special != 146 && (lines[i].flags & ML_NOCLIMB))
lines[i].args[3] |= 2;
lines[i].args[3] |= TMFA_NOSHADE;
lines[i].special = 100;
break;
@ -2937,24 +2937,24 @@ static void P_ConvertBinaryMap(void)
lines[i].args[0] = lines[i].tag;
if (lines[i].special >= 172 && lines[i].special <= 175)
{
lines[i].args[1] |= 2; //Intangible from below
lines[i].args[1] |= TMFT_INTANGIBLEBOTTOM;
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[2] |= 2; //Don't cast shadow
lines[i].args[2] |= TMFC_NOSHADE;
}
if (lines[i].special >= 174 && lines[i].special <= 175)
{
lines[i].args[2] |= 1; //Translucent
lines[i].args[2] |= TMFC_TRANSLUCENT;
if (sides[lines[i].sidenum[0]].toptexture > 0)
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS)/255;
else
lines[i].alpha = FRACUNIT/2;
}
if (lines[i].special % 2 == 1)
lines[i].args[2] |= 4; //Don't respawn
lines[i].args[2] |= TMFC_NORETURN;
if (lines[i].special == 176 || lines[i].special == 177 || lines[i].special == 180)
lines[i].args[2] |= 8; //Air bobbing
lines[i].args[2] |= TMFC_AIRBOB;
if (lines[i].special >= 176 && lines[i].special <= 179)
lines[i].args[2] |= 16; //Float on water
lines[i].args[2] |= TMFC_FLOATBOB;
lines[i].special = 170;
break;
case 200: //FOF: Light block
@ -2975,30 +2975,30 @@ static void P_ConvertBinaryMap(void)
//Visibility
if (lines[i].special == 222)
lines[i].args[1] |= 1; //Don't render planes
lines[i].args[1] |= TMFV_NOPLANES;
if (lines[i].special == 221)
lines[i].args[1] |= 4; //Don't render insides
lines[i].args[1] |= TMFV_TOGGLEINSIDES;
//Appearance
if (lines[i].special == 221)
{
lines[i].args[2] |= 1; //Translucent
lines[i].args[2] |= TMFA_TRANSLUCENT;
if (sides[lines[i].sidenum[0]].toptexture > 0)
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS)/255;
else
lines[i].alpha = FRACUNIT/2;
}
if (lines[i].special != 220 && !(lines[i].flags & ML_NOCLIMB))
lines[i].args[2] |= 2; //Don't cast shadow
lines[i].args[2] |= TMFA_NOSHADE;
lines[i].special = 220;
break;
case 250: //FOF: Mario block
lines[i].args[0] = lines[i].tag;
if (lines[i].flags & ML_NOCLIMB) //Brick block
lines[i].args[1] |= 1;
if (lines[i].flags & ML_EFFECT1) //Invisible
lines[i].args[1] |= 2;
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[1] |= TMFM_BRICK;
if (lines[i].flags & ML_EFFECT1)
lines[i].args[1] |= TMFM_INVISIBLE;
break;
case 251: //FOF: Thwomp block
lines[i].args[0] = lines[i].tag;
@ -3029,18 +3029,18 @@ static void P_ConvertBinaryMap(void)
//Bustable type
if (lines[i].special <= 253)
lines[i].args[1] = 0;
lines[i].args[1] = TMFB_TOUCH;
else if (lines[i].special >= 255)
lines[i].args[1] = 1;
lines[i].args[1] = TMFB_SPIN;
else if (lines[i].flags & ML_NOCLIMB)
lines[i].args[1] = 3;
lines[i].args[1] = TMFB_STRONG;
else
lines[i].args[1] = 2;
lines[i].args[1] = TMFB_REGULAR;
//Translucency
if (lines[i].special == 253 || lines[i].special == 256)
{
lines[i].args[2] = 1;
lines[i].args[2] = TMFC_TRANSLUCENT;
if (sides[lines[i].sidenum[0]].toptexture > 0)
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS)/255;
else
@ -3048,14 +3048,14 @@ static void P_ConvertBinaryMap(void)
}
if (lines[i].flags & ML_EFFECT4)
lines[i].args[3] |= 1; //Bustable by pushables
lines[i].args[3] |= TMFB_PUSHABLES;
if (lines[i].flags & ML_EFFECT5)
{
lines[i].args[3] |= 2; //Trigger linedef executor
lines[i].args[3] |= TMFB_EXECUTOR;
lines[i].args[4] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
}
if (lines[i].special == 252 && lines[i].flags & ML_NOCLIMB)
lines[i].args[4] |= 4; //Bust only from below
lines[i].args[4] |= TMFB_ONLYBOTTOM;
lines[i].special = 254;
break;

View file

@ -6736,11 +6736,11 @@ void P_SpawnSpecials(boolean fromnetsave)
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL;
//Visibility settings
if (lines[i].args[1] & 1) //Don't render planes
if (lines[i].args[1] & TMFV_NOPLANES)
ffloorflags &= ~FF_RENDERPLANES;
if (lines[i].args[1] & 2) //Don't render sides
if (lines[i].args[1] & TMFV_NOSIDES)
ffloorflags &= ~FF_RENDERSIDES;
if (lines[i].args[1] & 4) //Render insides
if (lines[i].args[1] & TMFV_TOGGLEINSIDES)
{
if (ffloorflags & FF_RENDERPLANES)
ffloorflags |= FF_BOTHPLANES;
@ -6749,26 +6749,26 @@ void P_SpawnSpecials(boolean fromnetsave)
}
//Tangibility settings
if (lines[i].args[2] & 1) //Intangible from top
if (lines[i].args[2] & TMFT_INTANGIBLETOP)
ffloorflags |= FF_REVERSEPLATFORM;
if (lines[i].args[2] & 2) //Intangible from bottom
if (lines[i].args[2] & TMFT_INTANGIBLEBOTTOM)
ffloorflags |= FF_PLATFORM;
if (lines[i].args[2] & 4) //Don't block player
if (lines[i].args[2] & TMFT_DONTBLOCKPLAYER)
ffloorflags &= ~FF_BLOCKPLAYER;
if (lines[i].args[2] & 8) //Don't block others
if (lines[i].args[2] & TMFT_DONTBLOCKOTHERS)
ffloorflags &= ~FF_BLOCKOTHERS;
//Appearance settings
if ((lines[i].args[3] & 1) && (ffloorflags & FF_RENDERALL)) //Translucent
if ((lines[i].args[3] & TMFA_TRANSLUCENT) && (ffloorflags & FF_RENDERALL)) //Translucent
ffloorflags |= FF_TRANSLUCENT;
if (lines[i].args[3] & 2) //Don't cast shadow
if (lines[i].args[3] & TMFA_NOSHADE)
ffloorflags |= FF_NOSHADE;
//Cutting options
if (ffloorflags & FF_RENDERALL)
{
//If translucent or player can enter it, cut inner walls
if ((ffloorflags & FF_TRANSLUCENT) || (lines[i].args[2] & 7))
if ((ffloorflags & FF_TRANSLUCENT) || (lines[i].args[2] & TMFT_VISIBLEFROMINSIDE))
ffloorflags |= FF_CUTEXTRA|FF_EXTRA;
else
ffloorflags |= FF_CUTLEVEL;
@ -6779,17 +6779,17 @@ void P_SpawnSpecials(boolean fromnetsave)
case 120: // FOF (water)
ffloorflags = FF_EXISTS|FF_RENDERPLANES|FF_SWIMMABLE|FF_BOTHPLANES|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES;
if (!(lines[i].args[1] & 1))
if (!(lines[i].args[1] & TMFW_OPAQUE))
ffloorflags |= FF_TRANSLUCENT;
if (!(lines[i].args[1] & 2))
if (!(lines[i].args[1] & TMFW_NOSIDES))
ffloorflags |= FF_RENDERSIDES|FF_ALLSIDES;
if (lines[i].args[1] & 4)
if (lines[i].args[1] & TMFW_DOUBLESHADOW)
ffloorflags |= FF_DOUBLESHADOW;
if (lines[i].args[1] & 8)
if (lines[i].args[1] & TMFW_COLORMAPONLY)
ffloorflags |= FF_COLORMAPONLY;
if (!(lines[i].args[1] & 16))
if (!(lines[i].args[1] & TMFW_NORIPPLE))
ffloorflags |= FF_RIPPLE;
if (lines[i].args[1] & 32)
if (lines[i].args[1] & TMFW_GOOWATER)
ffloorflags |= FF_GOOWATER;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
@ -6819,33 +6819,33 @@ void P_SpawnSpecials(boolean fromnetsave)
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CRUMBLE;
//Tangibility settings
if (lines[i].args[1] & 1) //Intangible from top
if (lines[i].args[1] & TMFT_INTANGIBLETOP)
ffloorflags |= FF_REVERSEPLATFORM;
if (lines[i].args[1] & 2) //Intangible from bottom
if (lines[i].args[1] & TMFT_INTANGIBLEBOTTOM)
ffloorflags |= FF_PLATFORM;
if (lines[i].args[1] & 4) //Don't block player
if (lines[i].args[1] & TMFT_DONTBLOCKPLAYER)
ffloorflags &= ~FF_BLOCKPLAYER;
if (lines[i].args[1] & 8) //Don't block others
if (lines[i].args[1] & TMFT_DONTBLOCKOTHERS)
ffloorflags &= ~FF_BLOCKOTHERS;
//Flags
if (lines[i].args[2] & 1) //Translucent
if (lines[i].args[2] & TMFC_TRANSLUCENT)
ffloorflags |= FF_TRANSLUCENT;
if (lines[i].args[2] & 2) //Don't cast shadow
if (lines[i].args[2] & TMFC_NOSHADE)
ffloorflags |= FF_NOSHADE;
if (lines[i].args[2] & 4) //Don't respawn
if (lines[i].args[2] & TMFC_NORETURN)
ffloorflags |= FF_NORETURN;
if (lines[i].args[2] & 16) //Float on water
if (lines[i].args[2] & TMFC_FLOATBOB)
ffloorflags |= FF_FLOATBOB;
//If translucent or player can enter it, cut inner walls
if ((ffloorflags & FF_TRANSLUCENT) || (lines[i].args[1] & 7))
if ((ffloorflags & FF_TRANSLUCENT) || (lines[i].args[1] & TMFT_VISIBLEFROMINSIDE))
ffloorflags |= FF_CUTEXTRA|FF_EXTRA;
else
ffloorflags |= FF_CUTLEVEL;
//If player can enter it, render insides
if (lines[i].args[1] & 7)
if (lines[i].args[1] & TMFT_VISIBLEFROMINSIDE)
{
if (ffloorflags & FF_RENDERPLANES)
ffloorflags |= FF_BOTHPLANES;
@ -6854,7 +6854,7 @@ void P_SpawnSpecials(boolean fromnetsave)
}
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
if (lines[i].args[2] & 8) //Air bobbing
if (lines[i].args[2] & TMFC_AIRBOB)
P_AddAirbob(lines[i].frontsector, lines + i, 16*FRACUNIT, false, false, false);
break;
@ -6918,11 +6918,11 @@ void P_SpawnSpecials(boolean fromnetsave)
ffloorflags = FF_EXISTS|FF_RENDERALL|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES;
//Visibility settings
if (lines[i].args[1] & 1) //Don't render planes
if (lines[i].args[1] & TMFV_NOPLANES)
ffloorflags &= ~FF_RENDERPLANES;
if (lines[i].args[1] & 2) //Don't render sides
if (lines[i].args[1] & TMFV_NOSIDES)
ffloorflags &= ~FF_RENDERSIDES;
if (!(lines[i].args[1] & 4)) //Render insides
if (!(lines[i].args[1] & TMFV_TOGGLEINSIDES))
{
if (ffloorflags & FF_RENDERPLANES)
ffloorflags |= FF_BOTHPLANES;
@ -6931,9 +6931,9 @@ void P_SpawnSpecials(boolean fromnetsave)
}
//Appearance settings
if ((lines[i].args[2] & 1) && (ffloorflags & FF_RENDERALL)) //Translucent
if ((lines[i].args[2] & TMFA_TRANSLUCENT) && (ffloorflags & FF_RENDERALL))
ffloorflags |= FF_TRANSLUCENT;
if (lines[i].args[2] & 2) //Don't cast shadow
if (lines[i].args[2] & TMFA_NOSHADE)
ffloorflags |= FF_NOSHADE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
@ -6945,9 +6945,9 @@ void P_SpawnSpecials(boolean fromnetsave)
case 250: // Mario Block
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_MARIO;
if (lines[i].args[1] & 1) //Brick block
if (lines[i].args[1] & TMFM_BRICK)
ffloorflags |= FF_SHATTERBOTTOM;
if (lines[i].args[1] & 2) // Invisible
if (lines[i].args[1] & TMFM_INVISIBLE)
ffloorflags &= ~(FF_SOLID|FF_RENDERALL|FF_CUTLEVEL);
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
@ -6969,13 +6969,13 @@ void P_SpawnSpecials(boolean fromnetsave)
//Bustable type
switch (lines[i].args[1])
{
case 0:
case TMFB_TOUCH:
ffloorflags |= FF_SHATTER;
break;
case 1:
case TMFB_SPIN:
ffloorflags |= FF_SPINBUST;
break;
case 3:
case TMFB_STRONG:
ffloorflags |= FF_STRONGBUST;
break;
default:
@ -6985,7 +6985,7 @@ void P_SpawnSpecials(boolean fromnetsave)
if (lines[i].args[2])
ffloorflags |= FF_TRANSLUCENT;
if (lines[i].args[2] & 4)
if (lines[i].args[3] & TMFB_ONLYBOTTOM)
ffloorflags |= FF_SHATTERBOTTOM;
if (!(ffloorflags & FF_SHATTER) || ffloorflags & FF_SHATTERBOTTOM)

View file

@ -21,6 +21,69 @@ extern mobj_t *skyboxmo[2]; // current skybox mobjs: 0 = viewpoint, 1 = centerpo
extern mobj_t *skyboxviewpnts[16]; // array of MT_SKYBOX viewpoint mobjs
extern mobj_t *skyboxcenterpnts[16]; // array of MT_SKYBOX centerpoint mobjs
//FOF flags
typedef enum
{
TMFV_NOPLANES = 1,
TMFV_NOSIDES = 1<<1,
TMFV_TOGGLEINSIDES = 1<<2,
} textmapfofvisibility_t;
typedef enum
{
TMFT_INTANGIBLETOP = 1,
TMFT_INTANGIBLEBOTTOM = 1<<1,
TMFT_DONTBLOCKPLAYER = 1<<2,
TMFT_VISIBLEFROMINSIDE = (TMFT_INTANGIBLETOP|TMFT_INTANGIBLEBOTTOM|TMFT_DONTBLOCKPLAYER),
TMFT_DONTBLOCKOTHERS = 1<<3,
} textmapfoftangibility_t;
typedef enum
{
TMFA_TRANSLUCENT = 1,
TMFA_NOSHADE = 1<<1,
} textmapfofappearance_t;
typedef enum
{
TMFW_OPAQUE = 1,
TMFW_NOSIDES = 1<<1,
TMFW_DOUBLESHADOW = 1<<2,
TMFW_COLORMAPONLY = 1<<3,
TMFW_NORIPPLE = 1<<4,
TMFW_GOOWATER = 1<<5,
} textmapfofwater_t;
typedef enum
{
TMFC_TRANSLUCENT = 1,
TMFC_NOSHADE = 1<<1,
TMFC_NORETURN = 1<<2,
TMFC_AIRBOB = 1<<3,
TMFC_FLOATBOB = 1<<4,
} textmapfofcrumbling_t;
typedef enum
{
TMFM_BRICK = 1,
TMFM_INVISIBLE = 1<<1,
} textmapfofmario_t;
typedef enum
{
TMFB_TOUCH,
TMFB_SPIN,
TMFB_REGULAR,
TMFB_STRONG,
} textmapfofbusttype_t;
typedef enum
{
TMFB_PUSHABLES = 1,
TMFB_EXECUTOR = 1<<1,
TMFB_ONLYBOTTOM = 1<<2,
} textmapfofbustflags_t;
// GETSECSPECIAL (specialval, section)
//
// Pulls out the special # from a particular section.

View file

@ -2663,7 +2663,7 @@ static void P_CheckBustableBlocks(player_t *player)
EV_CrumbleChain(NULL, rover); // node->m_sector
// Run a linedef executor??
if (rover->master->args[3] & 2)
if (rover->master->args[3] & TMFB_EXECUTOR)
P_LinedefExecute((INT16)(rover->master->args[4]), player->mo, node->m_sector);
goto bustupdone;