Fix sprite bsp clipping bug and wall sorting bug

This commit is contained in:
Magnus Norddahl 2016-12-02 13:06:16 +01:00
parent 71350f2c17
commit 01008f0daa
2 changed files with 3 additions and 3 deletions

View file

@ -158,7 +158,7 @@ void RenderPolyPortal::RenderSprite(AActor *thing, double sortDistance, DVector2
} }
else else
{ {
RenderSprite(thing, sortDistance, left, mid, t1, tmid, bsp->children[sideLeft]); RenderSprite(thing, sortDistance, left, mid, t1, tmid, bsp->children[sideRight]);
left = mid; left = mid;
t1 = tmid; t1 = tmid;
} }

View file

@ -46,7 +46,7 @@ class PolyTranslucentObject
public: public:
PolyTranslucentObject(particle_t *particle, subsector_t *sub, uint32_t subsectorDepth) : particle(particle), sub(sub), subsectorDepth(subsectorDepth) { } PolyTranslucentObject(particle_t *particle, subsector_t *sub, uint32_t subsectorDepth) : particle(particle), sub(sub), subsectorDepth(subsectorDepth) { }
PolyTranslucentObject(AActor *thing, subsector_t *sub, uint32_t subsectorDepth, double dist, float t1, float t2) : thing(thing), sub(sub), subsectorDepth(subsectorDepth), DistanceSquared(dist), SpriteLeft(t1), SpriteRight(t2) { } PolyTranslucentObject(AActor *thing, subsector_t *sub, uint32_t subsectorDepth, double dist, float t1, float t2) : thing(thing), sub(sub), subsectorDepth(subsectorDepth), DistanceSquared(dist), SpriteLeft(t1), SpriteRight(t2) { }
PolyTranslucentObject(RenderPolyWall wall) : wall(wall) { } PolyTranslucentObject(RenderPolyWall wall) : wall(wall), subsectorDepth(wall.SubsectorDepth), DistanceSquared(1.e6) { }
bool operator<(const PolyTranslucentObject &other) const bool operator<(const PolyTranslucentObject &other) const
{ {
@ -60,7 +60,7 @@ public:
RenderPolyWall wall; RenderPolyWall wall;
uint32_t subsectorDepth = 0; uint32_t subsectorDepth = 0;
double DistanceSquared = 1.e6; double DistanceSquared = 0.0;
float SpriteLeft = 0.0f, SpriteRight = 1.0f; float SpriteLeft = 0.0f, SpriteRight = 1.0f;
}; };