love.timer.step now returns the calculated dt directly.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-07-23 19:56:48 -03:00
parent ef5897b22c
commit 2eb9b3bdcd
5 changed files with 10 additions and 11 deletions
+3 -1
View File
@@ -61,7 +61,7 @@ Timer::Timer()
prevFpsUpdate = currTime = getTime();
}
void Timer::step()
double Timer::step()
{
// Frames rendered
frames++;
@@ -84,6 +84,8 @@ void Timer::step()
prevFpsUpdate = currTime;
frames = 0;
}
return dt;
}
void Timer::sleep(double seconds) const
+2 -2
View File
@@ -42,9 +42,9 @@ public:
/**
* Measures the time between this call and the previous call,
* and updates internal values accordinly.
* and updates internal values accordingly.
**/
void step();
double step();
/**
* Tries to sleep for the specified amount of time. The precision is
+3 -3
View File
@@ -30,10 +30,10 @@ namespace timer
#define instance() (Module::getInstance<Timer>(Module::M_TIMER))
int w_step(lua_State *)
int w_step(lua_State *L)
{
instance()->step();
return 0;
lua_pushnumber(L, instance()->step());
return 1;
}
int w_getDelta(lua_State *L)