mirror of
				https://github.com/OpenFusionProject/OpenFusion.git
				synced 2025-10-27 14:50:05 +00:00 
			
		
		
		
	added globalState; minor styling fixes
This commit is contained in:
		| @@ -2,8 +2,11 @@ | ||||
|  | ||||
| #include <iostream> | ||||
|  | ||||
| namespace LuaManager { | ||||
|   void init() { | ||||
| using namespace LuaManager; | ||||
|  | ||||
| static lua_State *globalState = nullptr; | ||||
|  | ||||
| void init() { | ||||
|     lua_State *L = luaL_newstate(); | ||||
|     luaL_openlibs(L); | ||||
|  | ||||
| @@ -11,5 +14,6 @@ namespace LuaManager { | ||||
|       std::cout << "Lua error: " << lua_tostring(L, -1) << std::endl; | ||||
|       lua_pop(L, 1); | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
|     globalState = L; | ||||
| } | ||||
|   | ||||
| @@ -3,5 +3,5 @@ | ||||
| #include "lua/Thread.hpp" | ||||
|  | ||||
| namespace LuaManager { | ||||
|   void init(); | ||||
|     void init(); | ||||
| } | ||||
| @@ -7,8 +7,8 @@ extern "C" { | ||||
| } | ||||
|  | ||||
| struct LuaThread { | ||||
|   lua_State *L; | ||||
|   int ref; | ||||
|     lua_State *L; | ||||
|     int ref; | ||||
|  | ||||
|   LuaThread(lua_State *L, int ref) : L(L), ref(ref) {} | ||||
|     LuaThread(lua_State *L, int ref) : L(L), ref(ref) {} | ||||
| }; | ||||
		Reference in New Issue
	
	Block a user