Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Expose PerformanceMan to Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Causeless committed Dec 29, 2023
1 parent 5d49daf commit d269141
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Lua/LuaAdapterDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions Lua/LuaBindingRegisterDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -210,6 +211,7 @@ namespace RTE {
LuaBindingRegisterFunctionDeclarationForType(FrameMan);
LuaBindingRegisterFunctionDeclarationForType(MetaMan);
LuaBindingRegisterFunctionDeclarationForType(MovableMan);
LuaBindingRegisterFunctionDeclarationForType(PerformanceMan);
LuaBindingRegisterFunctionDeclarationForType(PostProcessMan);
LuaBindingRegisterFunctionDeclarationForType(PresetMan);
LuaBindingRegisterFunctionDeclarationForType(PrimitiveMan);
Expand Down
8 changes: 8 additions & 0 deletions Lua/LuaBindingsManagers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ namespace RTE {
.def("AddParticle", &LuaAdaptersMovableMan::AddParticle, luabind::adopt(_2));
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

LuaBindingRegisterFunctionDefinitionForType(ManagerLuaBindings, PerformanceMan) {
return luabind::class_<PerformanceMan>("PerformanceManager")

.property("ShowPerformanceStats", &PerformanceMan::IsShowingPerformanceStats, &PerformanceMan::ShowPerformanceStats);
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

LuaBindingRegisterFunctionDefinitionForType(ManagerLuaBindings, PostProcessMan) {
Expand Down
2 changes: 2 additions & 0 deletions Managers/LuaMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d269141

Please sign in to comment.