Changeset - r28827:f131debacb19
[Not reviewed]
master
0 14 0
Peter Nelson - 9 months ago 2024-02-27 20:10:06
peter1138@openttd.org
Codechange: Use `GetVisibleRangeIterators()` in more places. (#12190)

This replaces more first/last index calculation, along with indexed array/vector access, with iterator access instead.
14 files changed with 58 insertions and 65 deletions:
0 comments (0 inline, 0 general)
src/bridge_gui.cpp
Show inline comments
 
@@ -228,17 +228,17 @@ public:
 
				this->DrawSortButtonState(widget, this->bridges.IsDescSortOrder() ? SBS_DOWN : SBS_UP);
 
				break;
 

	
 
			case WID_BBS_BRIDGE_LIST: {
 
				Rect tr = r.WithHeight(this->resize.step_height).Shrink(WidgetDimensions::scaled.matrix);
 
				bool rtl = _current_text_dir == TD_RTL;
 
				for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < (int)this->bridges.size(); i++) {
 
					const BuildBridgeData &bridge_data = this->bridges.at(i);
 
					const BridgeSpec *b = bridge_data.spec;
 
				auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->bridges);
 
				for (auto it = first; it != last; ++it) {
 
					const BridgeSpec *b = it->spec;
 
					DrawSpriteIgnorePadding(b->sprite, b->pal, tr.WithWidth(this->icon_width, rtl), SA_HOR_CENTER | SA_BOTTOM);
 
					DrawStringMultiLine(tr.Indent(this->icon_width + WidgetDimensions::scaled.hsep_normal, rtl), GetBridgeSelectString(bridge_data));
 
					DrawStringMultiLine(tr.Indent(this->icon_width + WidgetDimensions::scaled.hsep_normal, rtl), GetBridgeSelectString(*it));
 
					tr = tr.Translate(0, this->resize.step_height);
 
				}
 
				break;
 
			}
 
		}
 
	}
src/fios_gui.cpp
Show inline comments
 
