MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / Init

Method Init

CryScriptSystem/ScriptSystem.cpp:403–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401}
402
403bool CScriptSystem::Init(IScriptSystemSink *pSink, IScriptDebugSink *pDebugSink, bool bStdLibs, int nStackSize)
404{
405 m_pSink = pSink;
406 m_pLS = lua_open(0);
407 if (pDebugSink)
408 {
409 m_bDebug = true;
410 m_pDebugSink = pDebugSink;
411 }
412 else
413 {
414 m_pDebugSink = NULL;
415 m_bDebug = false;
416 }
417 if (m_pLS && m_bDebug)
418 {
419 lua_dblibopen(m_pLS);
420 lua_setlinehook(m_pLS, linehook);
421 lua_setcallhook(m_pLS, callhook);
422 }
423 if (bStdLibs)
424 {
425 lua_baselibopen(m_pLS);
426 lua_strlibopen(m_pLS);
427 lua_mathlibopen(m_pLS);
428 lua_iolibopen(m_pLS);
429 lua_bitlibopen(m_pLS);
430 }
431 vl_initvectorlib(m_pLS);
432 lua_setuserptr(m_pLS,this);
433 lua_iolibopen(m_pLS);
434 RegisterErrorHandler(m_bDebug);
435 RegisterTagHandlers();
436
437 //initvectortag(m_pLS);
438 return m_pLS?true:false;
439}
440
441void CScriptSystem::PostInit()
442{

Callers 1

CreateScriptSystemFunction · 0.45

Calls 10

lua_dblibopenFunction · 0.85
lua_setlinehookFunction · 0.85
lua_setcallhookFunction · 0.85
lua_baselibopenFunction · 0.85
lua_strlibopenFunction · 0.85
lua_mathlibopenFunction · 0.85
lua_iolibopenFunction · 0.85
lua_bitlibopenFunction · 0.85
vl_initvectorlibFunction · 0.85
lua_setuserptrFunction · 0.85

Tested by

no test coverage detected