summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-22 11:06:25 +0000
committerrubidium <rubidium@openttd.org>2009-03-22 11:06:25 +0000
commitdfe5dad5f68250ec67a3cb5e69bc7f9f58f9a58c (patch)
tree7c3693c152a65897c9f3b80f496caef3139058bf /src/vehicle_gui.cpp
parentead0a6a6e52ff0b538ab5f345bd1ff6a11b30f8d (diff)
downloadopenttd-dfe5dad5f68250ec67a3cb5e69bc7f9f58f9a58c.tar.xz
(svn r15807) -Codechange: let the build vehicle gui helper function pass around left and right instead of only left and assuming infinite width.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 5362681a6..d7aa74f4f 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -431,21 +431,21 @@ void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order, Window *pare
}
/** Display additional text from NewGRF in the purchase information window */
-uint ShowAdditionalText(int x, int y, uint w, EngineID engine)
+uint ShowAdditionalText(int left, int right, int y, EngineID engine)
{
uint16 callback = GetVehicleCallback(CBID_VEHICLE_ADDITIONAL_TEXT, 0, 0, engine, NULL);
- if (callback == CALLBACK_FAILED) return 0;
+ if (callback == CALLBACK_FAILED) return y;
/* STR_02BD is used to start the string with {BLACK} */
SetDParam(0, GetGRFStringID(GetEngineGRFID(engine), 0xD000 + callback));
PrepareTextRefStackUsage(0);
- uint result = DrawStringMultiLine(x, x + w, y, INT32_MAX, STR_02BD);
+ uint result = DrawStringMultiLine(left, right, y, INT32_MAX, STR_02BD);
StopTextRefStackUsage();
- return result - y;
+ return result;
}
/** Display list of cargo types of the engine, for the purchase information window */
-uint ShowRefitOptionsList(int x, int y, uint w, EngineID engine)
+uint ShowRefitOptionsList(int left, int right, int y, EngineID engine)
{
/* List of cargo types of this engine */
uint32 cmask = GetUnionOfArticulatedRefitMasks(engine, GetEngine(engine)->type, false);
@@ -455,7 +455,7 @@ uint ShowRefitOptionsList(int x, int y, uint w, EngineID engine)
char *b = string;
/* Draw nothing if the engine is not refittable */
- if (CountBits(cmask) <= 1) return 0;
+ if (CountBits(cmask) <= 1) return y;
b = InlineString(b, STR_PURCHASE_INFO_REFITTABLE_TO);
@@ -492,7 +492,7 @@ uint ShowRefitOptionsList(int x, int y, uint w, EngineID engine)
assert(b < endof(string));
SetDParamStr(0, string);
- return DrawStringMultiLine(x, x + w, y, INT32_MAX, STR_JUST_RAW_STRING);
+ return DrawStringMultiLine(left, right, y, INT32_MAX, STR_JUST_RAW_STRING);
}
/** Get the cargo subtype text from NewGRF for the vehicle details window. */