Преглед на файлове

Merge branch 'next-cculy' of https://github.com/blackberry-gaming/GamePlay into next-dgough

Darryl Gough преди 13 години
родител
ревизия
a5fd646751
променени са 2 файла, в които са добавени 29 реда и са изтрити 5 реда
  1. 6 0
      gameplay-encoder/src/FBXSceneEncoder.cpp
  2. 23 5
      gameplay/src/Base.h

+ 6 - 0
gameplay-encoder/src/FBXSceneEncoder.cpp

@@ -250,6 +250,12 @@ void FBXSceneEncoder::loadScene(KFbxScene* fbxScene)
     KFbxColor ambientColor = fbxScene->GetGlobalSettings().GetAmbientColor();
     scene->setAmbientColor((float)ambientColor.mRed, (float)ambientColor.mGreen, (float)ambientColor.mBlue);
 
+	// Assign the first camera node (if there is one) in the scene as the active camera
+	// This ensures that if there's a camera in the scene that it is assigned as the 
+	// active camera.
+	// TODO: add logic to find the "active" camera node in the fbxScene
+	scene->setActiveCameraNode(scene->getFirstCameraNode());
+
     _gamePlayFile.addScene(scene);
 }
 

+ 23 - 5
gameplay/src/Base.h

@@ -98,7 +98,6 @@ extern void printError(const char* format, ...);
 #endif
 #define WARN(x) printError(x)
 #define WARN_VARG(x, ...) printError(x, __VA_ARGS__)
-
 #endif
 
 // Bullet Physics
@@ -204,10 +203,10 @@ extern void printError(const char* format, ...);
     #define OPENGL_ES_PVR    
 #elif WIN32
     #define WIN32_LEAN_AND_MEAN
-	#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG                      0x8C00
-	#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG                      0x8C01
-	#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG                     0x8C02
-	#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG                     0x8C03
+    #define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG                      0x8C00
+    #define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG                      0x8C01
+    #define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG                     0x8C02
+    #define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG                     0x8C03
     #include <GL/glew.h>
 #elif __APPLE__
     #include "TargetConditionals.h"
@@ -322,4 +321,23 @@ extern GLenum __gl_error_code;
 extern void amain(struct android_app* state);
 #endif
 
+
+// Assert has special behavior on Windows (for Visual Studio).
+#ifdef WIN32
+#ifdef assert
+#undef assert
+#endif
+#ifdef _DEBUG
+#define assert(expression) do { \
+    if (!(expression)) \
+    { \
+        printError("Assertion \'" #expression "\' failed."); \
+        __debugbreak(); \
+    } } while (0)
+
+#else
+#define assert(expression) do { (void)sizeof(expression); } while (0)
+#endif
+#endif
+
 #endif