@@ -438,14 +438,14 @@ public:
 

	
 
			case WID_SL_DRIVES_DIRECTORIES_LIST: {
 
				const Rect br = r.Shrink(WidgetDimensions::scaled.bevel);
 
				GfxFillRect(br, PC_BLACK);
 

	
 
				Rect tr = r.Shrink(WidgetDimensions::scaled.inset).WithHeight(this->resize.step_height);
 
				uint scroll_pos = this->vscroll->GetPosition();
 
				for (auto it = this->display_list.begin() + scroll_pos; it != this->display_list.end() && tr.top < br.bottom; ++it) {
 
				auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->display_list);
 
				for (auto it = first; it != last; ++it) {
 
					const FiosItem *item = *it;
 

	
 
					if (item == this->selected) {
 
						GfxFillRect(br.left, tr.top, br.right, tr.bottom, PC_DARK_BLUE);
 
					} else if (item == this->highlighted) {
 
						GfxFillRect(br.left, tr.top, br.right, tr.bottom, PC_VERY_DARK_BLUE);
src/graph_gui.cpp
Show inline comments
 
@@ -1020,19 +1020,17 @@ struct PaymentRatesGraphWindow : BaseGra
 
			BaseGraphWindow::DrawWidget(r, widget);
 
			return;
 
		}
 

	
 
		bool rtl = _current_text_dir == TD_RTL;
 

	
 
		int pos = this->vscroll->GetPosition();
 
		int max = pos + this->vscroll->GetCapacity();
 
		auto [first, last] = this->vscroll->GetVisibleRangeIterators(_sorted_standard_cargo_specs);
 

	
 
		Rect line = r.WithHeight(this->line_height);
 
		for (const CargoSpec *cs : _sorted_standard_cargo_specs) {
 
			if (pos-- > 0) continue;
 
			if (--max < 0) break;
 
		for (auto it = first; it != last; ++it) {
 
			const CargoSpec *cs = *it;
 

	
 
			bool lowered = !HasBit(_legend_excluded_cargo, cs->Index());
 

	
 
			/* Redraw frame if lowered */
 
			if (lowered) DrawFrameRect(line, COLOUR_BROWN, FR_LOWERED);
 

	
src/group_gui.cpp
Show inline comments
 
@@ -623,15 +623,15 @@ public:
 
				break;
 

	
 
			case WID_GL_LIST_VEHICLE:
 
				if (this->vli.index != ALL_GROUP && this->grouping == GB_NONE) {
 
					/* Mark vehicles which are in sub-groups (only if we are not using shared order coalescing) */
 
					Rect mr = r.WithHeight(this->resize.step_height);
 
					size_t max = std::min<size_t>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->vehgroups.size());
 
					for (size_t i = this->vscroll->GetPosition(); i < max; ++i) {
 
						const Vehicle *v = this->vehgroups[i].GetSingleVehicle();
 
					auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->vehgroups);
 
					for (auto it = first; it != last; ++it) {
 
						const Vehicle *v = it->GetSingleVehicle();
 
						if (v->group_id != this->vli.index) {
 
							GfxFillRect(mr.Shrink(WidgetDimensions::scaled.bevel), GetColourGradient(COLOUR_GREY, SHADE_DARK), FILLRECT_CHECKER);
 
						}
 
						mr = mr.Translate(0, this->resize.step_height);
 
					}
 
				}
src/industry_gui.cpp
Show inline comments
 
@@ -525,14 +525,15 @@ public:
 
				text = text.Indent(this->legend.width + WidgetDimensions::scaled.hsep_wide, rtl);
 

	
 
				/* Vertical offset for legend icon. */
 
				icon.top    = r.top + (this->resize.step_height - this->legend.height + 1) / 2;
 
				icon.bottom = icon.top + this->legend.height - 1;
 

	
 
				for (uint16_t i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < this->vscroll->GetCount(); i++) {
 
					IndustryType type = this->list[i];
 
				auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->list);
 
				for (auto it = first; it != last; ++it) {
 
					IndustryType type = *it;
 
					bool selected = this->selected_type == type;
 
					const IndustrySpec *indsp = GetIndustrySpec(type);
 

	
 
					/* Draw the name of the industry in white is selected, otherwise, in orange */
 
					DrawString(text, indsp->name, selected ? TC_WHITE : TC_ORANGE);
 
					GfxFillRect(icon, selected ? PC_WHITE : PC_BLACK);
 
@@ -1696,26 +1697,25 @@ public:
 
				ir.right += this->hscroll->GetCapacity() - this->hscroll->GetPosition();
 

	
 
				if (this->industries.empty()) {
 
					DrawString(ir, STR_INDUSTRY_DIRECTORY_NONE);
 
					break;
 
				}
 
				int n = 0;
 
				const CargoID acf_cid = this->accepted_cargo_filter_criteria;
 
				for (uint i = this->vscroll->GetPosition(); i < this->industries.size(); i++) {
 
				auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->industries);
 
				for (auto it = first; it != last; ++it) {
 
					TextColour tc = TC_FROMSTRING;
 
					if (acf_cid != CargoFilterCriteria::CF_ANY && acf_cid != CargoFilterCriteria::CF_NONE) {
 
						Industry *ind = const_cast<Industry *>(this->industries[i]);
 
						Industry *ind = const_cast<Industry *>(*it);
 
						if (IndustryTemporarilyRefusesCargo(ind, acf_cid)) {
 
							tc = TC_GREY | TC_FORCED;
 
						}
 
					}
 
					DrawString(ir, this->GetIndustryString(this->industries[i]), tc);
 
					DrawString(ir, this->GetIndustryString(*it), tc);
 

	
 
					ir.top += this->resize.step_height;
 
					if (++n == this->vscroll->GetCapacity()) break; // max number of industries in 1 window
 
				}
 
				break;
 
			}
 
		}
 
	}
 

	
src/network/network_content_gui.cpp
Show inline comments
 
@@ -649,17 +649,14 @@ public:
 

	
 
		/* Fill the matrix with the information */
 
		int sprite_y_offset = (this->resize.step_height - this->checkbox_size.height) / 2;
 
		int text_y_offset   = (this->resize.step_height - GetCharacterHeight(FS_NORMAL)) / 2;
 

	
 
		Rect mr = r.WithHeight(this->resize.step_height);
 
		auto iter = this->content.begin() + this->vscroll->GetPosition();
 
		size_t last = this->vscroll->GetPosition() + this->vscroll->GetCapacity();
 
		auto end = (last < this->content.size()) ? this->content.begin() + last : this->content.end();
 

	
 
		for (/**/; iter != end; iter++) {
 
		auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->content);
 
		for (auto iter = first; iter != last; iter++) {
 
			const ContentInfo *ci = *iter;
 

	
 
			if (ci == this->selected) GfxFillRect(mr.Shrink(WidgetDimensions::scaled.bevel), PC_GREY);
 

	
 
			SpriteID sprite;
 
			SpriteID pal = PAL_NONE;
src/network/network_gui.cpp
Show inline comments
 
@@ -524,16 +524,15 @@ public:
 
	void DrawWidget(const Rect &r, WidgetID widget) const override
 
	{
 
		switch (widget) {
 
			case WID_NG_MATRIX: {
 
				uint16_t y = r.top;
 

	
 
				const int max = std::min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), (int)this->servers.size());
 

	
 
				for (int i = this->vscroll->GetPosition(); i < max; ++i) {
 
					const NetworkGameList *ngl = this->servers[i];
 
				auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->servers);
 
				for (auto it = first; it != last; ++it) {
 
					const NetworkGameList *ngl = *it;
 
					this->DrawServerLine(ngl, y, ngl == this->server);
 
					y += this->resize.step_height;
 
				}
 
				break;
 
			}
 

	
src/newgrf_debug_gui.cpp
Show inline comments
 
@@ -930,19 +930,19 @@ struct SpriteAlignerWindow : Window {
 
			}
 

	
 
			case WID_SA_LIST: {
 
				const NWidgetBase *nwid = this->GetWidget<NWidgetBase>(widget);
 
				int step_size = nwid->resize_y;
 

	
 
				std::vector<SpriteID> &list = _newgrf_debug_sprite_picker.sprites;
 
				int max = std::min<int>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), (uint)list.size());
 
				const std::vector<SpriteID> &list = _newgrf_debug_sprite_picker.sprites;
 

	
 
				Rect ir = r.Shrink(WidgetDimensions::scaled.matrix);
 
				for (int i = this->vscroll->GetPosition(); i < max; i++) {
 
					SetDParam(0, list[i]);
 
					DrawString(ir, STR_JUST_COMMA, list[i] == this->current_sprite ? TC_WHITE : TC_BLACK, SA_RIGHT | SA_FORCE);
 
				auto [first, last] = this->vscroll->GetVisibleRangeIterators(list);
 
				for (auto it = first; it != last; ++it) {
 
					SetDParam(0, *it);
 
					DrawString(ir, STR_JUST_COMMA, *it == this->current_sprite ? TC_WHITE : TC_BLACK, SA_RIGHT | SA_FORCE);
 
					ir.top += step_size;
 
				}
 
				break;
 
			}
 
		}
 
	}
