MCPcopy Create free account
hub / github.com/DFHack/dfhack / overlay_interpose_lua

Function overlay_interpose_lua

plugins/overlay.cpp:57–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55static int32_t interfacePct = 100;
56
57static void overlay_interpose_lua(const char *fn_name, int nargs = 0, int nres = 0,
58 Lua::LuaLambda && args_lambda = Lua::DEFAULT_LUA_LAMBDA,
59 Lua::LuaLambda && res_lambda = Lua::DEFAULT_LUA_LAMBDA) {
60 DEBUG(event).print("calling overlay lua function: '{}'\n", fn_name);
61
62 color_ostream & out = Core::getInstance().getConsole();
63 auto L = DFHack::Core::getInstance().getLuaState();
64
65 auto & core = Core::getInstance();
66 auto & counters = core.perf_counters;
67 uint32_t start_ms = core.p->getTickCount();
68
69 Lua::CallLuaModuleFunction(out, L, "plugins.overlay", fn_name, nargs, nres,
70 std::forward<Lua::LuaLambda&&>(args_lambda),
71 std::forward<Lua::LuaLambda&&>(res_lambda));
72
73 counters.incCounter(counters.total_overlay_ms, start_ms);
74}
75
76template<class T>
77struct viewscreen_overlay : T {

Callers 1

Calls 4

CallLuaModuleFunctionFunction · 0.85
getTickCountMethod · 0.80
incCounterMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected