From fdb447ac55fc7faffe6b7477a4ecfa7733b9a03d Mon Sep 17 00:00:00 2001 From: tron Date: Thu, 2 Dec 2004 22:53:07 +0000 Subject: (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 --- vehicle.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vehicle.c') diff --git a/vehicle.c b/vehicle.c index 2621adf30..8537e817f 100644 --- a/vehicle.c +++ b/vehicle.c @@ -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; -- cgit v1.2.3-54-g00ecf