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
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. #ifndef WORLDTEXTHELPER_H
  3. #define WORLDTEXTHELPER_H
  4. #pragma once
  5. #include "MapHelper.h"
  6. class CRender3D;
  7. //-----------------------------------------------------------------------------
  8. // Purpose:
  9. //-----------------------------------------------------------------------------
  10. class CWorldTextHelper : public CMapHelper
  11. {
  12. public:
  13. //
  14. // Factories.
  15. //
  16. static CMapClass *CreateWorldText(CHelperInfo *pHelperInfo, CMapEntity *pParent);
  17. //
  18. // Construction/destruction:
  19. //
  20. CWorldTextHelper();
  21. virtual ~CWorldTextHelper();
  22. DECLARE_MAPCLASS( CWorldTextHelper, CMapHelper )
  23. void SetText( const char *pNewText );
  24. void CalcBounds(BOOL bFullUpdate = FALSE);
  25. virtual CMapClass *Copy(bool bUpdateDependencies);
  26. virtual CMapClass *CopyFrom(CMapClass *pFrom, bool bUpdateDependencies);
  27. void Initialize();
  28. void Render2D(CRender2D *pRender);
  29. void Render3D(CRender3D *pRender);
  30. void Render3DText( CRender3D *pRender, const char* szText, const float flTextSize );
  31. void GetAngles(QAngle &Angles);
  32. int SerializeRMF(std::fstream &File, BOOL bRMF);
  33. int SerializeMAP(std::fstream &File, BOOL bRMF);
  34. static void SetRenderDistance(float fRenderDistance);
  35. bool ShouldRenderLast(void);
  36. bool IsVisualElement(void) { return(true); }
  37. const char* GetDescription() { return("WorldText"); }
  38. void OnParentKeyChanged(const char* szKey, const char* szValue);
  39. protected:
  40. //
  41. // Implements CMapAtom transformation functions.
  42. //
  43. void DoTransform(const VMatrix &matrix);
  44. void SetRenderMode( int mode );
  45. QAngle m_Angles;
  46. int m_eRenderMode; // Our render mode (transparency, etc.).
  47. colorVec m_RenderColor; // Our render color.
  48. float m_flTextSize;
  49. char *m_pText;
  50. private:
  51. void ComputeCornerVertices( Vector *pVerts, float flBloat = 0.0f ) const;
  52. };
  53. #endif // WORLDTEXTHELPER_H