diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/ViewConeImage.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/ViewConeImage.h')
| -rw-r--r-- | game/client/ViewConeImage.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/game/client/ViewConeImage.h b/game/client/ViewConeImage.h new file mode 100644 index 0000000..cfa2ea1 --- /dev/null +++ b/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 |