diff options
author | peter1138 <peter1138@openttd.org> | 2006-03-31 10:14:25 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-03-31 10:14:25 +0000 |
commit | a6e1a1d3721750cfd20470190f49a338ba6e890c (patch) | |
tree | 600ff4c2b918cdcd335da2158b5d3e0eb64ffa28 /newgrf_engine.c | |
parent | 3b4b5771073555b14a47400bf1d7522fd394e8a2 (diff) | |
download | openttd-a6e1a1d3721750cfd20470190f49a338ba6e890c.tar.xz |
(svn r4198) - NewGRF: Rename GetCallBackResult() to GetVehicleCallback(), as other types will exist later, and use separate parameters instead of bitshifting.
Diffstat (limited to 'newgrf_engine.c')
-rw-r--r-- | newgrf_engine.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/newgrf_engine.c b/newgrf_engine.c index 7f534deed..b28476dfc 100644 --- a/newgrf_engine.c +++ b/newgrf_engine.c @@ -476,18 +476,19 @@ bool UsesWagonOverride(const Vehicle* v) } /** - * Evaluates a newgrf callback - * @param callback_info info about which callback to evaluate - * (bit 0-7) = CallBack id of the callback to use, see CallBackId enum - * (bit 8-15) = Other info some callbacks need to have, callback specific, see CallBackId enum, not used yet - * @param engine Engine type of the vehicle to evaluate the callback for - * @param vehicle The vehicle to evaluate the callback for, NULL if it doesnt exist (yet) + * Evaluate a newgrf callback for vehicles + * @param callback The callback to evalute + * @param param1 First parameter of the callback + * @param param2 Second parameter of the callback + * @param engine Engine type of the vehicle to evaluate the callback for + * @param vehicle The vehicle to evaluate the callback for, or NULL if it doesnt exist yet * @return The value the callback returned, or CALLBACK_FAILED if it failed */ -uint16 GetCallBackResult(uint16 callback_info, EngineID engine, const Vehicle *v) +uint16 GetVehicleCallback(byte callback, uint32 param1, uint32 param2, EngineID engine, const Vehicle *v) { const SpriteGroup *group; CargoID cargo = GC_DEFAULT; + uint16 callback_info = callback | (param1 << 8); // XXX Temporary conversion between new and old format. if (v != NULL) cargo = _global_cargo_id[_opt.landscape][v->cargo_type]; |