20 |
20 |
21 static StringID GetEngineCategoryName(EngineID engine) |
21 static StringID GetEngineCategoryName(EngineID engine) |
22 { |
22 { |
23 switch (GetEngine(engine)->type) { |
23 switch (GetEngine(engine)->type) { |
24 default: NOT_REACHED(); |
24 default: NOT_REACHED(); |
25 case VEH_Road: return STR_8103_ROAD_VEHICLE; |
25 case VEH_ROAD: return STR_8103_ROAD_VEHICLE; |
26 case VEH_Aircraft: return STR_8104_AIRCRAFT; |
26 case VEH_AIRCRAFT: return STR_8104_AIRCRAFT; |
27 case VEH_Ship: return STR_8105_SHIP; |
27 case VEH_SHIP: return STR_8105_SHIP; |
28 case VEH_Train: |
28 case VEH_TRAIN: |
29 switch (RailVehInfo(engine)->railtype) { |
29 switch (RailVehInfo(engine)->railtype) { |
30 default: NOT_REACHED(); |
30 default: NOT_REACHED(); |
31 case RAILTYPE_RAIL: return STR_8102_RAILROAD_LOCOMOTIVE; |
31 case RAILTYPE_RAIL: return STR_8102_RAILROAD_LOCOMOTIVE; |
32 case RAILTYPE_ELECTRIC: return STR_8102_RAILROAD_LOCOMOTIVE; |
32 case RAILTYPE_ELECTRIC: return STR_8102_RAILROAD_LOCOMOTIVE; |
33 case RAILTYPE_MONO: return STR_8106_MONORAIL_LOCOMOTIVE; |
33 case RAILTYPE_MONO: return STR_8106_MONORAIL_LOCOMOTIVE; |
46 }; |
46 }; |
47 |
47 |
48 typedef void DrawEngineProc(int x, int y, EngineID engine, SpriteID pal); |
48 typedef void DrawEngineProc(int x, int y, EngineID engine, SpriteID pal); |
49 typedef void DrawEngineInfoProc(EngineID, int x, int y, int maxw); |
49 typedef void DrawEngineInfoProc(EngineID, int x, int y, int maxw); |
50 |
50 |
51 typedef struct DrawEngineInfo { |
51 struct DrawEngineInfo { |
52 DrawEngineProc *engine_proc; |
52 DrawEngineProc *engine_proc; |
53 DrawEngineInfoProc *info_proc; |
53 DrawEngineInfoProc *info_proc; |
54 } DrawEngineInfo; |
54 }; |
55 |
55 |
56 static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw); |
56 static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw); |
57 static void DrawRoadVehEngineInfo(EngineID engine, int x, int y, int maxw); |
57 static void DrawRoadVehEngineInfo(EngineID engine, int x, int y, int maxw); |
58 static void DrawShipEngineInfo(EngineID engine, int x, int y, int maxw); |
58 static void DrawShipEngineInfo(EngineID engine, int x, int y, int maxw); |
59 static void DrawAircraftEngineInfo(EngineID engine, int x, int y, int maxw); |
59 static void DrawAircraftEngineInfo(EngineID engine, int x, int y, int maxw); |
138 |
138 |
139 static void DrawAircraftEngineInfo(EngineID engine, int x, int y, int maxw) |
139 static void DrawAircraftEngineInfo(EngineID engine, int x, int y, int maxw) |
140 { |
140 { |
141 const AircraftVehicleInfo *avi = AircraftVehInfo(engine); |
141 const AircraftVehicleInfo *avi = AircraftVehInfo(engine); |
142 SetDParam(0, (_price.aircraft_base >> 3) * avi->base_cost >> 5); |
142 SetDParam(0, (_price.aircraft_base >> 3) * avi->base_cost >> 5); |
143 SetDParam(1, avi->max_speed); |
143 SetDParam(1, avi->max_speed * 10 / 16); |
144 SetDParam(2, avi->passenger_capacity); |
144 SetDParam(2, avi->passenger_capacity); |
145 SetDParam(3, avi->mail_capacity); |
145 SetDParam(3, avi->mail_capacity); |
146 SetDParam(4, avi->running_cost * _price.aircraft_running >> 8); |
146 SetDParam(4, avi->running_cost * _price.aircraft_running >> 8); |
147 |
147 |
148 DrawStringMultiCenter(x, y, STR_A02E_COST_MAX_SPEED_CAPACITY, maxw); |
148 DrawStringMultiCenter(x, y, STR_A02E_COST_MAX_SPEED_CAPACITY, maxw); |