summaryrefslogtreecommitdiff
path: root/ship_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-12-02 22:53:07 +0000
committertron <tron@openttd.org>2004-12-02 22:53:07 +0000
commitfdb447ac55fc7faffe6b7477a4ecfa7733b9a03d (patch)
tree822a14c0bf1d92e45c85d4ce62bc58b7b6cef6c7 /ship_cmd.c
parent2c88f958edc2ad87c92ac23b727e27e2ddbe710b (diff)
downloadopenttd-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 'ship_cmd.c')
-rw-r--r--ship_cmd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ship_cmd.c b/ship_cmd.c
index a5e7f65a1..9e5a8b0d0 100644
--- a/ship_cmd.c
+++ b/ship_cmd.c
@@ -39,11 +39,11 @@ void DrawShipEngine(int x, int y, int engine, uint32 image_ormod)
void DrawShipEngineInfo(int engine, int x, int y, int maxw)
{
ShipVehicleInfo *svi = &ship_vehicle_info(engine);
- SET_DPARAM32(0, svi->base_cost * (_price.ship_base>>3)>>5);
- SET_DPARAM16(1, svi->max_speed * 10 >> 5);
- SET_DPARAM16(2, _cargoc.names_long_p[svi->cargo_type]);
- SET_DPARAM16(3, svi->capacity);
- SET_DPARAM32(4, svi->running_cost * _price.ship_running >> 8);
+ SetDParam(0, svi->base_cost * (_price.ship_base>>3)>>5);
+ SetDParam(1, svi->max_speed * 10 >> 5);
+ SetDParam(2, _cargoc.names_long_p[svi->cargo_type]);
+ SetDParam(3, svi->capacity);
+ SetDParam(4, svi->running_cost * _price.ship_running >> 8);
DrawStringMultiCenter(x, y, STR_982E_COST_MAX_SPEED_CAPACITY, maxw);
}
@@ -406,7 +406,7 @@ static void ShipEnterDepot(Vehicle *v)
else if (t & 0x40) {
v->vehstatus |= VS_STOPPED;
if (v->owner == _local_player) {
- SET_DPARAM16(0, v->unitnumber);
+ SetDParam(0, v->unitnumber);
AddNewsItem(
STR_981C_SHIP_IS_WAITING_IN_DEPOT,
NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0),
@@ -423,7 +423,7 @@ static void ShipArrivesAt(Vehicle *v, Station *st)
if (!(st->had_vehicle_of_type & HVOT_SHIP)) {
uint32 flags;
st->had_vehicle_of_type |= HVOT_SHIP;
- SET_DPARAM16(0, st->index);
+ SetDParam(0, st->index);
flags = (v->owner == _local_player) ? NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_VEHICLE, NT_ARRIVAL_PLAYER, 0) : NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_VEHICLE, NT_ARRIVAL_OTHER, 0);
AddNewsItem(
STR_9833_CITIZENS_CELEBRATE_FIRST,