-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathSprite_ZAxis.h
61 lines (51 loc) · 1.55 KB
/
Sprite_ZAxis.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
#ifndef SPRITE_ZAXIS_H
#define SPRITE_ZAXIS_H
#include "../CommonTypes.h"
#include "RenderComponent.h"
#include <vector>
class IDriver3D;
class Object;
class Sprite_ZAxis : public RenderComponent
{
public:
Sprite_ZAxis();
virtual ~Sprite_ZAxis();
void Render(Object *pObj, IDriver3D *pDriver, float fIntensity, const Vector3& vOffset) override;
void SetUV_Flip(bool bFlipX, bool bFlipY, bool bFlipAxis=false) override { m_aFlip[0] = bFlipX?1:0; m_aFlip[1] = bFlipY?1:0; m_aFlip[2] = bFlipAxis?1:0; }
void SetAlpha(float fAlpha=1.0f) { m_fAlpha = fAlpha; }
void AddFX_Frame(TextureHandle frameTex, uint32_t uWidth, uint32_t uHeight)
{
FX_Frame frame;
frame.hTex = frameTex;
frame.uWidth = uWidth;
frame.uHeight = uHeight;
m_fxFrames.push_back(frame);
}
//Oriented Sprite specific functions.
void SetTextureHandle(TextureHandle hTex) override { m_hTex = hTex; }
void SetBaseIntensity(float fBaseItens) { m_fBaseItens = fBaseItens; }
void SetFlag(uint32_t uFlag) { m_uFlags |= uFlag; }
bool IsFlagSet(uint32_t uFlag) { return (m_uFlags&uFlag)!=0; }
public:
enum
{
FLAG_EMISSIVE = (1<<0),
};
private:
struct FX_Frame
{
TextureHandle hTex;
uint32_t uWidth;
uint32_t uHeight;
};
TextureHandle m_hTex;
std::vector<FX_Frame> m_fxFrames;
uint32_t m_uFlags;
uint32_t m_uCurFrame;
int32_t m_nFrameDelay;
uint8_t m_aFlip[3];
uint8_t m_uPad;
float m_fBaseItens;
float m_fAlpha;
};
#endif //SPRITE_ZAXIS_H