src/newgrf_gui.cpp
Show inline comments
 
@@ -906,17 +906,16 @@ struct NewGRFWindow : public Window, New
 
				const Rect br = r.Shrink(WidgetDimensions::scaled.bevel);
 
				GfxFillRect(br, this->active_over == -2 ? PC_DARK_GREY : PC_BLACK);
 

	
 
				Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
 
				uint step_height = this->GetWidget<NWidgetBase>(WID_NS_AVAIL_LIST)->resize_y;
 
				int offset_y = (step_height - GetCharacterHeight(FS_NORMAL)) / 2;
 
				uint min_index = this->vscroll2->GetPosition();
 
				uint max_index = std::min(min_index + this->vscroll2->GetCapacity(), (uint)this->avails.size());
 

	
 
				for (uint i = min_index; i < max_index; i++) {
 
					const GRFConfig *c = this->avails[i];
 
				auto [first, last] = this->vscroll2->GetVisibleRangeIterators(this->avails);
 
				for (auto it = first; it != last; ++it) {
 
					const GRFConfig *c = *it;
 
					bool h = (c == this->avail_sel);
 
					const char *text = c->GetName();
 

	
 
					if (h) GfxFillRect(br.left, tr.top, br.right, tr.top + step_height - 1, PC_DARK_BLUE);
 
					DrawString(tr.left, tr.right, tr.top + offset_y, text, h ? TC_WHITE : TC_SILVER);
 
					tr.top += step_height;
 
@@ -2124,19 +2123,19 @@ struct SavePresetWindow : public Window 
 
				const Rect br = r.Shrink(WidgetDimensions::scaled.bevel);
 
				GfxFillRect(br, PC_BLACK);
 

	
 
				uint step_height = this->GetWidget<NWidgetBase>(WID_SVP_PRESET_LIST)->resize_y;
 
				int offset_y = (step_height - GetCharacterHeight(FS_NORMAL)) / 2;
 
				Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
 
				uint min_index = this->vscroll->GetPosition();
 
				uint max_index = std::min(min_index + this->vscroll->GetCapacity(), (uint)this->presets.size());
 

	
 
				for (uint i = min_index; i < max_index; i++) {
 
					if ((int)i == this->selected) GfxFillRect(br.left, tr.top, br.right, tr.top + step_height - 1, PC_DARK_BLUE);
 
				auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->presets);
 
				for (auto it = first; it != last; ++it) {
 
					int row = static_cast<int>(std::distance(std::begin(this->presets), it));
 
					if (row == this->selected) GfxFillRect(br.left, tr.top, br.right, tr.top + step_height - 1, PC_DARK_BLUE);
 

	
 
					DrawString(tr.left, tr.right, tr.top + offset_y, this->presets[i], ((int)i == this->selected) ? TC_WHITE : TC_SILVER);
 
					DrawString(tr.left, tr.right, tr.top + offset_y, *it, (row == this->selected) ? TC_WHITE : TC_SILVER);
 
					tr.top += step_height;
 
				}
 
				break;
 
			}
 
		}
 
	}
