FREESCAPE: planar rendering fix

This commit is contained in:
neuromancer 2024-07-14 18:59:26 +02:00
parent b14be7de66
commit 40c9f7941e

View File

@ -228,6 +228,7 @@ void Area::draw(Freescape::Renderer *gfx, uint32 animationTicks, Math::Vector3d
ObjectArray planarObjects;
ObjectArray nonPlanarObjects;
Object *floor = nullptr;
Common::HashMap<Object *, float> sizes;
float offset = !gfx->_isAccelerated ? 2.0 : 1.0;
for (auto &obj : _drawableObjects) {
@ -271,6 +272,12 @@ void Area::draw(Freescape::Renderer *gfx, uint32 animationTicks, Math::Vector3d
if (distance.length() > 0.0001)
continue;
float sizeNonPlanar = object->_boundingBox.getSize().length();
if (sizes[planar] >= sizeNonPlanar)
continue;
sizes[planar] = sizeNonPlanar;
if (planar->getSize().x() == 0) {
if (object->getOrigin().x() >= centerPlanar.x())
offsetMap[planar] = -offset;