diff --git a/src/articulated_vehicles.cpp b/src/articulated_vehicles.cpp index 44a45ac7fc..cfaab25986 100644 --- a/src/articulated_vehicles.cpp +++ b/src/articulated_vehicles.cpp @@ -225,20 +225,6 @@ CargoTypes GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial return union_mask; } -/** - * Ands the refit_masks of all articulated parts. - * @param engine the first part - * @param include_initial_cargo_type if true the default cargo type of the vehicle is included; if false only the refit_mask - * @return bit mask of CargoIDs which are a refit option for every articulated part (with default capacity > 0) - */ -CargoTypes GetIntersectionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type) -{ - CargoTypes union_mask, intersection_mask; - GetArticulatedRefitMasks(engine, include_initial_cargo_type, &union_mask, &intersection_mask); - return intersection_mask; -} - - /** * Tests if all parts of an articulated vehicle are refitted to the same cargo. * Note: Vehicles not carrying anything are ignored diff --git a/src/articulated_vehicles.h b/src/articulated_vehicles.h index a98833b003..819c27d3c1 100644 --- a/src/articulated_vehicles.h +++ b/src/articulated_vehicles.h @@ -18,7 +18,6 @@ CargoArray GetCapacityOfArticulatedParts(EngineID engine); void AddArticulatedParts(Vehicle *first); void GetArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type, CargoTypes *union_mask, CargoTypes *intersection_mask); CargoTypes GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type); -CargoTypes GetIntersectionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type); bool IsArticulatedVehicleCarryingDifferentCargoes(const Vehicle *v, CargoID *cargo_type); bool IsArticulatedVehicleRefittable(EngineID engine); bool IsArticulatedEngine(EngineID engine_type); diff --git a/src/group.h b/src/group.h index ca867985bc..05a203a53c 100644 --- a/src/group.h +++ b/src/group.h @@ -110,7 +110,6 @@ Money GetGroupProfitLastYearMinAge(CompanyID company, GroupID id_g, VehicleType void SetTrainGroupID(Train *v, GroupID grp); void UpdateTrainGroupID(Train *v); -void RemoveVehicleFromGroup(const Vehicle *v); void RemoveAllGroupsForCompany(const CompanyID company); bool GroupIsInGroup(GroupID search, GroupID group); diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index e202177884..4fded9ebbf 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -714,19 +714,6 @@ CommandCost CmdSetGroupFlag(DoCommandFlag flags, GroupID group_id, GroupFlags fl return CommandCost(); } -/** - * Decrease the num_vehicle variable before delete an front engine from a group - * @note Called in CmdSellRailWagon and DeleteLasWagon, - * @param v FrontEngine of the train we want to remove. - */ -void RemoveVehicleFromGroup(const Vehicle *v) -{ - if (!v->IsPrimaryVehicle()) return; - - if (!IsDefaultGroupID(v->group_id)) GroupStatistics::CountVehicle(v, -1); -} - - /** * Affect the groupID of a train to new_g. * @note called in CmdAddVehicleGroup and CmdMoveRailVehicle diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index a4b984ca88..40c4d87156 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -744,8 +744,6 @@ struct TextRefStack { this->grffile = grffile; this->used = true; } - - void RewindStack() { this->position = 0; } }; /** The stack that is used for TTDP compatible string code parsing */ @@ -819,11 +817,6 @@ void StopTextRefStackUsage() _newgrf_textrefstack.used = false; } -void RewindTextRefStack() -{ - _newgrf_textrefstack.RewindStack(); -} - /** * FormatString for NewGRF specific "magic" string control codes * @param scc the string control code that has been read diff --git a/src/newgrf_text.h b/src/newgrf_text.h index c3dfa08cee..66f591f588 100644 --- a/src/newgrf_text.h +++ b/src/newgrf_text.h @@ -45,7 +45,6 @@ bool CheckGrfLangID(byte lang_id, byte grf_version); void StartTextRefStackUsage(const struct GRFFile *grffile, byte numEntries, const uint32_t *values = nullptr); void StopTextRefStackUsage(); -void RewindTextRefStack(); bool UsingNewGRFTextStack(); struct TextRefStack *CreateTextRefStackBackup(); void RestoreTextRefStackBackup(struct TextRefStack *backup); diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 35133be345..756cf2e317 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -87,16 +87,6 @@ class BuildObjectWindow : public Window { return objclass->GetSpec(_selected_object_index)->IsAvailable(); } - /** - * Calculate the number of columns of the #WID_BO_SELECT_MATRIX widget. - * @return Number of columns in the matrix. - */ - uint GetMatrixColumnCount() - { - const NWidgetBase *matrix = this->GetWidget(WID_BO_SELECT_MATRIX); - return 1 + (matrix->current_x - matrix->smallest_x) / matrix->resize_x; - } - public: BuildObjectWindow(WindowDesc *desc, WindowNumber number) : Window(desc), info_height(1), filter_editbox(EDITBOX_MAX_SIZE * MAX_CHAR_LENGTH, EDITBOX_MAX_SIZE) { diff --git a/src/order_base.h b/src/order_base.h index c607d97942..577dbe4c47 100644 --- a/src/order_base.h +++ b/src/order_base.h @@ -350,9 +350,6 @@ public: */ inline uint GetNumVehicles() const { return this->num_vehicles; } - bool IsVehicleInSharedOrdersList(const Vehicle *v) const; - int GetPositionInSharedOrderList(const Vehicle *v) const; - /** * Adds the given vehicle to this shared order list. * @note This is supposed to be called after the vehicle has been inserted diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index e20eac5056..fc32913bdc 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -571,31 +571,6 @@ void OrderList::RemoveVehicle(Vehicle *v) if (v == this->first_shared) this->first_shared = v->NextShared(); } -/** - * Checks whether a vehicle is part of the shared vehicle chain. - * @param v is the vehicle to search in the shared vehicle chain. - */ -bool OrderList::IsVehicleInSharedOrdersList(const Vehicle *v) const -{ - for (const Vehicle *v_shared = this->first_shared; v_shared != nullptr; v_shared = v_shared->NextShared()) { - if (v_shared == v) return true; - } - - return false; -} - -/** - * Gets the position of the given vehicle within the shared order vehicle list. - * @param v is the vehicle of which to get the position - * @return position of v within the shared vehicle chain. - */ -int OrderList::GetPositionInSharedOrderList(const Vehicle *v) const -{ - int count = 0; - for (const Vehicle *v_shared = v->PreviousShared(); v_shared != nullptr; v_shared = v_shared->PreviousShared()) count++; - return count; -} - /** * Checks whether all orders of the list have a filled timetable. * @return whether all orders have a filled timetable. diff --git a/src/pathfinder/yapf/yapf_road.cpp b/src/pathfinder/yapf/yapf_road.cpp index 13854dbfcc..86749c4f23 100644 --- a/src/pathfinder/yapf/yapf_road.cpp +++ b/src/pathfinder/yapf/yapf_road.cpp @@ -427,12 +427,6 @@ public: return next_trackdir; } - static uint stDistanceToTile(const RoadVehicle *v, TileIndex tile) - { - Tpf pf; - return pf.DistanceToTile(v, tile); - } - inline uint DistanceToTile(const RoadVehicle *v, TileIndex dst_tile) { /* handle special case - when current tile is the destination tile */ diff --git a/src/road.cpp b/src/road.cpp index d2b4144fdd..bf607fdb36 100644 --- a/src/road.cpp +++ b/src/road.cpp @@ -270,39 +270,3 @@ RoadType GetRoadTypeByLabel(RoadTypeLabel label, bool allow_alternate_labels) /* No matching label was found, so it is invalid */ return INVALID_ROADTYPE; } - -/** - * Returns the available RoadSubTypes for the provided RoadType - * If the given company is valid then will be returned a list of the available sub types at the current date, while passing - * a deity company will make all the sub types available - * @param rt the RoadType to filter - * @param c the company ID to check the roadtype against - * @param any_date whether to return only currently introduced roadtypes or also future ones - * @returns the existing RoadSubTypes - */ -RoadTypes ExistingRoadTypes(CompanyID c) -{ - /* Check only players which can actually own vehicles, editor and gamescripts are considered deities */ - if (c < OWNER_END) { - const Company *company = Company::GetIfValid(c); - if (company != nullptr) return company->avail_roadtypes; - } - - RoadTypes known_roadtypes = ROADTYPES_NONE; - - /* Find used roadtypes */ - for (Engine *e : Engine::IterateType(VEH_ROAD)) { - /* Check if the roadtype can be used in the current climate */ - if (!HasBit(e->info.climates, _settings_game.game_creation.landscape)) continue; - - /* Check whether available for all potential companies */ - if (e->company_avail != MAX_UVALUE(CompanyMask)) continue; - - known_roadtypes |= GetRoadTypeInfo(e->u.road.roadtype)->introduces_roadtypes; - } - - /* Get the date introduced roadtypes as well. */ - known_roadtypes = AddDateIntroducedRoadTypes(known_roadtypes, CalendarTime::MAX_DATE); - - return known_roadtypes; -} diff --git a/src/strings.cpp b/src/strings.cpp index 0eb4393dc6..56f7ed452f 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1957,14 +1957,6 @@ const char *GetCurrentLocale(const char *param) const char *GetCurrentLocale(const char *param); #endif /* !(defined(_WIN32) || defined(__APPLE__)) */ -bool StringIDSorter(const StringID &a, const StringID &b) -{ - std::string stra = GetString(a); - std::string strb = GetString(b); - - return StrNaturalCompare(stra, strb) < 0; -} - /** * Get the language with the given NewGRF language ID. * @param newgrflangid NewGRF languages ID to check. diff --git a/src/strings_func.h b/src/strings_func.h index 03fb1becb2..38417a85b7 100644 --- a/src/strings_func.h +++ b/src/strings_func.h @@ -110,8 +110,6 @@ extern TextDirection _current_text_dir; ///< Text direction of the currently sel void InitializeLanguagePacks(); const char *GetCurrentLanguageIsoCode(); -bool StringIDSorter(const StringID &a, const StringID &b); - /** * A searcher for missing glyphs. */ diff --git a/src/vehicle.cpp b/src/vehicle.cpp index d995547d63..2fc8ee6cc1 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2353,32 +2353,6 @@ void Vehicle::HandleLoading(bool mode) this->IncrementImplicitOrderIndex(); } -/** - * Get a map of cargoes and free capacities in the consist. - * @param capacities Map to be filled with cargoes and capacities. - */ -void Vehicle::GetConsistFreeCapacities(std::map &capacities) const -{ - for (const Vehicle *v = this; v != nullptr; v = v->Next()) { - if (v->cargo_cap == 0) continue; - auto pair = capacities.find(v->cargo_type); - if (pair == capacities.end()) { - capacities[v->cargo_type] = v->cargo_cap - v->cargo.StoredCount(); - } else { - pair->second += v->cargo_cap - v->cargo.StoredCount(); - } - } -} - -uint Vehicle::GetConsistTotalCapacity() const -{ - uint result = 0; - for (const Vehicle *v = this; v != nullptr; v = v->Next()) { - result += v->cargo_cap; - } - return result; -} - /** * Send this vehicle to the depot using the given command(s). * @param flags the command flags (like execute and such). diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 62de9a368a..74369a856c 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -391,10 +391,6 @@ public: void HandleLoading(bool mode = false); - void GetConsistFreeCapacities(std::map &capacities) const; - - uint GetConsistTotalCapacity() const; - /** * Marks the vehicles to be redrawn and updates cached variables *