1 /* $Id$ */ |
1 /* $Id$ */ |
|
2 |
|
3 /** @file newgrf_engine.h */ |
2 |
4 |
3 #ifndef NEWGRF_ENGINE_H |
5 #ifndef NEWGRF_ENGINE_H |
4 #define NEWGRF_ENGINE_H |
6 #define NEWGRF_ENGINE_H |
5 |
7 |
6 #include "newgrf.h" |
8 #include "newgrf.h" |
7 #include "direction.h" |
9 #include "direction.h" |
8 #include "newgrf_cargo.h" |
10 #include "newgrf_cargo.h" |
9 |
|
10 /** @file newgrf_engine.h |
|
11 */ |
|
12 |
11 |
13 extern int _traininfo_vehicle_pitch; |
12 extern int _traininfo_vehicle_pitch; |
14 extern int _traininfo_vehicle_width; |
13 extern int _traininfo_vehicle_width; |
15 |
14 |
16 |
15 |
36 #define GetCustomVehicleSprite(v, direction) GetCustomEngineSprite(v->engine_type, v, direction) |
35 #define GetCustomVehicleSprite(v, direction) GetCustomEngineSprite(v->engine_type, v, direction) |
37 #define GetCustomVehicleIcon(et, direction) GetCustomEngineSprite(et, NULL, direction) |
36 #define GetCustomVehicleIcon(et, direction) GetCustomEngineSprite(et, NULL, direction) |
38 |
37 |
39 enum VehicleTrigger { |
38 enum VehicleTrigger { |
40 VEHICLE_TRIGGER_NEW_CARGO = 1, |
39 VEHICLE_TRIGGER_NEW_CARGO = 1, |
41 // Externally triggered only for the first vehicle in chain |
40 /* Externally triggered only for the first vehicle in chain */ |
42 VEHICLE_TRIGGER_DEPOT = 2, |
41 VEHICLE_TRIGGER_DEPOT = 2, |
43 // Externally triggered only for the first vehicle in chain, only if whole chain is empty |
42 /* Externally triggered only for the first vehicle in chain, only if whole chain is empty */ |
44 VEHICLE_TRIGGER_EMPTY = 4, |
43 VEHICLE_TRIGGER_EMPTY = 4, |
45 // Not triggered externally (called for the whole chain if we got NEW_CARGO) |
44 /* Not triggered externally (called for the whole chain if we got NEW_CARGO) */ |
46 VEHICLE_TRIGGER_ANY_NEW_CARGO = 8, |
45 VEHICLE_TRIGGER_ANY_NEW_CARGO = 8, |
47 }; |
46 }; |
48 void TriggerVehicle(Vehicle *veh, VehicleTrigger trigger); |
47 void TriggerVehicle(Vehicle *veh, VehicleTrigger trigger); |
49 |
48 |
50 void SetCustomEngineName(EngineID engine, StringID name); |
49 void SetCustomEngineName(EngineID engine, StringID name); |