diff options
author | tron <tron@openttd.org> | 2004-12-02 22:53:07 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2004-12-02 22:53:07 +0000 |
commit | fdb447ac55fc7faffe6b7477a4ecfa7733b9a03d (patch) | |
tree | 822a14c0bf1d92e45c85d4ce62bc58b7b6cef6c7 /vehicle.c | |
parent | 2c88f958edc2ad87c92ac23b727e27e2ddbe710b (diff) | |
download | openttd-fdb447ac55fc7faffe6b7477a4ecfa7733b9a03d.tar.xz |
(svn r901) Small step in the process to clean up the DPARAM mess:
- reduce to 2 sizes (*DParam64 for 64bit values, *DParam for the rest)
- use inline functions instead of macros
- add assert()s to check for buffer overruns
Diffstat (limited to 'vehicle.c')
-rw-r--r-- | vehicle.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -112,7 +112,7 @@ void VehiclePositionChanged(Vehicle *v) void UpdateWaypointSign(Waypoint *cp) { Point pt = RemapCoords2(GET_TILE_X(cp->xy)*16, GET_TILE_Y(cp->xy)*16); - SET_DPARAM16(0, cp - _waypoints); + SetDParam(0, cp - _waypoints); UpdateViewportSignPos(&cp->sign, pt.x, pt.y - 0x20, STR_WAYPOINT_VIEWPORT); } @@ -1309,8 +1309,8 @@ static void ShowVehicleGettingOld(Vehicle *v, StringID msg) if (_patches.autorenew) return; - SET_DPARAM16(0, _vehicle_type_names[v->type - 0x10]); - SET_DPARAM16(1, v->unitnumber); + SetDParam(0, _vehicle_type_names[v->type - 0x10]); + SetDParam(1, v->unitnumber); AddNewsItem(msg, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0), v->index, 0); } @@ -1350,7 +1350,7 @@ void MaybeRenewVehicle(Vehicle *v, int32 build_cost) if (DEREF_PLAYER(v->owner)->money64 < _patches.autorenew_money + build_cost - v->value) { if (v->owner == _local_player) { int message; - SET_DPARAM16(0, v->unitnumber); + SetDParam(0, v->unitnumber); switch (v->type) { case VEH_Train: message = STR_TRAIN_AUTORENEW_FAILED; break; case VEH_Road: message = STR_ROADVEHICLE_AUTORENEW_FAILED; break; |