MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / SendEventToAll

Method SendEventToAll

Code/CryEngine/CryEntitySystem/EntitySystem.cpp:1975–2008  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1973
1974//////////////////////////////////////////////////////////////////////////
1975void CEntitySystem::SendEventToAll(SEntityEvent& event)
1976{
1977 uint32 dwMaxUsed = (uint32)m_EntitySaltBuffer.GetMaxUsed() + 1;
1978
1979 for (uint32 dwI = 0; dwI < dwMaxUsed; ++dwI)
1980 {
1981 CEntity* pEntity = m_EntityArray[dwI];
1982
1983 if (pEntity)
1984 pEntity->SendEvent(event);
1985 }
1986
1987 if (event.event == ENTITY_EVENT_RESET)
1988 {
1989 // This stuff is necessary because the reset event currently recreates
1990 // the character instance and thus removes all attachment data previously set up.
1991 for (uint32 dwI = 0; dwI < dwMaxUsed; ++dwI)
1992 {
1993 CEntity* pEntity = m_EntityArray[dwI];
1994
1995 if (pEntity)
1996 {
1997 // Restore the bone attachment by the deprecated CharAttachHelper.
1998 if (strcmp(pEntity->GetClass()->GetName(), "CharacterAttachHelper") == 0
1999 && pEntity->GetParent())
2000 {
2001 SEntityEvent attachEvent(ENTITY_EVENT_ATTACH_THIS);
2002 attachEvent.nParam[0] = pEntity->GetParent()->GetId();
2003 pEntity->SendEvent(attachEvent);
2004 }
2005 }
2006 }
2007 }
2008}
2009
2010//////////////////////////////////////////////////////////////////////////
2011void CEntitySystem::GetMemoryStatistics(ICrySizer* pSizer) const

Callers 10

LoadLevelMethod · 0.80
OnLoadingCompleteMethod · 0.80
ResetEngineMethod · 0.80
LoadEntitiesMethod · 0.80
OnStepMethod · 0.80
OnStepMethod · 0.80
LoadGameMethod · 0.80
LoadLevelMethod · 0.80
OnPostResetEngineMethod · 0.80
CRY_TEST_WITH_FIXTUREFunction · 0.80

Calls 7

strcmpFunction · 0.85
GetMaxUsedMethod · 0.80
SendEventMethod · 0.45
GetNameMethod · 0.45
GetClassMethod · 0.45
GetParentMethod · 0.45
GetIdMethod · 0.45

Tested by 1

CRY_TEST_WITH_FIXTUREFunction · 0.64