From 6a393dc6f64ebf284d06b4a6dd78ddf0231f75ca Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Fri, 7 Oct 2011 21:14:39 -0400 Subject: [PATCH] Add new RageDisplay bindings: GetFPS() GetVPF() GetCumFPS() --- Docs/Changelog_sm5.txt | 4 ++++ Docs/Luadoc/Lua.xml | 3 +++ Docs/Luadoc/LuaDocumentation.xml | 9 +++++++++ src/RageDisplay.cpp | 21 +++++++++++++++++++++ 4 files changed, 37 insertions(+) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 91301ac33a..0da696f734 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,10 @@ ________________________________________________________________________________ StepMania 5.0 $next | 2011xxxx -------------------------------------------------------------------------------- +2011/10/07 +---------- +* [RageDisplay] Add the GetFPS, GetVPF, and GetCumFPS bindings. [Wolfman2000] + 2011/10/06 ---------- * Various scoring fixes sourced from http://www47.atwiki.jp/waiei/pages/21.html diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml index 2956478b72..ce09d46c44 100644 --- a/Docs/Luadoc/Lua.xml +++ b/Docs/Luadoc/Lua.xml @@ -1134,6 +1134,9 @@ + + + diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index fdbfd37f93..4e868a5353 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -3035,6 +3035,15 @@ Return the width of the display. + + Return the FPS. + + + Return the VPF. + + + Return the cumulative FPS. + diff --git a/src/RageDisplay.cpp b/src/RageDisplay.cpp index b1c8c1b46f..02deceb34a 100644 --- a/src/RageDisplay.cpp +++ b/src/RageDisplay.cpp @@ -1012,11 +1012,32 @@ public: LuaHelpers::Push( L, params.height ); return 1; } + + static int GetFPS( T* p, lua_State *L ) + { + lua_pushnumber(L, p->GetFPS()); + return 1; + } + + static int GetVPF( T* p, lua_State *L ) + { + lua_pushnumber(L, p->GetVPF()); + return 1; + } + + static int GetCumFPS( T* p, lua_State *L ) + { + lua_pushnumber(L, p->GetCumFPS()); + return 1; + } LunaRageDisplay() { ADD_METHOD( GetDisplayWidth ); ADD_METHOD( GetDisplayHeight ); + ADD_METHOD( GetFPS ); + ADD_METHOD( GetVPF ); + ADD_METHOD( GetCumFPS ); } };