1
0
Fork 0

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

As this is drawing sprites, use sprite-based scaling instead of interface-based scaling.
pull/13914/head
Peter Nelson 2025-03-28 19:49:01 +00:00
parent a361841848
commit a0cd77bbda
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
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)) {