summaryrefslogtreecommitdiff
path: root/src/industry_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-11-22 13:22:53 +0000
committeralberth <alberth@openttd.org>2009-11-22 13:22:53 +0000
commitbf93372ca26375e392ff62a91db4de4c126dff38 (patch)
treeb09443cc8800ee93a79bb1df23f79283e8ddebbf /src/industry_gui.cpp
parent2332034822a9e2c9b1ed58e7f243a48cb8d630a6 (diff)
downloadopenttd-bf93372ca26375e392ff62a91db4de4c126dff38.tar.xz
(svn r18220) -Codechange: Reduce number of nested widget dynamic casts.
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r--src/industry_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 107b209bc..b42f17dfa 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -594,7 +594,7 @@ public:
{
this->DrawWidgets();
- NWidgetCore *nwi = this->GetWidget<NWidgetCore>(IVW_INFO);
+ NWidgetBase *nwi = this->GetWidget<NWidgetBase>(IVW_INFO);
uint expected = this->DrawInfo(nwi->pos_x, nwi->pos_x + nwi->current_x - 1, nwi->pos_y) - nwi->pos_y;
if (expected > nwi->current_y - 1) {
this->info_height = expected + 1;
@@ -720,7 +720,7 @@ public:
uint x = pt.x;
int line = (pt.y - this->production_offset_y) / FONT_HEIGHT_NORMAL;
if (pt.y >= this->production_offset_y && IsInsideMM(line, 0, 2) && i->produced_cargo[line] != CT_INVALID) {
- NWidgetCore *nwi = this->GetWidget<NWidgetCore>(widget);
+ NWidgetBase *nwi = this->GetWidget<NWidgetBase>(widget);
uint left = nwi->pos_x + WD_FRAMETEXT_LEFT;
uint right = nwi->pos_x + nwi->current_x - 1 - WD_FRAMERECT_RIGHT;
if (IsInsideMM(x, left, left + 20) ) {