mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Recalculate the screen position for entities when painting
This commit is contained in:
@@ -94,10 +94,15 @@ void EntityPaintSetup(PaintSession& session, const CoordsXY& pos)
|
||||
}
|
||||
}
|
||||
|
||||
if (session.DPI.y + session.DPI.height <= spr->SpriteData.SpriteRect.GetTop()
|
||||
|| spr->SpriteData.SpriteRect.GetBottom() <= session.DPI.y
|
||||
|| session.DPI.x + session.DPI.width <= spr->SpriteData.SpriteRect.GetLeft()
|
||||
|| spr->SpriteData.SpriteRect.GetRight() <= session.DPI.x)
|
||||
auto screenCoords = Translate3DTo2DWithZ(session.CurrentRotation, spr->GetLocation());
|
||||
auto spriteRect = ScreenRect(
|
||||
screenCoords - ScreenCoordsXY{ spr->SpriteData.Width, spr->SpriteData.HeightMin },
|
||||
screenCoords + ScreenCoordsXY{ spr->SpriteData.Width, spr->SpriteData.HeightMax });
|
||||
|
||||
if (session.DPI.y + session.DPI.height <= spriteRect.GetTop()
|
||||
|| spriteRect.GetBottom() <= session.DPI.y
|
||||
|| session.DPI.x + session.DPI.width <= spriteRect.GetLeft()
|
||||
|| spriteRect.GetRight() <= session.DPI.x)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user