mirror of https://github.com/axmolengine/axmol.git
Merge pull request #12689 from fusijie/refine_setAnimationInterval
Refine setAnimationInterval from double to float.
This commit is contained in:
commit
17207f14e5
|
@ -1341,7 +1341,7 @@ void DisplayLinkDirector::stopAnimation()
|
|||
_invalid = true;
|
||||
}
|
||||
|
||||
void DisplayLinkDirector::setAnimationInterval(double interval)
|
||||
void DisplayLinkDirector::setAnimationInterval(float interval)
|
||||
{
|
||||
_animationInterval = interval;
|
||||
if (! _invalid)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -57,7 +57,7 @@ int Application::run()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void Application::setAnimationInterval(double interval)
|
||||
void Application::setAnimationInterval(float interval)
|
||||
{
|
||||
[[CCDirectorCaller sharedDirectorCaller] setAnimationInterval: interval ];
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -108,7 +108,7 @@ int Application::run()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void Application::setAnimationInterval(double interval)
|
||||
void Application::setAnimationInterval(float interval)
|
||||
{
|
||||
_animationInterval = interval*1000.0f;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ int Application::run()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void Application::setAnimationInterval(double interval)
|
||||
void Application::setAnimationInterval(float interval)
|
||||
{
|
||||
LARGE_INTEGER nFreq;
|
||||
QueryPerformanceFrequency(&nFreq);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -83,7 +83,7 @@ int Application::run()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void Application::setAnimationInterval(double interval)
|
||||
void Application::setAnimationInterval(float interval)
|
||||
{
|
||||
LARGE_INTEGER nFreq;
|
||||
QueryPerformanceFrequency(&nFreq);
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue