Codechange: Remove FONT_HEIGHT_... macros. (#11481)

These make it look like we're dealing with a constant, but actually each is a call to `GetCharacterHeight(...)`.
This commit is contained in:
Peter Nelson
2023-11-21 19:04:24 +00:00
committed by GitHub
parent 96ec9c1b47
commit c18a1494b7
57 changed files with 369 additions and 381 deletions

View File

@@ -36,7 +36,7 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r)
SetDParam(1, v->build_year);
SetDParam(2, v->value);
DrawString(r.left, r.right, y, STR_VEHICLE_INFO_BUILT_VALUE);
y += FONT_HEIGHT_NORMAL;
y += GetCharacterHeight(FS_NORMAL);
if (v->HasArticulatedPart()) {
CargoArray max_cargo{};
@@ -71,7 +71,7 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r)
}
DrawString(r.left, r.right, y, capacity, TC_BLUE);
y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal;
y += GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_normal;
for (const Vehicle *u = v; u != nullptr; u = u->Next()) {
if (u->cargo_cap == 0) continue;
@@ -85,7 +85,7 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r)
feeder_share += u->cargo.GetFeederShare();
}
DrawString(r.left, r.right, y, str);
y += FONT_HEIGHT_NORMAL;
y += GetCharacterHeight(FS_NORMAL);
}
y += WidgetDimensions::scaled.vsep_normal;
} else {
@@ -93,7 +93,7 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r)
SetDParam(1, v->cargo_cap);
SetDParam(4, GetCargoSubtypeText(v));
DrawString(r.left, r.right, y, STR_VEHICLE_INFO_CAPACITY);
y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal;
y += GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_normal;
str = STR_VEHICLE_DETAILS_CARGO_EMPTY;
if (v->cargo.StoredCount() > 0) {
@@ -104,7 +104,7 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r)
feeder_share += v->cargo.GetFeederShare();
}
DrawString(r.left, r.right, y, str);
y += FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal;
y += GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_normal;
}
/* Draw Transfer credits text */