diff options
author | rubidium <rubidium@openttd.org> | 2010-01-04 18:21:07 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-01-04 18:21:07 +0000 |
commit | 87466a4ed091035b758ef981e6600e2b03cbfe30 (patch) | |
tree | b5a79792fb0f12f7f3a96e400091c1fda26de9c5 /src/industry_gui.cpp | |
parent | 71f2789270ca091af14ab4cfd64a4f17234cf007 (diff) | |
download | openttd-87466a4ed091035b758ef981e6600e2b03cbfe30.tar.xz |
(svn r18717) -Codechange: use TileArea in industry instead of three separate variables. Also make use of TileArea functions for determining the 'width' and 'height' of an industry.
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r-- | src/industry_gui.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index e7cd41884..9749ae756 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -63,7 +63,7 @@ static void GetCargoSuffix(uint cargo, CargoSuffixType cst, const Industry *ind, { suffix[0] = '\0'; if (HasBit(indspec->callback_mask, CBM_IND_CARGO_SUFFIX)) { - uint16 callback = GetIndustryCallback(CBID_INDUSTRY_CARGO_SUFFIX, 0, (cst << 8) | cargo, const_cast<Industry *>(ind), ind_type, (cst != CST_FUND) ? ind->xy : INVALID_TILE); + uint16 callback = GetIndustryCallback(CBID_INDUSTRY_CARGO_SUFFIX, 0, (cst << 8) | cargo, const_cast<Industry *>(ind), ind_type, (cst != CST_FUND) ? ind->location.tile : INVALID_TILE); if (GB(callback, 0, 8) != 0xFF) { PrepareTextRefStackUsage(6); GetString(suffix, GetGRFStringID(indspec->grf_prop.grffile->grfid, 0xD000 + callback), suffix_last); @@ -580,7 +580,7 @@ public: this->InitNested(desc, window_number); NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(IVW_VIEWPORT); - nvp->InitializeViewport(this, Industry::Get(window_number)->xy + TileDiffXY(1, 1), ZOOM_LVL_INDUSTRY); + nvp->InitializeViewport(this, Industry::Get(window_number)->location.tile + TileDiffXY(1, 1), ZOOM_LVL_INDUSTRY); } virtual void OnPaint() @@ -674,7 +674,7 @@ public: /* Get the extra message for the GUI */ if (HasBit(ind->callback_mask, CBM_IND_WINDOW_MORE_TEXT)) { - uint16 callback_res = GetIndustryCallback(CBID_INDUSTRY_WINDOW_MORE_TEXT, 0, 0, i, i->type, i->xy); + uint16 callback_res = GetIndustryCallback(CBID_INDUSTRY_WINDOW_MORE_TEXT, 0, 0, i, i->type, i->location.tile); if (callback_res != CALLBACK_FAILED) { StringID message = GetGRFStringID(ind->grf_prop.grffile->grfid, 0xD000 + callback_res); if (message != STR_NULL && message != STR_UNDEFINED) { @@ -747,9 +747,9 @@ public: case IVW_GOTO: i = Industry::Get(this->window_number); if (_ctrl_pressed) { - ShowExtraViewPortWindow(i->xy + TileDiffXY(1, 1)); + ShowExtraViewPortWindow(i->location.tile + TileDiffXY(1, 1)); } else { - ScrollMainWindowToTile(i->xy + TileDiffXY(1, 1)); + ScrollMainWindowToTile(i->location.tile + TileDiffXY(1, 1)); } break; } @@ -1124,9 +1124,9 @@ public: p = y + this->vscroll.GetPosition(); if (p < this->industries.Length()) { if (_ctrl_pressed) { - ShowExtraViewPortWindow(this->industries[p]->xy); + ShowExtraViewPortWindow(this->industries[p]->location.tile); } else { - ScrollMainWindowToTile(this->industries[p]->xy); + ScrollMainWindowToTile(this->industries[p]->location.tile); } } } break; |