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

Method InitScriptSystem

CrySystem/SystemInit.cpp:783–833  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

781/////////////////////////////////////////////////////////////////////////////////
782/////////////////////////////////////////////////////////////////////////////////
783bool CSystem::InitScriptSystem()
784{
785#ifndef _XBOX
786#if defined(LINUX)
787 m_dll.hScript = LoadDLL("cryscriptsystem.so");
788#else
789 m_dll.hScript = LoadDLL("CryScriptSystem.dll");
790#endif
791 if(m_dll.hScript==NULL)
792 return (false);
793
794 CREATESCRIPTSYSTEM_FNCPTR fncCreateScriptSystem;
795 fncCreateScriptSystem = (CREATESCRIPTSYSTEM_FNCPTR) CryGetProcAddress(m_dll.hScript,"CreateScriptSystem");
796 if(fncCreateScriptSystem==NULL)
797 {
798 Error( "Error initializeing ScriptSystem" );
799 return (false);
800 }
801
802 m_pScriptSink = new CScriptSink(this,m_pConsole);
803 m_pScriptSystem=fncCreateScriptSystem(this,m_pScriptSink,NULL,true);
804 if(m_pScriptSystem==NULL)
805 {
806 Error( "Error initializeing ScriptSystem" );
807 delete m_pScriptSink;
808 m_pScriptSink = NULL;
809 return (false);
810 }
811#else
812 m_pScriptSink = new CScriptSink(this,m_pConsole);
813 m_pScriptSystem=CreateScriptSystem(m_pScriptSink,NULL,true);
814 if (m_pScriptSystem==NULL)
815 {
816 Error( "Error initializeing ScriptSystem" );
817 delete m_pScriptSink;
818 m_pScriptSink = NULL;
819 return (false);
820 }
821#endif
822
823 if (m_pScriptSink)
824 m_pScriptSink->Init();
825
826 assert( m_pConsole );
827 //@HACK!
828 ((CXConsole*)m_pConsole)->SetScriptSystem(m_pScriptSystem);
829
830 m_pScriptSystem->PostInit();
831
832 return (true);
833}
834
835/////////////////////////////////////////////////////////////////////////////////
836bool CSystem::InitFileSystem()

Callers

nothing calls this directly

Calls 5

CreateScriptSystemFunction · 0.85
PostInitMethod · 0.80
ErrorClass · 0.70
InitMethod · 0.45
SetScriptSystemMethod · 0.45

Tested by

no test coverage detected