summaryrefslogtreecommitdiff
path: root/game/client/vgui_entityimagepanel.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/vgui_entityimagepanel.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/vgui_entityimagepanel.h')
-rw-r--r--game/client/vgui_entityimagepanel.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/game/client/vgui_entityimagepanel.h b/game/client/vgui_entityimagepanel.h
new file mode 100644
index 0000000..bb54525
--- /dev/null
+++ b/game/client/vgui_entityimagepanel.h
@@ -0,0 +1,79 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: This is a panel which is rendered image on top of an entity
+//
+// $Revision: $
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef VGUI_ENTITYIMAGEPANEL_H
+#define VGUI_ENTITYIMAGEPANEL_H
+
+#include "vgui_EntityPanel.h"
+#include "shareddefs.h"
+
+//-----------------------------------------------------------------------------
+// forward declarations
+//-----------------------------------------------------------------------------
+
+class C_BaseEntity;
+class KeyValues;
+class BitmapImage;
+
+//-----------------------------------------------------------------------------
+// This is a base class for a panel which always is rendered on top of an entity
+//-----------------------------------------------------------------------------
+
+class CEntityImagePanel : public CEntityPanel
+{
+ DECLARE_CLASS( CEntityImagePanel, CEntityPanel );
+
+public:
+ // constructor
+ CEntityImagePanel( vgui::Panel* pParent, const char *panelName );
+ ~CEntityImagePanel();
+
+ // initialization
+ virtual bool Init( KeyValues* pInitData, C_BaseEntity* pEntity );
+
+ bool ShouldDraw();
+
+ virtual void Paint( void );
+ virtual void PaintBackground( void ) {}
+
+private:
+ // The bitmap to render
+ BitmapImage *m_pImage;
+
+protected:
+ int m_r, m_g, m_b, m_a;
+};
+
+
+//-----------------------------------------------------------------------------
+// Purpose: Same as above, but understands how to parse color/material out of
+// Team1/Team2 sections
+//-----------------------------------------------------------------------------
+class CEntityTeamImagePanel : public CEntityImagePanel
+{
+ DECLARE_CLASS( CEntityTeamImagePanel, CEntityImagePanel );
+
+public:
+ CEntityTeamImagePanel( vgui::Panel* pParent, const char *panelName );
+ ~CEntityTeamImagePanel( void );
+ // initialization
+ virtual bool Init( KeyValues* pInitData, C_BaseEntity* pEntity );
+
+ virtual void Paint( void );
+
+private:
+ struct TEAMIMAGE
+ {
+ BitmapImage *m_pImage;
+ int m_r, m_g, m_b, m_a;
+ };
+
+ TEAMIMAGE m_Images[ MAX_TEAMS ];
+};
+
+#endif // VGUI_ENTITYIMAGEPANEL_H \ No newline at end of file