Use backup/restore wrappers for various _cur_dpi changes

This commit is contained in:
Jonathan G Rennison
2023-02-15 21:13:58 +00:00
parent 85889143c7
commit fef39b5797
11 changed files with 34 additions and 69 deletions

View File

@@ -367,8 +367,7 @@ void DrawHouseImage(HouseID house_id, int left, int top, int right, int bottom)
{
DrawPixelInfo tmp_dpi;
if (!FillDrawPixelInfo(&tmp_dpi, left, top, right - left + 1, bottom - top + 1)) return;
DrawPixelInfo *old_dpi = _cur_dpi;
_cur_dpi = &tmp_dpi;
AutoRestoreBackup dpi_backup(_cur_dpi, &tmp_dpi);
const HouseSpec *hs = HouseSpec::Get(house_id);
@@ -412,8 +411,6 @@ void DrawHouseImage(HouseID house_id, int left, int top, int right, int bottom)
}
if (!ground) break;
}
_cur_dpi = old_dpi;
}
static int GetSlopePixelZ_Town(TileIndex tile, uint x, uint y)