Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.5 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =====//
  2. //
  3. // Dme version of a body group
  4. //
  5. //===========================================================================//
  6. #include "mdlobjects/dmebodygroup.h"
  7. #include "datamodel/dmelementfactoryhelper.h"
  8. #include "mdlobjects/dmelodlist.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. //-----------------------------------------------------------------------------
  12. // Expose this class to the scene database
  13. //-----------------------------------------------------------------------------
  14. IMPLEMENT_ELEMENT_FACTORY( DmeBodyGroup, CDmeBodyGroup );
  15. //-----------------------------------------------------------------------------
  16. // Purpose:
  17. //-----------------------------------------------------------------------------
  18. void CDmeBodyGroup::OnConstruction()
  19. {
  20. m_BodyParts.Init( this, "bodyPartList" );
  21. }
  22. void CDmeBodyGroup::OnDestruction()
  23. {
  24. }
  25. //-----------------------------------------------------------------------------
  26. // Finds a body part by name
  27. //-----------------------------------------------------------------------------
  28. CDmeLODList *CDmeBodyGroup::FindBodyPart( const char *pName )
  29. {
  30. int nCount = m_BodyParts.Count();
  31. for ( int i = 0; i < nCount; ++i )
  32. {
  33. CDmeLODList *pLODList = CastElement< CDmeLODList >( m_BodyParts[ i ] );
  34. if ( !pLODList )
  35. continue;
  36. if ( !Q_stricmp( pName, pLODList->GetName() ) )
  37. return pLODList;
  38. }
  39. return NULL;
  40. }