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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user