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

Method DoRandomExpressions

CrySystem/ScriptObjectEntity.cpp:4736–4762  ·  view source on GitHub ↗

! loads (enables) expressions for a character @param pszFilename script-filename ("" to disable) */

Source from the content-addressed store, hash-verified

4734 @param pszFilename script-filename ("" to disable)
4735*/
4736int CScriptObjectEntity::DoRandomExpressions(IFunctionHandler *pH)
4737{
4738 if (pH->GetParamCount()<1)
4739 CHECK_PARAMETERS(1);
4740 const char *pszFilename;
4741 bool bRaiseError=true;
4742 pH->GetParam(1, pszFilename);
4743 if (pH->GetParamCount()>=2)
4744 pH->GetParam(2, bRaiseError);
4745 if(m_pEntity && m_pEntity->GetCharInterface())
4746 {
4747 ILipSync *pLipSync=m_pEntity->GetCharInterface()->GetLipSyncInterface();
4748 if (!pLipSync)
4749 {
4750 m_pISystem->Warning( VALIDATOR_MODULE_SYSTEM,VALIDATOR_WARNING,0,
4751 0,"Could not create lip-sync interface ! Does this entity %s have a character ?",m_pEntity->GetName() );
4752 return pH->EndFunctionNull();
4753 }
4754 if (!pLipSync->LoadRandomExpressions(pszFilename, bRaiseError))
4755 {
4756 m_pISystem->Warning( VALIDATOR_MODULE_SYSTEM,VALIDATOR_WARNING,0,
4757 0,"CLipSync::LoadDialog failed for Entity %s",m_pEntity->GetName() );
4758 return pH->EndFunctionNull();
4759 }
4760 }
4761 return pH->EndFunction((int)1);
4762}
4763
4764/*! plays an expression for a character
4765 @param pszMorphTarget name of morph-target

Callers

nothing calls this directly

Calls 9

GetCharInterfaceMethod · 0.80
GetLipSyncInterfaceMethod · 0.80
EndFunctionNullMethod · 0.80
LoadRandomExpressionsMethod · 0.80
EndFunctionMethod · 0.80
GetParamCountMethod · 0.45
GetParamMethod · 0.45
WarningMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected