diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index 6351c82d76..87b95d2b82 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -1341,7 +1341,7 @@ void DisplayLinkDirector::stopAnimation() _invalid = true; } -void DisplayLinkDirector::setAnimationInterval(double interval) +void DisplayLinkDirector::setAnimationInterval(float interval) { _animationInterval = interval; if (! _invalid) diff --git a/cocos/base/CCDirector.h b/cocos/base/CCDirector.h index 28cbdcfbf8..774f5385d4 100644 --- a/cocos/base/CCDirector.h +++ b/cocos/base/CCDirector.h @@ -152,9 +152,9 @@ public: inline Scene* getRunningScene() { return _runningScene; } /** Gets the FPS value. */ - inline double getAnimationInterval() { return _animationInterval; } + inline float getAnimationInterval() { return _animationInterval; } /** Sets the FPS value. FPS = 1/internal. */ - virtual void setAnimationInterval(double interval) = 0; + virtual void setAnimationInterval(float interval) = 0; /** Whether or not to display the FPS on the bottom-left corner. */ inline bool isDisplayStats() { return _displayStats; } @@ -543,8 +543,8 @@ protected: //texture cache belongs to this director TextureCache *_textureCache; - double _animationInterval; - double _oldAnimationInterval; + float _animationInterval; + float _oldAnimationInterval; /* landscape mode ? */ bool _landscape; @@ -634,7 +634,7 @@ public: // Overrides // virtual void mainLoop() override; - virtual void setAnimationInterval(double value) override; + virtual void setAnimationInterval(float value) override; virtual void startAnimation() override; virtual void stopAnimation() override; diff --git a/cocos/platform/CCApplicationProtocol.h b/cocos/platform/CCApplicationProtocol.h index ea69db3dd0..2b78c0b92f 100644 --- a/cocos/platform/CCApplicationProtocol.h +++ b/cocos/platform/CCApplicationProtocol.h @@ -101,7 +101,7 @@ public: * @js NA * @lua NA */ - virtual void setAnimationInterval(double interval) = 0; + virtual void setAnimationInterval(float interval) = 0; /** Subclass override the function to set OpenGL context attribution instead of use default value. * And now can only set six attributions:redBits,greenBits,blueBits,alphaBits,depthBits,stencilBits. diff --git a/cocos/platform/android/CCApplication-android.cpp b/cocos/platform/android/CCApplication-android.cpp index dacc0a33b1..1b5b5c8829 100644 --- a/cocos/platform/android/CCApplication-android.cpp +++ b/cocos/platform/android/CCApplication-android.cpp @@ -73,7 +73,7 @@ int Application::run() return -1; } -void Application::setAnimationInterval(double interval) +void Application::setAnimationInterval(float interval) { JniMethodInfo methodInfo; if (! JniHelper::getStaticMethodInfo(methodInfo, "org/cocos2dx/lib/Cocos2dxRenderer", "setAnimationInterval", diff --git a/cocos/platform/android/CCApplication-android.h b/cocos/platform/android/CCApplication-android.h index 9b11b87a3e..3317dbc40a 100644 --- a/cocos/platform/android/CCApplication-android.h +++ b/cocos/platform/android/CCApplication-android.h @@ -51,7 +51,7 @@ public: @brief Callback by Director to limit FPS. @param interval The time, expressed in seconds, between current frame and next. */ - void setAnimationInterval(double interval); + void setAnimationInterval(float interval); /** @brief Run the message loop. diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java index 83ddd8e7cc..70264590df 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java @@ -56,7 +56,7 @@ public class Cocos2dxRenderer implements GLSurfaceView.Renderer { // Getter & Setter // =========================================================== - public static void setAnimationInterval(final double animationInterval) { + public static void setAnimationInterval(final float animationInterval) { Cocos2dxRenderer.sAnimationInterval = (long) (animationInterval * Cocos2dxRenderer.NANOSECONDSPERSECOND); } diff --git a/cocos/platform/ios/CCApplication-ios.h b/cocos/platform/ios/CCApplication-ios.h index e88cc667c1..6fd0a93a93 100644 --- a/cocos/platform/ios/CCApplication-ios.h +++ b/cocos/platform/ios/CCApplication-ios.h @@ -67,7 +67,7 @@ public: @brief Callback by Director for limit FPS. @param interval The time, expressed in seconds, between current frame and next. */ - virtual void setAnimationInterval(double interval); + virtual void setAnimationInterval(float interval); /** @brief Get current language config diff --git a/cocos/platform/ios/CCApplication-ios.mm b/cocos/platform/ios/CCApplication-ios.mm index b085e00ed6..7411478060 100644 --- a/cocos/platform/ios/CCApplication-ios.mm +++ b/cocos/platform/ios/CCApplication-ios.mm @@ -57,7 +57,7 @@ int Application::run() return 0; } -void Application::setAnimationInterval(double interval) +void Application::setAnimationInterval(float interval) { [[CCDirectorCaller sharedDirectorCaller] setAnimationInterval: interval ]; } diff --git a/cocos/platform/linux/CCApplication-linux.cpp b/cocos/platform/linux/CCApplication-linux.cpp index e88d064cf6..12f1e89228 100644 --- a/cocos/platform/linux/CCApplication-linux.cpp +++ b/cocos/platform/linux/CCApplication-linux.cpp @@ -107,7 +107,7 @@ int Application::run() return EXIT_SUCCESS; } -void Application::setAnimationInterval(double interval) +void Application::setAnimationInterval(float interval) { //TODO do something else _animationInterval = interval*1000.0f; diff --git a/cocos/platform/linux/CCApplication-linux.h b/cocos/platform/linux/CCApplication-linux.h index e7334b50c9..d70d5cac67 100644 --- a/cocos/platform/linux/CCApplication-linux.h +++ b/cocos/platform/linux/CCApplication-linux.h @@ -53,7 +53,7 @@ public: @brief Callback by Director for limit FPS. @param interval The time, which expressed in second in second, between current frame and next. */ - void setAnimationInterval(double interval); + void setAnimationInterval(float interval); /** @brief Run the message loop. diff --git a/cocos/platform/mac/CCApplication-mac.h b/cocos/platform/mac/CCApplication-mac.h index f75c1d08d9..e26040789d 100644 --- a/cocos/platform/mac/CCApplication-mac.h +++ b/cocos/platform/mac/CCApplication-mac.h @@ -52,7 +52,7 @@ public: @brief Callback by Director for limit FPS. @param interval The time, which expressed in second in second, between current frame and next. */ - virtual void setAnimationInterval(double interval); + virtual void setAnimationInterval(float interval); /** @brief Get status bar rectangle in GLView window. diff --git a/cocos/platform/mac/CCApplication-mac.mm b/cocos/platform/mac/CCApplication-mac.mm index 001f7f515c..1666776a5c 100644 --- a/cocos/platform/mac/CCApplication-mac.mm +++ b/cocos/platform/mac/CCApplication-mac.mm @@ -108,7 +108,7 @@ int Application::run() return 0; } -void Application::setAnimationInterval(double interval) +void Application::setAnimationInterval(float interval) { _animationInterval = interval*1000.0f; } diff --git a/cocos/platform/win32/CCApplication-win32.cpp b/cocos/platform/win32/CCApplication-win32.cpp index 52e30c90c8..5f5d4a4271 100644 --- a/cocos/platform/win32/CCApplication-win32.cpp +++ b/cocos/platform/win32/CCApplication-win32.cpp @@ -109,7 +109,7 @@ int Application::run() return 0; } -void Application::setAnimationInterval(double interval) +void Application::setAnimationInterval(float interval) { LARGE_INTEGER nFreq; QueryPerformanceFrequency(&nFreq); diff --git a/cocos/platform/win32/CCApplication-win32.h b/cocos/platform/win32/CCApplication-win32.h index c30a697d74..72c0b004c7 100644 --- a/cocos/platform/win32/CCApplication-win32.h +++ b/cocos/platform/win32/CCApplication-win32.h @@ -65,7 +65,7 @@ public: CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); /* override functions */ - virtual void setAnimationInterval(double interval); + virtual void setAnimationInterval(float interval); virtual LanguageType getCurrentLanguage(); virtual const char * getCurrentLanguageCode(); diff --git a/cocos/platform/winrt/CCApplication.cpp b/cocos/platform/winrt/CCApplication.cpp index ddb5480deb..d6cb848e7f 100644 --- a/cocos/platform/winrt/CCApplication.cpp +++ b/cocos/platform/winrt/CCApplication.cpp @@ -83,7 +83,7 @@ int Application::run() return 0; } -void Application::setAnimationInterval(double interval) +void Application::setAnimationInterval(float interval) { LARGE_INTEGER nFreq; QueryPerformanceFrequency(&nFreq); diff --git a/cocos/platform/winrt/CCApplication.h b/cocos/platform/winrt/CCApplication.h index bd08715aa9..3c3a7c8c0f 100644 --- a/cocos/platform/winrt/CCApplication.h +++ b/cocos/platform/winrt/CCApplication.h @@ -55,7 +55,7 @@ public: static Application* getInstance(); /* override functions */ - virtual void setAnimationInterval(double interval); + virtual void setAnimationInterval(float interval); virtual LanguageType getCurrentLanguage(); virtual const char * getCurrentLanguageCode();