瀏覽代碼

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

Kieran Cunney 13 年之前
父節點
當前提交
863cc2786f
共有 6 個文件被更改,包括 17 次插入21 次删除
  1. 2 1
      CHANGES.md
  2. 2 2
      README.md
  3. 1 2
      gameplay/src/AnimationClip.cpp
  4. 0 1
      gameplay/src/AnimationTarget.cpp
  5. 7 10
      gameplay/src/Base.h
  6. 5 5
      gameplay/src/PlatformWin32.cpp

+ 2 - 1
CHANGES.md

@@ -5,7 +5,8 @@
 - User Interface support for scrolling with scrollbars on Container.
 - PVRTC, ATC and DXT texture compression support.
 - Performance improvements in user interface forms and text.
-- Performance improvements in animations on transforms.
+- Performance improvements in animations on transforms.
+- Performance improvements using NEON math for BlackBerry and iOS.
 - Fixes for improvements in error handling throughout all systems.
 - Fixes supporting built-in Maya COLLADA exporter via DAE_FBX export.
 - Fixes for latest FBX SDK 2013 support.

+ 2 - 2
README.md

@@ -3,7 +3,7 @@ An open-source, cross-platform 3D native C++ game framework making it easy to le
 
 ## Supported Mobile Platforms
 - BlackBerry 10 and PlayBook 2.0 (using BlackBerry Native SDK)
-- Google Android 2.3+ (using Google Android NDK r7, SDK API level 9+)
+- Google Android 2.3+ (using Google Android NDK, SDK API level 9+)
 - Apple iOS 5.1 (using Apple XCode 4.3.2)
 
 ## Supported Desktop Platforms
@@ -11,8 +11,8 @@ An open-source, cross-platform 3D native C++ game framework making it easy to le
 - Apple MacOS X (using Apple XCode 4.3.2)
 
 ## Roadmap for 'next' branch
-- Gamepad support
 - Lua script bindings
+- Gamepad support
 - Vehicle physics
 - Terrain
 - Lightmaps

+ 1 - 2
gameplay/src/AnimationClip.cpp

@@ -283,7 +283,7 @@ void AnimationClip::addListener(AnimationClip::Listener* listener, unsigned long
                 if (isClipStateBitSet(CLIP_IS_PLAYING_BIT))
                 {
                     unsigned long currentTime = _elapsedTime % _duration;
-                    GP_ASSERT(**_listenerItr);
+                    GP_ASSERT(**_listenerItr || *_listenerItr == _listeners->end());
                     if ((_speed >= 0.0f && currentTime < eventTime && (*_listenerItr == _listeners->end() || eventTime < (**_listenerItr)->_eventTime)) || 
                         (_speed <= 0 && currentTime > eventTime && (*_listenerItr == _listeners->begin() || eventTime > (**_listenerItr)->_eventTime)))
                         *_listenerItr = itr;
@@ -376,7 +376,6 @@ bool AnimationClip::update(unsigned long elapsedTime)
     if (_listeners)
     {
         GP_ASSERT(_listenerItr);
-        GP_ASSERT(**_listenerItr);
 
         if (_speed >= 0.0f)
         {

+ 0 - 1
gameplay/src/AnimationTarget.cpp

@@ -419,7 +419,6 @@ Animation::Channel* AnimationTarget::getChannel(const char* id) const
     if (_animationChannels)
     {
         std::vector<Animation::Channel*>::iterator itr = _animationChannels->begin();
-        GP_ASSERT(*itr);
 
         if (id == NULL)
             return (*itr);

+ 7 - 10
gameplay/src/Base.h

@@ -60,20 +60,14 @@ extern void printError(const char* format, ...);
 
 // Assert macros.
 #ifdef _DEBUG
-#ifdef WIN32
-#define GP_FORCE_ASSERTION_FAILURE do { __debugbreak(); } while (0)
-#else
-#define GP_FORCE_ASSERTION_FAILURE do { assert(0); } while (0)
-#endif
 #define GP_ASSERT(expression) do { \
     if (!(expression)) \
     { \
         printError("%s -- Assertion '" #expression "' failed.\n", __current__func__); \
-        GP_FORCE_ASSERTION_FAILURE; \
+        assert(expression); \
     } } while (0)
 #else
-#define GP_FORCE_ASSERTION_FAILURE do { (void)sizeof(int); } while (0)
-#define GP_ASSERT(expression) do { (void)sizeof(expression); } while (0)
+#define GP_ASSERT(expression)
 #endif
 
 // Error macro.
@@ -85,7 +79,7 @@ extern void printError(const char* format, ...);
         printError("%s -- ", __current__func__); \
         printError(__VA_ARGS__); \
         printError("\n"); \
-        GP_FORCE_ASSERTION_FAILURE; \
+        assert(0); \
         std::exit(-1); \
     } while (0)
 #endif
@@ -191,7 +185,7 @@ extern void printError(const char* format, ...);
     #define glClearDepth glClearDepthf
     #define OPENGL_ES
     #define USE_PVRTC
-    #ifdef __ARM__
+    #ifdef __arm__
         #define USE_NEON
     #endif
 #elif __ANDROID__
@@ -220,6 +214,9 @@ extern void printError(const char* format, ...);
         #define glClearDepth glClearDepthf
         #define OPENGL_ES
         #define USE_VAO
+        #ifdef __arm__
+            #define USE_NEON
+        #endif
     #elif TARGET_OS_MAC
         #include <OpenGL/gl.h>
         #include <OpenGL/glext.h>

+ 5 - 5
gameplay/src/PlatformWin32.cpp

@@ -276,11 +276,6 @@ LRESULT CALLBACK __WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
     switch (msg)
     {
-    case WM_PAINT:
-        gameplay::Game::getInstance()->frame();
-        SwapBuffers(__hdc);
-        return 0;
-
     case WM_CLOSE:
         DestroyWindow(__hwnd);
         return 0;
@@ -663,6 +658,11 @@ int Platform::enterMessagePump()
                 break;
             }
         }
+        else
+        {
+            _game->frame();
+            SwapBuffers(__hdc);
+        }
 
         // If we are done, then exit.
         if (_game->getState() == Game::UNINITIALIZED)