1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-25 13:14:19 +01:00

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

@@ -476,13 +476,7 @@ static void DrawTile_Object(TileInfo *ti)
if (!IsInvisibilitySet(TO_STRUCTURES)) {
for (const DrawTileSeqStruct &dtss : dts->GetSequence()) {
AddSortableSpriteToDraw(
dtss.image.sprite, palette,
ti->x + dtss.delta_x, ti->y + dtss.delta_y,
dtss.size_x, dtss.size_y,
dtss.size_z, ti->z + dtss.delta_z,
IsTransparencySet(TO_STRUCTURES)
);
AddSortableSpriteToDraw(dtss.image.sprite, palette, *ti, dtss, IsTransparencySet(TO_STRUCTURES));
}
}
} else {