From c39dfdfb1db301e7d06ab099b5c2e7124b0377d9 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Sat, 9 Jun 2018 16:17:03 +0200
Subject: Update configure.in to current standards...


diff --git a/cal3d/configure.in b/cal3d/configure.in
index 8e7c5c5..060d899 100644
--- a/cal3d/configure.in
+++ b/cal3d/configure.in
@@ -13,7 +13,7 @@ dnl ************************************************************************
 
 AC_INIT(src/cal3d/cal3d.h)
 
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS(config.h)
 
 AC_CANONICAL_SYSTEM
 
-- 
2.16.4


From 70299fe921c0879f4254720ba88b7b90be8df6db Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 9 Jun 2018 16:20:40 +0200
Subject: Fix gcc7 errors ...


diff --git a/cal3d/src/cal3d/loader.cpp b/cal3d/src/cal3d/loader.cpp
index 005296f..9032810 100644
--- a/cal3d/src/cal3d/loader.cpp
+++ b/cal3d/src/cal3d/loader.cpp
@@ -1308,7 +1308,7 @@ CalCoreKeyframe* CalLoader::loadCoreKeyframe(
   if(!dataSrc.ok())
   {
     dataSrc.setError();
-    return false;
+    return 0;
   }
 
   // allocate a new core keyframe instance
@@ -1928,11 +1928,11 @@ CalCoreSubmesh *CalLoader::loadCoreSubmesh(CalDataSource& dataSrc, int version)
       CalCoreSubMorphTarget * morphTarget = new CalCoreSubMorphTarget();
       if( !morphTarget ) {
          dataSrc.setError();
-         return false;
+         return 0;
       }
       if( !morphTarget->reserve(vertexCount) ) {
          dataSrc.setError();
-         return false;
+         return 0;
       }
 
       std::string morphName;
@@ -1974,7 +1974,7 @@ CalCoreSubmesh *CalLoader::loadCoreSubmesh(CalDataSource& dataSrc, int version)
             }
             if( ! dataSrc.ok() ) {
                dataSrc.setError();
-               return false;
+               return 0;
             }
 
             morphTarget->setBlendVertex(blendVertI, Vertex);
