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.

78 lines
2.1 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: This is a panel which is rendered image on top of an entity
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #ifndef VGUI_ENTITYIMAGEPANEL_H
  9. #define VGUI_ENTITYIMAGEPANEL_H
  10. #include "vgui_EntityPanel.h"
  11. #include "shareddefs.h"
  12. //-----------------------------------------------------------------------------
  13. // forward declarations
  14. //-----------------------------------------------------------------------------
  15. class C_BaseEntity;
  16. class KeyValues;
  17. class BitmapImage;
  18. //-----------------------------------------------------------------------------
  19. // This is a base class for a panel which always is rendered on top of an entity
  20. //-----------------------------------------------------------------------------
  21. class CEntityImagePanel : public CEntityPanel
  22. {
  23. DECLARE_CLASS( CEntityImagePanel, CEntityPanel );
  24. public:
  25. // constructor
  26. CEntityImagePanel( vgui::Panel* pParent, const char *panelName );
  27. ~CEntityImagePanel();
  28. // initialization
  29. virtual bool Init( KeyValues* pInitData, C_BaseEntity* pEntity );
  30. bool ShouldDraw();
  31. virtual void Paint( void );
  32. virtual void PaintBackground( void ) {}
  33. private:
  34. // The bitmap to render
  35. BitmapImage *m_pImage;
  36. protected:
  37. int m_r, m_g, m_b, m_a;
  38. };
  39. //-----------------------------------------------------------------------------
  40. // Purpose: Same as above, but understands how to parse color/material out of
  41. // Team1/Team2 sections
  42. //-----------------------------------------------------------------------------
  43. class CEntityTeamImagePanel : public CEntityImagePanel
  44. {
  45. DECLARE_CLASS( CEntityTeamImagePanel, CEntityImagePanel );
  46. public:
  47. CEntityTeamImagePanel( vgui::Panel* pParent, const char *panelName );
  48. ~CEntityTeamImagePanel( void );
  49. // initialization
  50. virtual bool Init( KeyValues* pInitData, C_BaseEntity* pEntity );
  51. virtual void Paint( void );
  52. private:
  53. struct TEAMIMAGE
  54. {
  55. BitmapImage *m_pImage;
  56. int m_r, m_g, m_b, m_a;
  57. };
  58. TEAMIMAGE m_Images[ MAX_TEAMS ];
  59. };
  60. #endif // VGUI_ENTITYIMAGEPANEL_H