summaryrefslogtreecommitdiff
path: root/order_gui.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 /order_gui.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 'order_gui.c')
-rw-r--r--order_gui.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/order_gui.c b/order_gui.c
index 3dcc5f4bd..956a1cecc 100644
--- a/order_gui.c
+++ b/order_gui.c
@@ -60,13 +60,13 @@ static void DrawOrdersWindow(Window *w)
sel = OrderGetSel(w);
- SET_DPARAM16(2,STR_8827_FULL_LOAD);
+ SetDParam(2,STR_8827_FULL_LOAD);
switch(v->schedule_ptr[sel] & 0x1F) {
case OT_GOTO_STATION:
break;
case OT_GOTO_DEPOT:
SETBIT(w->disabled_state, 9); /* unload */
- SET_DPARAM16(2,STR_SERVICE);
+ SetDParam(2,STR_SERVICE);
break;
default:
SETBIT(w->disabled_state, 6); /* nonstop */
@@ -74,8 +74,8 @@ static void DrawOrdersWindow(Window *w)
SETBIT(w->disabled_state, 9); /* unload */
}
- SET_DPARAM16(0, v->string_id);
- SET_DPARAM16(1, v->unitnumber);
+ SetDParam(0, v->string_id);
+ SetDParam(1, v->unitnumber);
DrawWindowWidgets(w);
y = 15;
@@ -91,18 +91,18 @@ static void DrawOrdersWindow(Window *w)
if (ord == 0) {
str = shared_schedule ? STR_END_OF_SHARED_ORDERS : STR_882A_END_OF_ORDERS;
} else {
- SET_DPARAM16(1, 6);
+ SetDParam(1, 6);
if ( (ord & OT_MASK) == OT_GOTO_STATION) {
- SET_DPARAM16(1, STR_8806_GO_TO + ((ord >> 5) & 7));
- SET_DPARAM16(2, ord >> 8);
+ SetDParam(1, STR_8806_GO_TO + ((ord >> 5) & 7));
+ SetDParam(2, ord >> 8);
} else if ((ord & OT_MASK) == OT_GOTO_DEPOT) {
StringID s = STR_NULL;
if (v->type == VEH_Aircraft) {
s = STR_GO_TO_AIRPORT_HANGAR;
- SET_DPARAM16(2, ord>>8);
+ SetDParam(2, ord>>8);
} else {
- SET_DPARAM16(2, _depots[ord >> 8].town_index);
+ SetDParam(2, _depots[ord >> 8].town_index);
switch (v->type) {
case VEH_Train: s = STR_880E_GO_TO_TRAIN_DEPOT; break;
case VEH_Road: s = STR_9038_GO_TO_ROADVEH_DEPOT; break;
@@ -111,20 +111,20 @@ static void DrawOrdersWindow(Window *w)
}
if (v->type == VEH_Train)
s += (ord>>6)&2;
- SET_DPARAM16(1, s + ((ord>>6)&1) );
+ SetDParam(1, s + ((ord>>6)&1) );
} else if ((ord & OT_MASK) == OT_GOTO_WAYPOINT) {
- SET_DPARAM16(2, ord >> 8);
- SET_DPARAM16(1, STR_GO_TO_WAYPOINT);
+ SetDParam(2, ord >> 8);
+ SetDParam(1, STR_GO_TO_WAYPOINT);
}
}
{
byte color = (i == WP(w,order_d).sel) ? 0xC : 0x10;
- SET_DPARAM(0, i+1);
+ SetDParam(0, i+1);
if ((ord & OT_MASK) != OT_DUMMY) {
DrawString(2, y, str, color);
} else {
- SET_DPARAM16(1, STR_INVALID_ORDER);
- SET_DPARAM16(2, ord >> 8);
+ SetDParam(1, STR_INVALID_ORDER);
+ SetDParam(2, ord >> 8);
DrawString(2, y, str, color);
}
}