summaryrefslogtreecommitdiff
path: root/station_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
commit265ac671831f4ba9f79a69e94e0dd527d9a7a132 (patch)
tree822a14c0bf1d92e45c85d4ce62bc58b7b6cef6c7 /station_cmd.c
parent0f5793ffa06572f1c2e2efc47d36e8ff92141469 (diff)
downloadopenttd-265ac671831f4ba9f79a69e94e0dd527d9a7a132.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 'station_cmd.c')
-rw-r--r--station_cmd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/station_cmd.c b/station_cmd.c
index f28626ef0..9c1329191 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -327,8 +327,8 @@ static void UpdateStationVirtCoord(Station *st)
pt.y -= 32;
if (st->facilities&FACIL_AIRPORT && st->airport_type==AT_OILRIG) pt.y -= 16;
- SET_DPARAM16(0, st->index);
- SET_DPARAM8(1, st->facilities);
+ SetDParam(0, st->index);
+ SetDParam(1, st->facilities);
UpdateViewportSignPos(&st->sign, pt.x, pt.y, STR_305C_0);
}
@@ -368,9 +368,9 @@ static uint GetAcceptanceMask(Station *st)
static void ShowRejectOrAcceptNews(Station *st, uint32 items, StringID msg)
{
if (items) {
- SET_DPARAM32(2, items >> 16);
- SET_DPARAM32(1, items & 0xFFFF);
- SET_DPARAM16(0, st->index);
+ SetDParam(2, items >> 16);
+ SetDParam(1, items & 0xFFFF);
+ SetDParam(0, st->index);
AddNewsItem(msg + ((items >> 16)?1:0), NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_TILE, NT_ACCEPTANCE, 0), st->xy, 0);
}
}
@@ -1517,7 +1517,7 @@ int32 CmdBuildAirport(int x, int y, uint32 flags, uint32 p1, uint32 p2)
num++;
}
if (num >= 2) {
- SET_DPARAM16(0, t->index);
+ SetDParam(0, t->index);
return_cmd_error(STR_2035_LOCAL_AUTHORITY_REFUSES);
}
}
@@ -2622,7 +2622,7 @@ static int32 ClearTile_Station(uint tile, byte flags) {
if (m5 < 0x4B) return_cmd_error(STR_3046_MUST_DEMOLISH_BUS_STATION);
if (m5 == 0x52) return_cmd_error(STR_306A_BUOY_IN_THE_WAY);
if (m5 != 0x4B && m5 < 0x53) return_cmd_error(STR_304D_MUST_DEMOLISH_DOCK_FIRST);
- SET_DPARAM16(0, STR_4807_OIL_RIG);
+ SetDParam(0, STR_4807_OIL_RIG);
return_cmd_error(STR_4800_IN_THE_WAY);
}