Browse Source

Fixed crash if model had zero submeshes.
Fixed root CMakeLists.

Lasse Öörni 13 years ago
parent
commit
101b2ee338
3 changed files with 5 additions and 5 deletions
  1. 3 3
      CMakeLists.txt
  2. 1 1
      Engine/Graphics/AnimatedModel.cpp
  3. 1 1
      Engine/Graphics/StaticModel.cpp

+ 3 - 3
CMakeLists.txt

@@ -32,11 +32,11 @@ add_definitions (-DENABLE_PROFILING)
 # If not on Windows, enable use of OpenGL instead of Direct3D9 (so called "Turso3D" mode.) Setting
 # this on Windows is not recommended, as graphics card drivers are usually better optimized for
 # Direct3D.
-#if (NOT WIN32)
+if (NOT WIN32)
     set (USE_OPENGL 1)
     add_definitions (-DUSE_OPENGL)
-#    add_definitions (-DUNIX)
-#endif ()
+    add_definitions (-DUNIX)
+endif ()
 
 # Compiler-specific options
 if (MSVC)

+ 1 - 1
Engine/Graphics/AnimatedModel.cpp

@@ -240,7 +240,7 @@ void AnimatedModel::UpdateBatches(const FrameInfo& frame)
             batches_[i].worldTransform_ = &worldTransform;
         }
     }
-    else
+    else if (batches_.Size() == 1)
     {
         batches_[0].distance_ = distance_;
         batches_[0].worldTransform_ = &worldTransform;

+ 1 - 1
Engine/Graphics/StaticModel.cpp

@@ -152,7 +152,7 @@ void StaticModel::UpdateBatches(const FrameInfo& frame)
             batches_[i].worldTransform_ = &worldTransform;
         }
     }
-    else
+    else if (batches_.Size() == 1)
     {
         batches_[0].distance_ = distance_;
         batches_[0].worldTransform_ = &worldTransform;