Codechange: Unify structures with sprite sub-tile bounds and simplify bounding boxes. (#14424)

Lots of different structs contain variations on sub-tile bounds with different naming. Unify into a single struct that can be inherited and passed directly to AddSortableSpriteToDraw.

At the same time, offsets now work more logically: sub-tile bounds now specify the bounding box, and an offset can be applied to the sprite.
This commit is contained in:
Peter Nelson
2025-07-22 00:02:00 +01:00
committed by GitHub
parent c69fc76395
commit 921d83c324
35 changed files with 398 additions and 374 deletions

View File

@@ -284,15 +284,7 @@ static void DrawTile_Town(TileInfo *ti)
/* Add a house on top of the ground? */
SpriteID image = dcts->building.sprite;
if (image != 0) {
AddSortableSpriteToDraw(image, dcts->building.pal,
ti->x + dcts->subtile_x,
ti->y + dcts->subtile_y,
dcts->width,
dcts->height,
dcts->dz,
ti->z,
IsTransparencySet(TO_HOUSES)
);
AddSortableSpriteToDraw(image, dcts->building.pal, *ti, *dcts, IsTransparencySet(TO_HOUSES));
if (IsTransparencySet(TO_HOUSES)) return;
}