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

Method LoadObject

CrySystem/ScriptObjectSystem.cpp:1044–1068  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// !load a CGF geometry(model) @param szFileName the texture file path @return the obj id if succeded nil if failed */

Source from the content-addressed store, hash-verified

1042 @return the obj id if succeded nil if failed
1043*/
1044int CScriptObjectSystem::LoadObject(IFunctionHandler *pH)
1045{
1046 CHECK_PARAMETERS(1);
1047 const char *szFileName=NULL;
1048 int nTid=0;
1049 pH->GetParam(1,szFileName);
1050
1051
1052 //nTid=m_pRenderer->LoadTexture(sFileName);
1053 if (!szFileName || strlen(szFileName) == 0)
1054 {
1055 m_pSystem->Warning( VALIDATOR_MODULE_SYSTEM,VALIDATOR_WARNING,0,0,
1056 "Script method System:LoadObject(filename) called with Empty filename" );
1057 return pH->EndFunctionNull();
1058 }
1059
1060 IStatObj *pObj = m_p3DEngine->MakeObject(szFileName);
1061 if (pObj)
1062 {
1063 //nTid=pPic->GetTextureID();
1064 USER_DATA ud=m_pScriptSystem->CreateUserData((INT_PTR)pObj,USER_DATA_OBJECT);
1065 return pH->EndFunction(ud);
1066 }
1067 return pH->EndFunctionNull();
1068}
1069
1070/////////////////////////////////////////////////////////////////////////////////
1071/////////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 6

EndFunctionNullMethod · 0.80
CreateUserDataMethod · 0.80
EndFunctionMethod · 0.80
GetParamMethod · 0.45
WarningMethod · 0.45
MakeObjectMethod · 0.45

Tested by

no test coverage detected