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.

79 lines
2.0 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef GRAPHICGROUP_H
  8. #define GRAPHICGROUP_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "dmxloader/dmxelement.h"
  13. #include "tier1/utlvector.h"
  14. #include "tier1/utldict.h"
  15. #include "gamegraphic.h"
  16. #include "hitarea.h"
  17. //-----------------------------------------------------------------------------
  18. // A class that holds a group of graphics.
  19. //-----------------------------------------------------------------------------
  20. class CGraphicGroup : public CGameGraphic
  21. {
  22. DECLARE_DMXELEMENT_UNPACK()
  23. public:
  24. CGraphicGroup();
  25. virtual ~CGraphicGroup();
  26. bool Unserialize( CDmxElement *pElement, CUtlDict< CGameGraphic *, int > &unserializedGraphicMapping );
  27. virtual void UpdateGeometry();
  28. void UpdateRenderData( color32 parentColor );
  29. virtual void UpdateRenderTransforms( const StageRenderInfo_t &stageRenderInfo );
  30. color32 GetResultantColor() const { return m_ResultantColor; } // needed by group children.
  31. virtual void GetRenderTransform( matrix3x4_t &relToScreen, bool bMaintainAspectRatio ) const; // needed by group children.
  32. void AddToGroup( CGameGraphic *pGraphic );
  33. void RemoveFromGroup( CGameGraphic *pGraphic );
  34. // From GameGraphic
  35. virtual bool HasState( const char *pStateName );
  36. virtual void SetState( const char *pStateName );
  37. virtual void StartPlaying();
  38. virtual void StopPlaying();
  39. virtual void AdvanceState();
  40. virtual bool IsGroup() const { return true; }
  41. virtual bool IsStageGroup()const { return false; }
  42. CHitArea *GetKeyFocusRequestGraphic();
  43. virtual CGameGraphic *FindGraphicByName( const char *pName ) const;
  44. virtual void SetVisible( bool bVisible );
  45. bool MaintainAspectRatio() const;
  46. protected:
  47. CUtlVector< CGameGraphic * > m_MemberList;
  48. color32 m_ResultantColor;
  49. private:
  50. matrix3x4_t m_RelToScreenHoldAspectRatio;
  51. };
  52. #endif // GRAPHICGROUP_H