From: Debian Games Team Date: Tue, 18 Aug 2020 09:48:00 +0000 (+0100) Subject: Fix FTBFS with gcc-10 X-Git-Tag: archive/raspbian/0.0.25b-1.1+rpi1~1^2^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=68c2acea1213228d5b2aa5e18ec928a4724aad05;p=0ad.git Fix FTBFS with gcc-10 Origin: upstream, https://trac.wildfiregames.com/changeset/23794 Bug: https://trac.wildfiregames.com/ticket/5756 Bug-Debian: https://bugs.debian.org/956967 Gbp-Pq: Name fix-ftbfs-gcc-10.patch --- diff --git a/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp b/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp index 9f2ab3e..41c5cc0 100644 --- a/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp +++ b/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp @@ -329,16 +329,3 @@ void FArchiveXML::WritePhysicsRigidBodyParameters(FCDPhysicsRigidBodyParameters* FArchiveXML::LetWriteObject(physicsRigidBodyParameters->GetPhysicsShape(i), techniqueNode); } } - -template -xmlNode* FArchiveXML::AddPhysicsParameter(xmlNode* parentNode, const char* name, FCDParameterAnimatableT& value) -{ - xmlNode* paramNode = AddChild(parentNode, name); - AddContent(paramNode, FUStringConversion::ToString((TYPE&) value)); - if (value.IsAnimated()) - { - const FCDAnimated* animated = value.GetAnimated(); - FArchiveXML::WriteAnimatedValue(animated, paramNode, name); - } - return paramNode; -} diff --git a/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h b/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h index 88d7cc9..9be5a8b 100644 --- a/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h +++ b/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h @@ -553,7 +553,16 @@ public: static void WritePhysicsRigidBodyParameters(FCDPhysicsRigidBodyParameters* physicsRigidBodyParameters, xmlNode* techniqueNode); template - static xmlNode* AddPhysicsParameter(xmlNode* parentNode, const char* name, FCDParameterAnimatableT& value); + static xmlNode* AddPhysicsParameter(xmlNode* parentNode, const char* name, FCDParameterAnimatableT& value) { + xmlNode* paramNode = AddChild(parentNode, name); + AddContent(paramNode, FUStringConversion::ToString((TYPE&) value)); + if (value.IsAnimated()) + { + const FCDAnimated* animated = value.GetAnimated(); + FArchiveXML::WriteAnimatedValue(animated, paramNode, name); + } + return paramNode; + } // diff --git a/source/simulation2/helpers/HierarchicalPathfinder.cpp b/source/simulation2/helpers/HierarchicalPathfinder.cpp index 7433a85..5d0f4f8 100644 --- a/source/simulation2/helpers/HierarchicalPathfinder.cpp +++ b/source/simulation2/helpers/HierarchicalPathfinder.cpp @@ -697,28 +697,6 @@ void HierarchicalPathfinder::FindNearestNavcellInRegions(const std::set& reachable, pass_class_t passClass) -{ - // Flood-fill the region graph, starting at 'from', - // collecting all the regions that are reachable via edges - - std::vector open; - open.push_back(from); - reachable.insert(from); - - while (!open.empty()) - { - RegionID curr = open.back(); - open.pop_back(); - - for (const RegionID& region : m_Edges[passClass][curr]) - // Add to the reachable set; if this is the first time we added - // it then also add it to the open list - if (reachable.insert(region).second) - open.push_back(region); - } -} - void HierarchicalPathfinder::FindPassableRegions(std::set& regions, pass_class_t passClass) { // Construct a set of all regions of all chunks for this pass class diff --git a/source/simulation2/helpers/HierarchicalPathfinder.h b/source/simulation2/helpers/HierarchicalPathfinder.h index d928838..86bce03 100644 --- a/source/simulation2/helpers/HierarchicalPathfinder.h +++ b/source/simulation2/helpers/HierarchicalPathfinder.h @@ -148,7 +148,27 @@ private: void FindEdges(u8 ci, u8 cj, pass_class_t passClass, EdgesMap& edges); - void FindReachableRegions(RegionID from, std::set& reachable, pass_class_t passClass); + void FindReachableRegions(RegionID from, std::set& reachable, pass_class_t passClass) + { + // Flood-fill the region graph, starting at 'from', + // collecting all the regions that are reachable via edges + + std::vector open; + open.push_back(from); + reachable.insert(from); + + while (!open.empty()) + { + RegionID curr = open.back(); + open.pop_back(); + + for (const RegionID& region : m_Edges[passClass][curr]) + // Add to the reachable set; if this is the first time we added + // it then also add it to the open list + if (reachable.insert(region).second) + open.push_back(region); + } + } void FindPassableRegions(std::set& regions, pass_class_t passClass);