0ad: fix build for gcc-10

This commit is contained in:
Đoàn Trần Công Danh 2021-01-24 12:02:03 +07:00
parent d59a755c2a
commit f245d61490
2 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,23 @@
Index: libraries/source/fcollada/src/Makefile
===================================================================
--- libraries/source/fcollada/src/Makefile.orig
+++ libraries/source/fcollada/src/Makefile
@@ -224,7 +224,7 @@ OBJECTS_RELEASE = $(addprefix output/rel
OBJECTS_TEST = $(addprefix output/test/,$(SOURCE:.cpp=.o) $(TEST_SOURCE:.cpp=.o))
OBJECTS_ALL = $(OBJECTS_DEBUG) $(OBJECTS_RELEASE) $(OBJECTS_TEST)
-all: output/libFColladaSD.a output/libFColladaSR.a install
+all: output/libFColladaSR.a install
output_dirs:
bash -c 'mkdir -p output/{debug,release,test}/{FCollada/{FCDocument,FMath,FUtils,FColladaTest/{FCTestAssetManagement,FCTestExportImport,FCTestXRef}},FColladaPlugins/FArchiveXML}'
@@ -244,8 +244,7 @@ output/libFColladaSR.a: $(OBJECTS_RELEAS
output/FColladaTest: $(OBJECTS_TEST) | output_dirs
$(CXX) -o $@ $(LDFLAGS) $(OBJECTS_TEST) $(LIBS)
-install: output/libFColladaSD.a output/libFColladaSR.a
- cp output/libFColladaSD.a ../lib/libFColladaSD.a
+install: output/libFColladaSR.a
cp output/libFColladaSR.a ../lib/libFColladaSR.a
dfile = $(@:.o=.d)

View File

@ -0,0 +1,43 @@
Index: libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp
===================================================================
--- libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp.orig
+++ libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp
@@ -329,16 +329,3 @@ void FArchiveXML::WritePhysicsRigidBodyP
FArchiveXML::LetWriteObject(physicsRigidBodyParameters->GetPhysicsShape(i), techniqueNode);
}
}
-
-template <class TYPE, int QUAL>
-xmlNode* FArchiveXML::AddPhysicsParameter(xmlNode* parentNode, const char* name, FCDParameterAnimatableT<TYPE,QUAL>& 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;
-}
Index: libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h
===================================================================
--- libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h.orig
+++ libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h
@@ -573,4 +573,17 @@ public:
static xmlNode* WriteLibrary(FCDLibrary<T>* library, xmlNode* node);
};
+template <class TYPE, int QUAL>
+xmlNode* FArchiveXML::AddPhysicsParameter(xmlNode* parentNode, const char* name, FCDParameterAnimatableT<TYPE,QUAL>& 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;
+}
+
#endif //_FCPARCHIVECOLLADA_H_