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