summaryrefslogtreecommitdiff
path: root/hammer/mapsprite.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 /hammer/mapsprite.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'hammer/mapsprite.h')
-rw-r--r--hammer/mapsprite.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/hammer/mapsprite.h b/hammer/mapsprite.h
new file mode 100644
index 0000000..8a3fa52
--- /dev/null
+++ b/hammer/mapsprite.h
@@ -0,0 +1,93 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef MAPSPRITE_H
+#define MAPSPRITE_H
+#pragma once
+
+
+#include "MapHelper.h"
+#include "Sprite.h"
+
+
+class CRender3D;
+class CSpriteModel;
+
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+class CMapSprite : public CMapHelper
+{
+ public:
+
+ //
+ // Factories.
+ //
+ static CMapClass *CreateMapSprite(CHelperInfo *pHelperInfo, CMapEntity *pParent);
+ static CMapSprite *CreateMapSprite(const char *pszSpritePath);
+
+ //
+ // Construction/destruction:
+ //
+ CMapSprite(void);
+ ~CMapSprite(void);
+
+ DECLARE_MAPCLASS(CMapSprite, CMapHelper)
+
+ void CalcBounds(BOOL bFullUpdate = FALSE);
+
+ virtual CMapClass *Copy(bool bUpdateDependencies);
+ virtual CMapClass *CopyFrom(CMapClass *pFrom, bool bUpdateDependencies);
+
+ void Initialize(void);
+ void Render2D(CRender2D *pRender);
+ void Render3D(CRender3D *pRender);
+
+ // Called by entity code to render sprites
+ void RenderLogicalAt(CRender2D *pRender, const Vector2D &vecMins, const Vector2D &vecMaxs );
+
+ void GetAngles(QAngle &Angles);
+
+ int SerializeRMF(std::fstream &File, BOOL bRMF);
+ int SerializeMAP(std::fstream &File, BOOL bRMF);
+
+ static void SetRenderDistance(float fRenderDistance);
+ static void EnableAnimation(BOOL bEnable);
+
+ bool ShouldRenderLast(void);
+
+ bool IsVisualElement(void) { return(true); }
+
+ const char* GetDescription() { return("Sprite"); }
+
+ void OnParentKeyChanged(const char* szKey, const char* szValue);
+
+ protected:
+
+ //
+ // Implements CMapAtom transformation functions.
+ //
+ void DoTransform(const VMatrix &matrix);
+
+ int GetNextSpriteFrame( CRender3D* pRender );
+ void SetRenderMode( int mode );
+ void SpriteColor(unsigned char *pColor, int eRenderMode, colorVec RenderColor, int alpha);
+
+ QAngle m_Angles;
+
+ CSpriteModel *m_pSpriteInfo; // Pointer to a sprite model in the cache.
+ int m_nCurrentFrame; // Current sprite frame for rendering.
+ float m_fSecondsPerFrame; // How many seconds to render each frame before advancing.
+ float m_fElapsedTimeThisFrame; // How many seconds we have rendered this sprite frame so far.
+ float m_fScale; // Sprite scale along sprite axes.
+ int m_eRenderMode; // Our render mode (transparency, etc.).
+ colorVec m_RenderColor; // Our render color.
+ bool m_bIsIcon; // If true, this sprite is an iconic representation of an entity.
+};
+
+#endif // MAPSPRITE_H