mirror of
https://github.com/love2d/love.git
synced 2026-08-14 10:13:46 +02:00
love.timer.step now returns the calculated dt directly.
--HG-- branch : minor
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user