mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 17:15:21 +02:00
Add support for Tracy profiler (#15113)
This commit is contained in:
@@ -32,6 +32,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include "client/client.h"
|
||||
#endif
|
||||
|
||||
#if BUILD_WITH_TRACY
|
||||
#include "tracy/TracyLua.hpp"
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
#include "lualib.h"
|
||||
@@ -95,6 +98,11 @@ ScriptApiBase::ScriptApiBase(ScriptingType type):
|
||||
lua_pushstring(m_luastack, LUA_BITLIBNAME);
|
||||
lua_call(m_luastack, 1, 0);
|
||||
|
||||
#if BUILD_WITH_TRACY
|
||||
// Load tracy lua bindings
|
||||
tracy::LuaRegister(m_luastack);
|
||||
#endif
|
||||
|
||||
// Make the ScriptApiBase* accessible to ModApiBase
|
||||
#if INDIRECT_SCRIPTAPI_RIDX
|
||||
*(void **)(lua_newuserdata(m_luastack, sizeof(void *))) = this;
|
||||
|
Reference in New Issue
Block a user