Change: Use power-of-2 scaling for some dimensions in GUI.

These are related to drawing sprites that are normally drawn on the
landscape, and should therefore still follow power-of-2 scaling to fit
correctly.
This commit is contained in:
Peter Nelson
2022-09-05 21:05:18 +01:00
committed by PeterN
parent 062ea68422
commit ed60c88b0a
19 changed files with 88 additions and 78 deletions

View File

@@ -986,8 +986,8 @@ struct BuildRoadDepotWindow : public PickerWindowBase {
if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) {
DrawPixelInfo *old_dpi = _cur_dpi;
_cur_dpi = &tmp_dpi;
int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31);
int y = (r.Height() + ScaleGUITrad(48)) / 2 - ScaleGUITrad(31);
int x = (r.Width() - ScaleSpriteTrad(64)) / 2 + ScaleSpriteTrad(31);
int y = (r.Height() + ScaleSpriteTrad(48)) / 2 - ScaleSpriteTrad(31);
DrawRoadDepotSprite(x, y, (DiagDirection)(widget - WID_BROD_DEPOT_NE + DIAGDIR_NE), _cur_roadtype);
_cur_dpi = old_dpi;
}
@@ -1121,8 +1121,8 @@ struct BuildRoadStationWindow : public PickerWindowBase {
if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) {
DrawPixelInfo *old_dpi = _cur_dpi;
_cur_dpi = &tmp_dpi;
int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31);
int y = (r.Height() + ScaleGUITrad(48)) / 2 - ScaleGUITrad(31);
int x = (r.Width() - ScaleSpriteTrad(64)) / 2 + ScaleSpriteTrad(31);
int y = (r.Height() + ScaleSpriteTrad(48)) / 2 - ScaleSpriteTrad(31);
StationPickerDrawSprite(x, y, st, INVALID_RAILTYPE, _cur_roadtype, widget - WID_BROS_STATION_NE);
_cur_dpi = old_dpi;
}