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
/********************************************************************
*
*	File:		fsCNativeSprite.h
*
*	Purpose:	Sprite that is added to and retained by a scene. All
*				positioning / parenting is handled in the scene
*
*********************************************************************/

#ifndef fsCNativeSpritehdr
#define fsCNativeSpritehdr

#include <fsCore/fsBaseTypes.h>
#include <fsCore/fsSColour.h>

#include "fsINative.h"
#include "fsCore/fsAffineMtx2d.h"


class fsAffineMtx2d;
class fsCBrush;
class fsCTexture;
struct fsPoint;


class fsCNativeSprite : public fsINative
{
	friend class fsCNativeSpriteRenderData;

public:

	fsBool hitTest(const fsPoint& pLocalPos, fsBool pRequireHitMap) const;

	fsS32 widthGet() const;
	fsS32 heightGet() const;

	std::shared_ptr<fsCBrush> brushGet() const;

	virtual ~fsCNativeSprite();<--- Destructor in derived class

protected:

	void polygonInfoSetDo(fsIRenderData::fsSPolyInfo const& pPolyInfo) override;<--- Function in derived class

	void textureWrapSetDo() override;<--- Function in derived class
	void renderDo() override;
	void colourSetDo(const fsSColour4B& pColour) override;

	void uvSetDo(const fsRect& pOffest) override;<--- Function in derived class
	void vertsSetDo(std::vector<fsVec2d> const& pVerts) override;
	void widthSetDo(fsS32 pWidth) override;
	void heightSetDo(fsS32 pHeight) override;
	void brushSetDo(std::shared_ptr<fsCBrush> pBrush) override;
	void alphaBlendModeSetDo(fsS32 pAlphaBlendMode) override;<--- Function in derived class

	fsCNativeSprite();

private:

	fsS32 mWidth;
	fsS32 mHeight;
	fsSColour4B mTint;

	std::shared_ptr<fsCBrush> mBrush;
	fsCTexture* mTexture;
	fsBool mScaled;
};


#endif