aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/ViewConeImage.h
diff options
context:
space:
mode:
Diffstat (limited to 'mp/src/game/client/ViewConeImage.h')
-rw-r--r--mp/src/game/client/ViewConeImage.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/mp/src/game/client/ViewConeImage.h b/mp/src/game/client/ViewConeImage.h
new file mode 100644
index 00000000..3d96feb3
--- /dev/null
+++ b/mp/src/game/client/ViewConeImage.h
@@ -0,0 +1,56 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: This is a panel which draws a viewcone
+//
+// $Revision: $
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef VIEWCONEIMAGE_H
+#define VIEWCONEIMAGE_H
+
+#include "shareddefs.h"
+#include "vgui_bitmapimage.h"
+
+namespace vgui
+{
+ class Panel;
+}
+
+class C_BaseEntity;
+class KeyValues;
+
+//-----------------------------------------------------------------------------
+// A bitmap that renders a view cone based on angles
+//-----------------------------------------------------------------------------
+class CViewConeImage
+{
+public:
+ // initialization
+ bool Init( vgui::Panel *pParent, KeyValues* pInitData );
+
+ // Paint the sucka
+ void Paint( float yaw );
+
+ void SetColor( int r, int g, int b );
+
+private:
+ BitmapImage m_Image;
+};
+
+
+//-----------------------------------------------------------------------------
+// Helper method to initialize a view cone image from KeyValues data..
+// KeyValues contains the bitmap data, pSectionName, if it exists,
+// indicates which subsection of pInitData should be looked at to get at the
+// image data. The final argument is the bitmap image to initialize.
+// The function returns true if it succeeded.
+//
+// NOTE: This function looks for the key values 'material' and 'color'
+// and uses them to set up the material + modulation color of the image
+//-----------------------------------------------------------------------------
+bool InitializeViewConeImage( KeyValues *pInitData, const char* pSectionName,
+ vgui::Panel *pParent, CViewConeImage* pViewConeImage );
+
+
+#endif // VIEWCONEIMAGE_H \ No newline at end of file