diff --git a/cal3d/src/cal3d/xmlformat.cpp b/cal3d/src/cal3d/xmlformat.cpp
index 2e882ac..eecb00f 100644
--- a/cal3d/src/cal3d/xmlformat.cpp
+++ b/cal3d/src/cal3d/xmlformat.cpp
@@ -89,16 +89,16 @@ static inline bool TexCoordFromXml( cal3d::TiXmlElement * texcoord, char const *
   CalCoreMesh * pCoreMesh, CalCoreSubmesh * pCoreSubmesh)
 {
   if( !ValidateTag(texcoord, tag, pCoreMesh, pCoreSubmesh) ) {
-    return false;
+    return 0;
   }
   cal3d::TiXmlNode * node = texcoord->FirstChild();
   if( !ValidateTag(node, NULL, pCoreMesh, pCoreSubmesh) ) {
-    return false;
+    return 0;
   }
   cal3d::TiXmlText* texcoorddata = node->ToText();
   if(!ValidateTag(texcoorddata , NULL, pCoreMesh, pCoreSubmesh))
   {
-    return false;
+    return 0;
   }
 
   ReadPair( texcoorddata->Value(), &texCoord->u, &texCoord->v );
@@ -129,16 +129,16 @@ static inline bool CalVectorFromXml( cal3d::TiXmlElement * pos, char const * tag
   CalCoreMesh * pCoreMesh, CalCoreSubmesh * pCoreSubmesh)
 {
   if( !ValidateTag(pos, tag, pCoreMesh, pCoreSubmesh) ) {
-    return false;
+    return 0;
   }
   cal3d::TiXmlNode * node = pos->FirstChild();
   if( !ValidateTag(node, NULL, pCoreMesh, pCoreSubmesh) ) {
-    return false;
+    return 0;
   }
   cal3d::TiXmlText* posdata = node->ToText();
   if(!ValidateTag(posdata, NULL, pCoreMesh, pCoreSubmesh))
   {
-    return false;
+    return 0;
   }
   ReadTripleFloat( posdata->Value(), &calVec->x, &calVec->y, &calVec->z );
   return true;
@@ -362,13 +362,13 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
      if(stricmp(firstChild->Attribute("MAGIC"),Cal::SKELETON_XMLFILE_EXTENSION)!=0)
      {
         CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
      }
 
      if(atoi(firstChild->Attribute("VERSION")) < Cal::EARLIEST_COMPATIBLE_FILE_VERSION )
      {
         CalError::setLastError(CalError::INCOMPATIBLE_FILE_VERSION, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
      }
 
      skeleton = firstChild->NextSiblingElement();
@@ -382,7 +382,7 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
   if(!skeleton || stricmp(skeleton->Value(),"SKELETON")!=0)
   {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-      return false;
+      return 0;
   }
 
   // allocate a new core skeleton instance
@@ -408,7 +408,7 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
     if(stricmp(bone->Value(),"BONE")!=0)
     {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
     }
 
     std::string strName=bone->Attribute("NAME");
@@ -433,7 +433,7 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
     if(!translation || stricmp( translation->Value(),"TRANSLATION")!=0)
     {
       CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-      return false;
+      return 0;
     }
 
     float tx, ty, tz;
@@ -442,13 +442,13 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
     if(!node)
     {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
     }
     cal3d::TiXmlText* translationdata = node->ToText();
     if(!translationdata)
     {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
     }
     str.clear();
     str.str("");
@@ -461,7 +461,7 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
     if(!rotation || stricmp(rotation->Value(),"ROTATION")!=0)
     {
       CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-      return false;
+      return 0;
     }
 
     float rx, ry, rz, rw;
@@ -470,13 +470,13 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
     if(!node)
     {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
     }
     cal3d::TiXmlText* rotationdata = node->ToText();
     if(!rotationdata)
     {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
     }
     str.clear();
     str.str("");
@@ -490,7 +490,7 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
     if(!rotation || stricmp(translationBoneSpace->Value(),"LOCALTRANSLATION")!=0)
     {
       CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-      return false;
+      return 0;
     }
 
     float txBoneSpace, tyBoneSpace, tzBoneSpace;
@@ -499,13 +499,13 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
     if(!node)
     {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
     }
     cal3d::TiXmlText* translationBoneSpacedata = node->ToText();
     if(!translationBoneSpacedata)
     {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
     }
     str.clear();
     str.str("");
@@ -518,7 +518,7 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
     if(!rotationBoneSpace || stricmp(rotationBoneSpace->Value(),"LOCALROTATION")!=0)
     {
       CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-      return false;
+      return 0;
     }
 
     float rxBoneSpace, ryBoneSpace, rzBoneSpace, rwBoneSpace;
@@ -527,13 +527,13 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
     if(!node)
     {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
     }
     cal3d::TiXmlText* rotationBoneSpacedata = node->ToText();
     if(!rotationBoneSpacedata)
     {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
     }
     str.clear();
     str.str("");
@@ -546,7 +546,7 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
     if(!parent ||stricmp(parent->Value(),"PARENTID")!=0)
     {
       CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-      return false;
+      return 0;
     }
 
 
@@ -556,13 +556,13 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
     if(!node)
     {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
     }
     cal3d::TiXmlText* parentid = node->ToText();
       if(!parentid)
     {
     CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
     }
     parentId = atoi(parentid->Value());
 
@@ -610,20 +610,20 @@ CalCoreSkeletonPtr CalLoader::loadXmlCoreSkeleton(cal3d::TiXmlDocument & doc)
       if(stricmp(child->Value(),"CHILDID")!=0)
       {
         CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
       }
 
       cal3d::TiXmlNode *node= child->FirstChild();
       if(!node)
       {
         CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
       }
       cal3d::TiXmlText* childid = node->ToText();
       if(!childid)
       {
         CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
       }
 
       int childId = atoi(childid->Value());
@@ -1058,13 +1058,13 @@ CalCoreAnimatedMorph *CalLoader::loadXmlCoreAnimatedMorph(cal3d::TiXmlDocument &
      if(stricmp(firstChild->Attribute("MAGIC"),Cal::ANIMATEDMORPH_XMLFILE_EXTENSION)!=0)
      {
         CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
      }
 
      if(atoi(firstChild->Attribute("VERSION")) < Cal::EARLIEST_COMPATIBLE_FILE_VERSION )
      {
         CalError::setLastError(CalError::INCOMPATIBLE_FILE_VERSION, __FILE__, __LINE__, strFilename);
-        return false;
+        return 0;
      }
 
      animatedMorph = firstChild->NextSiblingElement();
@@ -1132,28 +1132,28 @@ CalCoreAnimatedMorph *CalLoader::loadXmlCoreAnimatedMorph(cal3d::TiXmlDocument &
      pCoreMorphTrack->reserve(keyFrameCount);
 
      unsigned int morphName = atoi(track->Attribute("MORPHNAME"));
-     pCoreMorphTrack->setMorphID(morphName);
+     pCoreMorphTrack->setMorphID(morphName);
      morphName = atoi(track->Attribute("MESHID"));
-     pCoreMorphTrack->setTargetMesh(morphName);
-
-     int numsubmeshtargetted=0;
-     track->QueryIntAttribute("NUMSUBTARGET",&numsubmeshtargetted);
+     pCoreMorphTrack->setTargetMesh(morphName);
+
+     int numsubmeshtargetted=0;
+     track->QueryIntAttribute("NUMSUBTARGET",&numsubmeshtargetted);
+
 
-
-     cal3d::TiXmlElement* keyframe= track->FirstChildElement();
+     cal3d::TiXmlElement* keyframe= track->FirstChildElement();
      if(numsubmeshtargetted>0){
-         //cal3d::TiXmlElement* submeshes= track->FirstChildElement();
+         //cal3d::TiXmlElement* submeshes= track->FirstChildElement();
           for (int keyFrameId=0; keyFrameId<numsubmeshtargetted; ++keyFrameId)
-         {
+         {
           // load the core keyframe
             if(!keyframe|| stricmp(keyframe->Value(),"SUBMESH")!=0)
             {
                CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
                return 0;
-            }
+            }
             pCoreMorphTrack->addTargetSubMesh(atoi(keyframe->Attribute("ID")));
-            keyframe = keyframe->NextSiblingElement();
-         }
+            keyframe = keyframe->NextSiblingElement();
+         }
      }
 
      for (int keyFrameId=0; keyFrameId<keyFrameCount; ++keyFrameId)
@@ -1644,7 +1644,7 @@ CalCoreMeshPtr CalLoader::loadXmlCoreMesh(cal3d::TiXmlDocument & doc)
              CalError::setLastError(CalError::INVALID_FILE_FORMAT, __FILE__, __LINE__, strFilename);
              return 0;
            }
-
+
            morphTarget->setName(morph->Attribute("NAME"));
 
            cal3d::TiXmlElement * blendVert = morph->FirstChildElement();
-- 
2.16.4

