Add fixed FPS function for particle system.

Useful for low-end devices.
This commit is contained in:
DelinWorks 2022-05-24 00:49:17 +03:00
parent 27eecf1857
commit 9a175cb49b
2 changed files with 20 additions and 20 deletions

View File

@ -1723,16 +1723,6 @@ void ParticleSystem::resumeUpdate()
_updatePaused = false;
}
float ParticleSystem::getTimeScale()
{
return _timeScale;
}
void ParticleSystem::setTimeScale(float scale)
{
_timeScale = scale;
}
float ParticleSystem::getFixedFPS()
{
return _fixedFPS;
@ -1743,4 +1733,14 @@ void ParticleSystem::setFixedFPS(float frameRate)
_fixedFPS = frameRate;
}
float ParticleSystem::getTimeScale()
{
return _timeScale;
}
void ParticleSystem::setTimeScale(float scale)
{
_timeScale = scale;
}
NS_CC_END

View File

@ -1065,16 +1065,6 @@ public:
/* Unpause the particles from being updated */
virtual void resumeUpdate();
/** Gets the time scale of the particle system.
@return Time scale of the particle system.
*/
virtual float getTimeScale();
/** Gets the time scale of the particle system.
@param Time scale of the particle system. (default: 1.0)
*/
virtual void setTimeScale(float scale = 1.0F);
/** Gets the fixed frame rate count of the particle system.
@return Fixed frame rate count of the particle system.
*/
@ -1085,6 +1075,16 @@ public:
*/
virtual void setFixedFPS(float frameRate = 0.0F);
/** Gets the time scale of the particle system.
@return Time scale of the particle system.
*/
virtual float getTimeScale();
/** Gets the time scale of the particle system.
@param Time scale of the particle system. (default: 1.0)
*/
virtual void setTimeScale(float scale = 1.0F);
protected:
virtual void updateBlendFunc();