Prechádzať zdrojové kódy

Make love.timer.getFPS and love.timer.getAverageDelta microsecond-accurate

Bart van Strien 12 rokov pred
rodič
commit
63c57ba3f8
1 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  1. 3 3
      src/modules/timer/sdl/Timer.cpp

+ 3 - 3
src/modules/timer/sdl/Timer.cpp

@@ -71,12 +71,12 @@ void Timer::step()
 	prevTime = currTime;
 
 	// Get ticks from SDL
-	currTime = SDL_GetTicks();
+	currTime = getMicroTime();
 
 	// Convert to number of seconds
-	dt = (currTime - prevTime)/1000.0;
+	dt = currTime - prevTime;
 
-	double timeSinceLast = (currTime - prevFpsUpdate)/1000.0;
+	double timeSinceLast = currTime - prevFpsUpdate;
 	// Update FPS?
 	if (timeSinceLast > fpsUpdateFrequency)
 	{