//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// !load a CGF geometry(model) @param szFileName the texture file path @return the obj id if succeded nil if failed */
| 1042 | @return the obj id if succeded nil if failed |
| 1043 | */ |
| 1044 | int 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 | ///////////////////////////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected