mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
That was only part of the problem, now it should all work properly (and more accurately)
This commit is contained in:
@@ -70,11 +70,11 @@ namespace sdl
|
||||
// Convert to number of seconds
|
||||
dt = (currTime - prevTime)/1000.0;
|
||||
|
||||
int timeSinceLast = (currTime - prevFpsUpdate)/1000.0;
|
||||
double timeSinceLast = (currTime - prevFpsUpdate)/1000.0;
|
||||
// Update FPS?
|
||||
if (timeSinceLast > fpsUpdateFrequency)
|
||||
{
|
||||
fps = frames/timeSinceLast;
|
||||
fps = int((frames/timeSinceLast) + 0.5);
|
||||
prevFpsUpdate = currTime;
|
||||
frames = 0;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ namespace sdl
|
||||
return dt;
|
||||
}
|
||||
|
||||
double Timer::getFPS() const
|
||||
int Timer::getFPS() const
|
||||
{
|
||||
return fps;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace sdl
|
||||
void step();
|
||||
void sleep(double seconds);
|
||||
double getDelta() const;
|
||||
double getFPS() const;
|
||||
int getFPS() const;
|
||||
double getTime() const;
|
||||
double getMicroTime() const;
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace sdl
|
||||
Uint32 prevFpsUpdate;
|
||||
|
||||
// Updated with a certain frequency.
|
||||
double fps;
|
||||
int fps;
|
||||
|
||||
// The frequency by which to update the FPS.
|
||||
double fpsUpdateFrequency;
|
||||
|
||||
Reference in New Issue
Block a user