From ad50c4f2983b454bf5cef7546f4c4d5ec3240295 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 28 Apr 2024 14:56:52 +0200 Subject: [PATCH 01/30] Codechange: inline sorter name definitions and use proper static accessor instead of (implying) this-> --- src/bridge_gui.cpp | 27 +++++++--------- src/industry_gui.cpp | 17 ++++------ src/station_gui.cpp | 77 +++++++++++++++++++++----------------------- src/town_gui.cpp | 15 ++++----- 4 files changed, 61 insertions(+), 75 deletions(-) diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 6510355f8c..c983433b7f 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -75,7 +75,12 @@ private: static Listing last_sorting; ///< Last setting of the sort. /* Constants for sorting the bridges */ - static const StringID sorter_names[]; + static inline const StringID sorter_names[] = { + STR_SORT_BY_NUMBER, + STR_SORT_BY_COST, + STR_SORT_BY_MAX_SPEED, + INVALID_STRING_ID + }; static const std::initializer_list sorter_funcs; /* Internal variables */ @@ -122,7 +127,7 @@ private: this->bridges.Sort(); /* Display the current sort variant */ - this->GetWidget(WID_BBS_DROPDOWN_CRITERIA)->widget_data = this->sorter_names[this->bridges.SortType()]; + this->GetWidget(WID_BBS_DROPDOWN_CRITERIA)->widget_data = BuildBridgeWindow::sorter_names[this->bridges.SortType()]; /* Set the modified widgets dirty */ this->SetWidgetDirty(WID_BBS_DROPDOWN_CRITERIA); @@ -161,8 +166,8 @@ public: this->FinishInitNested(transport_type); // Initializes 'this->icon_width'. this->parent = FindWindowById(WC_BUILD_TOOLBAR, transport_type); - this->bridges.SetListing(this->last_sorting); - this->bridges.SetSortFuncs(this->sorter_funcs); + this->bridges.SetListing(BuildBridgeWindow::last_sorting); + this->bridges.SetSortFuncs(BuildBridgeWindow::sorter_funcs); this->bridges.NeedResort(); this->SortBridgeList(); @@ -171,7 +176,7 @@ public: ~BuildBridgeWindow() { - this->last_sorting = this->bridges.GetListing(); + BuildBridgeWindow::last_sorting = this->bridges.GetListing(); } void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override @@ -186,7 +191,7 @@ public: } case WID_BBS_DROPDOWN_CRITERIA: { Dimension d = {0, 0}; - for (const StringID *str = this->sorter_names; *str != INVALID_STRING_ID; str++) { + for (const StringID *str = BuildBridgeWindow::sorter_names; *str != INVALID_STRING_ID; str++) { d = maxdim(d, GetStringBoundingBox(*str)); } d.width += padding.width; @@ -274,7 +279,7 @@ public: break; case WID_BBS_DROPDOWN_CRITERIA: - ShowDropDownMenu(this, this->sorter_names, this->bridges.SortType(), WID_BBS_DROPDOWN_CRITERIA, 0, 0); + ShowDropDownMenu(this, BuildBridgeWindow::sorter_names, this->bridges.SortType(), WID_BBS_DROPDOWN_CRITERIA, 0, 0); break; } } @@ -304,14 +309,6 @@ const std::initializer_list BuildBridgeWind &BridgeSpeedSorter }; -/** Names of the sorting functions. */ -const StringID BuildBridgeWindow::sorter_names[] = { - STR_SORT_BY_NUMBER, - STR_SORT_BY_COST, - STR_SORT_BY_MAX_SPEED, - INVALID_STRING_ID -}; - /** Widgets of the bridge gui. */ static constexpr NWidgetPart _nested_build_bridge_widgets[] = { /* Header */ diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 25f48a3ed5..ebde5b921d 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1325,7 +1325,13 @@ protected: static Listing last_sorting; /* Constants for sorting industries */ - static const StringID sorter_names[]; + static inline const StringID sorter_names[] = { + STR_SORT_BY_NAME, + STR_SORT_BY_TYPE, + STR_SORT_BY_PRODUCTION, + STR_SORT_BY_TRANSPORTED, + INVALID_STRING_ID + }; static const std::initializer_list sorter_funcs; GUIIndustryList industries{IndustryDirectoryWindow::produced_cargo_filter}; @@ -1909,15 +1915,6 @@ const std::initializer_list IndustryDirec &IndustryTransportedCargoSorter }; -/* Names of the sorting functions */ -const StringID IndustryDirectoryWindow::sorter_names[] = { - STR_SORT_BY_NAME, - STR_SORT_BY_TYPE, - STR_SORT_BY_PRODUCTION, - STR_SORT_BY_TRANSPORTED, - INVALID_STRING_ID -}; - CargoID IndustryDirectoryWindow::produced_cargo_filter = CargoFilterCriteria::CF_ANY; diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 241a512b12..d3b04b2749 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -244,7 +244,15 @@ protected: }; /* Constants for sorting stations */ - static const StringID sorter_names[]; + static inline const StringID sorter_names[] = { + STR_SORT_BY_NAME, + STR_SORT_BY_FACILITY, + STR_SORT_BY_WAITING_TOTAL, + STR_SORT_BY_WAITING_AVAILABLE, + STR_SORT_BY_RATING_MAX, + STR_SORT_BY_RATING_MIN, + INVALID_STRING_ID + }; static const std::initializer_list sorter_funcs; FilterState filter; @@ -400,7 +408,7 @@ public: if (HasBit(this->filter.facilities, i)) this->LowerWidget(i + WID_STL_TRAIN); } - this->GetWidget(WID_STL_SORTDROPBTN)->widget_data = this->sorter_names[this->stations.SortType()]; + this->GetWidget(WID_STL_SORTDROPBTN)->widget_data = CompanyStationsWindow::sorter_names[this->stations.SortType()]; } ~CompanyStationsWindow() @@ -627,7 +635,7 @@ public: break; case WID_STL_SORTDROPBTN: // select sorting criteria dropdown menu - ShowDropDownMenu(this, this->sorter_names, this->stations.SortType(), WID_STL_SORTDROPBTN, 0, 0); + ShowDropDownMenu(this, CompanyStationsWindow::sorter_names, this->stations.SortType(), WID_STL_SORTDROPBTN, 0, 0); break; case WID_STL_CARGODROPDOWN: @@ -644,7 +652,7 @@ public: this->stations.SetSortType(index); /* Display the current sort variant */ - this->GetWidget(WID_STL_SORTDROPBTN)->widget_data = this->sorter_names[this->stations.SortType()]; + this->GetWidget(WID_STL_SORTDROPBTN)->widget_data = CompanyStationsWindow::sorter_names[this->stations.SortType()]; this->SetDirty(); } @@ -728,17 +736,6 @@ const std::initializer_list CompanyStation &StationRatingMinSorter }; -/* Names of the sorting functions */ -const StringID CompanyStationsWindow::sorter_names[] = { - STR_SORT_BY_NAME, - STR_SORT_BY_FACILITY, - STR_SORT_BY_WAITING_TOTAL, - STR_SORT_BY_WAITING_AVAILABLE, - STR_SORT_BY_RATING_MAX, - STR_SORT_BY_RATING_MIN, - INVALID_STRING_ID -}; - static constexpr NWidgetPart _nested_company_stations_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1291,8 +1288,24 @@ struct StationViewWindow : public Window { ALH_ACCEPTS = 3, ///< Height of the accepted cargo view. }; - static const StringID _sort_names[]; ///< Names of the sorting options in the dropdown. - static const StringID _group_names[]; ///< Names of the grouping options in the dropdown. + /** Names of the sorting options in the dropdown. */ + static inline const StringID sort_names[] = { + STR_STATION_VIEW_WAITING_STATION, + STR_STATION_VIEW_WAITING_AMOUNT, + STR_STATION_VIEW_PLANNED_STATION, + STR_STATION_VIEW_PLANNED_AMOUNT, + INVALID_STRING_ID + }; + /** Names of the grouping options in the dropdown. */ + static inline const StringID group_names[] = { + STR_STATION_VIEW_GROUP_S_V_D, + STR_STATION_VIEW_GROUP_S_D_V, + STR_STATION_VIEW_GROUP_V_S_D, + STR_STATION_VIEW_GROUP_V_D_S, + STR_STATION_VIEW_GROUP_D_S_V, + STR_STATION_VIEW_GROUP_D_V_S, + INVALID_STRING_ID + }; /** * Sort types of the different 'columns'. @@ -1977,14 +1990,14 @@ struct StationViewWindow : public Window { * sorting criteria for columns 1, 2, and 3. Column 0 is always * sorted by cargo ID. The others can theoretically be sorted * by different things but there is no UI for that. */ - ShowDropDownMenu(this, _sort_names, + ShowDropDownMenu(this, StationViewWindow::sort_names, this->current_mode * 2 + (this->sortings[1] == CargoSortType::Count ? 1 : 0), WID_SV_SORT_BY, 0, 0); break; } case WID_SV_GROUP_BY: { - ShowDropDownMenu(this, _group_names, this->grouping_index, WID_SV_GROUP_BY, 0, 0); + ShowDropDownMenu(this, StationViewWindow::group_names, this->grouping_index, WID_SV_GROUP_BY, 0, 0); break; } @@ -2015,7 +2028,7 @@ struct StationViewWindow : public Window { void SelectSortBy(int index) { _settings_client.gui.station_gui_sort_by = index; - switch (_sort_names[index]) { + switch (StationViewWindow::sort_names[index]) { case STR_STATION_VIEW_WAITING_STATION: this->current_mode = MODE_WAITING; this->sortings[1] = this->sortings[2] = this->sortings[3] = CargoSortType::AsGrouping; @@ -2036,7 +2049,7 @@ struct StationViewWindow : public Window { NOT_REACHED(); } /* Display the current sort variant */ - this->GetWidget(WID_SV_SORT_BY)->widget_data = _sort_names[index]; + this->GetWidget(WID_SV_SORT_BY)->widget_data = StationViewWindow::sort_names[index]; this->SetDirty(); } @@ -2048,8 +2061,8 @@ struct StationViewWindow : public Window { { this->grouping_index = index; _settings_client.gui.station_gui_group_order = index; - this->GetWidget(WID_SV_GROUP_BY)->widget_data = _group_names[index]; - switch (_group_names[index]) { + this->GetWidget(WID_SV_GROUP_BY)->widget_data = StationViewWindow::group_names[index]; + switch (StationViewWindow::group_names[index]) { case STR_STATION_VIEW_GROUP_S_V_D: this->groupings[1] = GR_SOURCE; this->groupings[2] = GR_NEXT; @@ -2122,24 +2135,6 @@ struct StationViewWindow : public Window { } }; -const StringID StationViewWindow::_sort_names[] = { - STR_STATION_VIEW_WAITING_STATION, - STR_STATION_VIEW_WAITING_AMOUNT, - STR_STATION_VIEW_PLANNED_STATION, - STR_STATION_VIEW_PLANNED_AMOUNT, - INVALID_STRING_ID -}; - -const StringID StationViewWindow::_group_names[] = { - STR_STATION_VIEW_GROUP_S_V_D, - STR_STATION_VIEW_GROUP_S_D_V, - STR_STATION_VIEW_GROUP_V_S_D, - STR_STATION_VIEW_GROUP_V_D_S, - STR_STATION_VIEW_GROUP_D_S_V, - STR_STATION_VIEW_GROUP_D_V_S, - INVALID_STRING_ID -}; - static WindowDesc _station_view_desc( WDP_AUTO, "view_station", 249, 117, WC_STATION_VIEW, WC_NONE, diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 0b5e729f99..8e38d7c1d1 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -720,7 +720,12 @@ private: static Listing last_sorting; /* Constants for sorting towns */ - static const StringID sorter_names[]; + static inline const StringID sorter_names[] = { + STR_SORT_BY_NAME, + STR_SORT_BY_POPULATION, + STR_SORT_BY_RATING, + INVALID_STRING_ID + }; static const std::initializer_list sorter_funcs; StringFilter string_filter; ///< Filter for towns @@ -1045,14 +1050,6 @@ public: Listing TownDirectoryWindow::last_sorting = {false, 0}; -/** Names of the sorting functions. */ -const StringID TownDirectoryWindow::sorter_names[] = { - STR_SORT_BY_NAME, - STR_SORT_BY_POPULATION, - STR_SORT_BY_RATING, - INVALID_STRING_ID -}; - /** Available town directory sorting functions. */ const std::initializer_list TownDirectoryWindow::sorter_funcs = { &TownNameSorter, From 546a996d9505f4dc4dfcbf673fc803bb57dd5ef7 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 28 Apr 2024 15:25:21 +0200 Subject: [PATCH 02/30] Codechange: pass options to ShowDropDownMenu using a span --- src/autoreplace_gui.cpp | 2 +- src/build_vehicle_gui.cpp | 4 ++-- src/dropdown.cpp | 2 +- src/dropdown_func.h | 2 +- src/engine_gui.h | 2 +- src/gfx.cpp | 4 ++-- src/gfx_func.h | 2 +- src/group_gui.cpp | 2 +- src/vehicle_gui.cpp | 14 +++++++------- src/vehicle_gui_base.h | 12 ++++++------ 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index b145e34696..891e9febc6 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -402,7 +402,7 @@ public: break; case WID_RV_SORT_DROPDOWN: - SetDParam(0, _engine_sort_listing[this->window_number][this->sort_criteria]); + SetDParam(0, std::data(_engine_sort_listing[this->window_number])[this->sort_criteria]); break; case WID_RV_TRAIN_WAGONREMOVE_TOGGLE: { diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 9b5daa0f43..6c587e794b 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -484,7 +484,7 @@ EngList_SortTypeFunction * const _engine_sort_functions[][11] = {{ }}; /** Dropdown menu strings for the vehicle sort criteria. */ -const StringID _engine_sort_listing[][12] = {{ +const std::initializer_list _engine_sort_listing[] = {{ /* Trains */ STR_SORT_BY_ENGINE_ID, STR_SORT_BY_COST, @@ -1747,7 +1747,7 @@ struct BuildVehicleWindow : Window { break; case WID_BV_SORT_DROPDOWN: - SetDParam(0, _engine_sort_listing[this->vehicle_type][this->sort_criteria]); + SetDParam(0, std::data(_engine_sort_listing[this->vehicle_type])[this->sort_criteria]); break; case WID_BV_CARGO_FILTER_DROPDOWN: diff --git a/src/dropdown.cpp b/src/dropdown.cpp index 6366090b88..da92a0c765 100644 --- a/src/dropdown.cpp +++ b/src/dropdown.cpp @@ -438,7 +438,7 @@ void ShowDropDownList(Window *w, DropDownList &&list, int selected, WidgetID but * @param hidden_mask Bitmask for hidden items (items with their bit set are not copied to the dropdown list). * @param width Minimum width of the dropdown menu. */ -void ShowDropDownMenu(Window *w, const StringID *strings, int selected, WidgetID button, uint32_t disabled_mask, uint32_t hidden_mask, uint width) +void ShowDropDownMenu(Window *w, std::span strings, int selected, WidgetID button, uint32_t disabled_mask, uint32_t hidden_mask, uint width) { DropDownList list; diff --git a/src/dropdown_func.h b/src/dropdown_func.h index dee640e00f..6aee0066f7 100644 --- a/src/dropdown_func.h +++ b/src/dropdown_func.h @@ -13,7 +13,7 @@ #include "window_gui.h" /* Show drop down menu containing a fixed list of strings */ -void ShowDropDownMenu(Window *w, const StringID *strings, int selected, WidgetID button, uint32_t disabled_mask, uint32_t hidden_mask, uint width = 0); +void ShowDropDownMenu(Window *w, std::span strings, int selected, WidgetID button, uint32_t disabled_mask, uint32_t hidden_mask, uint width = 0); /* Helper functions for commonly used drop down list items. */ std::unique_ptr MakeDropDownListDividerItem(); diff --git a/src/engine_gui.h b/src/engine_gui.h index ba7e41715f..5e2d5fe336 100644 --- a/src/engine_gui.h +++ b/src/engine_gui.h @@ -49,7 +49,7 @@ extern bool _engine_sort_direction; extern uint8_t _engine_sort_last_criteria[]; extern bool _engine_sort_last_order[]; extern bool _engine_sort_show_hidden_engines[]; -extern const StringID _engine_sort_listing[][12]; +extern const std::initializer_list _engine_sort_listing[]; extern EngList_SortTypeFunction * const _engine_sort_functions[][11]; /* Functions in build_vehicle_gui.cpp */ diff --git a/src/gfx.cpp b/src/gfx.cpp index 0292dff16a..b3bdc79998 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -868,10 +868,10 @@ Dimension GetStringBoundingBox(StringID strid, FontSize start_fontsize) * @param fontsize Font size to use. * @return Width of longest string within the list. */ -uint GetStringListWidth(const StringID *list, FontSize fontsize) +uint GetStringListWidth(std::span list, FontSize fontsize) { uint width = 0; - for (const StringID *str = list; *str != INVALID_STRING_ID; str++) { + for (const StringID *str = list.data(); *str != INVALID_STRING_ID; str++) { width = std::max(width, GetStringBoundingBox(*str, fontsize).width); } return width; diff --git a/src/gfx_func.h b/src/gfx_func.h index 7d6aff7c07..592bcc5a8d 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -133,7 +133,7 @@ inline void GfxFillRect(const Rect &r, int colour, FillRectMode mode = FILLRECT_ Dimension GetStringBoundingBox(std::string_view str, FontSize start_fontsize = FS_NORMAL); Dimension GetStringBoundingBox(StringID strid, FontSize start_fontsize = FS_NORMAL); -uint GetStringListWidth(const StringID *list, FontSize fontsize = FS_NORMAL); +uint GetStringListWidth(std::span list, FontSize fontsize = FS_NORMAL); int GetStringHeight(std::string_view str, int maxw, FontSize fontsize = FS_NORMAL); int GetStringHeight(StringID str, int maxw); int GetStringLineCount(StringID str, int maxw); diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 64b81228fb..b355e9f98f 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -588,7 +588,7 @@ public: this->GetWidget(WID_GL_REPLACE_PROTECTION)->widget_data = protect_sprite + this->vli.vtype; /* Set text of "group by" dropdown widget. */ - this->GetWidget(WID_GL_GROUP_BY_DROPDOWN)->widget_data = this->vehicle_group_by_names[this->grouping]; + this->GetWidget(WID_GL_GROUP_BY_DROPDOWN)->widget_data = std::data(this->vehicle_group_by_names)[this->grouping]; /* Set text of "sort by" dropdown widget. */ this->GetWidget(WID_GL_SORT_BY_DROPDOWN)->widget_data = this->GetVehicleSorterNames()[this->vehgroups.SortType()]; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 240a5cb9c5..6d85048134 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -94,7 +94,7 @@ const std::initializer_list, }; -const StringID BaseVehicleListWindow::vehicle_group_none_sorter_names_calendar[] = { +const std::initializer_list BaseVehicleListWindow::vehicle_group_none_sorter_names_calendar = { STR_SORT_BY_NUMBER, STR_SORT_BY_NAME, STR_SORT_BY_AGE, @@ -111,7 +111,7 @@ const StringID BaseVehicleListWindow::vehicle_group_none_sorter_names_calendar[] INVALID_STRING_ID }; -const StringID BaseVehicleListWindow::vehicle_group_none_sorter_names_wallclock[] = { +const std::initializer_list BaseVehicleListWindow::vehicle_group_none_sorter_names_wallclock = { STR_SORT_BY_NUMBER, STR_SORT_BY_NAME, STR_SORT_BY_AGE, @@ -136,7 +136,7 @@ const std::initializer_list BaseVehicleListWindow::vehicle_group_shared_orders_sorter_names_calendar = { STR_SORT_BY_NUM_VEHICLES, STR_SORT_BY_TOTAL_PROFIT_THIS_YEAR, STR_SORT_BY_TOTAL_PROFIT_LAST_YEAR, @@ -145,7 +145,7 @@ const StringID BaseVehicleListWindow::vehicle_group_shared_orders_sorter_names_c INVALID_STRING_ID }; -const StringID BaseVehicleListWindow::vehicle_group_shared_orders_sorter_names_wallclock[] = { +const std::initializer_list BaseVehicleListWindow::vehicle_group_shared_orders_sorter_names_wallclock = { STR_SORT_BY_NUM_VEHICLES, STR_SORT_BY_TOTAL_PROFIT_THIS_PERIOD, STR_SORT_BY_TOTAL_PROFIT_LAST_PERIOD, @@ -154,7 +154,7 @@ const StringID BaseVehicleListWindow::vehicle_group_shared_orders_sorter_names_w INVALID_STRING_ID }; -const StringID BaseVehicleListWindow::vehicle_group_by_names[] = { +const std::initializer_list BaseVehicleListWindow::vehicle_group_by_names = { STR_GROUP_BY_NONE, STR_GROUP_BY_SHARED_ORDERS, INVALID_STRING_ID @@ -174,7 +174,7 @@ BaseVehicleListWindow::BaseVehicleListWindow(WindowDesc *desc, WindowNumber wno) this->UpdateSortingFromGrouping(); } -const StringID *BaseVehicleListWindow::GetVehicleSorterNames() +std::span BaseVehicleListWindow::GetVehicleSorterNames() { switch (this->grouping) { case GB_NONE: @@ -2048,7 +2048,7 @@ public: } /* Set text of group by dropdown widget. */ - this->GetWidget(WID_VL_GROUP_BY_PULLDOWN)->widget_data = this->vehicle_group_by_names[this->grouping]; + this->GetWidget(WID_VL_GROUP_BY_PULLDOWN)->widget_data = std::data(this->vehicle_group_by_names)[this->grouping]; /* Set text of sort by dropdown widget. */ this->GetWidget(WID_VL_SORT_BY_PULLDOWN)->widget_data = this->GetVehicleSorterNames()[this->vehgroups.SortType()]; diff --git a/src/vehicle_gui_base.h b/src/vehicle_gui_base.h index 4b4519b225..73036fefe3 100644 --- a/src/vehicle_gui_base.h +++ b/src/vehicle_gui_base.h @@ -98,11 +98,11 @@ struct BaseVehicleListWindow : public Window { }; static const StringID vehicle_depot_name[]; - static const StringID vehicle_group_by_names[]; - static const StringID vehicle_group_none_sorter_names_calendar[]; - static const StringID vehicle_group_none_sorter_names_wallclock[]; - static const StringID vehicle_group_shared_orders_sorter_names_calendar[]; - static const StringID vehicle_group_shared_orders_sorter_names_wallclock[]; + static const std::initializer_list vehicle_group_by_names; + static const std::initializer_list vehicle_group_none_sorter_names_calendar; + static const std::initializer_list vehicle_group_none_sorter_names_wallclock; + static const std::initializer_list vehicle_group_shared_orders_sorter_names_calendar; + static const std::initializer_list vehicle_group_shared_orders_sorter_names_wallclock; static const std::initializer_list vehicle_group_none_sorter_funcs; static const std::initializer_list vehicle_group_shared_orders_sorter_funcs; @@ -124,7 +124,7 @@ struct BaseVehicleListWindow : public Window { Dimension GetActionDropdownSize(bool show_autoreplace, bool show_group, bool show_create); DropDownList BuildActionDropdownList(bool show_autoreplace, bool show_group, bool show_create); - const StringID *GetVehicleSorterNames(); + std::span GetVehicleSorterNames(); std::span GetVehicleSorterFuncs() { From 37a03b513f19396051899b3d0b18e492029a5d9d Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 28 Apr 2024 15:59:53 +0200 Subject: [PATCH 03/30] Codechange: refactor string list dimension finding into a separate function --- src/autoreplace_gui.cpp | 4 +--- src/bridge_gui.cpp | 5 +---- src/genworld_gui.cpp | 8 ++------ src/gfx.cpp | 16 ++++++++++++++++ src/gfx_func.h | 1 + src/industry_gui.cpp | 5 +---- src/order_gui.cpp | 5 +---- src/station_gui.cpp | 5 +---- src/town_gui.cpp | 5 +---- src/vehicle_gui.cpp | 7 +------ 10 files changed, 26 insertions(+), 35 deletions(-) diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 891e9febc6..db58477657 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -369,9 +369,7 @@ public: case WID_RV_START_REPLACE: { Dimension d = GetStringBoundingBox(STR_REPLACE_VEHICLES_START); - for (int i = 0; _start_replace_dropdown[i] != INVALID_STRING_ID; i++) { - d = maxdim(d, GetStringBoundingBox(_start_replace_dropdown[i])); - } + maxdim(d, GetStringListBoundingBox(_start_replace_dropdown)); d.width += padding.width; d.height += padding.height; size = maxdim(size, d); diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index c983433b7f..9683b59d33 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -190,10 +190,7 @@ public: break; } case WID_BBS_DROPDOWN_CRITERIA: { - Dimension d = {0, 0}; - for (const StringID *str = BuildBridgeWindow::sorter_names; *str != INVALID_STRING_ID; str++) { - d = maxdim(d, GetStringBoundingBox(*str)); - } + Dimension d = GetStringListBoundingBox(BuildBridgeWindow::sorter_names); d.width += padding.width; d.height += padding.height; size = maxdim(size, d); diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 5cd4112061..4ac2bbae36 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -574,7 +574,7 @@ struct GenerateLandscapeWindow : public Window { void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override { Dimension d{0, (uint)GetCharacterHeight(FS_NORMAL)}; - const StringID *strs = nullptr; + std::span strs; switch (widget) { case WID_GL_TEMPERATE: case WID_GL_ARCTIC: case WID_GL_TROPICAL: case WID_GL_TOYLAND: @@ -660,11 +660,7 @@ struct GenerateLandscapeWindow : public Window { default: return; } - if (strs != nullptr) { - while (*strs != INVALID_STRING_ID) { - d = maxdim(d, GetStringBoundingBox(*strs++)); - } - } + maxdim(d, GetStringListBoundingBox(strs)); d.width += padding.width; d.height += padding.height; size = maxdim(size, d); diff --git a/src/gfx.cpp b/src/gfx.cpp index b3bdc79998..64bfc4a807 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -22,6 +22,7 @@ #include "newgrf_debug.h" #include "core/backup_type.hpp" #include "core/container_func.hpp" +#include "core/geometry_func.hpp" #include "viewport_func.h" #include "table/string_colours.h" @@ -877,6 +878,21 @@ uint GetStringListWidth(std::span list, FontSize fontsize) return width; } +/** + * Get maximum dimension of a list of strings. + * @param list List of strings, terminated by INVALID_STRING_ID. + * @param fontsize Font size to use. + * @return Dimension of highest and longest string within the list. + */ +Dimension GetStringListBoundingBox(std::span list, FontSize fontsize) +{ + Dimension d{0, 0}; + for (const StringID *str = list.data(); *str != INVALID_STRING_ID; str++) { + d = maxdim(d, GetStringBoundingBox(*str, fontsize)); + } + return d; +} + /** * Get the leading corner of a character in a single-line string relative * to the start of the string. diff --git a/src/gfx_func.h b/src/gfx_func.h index 592bcc5a8d..c6c1a46a4c 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -134,6 +134,7 @@ inline void GfxFillRect(const Rect &r, int colour, FillRectMode mode = FILLRECT_ Dimension GetStringBoundingBox(std::string_view str, FontSize start_fontsize = FS_NORMAL); Dimension GetStringBoundingBox(StringID strid, FontSize start_fontsize = FS_NORMAL); uint GetStringListWidth(std::span list, FontSize fontsize = FS_NORMAL); +Dimension GetStringListBoundingBox(std::span list, FontSize fontsize = FS_NORMAL); int GetStringHeight(std::string_view str, int maxw, FontSize fontsize = FS_NORMAL); int GetStringHeight(StringID str, int maxw); int GetStringLineCount(StringID str, int maxw); diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index ebde5b921d..863789f250 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1739,10 +1739,7 @@ public: } case WID_ID_DROPDOWN_CRITERIA: { - Dimension d = {0, 0}; - for (uint i = 0; IndustryDirectoryWindow::sorter_names[i] != INVALID_STRING_ID; i++) { - d = maxdim(d, GetStringBoundingBox(IndustryDirectoryWindow::sorter_names[i])); - } + Dimension d = GetStringListBoundingBox(IndustryDirectoryWindow::sorter_names); d.width += padding.width; d.height += padding.height; size = maxdim(size, d); diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 397502cd32..06fb5318af 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -854,10 +854,7 @@ public: } case WID_O_COND_COMPARATOR: { - Dimension d = {0, 0}; - for (int i = 0; _order_conditional_condition[i] != INVALID_STRING_ID; i++) { - d = maxdim(d, GetStringBoundingBox(_order_conditional_condition[i])); - } + Dimension d = GetStringListBoundingBox(_order_conditional_condition); d.width += padding.width; d.height += padding.height; size = maxdim(size, d); diff --git a/src/station_gui.cpp b/src/station_gui.cpp index d3b04b2749..d538fa33a2 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -430,10 +430,7 @@ public: } case WID_STL_SORTDROPBTN: { - Dimension d = {0, 0}; - for (int i = 0; CompanyStationsWindow::sorter_names[i] != INVALID_STRING_ID; i++) { - d = maxdim(d, GetStringBoundingBox(CompanyStationsWindow::sorter_names[i])); - } + Dimension d = GetStringListBoundingBox(CompanyStationsWindow::sorter_names); d.width += padding.width; d.height += padding.height; size = maxdim(size, d); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 8e38d7c1d1..e030111cdb 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -894,10 +894,7 @@ public: break; } case WID_TD_SORT_CRITERIA: { - Dimension d = {0, 0}; - for (uint i = 0; TownDirectoryWindow::sorter_names[i] != INVALID_STRING_ID; i++) { - d = maxdim(d, GetStringBoundingBox(TownDirectoryWindow::sorter_names[i])); - } + Dimension d = GetStringListBoundingBox(TownDirectoryWindow::sorter_names); d.width += padding.width; d.height += padding.height; size = maxdim(size, d); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 6d85048134..2b7e9c00ff 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2487,12 +2487,7 @@ struct VehicleDetailsWindow : Window { break; case WID_VD_SERVICE_INTERVAL_DROPDOWN: { - Dimension d{0, 0}; - for (const StringID *strs : {_service_interval_dropdown_calendar, _service_interval_dropdown_wallclock}) { - while (*strs != INVALID_STRING_ID) { - d = maxdim(d, GetStringBoundingBox(*strs++)); - } - } + Dimension d = maxdim(GetStringListBoundingBox(_service_interval_dropdown_calendar), GetStringListBoundingBox(_service_interval_dropdown_wallclock)); d.width += padding.width; d.height += padding.height; size = maxdim(size, d); From d183d8e58701c31987980490dd0d763280d6a9f8 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 28 Apr 2024 16:03:29 +0200 Subject: [PATCH 04/30] Codechange: remove INVALID_STRING_ID now drop down uses spans --- src/autoreplace_gui.cpp | 1 - src/bridge_gui.cpp | 1 - src/build_vehicle_gui.cpp | 4 ---- src/dropdown.cpp | 8 +++++--- src/genworld_gui.cpp | 18 +++++++++--------- src/gfx.cpp | 10 +++++----- src/industry_gui.cpp | 1 - src/order_gui.cpp | 8 -------- src/station_gui.cpp | 3 --- src/town_gui.cpp | 1 - src/vehicle_gui.cpp | 7 ------- 11 files changed, 19 insertions(+), 43 deletions(-) diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index db58477657..f6d819d612 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -71,7 +71,6 @@ void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type) static const StringID _start_replace_dropdown[] = { STR_REPLACE_VEHICLES_NOW, STR_REPLACE_VEHICLES_WHEN_OLD, - INVALID_STRING_ID }; /** diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 9683b59d33..023411b115 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -79,7 +79,6 @@ private: STR_SORT_BY_NUMBER, STR_SORT_BY_COST, STR_SORT_BY_MAX_SPEED, - INVALID_STRING_ID }; static const std::initializer_list sorter_funcs; diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 6c587e794b..12934979ef 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -497,7 +497,6 @@ const std::initializer_list _engine_sort_listing[] = {{ STR_SORT_BY_POWER_VS_RUNNING_COST, STR_SORT_BY_RELIABILITY, STR_SORT_BY_CARGO_CAPACITY, - INVALID_STRING_ID }, { /* Road vehicles */ STR_SORT_BY_ENGINE_ID, @@ -511,7 +510,6 @@ const std::initializer_list _engine_sort_listing[] = {{ STR_SORT_BY_POWER_VS_RUNNING_COST, STR_SORT_BY_RELIABILITY, STR_SORT_BY_CARGO_CAPACITY, - INVALID_STRING_ID }, { /* Ships */ STR_SORT_BY_ENGINE_ID, @@ -522,7 +520,6 @@ const std::initializer_list _engine_sort_listing[] = {{ STR_SORT_BY_RUNNING_COST, STR_SORT_BY_RELIABILITY, STR_SORT_BY_CARGO_CAPACITY, - INVALID_STRING_ID }, { /* Aircraft */ STR_SORT_BY_ENGINE_ID, @@ -534,7 +531,6 @@ const std::initializer_list _engine_sort_listing[] = {{ STR_SORT_BY_RELIABILITY, STR_SORT_BY_CARGO_CAPACITY, STR_SORT_BY_RANGE, - INVALID_STRING_ID }}; /** Filters vehicles by cargo and engine (in case of rail vehicle). */ diff --git a/src/dropdown.cpp b/src/dropdown.cpp index da92a0c765..2e1cd43452 100644 --- a/src/dropdown.cpp +++ b/src/dropdown.cpp @@ -431,7 +431,7 @@ void ShowDropDownList(Window *w, DropDownList &&list, int selected, WidgetID but * Show a dropdown menu window near a widget of the parent window. * The result code of the items is their index in the \a strings list. * @param w Parent window that wants the dropdown menu. - * @param strings Menu list, end with #INVALID_STRING_ID + * @param strings Menu list. * @param selected Index of initial selected item. * @param button Button widget number of the parent window \a w that wants the dropdown menu. * @param disabled_mask Bitmask for disabled items (items with their bit set are displayed, but not selectable in the dropdown list). @@ -442,10 +442,12 @@ void ShowDropDownMenu(Window *w, std::span strings, int selected { DropDownList list; - for (uint i = 0; strings[i] != INVALID_STRING_ID; i++) { + uint i = 0; + for (auto string : strings) { if (!HasBit(hidden_mask, i)) { - list.push_back(MakeDropDownListStringItem(strings[i], i, HasBit(disabled_mask, i))); + list.push_back(MakeDropDownListStringItem(string, i, HasBit(disabled_mask, i))); } + ++i; } if (!list.empty()) ShowDropDownList(w, std::move(list), selected, button, width); diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 4ac2bbae36..cd203da979 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -373,16 +373,16 @@ static DropDownList BuildTownNameDropDown() } -static const StringID _elevations[] = {STR_TERRAIN_TYPE_VERY_FLAT, STR_TERRAIN_TYPE_FLAT, STR_TERRAIN_TYPE_HILLY, STR_TERRAIN_TYPE_MOUNTAINOUS, STR_TERRAIN_TYPE_ALPINIST, STR_TERRAIN_TYPE_CUSTOM, INVALID_STRING_ID}; -static const StringID _sea_lakes[] = {STR_SEA_LEVEL_VERY_LOW, STR_SEA_LEVEL_LOW, STR_SEA_LEVEL_MEDIUM, STR_SEA_LEVEL_HIGH, STR_SEA_LEVEL_CUSTOM, INVALID_STRING_ID}; -static const StringID _rivers[] = {STR_RIVERS_NONE, STR_RIVERS_FEW, STR_RIVERS_MODERATE, STR_RIVERS_LOT, INVALID_STRING_ID}; -static const StringID _smoothness[] = {STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH, INVALID_STRING_ID}; -static const StringID _rotation[] = {STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE, STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_CLOCKWISE, INVALID_STRING_ID}; -static const StringID _num_towns[] = {STR_NUM_VERY_LOW, STR_NUM_LOW, STR_NUM_NORMAL, STR_NUM_HIGH, STR_NUM_CUSTOM, INVALID_STRING_ID}; -static const StringID _num_inds[] = {STR_FUNDING_ONLY, STR_MINIMAL, STR_NUM_VERY_LOW, STR_NUM_LOW, STR_NUM_NORMAL, STR_NUM_HIGH, STR_NUM_CUSTOM, INVALID_STRING_ID}; -static const StringID _variety[] = {STR_VARIETY_NONE, STR_VARIETY_VERY_LOW, STR_VARIETY_LOW, STR_VARIETY_MEDIUM, STR_VARIETY_HIGH, STR_VARIETY_VERY_HIGH, INVALID_STRING_ID}; +static const StringID _elevations[] = {STR_TERRAIN_TYPE_VERY_FLAT, STR_TERRAIN_TYPE_FLAT, STR_TERRAIN_TYPE_HILLY, STR_TERRAIN_TYPE_MOUNTAINOUS, STR_TERRAIN_TYPE_ALPINIST, STR_TERRAIN_TYPE_CUSTOM}; +static const StringID _sea_lakes[] = {STR_SEA_LEVEL_VERY_LOW, STR_SEA_LEVEL_LOW, STR_SEA_LEVEL_MEDIUM, STR_SEA_LEVEL_HIGH, STR_SEA_LEVEL_CUSTOM}; +static const StringID _rivers[] = {STR_RIVERS_NONE, STR_RIVERS_FEW, STR_RIVERS_MODERATE, STR_RIVERS_LOT}; +static const StringID _smoothness[] = {STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH}; +static const StringID _rotation[] = {STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE, STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_CLOCKWISE}; +static const StringID _num_towns[] = {STR_NUM_VERY_LOW, STR_NUM_LOW, STR_NUM_NORMAL, STR_NUM_HIGH, STR_NUM_CUSTOM}; +static const StringID _num_inds[] = {STR_FUNDING_ONLY, STR_MINIMAL, STR_NUM_VERY_LOW, STR_NUM_LOW, STR_NUM_NORMAL, STR_NUM_HIGH, STR_NUM_CUSTOM}; +static const StringID _variety[] = {STR_VARIETY_NONE, STR_VARIETY_VERY_LOW, STR_VARIETY_LOW, STR_VARIETY_MEDIUM, STR_VARIETY_HIGH, STR_VARIETY_VERY_HIGH}; -static_assert(lengthof(_num_inds) == ID_END + 1); +static_assert(std::size(_num_inds) == ID_END); struct GenerateLandscapeWindow : public Window { WidgetID widget_id; diff --git a/src/gfx.cpp b/src/gfx.cpp index 64bfc4a807..3d652ab18d 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -865,15 +865,15 @@ Dimension GetStringBoundingBox(StringID strid, FontSize start_fontsize) /** * Get maximum width of a list of strings. - * @param list List of strings, terminated with INVALID_STRING_ID. + * @param list List of strings. * @param fontsize Font size to use. * @return Width of longest string within the list. */ uint GetStringListWidth(std::span list, FontSize fontsize) { uint width = 0; - for (const StringID *str = list.data(); *str != INVALID_STRING_ID; str++) { - width = std::max(width, GetStringBoundingBox(*str, fontsize).width); + for (auto str : list) { + width = std::max(width, GetStringBoundingBox(str, fontsize).width); } return width; } @@ -887,8 +887,8 @@ uint GetStringListWidth(std::span list, FontSize fontsize) Dimension GetStringListBoundingBox(std::span list, FontSize fontsize) { Dimension d{0, 0}; - for (const StringID *str = list.data(); *str != INVALID_STRING_ID; str++) { - d = maxdim(d, GetStringBoundingBox(*str, fontsize)); + for (auto str : list) { + d = maxdim(d, GetStringBoundingBox(str, fontsize)); } return d; } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 863789f250..35cc27d837 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1330,7 +1330,6 @@ protected: STR_SORT_BY_TYPE, STR_SORT_BY_PRODUCTION, STR_SORT_BY_TRANSPORTED, - INVALID_STRING_ID }; static const std::initializer_list sorter_funcs; diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 06fb5318af..43101d1cd1 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -116,7 +116,6 @@ static const StringID _order_non_stop_drowdown[] = { STR_ORDER_GO_NON_STOP_TO, STR_ORDER_GO_VIA, STR_ORDER_GO_NON_STOP_VIA, - INVALID_STRING_ID }; static const StringID _order_full_load_drowdown[] = { @@ -125,7 +124,6 @@ static const StringID _order_full_load_drowdown[] = { STR_ORDER_DROP_FULL_LOAD_ALL, STR_ORDER_DROP_FULL_LOAD_ANY, STR_ORDER_DROP_NO_LOADING, - INVALID_STRING_ID }; static const StringID _order_unload_drowdown[] = { @@ -134,7 +132,6 @@ static const StringID _order_unload_drowdown[] = { STR_ORDER_DROP_TRANSFER, STR_EMPTY, STR_ORDER_DROP_NO_UNLOADING, - INVALID_STRING_ID }; static const StringID _order_goto_dropdown[] = { @@ -142,7 +139,6 @@ static const StringID _order_goto_dropdown[] = { STR_ORDER_GO_TO_NEAREST_DEPOT, STR_ORDER_CONDITIONAL, STR_ORDER_SHARE, - INVALID_STRING_ID }; static const StringID _order_goto_dropdown_aircraft[] = { @@ -150,7 +146,6 @@ static const StringID _order_goto_dropdown_aircraft[] = { STR_ORDER_GO_TO_NEAREST_HANGAR, STR_ORDER_CONDITIONAL, STR_ORDER_SHARE, - INVALID_STRING_ID }; /** Variables for conditional orders; this defines the order of appearance in the dropdown box */ @@ -174,7 +169,6 @@ static const StringID _order_conditional_condition[] = { STR_ORDER_CONDITIONAL_COMPARATOR_MORE_EQUALS, STR_ORDER_CONDITIONAL_COMPARATOR_IS_TRUE, STR_ORDER_CONDITIONAL_COMPARATOR_IS_FALSE, - INVALID_STRING_ID, }; extern uint ConvertSpeedToDisplaySpeed(uint speed, VehicleType type); @@ -185,7 +179,6 @@ static const StringID _order_depot_action_dropdown[] = { STR_ORDER_DROP_SERVICE_DEPOT, STR_ORDER_DROP_HALT_DEPOT, STR_ORDER_DROP_UNBUNCH, - INVALID_STRING_ID }; static int DepotActionStringIndex(const Order *order) @@ -204,7 +197,6 @@ static int DepotActionStringIndex(const Order *order) static const StringID _order_refit_action_dropdown[] = { STR_ORDER_DROP_REFIT_AUTO, STR_ORDER_DROP_REFIT_AUTO_ANY, - INVALID_STRING_ID }; /** diff --git a/src/station_gui.cpp b/src/station_gui.cpp index d538fa33a2..c5de52e2e9 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -251,7 +251,6 @@ protected: STR_SORT_BY_WAITING_AVAILABLE, STR_SORT_BY_RATING_MAX, STR_SORT_BY_RATING_MIN, - INVALID_STRING_ID }; static const std::initializer_list sorter_funcs; @@ -1291,7 +1290,6 @@ struct StationViewWindow : public Window { STR_STATION_VIEW_WAITING_AMOUNT, STR_STATION_VIEW_PLANNED_STATION, STR_STATION_VIEW_PLANNED_AMOUNT, - INVALID_STRING_ID }; /** Names of the grouping options in the dropdown. */ static inline const StringID group_names[] = { @@ -1301,7 +1299,6 @@ struct StationViewWindow : public Window { STR_STATION_VIEW_GROUP_V_D_S, STR_STATION_VIEW_GROUP_D_S_V, STR_STATION_VIEW_GROUP_D_V_S, - INVALID_STRING_ID }; /** diff --git a/src/town_gui.cpp b/src/town_gui.cpp index e030111cdb..a4d9f40761 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -724,7 +724,6 @@ private: STR_SORT_BY_NAME, STR_SORT_BY_POPULATION, STR_SORT_BY_RATING, - INVALID_STRING_ID }; static const std::initializer_list sorter_funcs; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 2b7e9c00ff..e4bcdb93fd 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -108,7 +108,6 @@ const std::initializer_list BaseVehicleListWindow::vehicle_group STR_SORT_BY_LENGTH, STR_SORT_BY_LIFE_TIME, STR_SORT_BY_TIMETABLE_DELAY, - INVALID_STRING_ID }; const std::initializer_list BaseVehicleListWindow::vehicle_group_none_sorter_names_wallclock = { @@ -125,7 +124,6 @@ const std::initializer_list BaseVehicleListWindow::vehicle_group STR_SORT_BY_LENGTH, STR_SORT_BY_LIFE_TIME, STR_SORT_BY_TIMETABLE_DELAY, - INVALID_STRING_ID }; const std::initializer_list BaseVehicleListWindow::vehicle_group_shared_orders_sorter_funcs = { @@ -142,7 +140,6 @@ const std::initializer_list BaseVehicleListWindow::vehicle_group STR_SORT_BY_TOTAL_PROFIT_LAST_YEAR, STR_SORT_BY_AVERAGE_PROFIT_THIS_YEAR, STR_SORT_BY_AVERAGE_PROFIT_LAST_YEAR, - INVALID_STRING_ID }; const std::initializer_list BaseVehicleListWindow::vehicle_group_shared_orders_sorter_names_wallclock = { @@ -151,13 +148,11 @@ const std::initializer_list BaseVehicleListWindow::vehicle_group STR_SORT_BY_TOTAL_PROFIT_LAST_PERIOD, STR_SORT_BY_AVERAGE_PROFIT_THIS_PERIOD, STR_SORT_BY_AVERAGE_PROFIT_LAST_PERIOD, - INVALID_STRING_ID }; const std::initializer_list BaseVehicleListWindow::vehicle_group_by_names = { STR_GROUP_BY_NONE, STR_GROUP_BY_SHARED_ORDERS, - INVALID_STRING_ID }; const StringID BaseVehicleListWindow::vehicle_depot_name[] = { @@ -2362,14 +2357,12 @@ static StringID _service_interval_dropdown_calendar[] = { STR_VEHICLE_DETAILS_DEFAULT, STR_VEHICLE_DETAILS_DAYS, STR_VEHICLE_DETAILS_PERCENT, - INVALID_STRING_ID, }; static StringID _service_interval_dropdown_wallclock[] = { STR_VEHICLE_DETAILS_DEFAULT, STR_VEHICLE_DETAILS_MINUTES, STR_VEHICLE_DETAILS_PERCENT, - INVALID_STRING_ID, }; /** Class for managing the vehicle details window. */ From 87dbd4a8336c883c7cb41d213dd98cfc2b9ba919 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 28 Apr 2024 17:53:11 +0200 Subject: [PATCH 05/30] Codechange: use ranged for loop to determine widest title --- src/league_gui.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/league_gui.cpp b/src/league_gui.cpp index 062b195212..8b52359c92 100644 --- a/src/league_gui.cpp +++ b/src/league_gui.cpp @@ -141,11 +141,11 @@ public: this->ordinal_width += WidgetDimensions::scaled.hsep_wide; // Keep some extra spacing uint widest_width = 0; - uint widest_title = 0; - for (uint i = 0; i < lengthof(_performance_titles); i++) { - uint width = GetStringBoundingBox(_performance_titles[i]).width; + StringID widest_title = STR_NULL; + for (auto title : _performance_titles) { + uint width = GetStringBoundingBox(title).width; if (width > widest_width) { - widest_title = i; + widest_title = title; widest_width = width; } } @@ -156,7 +156,7 @@ public: for (const Company *c : Company::Iterate()) { SetDParam(0, c->index); SetDParam(1, c->index); - SetDParam(2, _performance_titles[widest_title]); + SetDParam(2, widest_title); widest_width = std::max(widest_width, GetStringBoundingBox(STR_COMPANY_LEAGUE_COMPANY_NAME).width); } From 24b6ec80a9be1aedc34413ae272fe206cd2fecb8 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 28 Apr 2024 18:05:07 +0200 Subject: [PATCH 06/30] Codechange: use ranged for loop and vector to determine the disaster to deploy --- src/disaster_vehicle.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/disaster_vehicle.cpp b/src/disaster_vehicle.cpp index eea873ffca..69ce0319e4 100644 --- a/src/disaster_vehicle.cpp +++ b/src/disaster_vehicle.cpp @@ -925,16 +925,17 @@ static const Disaster _disasters[] = { static void DoDisaster() { - uint8_t buf[lengthof(_disasters)]; + std::vector available_disasters; - uint8_t j = 0; - for (size_t i = 0; i != lengthof(_disasters); i++) { - if (TimerGameCalendar::year >= _disasters[i].min_year && TimerGameCalendar::year < _disasters[i].max_year) buf[j++] = (uint8_t)i; + for (auto &disaster : _disasters) { + if (TimerGameCalendar::year >= disaster.min_year && TimerGameCalendar::year < disaster.max_year) { + available_disasters.push_back(disaster.init_proc); + } } - if (j == 0) return; + if (available_disasters.empty()) return; - _disasters[buf[RandomRange(j)]].init_proc(); + available_disasters[RandomRange(static_cast(available_disasters.size()))](); } From 98d37338dfbf0fdc64eaa0e9e1ae8c74977c9ef6 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 28 Apr 2024 18:30:02 +0200 Subject: [PATCH 07/30] Codechange: use ranged for loop instead of one with lengthof --- src/object_gui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 4fec20d2f6..daab1f04de 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -257,9 +257,9 @@ public: } /* Determine the pixel heights. */ - for (size_t i = 0; i < lengthof(height); i++) { - height[i] *= ScaleGUITrad(TILE_HEIGHT); - height[i] += ScaleGUITrad(TILE_PIXELS) + 2 * this->object_margin; + for (auto &h : height) { + h *= ScaleGUITrad(TILE_HEIGHT); + h += ScaleGUITrad(TILE_PIXELS) + 2 * this->object_margin; } /* Now determine the size of the minimum widgets. When there are two columns, then From fd4cf699e5eef8e7912c0d0eac1602e8a53ecd69 Mon Sep 17 00:00:00 2001 From: rubidium42 Date: Sun, 28 Apr 2024 19:42:58 +0200 Subject: [PATCH 08/30] Codefix 37a03b5: the return value of maxdim should always be assigned (#12590) --- src/autoreplace_gui.cpp | 2 +- src/core/geometry_func.hpp | 2 +- src/genworld_gui.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index f6d819d612..e1f4cf174e 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -368,7 +368,7 @@ public: case WID_RV_START_REPLACE: { Dimension d = GetStringBoundingBox(STR_REPLACE_VEHICLES_START); - maxdim(d, GetStringListBoundingBox(_start_replace_dropdown)); + d = maxdim(d, GetStringListBoundingBox(_start_replace_dropdown)); d.width += padding.width; d.height += padding.height; size = maxdim(size, d); diff --git a/src/core/geometry_func.hpp b/src/core/geometry_func.hpp index 175a8a2ba7..58ebd316ab 100644 --- a/src/core/geometry_func.hpp +++ b/src/core/geometry_func.hpp @@ -12,7 +12,7 @@ #include "geometry_type.hpp" -Dimension maxdim(const Dimension &d1, const Dimension &d2); +[[nodiscard]] Dimension maxdim(const Dimension &d1, const Dimension &d2); /** * Check if a rectangle is empty. diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index cd203da979..827223e932 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -660,7 +660,7 @@ struct GenerateLandscapeWindow : public Window { default: return; } - maxdim(d, GetStringListBoundingBox(strs)); + d = maxdim(d, GetStringListBoundingBox(strs)); d.width += padding.width; d.height += padding.height; size = maxdim(size, d); From b852a3f408e9750716b816970a39fe01774f23ff Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 29 Apr 2024 04:40:19 +0000 Subject: [PATCH 09/30] Update: Translations from eints english (us): 3 changes by 2TallTyler korean: 3 changes by telk5093 hungarian: 2 changes by meskobalazs --- src/lang/english_US.txt | 3 +++ src/lang/hungarian.txt | 2 ++ src/lang/korean.txt | 3 +++ 3 files changed, 8 insertions(+) diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 42f5441f94..25082260d7 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -1833,6 +1833,9 @@ STR_CONFIG_SETTING_SERVINT_AIRCRAFT_HELPTEXT :Set the default STR_CONFIG_SETTING_SERVINT_SHIPS :Default maintenance interval for ships: {STRING} STR_CONFIG_SETTING_SERVINT_SHIPS_HELPTEXT :Set the default maintenance interval for new ships, if no explicit maintenance interval is set for the vehicle ###length 3 +STR_CONFIG_SETTING_SERVINT_VALUE_DAYS :{COMMA}{NBSP}Day{P 0 "" s} +STR_CONFIG_SETTING_SERVINT_VALUE_MINUTES :{COMMA}{NBSP}Minute{P 0 "" s} +STR_CONFIG_SETTING_SERVINT_VALUE_PERCENTAGE :{COMMA}{NBSP}% ###setting-zero-is-special STR_CONFIG_SETTING_SERVINT_DISABLED :Disabled diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index ace6c8aa60..f7e80766b8 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -5343,6 +5343,8 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Még nin STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Indíts új játékot {DATE_SHORT} után, vagy használj olyan NewGRF-et, ami tartalmaz megfelelően korai járműveket! STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL :{WHITE}Nincs városban építhető út-típus +STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Saját NewGRF konfiguráció módosítása +STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET :{WHITE}Még nem érhető el városban építhető úttípus # Specific vehicle errors STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Nem haladhatja meg a vonat a megállj jelzést... diff --git a/src/lang/korean.txt b/src/lang/korean.txt index d9119e5bed..acbcc3b9b6 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -1834,6 +1834,9 @@ STR_CONFIG_SETTING_SERVINT_AIRCRAFT_HELPTEXT :항공기에 STR_CONFIG_SETTING_SERVINT_SHIPS :선박에 대한 기본 점검 기준: {STRING} STR_CONFIG_SETTING_SERVINT_SHIPS_HELPTEXT :선박에 따로 점검 기간이 설정되어있지 않은 경우에 사용할 기본 점검 기간을 설정합니다. ###length 3 +STR_CONFIG_SETTING_SERVINT_VALUE_DAYS :{COMMA}일 +STR_CONFIG_SETTING_SERVINT_VALUE_MINUTES :{COMMA}분 +STR_CONFIG_SETTING_SERVINT_VALUE_PERCENTAGE :{COMMA}% ###setting-zero-is-special STR_CONFIG_SETTING_SERVINT_DISABLED :사용 안 함 From cc6e4768a9fc8179ccce0bf3cad655a15300199c Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 29 Apr 2024 17:05:35 +0100 Subject: [PATCH 10/30] Fix: Out-of-order window set up due to deferred window resize. (#12592) Deferred window resize was being applied to the initial window resize event, resulting in some window state (e.g. scroll bar capacity) not being initialised when expected. --- src/window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.cpp b/src/window.cpp index 1df0ccf199..142ba017e8 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1444,7 +1444,7 @@ void Window::FindWindowPlacementAndResize(int def_width, int def_height) if (this->resize.step_width > 1) enlarge_x -= enlarge_x % (int)this->resize.step_width; if (this->resize.step_height > 1) enlarge_y -= enlarge_y % (int)this->resize.step_height; - ResizeWindow(this, enlarge_x, enlarge_y); + ResizeWindow(this, enlarge_x, enlarge_y, true, false); /* ResizeWindow() calls this->OnResize(). */ } else { /* Always call OnResize; that way the scrollbars and matrices get initialized. */ From 4df44fea38c956959fdedd3759e484897180eff6 Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 30 Apr 2024 04:40:35 +0000 Subject: [PATCH 11/30] Update: Translations from eints swedish: 3 changes by joeax910 galician: 63 changes by pvillaverde --- src/lang/galician.txt | 107 +++++++++++++++++++++++++----------------- src/lang/swedish.txt | 3 ++ 2 files changed, 66 insertions(+), 44 deletions(-) diff --git a/src/lang/galician.txt b/src/lang/galician.txt index dd2cf47193..03d312d83f 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -1055,9 +1055,9 @@ STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Escalar STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Marca esta caixa para escalar os biseles segundo o tamaño da interface STR_GAME_OPTIONS_GUI_FONT_SPRITE :{BLACK}Usar a fonte tradicional dos sprites -STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Marca esta opción se prefires usar a fonte tradicional de tamaño fixo dos sprites. +STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Marca esta opción se prefires usar a fonte tradicional de tamaño fixo dos sprites STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Suavizar fontes -STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Marca esta opción para suavizar as fontes redimensionables. +STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Marca esta opción para suavizar as fontes redimensionables STR_GAME_OPTIONS_GUI_SCALE_1X :1x STR_GAME_OPTIONS_GUI_SCALE_2X :2x @@ -1276,7 +1276,7 @@ STR_CONFIG_SETTING_INFINITE_MONEY :Cartos infinito STR_CONFIG_SETTING_INFINITE_MONEY_HELPTEXT :Permite o gasto ilimitado e desactiva a bancarrota das compañías STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN :Crédito máximo inicial: {STRING} -STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN_HELPTEXT :Cantidade máxima de cartos que unha compañía pode pedir (sen ter en conta a inflación). Se se configura "Sen prestamo", non haberá cartos dispoñibles a non ser que os proporcione un script de xogo ou a configuración de "cartos infinitos". +STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN_HELPTEXT :Cantidade máxima de cartos que unha compañía pode pedir (sen ter en conta a inflación). Se se configura "Sen prestamo", non haberá cartos dispoñibles a non ser que os proporcione un script de xogo ou a configuración de "cartos infinitos" STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN_VALUE :{CURRENCY_LONG} ###setting-zero-is-special STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN_DISABLED :Sen empréstitos. @@ -1360,7 +1360,7 @@ STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS :Inclinación da STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT :Inclinación dun cadro en pendente para un vehículo de carretera. Valores máis elevados dificultan ascender unha colina STR_CONFIG_SETTING_FORBID_90_DEG :Prohibir xiros de 90° a trens: {STRING} -STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Os xiros de 90 graos ocorren cando unha vía horizontal vai seguida directamente dun tramo vertical no cadro adxancete, facendo que o tren vire 90 graos cando pasa o límite do cadro en vez dos 45 graos habituais noutras combinacións de vías. +STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Os xiros de 90 graos ocorren cando unha vía horizontal vai seguida directamente dun tramo vertical no cadro adxancete, facendo que o tren vire 90 graos cando pasa o límite do cadro en vez dos 45 graos habituais noutras combinacións de vías STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :Permitir a unión de estacións non adxacentes {STRING} STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Permite engadir partes a unha estación sen que estén en contacto directo coas partes existente facendo Ctrl+Clic ao colocar as partes novas @@ -1472,7 +1472,7 @@ STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Cor inicial da STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Escolle a cor inicial da túa compañía STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_SECONDARY :Cor secundaria inicial da compañía: {STRING} -STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_SECONDARY_HELPTEXT :Escoller a cor secundaria de inicio da compañía, se utilizas un NewGRF que o permita. +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_SECONDARY_HELPTEXT :Escoller a cor secundaria de inicio da compañía, se utilizas un NewGRF que o permita STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Os aeroportos nunca caducan: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Activar esta opción fai que cada tipo de aeroporto siga estando dispoñíbel para sempre dende a súa aparición @@ -1496,22 +1496,22 @@ STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES :Os vehículos n STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES_HELPTEXT :Cando se activa, tódolos modelos de vehículos seguen a estar dispoñíbeis para sempre dende a súa aparición STR_CONFIG_SETTING_TIMEKEEPING_UNITS :Cronometraxe: {STRING} -STR_CONFIG_SETTING_TIMEKEEPING_UNITS_HELPTEXT :Selecciona as unidades de cronometraxe do xogo. Isto non se pode mudar despois.{}{}A experiencia clásica de OpenTTD é basada en calendario, cun ano que consite de 12 meses e cada mes ten 28-31 días.{}{}No tempo baseado no reloxo, a producción de mercadorías e as finanzas baseanse en minutos, sendo o que dura aproximadamente un mes de 30 días no modo de Calendario. Estes agrúpanse en períodos de 12 minutos, equivalente o ano no modo de Calendario.{}{}En ambos modos hai sempre un calendario clásico, que se utiliza para a data de introdución de vehículos, casas e outras infraestruturas. +STR_CONFIG_SETTING_TIMEKEEPING_UNITS_HELPTEXT :Selecciona as unidades de cronometraxe do xogo. Isto non se pode mudar despois.{}{}A experiencia clásica de OpenTTD é basada en calendario, cun ano que consite de 12 meses e cada mes ten 28-31 días.{}{}No tempo baseado no reloxo, a producción de mercadorías e as finanzas baseanse en minutos, sendo o que dura aproximadamente un mes de 30 días no modo de Calendario. Estes agrúpanse en períodos de 12 minutos, equivalente o ano no modo de Calendario.{}{}En ambos modos hai sempre un calendario clásico, que se utiliza para a data de introdución de vehículos, casas e outras infraestruturas ###length 2 STR_CONFIG_SETTING_TIMEKEEPING_UNITS_CALENDAR :Calendario STR_CONFIG_SETTING_TIMEKEEPING_UNITS_WALLCLOCK :Reloxo STR_CONFIG_SETTING_MINUTES_PER_YEAR :Minutos por ano: {STRING} -STR_CONFIG_SETTING_MINUTES_PER_YEAR_HELPTEXT :Selecciona o número de minutos dun ano do calendario. Por defecto son 12 minutos. Fíxao en 0 para para conxelar o calendario. Este axuste non afecta a simulación da economía do xogo, e só está dispoñible cando se usa o modo reloxo de cronometraxe. +STR_CONFIG_SETTING_MINUTES_PER_YEAR_HELPTEXT :Selecciona o número de minutos dun ano do calendario. Por defecto son 12 minutos. Fíxao en 0 para para conxelar o calendario. Este axuste non afecta a simulación da economía do xogo, e só está dispoñible cando se usa o modo reloxo de cronometraxe STR_CONFIG_SETTING_MINUTES_PER_YEAR_VALUE :{NUM} ###setting-zero-is-special STR_CONFIG_SETTING_MINUTES_PER_YEAR_FROZEN :0 (calendario conxelado) STR_CONFIG_SETTING_TOWN_CARGO_SCALE :Escala da produción de mercadorías das vilas: {STRING} -STR_CONFIG_SETTING_TOWN_CARGO_SCALE_HELPTEXT :Escala a produción de mercadorías das vilas nesta porcentaxe. +STR_CONFIG_SETTING_TOWN_CARGO_SCALE_HELPTEXT :Escala a produción de mercadorías das vilas nesta porcentaxe STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE :Escala da produción industrial de mercadorías: {STRING} -STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_HELPTEXT :Escala a produción de mercadorías das industrias nesta porcentaxe. +STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_HELPTEXT :Escala a produción de mercadorías das industrias nesta porcentaxe STR_CONFIG_SETTING_CARGO_SCALE_VALUE :{NUM}% STR_CONFIG_SETTING_AUTORENEW_VEHICLE :Autorenova-los vehículos cando vaian vellos: {STRING} @@ -1542,8 +1542,8 @@ STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS :Grosor das liñ STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Ancho de liña nos gráficos. Unha liña fina lese con máis precisión, unha liña grosa é máis doada de ver e as cores son máis fáciles de distinguir STR_CONFIG_SETTING_SHOW_NEWGRF_NAME :Amosar o nome do NewGRF na fiestra de comprar vehículos: {STRING} -STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Engade unha liña a fiestra de compra de vehículos, amosando de que NewGRF ven o vehículo. -STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS :Amosa as cargas que os vehículos poden levar nas fiestras de listas {STRING} +STR_CONFIG_SETTING_SHOW_NEWGRF_NAME_HELPTEXT :Engade unha liña a fiestra de compra de vehículos, amosando de que NewGRF ven o vehículo +STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS :Amosa as cargas que os vehículos poden levar nas fiestras de listas: {STRING} STR_CONFIG_SETTING_SHOW_CARGO_IN_LISTS_HELPTEXT :Cando se activa, a carga transportable polo vehículo aparece enriba súa na lista de vehículos STR_CONFIG_SETTING_LANDSCAPE :Paisaxe: {STRING} @@ -1562,13 +1562,13 @@ STR_CONFIG_SETTING_INDUSTRY_DENSITY :Densidade indus STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :Establece cantas industrias deben xerarse e que nivel se debe manter durante o xogo STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Distancia máxima das refinarías ao borde do mundo: {STRING} -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Limita a qué distancia dos bordes do mundo as refinerías e pozos petrolíferos poden construirse. En mapas con illas asegura que estean situadas preto da costa. En mapas maiores de 256 unidades, o valor escálase acorde ao tamaño do mapa. +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Limita a qué distancia dos bordes do mundo as refinerías e pozos petrolíferos poden construirse. En mapas con illas asegura que estean situadas preto da costa. En mapas maiores de 256 unidades, o valor escálase acorde ao tamaño do mapa STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Cota de neve: {STRING} STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Escolle a que altitude comeza a nevar en paisaxes subárticas. A neve afecta tamén á xeración industrial e aos requirimentos de crecemento dos pobos. Só se pode modificar no Editor de Escenarios ou se non calcúlase a través da "cobertura de neve". STR_CONFIG_SETTING_SNOW_COVERAGE :Cobertura de neve: {STRING} -STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT :Escolle a cantidade aproximada de neve nas paisaxes subárticas. A neve afecta tamén á xeración industrial e aos requirimentos de crecemento dos pobos. Só se usa durante a xeración do mapa. O terreo costeiro e o nivel do mar nunca ten neve. +STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT :Escolle a cantidade aproximada de neve nas paisaxes subárticas. A neve afecta tamén á xeración industrial e aos requirimentos de crecemento dos pobos. Só se usa durante a xeración do mapa. O terreo costeiro e o nivel do mar nunca ten neve STR_CONFIG_SETTING_SNOW_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_DESERT_COVERAGE :Cobertura do deserto: {STRING} @@ -1576,7 +1576,7 @@ STR_CONFIG_SETTING_DESERT_COVERAGE_HELPTEXT :Controla a cant STR_CONFIG_SETTING_DESERT_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Desigualdade do terreo (só TerraGenesis) : {STRING} -STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :Escolle a forma e frequencia de montes: As paixases suaves teñen menos montes e máis españñados, mentres que as escarpadas teñen máis e pequenos outeiros. +STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :Escolle a forma e frequencia de montes: As paixases suaves teñen menos montes e máis españñados, mentres que as escarpadas teñen máis e pequenos outeiros ###length 4 STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :Moi suave STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH :Suave @@ -1584,7 +1584,7 @@ STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH :Escabroso STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH :Moi escabroso STR_CONFIG_SETTING_VARIETY :Distribución da variedade: {STRING} -STR_CONFIG_SETTING_VARIETY_HELPTEXT :Escolle se o mapa contén áreas montañosas ou chás. Canta máis variedade, maiores diferencias en elevación entre as zonas montañosas e chás. +STR_CONFIG_SETTING_VARIETY_HELPTEXT :Escolle se o mapa contén áreas montañosas ou chás. Canta máis variedade, maiores diferencias en elevación entre as zonas montañosas e chás STR_CONFIG_SETTING_RIVER_AMOUNT :Cantidade de ríos: {STRING} STR_CONFIG_SETTING_RIVER_AMOUNT_HELPTEXT :Escolle cantos ríos xerar @@ -1631,7 +1631,7 @@ STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :Verde escuro STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :Violeta STR_CONFIG_SETTING_LINKGRAPH_COLOURS :Cores superpostas do fluxo de carga: {STRING} -STR_CONFIG_SETTING_LINKGRAPH_COLOURS_HELPTEXT :Fixa o esquema de cor utilizado para a superposición do fluxo de carga. +STR_CONFIG_SETTING_LINKGRAPH_COLOURS_HELPTEXT :Fixa o esquema de cor utilizado para a superposición do fluxo de carga ###length 4 STR_CONFIG_SETTING_LINKGRAPH_COLOURS_GREEN_TO_RED :Verde a vermello(orixinal) STR_CONFIG_SETTING_LINKGRAPH_COLOURS_GREEN_TO_BLUE :Verde a azul @@ -1752,10 +1752,10 @@ STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS :Mante-las ferra STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT :Mante-las ferramentas de construción abertas para pontes, túneis, etc. tralo uso STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS :orrar automáticamente as sinais durante a construción de ferrocarrís: {STRING} -STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS_HELPTEXT :Borrar automáticamente as sinais durante a construción de ferrocarrís se as sinais están no medio. Teña en conta que isto pode levar a accidentes de tren. +STR_CONFIG_SETTING_AUTO_REMOVE_SIGNALS_HELPTEXT :Borrar automáticamente as sinais durante a construción de ferrocarrís se as sinais están no medio. Teña en conta que isto pode levar a accidentes de tren STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT :Límite de velocidade do avance rápido: {STRING} -STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_HELPTEXT :Limite o rápido que vai o xogo cando se activa o avance rápido. 0 = sen límite (tanto como permita o teu equipo). Os valores por debaixo do 100% ralentizan o xogo. O límite superior depende das especificacións do teu ordenador e pode variar dependendo do xogo. +STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_HELPTEXT :Limite o rápido que vai o xogo cando se activa o avance rápido. 0 = sen límite (tanto como permita o teu equipo). Os valores por debaixo do 100% ralentizan o xogo. O límite superior depende das especificacións do teu ordenador e pode variar dependendo do xogo STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL :{NUM}% velocidade normal de xogo ###setting-zero-is-special STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_ZERO :Sen límite (tan rápido como permita o teu equipo) @@ -1834,6 +1834,9 @@ STR_CONFIG_SETTING_SERVINT_AIRCRAFT_HELPTEXT :Fixa o interval STR_CONFIG_SETTING_SERVINT_SHIPS :Intervalo de mantemento por defecto para navíos: {STRING} STR_CONFIG_SETTING_SERVINT_SHIPS_HELPTEXT :Fixa o intervalo de mantemento por defecto para navíos novos, o cal se empregará no caso de que non se defina explicitamente un novo intervalo de mantemento para o vehículo ###length 3 +STR_CONFIG_SETTING_SERVINT_VALUE_DAYS :{COMMA}{NBSP}Día{P 0 "" s} +STR_CONFIG_SETTING_SERVINT_VALUE_MINUTES :{COMMA}{NBSP}Minuto{P 0 "" s} +STR_CONFIG_SETTING_SERVINT_VALUE_PERCENTAGE :{COMMA}{NBSP}% ###setting-zero-is-special STR_CONFIG_SETTING_SERVINT_DISABLED :Desactivado @@ -1842,7 +1845,7 @@ STR_CONFIG_SETTING_NOSERVICE :Deshabilita-lo STR_CONFIG_SETTING_NOSERVICE_HELPTEXT :Cando estea activado, os vehículos non teñen mantemento no caso de que non poidan ter avarías STR_CONFIG_SETTING_STATION_LENGTH_LOADING_PENALTY :Penalización na velocidade de carga dos trens máis longos que a estación: {STRING} -STR_CONFIG_SETTING_STATION_LENGTH_LOADING_PENALTY_HELPTEXT :Cando se habilita, os trens que son demasiados longos para a estación cargaranse máis lentamente que un tren que entra na estación. Este axuste non afecta a búsqueda de rutas. +STR_CONFIG_SETTING_STATION_LENGTH_LOADING_PENALTY_HELPTEXT :Cando se habilita, os trens que son demasiados longos para a estación cargaranse máis lentamente que un tren que entra na estación. Este axuste non afecta a búsqueda de rutas STR_CONFIG_SETTING_WAGONSPEEDLIMITS :Activa-los límites de velocidade dos vagóns: {STRING} STR_CONFIG_SETTING_WAGONSPEEDLIMITS_HELPTEXT :Cando estea activado, usar tamén os límites de velocidade dos vagóns para decidir a máxima velocidade do tren @@ -1907,13 +1910,13 @@ STR_CONFIG_SETTING_COLOURED_NEWS_YEAR_HELPTEXT :Ano no que os a STR_CONFIG_SETTING_STARTING_YEAR :Data de comezo: {STRING} STR_CONFIG_SETTING_ENDING_YEAR :Ano da puntuación final: {STRING} -STR_CONFIG_SETTING_ENDING_YEAR_HELPTEXT :O ano no que remate o xogo a efectos de puntiacións. Ao final deste ano, gárdase cal é a compañía con máis puntuación e amosase a pantalla de puntuacións, pero os xogadores poden seguir xogando despois disto.{}Se é anterior a data de inicio, a pantalla de puntuacións nunca se amosa. +STR_CONFIG_SETTING_ENDING_YEAR_HELPTEXT :O ano no que remate o xogo a efectos de puntiacións. Ao final deste ano, gárdase cal é a compañía con máis puntuación e amosase a pantalla de puntuacións, pero os xogadores poden seguir xogando despois disto.{}Se é anterior a data de inicio, a pantalla de puntuacións nunca se amosa STR_CONFIG_SETTING_ENDING_YEAR_VALUE :{NUM} ###setting-zero-is-special STR_CONFIG_SETTING_ENDING_YEAR_ZERO :Nunca STR_CONFIG_SETTING_ECONOMY_TYPE :Tipo de economía: {STRING} -STR_CONFIG_SETTING_ECONOMY_TYPE_HELPTEXT :A economía suave fai cambios de produción máis a miúdo, e en pequenos pasos. As economías conxeladas paran os cambios de produción e as industrias pechan. Esta configuración non ten efecto se non se provén industrias por un NewGRF. +STR_CONFIG_SETTING_ECONOMY_TYPE_HELPTEXT :A economía suave fai cambios de produción máis a miúdo, e en pequenos pasos. As economías conxeladas paran os cambios de produción e as industrias pechan. Esta configuración non ten efecto se non se provén industrias por un NewGRF ###length 3 STR_CONFIG_SETTING_ECONOMY_TYPE_ORIGINAL :Orixinal STR_CONFIG_SETTING_ECONOMY_TYPE_SMOOTH :Suave @@ -1968,7 +1971,7 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :Permitido STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :Permitido, patrón de estradas personalizado STR_CONFIG_SETTING_TOWN_CARGOGENMODE :Xeración de mercadorías da vila: {STRING} -STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT :Cantidade de mercadorías producidas nas casas da vila, segundo a poboación total da mesma.{}Crecemento cadrático: Unha vila o dobre de grande produce catro veces máis pasaxeiros.{}Linear growth: Unha vila o dobre de grande produce dúas veces máis pasaxeiros. +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT :Cantidade de mercadorías producidas nas casas da vila, segundo a poboación total da mesma.{}Crecemento cadrático: Unha vila o dobre de grande produce catro veces máis pasaxeiros.{}Linear growth: Unha vila o dobre de grande produce dúas veces máis pasaxeiros ###length 2 STR_CONFIG_SETTING_TOWN_CARGOGENMODE_ORIGINAL :Cadrático (orixinal) STR_CONFIG_SETTING_TOWN_CARGOGENMODE_BITCOUNT :Lineal @@ -2009,7 +2012,7 @@ STR_CONFIG_SETTING_ZOOM_LVL_OUT_4X :4x STR_CONFIG_SETTING_ZOOM_LVL_OUT_8X :8x STR_CONFIG_SETTING_SPRITE_ZOOM_MIN :Resolución máis alta a usar nos sprites: {STRING} -STR_CONFIG_SETTING_SPRITE_ZOOM_MIN_HELPTEXT :Limite a resolución máxima a usar nos sprites. Limitar a resolución dos sprites impide que se usen os gráficos de alta resolución incluso cando están dispoñibles. Isto axuda o xogo a manter unha apariencia unificada cando se usan distintos arquivos GRF con e sen gráficos de alta resolución. +STR_CONFIG_SETTING_SPRITE_ZOOM_MIN_HELPTEXT :Limite a resolución máxima a usar nos sprites. Limitar a resolución dos sprites impide que se usen os gráficos de alta resolución incluso cando están dispoñibles. Isto axuda o xogo a manter unha apariencia unificada cando se usan distintos arquivos GRF con e sen gráficos de alta resolución ###length 3 STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_MIN :4x STR_CONFIG_SETTING_SPRITE_ZOOM_LVL_IN_2X :2x @@ -2033,33 +2036,33 @@ STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :Multiplicador i STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :Relación entre o tamaño medio das cidades e o dos pobos ao inicio da partida STR_CONFIG_SETTING_LINKGRAPH_RECALC_INTERVAL :Actualizar o grafo de distribución cada {STRING} -STR_CONFIG_SETTING_LINKGRAPH_RECALC_INTERVAL_HELPTEXT :Tempo entre recálculos sucesivos do grafo de ligazóns. Cada recálculo calcula os plans para un compoñente do grafo. Iso significa que un valor X para esta configuración non significa que o grafo completo sexa actualizado cada X segundos. Só algúns compoñentes o serán. Canto máis curto sexa o tempo establecido, máis tempo de CPU será necesario para calculalo. Canto máis longo sexa o tempo establecido, máis tempo levará ata que a distribución de carga comece a percorrer novas rutas. +STR_CONFIG_SETTING_LINKGRAPH_RECALC_INTERVAL_HELPTEXT :Tempo entre recálculos sucesivos do grafo de ligazóns. Cada recálculo calcula os plans para un compoñente do grafo. Iso significa que un valor X para esta configuración non significa que o grafo completo sexa actualizado cada X segundos. Só algúns compoñentes o serán. Canto máis curto sexa o tempo establecido, máis tempo de CPU será necesario para calculalo. Canto máis longo sexa o tempo establecido, máis tempo levará ata que a distribución de carga comece a percorrer novas rutas STR_CONFIG_SETTING_LINKGRAPH_RECALC_TIME :Toma {STRING} para o recálculo do gráfico de distribución. -STR_CONFIG_SETTING_LINKGRAPH_RECALC_TIME_HELPTEXT :Tempo necesario para cada recalculación dun compoñente do grafo de ligazóns. Cando se inicia unha recalculación, abrese un fío que se pode executar durante este número de segundos. Canto máis curto o establezas, máis probable é que o fío non remate cando se supón que debe facelo. Entón, o xogo detense ata que o fío remata («lag»). Canto máis longo o estabelezas, máis tempo levará actualizar a distribución cando cambien as rutas. +STR_CONFIG_SETTING_LINKGRAPH_RECALC_TIME_HELPTEXT :Tempo necesario para cada recalculación dun compoñente do grafo de ligazóns. Cando se inicia unha recalculación, abrese un fío que se pode executar durante este número de segundos. Canto máis curto o establezas, máis probable é que o fío non remate cando se supón que debe facelo. Entón, o xogo detense ata que o fío remata («lag»). Canto máis longo o estabelezas, máis tempo levará actualizar a distribución cando cambien as rutas STR_CONFIG_SETTING_DISTRIBUTION_PAX :Modo de distribución para pasaxeiros: {STRING} -STR_CONFIG_SETTING_DISTRIBUTION_PAX_HELPTEXT :"Simétrico" significa que máis ou menos o mesmo número de pasaxeiros irán dende a estación A cada a estación B e tamén da B cara a A. "Asimétrico" significa que calquera número de pasaxeiros pode ir en calquera dirección. "manual" significa que non haberá distribución automática para os pasaxeiros. +STR_CONFIG_SETTING_DISTRIBUTION_PAX_HELPTEXT :"Simétrico" significa que máis ou menos o mesmo número de pasaxeiros irán dende a estación A cada a estación B e tamén da B cara a A. "Asimétrico" significa que calquera número de pasaxeiros pode ir en calquera dirección. "manual" significa que non haberá distribución automática para os pasaxeiros STR_CONFIG_SETTING_DISTRIBUTION_MAIL :Modo de distribución para correo: {STRING} -STR_CONFIG_SETTING_DISTRIBUTION_MAIL_HELPTEXT :"Simétrico" significa que máis ou menos a mesma cantidade de correo vai ser enviada da estación A cara a estación B como da estación B cara a A. "Asimétrico" signigica que calquera cantidade de correo pode ser enviado en calquera dirección. "Manual" significa que non hai distribución automática para o correo. +STR_CONFIG_SETTING_DISTRIBUTION_MAIL_HELPTEXT :"Simétrico" significa que máis ou menos a mesma cantidade de correo vai ser enviada da estación A cara a estación B como da estación B cara a A. "Asimétrico" signigica que calquera cantidade de correo pode ser enviado en calquera dirección. "Manual" significa que non hai distribución automática para o correo STR_CONFIG_SETTING_DISTRIBUTION_ARMOURED :Modo de disitribución para o tipo de mercadoría BLINDADO: {STRING} -STR_CONFIG_SETTING_DISTRIBUTION_ARMOURED_HELPTEXT :A clase de mercadoría BLINDADA contén obxectos de valor nos clima morno, diamantes no subtropical ou ouro no clima subártico. Os NewGRFs poden cambiar isto. "Simétrico" significa que máis ou menos a mesma cantidade de esta mercadoría será enviadas dende a estación A cara a estación B así como da estación B para a A. "Asimétrico" significa que calquera cantidade de esta mercadoría pode ser enviada en calquera dirección. "manual" significa que non haberá distribución automática para esta mercadoría. Recoméndase elixir asimétrico ou manual cando se xoguen mapas subárticos ou subtropicais, xa que os bancos só reciben carga nestos climas. Para os climas mornos podes escoller simétrico xa que os bancos enviarán carga de volta o banco orixinal. +STR_CONFIG_SETTING_DISTRIBUTION_ARMOURED_HELPTEXT :A clase de mercadoría BLINDADA contén obxectos de valor nos clima morno, diamantes no subtropical ou ouro no clima subártico. Os NewGRFs poden cambiar isto. "Simétrico" significa que máis ou menos a mesma cantidade de esta mercadoría será enviadas dende a estación A cara a estación B así como da estación B para a A. "Asimétrico" significa que calquera cantidade de esta mercadoría pode ser enviada en calquera dirección. "manual" significa que non haberá distribución automática para esta mercadoría. Recoméndase elixir asimétrico ou manual cando se xoguen mapas subárticos ou subtropicais, xa que os bancos só reciben carga nestos climas. Para os climas mornos podes escoller simétrico xa que os bancos enviarán carga de volta o banco orixinal STR_CONFIG_SETTING_DISTRIBUTION_DEFAULT :Xeito de distribución para outros tipos de mercadoría: {STRING} -STR_CONFIG_SETTING_DISTRIBUTION_DEFAULT_HELPTEXT :"Asimétrico" significa que calquera cantidade de mercadorías pode ser enviada en calquera dirección. "Manual" significa que non haberá distribución automática para estas mercadorías. +STR_CONFIG_SETTING_DISTRIBUTION_DEFAULT_HELPTEXT :"Asimétrico" significa que calquera cantidade de mercadorías pode ser enviada en calquera dirección. "Manual" significa que non haberá distribución automática para estas mercadorías ###length 3 STR_CONFIG_SETTING_DISTRIBUTION_MANUAL :manual STR_CONFIG_SETTING_DISTRIBUTION_ASYMMETRIC :asimétrica STR_CONFIG_SETTING_DISTRIBUTION_SYMMETRIC :simétrica STR_CONFIG_SETTING_LINKGRAPH_ACCURACY :Precisión da distribución: {STRING} -STR_CONFIG_SETTING_LINKGRAPH_ACCURACY_HELPTEXT :Canto máis alto sexa o valor, máis tempo de CPU levará o cálculo de distribución. Se leva demasiado tempo podes experimentar retraso. Se sen embargo o fixas nun valor baixo, a distribución será imprecisa, e pode que a carga non sexa enviada aos destinos que ti queres. +STR_CONFIG_SETTING_LINKGRAPH_ACCURACY_HELPTEXT :Canto máis alto sexa o valor, máis tempo de CPU levará o cálculo de distribución. Se leva demasiado tempo podes experimentar retraso. Se sen embargo o fixas nun valor baixo, a distribución será imprecisa, e pode que a carga non sexa enviada aos destinos que ti queres STR_CONFIG_SETTING_DEMAND_DISTANCE :Efecto da distancia na demanda: {STRING} -STR_CONFIG_SETTING_DEMAND_DISTANCE_HELPTEXT :Se o fixas nunha cantidade maior que 0, a distancia entre a estación de orixe A dalgunha carga e o posíbel destino B influirá na cantidade de carga enviada de A a B. Canto máis lonxe estea B de A, menos carga será enviada. Canto máis alto sexa o valor, menos carga será enviada a estacións lonxanas e máis a estacións cercanas. +STR_CONFIG_SETTING_DEMAND_DISTANCE_HELPTEXT :Se o fixas nunha cantidade maior que 0, a distancia entre a estación de orixe A dalgunha carga e o posíbel destino B influirá na cantidade de carga enviada de A a B. Canto máis lonxe estea B de A, menos carga será enviada. Canto máis alto sexa o valor, menos carga será enviada a estacións lonxanas e máis a estacións cercanas STR_CONFIG_SETTING_DEMAND_SIZE :Cantidade de carga a retornar en modo simétrico: {STRING} -STR_CONFIG_SETTING_DEMAND_SIZE_HELPTEXT :Fixar esta opción a menos do 100% fai que a distribución simétrica se comporte máis coma a asimétrica. Enviarase menos cantidade de carga de volta á forza se unha certa cantidade se envía a unha estación. Se o fixas no 0% a distribución simétrica compórtase coma a asimétrica. +STR_CONFIG_SETTING_DEMAND_SIZE_HELPTEXT :Fixar esta opción a menos do 100% fai que a distribución simétrica se comporte máis coma a asimétrica. Enviarase menos cantidade de carga de volta á forza se unha certa cantidade se envía a unha estación. Se o fixas no 0% a distribución simétrica compórtase coma a asimétrica STR_CONFIG_SETTING_SHORT_PATH_SATURATION :Saturación de rutas curtas antes de empregar rutas con capacidade: {STRING} -STR_CONFIG_SETTING_SHORT_PATH_SATURATION_HELPTEXT :Frecuentemente hai múltiples rutas posíbeis entre dúas estacións dadas. En primero lugar intentarase satura-la ruta máis curta, para posteriormente satura-la segunda máis curta e así sucesivamente. A saturación está determinada por unha estimación de capacidade e uso planificado. Unha vez saturadas tódalas rutas, se aínda queda demanda, sobrecargaranse as rutas comezando por aquelas de maior capacidade. A maior parte das veces, o algoritmo non estimará a capacidade con precisión. Esta opción permite especificar ata que porcentaxe de saturación pode ter unha ruta curta na primeira volta do algoritmo antes de escolle-la seguinte máis curta. Fíxao en menos do 100% para evitar estacións sobrecargadas no caso de que se sobreestime a capacidade. +STR_CONFIG_SETTING_SHORT_PATH_SATURATION_HELPTEXT :Frecuentemente hai múltiples rutas posíbeis entre dúas estacións dadas. En primero lugar intentarase satura-la ruta máis curta, para posteriormente satura-la segunda máis curta e así sucesivamente. A saturación está determinada por unha estimación de capacidade e uso planificado. Unha vez saturadas tódalas rutas, se aínda queda demanda, sobrecargaranse as rutas comezando por aquelas de maior capacidade. A maior parte das veces, o algoritmo non estimará a capacidade con precisión. Esta opción permite especificar ata que porcentaxe de saturación pode ter unha ruta curta na primeira volta do algoritmo antes de escolle-la seguinte máis curta. Fíxao en menos do 100% para evitar estacións sobrecargadas no caso de que se sobreestime a capacidade STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY :Unidades de velocidade (terra): {STRING} STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_NAUTICAL :Unidade de velocidade (náutica): {STRING} @@ -2576,6 +2579,7 @@ STR_NETWORK_ERROR_BAD_PLAYER_NAME :{WHITE}Non se e STR_NETWORK_ERROR_BAD_SERVER_NAME :{WHITE}Non se estableceu o nome do teu servidor. O nome pode establecerse na parte superior da fiestra de multixogador. STR_NETWORK_ERROR_WRONG_REVISION :{WHITE}A revisión deste cliente non é igual ca revisión do servidor STR_NETWORK_ERROR_WRONG_PASSWORD :{WHITE}Contrasinal incorrecto +STR_NETWORK_ERROR_NOT_ON_ALLOW_LIST :{WHITE}Non estás na lista de clientes permitidos STR_NETWORK_ERROR_SERVER_FULL :{WHITE}O servidor está cheo STR_NETWORK_ERROR_SERVER_BANNED :{WHITE}Non se che permite o acceso a este servidor STR_NETWORK_ERROR_KICKED :{WHITE}Chimpáronte da partida @@ -2603,6 +2607,7 @@ STR_NETWORK_ERROR_CLIENT_NOT_EXPECTED :recibiuse un pa STR_NETWORK_ERROR_CLIENT_WRONG_REVISION :revisión errónea STR_NETWORK_ERROR_CLIENT_NAME_IN_USE :o nome xa está en uso STR_NETWORK_ERROR_CLIENT_WRONG_PASSWORD :contrasinal incorrecto +STR_NETWORK_ERROR_CLIENT_NOT_ON_ALLOW_LIST :non na lista permitida STR_NETWORK_ERROR_CLIENT_COMPANY_MISMATCH :compañía errónea nun DoCommand STR_NETWORK_ERROR_CLIENT_KICKED :chimpado polo servidor STR_NETWORK_ERROR_CLIENT_CHEATER :intentaba usar unha trampa @@ -2981,11 +2986,11 @@ STR_TREES_RANDOM_TYPE_TOOLTIP :{BLACK}Colocar STR_TREES_RANDOM_TREES_BUTTON :{BLACK}Árbores aleatorias STR_TREES_RANDOM_TREES_TOOLTIP :{BLACK}Plantar árbores aleatoriamente sobre a paisaxe STR_TREES_MODE_NORMAL_BUTTON :{BLACK}Normal -STR_TREES_MODE_NORMAL_TOOLTIP :{BLACK}Planta árbores individuais arrastrando sobre a paisaxe. +STR_TREES_MODE_NORMAL_TOOLTIP :{BLACK}Planta árbores individuais arrastrando sobre a paisaxe STR_TREES_MODE_FOREST_SM_BUTTON :{BLACK}Arboreda -STR_TREES_MODE_FOREST_SM_TOOLTIP :{BLACK}Planta pequenos bosques arrastrando sobre a paisaxe. +STR_TREES_MODE_FOREST_SM_TOOLTIP :{BLACK}Planta pequenos bosques arrastrando sobre a paisaxe STR_TREES_MODE_FOREST_LG_BUTTON :{BLACK}Bosque -STR_TREES_MODE_FOREST_LG_TOOLTIP :{BLACK}Plantar bosques arrastrando sobre a paisaxe. +STR_TREES_MODE_FOREST_LG_TOOLTIP :{BLACK}Plantar bosques arrastrando sobre a paisaxe # Land generation window (SE) STR_TERRAFORM_TOOLBAR_LAND_GENERATION_CAPTION :{WHITE}Xeración de terreo @@ -3200,11 +3205,11 @@ STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD STR_FRAMERATE_CAPTION :{WHITE}Imaxes por segundo STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) STR_FRAMERATE_RATE_GAMELOOP :{BLACK}Velocidade de simulación: {STRING} -STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Número de ticks do xogo simulados por segundo. +STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Número de ticks do xogo simulados por segundo STR_FRAMERATE_RATE_BLITTER :{BLACK}Imaxes por segundo: {STRING} -STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}Número de frames renderizados por segundo. +STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}Número de frames renderizados por segundo STR_FRAMERATE_SPEED_FACTOR :{BLACK}Factor de velocidade do xogo actual: {DECIMAL}x -STR_FRAMERATE_SPEED_FACTOR_TOOLTIP :{BLACK}Como de rápido está a correr o xogo, comparado coa velocidade esperada a unha velocidade de simulación normal. +STR_FRAMERATE_SPEED_FACTOR_TOOLTIP :{BLACK}Como de rápido está a correr o xogo, comparado coa velocidade esperada a unha velocidade de simulación normal STR_FRAMERATE_CURRENT :{WHITE}Actual STR_FRAMERATE_AVERAGE :{WHITE}Media STR_FRAMERATE_MEMORYUSE :{WHITE}Memoria @@ -3393,8 +3398,11 @@ STR_GENERATION_ABORT_MESSAGE :{YELLOW}Estás STR_GENERATION_PROGRESS :{WHITE}{NUM}% completado STR_GENERATION_PROGRESS_NUM :{BLACK}{NUM} / {NUM} STR_GENERATION_WORLD_GENERATION :{BLACK}Xeración do mundo +STR_GENERATION_LANDSCAPE_GENERATION :{BLACK}Xeración da paisaxe STR_GENERATION_RIVER_GENERATION :{BLACK}Xeración de ríos STR_GENERATION_CLEARING_TILES :{BLACK}Xeración de áreas rochosas e escarpadas +STR_GENERATION_TOWN_GENERATION :{BLACK}Xeración de vilas +STR_GENERATION_INDUSTRY_GENERATION :{BLACK}Xeración da industria STR_GENERATION_OBJECT_GENERATION :{BLACK}Xeración de obxectos STR_GENERATION_TREE_GENERATION :{BLACK}Xeración de árbores STR_GENERATION_SETTINGUP_GAME :{BLACK}Configurando partida @@ -3488,6 +3496,9 @@ STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_ROAD_TYPE :Tipo de estrada STR_NEWGRF_INSPECT_QUERY_CAPTION :{WHITE}Parámetro de variable NewGRF 60+x (hexadecimal) # Sprite aligner window +STR_SPRITE_ALIGNER_CAPTION_NO_ACTION :{WHITE}Aliñación de sprite: ({STRING}:{NUM}) +STR_SPRITE_ALIGNER_CAPTION_ACTIONA :{WHITE}Aliñación de sprite: Action 0xA, {COMMA} ({STRING}:{NUM}) +STR_SPRITE_ALIGNER_CAPTION_ACTION5 :{WHITE}Aliñación de sprite: Action 0x5, type {HEX}, {COMMA} ({STRING}:{NUM}) STR_SPRITE_ALIGNER_NEXT_BUTTON :{BLACK}Seguinte sprite STR_SPRITE_ALIGNER_NEXT_TOOLTIP :{BLACK}Ir ao sprite seguinte, ignorando pseudosprites, sprites recoloreados e sprites de fonte, e volvendo a empezar ao chegar á fin STR_SPRITE_ALIGNER_GOTO_BUTTON :{BLACK}Ir a sprite @@ -3496,6 +3507,7 @@ STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Sprite a STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Ir ao sprite anterior, ignorando pseudosprites, sprites recoloreados e sprites de fonte, e volvendo a empezar ao chegar ao inicio STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Representación do sprite seleccionado. A aliñación ignórase ao debuxar este sprite STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Move-lo sprite, cambiando os valores de X e Y. Ctrl+Click para movelo sprite oito unidades de golpe. +STR_SPRITE_ALIGNER_SPRITE :{STRING}:{NUM} ###length 2 STR_SPRITE_ALIGNER_CENTRE_OFFSET :{BLACK}Desfase centrado @@ -3732,7 +3744,7 @@ STR_STORY_BOOK_SPECTATOR_CAPTION :{WHITE}Historia STR_STORY_BOOK_SPECTATOR :Álbum global STR_STORY_BOOK_TITLE :{YELLOW}{STRING} STR_STORY_BOOK_GENERIC_PAGE_ITEM :Páxina {NUM} -STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}Vai a unha páxina específica seleccionandoa nesta lista despregable. +STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}Vai a unha páxina específica seleccionandoa nesta lista despregable STR_STORY_BOOK_PREV_PAGE :{BLACK}Anterior STR_STORY_BOOK_PREV_PAGE_TOOLTIP :{BLACK}Ir á páxina anterior STR_STORY_BOOK_NEXT_PAGE :{BLACK}Seguinte @@ -4032,7 +4044,7 @@ STR_GROUP_CREATE_TOOLTIP :{BLACK}Pincha p STR_GROUP_DELETE_TOOLTIP :{BLACK}Borrar o grupo seleccionado STR_GROUP_RENAME_TOOLTIP :{BLACK}Renomear o grupo seleccionado STR_GROUP_LIVERY_TOOLTIP :{BLACK}Mudar o deseño do grupo seleccionado -STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Pincha para protexer a este grupo da autosubstitución global. Ctrl+Click para protexer tamén os subgrupos. +STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Pincha para protexer a este grupo da autosubstitución global. Ctrl+Click para protexer tamén os subgrupos STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Borrar Grupo STR_GROUP_DELETE_QUERY_TEXT :{WHITE}Seguro que queres borrar este grupo e calquera descendente? @@ -4448,10 +4460,10 @@ STR_VEHICLE_INFO_CAPACITY_CAPACITY :{BLACK}Capacida STR_VEHICLE_INFO_FEEDER_CARGO_VALUE :{BLACK}Créditos de transferencia: {LTBLUE}{CURRENCY_LONG} STR_VEHICLE_DETAILS_SERVICING_INTERVAL_DAYS :{BLACK}Intervalo de servizo: {LTBLUE}{COMMA}{NBSP}días{BLACK} {STRING} -STR_VEHICLE_DETAILS_SERVICING_INTERVAL_MINUTES :{BLACK}Intervalo de servizo: {LTBLUE}{COMMA}{NBSP}minutos{BLACK} {STRING} +STR_VEHICLE_DETAILS_SERVICING_INTERVAL_MINUTES :{BLACK}Intervalo de servizo: {LTBLUE}{COMMA}{NBSP}minuto{P "" s}{BLACK} {STRING} STR_VEHICLE_DETAILS_SERVICING_INTERVAL_PERCENT :{BLACK}Intervalo de servizo: {LTBLUE}{COMMA}%{BLACK} {STRING} STR_VEHICLE_DETAILS_LAST_SERVICE_DATE :Último servizo: {LTBLUE}{DATE_LONG} -STR_VEHICLE_DETAILS_LAST_SERVICE_MINUTES_AGO :Último servizo: {LTBLUE}fai {NUM} minutos +STR_VEHICLE_DETAILS_LAST_SERVICE_MINUTES_AGO :Último servizo: {LTBLUE}Fai {NUM} minuto{P "" s} STR_VEHICLE_DETAILS_INCREASE_SERVICING_INTERVAL_TOOLTIP_DAYS :{BLACK}Incrementar o intervalo de servizo en 10 días. Ctrl+Click para incrementar o intervalo de servizo en 5 días. STR_VEHICLE_DETAILS_INCREASE_SERVICING_INTERVAL_TOOLTIP_MINUTES :{BLACK}Incrementar o intervalo de servizo en 5 minutos. Ctrl+Click para incrementar o intervalo de servizo en 1 minuto STR_VEHICLE_DETAILS_INCREASE_SERVICING_INTERVAL_TOOLTIP_PERCENT :{BLACK}Incrementar o intervalo de servizo nun 10%. Ctrl+Click para incrementar o intervalo de servizo en 5%. @@ -4898,7 +4910,9 @@ STR_MESSAGE_ESTIMATED_INCOME :{WHITE}Ingreso STR_ERROR_SAVE_STILL_IN_PROGRESS :{WHITE}Gravación en progreso,{}por favor agarda ata que remate! STR_ERROR_AUTOSAVE_FAILED :{WHITE}Autogravado fallido STR_ERROR_UNABLE_TO_READ_DRIVE :{BLACK}No se pode lee-la unidade +STR_ERROR_GAME_SAVE_FAILED :{WHITE}Fallou o gardado da partida... STR_ERROR_UNABLE_TO_DELETE_FILE :{WHITE}Non se pode borra-lo arquivo +STR_ERROR_GAME_LOAD_FAILED :{WHITE}Fallou a carga da partida... STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR :Erro interno: {STRING} STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME :Partida gravada corrupta - {STRING} STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME :A partida gravouse cunha versión máis nova do xogo @@ -4992,7 +5006,7 @@ STR_ERROR_CAN_T_BUY_COMPANY :{WHITE}Non se p STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS :{WHITE}Non se pode construí-la sede # Town related errors -STR_ERROR_CAN_T_GENERATE_TOWN :{WHITE}Non se poden construír cidades +STR_ERROR_CAN_T_GENERATE_TOWN :{WHITE}Non se poden construír cidades... STR_ERROR_CAN_T_RENAME_TOWN :{WHITE}Non se pode renomear a cidade... STR_ERROR_CAN_T_FOUND_TOWN_HERE :{WHITE}Non se pode construír a cidade aquí... STR_ERROR_CAN_T_EXPAND_TOWN :{WHITE}Non se pode expandi-la vila @@ -5280,6 +5294,10 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Cambia a STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}Aínda non hai vehículos dispoñíbeis STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Comezar unha partida nova a partires de {DATE_SHORT} ou empregar un NewGRF que proporcione vehículos antigos +STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL :{WHITE}Non hai estradas dispoñibles que as vilas podan construír +STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Cambia a túa configuración NewGRF +STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET :{WHITE}Aínda non hai estradas dispoñibles que as vilas podan construír +STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET_EXPLANATION :{WHITE}Comeza unha nova partida despois do {DATE_SHORT} ou utiliza NewGRF que engadan tipos de estradas que as vilan podan construír antes # Specific vehicle errors STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Non se pode facer que o tren rebase un sinal en perigo... @@ -5831,6 +5849,7 @@ STR_JUST_DATE_ISO :{DATE_ISO} STR_JUST_STRING :{STRING} STR_JUST_STRING1 :{STRING} STR_JUST_STRING2 :{STRING} +STR_JUST_STRING4 :{STRING} STR_JUST_STRING_STRING :{STRING}{STRING} STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index efcf589405..06793fe8fb 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -1833,6 +1833,9 @@ STR_CONFIG_SETTING_SERVINT_AIRCRAFT_HELPTEXT :Välj vilket se STR_CONFIG_SETTING_SERVINT_SHIPS :Normalt serviceintervall för skepp: {STRING} STR_CONFIG_SETTING_SERVINT_SHIPS_HELPTEXT :Välj vilket serviceintervall som normalt sett ska användas för nya skepp, om inget annat serviceintervall uttryckligen anges ###length 3 +STR_CONFIG_SETTING_SERVINT_VALUE_DAYS :{COMMA}{NBSP}dag{P 0 "" ar} +STR_CONFIG_SETTING_SERVINT_VALUE_MINUTES :{COMMA}{NBSP}minut{P 0 "" er} +STR_CONFIG_SETTING_SERVINT_VALUE_PERCENTAGE :{COMMA}{NBSP}% ###setting-zero-is-special STR_CONFIG_SETTING_SERVINT_DISABLED :Inaktiverat From 96d82b4363eee042cb17d8deceebf632c2d802fa Mon Sep 17 00:00:00 2001 From: translators Date: Wed, 1 May 2024 04:41:08 +0000 Subject: [PATCH 12/30] Update: Translations from eints chinese (simplified): 1 change by WenSimEHRP greek: 52 changes by KyriakosMich german: 3 changes by Wuzzy2 basque: 36 changes by Porrumentzio danish: 3 changes by bscargo --- src/lang/basque.txt | 70 +++++++++++----------- src/lang/danish.txt | 3 + src/lang/german.txt | 3 + src/lang/greek.txt | 101 ++++++++++++++++---------------- src/lang/simplified_chinese.txt | 2 +- 5 files changed, 95 insertions(+), 84 deletions(-) diff --git a/src/lang/basque.txt b/src/lang/basque.txt index 0bdb78c006..c40a398ae2 100644 --- a/src/lang/basque.txt +++ b/src/lang/basque.txt @@ -93,7 +93,7 @@ STR_CARGO_SINGULAR_FIZZY_DRINK :Edari Burbuilat # Quantity of cargo STR_QUANTITY_NOTHING : -STR_QUANTITY_PASSENGERS :{COMMA}{NBSP}bidaiari{P "" ak} +STR_QUANTITY_PASSENGERS :{COMMA}{NBSP}bidaiari STR_QUANTITY_COAL :{WEIGHT_LONG} ikatz STR_QUANTITY_MAIL :{COMMA}{NBSP}posta zaku STR_QUANTITY_OIL :{VOLUME_LONG} petroleo @@ -162,23 +162,23 @@ STR_ABBREV_FIZZY_DRINKS :EB STR_ABBREV_ALL :DEN # 'Mode' of transport for cargoes -STR_PASSENGERS :{COMMA}{NBSP}bidaiari{P "" ak} -STR_BAGS :{COMMA}{NBSP}zaku{P "" ak} -STR_TONS :{COMMA}{NBSP}tona{P "" k} -STR_LITERS :{COMMA}{NBSP}litro{P "" ak} -STR_ITEMS :{COMMA}{NBSP}objektu{P "" ak} -STR_CRATES :{COMMA}{NBSP}kaxa{P "" k} +STR_PASSENGERS :{COMMA}{NBSP}bidaiari +STR_BAGS :{COMMA}{NBSP}zaku +STR_TONS :{COMMA}{NBSP}tona +STR_LITERS :{COMMA}{NBSP}litro +STR_ITEMS :{COMMA}{NBSP}objektu +STR_CRATES :{COMMA}{NBSP}kaxa STR_COLOUR_DEFAULT :Lehenetsia ###length 17 -STR_COLOUR_DARK_BLUE :Urdin Iluna -STR_COLOUR_PALE_GREEN :Berde Zurbila +STR_COLOUR_DARK_BLUE :Urdin iluna +STR_COLOUR_PALE_GREEN :Berde zurbila STR_COLOUR_PINK :Larrosa STR_COLOUR_YELLOW :Horia STR_COLOUR_RED :Gorria -STR_COLOUR_LIGHT_BLUE :Urdin Argia +STR_COLOUR_LIGHT_BLUE :Urdin argia STR_COLOUR_GREEN :Berdea -STR_COLOUR_DARK_GREEN :Berde Iluna +STR_COLOUR_DARK_GREEN :Berde iluna STR_COLOUR_BLUE :Urdina STR_COLOUR_CREAM :Krema STR_COLOUR_MAUVE :Malba @@ -205,16 +205,16 @@ STR_UNITS_WEIGHT_SHORT_IMPERIAL :{DECIMAL}{NBSP} STR_UNITS_WEIGHT_SHORT_METRIC :{DECIMAL}{NBSP}t STR_UNITS_WEIGHT_SHORT_SI :{DECIMAL}{NBSP}kg -STR_UNITS_WEIGHT_LONG_IMPERIAL :{DECIMAL}{NBSP}tona{P "" k} -STR_UNITS_WEIGHT_LONG_METRIC :{DECIMAL}{NBSP}tona{P "" k} +STR_UNITS_WEIGHT_LONG_IMPERIAL :{DECIMAL}{NBSP}tona +STR_UNITS_WEIGHT_LONG_METRIC :{DECIMAL}{NBSP}tona STR_UNITS_WEIGHT_LONG_SI :{DECIMAL}{NBSP}kg STR_UNITS_VOLUME_SHORT_IMPERIAL :{DECIMAL}{NBSP}gal STR_UNITS_VOLUME_SHORT_METRIC :{DECIMAL}{NBSP}l STR_UNITS_VOLUME_SHORT_SI :{DECIMAL}{NBSP}m³ -STR_UNITS_VOLUME_LONG_IMPERIAL :{DECIMAL}{NBSP}galoi{P "" ak} -STR_UNITS_VOLUME_LONG_METRIC :{DECIMAL}{NBSP}litro{P "" ak} +STR_UNITS_VOLUME_LONG_IMPERIAL :{DECIMAL}{NBSP}galoi +STR_UNITS_VOLUME_LONG_METRIC :{DECIMAL}{NBSP}litro STR_UNITS_VOLUME_LONG_SI :{DECIMAL}{NBSP}m³ STR_UNITS_FORCE_IMPERIAL :{DECIMAL}{NBSP}lbf @@ -230,9 +230,9 @@ STR_UNITS_HEIGHT_SI :{DECIMAL}{NBSP} # Common window strings -STR_LIST_FILTER_TITLE :{BLACK}Lokarri iragazkia: -STR_LIST_FILTER_OSKTITLE :{BLACK}Sartu lokarri iragazkia -STR_LIST_FILTER_TOOLTIP :{BLACK}Sartu hitz bat iragazkian zerrendan aurkitzeko +STR_LIST_FILTER_TITLE :{BLACK}Iragazi: +STR_LIST_FILTER_OSKTITLE :{BLACK}Idatzi hitzen bat zerrenda iragazteko +STR_LIST_FILTER_TOOLTIP :{BLACK}Idatzi hitzen bat zerrenda iragazteko STR_TOOLTIP_GROUP_ORDER :{BLACK}Aukeratu taldekatzeko ordena STR_TOOLTIP_SORT_ORDER :{BLACK}Hautatu agertze ordena (deszendientea/aszendientea) @@ -240,7 +240,7 @@ STR_TOOLTIP_SORT_CRITERIA :{BLACK}Aukeratu STR_TOOLTIP_FILTER_CRITERIA :{BLACK}Aukeratu iragazki irizpideak STR_BUTTON_SORT_BY :{BLACK}Ordenatu -STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Lehioa itxi +STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Itxi leihoa STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Leiho izena - Arrastatu hau leihoa mugitzeko STR_TOOLTIP_SHADE :{BLACK}Itzal leihoa - titulu barra bakarrik ikusten da STR_TOOLTIP_DEBUG :{BLACK}NewGRF garbiketa informazioa ikusi @@ -253,14 +253,14 @@ STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC :{BLACK}Eraikina # Show engines button ###length VEHICLE_TYPES -STR_SHOW_HIDDEN_ENGINES_VEHICLE_TRAIN :{BLACK}Ezkutuak erakutsi -STR_SHOW_HIDDEN_ENGINES_VEHICLE_ROAD_VEHICLE :{BLACK}Ezkutuak erakutsi -STR_SHOW_HIDDEN_ENGINES_VEHICLE_SHIP :{BLACK}Ezkutuak erakutsi -STR_SHOW_HIDDEN_ENGINES_VEHICLE_AIRCRAFT :{BLACK}Ezkutuak erakutsi +STR_SHOW_HIDDEN_ENGINES_VEHICLE_TRAIN :{BLACK}Erakutsi ezkutukoak +STR_SHOW_HIDDEN_ENGINES_VEHICLE_ROAD_VEHICLE :{BLACK}Erakutsi ezkutukoak +STR_SHOW_HIDDEN_ENGINES_VEHICLE_SHIP :{BLACK}Erakutsi ezkutukoak +STR_SHOW_HIDDEN_ENGINES_VEHICLE_AIRCRAFT :{BLACK}Erakutsi ezkutukoak ###length VEHICLE_TYPES -STR_SHOW_HIDDEN_ENGINES_VEHICLE_TRAIN_TOOLTIP :{BLACK}Botoi hau gaituz, ezkutuak dauden trenak erakusten dira -STR_SHOW_HIDDEN_ENGINES_VEHICLE_SHIP_TOOLTIP :{BLACK}Botoi hau gaituz, ezkutuko itsasontziak ere erakusten dira +STR_SHOW_HIDDEN_ENGINES_VEHICLE_TRAIN_TOOLTIP :{BLACK}Botoi hau sakatuz, ezkutuko trenak erakusten dira +STR_SHOW_HIDDEN_ENGINES_VEHICLE_SHIP_TOOLTIP :{BLACK}Botoi hau sakatuz, ezkutuko itsasontziak ere erakusten dira # Query window STR_BUTTON_DEFAULT :{BLACK}Lehenetsia @@ -275,7 +275,7 @@ STR_OSK_KEYBOARD_LAYOUT_CAPS :ª!"·$%&/()=? STR_MEASURE_LENGTH :{BLACK}Luzera: {NUM} STR_MEASURE_AREA :{BLACK}Area: {NUM} x {NUM} STR_MEASURE_LENGTH_HEIGHTDIFF :{BLACK}Luzera: {NUM}{}Garaiera diferentzia: {HEIGHT} -STR_MEASURE_AREA_HEIGHTDIFF :{BLACK}Area: {NUM} x {NUM}{}Goratasun diferentzia: {HEIGHT} +STR_MEASURE_AREA_HEIGHTDIFF :{BLACK}Area: {NUM} x {NUM}{}Garaiera diferentzia: {HEIGHT} # These are used in buttons @@ -321,11 +321,11 @@ STR_SORT_BY_RATING :Balorazioa # Tooltips for the main toolbar ###length 31 -STR_TOOLBAR_TOOLTIP_PAUSE_GAME :{BLACK}Jokoa pausatu -STR_TOOLBAR_TOOLTIP_FORWARD :{BLACK}Jokoa bizkortu +STR_TOOLBAR_TOOLTIP_PAUSE_GAME :{BLACK}Pausatu jokoa +STR_TOOLBAR_TOOLTIP_FORWARD :{BLACK}Bizkortu jokoa STR_TOOLBAR_TOOLTIP_OPTIONS :{BLACK}Ezarpenak -STR_TOOLBAR_TOOLTIP_SAVE_GAME_ABANDON_GAME :{BLACK}Jokoa gorde, joko honetatik irten, jokotik irten -STR_TOOLBAR_TOOLTIP_DISPLAY_MAP :{BLACK}Erakutsi mapa, ikuspegi extra edo kartelen zerrenda +STR_TOOLBAR_TOOLTIP_SAVE_GAME_ABANDON_GAME :{BLACK}Gorde, kargatu edo utzi jokoa, irten programatik +STR_TOOLBAR_TOOLTIP_DISPLAY_MAP :{BLACK}Mapa, ikuspegi gehigarria, zama-mugimenduak edo kartelen zerrenda ikusi STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY :{BLACK}Erakutsi herri zerrenda STR_TOOLBAR_TOOLTIP_DISPLAY_SUBSIDIES :{BLACK}Subsidioak erakutsi STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_STATIONS :{BLACK}Erakutsi konpainien geltokien zerrenda @@ -395,7 +395,7 @@ STR_SETTINGS_MENU_TRANSPARENT_SIGNS :Geltoki errotul # File menu STR_FILE_MENU_SAVE_GAME :Jokoa gorde -STR_FILE_MENU_LOAD_GAME :Jokoa kargatu +STR_FILE_MENU_LOAD_GAME :Kargatu joko bat STR_FILE_MENU_QUIT_GAME :Jokoa utzi STR_FILE_MENU_EXIT :Irten @@ -1784,8 +1784,8 @@ STR_CONFIG_ERROR_OUT_OF_MEMORY :{WHITE}Memoriaz # Intro window STR_INTRO_CAPTION :{WHITE}OpenTTD {REV} -STR_INTRO_NEW_GAME :{BLACK}Joko Berria -STR_INTRO_LOAD_GAME :{BLACK}Jokoa Kargatu +STR_INTRO_NEW_GAME :{BLACK}Joko berria +STR_INTRO_LOAD_GAME :{BLACK}Kargatu joko bat STR_INTRO_PLAY_SCENARIO :{BLACK}Eszenarioa Jokatu STR_INTRO_PLAY_HEIGHTMAP :{BLACK}Garaiera mapa jokatu STR_INTRO_SCENARIO_EDITOR :{BLACK}Eszenario Editorea @@ -1796,6 +1796,7 @@ STR_INTRO_HIGHSCORE :{BLACK}Puntuazi STR_INTRO_CONFIG_SETTINGS_TREE :{BLACK}Ezarpenak STR_INTRO_NEWGRF_SETTINGS :{BLACK}NewGRF-ren Ezarpenak STR_INTRO_ONLINE_CONTENT :{BLACK}Edukiak Online Kontsultatu +STR_INTRO_AI_SETTINGS :{BLACK}AAren ezarpenak STR_INTRO_QUIT :{BLACK}Irten STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Joko berria hasi. Krtl+klik mapa konfigurazioa desgaitzen du @@ -3293,6 +3294,7 @@ STR_GROUP_REMOVE_ALL_VEHICLES :Ibilgailu guzti STR_GROUP_RENAME_CAPTION :{BLACK}Taldea berrizendatu +STR_GROUP_PROFIT_THIS_YEAR :Aurtengo irabaziak: # Build vehicle window ###length 4 @@ -3910,7 +3912,7 @@ STR_DATE_YEAR_TOOLTIP :{BLACK}Urtea au STR_AI_DEBUG :{WHITE}IA/Joko Script Garbitzailea STR_AI_DEBUG_NAME_AND_VERSION :{BLACK}{STRING} (v{NUM}) STR_AI_DEBUG_NAME_TOOLTIP :{BLACK}Script-aren izena -STR_AI_DEBUG_SETTINGS :{BLACK}IA-ren Ezarpenak +STR_AI_DEBUG_SETTINGS :{BLACK}AAren ezarpenak STR_AI_DEBUG_SETTINGS_TOOLTIP :{BLACK}IA-ren hautaketak aldatu STR_AI_DEBUG_RELOAD :{BLACK}IA birkargatu STR_AI_DEBUG_RELOAD_TOOLTIP :{BLACK}IA kendu, script-a birkargatu, eta IA berrabiarazi diff --git a/src/lang/danish.txt b/src/lang/danish.txt index ddcf869978..e0f997da92 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -1833,6 +1833,9 @@ STR_CONFIG_SETTING_SERVINT_AIRCRAFT_HELPTEXT :Sæt serviceint STR_CONFIG_SETTING_SERVINT_SHIPS :Standard serviceinterval for skibe: {STRING} STR_CONFIG_SETTING_SERVINT_SHIPS_HELPTEXT :Sæt serviceintervallets standardværdi for nye skibe. ###length 3 +STR_CONFIG_SETTING_SERVINT_VALUE_DAYS :{COMMA}{NBSP}Dag{P 0 "" e} +STR_CONFIG_SETTING_SERVINT_VALUE_MINUTES :{COMMA}{NBSP}Minut{P 0 "" er} +STR_CONFIG_SETTING_SERVINT_VALUE_PERCENTAGE :{COMMA}{NBSP}% ###setting-zero-is-special STR_CONFIG_SETTING_SERVINT_DISABLED :Deaktiveret diff --git a/src/lang/german.txt b/src/lang/german.txt index e408441918..f35922103e 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -3395,8 +3395,11 @@ STR_GENERATION_ABORT_MESSAGE :{YELLOW}Soll di STR_GENERATION_PROGRESS :{WHITE}{NUM}% abgeschlossen STR_GENERATION_PROGRESS_NUM :{BLACK}{NUM} / {NUM} STR_GENERATION_WORLD_GENERATION :{BLACK}Spielfeld wird erzeugt +STR_GENERATION_LANDSCAPE_GENERATION :{BLACK}Landschaftserzeugung STR_GENERATION_RIVER_GENERATION :{BLACK}Flussgenerierung STR_GENERATION_CLEARING_TILES :{BLACK}Raue, felsige Landschaft wird erzeugt +STR_GENERATION_TOWN_GENERATION :{BLACK}Stadterzeugung +STR_GENERATION_INDUSTRY_GENERATION :{BLACK}Industrieerzeugung STR_GENERATION_OBJECT_GENERATION :{BLACK}Unbewegliche Objekte werden erzeugt STR_GENERATION_TREE_GENERATION :{BLACK}Bäume werden erzeugt STR_GENERATION_SETTINGUP_GAME :{BLACK}Spiel wird vorbereitet diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 75ec914d7f..6cb19b60c2 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -228,7 +228,7 @@ STR_BAGS :{COMMA}{NBSP}σ STR_TONS :{COMMA}{NBSP}τόνο{P ς οι} STR_LITERS :{COMMA}{NBSP}λίτρ{P ο α} STR_ITEMS :{COMMA}{NBSP}αντικείμεν{P ο α} -STR_CRATES :{COMMA}{NBSP}κουτ{P ί ιά} +STR_CRATES :{COMMA}{NBSP}κιβώτι{P ο α} STR_COLOUR_DEFAULT :Προεπιλογή ###length 17 @@ -346,7 +346,7 @@ STR_TOOLTIP_SHADE :{BLACK}Σκία STR_TOOLTIP_DEBUG :{BLACK}Εμφάνιση πληροφοριών αποσφαλμάτωσης για NewGRF STR_TOOLTIP_DEFSIZE :{BLACK}Κλιμακώνει το παράθυρο στο προκαθορισμένο μέγεθος. Με Ctrl+Κλικ αποθηκεύεται το τρέχον μέγεθος ως προκαθορισμένο STR_TOOLTIP_STICKY :{BLACK}Σημειώστε αυτό το παραθύρο ωστέ να μην κλείνει από το πλήκτρο «Κλείσιμο Όλων των Παραθύρων». Πατήστε Ctrl+Κλικ για να αποθηκεύσετε την κατάσταση απο επιλογή -STR_TOOLTIP_RESIZE :{BLACK}Κάντε κλίκ και σύρετε για να αλλάξετε το μέγεθος του παραθύρου +STR_TOOLTIP_RESIZE :{BLACK}Πατήστε και σύρετε για να αλλάξετε το μέγεθος του παραθύρου STR_TOOLTIP_TOGGLE_LARGE_SMALL_WINDOW :{BLACK}Εναλλαγή μεγάλου/μικρού παραθύρου STR_TOOLTIP_VSCROLL_BAR_SCROLLS_LIST :{BLACK}Μπάρα Κύλισης - μετακινεί την λίστα πάνω/κάτω STR_TOOLTIP_HSCROLL_BAR_SCROLLS_LIST :{BLACK}Μπάρα κίνησης - κινεί τη λίστα αριστερά/δεξιά @@ -590,7 +590,7 @@ STR_ABOUT_MENU_HELP :Βοήθεια STR_ABOUT_MENU_TOGGLE_CONSOLE :Εναλλαγή κονσόλας STR_ABOUT_MENU_AI_DEBUG :Αποσφαλμάτωση AI και δέσμης ενεργειών παιχνιδιού STR_ABOUT_MENU_SCREENSHOT :Στιγμιότυπο οθόνης -STR_ABOUT_MENU_SHOW_FRAMERATE :Εμφάνιση ρυθμού καρέ +STR_ABOUT_MENU_SHOW_FRAMERATE :Ρυθμός εμφάνισης καρέ STR_ABOUT_MENU_ABOUT_OPENTTD :Σχετικά με το 'OpenTTD' STR_ABOUT_MENU_SPRITE_ALIGNER :Ευθυγραμμιστής στοιχεών STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Εναλλαγή πλαισίου οριοθέτησης @@ -884,7 +884,7 @@ STR_SMALLMAP_LEGENDA_DESERT :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_SNOW :{TINY_FONT}{BLACK}Χιόνι STR_SMALLMAP_TOOLTIP_TOGGLE_TOWN_NAMES_ON_OFF :{BLACK}Εναλλαγή ονομάτων πόλεων στον χάρτη -STR_SMALLMAP_CENTER :{BLACK}Κεντράρισμα του μικρού χάρτη στη τρέχουσα θέση +STR_SMALLMAP_CENTER :{BLACK}Κεντράρισμα του μικρού χάρτη στην τρέχουσα θέση STR_SMALLMAP_INDUSTRY :{TINY_FONT}{STRING} ({NUM}) STR_SMALLMAP_LINKSTATS :{TINY_FONT}{STRING} STR_SMALLMAP_COMPANY :{TINY_FONT}{COMPANY} @@ -1135,7 +1135,7 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Η ρύ STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Τσεκάρετε αυτό το κουτί για να ενεργοποιήσετε το v-sync στην οθόνη. Η αλλαγή αυτή θα εφαρμοστεί μετά από επανεκκίνηση του παιχνιδιού. Λειτουργεί μόνο με ενεργοποιημένη την επιτάχυνση υλικού -STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Τρέχον οδηγός: {STRING} +STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Τρέχων οδηγός: {STRING} STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Μέγεθος διεπαφής STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Σύρετε το κουμπί για να ορίσετε το μέγεθος του περιβάλλοντος διεπαφής. Ctrl+Σύρσιμο για συνεχή προσαρμογή @@ -1200,15 +1200,15 @@ STR_GAME_OPTIONS_SOCIAL_PLUGIN_STATE_INVALID_SIGNATURE :{RED}Άκυρη STR_BASESET_STATUS :{STRING} {RED}({NUM} λείπει/κατεστραμμένο αρχεί{P ο α}) STR_ERROR_RESOLUTION_LIST_FAILED :{WHITE}Αποτυχία ανάκτησης λίστας υποστηριζόμενων αναλύσεων -STR_ERROR_FULLSCREEN_FAILED :{WHITE}Θέση του παιχνιδιού σε λειτουργία πλήρης οθόνης απέτυχε +STR_ERROR_FULLSCREEN_FAILED :{WHITE}Απέτυχε η λειτουργία πλήρους οθόνης # Custom currency window STR_CURRENCY_WINDOW :{WHITE}Προσαρμοσμένο νόμισμα STR_CURRENCY_EXCHANGE_RATE :{LTBLUE}Ισοτιμία: {ORANGE}{CURRENCY_LONG} = £ {COMMA} -STR_CURRENCY_DECREASE_EXCHANGE_RATE_TOOLTIP :{BLACK}Μείωση του ποσού της ισοτιμίας σας για μία λίρα (£) -STR_CURRENCY_INCREASE_EXCHANGE_RATE_TOOLTIP :{BLACK}Αυξήστε το ποσό της ισοτιμίας σας για μία Λίρα (£) -STR_CURRENCY_SET_EXCHANGE_RATE_TOOLTIP :{BLACK}Ρυθμίστε τη συναλλαγματική ισοτιμία του νομίσματος για μια λίρα (£) +STR_CURRENCY_DECREASE_EXCHANGE_RATE_TOOLTIP :{BLACK}Μείωση του ποσού του νομίσματός σας για μία λίρα (£) +STR_CURRENCY_INCREASE_EXCHANGE_RATE_TOOLTIP :{BLACK}Αύξηση του ποσού του νομίσματός σας για μία Λίρα (£) +STR_CURRENCY_SET_EXCHANGE_RATE_TOOLTIP :{BLACK}Ορίστε τη συναλλαγματική ισοτιμία του νομίσματος σας για μια λίρα (£) STR_CURRENCY_SEPARATOR :{LTBLUE}Διαχωριστής: {ORANGE}{STRING} STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP :{BLACK}Ορίστε το διαχωριστικό για το νόμισμά σας @@ -1225,7 +1225,7 @@ STR_CURRENCY_DECREASE_CUSTOM_CURRENCY_TO_EURO_TOOLTIP :{BLACK}Να γ STR_CURRENCY_INCREASE_CUSTOM_CURRENCY_TO_EURO_TOOLTIP :{BLACK}Να γίνει η μετάβαση σε Ευρώ αργότερα STR_CURRENCY_PREVIEW :{LTBLUE}Προεπισκόπιση: {ORANGE}{CURRENCY_LONG} -STR_CURRENCY_CUSTOM_CURRENCY_PREVIEW_TOOLTIP :{BLACK}10000 λίρες (£) στο νόμισμά σας +STR_CURRENCY_CUSTOM_CURRENCY_PREVIEW_TOOLTIP :{BLACK}10.000 λίρες (£) στο νόμισμά σας STR_CURRENCY_CHANGE_PARAMETER :{BLACK}Αλλαγή παραμέτρων προσαρμοσμένου νομίσματος STR_NONE :Κανένα @@ -1298,7 +1298,7 @@ STR_CITY_APPROVAL_TOLERANT :Υπομονε STR_CITY_APPROVAL_HOSTILE :Εχθρική STR_CITY_APPROVAL_PERMISSIVE :Ανεκτική (χωρίς επίδραση σε ενέργειες της εταιρίας) -STR_WARNING_NO_SUITABLE_AI :{WHITE}Δεν είναι διαθέσιμο κανένα κατάλληλο Al...{}Μπορείτε να κατεβάσετε AIs μέσω του συστήματος «Διαδικτυακού Περιεχομένου» +STR_WARNING_NO_SUITABLE_AI :{WHITE}Δεν υπάρχει διαθέσιμο κατάλληλο Al...{}Μπορείτε να κατεβάσετε AIs μέσω του συστήματος «Διαδικτυακού Περιεχομένου» # Settings tree window STR_CONFIG_SETTING_TREE_CAPTION :{WHITE}Ρυθμίσεις @@ -1925,6 +1925,9 @@ STR_CONFIG_SETTING_SERVINT_AIRCRAFT_HELPTEXT :Ορίστε τ STR_CONFIG_SETTING_SERVINT_SHIPS :Προκαθορισμένο διάστημα μεταξύ επισκευών για τα πλοία: {STRING} STR_CONFIG_SETTING_SERVINT_SHIPS_HELPTEXT :Ορίστε το προκαθορισμένο διάστημα μεταξύ συντηρήσεων για τα νέα πλοία, όταν δεν δίνεται άλλο διάστημα για το πλοίο ###length 3 +STR_CONFIG_SETTING_SERVINT_VALUE_DAYS :{COMMA}{NBSP}Ημέρα{P 0 "" s} +STR_CONFIG_SETTING_SERVINT_VALUE_MINUTES :{COMMA}{NBSP}Λεπτό{P 0 "" s} +STR_CONFIG_SETTING_SERVINT_VALUE_PERCENTAGE :{COMMA}{NBSP}% ###setting-zero-is-special STR_CONFIG_SETTING_SERVINT_DISABLED :Απενεργοποιημένο @@ -2743,22 +2746,22 @@ STR_NETWORK_ERROR_COORDINATOR_ISOLATED :{WHITE}Ο serve STR_NETWORK_ERROR_COORDINATOR_ISOLATED_DETAIL :{WHITE}Οι άλλοι παίκτες δεν θα μπορούν να συνδεθούν στον server σας # Content downloading window -STR_CONTENT_TITLE :{WHITE}Περιεχόμενο κατεβαίνει +STR_CONTENT_TITLE :{WHITE}Λαμβάνεται το περιεχόμενο STR_CONTENT_TYPE_CAPTION :{BLACK}Τύπος STR_CONTENT_TYPE_CAPTION_TOOLTIP :{BLACK}Τύπος περιεχόμενου STR_CONTENT_NAME_CAPTION :{BLACK}Όνομα STR_CONTENT_NAME_CAPTION_TOOLTIP :{BLACK}Το όνομα του περιεχομένου STR_CONTENT_MATRIX_TOOLTIP :{BLACK}Πατήστε σε μια γραμμή για να δείτε λεπτομέρειες{}Πατήστε στο κουτάκι για το επιλέξετε για κατέβασμα STR_CONTENT_SELECT_ALL_CAPTION :{BLACK}Επιλογή όλων -STR_CONTENT_SELECT_ALL_CAPTION_TOOLTIP :{BLACK}Μαρκάρισμα όλων των περιεχομένων για κατέβασμα +STR_CONTENT_SELECT_ALL_CAPTION_TOOLTIP :{BLACK}Μαρκάρισμα όλων των περιεχομένων για λήψη STR_CONTENT_SELECT_UPDATES_CAPTION :{BLACK}Επιλέξτε αναβαθμίσεις STR_CONTENT_SELECT_UPDATES_CAPTION_TOOLTIP :{BLACK}Μαρκάρισμα όλων των περιεχόμενων που είναι για αναβάθμιση υπαρχόντων περιεχόμενων για κατέβασμα STR_CONTENT_UNSELECT_ALL_CAPTION :{BLACK}Αποεπιλογή όλων STR_CONTENT_UNSELECT_ALL_CAPTION_TOOLTIP :{BLACK}Σημείωση όλων των περιεχομένων να μην κατέβουν STR_CONTENT_SEARCH_EXTERNAL :{BLACK}Αναζήτηση εξωτερικών ιστοσελίδων -STR_CONTENT_SEARCH_EXTERNAL_TOOLTIP :{BLACK}Αναζήτηση για περιεχόμενο που δεν είναι διαθέσιμο μέσω την υπηρεσία λήψης περιεχομένου του OpenTTD σε ιστοσελίδες που δεν σχετίζονται με το OpenTTD +STR_CONTENT_SEARCH_EXTERNAL_TOOLTIP :{BLACK}Αναζήτηση για περιεχόμενο που δεν είναι διαθέσιμο μέσω της υπηρεσίας λήψης περιεχομένου του OpenTTD σε ιστοσελίδες που δεν σχετίζονται με το OpenTTD STR_CONTENT_SEARCH_EXTERNAL_DISCLAIMER_CAPTION :{WHITE}Φεύγετε από το OpenTTD! -STR_CONTENT_SEARCH_EXTERNAL_DISCLAIMER :{WHITE}Οι όροι και προϋποθέσεις για τη λήψη περιεχομένου από εξωτερικές ιστοσελίδες διαφέρουν.{}Θα πρέπει να αναφερθείτε στις εξωτερικές ιστοσελίδες για οδηγίες περί της εγκατάστασης του περιεχομένου στο OpenTTD.{}Θέλετε να συνεχίσετε; +STR_CONTENT_SEARCH_EXTERNAL_DISCLAIMER :{WHITE}Οι όροι και προϋποθέσεις για τη λήψη περιεχομένου από εξωτερικές ιστοσελίδες διαφέρουν.{}Θα πρέπει να ανατρέξετε σε αυτές για οδηγίες σχετικά με την εγκατάσταση του περιεχομένου στο OpenTTD.{}Θέλετε να συνεχίσετε; STR_CONTENT_FILTER_TITLE :{BLACK}Ετικέτα/όνομα φίλτρου: STR_CONTENT_OPEN_URL :{BLACK}Ιστοσελίδα STR_CONTENT_OPEN_URL_TOOLTIP :{BLACK}Επισκεφθείτε την ιστοσελίδα αυτού του περιεχομένου @@ -2868,7 +2871,7 @@ STR_JOIN_STATION_CAPTION :{WHITE}Συνέ STR_JOIN_STATION_CREATE_SPLITTED_STATION :{YELLOW}Κατασκευάστε ένα ξεχωριστό σταθμό STR_JOIN_WAYPOINT_CAPTION :{WHITE}Συνένωση σημείου καθοδήγησης -STR_JOIN_WAYPOINT_CREATE_SPLITTED_WAYPOINT :{YELLOW}κατασκευή ενός ξεχωριστού σημείου καθοδήγησης +STR_JOIN_WAYPOINT_CREATE_SPLITTED_WAYPOINT :{YELLOW}Κατασκευή ενός ξεχωριστού σημείου καθοδήγησης # Generic toolbar STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE :{BLACK}Απενεργοποιημένο διότι δεν υπάρχουν διαθέσιμα οχήματα για αυτή την υποδομή @@ -2921,7 +2924,7 @@ STR_STATION_CLASS_DFLT :Προεπιλ STR_STATION_CLASS_DFLT_STATION :Προεπιλεγμένος σταθμός STR_STATION_CLASS_DFLT_ROADSTOP :Προεπιλεγμένη οδική στάση STR_STATION_CLASS_WAYP :Σημείο καθοδηγήσης -STR_STATION_CLASS_WAYP_WAYPOINT :Προεπιλεγμένο σημείο διαδρομής +STR_STATION_CLASS_WAYP_WAYPOINT :Προεπιλεγμένο σημείο καθοδήγησης # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}Επιλογή Σηματοδότη @@ -2938,7 +2941,7 @@ STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}Σημα STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Συνδυαστικός Σηματοδότης (ηλεκτρικός){}Ο συνδυαστικός σηματοδότης δουλεύει απλά ως σηματοδότης εισόδου και εξόδου ταυτόχρονα. Αυτό σας επιτρέπει την κατασκευή μεγάλων «δέντρων» με προ-σηματοδότες STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Σηματοδότης Τροχιάς (ηλεκτρικός){}Ένας σηματοδότης τροχιάς επιτρέπει σε περισσότερα από ένα τρένο να είναι σε ένα κομμάτι ελέγχου την ίδια στιγμή, εάν το τρένο μπορεί να δεσμεύσει τροχιά σε ασφαλές σημείο στάσης. Κανονικοί σηματοδότες τροχιάς μπορούν να περαστούν από την πίσω πλευρά STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}Μονόδρομος Σηματοδότης Τροχιάς (ηλεκτρικός){}Ένας σηματοδότης τροχιάς επιτρέπει σε περισσότερα από ένα τρένο να είναι σε ένα κομμάτι ελέγχου την ίδια στιγμή, εάν το τρένο μπορεί να δεσμεύσει τροχιά σε ασφαλές σημείο στάσης. Μονόδρομοι σηματοδότες τροχιάς δεν μπορούν να περαστούν από την πίσω πλευρά -STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Μετατροπή σήματος{}Κάντε κλικ σε ένα υπάρχον σήμα για να το μετατρέψετε στον επιλεγμένο τύπο και παραλλαγή. Ctrl+Κλικ για εναλλαγή της υπάρχουσας παραλλαγής. Το Shift+Κλικ εμφανίζει το εκτιμώμενο κόστος μετατροπής +STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Μετατροπή σήματος{}Πατήστε σε ένα υπάρχον σήμα για να το μετατρέψετε στον επιλεγμένο τύπο και παραλλαγή. Ctrl+Κλικ για εναλλαγή της υπάρχουσας παραλλαγής. Το Shift+Κλικ εμφανίζει το εκτιμώμενο κόστος μετατροπής STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Απόσταση μεταξύ σηματοδοτών με σύρσιμο STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Μείωση απόστασης μεταξύ σηματοδοτών με σύρσιμο STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Αύξηση απόστασης μεταξύ σηματοδοτών με σύρσιμο @@ -3354,7 +3357,7 @@ STR_SAVELOAD_SAVE_SCENARIO :{WHITE}Αποθ STR_SAVELOAD_LOAD_SCENARIO :{WHITE}Φόρτωση Σεναρίου STR_SAVELOAD_LOAD_HEIGHTMAP :{WHITE}Φόρτωση Χάρτη Υψομετρίας STR_SAVELOAD_SAVE_HEIGHTMAP :{WHITE}Αποθήκευση Χάρτη Υψομετρίας -STR_SAVELOAD_HOME_BUTTON :{BLACK}Πατήστε εδώ για να πάτε στον τρέχων φάκελο αποθήκευσης +STR_SAVELOAD_HOME_BUTTON :{BLACK}Πατήστε εδώ για να μεταβείτε στον τρέχοντα φάκελο αποθήκευσης/φόρτωσης STR_SAVELOAD_BYTES_FREE :{BLACK}{BYTES} ελεύθερα STR_SAVELOAD_LIST_TOOLTIP :{BLACK}Λίστα δισκών, φακέλων και αποθηκευμένων παιχνιδιών STR_SAVELOAD_EDITBOX_TOOLTIP :{BLACK}Τρέχον επιλεγμένο όνομα για το αποθηκευμένο παιχνίδι @@ -4006,7 +4009,7 @@ STR_COMPANY_VIEW_INFRASTRUCTURE_TOOLTIP :{BLACK}Προβ STR_COMPANY_VIEW_GIVE_MONEY_BUTTON :{BLACK}Δώστε χρήματα STR_COMPANY_VIEW_GIVE_MONEY_TOOLTIP :{BLACK}Δώστε χρήματα σε αυτή την εταρία STR_COMPANY_VIEW_HOSTILE_TAKEOVER_BUTTON :{BLACK}Εχθρική εξαγορά -STR_COMPANY_VIEW_HOSTILE_TAKEOVER_TOOLTIP :{BLACK}Κάντε μια εχθρική εξαγορά αυτής της εταιρείας +STR_COMPANY_VIEW_HOSTILE_TAKEOVER_TOOLTIP :{BLACK}Κάντε εχθρική εξαγορά αυτής της εταιρείας STR_COMPANY_VIEW_NEW_FACE_BUTTON :{BLACK}Νέο Πρόσωπο STR_COMPANY_VIEW_NEW_FACE_TOOLTIP :{BLACK}Επιλογή νέου προσώπου διευθυντή @@ -4286,9 +4289,9 @@ STR_DEPOT_AIRCRAFT_LIST_TOOLTIP :{BLACK}Αερο ###length VEHICLE_TYPES STR_DEPOT_TRAIN_SELL_TOOLTIP :{BLACK}Τραβήξτε το όχημα τρένου εδώ για να το πουλήσετε -STR_DEPOT_ROAD_VEHICLE_SELL_TOOLTIP :{BLACK}Τραβήξτε το όχημα δρόμου εδώ για να το πουλήσετε +STR_DEPOT_ROAD_VEHICLE_SELL_TOOLTIP :{BLACK}Σύρετε το όχημα δρόμου εδώ για να το πουλήσετε STR_DEPOT_SHIP_SELL_TOOLTIP :{BLACK}Τραβήξτε το πλοίο εδώ για να το πουλήσετε -STR_DEPOT_AIRCRAFT_SELL_TOOLTIP :{BLACK}Τραβήξτε το αεροσκάφος εδώ για να το πουλήσετε +STR_DEPOT_AIRCRAFT_SELL_TOOLTIP :{BLACK}Σύρετε το αεροσκάφος εδώ για να το πουλήσετε ###length VEHICLE_TYPES STR_DEPOT_SELL_ALL_BUTTON_TRAIN_TOOLTIP :{BLACK}Πουλήστε όλα τα τρένα στο αμαξοστάσιο @@ -4300,7 +4303,7 @@ STR_DEPOT_SELL_ALL_BUTTON_AIRCRAFT_TOOLTIP :{BLACK}Πουλ STR_DEPOT_AUTOREPLACE_TRAIN_TOOLTIP :{BLACK}Αυτόματη αντικατάσταση όλων των τρένων στο αμαξοστάσιο STR_DEPOT_AUTOREPLACE_ROAD_VEHICLE_TOOLTIP :{BLACK}Αυτόματη αντικατάσταση όλων των οχημάτων στο αμαξοστάσιο STR_DEPOT_AUTOREPLACE_SHIP_TOOLTIP :{BLACK}Αυτόματη αντικατάσταση όλων των πλοίων στο ναυπηγείο -STR_DEPOT_AUTOREPLACE_AIRCRAFT_TOOLTIP :{BLACK}Αυτόματη αντικατάσταση όλων των αεροσκαφών του υποστέγου +STR_DEPOT_AUTOREPLACE_AIRCRAFT_TOOLTIP :{BLACK}Αυτόματη αντικατάσταση όλων των αεροσκαφών στο υπόστεγο ###length VEHICLE_TYPES STR_DEPOT_TRAIN_NEW_VEHICLES_BUTTON :{BLACK}Νέα Οχήματα @@ -4321,7 +4324,7 @@ STR_DEPOT_CLONE_SHIP :{BLACK}Κλων STR_DEPOT_CLONE_AIRCRAFT :{BLACK}Κλωνοποίηση Αεροσκάφους ###length VEHICLE_TYPES -STR_DEPOT_CLONE_TRAIN_DEPOT_INFO :{BLACK}Αγορά αντιγράφου ενός τρένου μαζί με τα όλα τα βαγόνια. Πατήστε αυτό το κουμπί και μετά σε κάποιο τρένο μέσα ή έξω από το αμαξοστάσιο. Ctrl+Κλικ για διαμοιρασμό εντολών. Επιπρόσθετα, με Shift εμφανίζεται εκτίμηση κόστους μόνο +STR_DEPOT_CLONE_TRAIN_DEPOT_INFO :{BLACK}Αγορά αντιγράφου ενός τρένου μαζί με όλα τα βαγόνια. Πατήστε αυτό το κουμπί και μετά σε κάποιο τρένο μέσα ή έξω από το αμαξοστάσιο. Ctrl+Κλικ για διαμοιρασμό εντολών. Επιπρόσθετα, με Shift εμφανίζεται εκτίμηση κόστους μόνο STR_DEPOT_CLONE_ROAD_VEHICLE_DEPOT_INFO :{BLACK}Αγορά αντιγράφου ενός οχήματος δρόμου. Πατήστε αυτό το κουμπί και μετά σε κάποιο όχημα μέσα ή έξω από το αμαξοστάσιο. Ctrl+Κλικ για διαμοιρασμό εντολών. Επιπρόσθετα, με Shift εμφανίζεται εκτίμηση κόστους μόνο STR_DEPOT_CLONE_SHIP_DEPOT_INFO :{BLACK}Αγορά αντιγράφου ενός πλοίου. Πατήστε αυτό το κουμπί και μετά σε κάποιο πλοίο μέσα ή έξω από το ναυπηγείο. Ctrl+Κλικ για διαμοιρασμό εντολών. Επιπρόσθετα, με Shift εμφανίζεται εκτίμηση κόστους μόνο STR_DEPOT_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW :{BLACK}Αγορά αντιγράφου του αεροσκάφους. Πατήστε αυτό το κουμπί και μετά σε κάποιο αεροσκάφος μέσα ή έξω από το υπόστεγο. Με Ctrl+Κλικ θα διαμοιραστούν τις εντολές. Επιπρόσθετα, με Shift εμφανίζεται εκτίμηση κόστους μόνο @@ -4350,7 +4353,7 @@ STR_DEPOT_MASS_START_DEPOT_ROAD_VEHICLE_TOOLTIP :{BLACK}Πατή STR_DEPOT_MASS_START_DEPOT_SHIP_TOOLTIP :{BLACK}Πατήστε για να ξεκινήσουν όλα τα πλοία μέσα στο ναυπηγείο STR_DEPOT_MASS_START_HANGAR_TOOLTIP :{BLACK}Πατήστε για να ξεκινήσουν όλα τα αεροσκάφη μέσα στο υπόστεγο -STR_DEPOT_DRAG_WHOLE_TRAIN_TO_SELL_TOOLTIP :{BLACK}Τραβήξτε τη μηχανή του τρένου εδώ για να πουληθεί ολόκληρο το τρένο +STR_DEPOT_DRAG_WHOLE_TRAIN_TO_SELL_TOOLTIP :{BLACK}Σύρετε τη μηχανή του τρένου εδώ για να πουληθεί ολόκληρο το τρένο STR_DEPOT_SELL_CONFIRMATION_TEXT :{YELLOW}Πρόκειται να πουλήσετε όλα τα οχήματα στο αμαξοστάσιο. Είσαστε σίγουροι; # Engine preview window @@ -4483,10 +4486,10 @@ STR_VEHICLE_VIEW_SHIP_SHOW_DETAILS_TOOLTIP :{BLACK}Εμφά STR_VEHICLE_VIEW_AIRCRAFT_SHOW_DETAILS_TOOLTIP :{BLACK}Εμφάνιση λεπτομερειών αεροσκάφους ###length VEHICLE_TYPES -STR_VEHICLE_VIEW_TRAIN_STATUS_START_STOP_TOOLTIP :{BLACK}Τρέχουσα δράση τρένου - κάντε κλικ για να σταματήσετε/ξεκινήσετε το τρένο -STR_VEHICLE_VIEW_ROAD_VEHICLE_STATUS_START_STOP_TOOLTIP :{BLACK}Τρέχων ενέργεια οχήματος - κάντε κλικ για να σταματήσετε/ξεκινήσετε το όχημα -STR_VEHICLE_VIEW_SHIP_STATE_STATUS_STOP_TOOLTIP :{BLACK}Τρέχουσα ενέργεια πλοίου - κάντε κλικ για να σταματήσετε/ξεκινήσετε το πλοίο -STR_VEHICLE_VIEW_AIRCRAFT_STATUS_START_STOP_TOOLTIP :{BLACK}Τρέχουσα δράση αεροσκάφους - κάντε κλικ για να σταματήσετε/ξεκινήσετε το αεροσκάφος +STR_VEHICLE_VIEW_TRAIN_STATUS_START_STOP_TOOLTIP :{BLACK}Τρέχουσα δράση τρένου - πατήστε για να σταματήσετε/ξεκινήσετε το τρένο +STR_VEHICLE_VIEW_ROAD_VEHICLE_STATUS_START_STOP_TOOLTIP :{BLACK}Τρέχουσα ενέργεια οχήματος - πατήστε για να σταματήσετε/ξεκινήσετε το όχημα +STR_VEHICLE_VIEW_SHIP_STATE_STATUS_STOP_TOOLTIP :{BLACK}Τρέχουσα ενέργεια πλοίου - πατήστε για να σταματήσετε/ξεκινήσετε το πλοίο +STR_VEHICLE_VIEW_AIRCRAFT_STATUS_START_STOP_TOOLTIP :{BLACK}Τρέχουσα δράση αεροσκάφους - πατήστε για να σταματήσετε/ξεκινήσετε το αεροσκάφος # Messages in the start stop button in the vehicle view STR_VEHICLE_STATUS_LOADING_UNLOADING :{LTBLUE}Φόρτωση / Εκφόρτωση @@ -4609,7 +4612,7 @@ STR_REFIT_NEW_CAPACITY_COST_OF_REFIT :{BLACK}Νέα STR_REFIT_NEW_CAPACITY_INCOME_FROM_REFIT :{BLACK}Νέα χωρητικότητα: {GOLD}{CARGO_LONG}{}{BLACK}Κέρδος από τη μετατροπή: {GREEN}{CURRENCY_LONG} STR_REFIT_NEW_CAPACITY_COST_OF_AIRCRAFT_REFIT :{BLACK}Νέα χωρητικότητα: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Κόστος μετατροπής: {RED}{CURRENCY_LONG} STR_REFIT_NEW_CAPACITY_INCOME_FROM_AIRCRAFT_REFIT :{BLACK}Νέα χωρητικότητα: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Κέρδος από τη μετατροπή: {GREEN}{CURRENCY_LONG} -STR_REFIT_SELECT_VEHICLES_TOOLTIP :{BLACK}Επιλέξτε τα οχήματα για μετατροπή. Κλικ+Σύρσιμο για επιλογή πολλαπλών οχημάτων. Κάντε κλικ σε έναν κενό χώρο για να επιλέξετε ολόκληρο το όχημα. Ctrl+Κλικ για να επιλέξετε ένα όχημα και την ακόλουθη αλυσίδα +STR_REFIT_SELECT_VEHICLES_TOOLTIP :{BLACK}Επιλέξτε τα οχήματα για μετατροπή. Κλικ+Σύρσιμο για επιλογή πολλαπλών οχημάτων. Πατήστε σε κενό χώρο για να επιλέξετε ολόκληρο το όχημα. Ctrl+Κλικ για να επιλέξετε κάποιο όχημα και την ακόλουθη αλυσίδα ###length VEHICLE_TYPES STR_REFIT_TRAIN_LIST_TOOLTIP :{BLACK}Επιλέξτε τον τύπο εμπορεύματος που θα μεταφέρει το τρένο @@ -4724,7 +4727,7 @@ STR_ORDER_GO_TO_NEAREST_DEPOT :Πήγαινε STR_ORDER_GO_TO_NEAREST_HANGAR :Πήγαινε στο κοντινότερο υπόστεγο STR_ORDER_CONDITIONAL :Εκτέλεση εντόλης υπο προυπόθεση STR_ORDER_SHARE :Μοίρασμα εντολών -STR_ORDERS_GO_TO_TOOLTIP :{BLACK}Εισάγετε μια νέα εντολή πριν την επιλεγμένη ή προσθέστε στο τέλος της λίστας. Ctrl+Κλικ σε έναν σταθμό για ορισμό εντολής σε "πλήρης φόρτωση οποιουδήποτε εμπορεύματος", σε σημείο διαδρομής για αντιστροφή εντολής "χωρίς στάση εξ ορισμού" ή σε αμαξοστάσιο για "αποσύνδεση". Κάντε κλικ σε άλλο όχημα για να αντιγράψετε τις εντολές του ή Ctrl+Κλικ για διαμοιρασμό εντολών. Μια εντολή αμαξοστασίου απενεργοποιεί την αυτόματη συντήρηση του οχήματος +STR_ORDERS_GO_TO_TOOLTIP :{BLACK}Εισαγάγετε νέα εντολή πριν την επιλεγμένη ή προσθέστε στο τέλος της λίστας. Ctrl+Κλικ σε σταθμό για «πλήρη φόρτωση οποιουδήποτε εμπορεύματος», σε σημείο διαδρομής για αντιστροφή της εντολής «προεπιλογή χωρίς στάση» ή σε αμαξοστάσιο για «αποσύνδεση». Πατήστε σε άλλο όχημα για να αντιγράψετε τις εντολές του ή Ctrl+Κλικ για διαμοιρασμό εντολών. Η εντολή για αμαξοστάσιο απενεργοποιεί την αυτόματη συντήρηση του οχήματος STR_ORDERS_VEH_WITH_SHARED_ORDERS_LIST_TOOLTIP :{BLACK}Εμφάνιση όλων των οχημάτων που μοιράζονται αυτό το δρομολόγιο @@ -4894,7 +4897,7 @@ STR_AI_GAME_SCRIPT :{BLACK}Δέσμ STR_AI_GAME_SCRIPT_TOOLTIP :{BLACK}Έλεγχος ιστορικού δέσμης ενεργειών παιχνιδιού. Ctrl+Κλικ για άνοιγμα σε νέο παράθυρο STR_ERROR_AI_NO_AI_FOUND :Δεν βρέθηκε κατάλληλη AI για φόρτωση.{}Αυτή η AI είναι ψεύτικη και δεν θα κάνει τίποτα.{}Μπορείτε να κατεβάσετε διάφορες AΙ από το σύστημα Διαδικτυακού Περιεχομένου. -STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Μια τρέχουσα δέσμη ενεργειών τερμάτισε απότομα. Παρακαλώ ενημερώστε τον συγγραφέα της δέσμης ενεργειών με ένα στιγμιότυπο οθόνης από το παράθυρο αποσφαλμάτωσης AI/Παιχνιδιού +STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Μια από τις δέσμες ενεργειών που εκτελούνται τερμάτισε απότομα. Παρακαλώ ενημερώστε τον συγγραφέα της δέσμης ενεργειών με ένα στιγμιότυπο οθόνης από το παράθυρο αποσφαλμάτωσης AI/Παιχνιδιού STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}Το παράθυρο αποσφαλμάτωσης ΑΙ και δέσμης ενεργειών είναι διαθέσιμο μόνο για τον διακομιστή # AI configuration window @@ -5008,7 +5011,7 @@ STR_ERROR_AUTOSAVE_FAILED :{WHITE}Η αυ STR_ERROR_UNABLE_TO_READ_DRIVE :{BLACK}Αδύνατη η ανάγνωση του δίσκου STR_ERROR_GAME_SAVE_FAILED :{WHITE}Η αποθήκευση του παιχνιδιού απέτυχε... STR_ERROR_UNABLE_TO_DELETE_FILE :{WHITE}Αδύνατη η διαγραφή του αρχείου -STR_ERROR_GAME_LOAD_FAILED :{WHITE}Το φόρτωμα του παιχνιδιού απέτυχε... +STR_ERROR_GAME_LOAD_FAILED :{WHITE}Απέτυχε η φόρτωση του παιχνιδιού... STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR :Εσωτερικό λάθος: {STRING} STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME :Χαλασμένο αποθηκευμένο παιχνίδι - {STRING} STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME :Το αποθηκευμένο παιχνίδι είναι φτιαγμένο με νεότερη έκδοση @@ -5037,7 +5040,7 @@ STR_WARNING_HEIGHTMAP_SCALE_CAPTION :{WHITE}Προε STR_WARNING_HEIGHTMAP_SCALE_MESSAGE :{YELLOW}Αλλαγή μεγέθους του πηγαίου χάρτη δεν συνιστάται. Να προχωρήσει η δημιουργία; # Soundset messages -STR_WARNING_FALLBACK_SOUNDSET :{WHITE}Βρέθηκε μόνο εφεδρικό σετ ήχου. Αν θέλετε ήχους, εγκαταστήστε ένα πακέτο ήχων μέσω του συστήματος μεταφόρτωσης υλικού +STR_WARNING_FALLBACK_SOUNDSET :{WHITE}Βρέθηκε μόνο εφεδρικό πακέτο ήχων. Αν θέλετε ήχους, εγκαταστήστε πακέτο ήχων μέσω του συστήματος μεταφόρτωσης υλικού # Screenshot related messages STR_WARNING_SCREENSHOT_SIZE_CAPTION :{WHITE}Τεράστιο στιγμιότυπο οθόνης @@ -5157,23 +5160,23 @@ STR_ERROR_TOO_MANY_TRUCK_STOPS :{WHITE}Πάρα STR_ERROR_TOO_CLOSE_TO_ANOTHER_DOCK :{WHITE}Πολύ κοντά σε άλλη αποβάθρα STR_ERROR_TOO_CLOSE_TO_ANOTHER_AIRPORT :{WHITE}Πολύ κοντά σε άλλο αεροδρόμιο STR_ERROR_CAN_T_RENAME_STATION :{WHITE}Δεν μπορεί να μετονομαστεί ο σταθμός... -STR_ERROR_DRIVE_THROUGH_ON_TOWN_ROAD :{WHITE}... δρόμος ιδιοκτησία μιας πόλης +STR_ERROR_DRIVE_THROUGH_ON_TOWN_ROAD :{WHITE}... δρόμος ιδιοκτησία κάποιας πόλης STR_ERROR_DRIVE_THROUGH_DIRECTION :{WHITE}... ο δρόμος βλέπει σε λάθος κατεύθυνση STR_ERROR_DRIVE_THROUGH_CORNER :{WHITE}... οι μη τερματικοί σταθμοί δε μπορούν να έχουν στροφές STR_ERROR_DRIVE_THROUGH_JUNCTION :{WHITE}... οι μη τερματικοί σταθμοί δε μπορούν να έχουν διασταυρώσεις # Station destruction related errors STR_ERROR_CAN_T_REMOVE_PART_OF_STATION :{WHITE}Δεν μπορεί να αφαιρεθεί μέρος του σταθμού... -STR_ERROR_MUST_REMOVE_RAILWAY_STATION_FIRST :{WHITE}Πρέπει πρώτα να αφαιρέσετε τον σταθμό σιδηροδρόμου +STR_ERROR_MUST_REMOVE_RAILWAY_STATION_FIRST :{WHITE}Πρέπει να αφαιρεθεί ο σταθμός σιδηροδρόμου πρώτα STR_ERROR_CAN_T_REMOVE_BUS_STATION :{WHITE}Αδύνατο να αφαιρεθεί η στάση λεωφορείων... STR_ERROR_CAN_T_REMOVE_TRUCK_STATION :{WHITE}Δεν μπορεί να αφαιρεθεί ο σταθμός φορτηγών... STR_ERROR_CAN_T_REMOVE_PASSENGER_TRAM_STATION :{WHITE}Δεν μπορεί να αφαιρεθεί η στάση επιβατών τραμ... STR_ERROR_CAN_T_REMOVE_CARGO_TRAM_STATION :{WHITE}Δεν μπορεί να αφαιρεθεί ο σταθμός εμπορευμάτων τραμ... -STR_ERROR_MUST_REMOVE_ROAD_STOP_FIRST :{WHITE}Πρέπει να γίνει αφαίρεση της στάσης οχημάτων πρώτα +STR_ERROR_MUST_REMOVE_ROAD_STOP_FIRST :{WHITE}Πρέπει να αφαιρεθεί η στάση οχημάτων πρώτα STR_ERROR_THERE_IS_NO_STATION :{WHITE}... δεν υπάρχει σταθμός εδώ STR_ERROR_MUST_DEMOLISH_RAILROAD :{WHITE}Πρέπει να κατεδαφιστεί ο σιδηροδρομικός σταθμός πρώτα -STR_ERROR_MUST_DEMOLISH_BUS_STATION_FIRST :{WHITE}Πρέπει να κατεδαφιστεί η στάσης λεωφορείου πρώτα +STR_ERROR_MUST_DEMOLISH_BUS_STATION_FIRST :{WHITE}Πρέπει να κατεδαφιστεί η στάση λεωφορείου πρώτα STR_ERROR_MUST_DEMOLISH_TRUCK_STATION_FIRST :{WHITE}Πρέπει να κατεδαφιστεί ο σταθμός φορτηγών πρώτα STR_ERROR_MUST_DEMOLISH_PASSENGER_TRAM_STATION_FIRST :{WHITE}Πρέπει να κατεδαφιστεί ο επιβατικός σταθμός τραμ πρώτα STR_ERROR_MUST_DEMOLISH_CARGO_TRAM_STATION_FIRST :{WHITE}Πρέπει να κατεδαφιστεί ο εμπορευματικός σταθμός τραμ πρώτα @@ -5181,7 +5184,7 @@ STR_ERROR_MUST_DEMOLISH_DOCK_FIRST :{WHITE}Πρέπ STR_ERROR_MUST_DEMOLISH_AIRPORT_FIRST :{WHITE}Πρέπει να κατεδαφιστεί το αεροδρόμιο πρώτα # Waypoint related errors -STR_ERROR_WAYPOINT_ADJOINS_MORE_THAN_ONE_EXISTING :{WHITE}Προστίθεται σε περισσότερο από ένα υπάρχον σημείο καθοδήγησης +STR_ERROR_WAYPOINT_ADJOINS_MORE_THAN_ONE_EXISTING :{WHITE}Συνενώνει περισσότερα από ένα υπάρχοντα σημεία καθοδήγησης STR_ERROR_TOO_CLOSE_TO_ANOTHER_WAYPOINT :{WHITE}Πολύ κοντά σε άλλο σημείο καθοδήγησης STR_ERROR_CAN_T_BUILD_TRAIN_WAYPOINT :{WHITE}Δεν μπορεί να κατασκευαστεί σημείο καθοδήγησης τρένου εδώ... @@ -5189,7 +5192,7 @@ STR_ERROR_CAN_T_POSITION_BUOY_HERE :{WHITE}Δεν STR_ERROR_CAN_T_CHANGE_WAYPOINT_NAME :{WHITE}Αδύνατο να αλλαχτεί το όνομα του σημείου καθοδήγησης... STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT :{WHITE}Αδύνατο να αφαιρεθεί το σημείο καθοδήγησης τρένου από εδώ... -STR_ERROR_MUST_REMOVE_RAILWAYPOINT_FIRST :{WHITE}Πρέπει να αφαιρεθεί πρώτα το σημείο καθοδήγησης σιδηρόδρομου +STR_ERROR_MUST_REMOVE_RAILWAYPOINT_FIRST :{WHITE}Πρέπει να αφαιρεθεί το σημείο καθοδήγησης σιδηρόδρομου πρώτα STR_ERROR_BUOY_IN_THE_WAY :{WHITE}... σημαδούρα στη μέση STR_ERROR_BUOY_IS_IN_USE :{WHITE}... σημαδούρα σε χρήση από άλλη εταιρία! @@ -5235,7 +5238,7 @@ STR_ERROR_AUTOREPLACE_INCOMPATIBLE_REFIT :{WHITE}Το κ # Rail construction errors STR_ERROR_IMPOSSIBLE_TRACK_COMBINATION :{WHITE}Αδύνατος συνδυασμός σιδηροδρόμου -STR_ERROR_MUST_REMOVE_SIGNALS_FIRST :{WHITE}Πρέπει να γίνει αφαίρεση του σήματος πρώτα +STR_ERROR_MUST_REMOVE_SIGNALS_FIRST :{WHITE}Πρέπει να αφαιρεθεί το σήμα πρώτα STR_ERROR_NO_SUITABLE_RAILROAD_TRACK :{WHITE}Μη συμβατή σιδηροτροχιά STR_ERROR_MUST_REMOVE_RAILROAD_TRACK :{WHITE}Πρέπει να αφαιρεθεί ο σιδηρόδρομος πρώτα STR_ERROR_CROSSING_ON_ONEWAY_ROAD :{WHITE}Η δρόμος είναι μονόδρομος ή μπλοκαρισμένος @@ -5252,7 +5255,7 @@ STR_ERROR_THERE_ARE_NO_SIGNALS :{WHITE}... δε STR_ERROR_CAN_T_CONVERT_RAIL :{WHITE}Δε γίνεται να μετατραπεί ο τύπος της σιδηροτροχιάς εδώ... # Road construction errors -STR_ERROR_MUST_REMOVE_ROAD_FIRST :{WHITE}Πρέπει πρώτα να αφαιρεθεί ο δρόμος +STR_ERROR_MUST_REMOVE_ROAD_FIRST :{WHITE}Πρέπει να αφαιρεθεί ο δρόμος πρώτα STR_ERROR_ONEWAY_ROADS_CAN_T_HAVE_JUNCTION :{WHITE}... οι μονόδρομοι δεν μπορούν να έχουν διασταυρώσεις STR_ERROR_CAN_T_BUILD_ROAD_HERE :{WHITE}Δεν μπορεί να κατασκευαστεί δρόμος εδώ... STR_ERROR_CAN_T_BUILD_TRAMWAY_HERE :{WHITE}Δεν μπορεί να κατασκευαστεί τροχιοδρόμος εδώ... @@ -5284,7 +5287,7 @@ STR_ERROR_CAN_T_PLANT_TREE_HERE :{WHITE}Δεν # Bridge related errors STR_ERROR_CAN_T_BUILD_BRIDGE_HERE :{WHITE}Δεν μπορεί να κατασκευαστεί γέφυρα εδώ... -STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST :{WHITE}Πρέπει πρώτα να καταστραφεί η γέφυρα +STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST :{WHITE}Πρέπει να καταστραφεί η γέφυρα πρώτα STR_ERROR_CAN_T_START_AND_END_ON :{WHITE}Δεν γίνεται να ξεκινάει και να τελειώνει στο ίδιο σημείο STR_ERROR_BRIDGEHEADS_NOT_SAME_HEIGHT :{WHITE}Η γέφυρα δεν καταλήγει στο ίδιο επίπεδο STR_ERROR_BRIDGE_TOO_LOW_FOR_TERRAIN :{WHITE}Η γέφυρα είναι πολύ χαμηλή για το έδαφος @@ -5297,7 +5300,7 @@ STR_ERROR_BRIDGE_THROUGH_MAP_BORDER :{WHITE}Η γέ # Tunnel related errors STR_ERROR_CAN_T_BUILD_TUNNEL_HERE :{WHITE}Δεν μπορεί να κατασκευαστεί τούνελ εδώ... STR_ERROR_SITE_UNSUITABLE_FOR_TUNNEL :{WHITE}Ακατάλληλη τοποθεσία για είσοδο τούνελ -STR_ERROR_MUST_DEMOLISH_TUNNEL_FIRST :{WHITE}Πρέπει πρώτα να καταστραφεί το τούνελ +STR_ERROR_MUST_DEMOLISH_TUNNEL_FIRST :{WHITE}Πρέπει να καταστραφεί το τούνελ πρώτα STR_ERROR_ANOTHER_TUNNEL_IN_THE_WAY :{WHITE}Υπάρχει άλλο τούνελ στη μέση STR_ERROR_TUNNEL_THROUGH_MAP_BORDER :{WHITE}Το τούνελ θα καταλήξει εκτός του χάρτη STR_ERROR_UNABLE_TO_EXCAVATE_LAND :{WHITE}Αδύνατο να γίνει εκσκαφή γης στην άλλη άκρη του τούνελ @@ -5436,7 +5439,7 @@ STR_ERROR_NO_STOP_COMPATIBLE_TRAM_TYPE :{WHITE}Δεν STR_ERROR_NO_STOP_ARTICULATED_VEHICLE :{WHITE}Δεν υπάρχουν στάσεις που να είναι κατάλληλες για αρθρωτά οδικά οχήματα.{}Τα αρθρωτά οδικά οχήματα απαιτούν μια στάση-πέρασμα (drive-through) και όχι κλειστή στάση STR_ERROR_AIRPORT_NO_PLANES :{WHITE}Το αεροπλάνο αυτό δεν μπορεί να προσγειωθεί σε αυτό το ελικοδρόμιο STR_ERROR_AIRPORT_NO_HELICOPTERS :{WHITE}Το ελικόπτερο αυτό δεν μπορεί να προσγειωθεί σε αυτό το αεροδρόμιο -STR_ERROR_NO_RAIL_WAYPOINT :{WHITE}Δεν υπάρχει σιδηροδρομικό σημείο +STR_ERROR_NO_RAIL_WAYPOINT :{WHITE}Δεν υπάρχει σημείο καθοδήγησης σιδηροδρόμου STR_ERROR_NO_BUOY :{WHITE}Δεν υπάρχει σημαδούρα # Timetable related errors @@ -5928,10 +5931,10 @@ STR_TOWN_NAME :{TOWN} STR_VEHICLE_NAME :{VEHICLE} STR_WAYPOINT_NAME :{WAYPOINT} -STR_CURRENCY_SHORT_KILO :{NBSP}k -STR_CURRENCY_SHORT_MEGA :{NBSP}m -STR_CURRENCY_SHORT_GIGA :{NBSP}Δις -STR_CURRENCY_SHORT_TERA :{NBSP}tn +STR_CURRENCY_SHORT_KILO :{NBSP}χιλ. +STR_CURRENCY_SHORT_MEGA :{NBSP}εκ. +STR_CURRENCY_SHORT_GIGA :{NBSP}δισ. +STR_CURRENCY_SHORT_TERA :{NBSP}τρισ. STR_JUST_CARGO :{CARGO_LONG} STR_JUST_RIGHT_ARROW :{RIGHT_ARROW} diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index 4f9e608597..a1577817f6 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -2162,7 +2162,7 @@ STR_CONFIG_ERROR_INVALID_GRF_UNKNOWN :未知 STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_LEVEL :{WHITE}... 压缩等级 '{STRING}' 无效 STR_CONFIG_ERROR_INVALID_SAVEGAME_COMPRESSION_ALGORITHM :{WHITE}...存档格式 '{STRING}' 不适用. 请转换成 '{STRING}' STR_CONFIG_ERROR_INVALID_BASE_GRAPHICS_NOT_FOUND :{WHITE}... 禁用基础图形设置 '{STRING}': 未找到 -STR_CONFIG_ERROR_INVALID_BASE_SOUNDS_NOT_FOUND :{WHITE}... 禁用基础意义设置 '{STRING}': 未找到 +STR_CONFIG_ERROR_INVALID_BASE_SOUNDS_NOT_FOUND :{WHITE}……禁用基础音效设置 '{STRING}': 未找到 STR_CONFIG_ERROR_INVALID_BASE_MUSIC_NOT_FOUND :{WHITE}... 禁用基础音乐设置 '{STRING}': 未找到 STR_CONFIG_ERROR_OUT_OF_MEMORY :{WHITE}内存溢出 STR_CONFIG_ERROR_SPRITECACHE_TOO_BIG :{WHITE}无法分配 {BYTES} 的 Sprite 缓存。Sprite 缓存的大小已降至 {BYTES}。OpenTTD 的性能将受到影响。请尝试停用 32bpp 图形及/或减少放大倍数,以降低内存需求 From 1424a184d8eff1ae78bd5c299386d6bac3e8640b Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 1 May 2024 18:23:27 +0100 Subject: [PATCH 13/30] Codechange: Use vector/span when loading wagon overrides. (#12604) Replaces manual memory allocation and passing pointer with size. --- src/newgrf.cpp | 18 +++++++----------- src/newgrf_engine.cpp | 4 ++-- src/newgrf_engine.h | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 0b8628f370..2444e82121 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -5611,8 +5611,7 @@ static bool IsValidGroupID(uint16_t groupid, const char *function) static void VehicleMapSpriteGroup(ByteReader *buf, uint8_t feature, uint8_t idcount) { - static EngineID *last_engines; - static uint last_engines_count; + static std::vector last_engines; // Engine IDs are remembered in case the next action is a wagon override. bool wagover = false; /* Test for 'wagon override' flag */ @@ -5621,21 +5620,18 @@ static void VehicleMapSpriteGroup(ByteReader *buf, uint8_t feature, uint8_t idco /* Strip off the flag */ idcount = GB(idcount, 0, 7); - if (last_engines_count == 0) { + if (last_engines.empty()) { GrfMsg(0, "VehicleMapSpriteGroup: WagonOverride: No engine to do override with"); return; } - GrfMsg(6, "VehicleMapSpriteGroup: WagonOverride: {} engines, {} wagons", - last_engines_count, idcount); + GrfMsg(6, "VehicleMapSpriteGroup: WagonOverride: {} engines, {} wagons", last_engines.size(), idcount); } else { - if (last_engines_count != idcount) { - last_engines = ReallocT(last_engines, idcount); - last_engines_count = idcount; - } + last_engines.resize(idcount); } std::vector engines; + engines.reserve(idcount); for (uint i = 0; i < idcount; i++) { Engine *e = GetNewEngine(_cur.grffile, (VehicleType)feature, buf->ReadExtendedByte()); if (e == nullptr) { @@ -5667,7 +5663,7 @@ static void VehicleMapSpriteGroup(ByteReader *buf, uint8_t feature, uint8_t idco GrfMsg(7, "VehicleMapSpriteGroup: [{}] Engine {}...", i, engine); if (wagover) { - SetWagonOverrideSprites(engine, cid, _cur.spritegroups[groupid], last_engines, last_engines_count); + SetWagonOverrideSprites(engine, cid, _cur.spritegroups[groupid], last_engines); } else { SetCustomEngineSprites(engine, cid, _cur.spritegroups[groupid]); } @@ -5683,7 +5679,7 @@ static void VehicleMapSpriteGroup(ByteReader *buf, uint8_t feature, uint8_t idco EngineID engine = engines[i]; if (wagover) { - SetWagonOverrideSprites(engine, SpriteGroupCargo::SG_DEFAULT, _cur.spritegroups[groupid], last_engines, last_engines_count); + SetWagonOverrideSprites(engine, SpriteGroupCargo::SG_DEFAULT, _cur.spritegroups[groupid], last_engines); } else { SetCustomEngineSprites(engine, SpriteGroupCargo::SG_DEFAULT, _cur.spritegroups[groupid]); SetEngineGRF(engine, _cur.grffile); diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 0b7e6e08e7..4a5abcdce0 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -27,7 +27,7 @@ #include "safeguards.h" -void SetWagonOverrideSprites(EngineID engine, CargoID cargo, const SpriteGroup *group, EngineID *train_id, uint trains) +void SetWagonOverrideSprites(EngineID engine, CargoID cargo, const SpriteGroup *group, std::span engine_ids) { Engine *e = Engine::Get(engine); @@ -36,7 +36,7 @@ void SetWagonOverrideSprites(EngineID engine, CargoID cargo, const SpriteGroup * WagonOverride *wo = &e->overrides.emplace_back(); wo->group = group; wo->cargo = cargo; - wo->engines.assign(train_id, train_id + trains); + wo->engines.assign(engine_ids.begin(), engine_ids.end()); } const SpriteGroup *GetWagonOverrideSpriteSet(EngineID engine, CargoID cargo, EngineID overriding_engine) diff --git a/src/newgrf_engine.h b/src/newgrf_engine.h index 527942a0a3..a2795a8d2c 100644 --- a/src/newgrf_engine.h +++ b/src/newgrf_engine.h @@ -76,7 +76,7 @@ static const uint VEHICLEINFO_FULL_VEHICLE_WIDTH = 32; struct VehicleSpriteSeq; -void SetWagonOverrideSprites(EngineID engine, CargoID cargo, const struct SpriteGroup *group, EngineID *train_id, uint trains); +void SetWagonOverrideSprites(EngineID engine, CargoID cargo, const struct SpriteGroup *group, std::span engine_ids); const SpriteGroup *GetWagonOverrideSpriteSet(EngineID engine, CargoID cargo, EngineID overriding_engine); void SetCustomEngineSprites(EngineID engine, uint8_t cargo, const struct SpriteGroup *group); From 532ce1a9079d67f8fbbef80507350111ea93bea7 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 1 May 2024 18:55:54 +0100 Subject: [PATCH 14/30] Codechange: Use Recv/Send_bytes for md5sum. (#12602) Use existing functions to handle serialisation of arrays instead of indexed for-loop. --- src/network/core/network_game_info.cpp | 8 ++------ src/network/network_content.cpp | 9 ++------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/network/core/network_game_info.cpp b/src/network/core/network_game_info.cpp index 623be7fa84..becc7d405e 100644 --- a/src/network/core/network_game_info.cpp +++ b/src/network/core/network_game_info.cpp @@ -375,9 +375,7 @@ void DeserializeNetworkGameInfo(Packet &p, NetworkGameInfo &info, const GameInfo void SerializeGRFIdentifier(Packet &p, const GRFIdentifier &grf) { p.Send_uint32(grf.grfid); - for (size_t j = 0; j < grf.md5sum.size(); j++) { - p.Send_uint8(grf.md5sum[j]); - } + p.Send_bytes(grf.md5sum); } /** @@ -388,9 +386,7 @@ void SerializeGRFIdentifier(Packet &p, const GRFIdentifier &grf) void DeserializeGRFIdentifier(Packet &p, GRFIdentifier &grf) { grf.grfid = p.Recv_uint32(); - for (size_t j = 0; j < grf.md5sum.size(); j++) { - grf.md5sum[j] = p.Recv_uint8(); - } + p.Recv_bytes(grf.md5sum); } /** diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 2395180a27..66926d26d8 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -63,9 +63,7 @@ bool ClientNetworkContentSocketHandler::Receive_SERVER_INFO(Packet &p) ci->description = p.Recv_string(NETWORK_CONTENT_DESC_LENGTH, SVS_REPLACE_WITH_QUESTION_MARK | SVS_ALLOW_NEWLINE); ci->unique_id = p.Recv_uint32(); - for (size_t j = 0; j < ci->md5sum.size(); j++) { - ci->md5sum[j] = p.Recv_uint8(); - } + p.Recv_bytes(ci->md5sum); uint dependency_count = p.Recv_uint8(); ci->dependencies.reserve(dependency_count); @@ -276,10 +274,7 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentVector *cv, bo p->Send_uint8((uint8_t)ci->type); p->Send_uint32(ci->unique_id); if (!send_md5sum) continue; - - for (size_t j = 0; j < ci->md5sum.size(); j++) { - p->Send_uint8(ci->md5sum[j]); - } + p->Send_bytes(ci->md5sum); } this->SendPacket(std::move(p)); From 7147fe9e7a347209a030d927f35f302b3b76945f Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 1 May 2024 19:59:46 +0100 Subject: [PATCH 15/30] Codechange: Use range-for when loading NewGRF deterministic sprite groups. (#12605) --- src/newgrf.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 2444e82121..17fbbbbdd3 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -5279,10 +5279,10 @@ static void NewSpriteGroup(ByteReader *buf) std::vector ranges; ranges.resize(buf->ReadByte()); - for (uint i = 0; i < ranges.size(); i++) { - ranges[i].group = GetGroupFromGroupID(setid, type, buf->ReadWord()); - ranges[i].low = buf->ReadVarSize(varsize); - ranges[i].high = buf->ReadVarSize(varsize); + for (auto &range : ranges) { + range.group = GetGroupFromGroupID(setid, type, buf->ReadWord()); + range.low = buf->ReadVarSize(varsize); + range.high = buf->ReadVarSize(varsize); } group->default_group = GetGroupFromGroupID(setid, type, buf->ReadWord()); @@ -5292,20 +5292,19 @@ static void NewSpriteGroup(ByteReader *buf) /* Sort ranges ascending. When ranges overlap, this may required clamping or splitting them */ std::vector bounds; - for (uint i = 0; i < ranges.size(); i++) { - bounds.push_back(ranges[i].low); - if (ranges[i].high != UINT32_MAX) bounds.push_back(ranges[i].high + 1); + for (const auto &range : ranges) { + bounds.push_back(range.low); + if (range.high != UINT32_MAX) bounds.push_back(range.high + 1); } std::sort(bounds.begin(), bounds.end()); bounds.erase(std::unique(bounds.begin(), bounds.end()), bounds.end()); std::vector target; - for (uint j = 0; j < bounds.size(); ++j) { - uint32_t v = bounds[j]; + for (const auto &bound : bounds) { const SpriteGroup *t = group->default_group; - for (uint i = 0; i < ranges.size(); i++) { - if (ranges[i].low <= v && v <= ranges[i].high) { - t = ranges[i].group; + for (const auto &range : ranges) { + if (range.low <= bound && bound <= range.high) { + t = range.group; break; } } From f1466801217647b2a089d0d9ceed64a5da4b437e Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 1 May 2024 20:55:00 +0100 Subject: [PATCH 16/30] Codechange: Use vector for industry random sounds. (#12606) Use a vector to store the list of random sounds played for an industry. The removes manual memory allocation, flags to control memory management, a separate count member, and a try/catch block. --- src/industry_cmd.cpp | 11 +---- src/industrytype.h | 10 +---- src/newgrf.cpp | 20 +++------ src/table/build_industry.h | 86 +++++++++++++++++++------------------- 4 files changed, 52 insertions(+), 75 deletions(-) diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index d46ebe3d6f..8596b6e658 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1166,11 +1166,11 @@ static void ProduceIndustryGoods(Industry *i) /* play a sound? */ if ((i->counter & 0x3F) == 0) { uint32_t r; - if (Chance16R(1, 14, r) && indsp->number_of_sounds != 0 && _settings_client.sound.ambient) { + if (Chance16R(1, 14, r) && !indsp->random_sounds.empty() && _settings_client.sound.ambient) { if (std::any_of(std::begin(i->produced), std::end(i->produced), [](const auto &p) { return p.history[LAST_MONTH].production > 0; })) { /* Play sound since last month had production */ SndPlayTileFx( - (SoundFx)(indsp->random_sounds[((r >> 16) * indsp->number_of_sounds) >> 16]), + static_cast(indsp->random_sounds[((r >> 16) * indsp->random_sounds.size()) >> 16]), i->location.tile); } } @@ -3170,13 +3170,6 @@ bool IndustrySpec::UsesOriginalEconomy() const HasBit(this->callback_mask, CBM_IND_MONTHLYPROD_CHANGE) || HasBit(this->callback_mask, CBM_IND_PRODUCTION_CHANGE) || HasBit(this->callback_mask, CBM_IND_PROD_CHANGE_BUILD); // production change callbacks } -IndustrySpec::~IndustrySpec() -{ - if (HasBit(this->cleanup_flag, CLEAN_RANDOMSOUNDS)) { - free(this->random_sounds); - } -} - static CommandCost TerraformTile_Industry(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new) { if (AutoslopeEnabled()) { diff --git a/src/industrytype.h b/src/industrytype.h index 74b656cb81..b299851c10 100644 --- a/src/industrytype.h +++ b/src/industrytype.h @@ -18,10 +18,6 @@ #include "newgrf_animation_type.h" #include "newgrf_commons.h" -enum IndustryCleanupType { - CLEAN_RANDOMSOUNDS, ///< Free the dynamically allocated sounds table -}; - /** Available types of industry lifetimes. */ enum IndustryLifeType { INDUSTRYLIFE_BLACK_HOLE = 0, ///< Like power plants and banks @@ -132,21 +128,17 @@ struct IndustrySpec { StringID station_name; ///< Default name for nearby station uint8_t appear_ingame[NUM_LANDSCAPE]; ///< Probability of appearance in game uint8_t appear_creation[NUM_LANDSCAPE]; ///< Probability of appearance during map creation - uint8_t number_of_sounds; ///< Number of sounds available in the sounds array - const uint8_t *random_sounds; ///< array of random sounds. /* Newgrf data */ uint16_t callback_mask; ///< Bitmask of industry callbacks that have to be called - uint8_t cleanup_flag; ///< flags indicating which data should be freed upon cleaning up bool enabled; ///< entity still available (by default true).newgrf can disable it, though GRFFileProps grf_prop; ///< properties related to the grf file + std::vector random_sounds; ///< Random sounds; bool IsRawIndustry() const; bool IsProcessingIndustry() const; Money GetConstructionCost() const; Money GetRemovalCost() const; bool UsesOriginalEconomy() const; - - ~IndustrySpec(); }; /** diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 17fbbbbdd3..5d9cf6fa57 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3705,23 +3705,15 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop, break; case 0x15: { // Random sound effects - indsp->number_of_sounds = buf->ReadByte(); - uint8_t *sounds = MallocT(indsp->number_of_sounds); + uint8_t num_sounds = buf->ReadByte(); - try { - for (uint8_t j = 0; j < indsp->number_of_sounds; j++) { - sounds[j] = buf->ReadByte(); - } - } catch (...) { - free(sounds); - throw; + std::vector sounds; + sounds.reserve(num_sounds); + for (uint8_t j = 0; j < num_sounds; ++j) { + sounds.push_back(buf->ReadByte()); } - if (HasBit(indsp->cleanup_flag, CLEAN_RANDOMSOUNDS)) { - free(indsp->random_sounds); - } - indsp->random_sounds = sounds; - SetBit(indsp->cleanup_flag, CLEAN_RANDOMSOUNDS); + indsp->random_sounds = std::move(sounds); break; } diff --git a/src/table/build_industry.h b/src/table/build_industry.h index 72abeb5db0..116d3bad3f 100644 --- a/src/table/build_industry.h +++ b/src/table/build_industry.h @@ -1032,16 +1032,16 @@ static const std::vector _tile_table_sugar_mine { #undef MK /** Array with saw sound, for sawmill */ -static const uint8_t _sawmill_sounds[] = { SND_28_SAWMILL }; +static const std::initializer_list _sawmill_sounds = { SND_28_SAWMILL }; /** Array with whistle sound, for factory */ -static const uint8_t _factory_sounds[] = { SND_03_FACTORY }; +static const std::initializer_list _factory_sounds = { SND_03_FACTORY }; /** Array with 3 animal sounds, for farms */ -static const uint8_t _farm_sounds[] = { SND_24_FARM_1, SND_25_FARM_2, SND_26_FARM_3 }; +static const std::initializer_list _farm_sounds = { SND_24_FARM_1, SND_25_FARM_2, SND_26_FARM_3 }; /** Array with... hem... a sound of toyland */ -static const uint8_t _plastic_mine_sounds[] = { SND_33_PLASTIC_MINE }; +static const std::initializer_list _plastic_mine_sounds = { SND_33_PLASTIC_MINE }; enum IndustryTypes { IT_COAL_MINE = 0, @@ -1125,7 +1125,7 @@ enum IndustryTypes { * @param s3 text for production down */ -#define MI(tbl, sndc, snd, d, pc, ai1, ai2, ai3, ai4, ag1, ag2, ag3, ag4, col, \ +#define MI(tbl, snd, d, pc, ai1, ai2, ai3, ai4, ag1, ag2, ag3, ag4, col, \ c1, c2, c3, proc, p1, r1, p2, r2, m, a1, im1, a2, im2, a3, im3, pr, clim, bev, in, intx, s1, s2, s3) \ {tbl, d, 0, pc, {c1, c2, c3}, proc, \ {INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO, INVALID_CARGO}, \ @@ -1135,7 +1135,7 @@ enum IndustryTypes { {a1, a2, a3, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID, CT_INVALID}, \ {{im1, 0}, {im2, 0}, {im3, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, \ pr, clim, bev, col, in, intx, s1, s2, s3, STR_UNDEFINED, {ai1, ai2, ai3, ai4}, {ag1, ag2, ag3, ag4}, \ - sndc, snd, 0, 0, true, GRFFileProps(INVALID_INDUSTRYTYPE)} + 0, true, GRFFileProps(INVALID_INDUSTRYTYPE), snd} /* Format: tile table count and sounds table cost multiplier appear chances(4ingame, 4random) map colour @@ -1147,7 +1147,7 @@ enum IndustryTypes { industry name building text messages : Closure production up production down */ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { - MI(_tile_table_coal_mine, 0, nullptr, + MI(_tile_table_coal_mine, {}, 210, 0xB3333333, 2, 3, 0, 0, 8, 8, 0, 0, 1, IT_POWER_STATION, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_COAL, 15, CT_INVALID, 0, 5, @@ -1157,7 +1157,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_COAL_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_COAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_power_station, 0, nullptr, + MI(_tile_table_power_station, {}, 240, 0xFFFFFFFF, 2, 2, 0, 0, 5, 5, 0, 0, 184, IT_COAL_MINE, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_INVALID, 0, CT_INVALID, 0, 5, @@ -1167,7 +1167,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_POWER_STATION, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_sawmill, 1, _sawmill_sounds, + MI(_tile_table_sawmill, _sawmill_sounds, 224, 0xFFFFFFFF, 2, 0, 0, 0, 5, 0, 0, 0, 194, IT_FOREST, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_GOODS, 0, CT_INVALID, 0, 5, @@ -1177,7 +1177,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_SAWMILL, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_forest, 0, nullptr, + MI(_tile_table_forest, {}, 200, 0xBFFFFFFF, 3, 4, 0, 0, 5, 5, 0, 0, 86, IT_SAWMILL, IT_PAPER_MILL, IT_INVALID, CHECK_FOREST, CT_WOOD, 13, CT_INVALID, 0, 30, @@ -1187,7 +1187,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_FOREST, STR_NEWS_INDUSTRY_PLANTED, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), - MI(_tile_table_oil_refinery, 0, nullptr, + MI(_tile_table_oil_refinery, {}, 244, 0xFFFFFFFF, 2, 2, 2, 0, 4, 4, 4, 0, 191, IT_OIL_RIG, IT_INVALID, IT_INVALID, CHECK_REFINERY, CT_GOODS, 0, CT_INVALID, 0, 5, @@ -1197,7 +1197,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_OIL_REFINERY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_oil_rig, 0, nullptr, + MI(_tile_table_oil_rig, {}, 240, 0x99999999, 6, 0, 0, 0, 0, 0, 0, 0, 152, IT_OIL_REFINERY, IT_INVALID, IT_INVALID, CHECK_OIL_RIG, CT_OIL, 15, CT_PASSENGERS, 2, 5, @@ -1207,7 +1207,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_OIL_RIG, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_OIL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_factory, 1, _factory_sounds, + MI(_tile_table_factory, _factory_sounds, 208, 0xFFFFFFFF, 2, 0, 0, 0, 5, 0, 0, 0, 174, IT_FARM, IT_STEEL_MILL, IT_INVALID, CHECK_NOTHING, CT_GOODS, 0, CT_INVALID, 0, 5, @@ -1217,7 +1217,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_printing_works, 1, _factory_sounds, + MI(_tile_table_printing_works, _factory_sounds, 208, 0xFFFFFFFF, 0, 2, 0, 0, 0, 5, 0, 0, 174, IT_PAPER_MILL, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_GOODS, 0, CT_INVALID, 0, 5, @@ -1227,7 +1227,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_PRINTING_WORKS, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_steel_mill, 0, nullptr, + MI(_tile_table_steel_mill, {}, 215, 0xFFFFFFFF, 2, 0, 0, 0, 5, 0, 0, 0, 10, IT_IRON_MINE, IT_FACTORY, IT_INVALID, CHECK_NOTHING, CT_STEEL, 0, CT_INVALID, 0, 5, @@ -1237,7 +1237,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_STEEL_MILL, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_farm, 3, _farm_sounds, + MI(_tile_table_farm, _farm_sounds, 250, 0xD9999999, 2, 4, 0, 0, 9, 9, 0, 0, 48, IT_FACTORY, IT_FOOD_PROCESS, IT_INVALID, CHECK_FARM, MCT_GRAIN_WHEAT_MAIZE, 10, MCT_LIVESTOCK_FRUIT, 10, 5, @@ -1247,7 +1247,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_FARM, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), - MI(_tile_table_copper_mine, 0, nullptr, + MI(_tile_table_copper_mine, {}, 205, 0xB3333333, 0, 0, 3, 0, 0, 0, 4, 0, 10, IT_FACTORY_2, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_COPPER_ORE, 10, CT_INVALID, 0, 5, @@ -1257,7 +1257,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_COPPER_ORE_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_oil_well, 0, nullptr, + MI(_tile_table_oil_well, {}, 220, 0x99999999, 0, 5, 3, 0, 4, 5, 5, 0, 152, IT_OIL_REFINERY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_OIL, 12, CT_INVALID, 0, 5, @@ -1267,7 +1267,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_OIL_WELLS, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_OIL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_bank, 0, nullptr, + MI(_tile_table_bank, {}, 255, 0xA6666666, 7, 0, 0, 0, 0, 0, 0, 0, 15, IT_BANK_TEMP, IT_INVALID, IT_INVALID, CHECK_NOTHING, MCT_VALUABLES_GOLD_DIAMONDS, 6, CT_INVALID, 0, 5, @@ -1277,7 +1277,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_BANK, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_food_process, 0, nullptr, + MI(_tile_table_food_process, {}, 206, 0xFFFFFFFF, 0, 2, 2, 0, 0, 3, 4, 0, 55, IT_FRUIT_PLANTATION, IT_FARM, IT_FARM_2, CHECK_NOTHING, CT_FOOD, 0, CT_INVALID, 0, 5, @@ -1287,7 +1287,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_FOOD_PROCESSING_PLANT, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_paper_mill, 1, _sawmill_sounds, + MI(_tile_table_paper_mill, _sawmill_sounds, 227, 0xFFFFFFFF, 0, 2, 0, 0, 0, 5, 0, 0, 10, IT_FOREST, IT_PRINTING_WORKS, IT_INVALID, CHECK_NOTHING, CT_PAPER, 0, CT_INVALID, 0, 5, @@ -1297,7 +1297,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_PAPER_MILL, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_gold_mine, 0, nullptr, + MI(_tile_table_gold_mine, {}, 208, 0x99999999, 0, 3, 0, 0, 0, 4, 0, 0, 194, IT_BANK_TROPIC_ARCTIC, IT_INVALID, IT_INVALID, CHECK_NOTHING, MCT_VALUABLES_GOLD_DIAMONDS, 7, CT_INVALID, 0, 5, @@ -1307,7 +1307,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_GOLD_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_bank2, 0, nullptr, + MI(_tile_table_bank2, {}, 151, 0xA6666666, 0, 3, 3, 0, 0, 6, 5, 0, 15, IT_GOLD_MINE, IT_DIAMOND_MINE, IT_INVALID, CHECK_NOTHING, CT_INVALID, 0, CT_INVALID, 0, 5, @@ -1317,7 +1317,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_BANK_TROPIC_ARCTIC, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_diamond_mine, 0, nullptr, + MI(_tile_table_diamond_mine, {}, 213, 0x99999999, 0, 0, 3, 0, 0, 0, 4, 0, 184, IT_BANK_TROPIC_ARCTIC, IT_INVALID, IT_INVALID, CHECK_NOTHING, MCT_VALUABLES_GOLD_DIAMONDS, 7, CT_INVALID, 0, 5, @@ -1327,7 +1327,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_DIAMOND_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_iron_mine, 0, nullptr, + MI(_tile_table_iron_mine, {}, 220, 0xB3333333, 2, 0, 0, 0, 5, 0, 0, 0, 55, IT_STEEL_MILL, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_IRON_ORE, 10, CT_INVALID, 0, 5, @@ -1337,7 +1337,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_IRON_ORE_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_fruit_plantation, 0, nullptr, + MI(_tile_table_fruit_plantation, {}, 225, 0xBFFFFFFF, 0, 0, 2, 0, 0, 0, 4, 0, 86, IT_FOOD_PROCESS, IT_INVALID, IT_INVALID, CHECK_PLANTATION, MCT_LIVESTOCK_FRUIT, 10, CT_INVALID, 0, 15, @@ -1347,7 +1347,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_FRUIT_PLANTATION, STR_NEWS_INDUSTRY_PLANTED, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), - MI(_tile_table_rubber_plantation, 0, nullptr, + MI(_tile_table_rubber_plantation, {}, 218, 0xBFFFFFFF, 0, 0, 3, 0, 0, 0, 4, 0, 39, IT_FACTORY_2, IT_INVALID, IT_INVALID, CHECK_PLANTATION, CT_RUBBER, 10, CT_INVALID, 0, 15, @@ -1357,7 +1357,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_RUBBER_PLANTATION, STR_NEWS_INDUSTRY_PLANTED, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), - MI(_tile_table_water_supply, 0, nullptr, + MI(_tile_table_water_supply, {}, 199, 0xB3333333, 0, 0, 3, 0, 0, 0, 4, 0, 37, IT_WATER_TOWER, IT_INVALID, IT_INVALID, CHECK_WATER, CT_WATER, 12, CT_INVALID, 0, 5, @@ -1367,7 +1367,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_WATER_SUPPLY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_water_tower, 0, nullptr, + MI(_tile_table_water_tower, {}, 115, 0xFFFFFFFF, 0, 0, 4, 0, 0, 0, 8, 0, 208, IT_WATER_SUPPLY, IT_INVALID, IT_INVALID, CHECK_WATER, CT_INVALID, 0, CT_INVALID, 0, 5, @@ -1377,7 +1377,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_WATER_TOWER, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_factory2, 1, _factory_sounds, + MI(_tile_table_factory2, _factory_sounds, 208, 0xFFFFFFFF, 0, 0, 2, 0, 0, 0, 4, 0, 174, IT_RUBBER_PLANTATION, IT_COPPER_MINE, IT_LUMBER_MILL, CHECK_PLANTATION, CT_GOODS, 0, CT_INVALID, 0, 5, @@ -1387,7 +1387,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_FACTORY_2, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_farm2, 0, nullptr, + MI(_tile_table_farm2, {}, 250, 0xD9999999, 0, 0, 1, 0, 0, 0, 2, 0, 48, IT_FOOD_PROCESS, IT_INVALID, IT_INVALID, CHECK_PLANTATION, MCT_GRAIN_WHEAT_MAIZE, 11, CT_INVALID, 0, 5, @@ -1397,7 +1397,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_FARM_2, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), - MI(_tile_table_lumber_mill, 0, nullptr, + MI(_tile_table_lumber_mill, {}, 135, 0xFFFFFFFF, 0, 0, 0, 0, 0, 0, 0, 0, 194, IT_FACTORY_2, IT_INVALID, IT_INVALID, CHECK_LUMBERMILL, CT_WOOD, 0, CT_INVALID, 0, 5, @@ -1407,7 +1407,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_LUMBER_MILL, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_LACK_OF_TREES, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_cotton_candy, 0, nullptr, + MI(_tile_table_cotton_candy, {}, 195, 0xBFFFFFFF, 0, 0, 0, 3, 0, 0, 0, 5, 48, IT_CANDY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_COTTON_CANDY, 13, CT_INVALID, 0, 30, @@ -1417,7 +1417,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_COTTON_CANDY_FOREST, STR_NEWS_INDUSTRY_PLANTED, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_candy_factory, 0, nullptr, + MI(_tile_table_candy_factory, {}, 206, 0xFFFFFFFF, 0, 0, 0, 3, 0, 0, 0, 5, 174, IT_COTTON_CANDY, IT_TOFFEE_QUARRY, IT_SUGAR_MINE, CHECK_NOTHING, CT_CANDY, 0, CT_INVALID, 0, 5, @@ -1427,7 +1427,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_CANDY_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_battery_farm, 0, nullptr, + MI(_tile_table_battery_farm, {}, 187, 0xB3333333, 0, 0, 0, 3, 0, 0, 0, 4, 39, IT_TOY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_BATTERIES, 11, CT_INVALID, 0, 30, @@ -1437,7 +1437,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_BATTERY_FARM, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), - MI(_tile_table_cola_wells, 0, nullptr, + MI(_tile_table_cola_wells, {}, 193, 0x99999999, 0, 0, 0, 3, 0, 0, 0, 5, 55, IT_FIZZY_DRINK_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_COLA, 12, CT_INVALID, 0, 5, @@ -1447,7 +1447,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_COLA_WELLS, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_toy_shop, 0, nullptr, + MI(_tile_table_toy_shop, {}, 133, 0xFFFFFFFF, 0, 0, 0, 3, 0, 0, 0, 4, 208, IT_TOY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_INVALID, 0, CT_INVALID, 0, 5, @@ -1457,7 +1457,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_TOY_SHOP, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_toy_factory, 0, nullptr, + MI(_tile_table_toy_factory, {}, 163, 0xFFFFFFFF, 0, 0, 0, 3, 0, 0, 0, 5, 10, IT_PLASTIC_FOUNTAINS, IT_BATTERY_FARM, IT_TOY_SHOP, CHECK_NOTHING, CT_TOYS, 0, CT_INVALID, 0, 5, @@ -1467,7 +1467,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_TOY_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_plastic_fountain, 1, _plastic_mine_sounds, + MI(_tile_table_plastic_fountain, _plastic_mine_sounds, 192, 0xA6666666, 0, 0, 0, 3, 0, 0, 0, 5, 37, IT_TOY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_PLASTIC, 14, CT_INVALID, 0, 5, @@ -1477,7 +1477,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_PLASTIC_FOUNTAINS, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_fizzy_drink, 0, nullptr, + MI(_tile_table_fizzy_drink, {}, 177, 0xFFFFFFFF, 0, 0, 0, 3, 0, 0, 0, 4, 184, IT_COLA_WELLS, IT_BUBBLE_GENERATOR, IT_INVALID, CHECK_NOTHING, CT_FIZZY_DRINKS, 0, CT_INVALID, 0, 5, @@ -1487,7 +1487,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_FIZZY_DRINK_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_bubble_generator, 0, nullptr, + MI(_tile_table_bubble_generator, {}, 203, 0xB3333333, 0, 0, 0, 3, 0, 0, 0, 5, 152, IT_FIZZY_DRINK_FACTORY, IT_INVALID, IT_INVALID, CHECK_BUBBLEGEN, CT_BUBBLES, 13, CT_INVALID, 0, 5, @@ -1497,7 +1497,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_BUBBLE_GENERATOR, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_toffee_quarry, 0, nullptr, + MI(_tile_table_toffee_quarry, {}, 213, 0xCCCCCCCC, 0, 0, 0, 3, 0, 0, 0, 5, 194, IT_CANDY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_TOFFEE, 10, CT_INVALID, 0, 5, @@ -1507,7 +1507,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { STR_INDUSTRY_NAME_TOFFEE_QUARRY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), - MI(_tile_table_sugar_mine, 0, nullptr, + MI(_tile_table_sugar_mine, {}, 210, 0xBFFFFFFF, 0, 0, 0, 2, 0, 0, 0, 4, 15, IT_CANDY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_SUGAR, 11, CT_INVALID, 0, 5, From 9647fe1d05866c0e868ee7ad94497f75acd98832 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 20 Apr 2024 13:53:42 +0100 Subject: [PATCH 17/30] Change: [Linkgraph] Improve distance scaling algorithm in demand scaler Improve scaling at values other than 0% and 100% Fix erratic scaling and increase effect size at large setting values --- src/linkgraph/demands.cpp | 36 +++++++++++++++++++++++------------- src/linkgraph/demands.h | 6 +++--- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/linkgraph/demands.cpp b/src/linkgraph/demands.cpp index b164f46ae6..851d82f82a 100644 --- a/src/linkgraph/demands.cpp +++ b/src/linkgraph/demands.cpp @@ -2,6 +2,7 @@ #include "../stdafx.h" #include "demands.h" +#include "../core/math_func.hpp" #include #include "../safeguards.h" @@ -207,23 +208,26 @@ void DemandCalculator::CalcDemand(LinkGraphJob &job, Tscaler scaler) int32_t supply = scaler.EffectiveSupply(job[from_id], job[to_id]); assert(supply > 0); - /* Scale the distance by mod_dist around max_distance */ - int32_t distance = this->max_distance - (this->max_distance - - (int32_t)DistanceMaxPlusManhattan(job[from_id].base.xy, job[to_id].base.xy)) * - this->mod_dist / 100; + constexpr int32_t divisor_scale = 16; + + int32_t scaled_distance = this->base_distance; + if (this->mod_dist > 0) { + const int32_t distance = DistanceMaxPlusManhattan(job[from_id].base.xy, job[to_id].base.xy); + /* Scale distance around base_distance by (mod_dist * (100 / 1024)). + * mod_dist may be > 1024, so clamp result to be non-negative */ + scaled_distance = std::max(0, this->base_distance + (((distance - this->base_distance) * this->mod_dist) / 1024)); + } /* Scale the accuracy by distance around accuracy / 2 */ - int32_t divisor = this->accuracy * (this->mod_dist - 50) / 100 + - this->accuracy * distance / this->max_distance + 1; - - assert(divisor > 0); + const int32_t divisor = divisor_scale + ((this->accuracy * scaled_distance * divisor_scale) / (this->base_distance * 2)); + assert(divisor >= divisor_scale); uint demand_forw = 0; - if (divisor <= supply) { + if (divisor <= (supply * divisor_scale)) { /* At first only distribute demand if * effective supply / accuracy divisor >= 1 * Others are too small or too far away to be considered. */ - demand_forw = supply / divisor; + demand_forw = (supply * divisor_scale) / divisor; } else if (++chance > this->accuracy * num_demands * num_supplies) { /* After some trying, if there is still supply left, distribute * demand also to other nodes. */ @@ -256,7 +260,7 @@ void DemandCalculator::CalcDemand(LinkGraphJob &job, Tscaler scaler) * @param job Job to calculate the demands for. */ DemandCalculator::DemandCalculator(LinkGraphJob &job) : - max_distance(DistanceMaxPlusManhattan(TileXY(0,0), TileXY(Map::MaxX(), Map::MaxY()))) + base_distance(IntSqrt(DistanceMaxPlusManhattan(TileXY(0,0), TileXY(Map::MaxX(), Map::MaxY())))) { const LinkGraphSettings &settings = job.Settings(); CargoID cargo = job.Cargo(); @@ -264,9 +268,15 @@ DemandCalculator::DemandCalculator(LinkGraphJob &job) : this->accuracy = settings.accuracy; this->mod_dist = settings.demand_distance; if (this->mod_dist > 100) { - /* Increase effect of mod_dist > 100 */ + /* Increase effect of mod_dist > 100. + * Quadratic: + * 100 --> 100 + * 150 --> 308 + * 200 --> 933 + * 255 --> 2102 + */ int over100 = this->mod_dist - 100; - this->mod_dist = 100 + over100 * over100; + this->mod_dist = 100 + ((over100 * over100) / 12); } switch (settings.GetDistributionType(cargo)) { diff --git a/src/linkgraph/demands.h b/src/linkgraph/demands.h index 7de853a674..52dd5cb097 100644 --- a/src/linkgraph/demands.h +++ b/src/linkgraph/demands.h @@ -14,9 +14,9 @@ public: DemandCalculator(LinkGraphJob &job); private: - int32_t max_distance; ///< Maximum distance possible on the map. - int32_t mod_dist; ///< Distance modifier, determines how much demands decrease with distance. - int32_t accuracy; ///< Accuracy of the calculation. + int32_t base_distance; ///< Base distance for scaling purposes. + int32_t mod_dist; ///< Distance modifier, determines how much demands decrease with distance. + int32_t accuracy; ///< Accuracy of the calculation. template void CalcDemand(LinkGraphJob &job, Tscaler scaler); From 2559bdfa6f65e6a44bb1f4fd72ab9c5eb42b09c6 Mon Sep 17 00:00:00 2001 From: Fen <48841404+infinifen@users.noreply.github.com> Date: Wed, 1 May 2024 23:10:01 +0200 Subject: [PATCH 18/30] Fix 2d27e8e: Update numpad keycodes for SDL2, making it usable (#12596) * Fix 2d27e8e: Update numpad keycodes for SDL2, making it usable * Cleanup: List sdl2 numpad mappings individually --- src/video/sdl2_v.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp index 31d7411c44..2fb0654ee5 100644 --- a/src/video/sdl2_v.cpp +++ b/src/video/sdl2_v.cpp @@ -282,7 +282,16 @@ static const SDLVkMapping _vk_mapping[] = { AM_UP(SDLK_F1, SDLK_F12, WKC_F1, WKC_F12), /* Numeric part. */ - AM(SDLK_KP_0, SDLK_KP_9, '0', '9'), + AS(SDLK_KP_1, '1'), + AS(SDLK_KP_2, '2'), + AS(SDLK_KP_3, '3'), + AS(SDLK_KP_4, '4'), + AS(SDLK_KP_5, '5'), + AS(SDLK_KP_6, '6'), + AS(SDLK_KP_7, '7'), + AS(SDLK_KP_8, '8'), + AS(SDLK_KP_9, '9'), + AS(SDLK_KP_0, '0'), AS(SDLK_KP_DIVIDE, WKC_NUM_DIV), AS(SDLK_KP_MULTIPLY, WKC_NUM_MUL), AS(SDLK_KP_MINUS, WKC_NUM_MINUS), From 65c9df49d9e9843709b517527376b53597159cb3 Mon Sep 17 00:00:00 2001 From: translators Date: Thu, 2 May 2024 04:41:51 +0000 Subject: [PATCH 19/30] Update: Translations from eints chinese (simplified): 8 changes by XiaoJi-Game catalan: 3 changes by J0anJosep --- src/lang/catalan.txt | 3 +++ src/lang/simplified_chinese.txt | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index 8f99fc6e6c..6980aa8e0a 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -1834,6 +1834,9 @@ STR_CONFIG_SETTING_SERVINT_AIRCRAFT_HELPTEXT :Estableix l'int STR_CONFIG_SETTING_SERVINT_SHIPS :Interval per defecte de servei per als vaixells: {STRING} STR_CONFIG_SETTING_SERVINT_SHIPS_HELPTEXT :Estableix l'interval de revisió predeterminat pels vaixells que es comprin, si no hi ha un interval de revisió explícit pel vehicle. ###length 3 +STR_CONFIG_SETTING_SERVINT_VALUE_DAYS :{COMMA}{NBSP}di{P 0 a es} +STR_CONFIG_SETTING_SERVINT_VALUE_MINUTES :{COMMA}{NBSP}minut{P 0 "" s} +STR_CONFIG_SETTING_SERVINT_VALUE_PERCENTAGE :{COMMA}{NBSP}% ###setting-zero-is-special STR_CONFIG_SETTING_SERVINT_DISABLED :Desactivat diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index a1577817f6..fc99513c23 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -3394,8 +3394,11 @@ STR_GENERATION_ABORT_MESSAGE :{YELLOW}确定 STR_GENERATION_PROGRESS :{WHITE}已完成 {NUM}% STR_GENERATION_PROGRESS_NUM :{BLACK}{NUM} / {NUM} STR_GENERATION_WORLD_GENERATION :{BLACK}地图生成 +STR_GENERATION_LANDSCAPE_GENERATION :{BLACK}景观生成 STR_GENERATION_RIVER_GENERATION :{BLACK}生成河流 STR_GENERATION_CLEARING_TILES :{BLACK}生成岩石地貌 +STR_GENERATION_TOWN_GENERATION :{BLACK}城镇生成 +STR_GENERATION_INDUSTRY_GENERATION :{BLACK}工业生成 STR_GENERATION_OBJECT_GENERATION :{BLACK}生成固定设施 STR_GENERATION_TREE_GENERATION :{BLACK}生成树木 STR_GENERATION_SETTINGUP_GAME :{BLACK}设置游戏 @@ -5284,6 +5287,10 @@ STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}请改 STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}暂时沒有可用的载具 STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}在{DATE_SHORT}后开始新游戏,或使用一款能提供早期载具的NewGRF +STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL :{WHITE}没有可用的城镇道路类型 +STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}请改动您的 NewGRF 设置 +STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET :{WHITE}目前没有可用的城镇道路类型 +STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET_EXPLANATION :{WHITE}在 {DATE_SHORT} 后开始新游戏,或使用一款能提供早期城镇可建造的道路类型的NewGRF # Specific vehicle errors STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}不能让列车冒险通过信号... @@ -5835,6 +5842,7 @@ STR_JUST_DATE_ISO :{DATE_ISO} STR_JUST_STRING :{STRING} STR_JUST_STRING1 :{STRING} STR_JUST_STRING2 :{STRING} +STR_JUST_STRING4 :{STRING} STR_JUST_STRING_STRING :{STRING}{STRING} STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} From cf96d49ced540e502cc7d2ccb3e3af7dc7fb2ae3 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 2 May 2024 12:37:54 +0100 Subject: [PATCH 20/30] Codechange: Use vector for airport tile layouts. (#12607) Simplify AirportSpec data by storing layout information together in a vector, instead of separate arrays. This removes manual memory management and separate count members. The default layouts will be copied instead of always referring to the originals. --- src/airport_gui.cpp | 12 +-- src/newgrf.cpp | 161 ++++++++++-------------------- src/newgrf_airport.cpp | 4 +- src/newgrf_airport.h | 12 ++- src/script/api/script_airport.cpp | 6 +- src/station_base.h | 25 ++--- src/station_cmd.cpp | 16 +-- src/table/airport_defaults.h | 70 ++++++------- 8 files changed, 122 insertions(+), 184 deletions(-) diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 2d5378e72f..c592d8c9cf 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -277,7 +277,7 @@ public: const AirportSpec *as = ac->GetSpec(_selected_airport_index); if (as->IsAvailable()) { /* Ensure the airport layout is valid. */ - _selected_airport_layout = Clamp(_selected_airport_layout, 0, as->num_table - 1); + _selected_airport_layout = Clamp(_selected_airport_layout, 0, static_cast(as->layouts.size() - 1)); selectFirstAirport = false; this->UpdateSelectSize(); } @@ -306,7 +306,7 @@ public: StringID string = GetAirportTextCallback(as, _selected_airport_layout, CBID_AIRPORT_LAYOUT_NAME); if (string != STR_UNDEFINED) { SetDParam(0, string); - } else if (as->num_table > 1) { + } else if (as->layouts.size() > 1) { SetDParam(0, STR_STATION_BUILD_AIRPORT_LAYOUT_NAME); SetDParam(1, _selected_airport_layout + 1); } @@ -348,7 +348,7 @@ public: for (int i = 0; i < NUM_AIRPORTS; i++) { const AirportSpec *as = AirportSpec::Get(i); if (!as->enabled) continue; - for (uint8_t layout = 0; layout < as->num_table; layout++) { + for (uint8_t layout = 0; layout < static_cast(as->layouts.size()); layout++) { SpriteID sprite = GetCustomAirportSprite(as, layout); if (sprite != 0) { Dimension d = GetSpriteSize(sprite); @@ -364,7 +364,7 @@ public: for (int i = NEW_AIRPORT_OFFSET; i < NUM_AIRPORTS; i++) { const AirportSpec *as = AirportSpec::Get(i); if (!as->enabled) continue; - for (uint8_t layout = 0; layout < as->num_table; layout++) { + for (uint8_t layout = 0; layout < static_cast(as->layouts.size()); layout++) { StringID string = GetAirportTextCallback(as, layout, CBID_AIRPORT_ADDITIONAL_TEXT); if (string == STR_UNDEFINED) continue; @@ -474,14 +474,14 @@ public: const AirportSpec *as = AirportClass::Get(_selected_airport_class)->GetSpec(_selected_airport_index); int w = as->size_x; int h = as->size_y; - Direction rotation = as->rotation[_selected_airport_layout]; + Direction rotation = as->layouts[_selected_airport_layout].rotation; if (rotation == DIR_E || rotation == DIR_W) Swap(w, h); SetTileSelectSize(w, h); this->preview_sprite = GetCustomAirportSprite(as, _selected_airport_layout); this->SetWidgetDisabledState(WID_AP_LAYOUT_DECREASE, _selected_airport_layout == 0); - this->SetWidgetDisabledState(WID_AP_LAYOUT_INCREASE, _selected_airport_layout + 1 >= as->num_table); + this->SetWidgetDisabledState(WID_AP_LAYOUT_INCREASE, _selected_airport_layout + 1U >= as->layouts.size()); int rad = _settings_game.station.modified_catchment ? as->catchment : (uint)CA_UNMODIFIED; if (_settings_client.gui.station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad); diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 5d9cf6fa57..479552a880 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3861,32 +3861,6 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop, return ret; } -/** - * Create a copy of the tile table so it can be freed later - * without problems. - * @param as The AirportSpec to copy the arrays of. - */ -static void DuplicateTileTable(AirportSpec *as) -{ - AirportTileTable **table_list = MallocT(as->num_table); - for (int i = 0; i < as->num_table; i++) { - uint num_tiles = 1; - const AirportTileTable *it = as->table[0]; - do { - num_tiles++; - } while ((++it)->ti.x != -0x80); - table_list[i] = MallocT(num_tiles); - MemCpyT(table_list[i], as->table[i], num_tiles); - } - as->table = table_list; - HangarTileTable *depot_table = MallocT(as->nof_depots); - MemCpyT(depot_table, as->depot_table, as->nof_depots); - as->depot_table = depot_table; - Direction *rotation = MallocT(as->num_table); - MemCpyT(rotation, as->rotation, as->num_table); - as->rotation = rotation; -} - /** * Define properties for airports * @param airport Local ID of the airport. @@ -3942,89 +3916,68 @@ static ChangeInfoResult AirportChangeInfo(uint airport, int numinfo, int prop, B as->grf_prop.grffile = _cur.grffile; /* override the default airport */ _airport_mngr.Add(airport + i, _cur.grffile->grfid, subs_id); - /* Create a copy of the original tiletable so it can be freed later. */ - DuplicateTileTable(as); } break; } case 0x0A: { // Set airport layout - uint8_t old_num_table = as->num_table; - free(as->rotation); - as->num_table = buf->ReadByte(); // Number of layaouts - as->rotation = MallocT(as->num_table); - uint32_t defsize = buf->ReadDWord(); // Total size of the definition - AirportTileTable **tile_table = CallocT(as->num_table); // Table with tiles to compose the airport - AirportTileTable *att = CallocT(defsize); // Temporary array to read the tile layouts from the GRF - int size; - const AirportTileTable *copy_from; - try { - for (uint8_t j = 0; j < as->num_table; j++) { - const_cast(as->rotation[j]) = (Direction)buf->ReadByte(); - for (int k = 0;; k++) { - att[k].ti.x = buf->ReadByte(); // Offsets from northermost tile - att[k].ti.y = buf->ReadByte(); + uint8_t num_layouts = buf->ReadByte(); + buf->ReadDWord(); // Total size of definition, unneeded. + uint8_t size_x = 0; + uint8_t size_y = 0; - if (att[k].ti.x == 0 && att[k].ti.y == 0x80) { - /* Not the same terminator. The one we are using is rather - * x = -80, y = 0 . So, adjust it. */ - att[k].ti.x = -0x80; - att[k].ti.y = 0; - att[k].gfx = 0; + std::vector layouts; + layouts.reserve(num_layouts); - size = k + 1; - copy_from = att; - break; - } + for (uint8_t j = 0; j != num_layouts; ++j) { + auto &layout = layouts.emplace_back(); + layout.rotation = static_cast(buf->ReadByte() & 6); // Rotation can only be DIR_NORTH, DIR_EAST, DIR_SOUTH or DIR_WEST. - att[k].gfx = buf->ReadByte(); - - if (att[k].gfx == 0xFE) { - /* Use a new tile from this GRF */ - int local_tile_id = buf->ReadWord(); - - /* Read the ID from the _airporttile_mngr. */ - uint16_t tempid = _airporttile_mngr.GetID(local_tile_id, _cur.grffile->grfid); - - if (tempid == INVALID_AIRPORTTILE) { - GrfMsg(2, "AirportChangeInfo: Attempt to use airport tile {} with airport id {}, not yet defined. Ignoring.", local_tile_id, airport + i); - } else { - /* Declared as been valid, can be used */ - att[k].gfx = tempid; - } - } else if (att[k].gfx == 0xFF) { - att[k].ti.x = (int8_t)GB(att[k].ti.x, 0, 8); - att[k].ti.y = (int8_t)GB(att[k].ti.y, 0, 8); - } - - if (as->rotation[j] == DIR_E || as->rotation[j] == DIR_W) { - as->size_x = std::max(as->size_x, att[k].ti.y + 1); - as->size_y = std::max(as->size_y, att[k].ti.x + 1); - } else { - as->size_x = std::max(as->size_x, att[k].ti.x + 1); - as->size_y = std::max(as->size_y, att[k].ti.y + 1); - } + for (;;) { + auto &tile = layout.tiles.emplace_back(); + tile.ti.x = buf->ReadByte(); + tile.ti.y = buf->ReadByte(); + if (tile.ti.x == 0 && tile.ti.y == 0x80) { + /* Convert terminator to our own. */ + tile.ti.x = -0x80; + tile.ti.y = 0; + tile.gfx = 0; + break; + } + + tile.gfx = buf->ReadByte(); + + if (tile.gfx == 0xFE) { + /* Use a new tile from this GRF */ + int local_tile_id = buf->ReadWord(); + + /* Read the ID from the _airporttile_mngr. */ + uint16_t tempid = _airporttile_mngr.GetID(local_tile_id, _cur.grffile->grfid); + + if (tempid == INVALID_AIRPORTTILE) { + GrfMsg(2, "AirportChangeInfo: Attempt to use airport tile {} with airport id {}, not yet defined. Ignoring.", local_tile_id, airport + i); + } else { + /* Declared as been valid, can be used */ + tile.gfx = tempid; + } + } else if (tile.gfx == 0xFF) { + tile.ti.x = static_cast(GB(tile.ti.x, 0, 8)); + tile.ti.y = static_cast(GB(tile.ti.y, 0, 8)); + } + + /* Determine largest size. */ + if (layout.rotation == DIR_E || layout.rotation == DIR_W) { + size_x = std::max(size_x, tile.ti.y + 1); + size_y = std::max(size_y, tile.ti.x + 1); + } else { + size_x = std::max(size_x, tile.ti.x + 1); + size_y = std::max(size_y, tile.ti.y + 1); } - tile_table[j] = CallocT(size); - memcpy(tile_table[j], copy_from, sizeof(*copy_from) * size); } - /* Free old layouts in the airport spec */ - for (int j = 0; j < old_num_table; j++) { - /* remove the individual layouts */ - free(as->table[j]); - } - free(as->table); - /* Install final layout construction in the airport spec */ - as->table = tile_table; - free(att); - } catch (...) { - for (int i = 0; i < as->num_table; i++) { - free(tile_table[i]); - } - free(tile_table); - free(att); - throw; } + as->layouts = std::move(layouts); + as->size_x = size_x; + as->size_y = size_y; break; } @@ -8726,18 +8679,6 @@ static void ResetCustomHouses() static void ResetCustomAirports() { for (GRFFile * const file : _grf_files) { - for (auto &as : file->airportspec) { - if (as != nullptr) { - /* We need to remove the tiles layouts */ - for (int j = 0; j < as->num_table; j++) { - /* remove the individual layouts */ - free(as->table[j]); - } - free(as->table); - free(as->depot_table); - free(as->rotation); - } - } file->airportspec.clear(); file->airtspec.clear(); } diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp index b50246bbe7..dca77bb3c7 100644 --- a/src/newgrf_airport.cpp +++ b/src/newgrf_airport.cpp @@ -95,11 +95,11 @@ bool AirportSpec::IsAvailable() const */ bool AirportSpec::IsWithinMapBounds(uint8_t table, TileIndex tile) const { - if (table >= this->num_table) return false; + if (table >= this->layouts.size()) return false; uint8_t w = this->size_x; uint8_t h = this->size_y; - if (this->rotation[table] == DIR_E || this->rotation[table] == DIR_W) Swap(w, h); + if (this->layouts[table].rotation == DIR_E || this->layouts[table].rotation == DIR_W) Swap(w, h); return TileX(tile) + w < Map::SizeX() && TileY(tile) + h < Map::SizeY(); diff --git a/src/newgrf_airport.h b/src/newgrf_airport.h index 9fb5348c0a..057ae346fc 100644 --- a/src/newgrf_airport.h +++ b/src/newgrf_airport.h @@ -94,16 +94,18 @@ struct HangarTileTable { uint8_t hangar_num; ///< The hangar to which this tile belongs. }; +struct AirportTileLayout { + std::vector tiles; ///< List of all tiles in this layout. + Direction rotation; ///< The rotation of this layout. +}; + /** * Defines the data structure for an airport. */ struct AirportSpec { const struct AirportFTAClass *fsm; ///< the finite statemachine for the default airports - const AirportTileTable * const *table; ///< list of the tiles composing the airport - const Direction *rotation; ///< the rotation of each tiletable - uint8_t num_table; ///< number of elements in the table - const HangarTileTable *depot_table; ///< gives the position of the depots on the airports - uint8_t nof_depots; ///< the number of hangar tiles in this airport + std::vector layouts; ///< List of layouts composing the airport. + std::span depots; ///< Position of the depots on the airports. uint8_t size_x; ///< size of airport in x direction uint8_t size_y; ///< size of airport in y direction uint8_t noise_level; ///< noise that this airport generates diff --git a/src/script/api/script_airport.cpp b/src/script/api/script_airport.cpp index 39fbee2e60..11817485ce 100644 --- a/src/script/api/script_airport.cpp +++ b/src/script/api/script_airport.cpp @@ -138,7 +138,8 @@ if (_settings_game.economy.station_noise_level) { uint dist; - AirportGetNearestTown(as, as->rotation[0], tile, AirportTileTableIterator(as->table[0], tile), dist); + const auto &layout = as->layouts[0]; + AirportGetNearestTown(as, layout.rotation, tile, AirportTileTableIterator(layout.tiles.data(), tile), dist); return GetAirportNoiseLevelForDistance(as, dist); } @@ -154,7 +155,8 @@ if (!as->IsWithinMapBounds(0, tile)) return INVALID_TOWN; uint dist; - return AirportGetNearestTown(as, as->rotation[0], tile, AirportTileTableIterator(as->table[0], tile), dist)->index; + const auto &layout = as->layouts[0]; + return AirportGetNearestTown(as, layout.rotation, tile, AirportTileTableIterator(layout.tiles.data(), tile), dist)->index; } /* static */ SQInteger ScriptAirport::GetMaintenanceCostFactor(AirportType type) diff --git a/src/station_base.h b/src/station_base.h index 12ed87355a..5b73de95ef 100644 --- a/src/station_base.h +++ b/src/station_base.h @@ -322,7 +322,7 @@ struct Airport : public TileArea { /** Check if this airport has at least one hangar. */ inline bool HasHangar() const { - return this->GetSpec()->nof_depots > 0; + return !this->GetSpec()->depots.empty(); } /** @@ -357,10 +357,9 @@ struct Airport : public TileArea { */ inline TileIndex GetHangarTile(uint hangar_num) const { - const AirportSpec *as = this->GetSpec(); - for (uint i = 0; i < as->nof_depots; i++) { - if (as->depot_table[i].hangar_num == hangar_num) { - return this->GetRotatedTileFromOffset(as->depot_table[i].ti); + for (const auto &depot : this->GetSpec()->depots) { + if (depot.hangar_num == hangar_num) { + return this->GetRotatedTileFromOffset(depot.ti); } } NOT_REACHED(); @@ -376,7 +375,7 @@ struct Airport : public TileArea { { const AirportSpec *as = this->GetSpec(); const HangarTileTable *htt = GetHangarDataByTile(tile); - return ChangeDir(htt->dir, DirDifference(this->rotation, as->rotation[0])); + return ChangeDir(htt->dir, DirDifference(this->rotation, as->layouts[0].rotation)); } /** @@ -396,11 +395,10 @@ struct Airport : public TileArea { { uint num = 0; uint counted = 0; - const AirportSpec *as = this->GetSpec(); - for (uint i = 0; i < as->nof_depots; i++) { - if (!HasBit(counted, as->depot_table[i].hangar_num)) { + for (const auto &depot : this->GetSpec()->depots) { + if (!HasBit(counted, depot.hangar_num)) { num++; - SetBit(counted, as->depot_table[i].hangar_num); + SetBit(counted, depot.hangar_num); } } return num; @@ -415,10 +413,9 @@ private: */ inline const HangarTileTable *GetHangarDataByTile(TileIndex tile) const { - const AirportSpec *as = this->GetSpec(); - for (uint i = 0; i < as->nof_depots; i++) { - if (this->GetRotatedTileFromOffset(as->depot_table[i].ti) == tile) { - return as->depot_table + i; + for (const auto &depot : this->GetSpec()->depots) { + if (this->GetRotatedTileFromOffset(depot.ti) == tile) { + return &depot; } } NOT_REACHED(); diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 615e680723..de949f9a2d 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -98,8 +98,8 @@ bool IsHangar(Tile t) const Station *st = Station::GetByTile(t); const AirportSpec *as = st->airport.GetSpec(); - for (uint i = 0; i < as->nof_depots; i++) { - if (st->airport.GetHangarTile(i) == TileIndex(t)) return true; + for (const auto &depot : as->depots) { + if (st->airport.GetRotatedTileFromOffset(depot.ti) == TileIndex(t)) return true; } return false; @@ -2414,10 +2414,10 @@ CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, uint8_t airport /* Check if a valid, buildable airport was chosen for construction */ const AirportSpec *as = AirportSpec::Get(airport_type); - if (!as->IsAvailable() || layout >= as->num_table) return CMD_ERROR; + if (!as->IsAvailable() || layout >= as->layouts.size()) return CMD_ERROR; if (!as->IsWithinMapBounds(layout, tile)) return CMD_ERROR; - Direction rotation = as->rotation[layout]; + Direction rotation = as->layouts[layout].rotation; int w = as->size_x; int h = as->size_y; if (rotation == DIR_E || rotation == DIR_W) Swap(w, h); @@ -2427,7 +2427,7 @@ CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, uint8_t airport return_cmd_error(STR_ERROR_STATION_TOO_SPREAD_OUT); } - AirportTileTableIterator tile_iter(as->table[layout], tile); + AirportTileTableIterator tile_iter(as->layouts[layout].tiles.data(), tile); CommandCost cost = CheckFlatLandAirport(tile_iter, flags); if (cost.Failed()) return cost; @@ -2477,7 +2477,7 @@ CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, uint8_t airport return_cmd_error(STR_ERROR_TOO_CLOSE_TO_ANOTHER_AIRPORT); } - for (AirportTileTableIterator iter(as->table[layout], tile); iter != INVALID_TILE; ++iter) { + for (AirportTileTableIterator iter(as->layouts[layout].tiles.data(), tile); iter != INVALID_TILE; ++iter) { cost.AddCost(_price[PR_BUILD_STATION_AIRPORT]); } @@ -2493,7 +2493,7 @@ CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, uint8_t airport st->rect.BeforeAddRect(tile, w, h, StationRect::ADD_TRY); - for (AirportTileTableIterator iter(as->table[layout], tile); iter != INVALID_TILE; ++iter) { + for (AirportTileTableIterator iter(as->layouts[layout].tiles.data(), tile); iter != INVALID_TILE; ++iter) { Tile t(iter); MakeAirport(t, st->owner, st->index, iter.GetStationGfx(), WATER_CLASS_INVALID); SetStationTileRandomBits(t, GB(Random(), 0, 4)); @@ -2503,7 +2503,7 @@ CommandCost CmdBuildAirport(DoCommandFlag flags, TileIndex tile, uint8_t airport } /* Only call the animation trigger after all tiles have been built */ - for (AirportTileTableIterator iter(as->table[layout], tile); iter != INVALID_TILE; ++iter) { + for (AirportTileTableIterator iter(as->layouts[layout].tiles.data(), tile); iter != INVALID_TILE; ++iter) { AirportTileAnimationTrigger(st, iter, AAT_BUILT); } diff --git a/src/table/airport_defaults.h b/src/table/airport_defaults.h index 7305779412..d9db0c15b6 100644 --- a/src/table/airport_defaults.h +++ b/src/table/airport_defaults.h @@ -28,7 +28,7 @@ #define MKEND {{-0x80, 0}, 0} /** Tiles for Country Airfield (small) */ -static const AirportTileTable _tile_table_country_0[] = { +static const std::initializer_list _tile_table_country_0 = { MK(0, 0, APT_SMALL_BUILDING_1), MK(1, 0, APT_SMALL_BUILDING_2), MK(2, 0, APT_SMALL_BUILDING_3), @@ -44,12 +44,12 @@ static const AirportTileTable _tile_table_country_0[] = { MKEND }; -static const AirportTileTable * const _tile_table_country[] = { - _tile_table_country_0, +static const std::initializer_list _tile_table_country = { + { _tile_table_country_0, DIR_N }, }; /** Tiles for Commuter Airfield (small) */ -static const AirportTileTable _tile_table_commuter_0[] = { +static const std::initializer_list _tile_table_commuter_0 = { MK(0, 0, APT_TOWER), MK(1, 0, APT_BUILDING_3), MK(2, 0, APT_HELIPAD_2_FENCE_NW), @@ -73,12 +73,12 @@ static const AirportTileTable _tile_table_commuter_0[] = { MKEND }; -static const AirportTileTable * const _tile_table_commuter[] = { - _tile_table_commuter_0, +static const std::initializer_list _tile_table_commuter = { + { _tile_table_commuter_0, DIR_N }, }; /** Tiles for City Airport (large) */ -static const AirportTileTable _tile_table_city_0[] = { +static const std::initializer_list _tile_table_city_0 = { MK(0, 0, APT_BUILDING_1), MK(1, 0, APT_APRON_FENCE_NW), MK(2, 0, APT_STAND_1), @@ -118,12 +118,12 @@ static const AirportTileTable _tile_table_city_0[] = { MKEND }; -static const AirportTileTable * const _tile_table_city[] = { - _tile_table_city_0, +static const std::initializer_list _tile_table_city = { + { _tile_table_city_0, DIR_N }, }; /** Tiles for Metropolitain Airport (large) - 2 runways */ -static const AirportTileTable _tile_table_metropolitan_0[] = { +static const std::initializer_list _tile_table_metropolitan_0 = { MK(0, 0, APT_BUILDING_1), MK(1, 0, APT_APRON_FENCE_NW), MK(2, 0, APT_STAND_1), @@ -163,12 +163,12 @@ static const AirportTileTable _tile_table_metropolitan_0[] = { MKEND }; -static const AirportTileTable * const _tile_table_metropolitan[] = { - _tile_table_metropolitan_0, +static const std::initializer_list _tile_table_metropolitan = { + { _tile_table_metropolitan_0, DIR_N }, }; /** Tiles for International Airport (large) - 2 runways */ -static const AirportTileTable _tile_table_international_0[] = { +static const std::initializer_list _tile_table_international_0 = { MK(0, 0, APT_RUNWAY_END_FENCE_NW), MK(1, 0, APT_RUNWAY_FENCE_NW), MK(2, 0, APT_RUNWAY_FENCE_NW), @@ -221,12 +221,12 @@ static const AirportTileTable _tile_table_international_0[] = { MKEND }; -static const AirportTileTable * const _tile_table_international[] = { - _tile_table_international_0, +static const std::initializer_list _tile_table_international = { + { _tile_table_international_0, DIR_N }, }; /** Tiles for International Airport (large) - 2 runways */ -static const AirportTileTable _tile_table_intercontinental_0[] = { +static const std::initializer_list _tile_table_intercontinental_0 = { MK(0, 0, APT_RADAR_FENCE_NE), MK(1, 0, APT_RUNWAY_END_FENCE_NE_NW), MK(2, 0, APT_RUNWAY_FENCE_NW), @@ -329,22 +329,22 @@ static const AirportTileTable _tile_table_intercontinental_0[] = { MKEND }; -static const AirportTileTable * const _tile_table_intercontinental[] = { - _tile_table_intercontinental_0, +static const std::initializer_list _tile_table_intercontinental = { + { _tile_table_intercontinental_0, DIR_N }, }; /** Tiles for Heliport */ -static const AirportTileTable _tile_table_heliport_0[] = { +static const std::initializer_list _tile_table_heliport_0 = { MK(0, 0, APT_HELIPORT), MKEND }; -static const AirportTileTable * const _tile_table_heliport[] = { - _tile_table_heliport_0, +static const std::initializer_list _tile_table_heliport = { + { _tile_table_heliport_0, DIR_N }, }; /** Tiles for Helidepot */ -static const AirportTileTable _tile_table_helidepot_0[] = { +static const std::initializer_list _tile_table_helidepot_0 = { MK(0, 0, APT_LOW_BUILDING_FENCE_N), MK(1, 0, APT_DEPOT_SE), MK(0, 1, APT_HELIPAD_2_FENCE_NE_SE), @@ -352,12 +352,12 @@ static const AirportTileTable _tile_table_helidepot_0[] = { MKEND }; -static const AirportTileTable * const _tile_table_helidepot[] = { - _tile_table_helidepot_0, +static const std::initializer_list _tile_table_helidepot = { + { _tile_table_helidepot_0, DIR_N }, }; /** Tiles for Helistation */ -static const AirportTileTable _tile_table_helistation_0[] = { +static const std::initializer_list _tile_table_helistation_0 = { MK(0, 0, APT_DEPOT_SE), MK(1, 0, APT_LOW_BUILDING_FENCE_NW), MK(2, 0, APT_HELIPAD_3_FENCE_NW), @@ -369,29 +369,25 @@ static const AirportTileTable _tile_table_helistation_0[] = { MKEND }; -static const AirportTileTable * const _tile_table_helistation[] = { - _tile_table_helistation_0, -}; - -static const Direction _default_airports_rotation[] = { - DIR_N, +static const std::initializer_list _tile_table_helistation = { + { _tile_table_helistation_0, DIR_N }, }; #undef MK #undef MKEND /** General AirportSpec definition. */ -#define AS_GENERIC(fsm, att, rot, att_len, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, enabled) \ - {fsm, att, rot, att_len, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year, name, ttdpatch_type, class_id, preview, maint_cost, enabled, GRFFileProps(AT_INVALID)} +#define AS_GENERIC(fsm, layouts, depots, size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, enabled) \ + {fsm, layouts, depots, size_x, size_y, noise, catchment, min_year, max_year, name, ttdpatch_type, class_id, preview, maint_cost, enabled, GRFFileProps(AT_INVALID)} /** AirportSpec definition for airports without any depot. */ #define AS_ND(ap_name, size_x, size_y, min_year, max_year, catchment, noise, maint_cost, ttdpatch_type, class_id, name, preview) \ - AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, _default_airports_rotation, lengthof(_tile_table_##ap_name), nullptr, 0, \ + AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, {}, \ size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, true) /** AirportSpec definition for airports with at least one depot. */ #define AS(ap_name, size_x, size_y, min_year, max_year, catchment, noise, maint_cost, ttdpatch_type, class_id, name, preview) \ - AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, _default_airports_rotation, lengthof(_tile_table_##ap_name), _airport_depots_##ap_name, lengthof(_airport_depots_##ap_name), \ + AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, _airport_depots_##ap_name, \ size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, true) /* The helidepot and helistation have ATP_TTDP_SMALL because they are at ground level */ @@ -405,12 +401,12 @@ extern const AirportSpec _origin_airport_specs[] = { AS(helidepot, 2, 2, 1976, CalendarTime::MAX_YEAR, 4, 2, 7, ATP_TTDP_SMALL, APC_HELIPORT, STR_AIRPORT_HELIDEPOT, SPR_AIRPORT_PREVIEW_HELIDEPOT), AS(intercontinental, 9, 11, 2002, CalendarTime::MAX_YEAR, 10, 25, 72, ATP_TTDP_LARGE, APC_HUB, STR_AIRPORT_INTERCONTINENTAL, SPR_AIRPORT_PREVIEW_INTERCONTINENTAL), AS(helistation, 4, 2, 1980, CalendarTime::MAX_YEAR, 4, 3, 14, ATP_TTDP_SMALL, APC_HELIPORT, STR_AIRPORT_HELISTATION, SPR_AIRPORT_PREVIEW_HELISTATION), - AS_GENERIC(&_airportfta_oilrig, nullptr, _default_airports_rotation, 0, nullptr, 0, 1, 1, 0, 4, 0, 0, 0, ATP_TTDP_OILRIG, APC_HELIPORT, STR_NULL, 0, false), + AS_GENERIC(&_airportfta_oilrig, {}, {}, 1, 1, 0, 4, 0, 0, 0, ATP_TTDP_OILRIG, APC_HELIPORT, STR_NULL, 0, false), }; static_assert(NEW_AIRPORT_OFFSET == lengthof(_origin_airport_specs)); -const AirportSpec AirportSpec::dummy = AS_GENERIC(&_airportfta_dummy, nullptr, _default_airports_rotation, 0, nullptr, 0, 0, 0, 0, 0, CalendarTime::MIN_YEAR, CalendarTime::MIN_YEAR, 0, ATP_TTDP_LARGE, APC_BEGIN, STR_NULL, 0, false); +const AirportSpec AirportSpec::dummy = AS_GENERIC(&_airportfta_dummy, {}, {}, 0, 0, 0, 0, CalendarTime::MIN_YEAR, CalendarTime::MIN_YEAR, 0, ATP_TTDP_LARGE, APC_BEGIN, STR_NULL, 0, false); #undef AS #undef AS_ND From ef99aa81a3c6386833ed98fe528b2d2fde1193c6 Mon Sep 17 00:00:00 2001 From: Koen Bussemaker Date: Tue, 23 Apr 2024 21:01:48 +0200 Subject: [PATCH 21/30] Codechange: Store validity of water regions in separate vector --- src/pathfinder/water_regions.cpp | 55 +++++++++++++++----------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/src/pathfinder/water_regions.cpp b/src/pathfinder/water_regions.cpp index e34f3ad47e..d9daf3449f 100644 --- a/src/pathfinder/water_regions.cpp +++ b/src/pathfinder/water_regions.cpp @@ -51,7 +51,6 @@ class WaterRegion private: std::array edge_traversability_bits{}; bool has_cross_region_aqueducts = false; - bool initialized = false; TWaterRegionPatchLabel number_of_patches = 0; // 0 = no water, 1 = one single patch of water, etc... const OrthogonalTileArea tile_area; std::unique_ptr tile_patch_labels; ///< Tile patch labels, this may be nullptr in the following trivial cases: region is invalid, region is only land (0 patches), region is only water (1 patch) @@ -76,14 +75,6 @@ public: OrthogonalTileIterator begin() const { return this->tile_area.begin(); } OrthogonalTileIterator end() const { return this->tile_area.end(); } - bool IsInitialized() const { return this->initialized; } - - void Invalidate() - { - if (!IsInitialized()) Debug(map, 3, "Invalidated water region ({},{})", GetWaterRegionX(this->tile_area.tile), GetWaterRegionY(this->tile_area.tile)); - this->initialized = false; - } - /** * Returns a set of bits indicating whether an edge tile on a particular side is traversable or not. These * values can be used to determine whether a ship can enter/leave the region through a particular edge tile. @@ -182,7 +173,6 @@ public: } this->number_of_patches = highest_assigned_label; - this->initialized = true; if (this->number_of_patches == 0 || (this->number_of_patches == 1 && std::all_of(this->tile_patch_labels->begin(), this->tile_patch_labels->end(), [](TWaterRegionPatchLabel label) { return label == 1; }))) { @@ -191,14 +181,6 @@ public: } } - /** - * Updates the patch labels and other data, but only if the region is not yet initialized. - */ - inline void UpdateIfNotInitialized() - { - if (!this->initialized) ForceUpdate(); - } - void PrintDebugInfo() { Debug(map, 9, "Water region {},{} labels and edge traversability = ...", GetWaterRegionX(tile_area.tile), GetWaterRegionY(tile_area.tile)); @@ -228,6 +210,7 @@ public: }; std::vector _water_regions; +std::vector _is_water_region_valid; TileIndex GetTileIndexFromLocalCoordinate(int region_x, int region_y, int local_x, int local_y) { @@ -250,16 +233,18 @@ TileIndex GetEdgeTileCoordinate(int region_x, int region_y, DiagDirection side, WaterRegion &GetUpdatedWaterRegion(uint16_t region_x, uint16_t region_y) { - WaterRegion &result = _water_regions[GetWaterRegionIndex(region_x, region_y)]; - result.UpdateIfNotInitialized(); - return result; + const int index = GetWaterRegionIndex(region_x, region_y); + auto &water_region = _water_regions[index]; + if (!_is_water_region_valid[index]) { + water_region.ForceUpdate(); + _is_water_region_valid[index] = true; + } + return water_region; } WaterRegion &GetUpdatedWaterRegion(TileIndex tile) { - WaterRegion &result = _water_regions[GetWaterRegionIndex(tile)]; - result.UpdateIfNotInitialized(); - return result; + return GetUpdatedWaterRegion(GetWaterRegionX(tile), GetWaterRegionY(tile)); } /** @@ -316,15 +301,21 @@ WaterRegionPatchDesc GetWaterRegionPatchInfo(TileIndex tile) void InvalidateWaterRegion(TileIndex tile) { if (!IsValidTile(tile)) return; - const int water_region_index = GetWaterRegionIndex(tile); - _water_regions[water_region_index].Invalidate(); + + auto invalidate_region = [](TileIndex tile) { + const int water_region_index = GetWaterRegionIndex(tile); + if (!_is_water_region_valid[water_region_index]) Debug(map, 3, "Invalidated water region ({},{})", GetWaterRegionX(tile), GetWaterRegionY(tile)); + _is_water_region_valid[water_region_index] = false; + }; + + invalidate_region(tile); /* When updating the water region we look into the first tile of adjacent water regions to determine edge * traversability. This means that if we invalidate any region edge tiles we might also change the traversability * of the adjacent region. This code ensures the adjacent regions also get invalidated in such a case. */ for (DiagDirection side = DIAGDIR_BEGIN; side < DIAGDIR_END; side++) { - const int adjacent_region_index = GetWaterRegionIndex(TileAddByDiagDir(tile, side)); - if (adjacent_region_index != water_region_index) _water_regions[adjacent_region_index].Invalidate(); + const TileIndex adjacent_tile = TileAddByDiagDir(tile, side); + if (GetWaterRegionIndex(adjacent_tile) != GetWaterRegionIndex(tile)) invalidate_region(adjacent_tile); } } @@ -409,8 +400,12 @@ void VisitWaterRegionPatchNeighbors(const WaterRegionPatchDesc &water_region_pat */ void AllocateWaterRegions() { + const int number_of_regions = GetWaterRegionMapSizeX() * GetWaterRegionMapSizeY(); + _water_regions.clear(); - _water_regions.reserve(static_cast(GetWaterRegionMapSizeX()) * GetWaterRegionMapSizeY()); + _water_regions.reserve(number_of_regions); + + _is_water_region_valid.resize(number_of_regions, false); Debug(map, 2, "Allocating {} x {} water regions", GetWaterRegionMapSizeX(), GetWaterRegionMapSizeY()); @@ -419,6 +414,8 @@ void AllocateWaterRegions() _water_regions.emplace_back(region_x, region_y); } } + + assert(_is_water_region_valid.size() == _water_regions.size()); } void PrintWaterRegionDebugInfo(TileIndex tile) From c17fa6032b2861ff2f39e1808c13eb0a29b73704 Mon Sep 17 00:00:00 2001 From: James Addison <55152140+jayaddison@users.noreply.github.com> Date: Thu, 2 May 2024 14:13:00 +0100 Subject: [PATCH 22/30] Doc: Add Apache 2.0 licensing info for CheckAtomic.cmake (#12603) --- CMakeLists.txt | 2 +- README.md | 3 + cmake/{ => 3rdparty/llvm}/CheckAtomic.cmake | 8 + cmake/3rdparty/llvm/LICENSE.txt | 279 ++++++++++++++++++++ 4 files changed, 291 insertions(+), 1 deletion(-) rename cmake/{ => 3rdparty/llvm}/CheckAtomic.cmake (90%) create mode 100644 cmake/3rdparty/llvm/LICENSE.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 8569e5ec7b..487eb8520d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -343,7 +343,7 @@ if(NOT OPTION_DEDICATED) endif() endif() -include(CheckAtomic) +include(3rdparty/llvm/CheckAtomic) if(APPLE) link_package(Iconv TARGET Iconv::Iconv) diff --git a/README.md b/README.md index 1943ed6bc3..96a3a6eb93 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,9 @@ See `src/3rdparty/monocypher/LICENSE.md` for the complete license text. The OpenTTD Social Integration API in `src/3rdparty/openttd_social_integration_api` is licensed under the MIT license. See `src/3rdparty/openttd_social_integration_api/LICENSE` for the complete license text. +The atomic datatype support detection in `cmake/3rdparty/llvm/CheckAtomic.cmake` is licensed under the Apache 2.0 license. +See `cmake/3rdparty/llvm/LICENSE.txt` for the complete license text. + ## 4.0 Credits See [CREDITS.md](./CREDITS.md) diff --git a/cmake/CheckAtomic.cmake b/cmake/3rdparty/llvm/CheckAtomic.cmake similarity index 90% rename from cmake/CheckAtomic.cmake rename to cmake/3rdparty/llvm/CheckAtomic.cmake index 990c52c37c..2dc895d75b 100644 --- a/cmake/CheckAtomic.cmake +++ b/cmake/3rdparty/llvm/CheckAtomic.cmake @@ -1,3 +1,11 @@ +# +# This was originally part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See (https://llvm.org/)LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +# Modifications have been made to suit building OpenTTD. +# + # atomic builtins are required for threading support. INCLUDE(CheckCXXSourceCompiles) diff --git a/cmake/3rdparty/llvm/LICENSE.txt b/cmake/3rdparty/llvm/LICENSE.txt new file mode 100644 index 0000000000..fa6ac54000 --- /dev/null +++ b/cmake/3rdparty/llvm/LICENSE.txt @@ -0,0 +1,279 @@ +============================================================================== +The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: +============================================================================== + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +---- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + +============================================================================== +Software from third parties included in the LLVM Project: +============================================================================== +The LLVM Project contains third party software which is under different license +terms. All such code will be identified clearly using at least one of two +mechanisms: +1) It will be in a separate directory tree with its own `LICENSE.txt` or + `LICENSE` file at the top containing the specific license and restrictions + which apply to that software, or +2) It will contain specific license and restriction terms at the top of every + file. + +============================================================================== +Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + From 90029beb4919ea8d74b9d646e643beb7a3e3fcd0 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 2 May 2024 23:19:08 +0100 Subject: [PATCH 23/30] Codechange: Ensure SDLK mappings stay in the expected order. (#12608) Add a constexpr constructor that ensures at compile-time that the source SDLK range matches the target range. --- src/video/sdl2_v.cpp | 24 +++++++++++++++--------- src/video/sdl_v.cpp | 18 ++++++++++++------ 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp index 2fb0654ee5..93a74a2b13 100644 --- a/src/video/sdl2_v.cpp +++ b/src/video/sdl2_v.cpp @@ -240,18 +240,24 @@ std::vector VideoDriver_SDL_Base::GetListOfMonitorRefreshRates() struct SDLVkMapping { - SDL_Keycode vk_from; - uint8_t vk_count; - uint8_t map_to; - bool unprintable; + const SDL_Keycode vk_from; + const uint8_t vk_count; + const uint8_t map_to; + const bool unprintable; + + constexpr SDLVkMapping(SDL_Keycode vk_first, SDL_Keycode vk_last, uint8_t map_first, [[maybe_unused]] uint8_t map_last, bool unprintable) + : vk_from(vk_first), vk_count(vk_first - vk_last + 1), map_to(map_first), unprintable(unprintable) + { + assert((vk_last - vk_first) == (map_last - map_first)); + } }; -#define AS(x, z) {x, 1, z, false} -#define AM(x, y, z, w) {x, (uint8_t)(y - x + 1), z, false} -#define AS_UP(x, z) {x, 1, z, true} -#define AM_UP(x, y, z, w) {x, (uint8_t)(y - x + 1), z, true} +#define AS(x, z) {x, x, z, z, false} +#define AM(x, y, z, w) {x, y, z, w, false} +#define AS_UP(x, z) {x, x, z, z, true} +#define AM_UP(x, y, z, w) {x, y, z, w, true} -static const SDLVkMapping _vk_mapping[] = { +static constexpr SDLVkMapping _vk_mapping[] = { /* Pageup stuff + up/down */ AS_UP(SDLK_PAGEUP, WKC_PAGEUP), AS_UP(SDLK_PAGEDOWN, WKC_PAGEDOWN), diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index 3619b61fd2..b40e23574d 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -373,15 +373,21 @@ bool VideoDriver_SDL::ClaimMousePointer() } struct SDLVkMapping { - uint16_t vk_from; - uint8_t vk_count; - uint8_t map_to; + const uint16_t vk_from; + const uint8_t vk_count; + const uint8_t map_to; + + constexpr SDLVkMapping(SDL_Keycode vk_first, SDL_Keycode vk_last, uint8_t map_first, [[maybe_unused]] uint8_t map_last) + : vk_from(vk_first), vk_count(vk_first - vk_last + 1), map_to(map_first) + { + assert((vk_last - vk_first) == (map_last - map_first)); + } }; -#define AS(x, z) {x, 1, z} -#define AM(x, y, z, w) {x, (uint8_t)(y - x + 1), z} +#define AS(x, z) {x, x, z, z, false} +#define AM(x, y, z, w) {x, y, z, w, false} -static const SDLVkMapping _vk_mapping[] = { +static constexpr SDLVkMapping _vk_mapping[] = { /* Pageup stuff + up/down */ AM(SDLK_PAGEUP, SDLK_PAGEDOWN, WKC_PAGEUP, WKC_PAGEDOWN), AS(SDLK_UP, WKC_UP), From e0048d798f9024dcadd984524ab8d7cd141994ed Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 3 May 2024 04:41:54 +0000 Subject: [PATCH 24/30] Update: Translations from eints hungarian: 5 changes by egri-nagy --- src/lang/hungarian.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index f7e80766b8..f4230957f5 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -459,7 +459,7 @@ STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_LEAGUE :{BLACK}A válla STR_TOOLBAR_TOOLTIP_FUND_CONSTRUCTION_OF_NEW :{BLACK}Gazdasági épületek listázása, ipari lánc megnyitása, vagy új gazdasági épületek építése STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_TRAINS :{BLACK}Vonatlista megnyitása. Ctrl+kattintással válszthatsz a csoport- vagy járműlista között STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_ROAD_VEHICLES :{BLACK}Közúti járműlista megnyitása. Ctrl+kattintással válszthatsz a csoport- vagy járműlista között -STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_SHIPS :{BLACK}Hajóista megnyitása. Ctrl+kattintással válszthatsz a csoport- vagy járműlista között +STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_SHIPS :{BLACK}Hajólista megnyitása. Ctrl+kattintással válszthatsz a csoport- vagy járműlista között STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_AIRCRAFT :{BLACK}Repülőgéplista megnyitása. Ctrl+kattintással válszthatsz a csoport- vagy járműlista között STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_IN :{BLACK}Nagyítás STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_OUT :{BLACK}Kicsinyítés @@ -3455,8 +3455,11 @@ STR_GENERATION_ABORT_MESSAGE :{YELLOW}Tényle STR_GENERATION_PROGRESS :{WHITE}{NUM}% kész STR_GENERATION_PROGRESS_NUM :{BLACK}{NUM} / {NUM} STR_GENERATION_WORLD_GENERATION :{BLACK}Világ létrehozása +STR_GENERATION_LANDSCAPE_GENERATION :{BLACK}Tájkép generálás STR_GENERATION_RIVER_GENERATION :{BLACK}Folyó generálás STR_GENERATION_CLEARING_TILES :{BLACK}Durva és köves területek generálása +STR_GENERATION_TOWN_GENERATION :{BLACK}Város generálás +STR_GENERATION_INDUSTRY_GENERATION :{BLACK}Ipar generálás STR_GENERATION_OBJECT_GENERATION :{BLACK}Mozgathatatlan létesítmények létrehozása STR_GENERATION_TREE_GENERATION :{BLACK}Fák generálása STR_GENERATION_SETTINGUP_GAME :{BLACK}Játék beállítása @@ -3550,6 +3553,7 @@ STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_ROAD_TYPE :Út típus STR_NEWGRF_INSPECT_QUERY_CAPTION :{WHITE}NewGRF változó 60+x paraméter (hexadecimális) # Sprite aligner window +STR_SPRITE_ALIGNER_CAPTION_NO_ACTION :{WHITE}Sprite elhelyezés: ({STRING}:{NUM}) STR_SPRITE_ALIGNER_NEXT_BUTTON :{BLACK}Következő sprite STR_SPRITE_ALIGNER_NEXT_TOOLTIP :{BLACK}Továbbhaladás a következő normál spritera, kihagyva bármilyen ál/átszínező/betű spriteokat, a végén folytatva az elsővel STR_SPRITE_ALIGNER_GOTO_BUTTON :{BLACK}Ugrás a spritehoz From 0b50834f8144a457287f3b0c7869dcc630d6a033 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Thu, 2 May 2024 23:30:09 +0200 Subject: [PATCH 25/30] Fix 2955ff3: CMake atomic check fails due to chosen compiler --- cmake/3rdparty/llvm/CheckAtomic.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/3rdparty/llvm/CheckAtomic.cmake b/cmake/3rdparty/llvm/CheckAtomic.cmake index 2dc895d75b..86ab2ab136 100644 --- a/cmake/3rdparty/llvm/CheckAtomic.cmake +++ b/cmake/3rdparty/llvm/CheckAtomic.cmake @@ -56,6 +56,8 @@ else() check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB) # If not, check if the library exists, and atomics work with it. if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) + # check_library_exists requires the C-compiler as the atomic functions are built-in declared. + enable_language(C) check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC) if(HAVE_LIBATOMIC) list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") @@ -77,6 +79,8 @@ else() check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB) # If not, check if the library exists, and atomics work with it. if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) + # check_library_exists requires the C-compiler as the atomic functions are built-in declared. + enable_language(C) check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64) if(HAVE_CXX_LIBATOMICS64) list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") From 8b6661d4862cd43d6e98b2e9811a98c6f01d11b2 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Fri, 3 May 2024 07:44:48 +0200 Subject: [PATCH 26/30] Codefix 90029be: build failure for SDL 1.2 --- src/video/sdl_v.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index b40e23574d..2e069271f6 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -377,15 +377,15 @@ struct SDLVkMapping { const uint8_t vk_count; const uint8_t map_to; - constexpr SDLVkMapping(SDL_Keycode vk_first, SDL_Keycode vk_last, uint8_t map_first, [[maybe_unused]] uint8_t map_last) + constexpr SDLVkMapping(SDLKey vk_first, SDLKey vk_last, uint8_t map_first, [[maybe_unused]] uint8_t map_last) : vk_from(vk_first), vk_count(vk_first - vk_last + 1), map_to(map_first) { assert((vk_last - vk_first) == (map_last - map_first)); } }; -#define AS(x, z) {x, x, z, z, false} -#define AM(x, y, z, w) {x, y, z, w, false} +#define AS(x, z) {x, x, z, z} +#define AM(x, y, z, w) {x, y, z, w} static constexpr SDLVkMapping _vk_mapping[] = { /* Pageup stuff + up/down */ From 9d2efd4c96278d5779820935670586f6b2f4fa95 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 2 May 2024 22:27:17 +0100 Subject: [PATCH 27/30] Codechange: Use callback function to set labels of slider widget marks. Slider widgets can only use a predefined list of values and strings to draw labels. This makes it difficult to vary the display by context. Instead of providing a predefined list as a std::map, use a callback function instead. This function can decide what text to display, and can call SetDParam to dynamically set up strings. --- src/lang/english.txt | 12 ++-------- src/music_gui.cpp | 4 ++-- src/settings_gui.cpp | 56 ++++++++++++++++++-------------------------- src/slider.cpp | 30 +++++++++++++++--------- src/slider_func.h | 3 ++- 5 files changed, 48 insertions(+), 57 deletions(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index 36fea5c491..df48b08dec 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -956,11 +956,7 @@ STR_GAME_OPTIONS_VOLUME :Volume STR_GAME_OPTIONS_SFX_VOLUME :Sound effects STR_GAME_OPTIONS_MUSIC_VOLUME :Music -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% +STR_GAME_OPTIONS_VOLUME_MARK :{NUM}% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Currency units STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Currency units selection @@ -1058,11 +1054,7 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Check th STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Anti-alias fonts STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Check this box to anti-alias resizable fonts -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x +STR_GAME_OPTIONS_GUI_SCALE_MARK :{DECIMAL}x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automated survey STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Participate in automated survey diff --git a/src/music_gui.cpp b/src/music_gui.cpp index c31bfca711..639f360ce0 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -775,11 +775,11 @@ struct MusicWindow : public Window { } case WID_M_MUSIC_VOL: - DrawSliderWidget(r, 0, INT8_MAX, _settings_client.music.music_vol, {}); + DrawSliderWidget(r, 0, INT8_MAX, 0, _settings_client.music.music_vol, nullptr); break; case WID_M_EFFECT_VOL: - DrawSliderWidget(r, 0, INT8_MAX, _settings_client.music.effect_vol, {}); + DrawSliderWidget(r, 0, INT8_MAX, 0, _settings_client.music.effect_vol, nullptr); break; } } diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 0ef8fb330e..889f65d7ad 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -152,37 +152,27 @@ static void AddCustomRefreshRates() std::copy(monitorRates.begin(), monitorRates.end(), std::inserter(_refresh_rates, _refresh_rates.end())); } -static const std::map _scale_labels = { - { 100, STR_GAME_OPTIONS_GUI_SCALE_1X }, - { 125, STR_NULL }, - { 150, STR_NULL }, - { 175, STR_NULL }, - { 200, STR_GAME_OPTIONS_GUI_SCALE_2X }, - { 225, STR_NULL }, - { 250, STR_NULL }, - { 275, STR_NULL }, - { 300, STR_GAME_OPTIONS_GUI_SCALE_3X }, - { 325, STR_NULL }, - { 350, STR_NULL }, - { 375, STR_NULL }, - { 400, STR_GAME_OPTIONS_GUI_SCALE_4X }, - { 425, STR_NULL }, - { 450, STR_NULL }, - { 475, STR_NULL }, - { 500, STR_GAME_OPTIONS_GUI_SCALE_5X }, -}; +static const int SCALE_NMARKS = (MAX_INTERFACE_SCALE - MIN_INTERFACE_SCALE) / 25 + 1; // Show marks at 25% increments +static const int VOLUME_NMARKS = 9; // Show 5 values and 4 empty marks. -static const std::map _volume_labels = { - { 0, STR_GAME_OPTIONS_VOLUME_0 }, - { 15, STR_NULL }, - { 31, STR_GAME_OPTIONS_VOLUME_25 }, - { 47, STR_NULL }, - { 63, STR_GAME_OPTIONS_VOLUME_50 }, - { 79, STR_NULL }, - { 95, STR_GAME_OPTIONS_VOLUME_75 }, - { 111, STR_NULL }, - { 127, STR_GAME_OPTIONS_VOLUME_100 }, -}; +static StringID ScaleMarkFunc(int, int, int value) +{ + /* Label only every 100% mark. */ + if (value % 100 != 0) return STR_NULL; + + SetDParam(0, value / 100); + SetDParam(1, 0); + return STR_GAME_OPTIONS_GUI_SCALE_MARK; +} + +static StringID VolumeMarkFunc(int, int mark, int value) +{ + /* Label only every other mark. */ + if (mark % 2 != 0) return STR_NULL; + + SetDParam(0, value / 31 * 25); // 0-127 does not map nicely to 0-100. Dividing first gives us nice round numbers. + return STR_GAME_OPTIONS_VOLUME_MARK; +} static constexpr NWidgetPart _nested_social_plugins_widgets[] = { NWidget(NWID_HORIZONTAL), @@ -572,7 +562,7 @@ struct GameOptionsWindow : Window { break; case WID_GO_GUI_SCALE: - DrawSliderWidget(r, MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE, this->gui_scale, _scale_labels); + DrawSliderWidget(r, MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE, SCALE_NMARKS, this->gui_scale, ScaleMarkFunc); break; case WID_GO_VIDEO_DRIVER_INFO: @@ -581,11 +571,11 @@ struct GameOptionsWindow : Window { break; case WID_GO_BASE_SFX_VOLUME: - DrawSliderWidget(r, 0, INT8_MAX, _settings_client.music.effect_vol, _volume_labels); + DrawSliderWidget(r, 0, INT8_MAX, VOLUME_NMARKS, _settings_client.music.effect_vol, VolumeMarkFunc); break; case WID_GO_BASE_MUSIC_VOLUME: - DrawSliderWidget(r, 0, INT8_MAX, _settings_client.music.music_vol, _volume_labels); + DrawSliderWidget(r, 0, INT8_MAX, VOLUME_NMARKS, _settings_client.music.music_vol, VolumeMarkFunc); break; } } diff --git a/src/slider.cpp b/src/slider.cpp index 67894a88d2..c6f086c006 100644 --- a/src/slider.cpp +++ b/src/slider.cpp @@ -24,13 +24,14 @@ static const int SLIDER_WIDTH = 3; * @param r Rectangle to draw the widget in * @param min_value Minimum value of slider * @param max_value Maximum value of slider + * @param nmarks Number of marks to display (when mark_func is provided.) * @param value Value to put the slider at - * @param labels List of positions and labels to draw along the slider. + * @param mark_func Callback function to get the StringID to draw on a mark. */ -void DrawSliderWidget(Rect r, int min_value, int max_value, int value, const std::map &labels) +void DrawSliderWidget(Rect r, int min_value, int max_value, int nmarks, int value, SliderMarkFunc *mark_func) { /* Allow space for labels. We assume they are in the small font. */ - if (!labels.empty()) r.bottom -= GetCharacterHeight(FS_SMALL) + WidgetDimensions::scaled.hsep_normal; + if (mark_func != nullptr) r.bottom -= GetCharacterHeight(FS_SMALL) + WidgetDimensions::scaled.hsep_normal; max_value -= min_value; @@ -51,15 +52,22 @@ void DrawSliderWidget(Rect r, int min_value, int max_value, int value, const std GfxDrawLine(wedge[0].x, wedge[0].y, wedge[1].x, wedge[1].y, shadow, t); int x; - for (auto label : labels) { - x = label.first - min_value; - if (_current_text_dir == TD_RTL) x = max_value - x; - x = r.left + (x * (r.right - r.left - sw) / max_value) + sw / 2; - GfxDrawLine(x, r.bottom - ha + 1, x, r.bottom + (label.second == STR_NULL ? 0 : WidgetDimensions::scaled.hsep_normal), shadow, t); - if (label.second != STR_NULL) { - Dimension d = GetStringBoundingBox(label.second, FS_SMALL); + if (mark_func != nullptr) { + for (int mark = 0; mark < nmarks; ++mark) { + const int mark_value = (max_value * mark) / (nmarks - 1); + + const StringID str = mark_func(nmarks, mark, mark_value + min_value); + if (str == INVALID_STRING_ID) continue; + + x = mark_value; + if (_current_text_dir == TD_RTL) x = max_value - mark_value; + x = r.left + (x * (r.right - r.left - sw) / max_value) + sw / 2; + GfxDrawLine(x, r.bottom - ha + 1, x, r.bottom + (str == STR_NULL ? 0 : WidgetDimensions::scaled.hsep_normal), shadow, t); + if (str == STR_NULL) continue; + + Dimension d = GetStringBoundingBox(str, FS_SMALL); x = Clamp(x - d.width / 2, r.left, r.right - d.width); - DrawString(x, x + d.width, r.bottom + 1 + WidgetDimensions::scaled.hsep_normal, label.second, TC_BLACK, SA_CENTER, false, FS_SMALL); + DrawString(x, x + d.width, r.bottom + 1 + WidgetDimensions::scaled.hsep_normal, str, TC_BLACK, SA_CENTER, false, FS_SMALL); } } diff --git a/src/slider_func.h b/src/slider_func.h index 0aaa39bf15..f0ff9cc0ac 100644 --- a/src/slider_func.h +++ b/src/slider_func.h @@ -13,7 +13,8 @@ #include "core/geometry_type.hpp" #include "strings_type.h" -void DrawSliderWidget(Rect r, int min_value, int max_value, int value, const std::map &labels); +using SliderMarkFunc = StringID(int nmarks, int mark, int value); +void DrawSliderWidget(Rect r, int min_value, int max_value, int nmarks, int value, SliderMarkFunc *mark_func); bool ClickSliderWidget(Rect r, Point pt, int min_value, int max_value, int &value); inline bool ClickSliderWidget(Rect r, Point pt, int min_value, int max_value, uint8_t &value) From 9a7c30a1091c520b8908e9ed965ff94e6f595fff Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 2 May 2024 22:31:47 +0100 Subject: [PATCH 28/30] Codechange: Let ClickSliderWidget handle rounding to nearest mark. --- src/music_gui.cpp | 2 +- src/settings_gui.cpp | 5 ++--- src/slider.cpp | 10 +++++++++- src/slider_func.h | 6 +++--- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 639f360ce0..4f9e5b978d 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -826,7 +826,7 @@ struct MusicWindow : public Window { case WID_M_MUSIC_VOL: case WID_M_EFFECT_VOL: { // volume sliders uint8_t &vol = (widget == WID_M_MUSIC_VOL) ? _settings_client.music.music_vol : _settings_client.music.effect_vol; - if (ClickSliderWidget(this->GetWidget(widget)->GetCurrentRect(), pt, 0, INT8_MAX, vol)) { + if (ClickSliderWidget(this->GetWidget(widget)->GetCurrentRect(), pt, 0, INT8_MAX, 0, vol)) { if (widget == WID_M_MUSIC_VOL) { MusicDriver::GetInstance()->SetVolume(vol); } else { diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 889f65d7ad..3dfdccbb14 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -786,8 +786,7 @@ struct GameOptionsWindow : Window { #endif /* HAS_TRUETYPE_FONT */ case WID_GO_GUI_SCALE: - if (ClickSliderWidget(this->GetWidget(widget)->GetCurrentRect(), pt, MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE, this->gui_scale)) { - if (!_ctrl_pressed) this->gui_scale = ((this->gui_scale + 12) / 25) * 25; + if (ClickSliderWidget(this->GetWidget(widget)->GetCurrentRect(), pt, MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE, _ctrl_pressed ? 0 : SCALE_NMARKS, this->gui_scale)) { this->SetWidgetDirty(widget); } @@ -822,7 +821,7 @@ struct GameOptionsWindow : Window { case WID_GO_BASE_SFX_VOLUME: case WID_GO_BASE_MUSIC_VOLUME: { uint8_t &vol = (widget == WID_GO_BASE_MUSIC_VOLUME) ? _settings_client.music.music_vol : _settings_client.music.effect_vol; - if (ClickSliderWidget(this->GetWidget(widget)->GetCurrentRect(), pt, 0, INT8_MAX, vol)) { + if (ClickSliderWidget(this->GetWidget(widget)->GetCurrentRect(), pt, 0, INT8_MAX, 0, vol)) { if (widget == WID_GO_BASE_MUSIC_VOLUME) { MusicDriver::GetInstance()->SetVolume(vol); } else { diff --git a/src/slider.cpp b/src/slider.cpp index c6f086c006..30e0591e83 100644 --- a/src/slider.cpp +++ b/src/slider.cpp @@ -82,10 +82,13 @@ void DrawSliderWidget(Rect r, int min_value, int max_value, int nmarks, int valu * Handle click on a slider widget to change the value * @param r Rectangle of the widget * @param pt Clicked point + * @param min_value Minimum value of slider + * @param max_value Maximum value of slider + * @param nmarks Number of marks displayed. Value will be rounded to nearest mark. * @param value[in,out] Value to modify * @return True if the value setting was modified */ -bool ClickSliderWidget(Rect r, Point pt, int min_value, int max_value, int &value) +bool ClickSliderWidget(Rect r, Point pt, int min_value, int max_value, int nmarks, int &value) { max_value -= min_value; @@ -94,6 +97,11 @@ bool ClickSliderWidget(Rect r, Point pt, int min_value, int max_value, int &valu if (_current_text_dir == TD_RTL) new_value = max_value - new_value; new_value += min_value; + if (nmarks > 0) { + const int step = max_value / (nmarks - 1); + new_value = ((new_value + step / 2) / step) * step; + } + if (new_value != value) { value = new_value; return true; diff --git a/src/slider_func.h b/src/slider_func.h index f0ff9cc0ac..cb5b97fe06 100644 --- a/src/slider_func.h +++ b/src/slider_func.h @@ -15,12 +15,12 @@ using SliderMarkFunc = StringID(int nmarks, int mark, int value); void DrawSliderWidget(Rect r, int min_value, int max_value, int nmarks, int value, SliderMarkFunc *mark_func); -bool ClickSliderWidget(Rect r, Point pt, int min_value, int max_value, int &value); +bool ClickSliderWidget(Rect r, Point pt, int min_value, int max_value, int nmarks, int &value); -inline bool ClickSliderWidget(Rect r, Point pt, int min_value, int max_value, uint8_t &value) +inline bool ClickSliderWidget(Rect r, Point pt, int min_value, int max_value, int nmarks, uint8_t &value) { int tmp_value = value; - if (!ClickSliderWidget(r, pt, min_value, max_value, tmp_value)) return false; + if (!ClickSliderWidget(r, pt, min_value, max_value, nmarks, tmp_value)) return false; value = tmp_value; return true; } From 60cf37e0d175a0fe45615f3bc4459afa7b17d41a Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 4 May 2024 04:41:06 +0000 Subject: [PATCH 29/30] Update: Translations from eints --- src/lang/arabic_egypt.txt | 1 - src/lang/belarusian.txt | 10 ---------- src/lang/brazilian_portuguese.txt | 10 ---------- src/lang/bulgarian.txt | 5 ----- src/lang/catalan.txt | 10 ---------- src/lang/czech.txt | 10 ---------- src/lang/danish.txt | 10 ---------- src/lang/dutch.txt | 10 ---------- src/lang/english_AU.txt | 10 ---------- src/lang/english_US.txt | 10 ---------- src/lang/esperanto.txt | 10 ---------- src/lang/estonian.txt | 10 ---------- src/lang/finnish.txt | 10 ---------- src/lang/french.txt | 10 ---------- src/lang/galician.txt | 10 ---------- src/lang/german.txt | 10 ---------- src/lang/greek.txt | 10 ---------- src/lang/hebrew.txt | 3 --- src/lang/hungarian.txt | 10 ---------- src/lang/indonesian.txt | 10 ---------- src/lang/italian.txt | 10 ---------- src/lang/japanese.txt | 10 ---------- src/lang/korean.txt | 10 ---------- src/lang/latvian.txt | 10 ---------- src/lang/lithuanian.txt | 10 ---------- src/lang/luxembourgish.txt | 10 ---------- src/lang/norwegian_bokmal.txt | 10 ---------- src/lang/polish.txt | 10 ---------- src/lang/portuguese.txt | 10 ---------- src/lang/romanian.txt | 10 ---------- src/lang/russian.txt | 10 ---------- src/lang/serbian.txt | 10 ---------- src/lang/simplified_chinese.txt | 10 ---------- src/lang/slovak.txt | 10 ---------- src/lang/spanish.txt | 10 ---------- src/lang/spanish_MX.txt | 5 ----- src/lang/swedish.txt | 10 ---------- src/lang/tamil.txt | 10 ---------- src/lang/traditional_chinese.txt | 10 ---------- src/lang/turkish.txt | 10 ---------- src/lang/ukrainian.txt | 10 ---------- src/lang/vietnamese.txt | 10 ---------- src/lang/welsh.txt | 10 ---------- 43 files changed, 404 deletions(-) diff --git a/src/lang/arabic_egypt.txt b/src/lang/arabic_egypt.txt index 9fb0279d03..d935ab0ac7 100644 --- a/src/lang/arabic_egypt.txt +++ b/src/lang/arabic_egypt.txt @@ -965,7 +965,6 @@ STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}اختر -STR_GAME_OPTIONS_GUI_SCALE_1X :1x STR_GAME_OPTIONS_GRAPHICS :{BLACK}الرسومات diff --git a/src/lang/belarusian.txt b/src/lang/belarusian.txt index 1bb20e0cd7..6439d49f84 100644 --- a/src/lang/belarusian.txt +++ b/src/lang/belarusian.txt @@ -1270,11 +1270,6 @@ STR_GAME_OPTIONS_VOLUME :Гучнасц STR_GAME_OPTIONS_SFX_VOLUME :Гукавыя эфекты STR_GAME_OPTIONS_MUSIC_VOLUME :Музыка -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Валюта STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Выбар валюты @@ -1371,11 +1366,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Паст STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Згладжваньне шрыфтоў STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Пастаўце адзнаку, каб уключыць згладжваньне маштабуемых шрыфтоў -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Аўтаматычны збор дадзеных STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Дазволіць збор і адпраўку дадзеных diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index aa24ae7e5b..153f2414ea 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -957,11 +957,6 @@ STR_GAME_OPTIONS_VOLUME :Volume STR_GAME_OPTIONS_SFX_VOLUME :Efeitos sonoros STR_GAME_OPTIONS_MUSIC_VOLUME :Música -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Unidades monetárias STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Seleção de unidades monetárias @@ -1059,11 +1054,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Marque e STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Fontes com contornos suaves STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Marque esta caixa para usar fontes redimensionáveis com contornos suaves -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Pesquisa automatizada STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Participar da pesquisa automatizada diff --git a/src/lang/bulgarian.txt b/src/lang/bulgarian.txt index a196d4cac6..a84aef6305 100644 --- a/src/lang/bulgarian.txt +++ b/src/lang/bulgarian.txt @@ -971,11 +971,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Отме STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Анти-Alias шрифтове STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Отметни тук за да се добави anti-alias към променливи шрифтове. -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Автоматизирано проучване STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Участвайте в автоматизирано проучване diff --git a/src/lang/catalan.txt b/src/lang/catalan.txt index 6980aa8e0a..344ae8e80d 100644 --- a/src/lang/catalan.txt +++ b/src/lang/catalan.txt @@ -957,11 +957,6 @@ STR_GAME_OPTIONS_VOLUME :Volum STR_GAME_OPTIONS_SFX_VOLUME :Efectes de so STR_GAME_OPTIONS_MUSIC_VOLUME :Música -STR_GAME_OPTIONS_VOLUME_0 :0{NBSP}% -STR_GAME_OPTIONS_VOLUME_25 :25{NBSP}% -STR_GAME_OPTIONS_VOLUME_50 :50{NBSP}% -STR_GAME_OPTIONS_VOLUME_75 :75{NBSP}% -STR_GAME_OPTIONS_VOLUME_100 :100{NBSP}% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Moneda STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Selecció de la unitat monetària @@ -1059,11 +1054,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Marqueu STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Aplica anti-àlies a les fonts STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Marqueu aquesta casella per a fer servir tècniques d'anti-àlies a les fonts redimensionables. -STR_GAME_OPTIONS_GUI_SCALE_1X :x1 -STR_GAME_OPTIONS_GUI_SCALE_2X :x2 -STR_GAME_OPTIONS_GUI_SCALE_3X :x3 -STR_GAME_OPTIONS_GUI_SCALE_4X :x4 -STR_GAME_OPTIONS_GUI_SCALE_5X :x5 STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Sondeig automatitzat STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Participa al sondeig automatitzat diff --git a/src/lang/czech.txt b/src/lang/czech.txt index 3fef564e8a..a7febe6752 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -1043,11 +1043,6 @@ STR_GAME_OPTIONS_VOLUME :Hlasitost STR_GAME_OPTIONS_SFX_VOLUME :Zvukové efekty STR_GAME_OPTIONS_MUSIC_VOLUME :Hudba -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25 % -STR_GAME_OPTIONS_VOLUME_50 :50 % -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Měna STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Výběr jednotek měny @@ -1144,11 +1139,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Zaškrtn STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Anti-aliasovat písma STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Zaškrtni toto políčko pro zapnutí anti-aliasování škálovatelných písem. -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automatický průzkum STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Účastnit se automatického průzkumu diff --git a/src/lang/danish.txt b/src/lang/danish.txt index e0f997da92..d4d4e738be 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -956,11 +956,6 @@ STR_GAME_OPTIONS_VOLUME :Lydstyrke STR_GAME_OPTIONS_SFX_VOLUME :Lydeffekter STR_GAME_OPTIONS_MUSIC_VOLUME :musik -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Valutaenhed STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Valg af valutaenhed @@ -1058,11 +1053,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Marker d STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Anti-alias skrifttyper STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Marker dette felt for at skrifttyper, der kan ændres størrelse, kan udlignes -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automatiseret undersøgelse STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Deltag i automatiseret undersøgelse diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 695afe3d1c..1167a4a985 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -956,11 +956,6 @@ STR_GAME_OPTIONS_VOLUME :Volume STR_GAME_OPTIONS_SFX_VOLUME :Geluidseffecten STR_GAME_OPTIONS_MUSIC_VOLUME :Muziek -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Valuta STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Valuta kiezen @@ -1058,11 +1053,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Vink dit STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Lettertypen met anti-alias STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Vink dit vakje aan voor in grootte aanpasbare lettertypen met anti-alias -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Geautomatiseerd onderzoek STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Deelnemen aan geautomatiseerd onderzoek diff --git a/src/lang/english_AU.txt b/src/lang/english_AU.txt index 1c2bebb5f0..c49fcf7674 100644 --- a/src/lang/english_AU.txt +++ b/src/lang/english_AU.txt @@ -956,11 +956,6 @@ STR_GAME_OPTIONS_VOLUME :Volume STR_GAME_OPTIONS_SFX_VOLUME :Sound effects STR_GAME_OPTIONS_MUSIC_VOLUME :Music -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Currency units STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Currency units selection @@ -1058,11 +1053,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Check th STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Anti-alias fonts STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Check this box to anti-alias resizable fonts -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automated survey STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Participate in automated survey diff --git a/src/lang/english_US.txt b/src/lang/english_US.txt index 25082260d7..389e3bd2a7 100644 --- a/src/lang/english_US.txt +++ b/src/lang/english_US.txt @@ -956,11 +956,6 @@ STR_GAME_OPTIONS_VOLUME :Volume STR_GAME_OPTIONS_SFX_VOLUME :Sound effects STR_GAME_OPTIONS_MUSIC_VOLUME :Music -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Currency units STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Currency units selection @@ -1058,11 +1053,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Check th STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Anti-alias fonts STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Check this box to anti-alias resizable fonts -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automated survey STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Participate in automated survey diff --git a/src/lang/esperanto.txt b/src/lang/esperanto.txt index d7d155197a..a5f58a1e2e 100644 --- a/src/lang/esperanto.txt +++ b/src/lang/esperanto.txt @@ -1018,11 +1018,6 @@ STR_GAME_OPTIONS_VOLUME :Laŭteco STR_GAME_OPTIONS_SFX_VOLUME :Sonefektoj STR_GAME_OPTIONS_MUSIC_VOLUME :Muziko -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Monunuoj STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Elekto de monunuoj @@ -1116,11 +1111,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Ŝaltu STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Glatigu tiparojn STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Ŝaltu ĉi tiun kvadrateton por glatigi aligrandigeblajn tiparojn -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Aŭtomata sondado STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Partopreni aŭtomatan sondadon diff --git a/src/lang/estonian.txt b/src/lang/estonian.txt index 98f75a5ac6..1a4a40d859 100644 --- a/src/lang/estonian.txt +++ b/src/lang/estonian.txt @@ -1013,11 +1013,6 @@ STR_GAME_OPTIONS_VOLUME :Helitase STR_GAME_OPTIONS_SFX_VOLUME :Heliefektid STR_GAME_OPTIONS_MUSIC_VOLUME :Muusika -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Valuuta STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Valuuta valimine @@ -1114,11 +1109,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Märgi, STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Anti-alias fondid STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Kasti märkimisel tehakse muudetava suurusega fontidele anti-alias. -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automaatne uuring STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Osale automaatses uuringus diff --git a/src/lang/finnish.txt b/src/lang/finnish.txt index e856a755b5..7e6c20e809 100644 --- a/src/lang/finnish.txt +++ b/src/lang/finnish.txt @@ -956,11 +956,6 @@ STR_GAME_OPTIONS_VOLUME :Äänenvoimakku STR_GAME_OPTIONS_SFX_VOLUME :Äänitehosteet STR_GAME_OPTIONS_MUSIC_VOLUME :Musiikki -STR_GAME_OPTIONS_VOLUME_0 :0{NBSP}% -STR_GAME_OPTIONS_VOLUME_25 :25{NBSP}% -STR_GAME_OPTIONS_VOLUME_50 :50{NBSP}% -STR_GAME_OPTIONS_VOLUME_75 :75{NBSP}% -STR_GAME_OPTIONS_VOLUME_100 :100{NBSP}% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Rahayksikkö STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Rahayksikön valinta @@ -1058,11 +1053,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Valitse STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Pehmennä kirjasinten reunoja STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Valitse tämä ruutu pehmentääksesi muuttuvan kokoisten fonttien reunoja -STR_GAME_OPTIONS_GUI_SCALE_1X :1× -STR_GAME_OPTIONS_GUI_SCALE_2X :2× -STR_GAME_OPTIONS_GUI_SCALE_3X :3× -STR_GAME_OPTIONS_GUI_SCALE_4X :4× -STR_GAME_OPTIONS_GUI_SCALE_5X :5× STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automatisoitu tutkimus STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Osallistu automatisoituun tutkimukseen diff --git a/src/lang/french.txt b/src/lang/french.txt index 863c011616..e414e0d44e 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -957,11 +957,6 @@ STR_GAME_OPTIONS_VOLUME :Volume STR_GAME_OPTIONS_SFX_VOLUME :Effets sonores STR_GAME_OPTIONS_MUSIC_VOLUME :Musique -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Devise STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Sélectionner l'unité monétaire @@ -1059,11 +1054,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Cochez c STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Polices d'écriture supportant l'anti-crénelage STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Cochez cette case pour activer l'anti-crénelage sur les polices d'écriture à taille variable -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :x5 STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Données d'analyse STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Participer à l'envoi de données d'analyse diff --git a/src/lang/galician.txt b/src/lang/galician.txt index 03d312d83f..bf8478b374 100644 --- a/src/lang/galician.txt +++ b/src/lang/galician.txt @@ -957,11 +957,6 @@ STR_GAME_OPTIONS_VOLUME :Volume STR_GAME_OPTIONS_SFX_VOLUME :Efectos de son STR_GAME_OPTIONS_MUSIC_VOLUME :Música -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Unidades monetarias STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Selección de unidades monetarias @@ -1059,11 +1054,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Marca es STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Suavizar fontes STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Marca esta opción para suavizar as fontes redimensionables -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Enquisa automática STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Participar nunha enquisa automática diff --git a/src/lang/german.txt b/src/lang/german.txt index f35922103e..6bc1480e21 100644 --- a/src/lang/german.txt +++ b/src/lang/german.txt @@ -957,11 +957,6 @@ STR_GAME_OPTIONS_VOLUME :Lautstärke STR_GAME_OPTIONS_SFX_VOLUME :Sound-Effekte STR_GAME_OPTIONS_MUSIC_VOLUME :Musik -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Währung STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Währung auswählen @@ -1059,11 +1054,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Dieses K STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Kantenglättung für Schriften STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Dieses Kästchen ankreuzen, um Kantenglättung für skalierbare Schriften zu aktivieren -STR_GAME_OPTIONS_GUI_SCALE_1X :1× -STR_GAME_OPTIONS_GUI_SCALE_2X :2× -STR_GAME_OPTIONS_GUI_SCALE_3X :3× -STR_GAME_OPTIONS_GUI_SCALE_4X :4× -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automatische Umfrage STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Bei automatischer Umfrage teilnehmen diff --git a/src/lang/greek.txt b/src/lang/greek.txt index 6cb19b60c2..e6cdebcdfd 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -1048,11 +1048,6 @@ STR_GAME_OPTIONS_VOLUME :Ένταση Ή STR_GAME_OPTIONS_SFX_VOLUME :Ηχητικά εφέ STR_GAME_OPTIONS_MUSIC_VOLUME :Μουσική -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Νομισματικές μονάδες STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Επιλογή νομισματικών μονάδων @@ -1150,11 +1145,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Τσεκ STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Εξομάλυνση εμφάνισης γραμματοσειράς STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Τσεκάρετε αυτό το κουτάκι για εξομάλυνση εμφάνισης γραμματοσειράς -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Αυτοματοποιημένη έρευνα STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Συμμετοχή σε αυτοματοποιημένη έρευνα diff --git a/src/lang/hebrew.txt b/src/lang/hebrew.txt index 47775a6a37..5fa35a2634 100644 --- a/src/lang/hebrew.txt +++ b/src/lang/hebrew.txt @@ -940,9 +940,6 @@ STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}VSync -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x STR_GAME_OPTIONS_GRAPHICS :{BLACK}גרפיקה diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index f4230957f5..e8993aff3c 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -1020,11 +1020,6 @@ STR_GAME_OPTIONS_VOLUME :Hangerő STR_GAME_OPTIONS_SFX_VOLUME :Hang effektek STR_GAME_OPTIONS_MUSIC_VOLUME :Zene -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Pénznem STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}A használt pénznem kiválasztása @@ -1121,11 +1116,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Jelöld STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Betűtípusok simítása STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Jelöld be ezt, ha lesimított betűket akarsz. -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automata felmérés STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Részvétel automata felmérésben diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index 7156f51f80..17e8dc8082 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -935,11 +935,6 @@ STR_GAME_OPTIONS_VOLUME :Volume STR_GAME_OPTIONS_SFX_VOLUME :Efek suara STR_GAME_OPTIONS_MUSIC_VOLUME :Musik -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Mata uang STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Pilih mata uang @@ -1033,11 +1028,6 @@ STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Pilih ko STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Font anti-alias STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Centang kotak ini untuk font anti-alias yang dapat diubah ukurannya. -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Survei Otomatis STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Berpartisipasi pada survey otomatis diff --git a/src/lang/italian.txt b/src/lang/italian.txt index 70c30ec283..98cde9d385 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -958,11 +958,6 @@ STR_GAME_OPTIONS_VOLUME :Volume STR_GAME_OPTIONS_SFX_VOLUME :Effetti sonori STR_GAME_OPTIONS_MUSIC_VOLUME :Musica -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Valuta STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Selezione della valuta @@ -1060,11 +1055,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Selezion STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Font anti-aliasing STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Seleziona questa casella per applicare l'anti-aliasing ai caratteri ridimensionabili -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Sondaggio automatizzato STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Partecipare al sondaggio automatico diff --git a/src/lang/japanese.txt b/src/lang/japanese.txt index 1ef33a56df..6b784d61cf 100644 --- a/src/lang/japanese.txt +++ b/src/lang/japanese.txt @@ -896,11 +896,6 @@ STR_GAME_OPTIONS_VOLUME :音量 STR_GAME_OPTIONS_SFX_VOLUME :効果音 STR_GAME_OPTIONS_MUSIC_VOLUME :音楽 -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}通貨単位 STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}通貨単位の選択 @@ -991,11 +986,6 @@ STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}ベベ STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}ここをチェックするとベベルはインタフェースのサイズに比例します -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}グラフィクス diff --git a/src/lang/korean.txt b/src/lang/korean.txt index acbcc3b9b6..887ccc47f8 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -957,11 +957,6 @@ STR_GAME_OPTIONS_VOLUME :음량 STR_GAME_OPTIONS_SFX_VOLUME :효과음 STR_GAME_OPTIONS_MUSIC_VOLUME :배경음 -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}화폐 단위 STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}화폐 단위 선택 @@ -1059,11 +1054,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}기존 STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}글씨체 테두리를 부드럽게 STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}크기 조절이 가능한 글씨체에 안티 에일리어싱을 적용하여 테두리를 부드럽게 표현하려면 이 박스에 체크하세요 -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}자동 설문 STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}자동 설문조사 참여 diff --git a/src/lang/latvian.txt b/src/lang/latvian.txt index 20e9ee837d..9e0dbd86d7 100644 --- a/src/lang/latvian.txt +++ b/src/lang/latvian.txt @@ -958,11 +958,6 @@ STR_GAME_OPTIONS_VOLUME :Skaļums STR_GAME_OPTIONS_SFX_VOLUME :Skaņas efekti STR_GAME_OPTIONS_MUSIC_VOLUME :Mūzika -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Naudas vienības STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Naudas vienību izvēle @@ -1060,11 +1055,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Atzīmē STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Anti-alias fonti STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Atzīmējiet šo izvēli, ja vēlaties mainīt fontus ar anti-alias izmēru. -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automatizēta aptauja STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Piedalieties automatizētā aptaujā diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index 3c30b47fdd..8e09b94ce3 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -1097,11 +1097,6 @@ STR_GAME_OPTIONS_CAPTION :{WHITE}Pagrindi STR_GAME_OPTIONS_VOLUME :Tūris -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Valiuta STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Valiutos pasirinkimas @@ -1190,11 +1185,6 @@ STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Skalės STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Pažymėkite šį langelį, jei norite keisti kampus pagal sąsajos dydį -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_GRAPHICS :{BLACK}Grafika diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt index 8f5674bf2f..819b465daa 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt @@ -956,11 +956,6 @@ STR_GAME_OPTIONS_VOLUME :Volume STR_GAME_OPTIONS_SFX_VOLUME :Soundeffekter STR_GAME_OPTIONS_MUSIC_VOLUME :Musik -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Währungseenheet STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Währungseenheet wielen @@ -1057,11 +1052,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Klick d STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Anti-alias Schrëften STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Klick dës Optioun fir verännerbar Schrëften ze anti-aliasen -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automatesch Emfro STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}An enger automatescher Emfro matmaachen diff --git a/src/lang/norwegian_bokmal.txt b/src/lang/norwegian_bokmal.txt index 6a8446158b..d99ca5569a 100644 --- a/src/lang/norwegian_bokmal.txt +++ b/src/lang/norwegian_bokmal.txt @@ -958,11 +958,6 @@ STR_GAME_OPTIONS_VOLUME :Volum STR_GAME_OPTIONS_SFX_VOLUME :Lydeffekter STR_GAME_OPTIONS_MUSIC_VOLUME :Musikk -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Valutaenhet STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Velg valutaenhet som skal brukes @@ -1060,11 +1055,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Kryss av STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Kantutjevning av skrift STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Kryss av denne knappen for å kantutjevne skalerbar skrift -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automatisert undersøkelse STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Delta i automatisert undersøkelse diff --git a/src/lang/polish.txt b/src/lang/polish.txt index db4f189c5a..604bcde35f 100644 --- a/src/lang/polish.txt +++ b/src/lang/polish.txt @@ -1336,11 +1336,6 @@ STR_GAME_OPTIONS_VOLUME :Głośność STR_GAME_OPTIONS_SFX_VOLUME :Efekty dźwiękowe STR_GAME_OPTIONS_MUSIC_VOLUME :Muzyka -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Waluta STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Wybór waluty @@ -1438,11 +1433,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Zaznacz STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Antyaliasing fontów STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Zaznacz to pole, aby wygładzać fonty o zmiennym rozmiarze -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automatyczna ankieta STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Udział w automatycznej ankiecie diff --git a/src/lang/portuguese.txt b/src/lang/portuguese.txt index d4ed990215..e372f9e7be 100644 --- a/src/lang/portuguese.txt +++ b/src/lang/portuguese.txt @@ -957,11 +957,6 @@ STR_GAME_OPTIONS_VOLUME :Volume STR_GAME_OPTIONS_SFX_VOLUME :Efeitos sonoros STR_GAME_OPTIONS_MUSIC_VOLUME :Música -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Unidades monetárias STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Selecção de unidades monetárias @@ -1059,11 +1054,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Marque e STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Fontes anti-alias STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Marque esta caixa para fontes redimensionáveis com anti-alias -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Sondagem automatizada STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Participar numa sondagem automatizada diff --git a/src/lang/romanian.txt b/src/lang/romanian.txt index eb2cfade78..931b823d75 100644 --- a/src/lang/romanian.txt +++ b/src/lang/romanian.txt @@ -956,11 +956,6 @@ STR_GAME_OPTIONS_VOLUME :Volum STR_GAME_OPTIONS_SFX_VOLUME :Efecte sonore STR_GAME_OPTIONS_MUSIC_VOLUME :Muzică -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Unitate monetară STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Alege unitatea monetară @@ -1057,11 +1052,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Bifați STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Fonturi anti-alias STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Bifați această casetă pentru anti-alias fonturi redimensionabile. -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Sondaj automat STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Participă în sondaje automate diff --git a/src/lang/russian.txt b/src/lang/russian.txt index 5d1ec0ffe0..343af553dc 100644 --- a/src/lang/russian.txt +++ b/src/lang/russian.txt @@ -1101,11 +1101,6 @@ STR_GAME_OPTIONS_VOLUME :Громкос STR_GAME_OPTIONS_SFX_VOLUME :Звуковые эффекты STR_GAME_OPTIONS_MUSIC_VOLUME :Музыка -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Валюта STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Смена используемой в игре валюты @@ -1203,11 +1198,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Пост STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Сглаживание шрифтов STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Поставьте отметку, чтобы включить сглаживание масштабируемых шрифтов -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Автоматический сбор данных STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Разрешить сбор и отправку данных diff --git a/src/lang/serbian.txt b/src/lang/serbian.txt index ce08c2b73d..8af04fd8f2 100644 --- a/src/lang/serbian.txt +++ b/src/lang/serbian.txt @@ -1133,11 +1133,6 @@ STR_GAME_OPTIONS_VOLUME :Jačina zvuka STR_GAME_OPTIONS_SFX_VOLUME :Zvučni efekti STR_GAME_OPTIONS_MUSIC_VOLUME :Muzika -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Valuta STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Izbor valute @@ -1234,11 +1229,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Označi STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Anti-alias fontova STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Označi ovde za anti-alias fontova promenljive veličine -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automatizovana anketa STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Učestvuj u automatizovanoj anketi diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index fc99513c23..5d7154b616 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -956,11 +956,6 @@ STR_GAME_OPTIONS_VOLUME :音量 STR_GAME_OPTIONS_SFX_VOLUME :音效 STR_GAME_OPTIONS_MUSIC_VOLUME :音乐 -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}货币单位 STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}货币单位选择 @@ -1058,11 +1053,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}如果 STR_GAME_OPTIONS_GUI_FONT_AA :字体抗锯齿 STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}勾选此框以对游戏字体应用抗锯齿 -STR_GAME_OPTIONS_GUI_SCALE_1X :1倍 -STR_GAME_OPTIONS_GUI_SCALE_2X :2倍 -STR_GAME_OPTIONS_GUI_SCALE_3X :3倍 -STR_GAME_OPTIONS_GUI_SCALE_4X :4倍 -STR_GAME_OPTIONS_GUI_SCALE_5X :5倍 STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}自动体验调查 STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}参与自动体验调查 diff --git a/src/lang/slovak.txt b/src/lang/slovak.txt index cc0bac5fc6..810345a117 100644 --- a/src/lang/slovak.txt +++ b/src/lang/slovak.txt @@ -1024,11 +1024,6 @@ STR_GAME_OPTIONS_VOLUME :Hlasitosť STR_GAME_OPTIONS_SFX_VOLUME :Zvukové efekty STR_GAME_OPTIONS_MUSIC_VOLUME :Hudba -STR_GAME_OPTIONS_VOLUME_0 :0 % -STR_GAME_OPTIONS_VOLUME_25 :25 % -STR_GAME_OPTIONS_VOLUME_50 :50 % -STR_GAME_OPTIONS_VOLUME_75 :75 % -STR_GAME_OPTIONS_VOLUME_100 :100 % STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Mena STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Výber menovej jednotky @@ -1126,11 +1121,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Začiark STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Vyhladzovacie písma STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Začiarknite toto políčko, ak chcete vyhladiť písma s meniteľnou veľkosťou -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automatizovaný prieskum STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Zúčastniť sa automatizovaného prieskumu diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index b0fbc6c593..b68ce41e18 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -957,11 +957,6 @@ STR_GAME_OPTIONS_VOLUME :Volumen STR_GAME_OPTIONS_SFX_VOLUME :Efectos de sonido STR_GAME_OPTIONS_MUSIC_VOLUME :Música -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Unidad monetaria STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Selecciona la nnidad monetaria @@ -1059,11 +1054,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Marca es STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Tipos de letra suavizadas STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Marca esta casilla para suavizar los tipos de letra escalables -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Encuesta automática STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Participar en la encuesta automática diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index 86a964d782..cec1e90692 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -1030,11 +1030,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Marca es STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Tipos de letra suavizadas STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Marca esta casilla para suavizar los tipos de letra escalables. -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Encuesta automática STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Participar en la encuesta automática diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index 06793fe8fb..575581bfef 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -956,11 +956,6 @@ STR_GAME_OPTIONS_VOLUME :Volym STR_GAME_OPTIONS_SFX_VOLUME :Ljudeffekter STR_GAME_OPTIONS_MUSIC_VOLUME :Musik -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Valutaenheter STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Välj valutaenhet @@ -1058,11 +1053,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Kryssa i STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Anti-alias-typsnitt STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Kryssa i den här rutan för anti-aliasing av typsnitt med justerbar storlek -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Automatisk undersökning STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Delta i en automatisk undersökning diff --git a/src/lang/tamil.txt b/src/lang/tamil.txt index 59bbd6a5cf..d1bab34a0c 100644 --- a/src/lang/tamil.txt +++ b/src/lang/tamil.txt @@ -928,11 +928,6 @@ STR_GAME_OPTIONS_VOLUME :ஒலி அ STR_GAME_OPTIONS_SFX_VOLUME :ஒலி விளைவுகள் STR_GAME_OPTIONS_MUSIC_VOLUME :இசை -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}நாணய பிரிவுகள் STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}நாணய பிரிவு தேர்ந்தெடுத்தல் @@ -1023,11 +1018,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE :{BLACK}வழ STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}மாற்றுப்பெயர் எதிர்ப்பு எழுத்துருக்கள் STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}மறுஅளவிடக்கூடிய மாற்றுப்பெயர் எதிர்ப்பு எழுத்துருக்களுக்கு இந்தப் பெட்டியைத் தேர்வு செய்யவும். -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}தானியங்கி கணக்கெடுப்பு STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}தானியங்கி கணக்கெடுப்பில் சேர் diff --git a/src/lang/traditional_chinese.txt b/src/lang/traditional_chinese.txt index cf4d45ea54..cf2b3ea0dd 100644 --- a/src/lang/traditional_chinese.txt +++ b/src/lang/traditional_chinese.txt @@ -931,11 +931,6 @@ STR_GAME_OPTIONS_VOLUME :音量 STR_GAME_OPTIONS_SFX_VOLUME :音效 STR_GAME_OPTIONS_MUSIC_VOLUME :音樂 -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}幣值單位 STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}選擇幣值單位 @@ -1031,11 +1026,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}勾選 STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}反鋸齒字體 STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}勾選此方框以使用反鋸齒字體。 -STR_GAME_OPTIONS_GUI_SCALE_1X :1倍 -STR_GAME_OPTIONS_GUI_SCALE_2X :2倍 -STR_GAME_OPTIONS_GUI_SCALE_3X :3倍 -STR_GAME_OPTIONS_GUI_SCALE_4X :4倍 -STR_GAME_OPTIONS_GUI_SCALE_5X :5倍 STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}自動問卷 STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}參與自動問卷 diff --git a/src/lang/turkish.txt b/src/lang/turkish.txt index 2035307a74..c6c93827cf 100644 --- a/src/lang/turkish.txt +++ b/src/lang/turkish.txt @@ -957,11 +957,6 @@ STR_GAME_OPTIONS_VOLUME :Ses seviyesi STR_GAME_OPTIONS_SFX_VOLUME :Ses efektleri STR_GAME_OPTIONS_MUSIC_VOLUME :Müzik -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Para birimleri STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Para birimi seçimi @@ -1059,11 +1054,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Yazı ti STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Yazı tipi kenarlarını yumuşatma STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Yeniden boyutlandırılabilir yazı tiplerinin kenarlarını yumuşatmak için bu kutuyu işaretleyin -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Otomatik anket STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Otomatik ankete katılın diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index 208f3a2706..ed50872061 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -1093,11 +1093,6 @@ STR_GAME_OPTIONS_VOLUME :Гучніст STR_GAME_OPTIONS_SFX_VOLUME :Звукові ефекти STR_GAME_OPTIONS_MUSIC_VOLUME :Музика -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Грошова одиниця STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Виберіть грошову одиницю @@ -1195,11 +1190,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Позн STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Згладжування шрифтів STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Позначте цей прапорець для того, щоби згладжувати шрифти змінних розмірів -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Автоматизований збір даних STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Брати участь в автоматизованому зборі даних diff --git a/src/lang/vietnamese.txt b/src/lang/vietnamese.txt index fb095abf3c..0bc0c86f29 100644 --- a/src/lang/vietnamese.txt +++ b/src/lang/vietnamese.txt @@ -956,11 +956,6 @@ STR_GAME_OPTIONS_VOLUME :Âm lượng STR_GAME_OPTIONS_SFX_VOLUME :Hiệu ứng âm thanh STR_GAME_OPTIONS_MUSIC_VOLUME :Âm nhạc -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Đơn vị tiền tệ STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Lựa chọn đơn vị tiền tệ @@ -1058,11 +1053,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Tuỳ ch STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Phông chữ chống răng cưa STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Tuỳ chọn này để chống răng cưa phông chữ co dãn được -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Khảo sát tự động STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Tham gia khảo sát tự động diff --git a/src/lang/welsh.txt b/src/lang/welsh.txt index b0db82c4b5..68400e83b5 100644 --- a/src/lang/welsh.txt +++ b/src/lang/welsh.txt @@ -956,11 +956,6 @@ STR_GAME_OPTIONS_VOLUME :Lefel Sain STR_GAME_OPTIONS_SFX_VOLUME :Effeithiau sŵn STR_GAME_OPTIONS_MUSIC_VOLUME :Cerddoriaeth -STR_GAME_OPTIONS_VOLUME_0 :0% -STR_GAME_OPTIONS_VOLUME_25 :25% -STR_GAME_OPTIONS_VOLUME_50 :50% -STR_GAME_OPTIONS_VOLUME_75 :75% -STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Uned Arian STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Dewis unedau arian @@ -1058,11 +1053,6 @@ STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Marciwch STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Gwynebfathau dadamgenu STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Marciwch y blwch hwn i ddadamgennu ffontiau y gellir eu hailfeintio -STR_GAME_OPTIONS_GUI_SCALE_1X :1x -STR_GAME_OPTIONS_GUI_SCALE_2X :2x -STR_GAME_OPTIONS_GUI_SCALE_3X :3x -STR_GAME_OPTIONS_GUI_SCALE_4X :4x -STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Arolwg awtomatig STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Cymryd rhan mewn arolwg awtomatig From 115ac2629bb395bed14363158fd1cdcce7f50b4c Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 4 May 2024 09:41:58 +0100 Subject: [PATCH 30/30] Cleanup: Remove TileMatrix that hasn't been used for 4+ years. (#12621) This 'nice' structure was left around from #8258 just in case it might be used again. Spoiler alert: it hasn't. This removes manual memory management. And otherwise unused and untested code. --- src/CMakeLists.txt | 1 - src/saveload/town_sl.cpp | 9 ++- src/tilematrix_type.hpp | 144 --------------------------------------- 3 files changed, 6 insertions(+), 148 deletions(-) delete mode 100644 src/tilematrix_type.hpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b3339bae04..86abd9f9c1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -476,7 +476,6 @@ add_files( tilearea_type.h tilehighlight_func.h tilehighlight_type.h - tilematrix_type.hpp timetable.h timetable_cmd.cpp timetable_cmd.h diff --git a/src/saveload/town_sl.cpp b/src/saveload/town_sl.cpp index 0390cb0792..e09bf9d444 100644 --- a/src/saveload/town_sl.cpp +++ b/src/saveload/town_sl.cpp @@ -18,12 +18,9 @@ #include "../landscape.h" #include "../subsidy_func.h" #include "../strings_func.h" -#include "../tilematrix_type.hpp" #include "../safeguards.h" -typedef TileMatrix AcceptanceMatrix; - /** * Rebuild all the cached variables of towns. */ @@ -182,6 +179,12 @@ public: }; class SlTownAcceptanceMatrix : public DefaultSaveLoadHandler { +private: + /** Compatibility struct with just enough of TileMatrix to facilitate loading. */ + struct AcceptanceMatrix { + TileArea area; + static const uint GRID = 4; + }; public: inline static const SaveLoad description[] = { SLE_VAR(AcceptanceMatrix, area.tile, SLE_UINT32), diff --git a/src/tilematrix_type.hpp b/src/tilematrix_type.hpp deleted file mode 100644 index 006267b5bd..0000000000 --- a/src/tilematrix_type.hpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * This file is part of OpenTTD. - * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. - * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . - */ - -/** @file tilematrix_type.hpp Template for storing a value per area of the map. */ - -#ifndef TILEMATRIX_TYPE_HPP -#define TILEMATRIX_TYPE_HPP - -#include "core/alloc_func.hpp" -#include "tilearea_type.h" - -/** - * A simple matrix that stores one value per N*N square of the map. - * Storage is only allocated for the part of the map that has values - * assigned. - * - * @note No constructor is called for newly allocated values, you - * have to do this yourself if needed. - * @tparam T The type of the stored items. - * @tparam N Grid size. - */ -template -class TileMatrix { - - /** Allocates space for a new tile in the matrix. - * @param tile Tile to add. - */ - void AllocateStorage(TileIndex tile) - { - uint old_left = TileX(this->area.tile) / N; - uint old_top = TileY(this->area.tile) / N; - uint old_w = this->area.w / N; - uint old_h = this->area.h / N; - - /* Add the square the tile is in to the tile area. We do this - * by adding top-left and bottom-right of the square. */ - uint grid_x = (TileX(tile) / N) * N; - uint grid_y = (TileY(tile) / N) * N; - this->area.Add(TileXY(grid_x, grid_y)); - this->area.Add(TileXY(grid_x + N - 1, grid_y + N - 1)); - - /* Allocate new storage. */ - T *new_data = CallocT(this->area.w / N * this->area.h / N); - - if (old_w > 0) { - /* Copy old data if present. */ - uint offs_x = old_left - TileX(this->area.tile) / N; - uint offs_y = old_top - TileY(this->area.tile) / N; - - for (uint row = 0; row < old_h; row++) { - MemCpyT(&new_data[(row + offs_y) * this->area.w / N + offs_x], &this->data[row * old_w], old_w); - } - } - - free(this->data); - this->data = new_data; - } - -public: - static const uint GRID = N; - - TileArea area; ///< Area covered by the matrix. - - T *data; ///< Pointer to data array. - - TileMatrix() : area(INVALID_TILE, 0, 0), data(nullptr) {} - - ~TileMatrix() - { - free(this->data); - } - - /** - * Get the total covered area. - * @return The area covered by the matrix. - */ - const TileArea &GetArea() const - { - return this->area; - } - - /** - * Get the area of the matrix square that contains a specific tile. - * @param tile The tile to get the map area for. - * @param extend Extend the area by this many squares on all sides. - * @return Tile area containing the tile. - */ - static TileArea GetAreaForTile(TileIndex tile, uint extend = 0) - { - uint tile_x = (TileX(tile) / N) * N; - uint tile_y = (TileY(tile) / N) * N; - uint w = N, h = N; - - w += std::min(extend * N, tile_x); - h += std::min(extend * N, tile_y); - - tile_x -= std::min(extend * N, tile_x); - tile_y -= std::min(extend * N, tile_y); - - w += std::min(extend * N, Map::SizeX() - tile_x - w); - h += std::min(extend * N, Map::SizeY() - tile_y - h); - - return TileArea(TileXY(tile_x, tile_y), w, h); - } - - /** - * Extend the coverage area to include a tile. - * @param tile The tile to include. - */ - void Add(TileIndex tile) - { - if (!this->area.Contains(tile)) { - this->AllocateStorage(tile); - } - } - - /** - * Get the value associated to a tile index. - * @param tile The tile to get the value for. - * @return Pointer to the value. - */ - T *Get(TileIndex tile) - { - this->Add(tile); - - tile -= this->area.tile; - uint x = TileX(tile) / N; - uint y = TileY(tile) / N; - - return &this->data[y * this->area.w / N + x]; - } - - /** Array access operator, see #Get. */ - inline T &operator[](TileIndex tile) - { - return *this->Get(tile); - } -}; - -#endif /* TILEMATRIX_TYPE_HPP */