| 11 | cycrow | 1 | // GfxEntitySprite.h: interface for the CRenderSprite class.
 | 
        
           |  |  | 2 | //
 | 
        
           |  |  | 3 | //////////////////////////////////////////////////////////////////////
 | 
        
           |  |  | 4 |   | 
        
           |  |  | 5 | #if !defined(AFX_GFXENTITYSPRITE_H__8A261898_192A_4D9F_ADA1_A0FAA1A365F5__INCLUDED_)
 | 
        
           |  |  | 6 | #define AFX_GFXENTITYSPRITE_H__8A261898_192A_4D9F_ADA1_A0FAA1A365F5__INCLUDED_
 | 
        
           |  |  | 7 |   | 
        
           |  |  | 8 | #if _MSC_VER > 1000
 | 
        
           |  |  | 9 | #pragma once
 | 
        
           |  |  | 10 | #endif // _MSC_VER > 1000
 | 
        
           |  |  | 11 |   | 
        
           |  |  | 12 | #include "../../src/Visualisation/TextureFile.h"
 | 
        
           |  |  | 13 | #include "Display.h"
 | 
        
           |  |  | 14 |   | 
        
           |  |  | 15 | #ifndef DEGTORAD
 | 
        
           |  |  | 16 | 	#define DEGTORAD(degree) ((D3DX_PI / 180.0f) * (degree)) // converts from degrees to radians
 | 
        
           |  |  | 17 | 	#define RADTODEG(radian) ((180.0f / D3DX_PI) * (radian)) // converts from radians to degrees
 | 
        
           |  |  | 18 | #endif //DEGTORAD
 | 
        
           |  |  | 19 |   | 
        
           |  |  | 20 | class CRenderSprite : public CRenderObject
 | 
        
           |  |  | 21 | {
 | 
        
           |  |  | 22 | public:
 | 
        
           |  |  | 23 | 	virtual void StartAnimation ( SAnimate *anim );
 | 
        
           |  |  | 24 | 	virtual void ParseSetting ( COverlay *overlay, CyString cmd, CyString rest, CyString section );
 | 
        
           |  |  | 25 |   | 
        
           |  |  | 26 | 	CTextureFile * GetTextureFile();
 | 
        
           |  |  | 27 | 	RECT *GetFrame ( int frame );
 | 
        
           |  |  | 28 | 	void SetFrames ( const STextureFrames *frames );
 | 
        
           |  |  | 29 | 	bool Init( MyDirect3DDevice9 *device );
 | 
        
           |  |  | 30 | 	void SetCenter();
 | 
        
           |  |  | 31 | 	int GetWidth();
 | 
        
           |  |  | 32 | 	int GetHeight();
 | 
        
           |  |  | 33 | 	bool InitialiseData ();
 | 
        
           |  |  | 34 | 	void render ( MyDirect3DDevice9 *device, int x, int y, LPD3DXSPRITE sprite );
 | 
        
           |  |  | 35 | 	bool LoadFile ( const char *filename );
 | 
        
           |  |  | 36 |   | 
        
           |  |  | 37 | 	CRenderSprite ( MyDirect3DDevice9 *device );
 | 
        
           |  |  | 38 | 	virtual ~CRenderSprite();
 | 
        
           |  |  | 39 |   | 
        
           |  |  | 40 | 	bool Init () { return m_init; }
 | 
        
           |  |  | 41 |   | 
        
           |  |  | 42 | private:
 | 
        
           |  |  | 43 | 	LPDIRECT3DTEXTURE9 m_texture;
 | 
        
           |  |  | 44 | 	LPDIRECT3DTEXTURE9 m_collisionTexture;
 | 
        
           |  |  | 45 |   | 
        
           |  |  | 46 | 	bool CheckFile ( const char *filename );
 | 
        
           |  |  | 47 |   | 
        
           |  |  | 48 | 	int  m_width;
 | 
        
           |  |  | 49 | 	char m_file[30];
 | 
        
           |  |  | 50 | 	int  m_height;
 | 
        
           |  |  | 51 | 	bool *m_alphamap;
 | 
        
           |  |  | 52 |   | 
        
           |  |  | 53 | 	bool m_center;
 | 
        
           |  |  | 54 |   | 
        
           |  |  | 55 | 	CTextureFile *m_tfile;
 | 
        
           |  |  | 56 |   | 
        
           |  |  | 57 | 	STextureFrames m_frames;
 | 
        
           |  |  | 58 | 	bool  m_init;
 | 
        
           |  |  | 59 | 	int m_type;
 | 
        
           |  |  | 60 |   | 
        
           |  |  | 61 | 	float m_fRot;
 | 
        
           |  |  | 62 | 	int	  m_iCurFrame;
 | 
        
           |  |  | 63 |   | 
        
           |  |  | 64 | 	SPlayAnimation m_anim;
 | 
        
           |  |  | 65 | 	bool m_animStop;
 | 
        
           |  |  | 66 |   | 
        
           |  |  | 67 | 	int m_iAnimation;
 | 
        
           |  |  | 68 | };
 | 
        
           |  |  | 69 |   | 
        
           |  |  | 70 | #endif // !defined(AFX_GFXENTITYSPRITE_H__8A261898_192A_4D9F_ADA1_A0FAA1A365F5__INCLUDED_)
 |