mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-21 06:41:33 +00:00
lua - add bindings to get frame duration
This commit is contained in:
parent
a2c6009352
commit
8f85c9194d
3 changed files with 11 additions and 0 deletions
|
@ -86,6 +86,7 @@ namespace MWLua
|
||||||
api["getRealTime"] = []() {
|
api["getRealTime"] = []() {
|
||||||
return std::chrono::duration<double>(std::chrono::steady_clock::now().time_since_epoch()).count();
|
return std::chrono::duration<double>(std::chrono::steady_clock::now().time_since_epoch()).count();
|
||||||
};
|
};
|
||||||
|
api["getRealFrameDuration"] = []() { return MWBase::Environment::get().getFrameDuration(); };
|
||||||
|
|
||||||
if (!global)
|
if (!global)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -55,6 +55,11 @@
|
||||||
-- @function [parent=#core] getRealTime
|
-- @function [parent=#core] getRealTime
|
||||||
-- @return #number
|
-- @return #number
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Frame duration in seconds
|
||||||
|
-- @function [parent=#core] getRealFrameDuration
|
||||||
|
-- @return #number
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Get a GMST setting from content files.
|
-- Get a GMST setting from content files.
|
||||||
-- @function [parent=#core] getGMST
|
-- @function [parent=#core] getGMST
|
||||||
|
|
|
@ -111,6 +111,11 @@
|
||||||
-- @function [parent=#world] setGameTimeScale
|
-- @function [parent=#world] setGameTimeScale
|
||||||
-- @param #number ratio
|
-- @param #number ratio
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Frame duration in seconds
|
||||||
|
-- @function [parent=#world] getRealFrameDuration
|
||||||
|
-- @return #number
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Whether the world is paused (onUpdate doesn't work when the world is paused).
|
-- Whether the world is paused (onUpdate doesn't work when the world is paused).
|
||||||
-- @function [parent=#world] isWorldPaused
|
-- @function [parent=#world] isWorldPaused
|
||||||
|
|
Loading…
Reference in a new issue