mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-30 05:00:46 +00:00
As requested by Nev3r and VAda, seperating MF_PAPER into FF_PAPERSPRITE and MF_PAPERCOLLISION.
This commit is contained in:
parent
ef6c2510a2
commit
c08e9674be
6 changed files with 18 additions and 15 deletions
|
@ -7045,6 +7045,7 @@ struct {
|
||||||
|
|
||||||
// Frame settings
|
// Frame settings
|
||||||
{"FF_FRAMEMASK",FF_FRAMEMASK},
|
{"FF_FRAMEMASK",FF_FRAMEMASK},
|
||||||
|
{"FF_PAPERSPRITE",FF_PAPERSPRITE},
|
||||||
{"FF_ANIMATE",FF_ANIMATE},
|
{"FF_ANIMATE",FF_ANIMATE},
|
||||||
{"FF_FULLBRIGHT",FF_FULLBRIGHT},
|
{"FF_FULLBRIGHT",FF_FULLBRIGHT},
|
||||||
{"FF_TRANSMASK",FF_TRANSMASK},
|
{"FF_TRANSMASK",FF_TRANSMASK},
|
||||||
|
|
|
@ -498,7 +498,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||||
/// \note You should leave this enabled unless you're working with a future SRB2 version.
|
/// \note You should leave this enabled unless you're working with a future SRB2 version.
|
||||||
#define MUSICSLOT_COMPATIBILITY
|
#define MUSICSLOT_COMPATIBILITY
|
||||||
|
|
||||||
/// Experimental attempts at preventing MF_PAPER objects from getting stuck in walls.
|
/// Experimental attempts at preventing MF_PAPERCOLLISION objects from getting stuck in walls.
|
||||||
//#define PAPER_COLLISIONCORRECTION
|
//#define PAPER_COLLISIONCORRECTION
|
||||||
|
|
||||||
#endif // __DOOMDEF__
|
#endif // __DOOMDEF__
|
||||||
|
|
10
src/p_map.c
10
src/p_map.c
|
@ -498,7 +498,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist)
|
if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist)
|
||||||
return true; // didn't hit it
|
return true; // didn't hit it
|
||||||
|
|
||||||
if (thing->flags & MF_PAPER) // CAUTION! Very easy to get stuck inside MF_SOLID objects. Giving the player MF_PAPER is a bad idea unless you know what you're doing.
|
if (thing->flags & MF_PAPERCOLLISION) // CAUTION! Very easy to get stuck inside MF_SOLID objects. Giving the player MF_PAPERCOLLISION is a bad idea unless you know what you're doing.
|
||||||
{
|
{
|
||||||
fixed_t cosradius, sinradius;
|
fixed_t cosradius, sinradius;
|
||||||
vertex_t v1, v2; // fake vertexes
|
vertex_t v1, v2; // fake vertexes
|
||||||
|
@ -517,7 +517,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
junk.dx = v2.x - v1.x;
|
junk.dx = v2.x - v1.x;
|
||||||
junk.dy = v2.y - v1.y;
|
junk.dy = v2.y - v1.y;
|
||||||
|
|
||||||
if (tmthing->flags & MF_PAPER) // more strenuous checking to prevent clipping issues
|
if (tmthing->flags & MF_PAPERCOLLISION) // more strenuous checking to prevent clipping issues
|
||||||
{
|
{
|
||||||
INT32 check1, check2, check3, check4;
|
INT32 check1, check2, check3, check4;
|
||||||
cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT));
|
cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT));
|
||||||
|
@ -538,7 +538,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
return true; // the line doesn't cross between either pair of opposite corners
|
return true; // the line doesn't cross between either pair of opposite corners
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (tmthing->flags & MF_PAPER)
|
else if (tmthing->flags & MF_PAPERCOLLISION)
|
||||||
{
|
{
|
||||||
fixed_t cosradius, sinradius;
|
fixed_t cosradius, sinradius;
|
||||||
vertex_t v1, v2; // fake vertexes
|
vertex_t v1, v2; // fake vertexes
|
||||||
|
@ -557,7 +557,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
junk.dx = v2.x - v1.x;
|
junk.dx = v2.x - v1.x;
|
||||||
junk.dy = v2.y - v1.y;
|
junk.dy = v2.y - v1.y;
|
||||||
|
|
||||||
// no need to check whether thing has MF_PAPER, since checked above
|
// no need to check whether thing has MF_PAPERCOLLISION, since checked above
|
||||||
|
|
||||||
if ((P_PointOnLineSide(thing->x - thing->radius, thing->y - thing->radius, &junk)
|
if ((P_PointOnLineSide(thing->x - thing->radius, thing->y - thing->radius, &junk)
|
||||||
== P_PointOnLineSide(thing->x + thing->radius, thing->y + thing->radius, &junk))
|
== P_PointOnLineSide(thing->x + thing->radius, thing->y + thing->radius, &junk))
|
||||||
|
@ -1230,7 +1230,7 @@ static boolean PIT_CheckLine(line_t *ld)
|
||||||
if (P_BoxOnLineSide(tmbbox, ld) != -1)
|
if (P_BoxOnLineSide(tmbbox, ld) != -1)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (tmthing->flags & MF_PAPER) // Caution! Turning whilst up against a wall will get you stuck. You probably shouldn't give the player this flag.
|
if (tmthing->flags & MF_PAPERCOLLISION) // Caution! Turning whilst up against a wall will get you stuck. You probably shouldn't give the player this flag.
|
||||||
{
|
{
|
||||||
fixed_t cosradius, sinradius;
|
fixed_t cosradius, sinradius;
|
||||||
cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT));
|
cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT));
|
||||||
|
|
|
@ -107,8 +107,8 @@ typedef enum
|
||||||
MF_NOSECTOR = 1<<3,
|
MF_NOSECTOR = 1<<3,
|
||||||
// Don't use the blocklinks (inert but displayable)
|
// Don't use the blocklinks (inert but displayable)
|
||||||
MF_NOBLOCKMAP = 1<<4,
|
MF_NOBLOCKMAP = 1<<4,
|
||||||
// Paper-thin. Drawn like a midtexture, has a flat collision bound.
|
// Thin, paper-like collision bound (for visual equivalent, see FF_PAPERSPRITE)
|
||||||
MF_PAPER = 1<<5,
|
MF_PAPERCOLLISION = 1<<5,
|
||||||
// You can push this object. It can activate switches and things by pushing it on top.
|
// You can push this object. It can activate switches and things by pushing it on top.
|
||||||
MF_PUSHABLE = 1<<6,
|
MF_PUSHABLE = 1<<6,
|
||||||
// Object is a boss.
|
// Object is a boss.
|
||||||
|
|
|
@ -36,7 +36,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// \brief Frame flags: only the frame number
|
/// \brief Frame flags: only the frame number
|
||||||
#define FF_FRAMEMASK 0x3fff
|
#define FF_FRAMEMASK 0x1ff
|
||||||
|
/// \brief Frame flags: Thin, paper-like sprite (for collision equivalent, see MF_PAPERCOLLISION)
|
||||||
|
#define FF_PAPERSPRITE 0x800
|
||||||
/// \brief Frame flags: Simple stateless animation
|
/// \brief Frame flags: Simple stateless animation
|
||||||
#define FF_ANIMATE 0x4000
|
#define FF_ANIMATE 0x4000
|
||||||
/// \brief Frame flags: frame always appears full bright
|
/// \brief Frame flags: frame always appears full bright
|
||||||
|
|
|
@ -1123,7 +1123,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
fixed_t iscale;
|
fixed_t iscale;
|
||||||
fixed_t scalestep; // toast '16
|
fixed_t scalestep; // toast '16
|
||||||
fixed_t offset, offset2;
|
fixed_t offset, offset2;
|
||||||
boolean flatsprite = (thing->flags & MF_PAPER);
|
boolean papersprite = (thing->frame & FF_PAPERSPRITE);
|
||||||
|
|
||||||
//SoM: 3/17/2000
|
//SoM: 3/17/2000
|
||||||
fixed_t gz, gzt;
|
fixed_t gz, gzt;
|
||||||
|
@ -1143,7 +1143,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
tz = gxt-gyt;
|
tz = gxt-gyt;
|
||||||
|
|
||||||
// thing is behind view plane?
|
// thing is behind view plane?
|
||||||
if (!(flatsprite) && (tz < FixedMul(MINZ, this_scale))) // flatsprite clipping is handled later
|
if (!(papersprite) && (tz < FixedMul(MINZ, this_scale))) // papersprite clipping is handled later
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gxt = -FixedMul(tr_x, viewsin);
|
gxt = -FixedMul(tr_x, viewsin);
|
||||||
|
@ -1203,10 +1203,10 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
I_Error("R_ProjectSprite: sprframes NULL for sprite %d\n", thing->sprite);
|
I_Error("R_ProjectSprite: sprframes NULL for sprite %d\n", thing->sprite);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (sprframe->rotate != SRF_SINGLE || flatsprite)
|
if (sprframe->rotate != SRF_SINGLE || papersprite)
|
||||||
{
|
{
|
||||||
ang = R_PointToAngle (thing->x, thing->y) - thing->angle;
|
ang = R_PointToAngle (thing->x, thing->y) - thing->angle;
|
||||||
if (flatsprite)
|
if (papersprite)
|
||||||
ang_scale = abs(FINESINE(ang>>ANGLETOFINESHIFT));
|
ang_scale = abs(FINESINE(ang>>ANGLETOFINESHIFT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1260,7 +1260,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
if (x2 < 0)
|
if (x2 < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (flatsprite)
|
if (papersprite)
|
||||||
{
|
{
|
||||||
fixed_t yscale2, cosmul, sinmul, tz2;
|
fixed_t yscale2, cosmul, sinmul, tz2;
|
||||||
INT32 range;
|
INT32 range;
|
||||||
|
@ -1290,7 +1290,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
yscale2 = FixedDiv(projectiony, tz2);
|
yscale2 = FixedDiv(projectiony, tz2);
|
||||||
if (yscale2 < 64) return; // ditto
|
if (yscale2 < 64) return; // ditto
|
||||||
|
|
||||||
if (max(tz, tz2) < FixedMul(MINZ, this_scale)) // non-flatsprite clipping is handled earlier
|
if (max(tz, tz2) < FixedMul(MINZ, this_scale)) // non-papersprite clipping is handled earlier
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (x2 > x1)
|
if (x2 > x1)
|
||||||
|
|
Loading…
Reference in a new issue