Browse Source

Fix FCollada compile issues on Windows

rdb 10 years ago
parent
commit
413162110b

+ 1 - 1
pandatool/src/daeegg/daeCharacter.cxx

@@ -320,7 +320,7 @@ build_table(EggTable *parent, FCDSceneNode* node, const pset<float> &keys) {
   }
 
   // Quantize the FPS, otherwise Panda complains about FPS mismatches.
-  float fps = round(((keys.size() - 1) / timing_total) * 100) * 0.01f;
+  float fps = cfloor(((keys.size() - 1) / timing_total) * 100 + 0.5f) * 0.01f;
   xform->set_fps(fps);
 
   // Loop through the children joints

+ 1 - 1
pandatool/src/daeegg/daeCharacter.h

@@ -45,7 +45,7 @@ public:
       _bind_pose(LMatrix4d::ident_mat()) {}
 
     LMatrix4d _bind_pose;
-    const PT(EggGroup) _group;
+    PT(EggGroup) _group;
     const FCDSceneNode *_scene_node;
     DaeCharacter *_character;
   };

+ 1 - 1
pandatool/src/daeegg/daeToEggConverter.cxx

@@ -228,7 +228,7 @@ convert_file(const Filename &filename) {
       Characters::iterator it;
       DaeCharacter *character;
       for (it = _characters.begin(); it != _characters.end(); ++it) {
-        DaeCharacter *character = *it;
+        character = *it;
 
         // Collect key frame timings.
         if (get_animation_convert() == AC_both ||

+ 7 - 0
pandatool/src/daeegg/pre_fcollada_include.h

@@ -22,6 +22,13 @@
   #error You must include pre_fcollada_include.h before including FCollada.h!
 #endif
 
+#ifdef _WIN32
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN 1
+#endif
+#include <winsock2.h>
+#endif
+
 // FCollada expects LINUX to be defined on linux
 #ifdef IS_LINUX
   #ifndef LINUX