forked from perilouswithadollarsign/cstrike15_src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapsprite.h
93 lines (66 loc) · 2.59 KB
/
mapsprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//========= Copyright © 1996-2005, 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