CryScriptSystem LuaJIT build
ExtReMLapin opened this issue · 1 comments
That's a good idea. Unfortunately, CryEngine 2 source code is not available. The Crysis Mod SDK contains only almost complete CryGame DLL source code + CryCommon headers with interfaces implemented by the DLLs.
Since the CryCommon headers contain the exact definition of IScriptSystem
, it should be possible to create own CryScriptSystem DLL from scratch. You just need to implement that IScriptSystem
interface (together with IScriptTable
etc) and then export init function from your DLL. For CryScriptSystem DLL the init function is as follows:
extern "C" __declspec(dllexport) IScriptSystem *CreateScriptSystem(ISystem *pSystem, bool bStdLibs)
The ISystem
pointer allows you to easily access the rest of the engine from your DLL. The bStdLibs
parameter is always true and can be safely ignored probably. The return value is a pointer to newly created instance of your script system.
See also CE5 source code: https://github.com/CRYTEK/CRYENGINE/tree/release/Code/CryEngine/CryScriptSystem
However, creating own CryScriptSystem DLL is still a lot of work and it's not as straightforward as it seems to be, but it would so epic. Even though the main performance bottleneck in Crysis is not Lua probably.