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/tf2/ground_line.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/tf2/ground_line.h')
| -rw-r--r-- | game/client/tf2/ground_line.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/game/client/tf2/ground_line.h b/game/client/tf2/ground_line.h new file mode 100644 index 0000000..4164977 --- /dev/null +++ b/game/client/tf2/ground_line.h @@ -0,0 +1,80 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef GROUND_LINE_H +#define GROUND_LINE_H +#ifdef _WIN32 +#pragma once +#endif + + +#include "mathlib/vector.h" +#include "hud_minimap.h" + + +class IMaterial; + + +#define MAX_GROUNDLINE_SEGMENTS 100 + + +// This class will lay out a line of a specified width along the ground. It follows +// the contour of the ground as well as it can. +class CGroundLine : public vgui::Panel +{ + typedef vgui::Panel BaseClass; + +public: + CGroundLine(); + ~CGroundLine(); + + // One-time initialization. + bool Init(const char *pMaterialName); + + // Setup the line's rendering parameters. + void SetParameters( + const Vector &vStart, + const Vector &vEnd, + const Vector &vStartColor, // Color values 0-1 + const Vector &vEndColor, // Color values 0-1 + float alpha, + float lineWidth + ); + + // Called by the renderer when it's time to render the ground lines. + static void DrawAllGroundLines(); + + // Set the visibility + void SetVisible( bool bVisible ); + bool IsVisible( void ); + +private: + + // Draw a line along the ground. + void Draw(); + void Paint(); + +private: + // Rendering parameters. + IMaterial *m_pMaterial; + Vector m_vStartColor; + Vector m_vEndColor; + float m_Alpha; + Vector m_vStart; + Vector m_vEnd; + float m_LineWidth; + bool m_bVisible; + + // Points along the line. + Vector m_Points[MAX_GROUNDLINE_SEGMENTS]; + unsigned int m_nPoints; + + unsigned short m_ListHandle; +}; + + +#endif // GROUND_LINE_H |