equal
deleted
inserted
replaced
216 static int CDECL TrainEnginePowerSorter(const void *a, const void *b) |
216 static int CDECL TrainEnginePowerSorter(const void *a, const void *b) |
217 { |
217 { |
218 const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a); |
218 const RailVehicleInfo *rvi_a = RailVehInfo(*(const EngineID*)a); |
219 const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b); |
219 const RailVehicleInfo *rvi_b = RailVehInfo(*(const EngineID*)b); |
220 |
220 |
221 int va = rvi_a->power << (rvi_a->railveh_type == RAILVEH_MULTIHEAD ? 1 : 0); |
221 int va = rvi_a->power; |
222 int vb = rvi_b->power << (rvi_b->railveh_type == RAILVEH_MULTIHEAD ? 1 : 0); |
222 int vb = rvi_b->power; |
223 int r = va - vb; |
223 int r = va - vb; |
224 |
224 |
225 return _internal_sort_order ? -r : r; |
225 return _internal_sort_order ? -r : r; |
226 } |
226 } |
227 |
227 |
600 DrawString(x, y, STR_PURCHASE_INFO_COST_WEIGHT, TC_FROMSTRING); |
600 DrawString(x, y, STR_PURCHASE_INFO_COST_WEIGHT, TC_FROMSTRING); |
601 y += 10; |
601 y += 10; |
602 |
602 |
603 /* Max speed - Engine power */ |
603 /* Max speed - Engine power */ |
604 SetDParam(0, GetEngineProperty(engine_number, 0x09, rvi->max_speed) * 10 / 16); |
604 SetDParam(0, GetEngineProperty(engine_number, 0x09, rvi->max_speed) * 10 / 16); |
605 SetDParam(1, GetEngineProperty(engine_number, 0x0B, rvi->power) << multihead); |
605 SetDParam(1, GetEngineProperty(engine_number, 0x0B, rvi->power)); |
606 DrawString(x, y, STR_PURCHASE_INFO_SPEED_POWER, TC_FROMSTRING); |
606 DrawString(x, y, STR_PURCHASE_INFO_SPEED_POWER, TC_FROMSTRING); |
607 y += 10; |
607 y += 10; |
608 |
608 |
609 /* Max tractive effort - not applicable if old acceleration or maglev */ |
609 /* Max tractive effort - not applicable if old acceleration or maglev */ |
610 if (_patches.realistic_acceleration && rvi->railtype != RAILTYPE_MAGLEV) { |
610 if (_patches.realistic_acceleration && rvi->railtype != RAILTYPE_MAGLEV) { |
613 y += 10; |
613 y += 10; |
614 } |
614 } |
615 |
615 |
616 /* Running cost */ |
616 /* Running cost */ |
617 if (rvi->running_cost_class != 0xFF) { |
617 if (rvi->running_cost_class != 0xFF) { |
618 SetDParam(0, (GetEngineProperty(engine_number, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8) << multihead); |
618 SetDParam(0, GetEngineProperty(engine_number, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8); |
619 DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING); |
619 DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, TC_FROMSTRING); |
620 y += 10; |
620 y += 10; |
621 } |
621 } |
622 |
622 |
623 /* Powered wagons power - Powered wagons extra weight */ |
623 /* Powered wagons power - Powered wagons extra weight */ |