Merge branch 'master' into jgrpp

# Conflicts:
#	src/company_cmd.cpp
#	src/company_func.h
#	src/core/overflowsafe_type.hpp
#	src/engine.cpp
#	src/music/midifile.cpp
#	src/network/network_command.cpp
#	src/newgrf_debug_gui.cpp
#	src/newgrf_roadstop.h
#	src/newgrf_spritegroup.cpp
#	src/os/macosx/crashlog_osx.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/pathfinder/yapf/yapf_common.hpp
#	src/road_gui.cpp
#	src/saveload/engine_sl.cpp
#	src/script/api/script_depotlist.cpp
#	src/script/api/script_roadtypelist.cpp
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/strings.cpp
#	src/table/settings/game_settings.ini
This commit is contained in:
Jonathan G Rennison
2024-01-05 13:37:52 +00:00
136 changed files with 1198 additions and 1032 deletions

View File

@@ -132,7 +132,7 @@ public:
}
/** remove and return the open node specified by a key */
inline Titem_& PopOpenNode(const Key &key)
inline Titem_ &PopOpenNode(const Key &key)
{
Titem_ &item = m_open.Pop(key);
uint idxPop = m_open_queue.FindIndex(item);
@@ -161,7 +161,7 @@ public:
}
/** Get a particular item. */
inline Titem_& ItemAt(int idx)
inline Titem_ &ItemAt(int idx)
{
return m_arr[idx];
}

View File

@@ -85,14 +85,14 @@ public:
protected:
/** to access inherited path finder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}
public:
/** return current settings (can be custom - company based - but later) */
inline const YAPFSettings& PfGetSettings() const
inline const YAPFSettings &PfGetSettings() const
{
return _settings_game.pf.yapf;
}
@@ -167,7 +167,7 @@ public:
* Calls NodeList::CreateNewNode() - allocates new node that can be filled and used
* as argument for AddStartupNode() or AddNewNode()
*/
inline Node& CreateNewNode()
inline Node &CreateNewNode()
{
Node &node = *m_nodes.CreateNewNode();
return node;

View File

@@ -24,7 +24,7 @@ protected:
TrackdirBits m_orgTrackdirs; ///< origin trackdir mask
/** to access inherited path finder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
/* use two lines to avoid false-positive Undefined Behavior Sanitizer warnings when alignof(Tpf) > alignof(*this) and *this does not meet alignof(Tpf) */
Tpf *p = static_cast<Tpf *>(this);
@@ -70,7 +70,7 @@ protected:
bool m_treat_first_red_two_way_signal_as_eol; ///< in some cases (leaving station) we need to handle first two-way signal differently
/** to access inherited path finder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
/* use two lines to avoid false-positive Undefined Behavior Sanitizer warnings when alignof(Tpf) > alignof(*this) and *this does not meet alignof(Tpf) */
Tpf *p = static_cast<Tpf *>(this);

View File

@@ -63,7 +63,7 @@ protected:
LocalCache m_local_cache;
/** to access inherited path finder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}
@@ -138,7 +138,7 @@ struct CSegmentCostCacheT : public CSegmentCostCacheBase {
m_heap.Clear();
}
inline Tsegment& Get(Key &key, bool *found)
inline Tsegment &Get(Key &key, bool *found)
{
Tsegment *item = m_map.Find(key);
if (item == nullptr) {
@@ -174,12 +174,12 @@ protected:
inline CYapfSegmentCostCacheGlobalT() : m_global_cache(stGetGlobalCache()) {};
/** to access inherited path finder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}
inline static Cache& stGetGlobalCache()
inline static Cache &stGetGlobalCache()
{
static int last_rail_change_counter = 0;
static Cache C;

View File

@@ -79,7 +79,7 @@ protected:
}
/** to access inherited path finder */
Tpf& Yapf()
Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}

View File

@@ -40,7 +40,7 @@ public:
typedef typename Node::Key Key; ///< key to hash tables
/** to access inherited path finder */
Tpf& Yapf()
Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}
@@ -83,7 +83,7 @@ public:
typedef typename Types::TrackFollower TrackFollower; ///< TrackFollower. Need to typedef for gcc 2.95
/** to access inherited path finder */
Tpf& Yapf()
Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}
@@ -131,7 +131,7 @@ protected:
bool m_any_depot;
/** to access inherited path finder */
Tpf& Yapf()
Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}

View File

@@ -97,7 +97,7 @@ struct CYapfNodeT {
return m_key.m_td;
}
inline const Tkey_& GetKey() const
inline const Tkey_ &GetKey() const
{
return m_key;
}

View File

@@ -82,7 +82,7 @@ struct CYapfRailSegment
, m_hash_next(nullptr)
{}
inline const Key& GetKey() const
inline const Key &GetKey() const
{
return m_key;
}

View File

@@ -73,7 +73,7 @@ public:
protected:
/** to access inherited pathfinder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}
@@ -273,7 +273,7 @@ public:
protected:
/** to access inherited path finder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}
@@ -384,7 +384,7 @@ public:
protected:
/** to access inherited path finder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}
@@ -471,7 +471,7 @@ public:
protected:
/** to access inherited path finder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}

View File

@@ -41,7 +41,7 @@ protected:
CYapfCostRoadT() : m_max_cost(0) {};
/** to access inherited path finder */
Tpf& Yapf()
Tpf &Yapf()
{
/* use two lines to avoid false-positive Undefined Behavior Sanitizer warnings when alignof(Tpf) > alignof(*this) and *this does not meet alignof(Tpf) */
Tpf *p = static_cast<Tpf *>(this);
@@ -231,7 +231,7 @@ public:
typedef typename Node::Key Key; ///< key to hash tables
/** to access inherited path finder */
Tpf& Yapf()
Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}
@@ -308,7 +308,7 @@ public:
protected:
/** to access inherited path finder */
Tpf& Yapf()
Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}
@@ -410,7 +410,7 @@ public:
protected:
/** to access inherited path finder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}

View File

@@ -47,14 +47,14 @@ public:
protected:
/** to access inherited path finder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
return *static_cast<Tpf*>(this);
}
public:
/** Called by YAPF to detect if node ends in the desired destination */
inline bool PfDetectDestination(Node& n)
inline bool PfDetectDestination(Node &n)
{
return PfDetectDestinationTile(n.m_segment_last_tile, n.m_segment_last_td);
}
@@ -72,7 +72,7 @@ public:
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate
*/
inline bool PfCalcEstimate(Node& n)
inline bool PfCalcEstimate(Node &n)
{
static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
static const int dg_dir_to_y_offs[] = {0, 1, 0, -1};
@@ -111,7 +111,7 @@ public:
protected:
/** to access inherited path finder */
inline Tpf& Yapf()
inline Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}
@@ -254,7 +254,7 @@ public:
protected:
/** to access inherited path finder */
Tpf& Yapf()
Tpf &Yapf()
{
return *static_cast<Tpf *>(this);
}