1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-27 00:19:09 +00:00

(svn r3078) Some more stuff, which piled up:

- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
This commit is contained in:
tron
2005-10-23 13:04:44 +00:00
parent 2cc2154ad2
commit 47137cefb7
38 changed files with 442 additions and 453 deletions

View File

@@ -122,7 +122,6 @@ void ShowEnginePreviewWindow(EngineID engine)
static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw)
{
const RailVehicleInfo *rvi = RailVehInfo(engine);
int cap;
uint multihead = (rvi->flags & RVI_MULTIHEAD) ? 1 : 0;
SetDParam(0, (_price.build_railvehicle >> 3) * rvi->base_cost >> 5);
@@ -132,11 +131,11 @@ static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw)
SetDParam(4, rvi->running_cost_base * _price.running_rail[rvi->engclass] >> 8 << multihead);
cap = rvi->capacity;
SetDParam(5, STR_8838_N_A);
if (cap != 0) {
SetDParam(6, cap << multihead);
if (rvi->capacity != 0) {
SetDParam(5, _cargoc.names_long[rvi->cargo_type]);
SetDParam(6, rvi->capacity << multihead);
} else {
SetDParam(5, STR_8838_N_A);
}
DrawStringMultiCenter(x, y, STR_885B_COST_WEIGHT_T_SPEED_POWER, maxw);
}