src/script/script_gui.cpp
Show inline comments
 
@@ -924,13 +924,13 @@ struct ScriptDebugWindow : public Window
 
	 * @param r Rect area to draw within.
 
	 */
 
	void DrawWidgetLog(const Rect &r) const
 
	{
 
		if (this->filter.script_debug_company == INVALID_COMPANY) return;
 

	
 
		ScriptLogTypes::LogData &log = this->GetLogData();
 
		const ScriptLogTypes::LogData &log = this->GetLogData();
 
		if (log.empty()) return;
 

	
 
		Rect fr = r.Shrink(WidgetDimensions::scaled.framerect);
 

	
 
		/* Setup a clipping rectangle... */
 
		DrawPixelInfo tmp_dpi;
 
@@ -940,27 +940,28 @@ struct ScriptDebugWindow : public Window
 
		tmp_dpi.top += fr.top;
 

	
 
		AutoRestoreBackup dpi_backup(_cur_dpi, &tmp_dpi);
 

	
 
		fr.left -= this->hscroll->GetPosition();
 

	
 
		for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && (size_t)i < log.size(); i++) {
 
			const ScriptLogTypes::LogLine &line = log[i];
 
		auto [first, last] = this->vscroll->GetVisibleRangeIterators(log);
 
		for (auto it = first; it != last; ++it) {
 
			const ScriptLogTypes::LogLine &line = *it;
 

	
 
			TextColour colour;
 
			switch (line.type) {
 
				case ScriptLogTypes::LOG_SQ_INFO:  colour = TC_BLACK;  break;
 
				case ScriptLogTypes::LOG_SQ_ERROR: colour = TC_WHITE;  break;
 
				case ScriptLogTypes::LOG_INFO:     colour = TC_BLACK;  break;
 
				case ScriptLogTypes::LOG_WARNING:  colour = TC_YELLOW; break;
 
				case ScriptLogTypes::LOG_ERROR:    colour = TC_RED;    break;
 
				default:                           colour = TC_BLACK;  break;
 
			}
 

	
 
			/* Check if the current line should be highlighted */
 
			if (i == this->highlight_row) {
 
			if (std::distance(std::begin(log), it) == this->highlight_row) {
 
				fr.bottom = fr.top + this->resize.step_height - 1;
 
				GfxFillRect(fr, PC_BLACK);
 
				if (colour == TC_BLACK) colour = TC_WHITE; // Make black text readable by inverting it to white.
 
			}
 

	
 
			DrawString(fr, line.text, colour, SA_LEFT | SA_FORCE);
src/signs_gui.cpp
Show inline comments
 
@@ -208,15 +208,15 @@ struct SignListWindow : Window, SignList
 
				bool rtl = _current_text_dir == TD_RTL;
 
				int sprite_offset_y = (this->resize.step_height - d.height + 1) / 2;
 
				uint icon_left = rtl ? tr.right - this->text_offset : tr.left;
 
				tr = tr.Indent(this->text_offset, rtl);
 

	
 
				/* At least one sign available. */
 
				for (uint16_t i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < this->vscroll->GetCount(); i++)
 
				{
 
					const Sign *si = this->signs[i];
 
				auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->signs);
 
				for (auto it = first; it != last; ++it) {
 
					const Sign *si = *it;
 

	
 
					if (si->owner != OWNER_NONE) DrawCompanyIcon(si->owner, icon_left, tr.top + sprite_offset_y);
 

	
 
					SetDParam(0, si->index);
 
					DrawString(tr.left, tr.right, tr.top + text_offset_y, STR_SIGN_NAME, TC_YELLOW);
 
					tr.top += this->resize.step_height;
src/station_gui.cpp
Show inline comments
 
@@ -452,22 +452,22 @@ public:
 
				/* draw arrow pointing up/down for ascending/descending sorting */
 
				this->DrawSortButtonState(WID_STL_SORTBY, this->stations.IsDescSortOrder() ? SBS_DOWN : SBS_UP);
 
				break;
 

	
 
			case WID_STL_LIST: {
 
				bool rtl = _current_text_dir == TD_RTL;
 
				size_t max = std::min<size_t>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->stations.size());
 
				Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
 
				uint line_height = this->GetWidget<NWidgetBase>(widget)->resize_y;
 
				/* Spacing between station name and first rating graph. */
 
				int text_spacing = WidgetDimensions::scaled.hsep_wide;
 
				/* Spacing between additional rating graphs. */
 
				int rating_spacing = WidgetDimensions::scaled.hsep_normal;
 

	
 
				for (size_t i = this->vscroll->GetPosition(); i < max; ++i) { // do until max number of stations of owner
 
					const Station *st = this->stations[i];
 
				auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->stations);
 
				for (auto it = first; it != last; ++it) {
 
					const Station *st = *it;
 
					assert(st->xy != INVALID_TILE);
 

	
 
					/* Do not do the complex check HasStationInUse here, it may be even false
 
					 * when the order had been removed and the station list hasn't been removed yet */
 
					assert(st->owner == owner || st->owner == OWNER_NONE);
 

	
 
@@ -2317,17 +2317,18 @@ struct SelectStationWindow : Window {
 

	
 
	void DrawWidget(const Rect &r, WidgetID widget) const override
 
	{
 
		if (widget != WID_JS_PANEL) return;
 

	
 
		Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
 
		for (uint i = this->vscroll->GetPosition(); i < _stations_nearby_list.size(); ++i, tr.top += this->resize.step_height) {
 
			if (_stations_nearby_list[i] == NEW_STATION) {
 
		auto [first, last] = this->vscroll->GetVisibleRangeIterators(_stations_nearby_list);
 
		for (auto it = first; it != last; ++it, tr.top += this->resize.step_height) {
 
			if (*it == NEW_STATION) {
 
				DrawString(tr, T::EXPECTED_FACIL == FACIL_WAYPOINT ? STR_JOIN_WAYPOINT_CREATE_SPLITTED_WAYPOINT : STR_JOIN_STATION_CREATE_SPLITTED_STATION);
 
			} else {
 
				const T *st = T::Get(_stations_nearby_list[i]);
 
				const T *st = T::Get(*it);
 
				SetDParam(0, st->index);
 
				SetDParam(1, st->facilities);
 
				DrawString(tr, T::EXPECTED_FACIL == FACIL_WAYPOINT ? STR_STATION_LIST_WAYPOINT : STR_STATION_LIST_STATION);
 
			}
 
		}
 

	
src/town_gui.cpp
Show inline comments
 
@@ -837,27 +837,27 @@ public:
 
		switch (widget) {
 
			case WID_TD_SORT_ORDER:
 
				this->DrawSortButtonState(widget, this->towns.IsDescSortOrder() ? SBS_DOWN : SBS_UP);
 
				break;
 

	
 
			case WID_TD_LIST: {
 
				int n = 0;
 
				Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
 
				if (this->towns.empty()) { // No towns available.
 
					DrawString(tr, STR_TOWN_DIRECTORY_NONE);
 
					break;
 
				}
 

	
 
				/* At least one town available. */
 
				bool rtl = _current_text_dir == TD_RTL;
 
				Dimension icon_size = GetSpriteSize(SPR_TOWN_RATING_GOOD);
 
				int icon_x = tr.WithWidth(icon_size.width, rtl).left;
 
				tr = tr.Indent(icon_size.width + WidgetDimensions::scaled.hsep_normal, rtl);
 

	
 
				for (uint i = this->vscroll->GetPosition(); i < this->towns.size(); i++) {
 
					const Town *t = this->towns[i];
 
				auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->towns);
 
				for (auto it = first; it != last; ++it) {
 
					const Town *t = *it;
 
					assert(t->xy != INVALID_TILE);
 

	
 
					/* Draw rating icon. */
 
					if (_game_mode == GM_EDITOR || !HasBit(t->have_ratings, _local_company)) {
 
						DrawSprite(SPR_TOWN_RATING_NA, PAL_NONE, icon_x, tr.top + (this->resize.step_height - icon_size.height) / 2);
 
					} else {
 
@@ -869,13 +869,12 @@ public:
 

	
 
					SetDParam(0, t->index);
 
					SetDParam(1, t->cache.population);
 
					DrawString(tr.left, tr.right, tr.top + (this->resize.step_height - GetCharacterHeight(FS_NORMAL)) / 2, GetTownString(t));
 

	
 
					tr.top += this->resize.step_height;
 
					if (++n == this->vscroll->GetCapacity()) break; // max number of towns in 1 window
 
				}
 
				break;
 
			}
 
		}
 
	}
 

	
src/vehicle_gui.cpp
Show inline comments
 
@@ -1701,16 +1701,15 @@ void BaseVehicleListWindow::DrawVehicleL
 

	
 
	int image_left  = (rtl && show_orderlist) ? olr.right : tr.left;
 
	int image_right = (!rtl && show_orderlist) ? olr.left : tr.right;
 

	
 
	int vehicle_button_x = rtl ? ir.right - profit.width : ir.left;
 

	
 
	uint max = static_cast<uint>(std::min<size_t>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->vehgroups.size()));
 
	for (uint i = this->vscroll->GetPosition(); i < max; ++i) {
 

	
 
		const GUIVehicleGroup &vehgroup = this->vehgroups[i];
 
	auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->vehgroups);
 
	for (auto it = first; it != last; ++it) {
 
		const GUIVehicleGroup &vehgroup = *it;
 

	
 
		SetDParam(0, vehgroup.GetDisplayProfitThisYear());
 
		SetDParam(1, vehgroup.GetDisplayProfitLastYear());
 
		DrawString(tr.left, tr.right, ir.bottom - GetCharacterHeight(FS_SMALL) - WidgetDimensions::scaled.framerect.bottom,
 
			TimerGameEconomy::UsingWallclockUnits() ? STR_VEHICLE_LIST_PROFIT_THIS_PERIOD_LAST_PERIOD : STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR);
 

	
0 comments (0 inline, 0 general)