Merge pull request #12689 from fusijie/refine_setAnimationInterval

Refine setAnimationInterval from double to float.
This commit is contained in:
子龙山人 2015-07-06 16:18:45 +08:00
commit 17207f14e5
16 changed files with 20 additions and 20 deletions

View File

@ -1341,7 +1341,7 @@ void DisplayLinkDirector::stopAnimation()
_invalid = true;
}
void DisplayLinkDirector::setAnimationInterval(double interval)
void DisplayLinkDirector::setAnimationInterval(float interval)
{
_animationInterval = interval;
if (! _invalid)

View File

@ -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;

View File

@ -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.

View File

@ -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",

View File

@ -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.

View File

@ -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);
}

View File

@ -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

View File

@ -57,7 +57,7 @@ int Application::run()
return 0;
}
void Application::setAnimationInterval(double interval)
void Application::setAnimationInterval(float interval)
{
[[CCDirectorCaller sharedDirectorCaller] setAnimationInterval: interval ];
}

View File

@ -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;

View File

@ -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.

View File

@ -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.

View File

@ -108,7 +108,7 @@ int Application::run()
return 0;
}
void Application::setAnimationInterval(double interval)
void Application::setAnimationInterval(float interval)
{
_animationInterval = interval*1000.0f;
}

View File

@ -109,7 +109,7 @@ int Application::run()
return 0;
}
void Application::setAnimationInterval(double interval)
void Application::setAnimationInterval(float interval)
{
LARGE_INTEGER nFreq;
QueryPerformanceFrequency(&nFreq);

View File

@ -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();

View File

@ -83,7 +83,7 @@ int Application::run()
return 0;
}
void Application::setAnimationInterval(double interval)
void Application::setAnimationInterval(float interval)
{
LARGE_INTEGER nFreq;
QueryPerformanceFrequency(&nFreq);

View File

@ -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();