summaryrefslogtreecommitdiff
path: root/roadveh_gui.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-10-23 18:45:43 +0000
committerpeter1138 <peter1138@openttd.org>2006-10-23 18:45:43 +0000
commit59f78aa2b73cef324c15d26b5d126d5b280e188a (patch)
treee73bc759e69d13e07ce73c600d8ac0c7f1536fe8 /roadveh_gui.c
parent74850a771249f25e01b7c4f6efee07b99e101c47 (diff)
downloadopenttd-59f78aa2b73cef324c15d26b5d126d5b280e188a.tar.xz
(svn r6910) - Codechange: Supply width of area when drawing purchase info instead of using hardcoded values. (mart3p)
Diffstat (limited to 'roadveh_gui.c')
-rw-r--r--roadveh_gui.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/roadveh_gui.c b/roadveh_gui.c
index 93863a63b..49adbea55 100644
--- a/roadveh_gui.c
+++ b/roadveh_gui.c
@@ -27,7 +27,7 @@
* @param x,y location where to draw the info
* @param engine_number the engine of which to draw the info of
*/
-void DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number)
+void DrawRoadVehPurchaseInfo(int x, int y, uint w, EngineID engine_number)
{
const RoadVehicleInfo *rvi = RoadVehInfo(engine_number);
const Engine *e = GetEngine(engine_number);
@@ -65,8 +65,7 @@ void DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number)
y += 10;
/* Additional text from NewGRF */
- // XXX 227 will become a calculated width...
- y += ShowAdditionalText(x, y, 227, engine_number);
+ y += ShowAdditionalText(x, y, w, engine_number);
}
void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection)
@@ -432,7 +431,8 @@ static void DrawNewRoadVehWindow(Window *w)
WP(w,buildvehicle_d).sel_engine = selected_id;
if (selected_id != INVALID_ENGINE) {
- DrawRoadVehPurchaseInfo(2, w->widget[4].top + 1, selected_id);
+ const Widget *wi = &w->widget[4];
+ DrawRoadVehPurchaseInfo(2, wi->top + 1, wi->right - wi->left - 2, selected_id);
}
}