1
0
Fork 0

Fix #13912: Multitile buildings break apart in house picker. (#13914)

As this is drawing sprites, use sprite-based scaling instead of interface-based scaling.
pull/13917/head
Peter Nelson 2025-03-28 20:30:52 +00:00 committed by GitHub
parent 0829604b4f
commit 319caef58f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -1406,14 +1406,14 @@ void DrawHouseInGUI(int x, int y, HouseID house_id, int view)
/* Add a house on top of the ground? */
if (dcts.building.sprite != 0) {
Point pt = RemapCoords(dcts.subtile_x, dcts.subtile_y, 0);
DrawSprite(dcts.building.sprite, dcts.building.pal, x + UnScaleGUI(pt.x), y + UnScaleGUI(pt.y));
DrawSprite(dcts.building.sprite, dcts.building.pal, x + ScaleSpriteTrad(pt.x), y + ScaleSpriteTrad(pt.y));
}
};
/* Houses can have 1x1, 1x2, 2x1 and 2x2 layouts which are individual HouseIDs. For the GUI we need
* draw all of the tiles with appropriate positions. */
int x_delta = ScaleGUITrad(TILE_PIXELS);
int y_delta = ScaleGUITrad(TILE_PIXELS / 2);
int x_delta = ScaleSpriteTrad(TILE_PIXELS);
int y_delta = ScaleSpriteTrad(TILE_PIXELS / 2);
const HouseSpec *hs = HouseSpec::Get(house_id);
if (hs->building_flags.Test(BuildingFlag::Size2x2)) {