newgrf_callbacks.h
author peter1138
Sat, 11 Feb 2006 09:17:16 +0000
changeset 3007 5c0d90264d47
parent 2982 eb7f50dcb249
child 3505 091f0285df7d
permissions -rw-r--r--
(svn r3587) - NewGRF: Rename Callback IDs to include their "class"
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2129
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2129
diff changeset
     2
2982
eb7f50dcb249 (svn r3557) - NewGRF: move callback enums to a new file as more than just engines will use them
peter1138
parents: 2971
diff changeset
     3
#ifndef NEWGRF_CALLBACKS_H
eb7f50dcb249 (svn r3557) - NewGRF: move callback enums to a new file as more than just engines will use them
peter1138
parents: 2971
diff changeset
     4
#define NEWGRF_CALLBACKS_H
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
2982
eb7f50dcb249 (svn r3557) - NewGRF: move callback enums to a new file as more than just engines will use them
peter1138
parents: 2971
diff changeset
     6
/** @file newgrf_callbacks.h
2962
f0a49b646c48 (svn r3524) - Split newgrf features from engine.[ch] into newgrf_engine.[ch], and add the new files to project files.
peter1138
parents: 2848
diff changeset
     7
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     8
3007
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
     9
/**
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    10
 * List of implemented NewGRF callbacks.
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    11
 * Names are formatted as CBID_<CLASS>_<CALLBACK>
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    12
 */
1883
ad68cd0a0a25 (svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents: 1802
diff changeset
    13
enum CallbackID {
1908
2fa391fed79a (svn r2414) - Feature: [newgrf] Implement powered wagons, and the callback that goes with it.
hackykid
parents: 1895
diff changeset
    14
	// Powered wagons, if the result is lower as 0x40 then the wagon is powered
2fa391fed79a (svn r2414) - Feature: [newgrf] Implement powered wagons, and the callback that goes with it.
hackykid
parents: 1895
diff changeset
    15
	// TODO: interpret the rest of the result, aka "visual effects"
3007
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    16
	CBID_TRAIN_WAGON_POWER          = 0x10,
1908
2fa391fed79a (svn r2414) - Feature: [newgrf] Implement powered wagons, and the callback that goes with it.
hackykid
parents: 1895
diff changeset
    17
1922
bda6f85eefaa (svn r2428) - Feature: [newgrf] Implement shorter train vehicles (Therax), and the callback that goes with it.
hackykid
parents: 1909
diff changeset
    18
	// Vehicle length, returns the amount of 1/8's the vehicle is shorter
bda6f85eefaa (svn r2428) - Feature: [newgrf] Implement shorter train vehicles (Therax), and the callback that goes with it.
hackykid
parents: 1909
diff changeset
    19
	// only for train vehicles
3007
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    20
	CBID_TRAIN_VEHICLE_LENGTH       = 0x11,
1922
bda6f85eefaa (svn r2428) - Feature: [newgrf] Implement shorter train vehicles (Therax), and the callback that goes with it.
hackykid
parents: 1909
diff changeset
    21
1883
ad68cd0a0a25 (svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents: 1802
diff changeset
    22
	// Refit capacity, the passed vehicle needs to have its ->cargo_type set to
ad68cd0a0a25 (svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents: 1802
diff changeset
    23
	// the cargo we are refitting to, returns the new cargo capacity
3007
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    24
	CBID_VEHICLE_REFIT_CAPACITY     = 0x15,
2602
1a6561c9a408 (svn r3139) -NewGRF, Feature: support for articulated rail vehicles. This is used, for example, by coal tenders.
peter1138
parents: 2542
diff changeset
    25
3007
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    26
	CBID_TRAIN_ARTIC_ENGINE         = 0x16,
1895
0d499b71a782 (svn r2401) - Fix: [newgrf] Finish up callback mechanism, implement 'refit capacity' callback slightly more correct.
hackykid
parents: 1883
diff changeset
    27
};
0d499b71a782 (svn r2401) - Fix: [newgrf] Finish up callback mechanism, implement 'refit capacity' callback slightly more correct.
hackykid
parents: 1883
diff changeset
    28
3007
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    29
/**
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    30
 * Callback masks for vehicles, indicates which callbacks are used by a vehicle.
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    31
 * Some callbacks are always used and don't have a mask.
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    32
 */
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    33
enum VehicleCallbackMask {
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    34
	CBM_WAGON_POWER    = 0, ///< Powered wagons (trains only)
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    35
	CBM_VEHICLE_LENGTH = 1, ///< Vehicle length (trains only)
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    36
	CBM_LOAD_AMOUNT    = 2, ///< Load amount
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    37
	CBM_REFIT_CAPACITY = 3, ///< Cargo capacity after refit
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    38
	CBM_ARTIC_ENGINE   = 4, ///< Add articulated engines (trains only)
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    39
	CBM_CARGO_SUFFIX   = 5, ///< Show suffix after cargo name
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    40
	CBM_COLOUR_REMAP   = 6, ///< Change colour mapping of vehicle
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    41
	CBM_SOUND_EFFECT   = 7, ///< Vehicle uses custom sound effects
1883
ad68cd0a0a25 (svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents: 1802
diff changeset
    42
};
ad68cd0a0a25 (svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents: 1802
diff changeset
    43
3007
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    44
/**
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    45
 * Result of a failed callback.
5c0d90264d47 (svn r3587) - NewGRF: Rename Callback IDs to include their "class"
peter1138
parents: 2982
diff changeset
    46
 */
1883
ad68cd0a0a25 (svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents: 1802
diff changeset
    47
enum {
ad68cd0a0a25 (svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents: 1802
diff changeset
    48
	CALLBACK_FAILED = 0xFFFF
ad68cd0a0a25 (svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents: 1802
diff changeset
    49
};
ad68cd0a0a25 (svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
hackykid
parents: 1802
diff changeset
    50
2982
eb7f50dcb249 (svn r3557) - NewGRF: move callback enums to a new file as more than just engines will use them
peter1138
parents: 2971
diff changeset
    51
#endif /* NEWGRF_CALLBACKS_H */