diff options
Diffstat (limited to 'NorthstarDedicatedTest/squirrel.h')
-rw-r--r-- | NorthstarDedicatedTest/squirrel.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/NorthstarDedicatedTest/squirrel.h b/NorthstarDedicatedTest/squirrel.h index 50b4a19e..d02a0000 100644 --- a/NorthstarDedicatedTest/squirrel.h +++ b/NorthstarDedicatedTest/squirrel.h @@ -60,7 +60,7 @@ struct SQFuncRegistration }; // core sqvm funcs -typedef SQRESULT(*sq_compilebufferType)(void* sqvm, CompileBufferState* compileBuffer, const char* file, int a1, int a2); +typedef SQRESULT(*sq_compilebufferType)(void* sqvm, CompileBufferState* compileBuffer, const char* file, int a1, ScriptContex a2); extern sq_compilebufferType ClientSq_compilebuffer; extern sq_compilebufferType ServerSq_compilebuffer; @@ -126,7 +126,7 @@ typedef SQBool(*sq_getboolType)(void*, SQInteger stackpos); extern sq_getboolType ClientSq_getbool; extern sq_getboolType ServerSq_getbool; -template<Context context> class SquirrelManager +template<ScriptContex context> class SquirrelManager { private: std::vector<SQFuncRegistration*> m_funcRegistrations; @@ -148,7 +148,7 @@ public: { spdlog::info("Registering {} function {}", GetContextName(context), funcReg->squirrelFuncName); - if (context == CLIENT || context == UI) + if (context == ScriptContex::CLIENT || context == ScriptContex::UI) ClientRegisterSquirrelFunc(sqvm, funcReg, 1); else ServerRegisterSquirrelFunc(sqvm, funcReg, 1); @@ -176,21 +176,21 @@ public: CompileBufferState bufferState = CompileBufferState(strCode); SQRESULT compileResult; - if (context == CLIENT || context == UI) + if (context == ScriptContex::CLIENT || context == ScriptContex::UI) compileResult = ClientSq_compilebuffer(sqvm2, &bufferState, "console", -1, context); - else if (context == SERVER) + else if (context == ScriptContex::SERVER) compileResult = ServerSq_compilebuffer(sqvm2, &bufferState, "console", -1, context); spdlog::info("sq_compilebuffer returned {}", compileResult); if (compileResult >= 0) { - if (context == CLIENT || context == UI) + if (context == ScriptContex::CLIENT || context == ScriptContex::UI) { ClientSq_pushroottable(sqvm2); SQRESULT callResult = ClientSq_call(sqvm2, 1, false, false); spdlog::info("sq_call returned {}", callResult); } - else if (context == SERVER) + else if (context == ScriptContex::SERVER) { ServerSq_pushroottable(sqvm2); SQRESULT callResult = ServerSq_call(sqvm2, 1, false, false); @@ -222,6 +222,6 @@ public: } }; -extern SquirrelManager<CLIENT>* g_ClientSquirrelManager; -extern SquirrelManager<SERVER>* g_ServerSquirrelManager; -extern SquirrelManager<UI>* g_UISquirrelManager;
\ No newline at end of file +extern SquirrelManager<ScriptContex::CLIENT>* g_ClientSquirrelManager; +extern SquirrelManager<ScriptContex::SERVER>* g_ServerSquirrelManager; +extern SquirrelManager<ScriptContex::UI>* g_UISquirrelManager;
\ No newline at end of file |