mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add MF_DRAWFROMFARAWAY flag, renders objects up to 2x drawdist
This commit is contained in:
parent
629614710c
commit
61abb7a82e
3 changed files with 19 additions and 5 deletions
|
|
@ -5685,7 +5685,7 @@ const char *const MOBJFLAG_LIST[] = {
|
||||||
"BOSS",
|
"BOSS",
|
||||||
"SPAWNCEILING",
|
"SPAWNCEILING",
|
||||||
"NOGRAVITY",
|
"NOGRAVITY",
|
||||||
"\x01", // free: 1<<10 (name un-matchable)
|
"DRAWFROMFARAWAY",
|
||||||
"SLIDEME",
|
"SLIDEME",
|
||||||
"NOCLIP",
|
"NOCLIP",
|
||||||
"FLOAT",
|
"FLOAT",
|
||||||
|
|
|
||||||
|
|
@ -122,8 +122,8 @@ typedef enum
|
||||||
// Don't apply gravity (every tic); object will float, keeping current height
|
// Don't apply gravity (every tic); object will float, keeping current height
|
||||||
// or changing it actively.
|
// or changing it actively.
|
||||||
MF_NOGRAVITY = 1<<9,
|
MF_NOGRAVITY = 1<<9,
|
||||||
// Free:
|
// This object is visible from a greater distance than normal objects.
|
||||||
// 1<<10
|
MF_DRAWFROMFARAWAY = 1<<10,
|
||||||
// Slide this object when it hits a wall.
|
// Slide this object when it hits a wall.
|
||||||
MF_SLIDEME = 1<<11,
|
MF_SLIDEME = 1<<11,
|
||||||
// Don't collide with walls or solid objects. Two MF_NOCLIP objects can't touch each other at all!
|
// Don't collide with walls or solid objects. Two MF_NOCLIP objects can't touch each other at all!
|
||||||
|
|
|
||||||
|
|
@ -3618,10 +3618,24 @@ boolean R_ThingWithinDist (mobj_t *thing, fixed_t limit_dist)
|
||||||
{
|
{
|
||||||
const fixed_t dist = R_PointToDist(thing->x, thing->y);
|
const fixed_t dist = R_PointToDist(thing->x, thing->y);
|
||||||
|
|
||||||
if (limit_dist && dist > limit_dist)
|
if (limit_dist)
|
||||||
|
{
|
||||||
|
if (thing->flags & MF_DRAWFROMFARAWAY)
|
||||||
|
{
|
||||||
|
// MF_DRAWFROMFARAWAY: visible from 2x drawdist
|
||||||
|
if (dist > limit_dist * 2)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (dist > limit_dist)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue