Move the Timer::sleep implementation up from timer/sdl/Timer.cpp to timer/Timer.cpp, since it doesn't directly use any SDL-specific code.

This commit is contained in:
Alex Szpakowski
2016-03-18 23:01:49 -03:00
parent b983588d2e
commit 36cc48d306
4 changed files with 8 additions and 14 deletions
+7
View File
@@ -21,6 +21,7 @@
// LOVE
#include "common/config.h"
#include "common/int.h"
#include "common/delay.h"
#include "Timer.h"
#if defined(LOVE_WINDOWS)
@@ -85,6 +86,12 @@ void Timer::step()
}
}
void Timer::sleep(double seconds) const
{
if (seconds > 0)
love::sleep((unsigned int)(seconds*1000));
}
double Timer::getDelta() const
{
return dt;
+1 -1
View File
@@ -50,7 +50,7 @@ public:
* usually 1ms.
* @param seconds The number of seconds to sleep for.
**/
virtual void sleep(double seconds) const = 0;
virtual void sleep(double seconds) const;
/**
* Gets the time between the last two frames, assuming step is called
-10
View File
@@ -20,10 +20,6 @@
// LOVE
#include "Timer.h"
#include "common/delay.h"
// SDL
#include <SDL.h>
namespace love
{
@@ -47,12 +43,6 @@ const char *Timer::getName() const
return "love.timer.sdl";
}
void Timer::sleep(double seconds) const
{
if (seconds > 0)
love::sleep((unsigned int)(seconds*1000));
}
} // sdl
} // timer
} // love
-3
View File
@@ -37,11 +37,8 @@ public:
Timer();
virtual ~Timer();
const char *getName() const override;
void sleep(double seconds) const override;
}; // Timer
} // sdl