From d269141a7333bc40f2ec685be30fde6ffe665799 Mon Sep 17 00:00:00 2001 From: Causeless Date: Fri, 29 Dec 2023 22:59:54 +0000 Subject: [PATCH] Expose PerformanceMan to Lua --- Lua/LuaAdapterDefinitions.h | 1 + Lua/LuaBindingRegisterDefinitions.h | 2 ++ Lua/LuaBindingsManagers.cpp | 8 ++++++++ Managers/LuaMan.cpp | 2 ++ 4 files changed, 13 insertions(+) diff --git a/Lua/LuaAdapterDefinitions.h b/Lua/LuaAdapterDefinitions.h index f37d3495a..759ca6223 100644 --- a/Lua/LuaAdapterDefinitions.h +++ b/Lua/LuaAdapterDefinitions.h @@ -10,6 +10,7 @@ #include "FrameMan.h" #include "MetaMan.h" #include "MovableMan.h" +#include "PerformanceMan.h" #include "PostProcessMan.h" #include "PresetMan.h" #include "PrimitiveMan.h" diff --git a/Lua/LuaBindingRegisterDefinitions.h b/Lua/LuaBindingRegisterDefinitions.h index 9117aba66..3459f7c69 100644 --- a/Lua/LuaBindingRegisterDefinitions.h +++ b/Lua/LuaBindingRegisterDefinitions.h @@ -23,6 +23,7 @@ namespace RTE { PER_LUA_BINDING(FrameMan) \ PER_LUA_BINDING(MetaMan) \ PER_LUA_BINDING(MovableMan) \ + PER_LUA_BINDING(PerformanceMan) \ PER_LUA_BINDING(PostProcessMan) \ PER_LUA_BINDING(PresetMan) \ PER_LUA_BINDING(PrimitiveMan) \ @@ -210,6 +211,7 @@ namespace RTE { LuaBindingRegisterFunctionDeclarationForType(FrameMan); LuaBindingRegisterFunctionDeclarationForType(MetaMan); LuaBindingRegisterFunctionDeclarationForType(MovableMan); + LuaBindingRegisterFunctionDeclarationForType(PerformanceMan); LuaBindingRegisterFunctionDeclarationForType(PostProcessMan); LuaBindingRegisterFunctionDeclarationForType(PresetMan); LuaBindingRegisterFunctionDeclarationForType(PrimitiveMan); diff --git a/Lua/LuaBindingsManagers.cpp b/Lua/LuaBindingsManagers.cpp index 337c8d61c..3ee688f83 100644 --- a/Lua/LuaBindingsManagers.cpp +++ b/Lua/LuaBindingsManagers.cpp @@ -171,6 +171,14 @@ namespace RTE { .def("AddParticle", &LuaAdaptersMovableMan::AddParticle, luabind::adopt(_2)); } +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + LuaBindingRegisterFunctionDefinitionForType(ManagerLuaBindings, PerformanceMan) { + return luabind::class_("PerformanceManager") + + .property("ShowPerformanceStats", &PerformanceMan::IsShowingPerformanceStats, &PerformanceMan::ShowPerformanceStats); + } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// LuaBindingRegisterFunctionDefinitionForType(ManagerLuaBindings, PostProcessMan) { diff --git a/Managers/LuaMan.cpp b/Managers/LuaMan.cpp index 031baa083..7813247f8 100644 --- a/Managers/LuaMan.cpp +++ b/Managers/LuaMan.cpp @@ -155,6 +155,7 @@ namespace RTE { RegisterLuaBindingsOfType(ManagerLuaBindings, FrameMan), RegisterLuaBindingsOfType(ManagerLuaBindings, MetaMan), RegisterLuaBindingsOfType(ManagerLuaBindings, MovableMan), + RegisterLuaBindingsOfType(ManagerLuaBindings, PerformanceMan), RegisterLuaBindingsOfType(ManagerLuaBindings, PostProcessMan), RegisterLuaBindingsOfType(ManagerLuaBindings, PresetMan), RegisterLuaBindingsOfType(ManagerLuaBindings, PrimitiveMan), @@ -195,6 +196,7 @@ namespace RTE { // Assign the manager instances to globals in the lua master state luabind::globals(m_State)["TimerMan"] = &g_TimerMan; luabind::globals(m_State)["FrameMan"] = &g_FrameMan; + luabind::globals(m_State)["PerformanceMan"] = &g_PerformanceMan; luabind::globals(m_State)["PostProcessMan"] = &g_PostProcessMan; luabind::globals(m_State)["PrimitiveMan"] = &g_PrimitiveMan; luabind::globals(m_State)["PresetMan"] = &g_PresetMan;