Subversion Repositories spk

Rev

Blame | Last modification | View Log | RSS feed

// GfxEntitySprite.h: interface for the CRenderSprite class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_GFXENTITYSPRITE_H__8A261898_192A_4D9F_ADA1_A0FAA1A365F5__INCLUDED_)
#define AFX_GFXENTITYSPRITE_H__8A261898_192A_4D9F_ADA1_A0FAA1A365F5__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "../../src/Visualisation/TextureFile.h"
#include "Display.h"

#ifndef DEGTORAD
        #define DEGTORAD(degree) ((D3DX_PI / 180.0f) * (degree)) // converts from degrees to radians
        #define RADTODEG(radian) ((180.0f / D3DX_PI) * (radian)) // converts from radians to degrees
#endif //DEGTORAD

class CRenderSprite : public CRenderObject
{
public:
        virtual void StartAnimation ( SAnimate *anim );
        virtual void ParseSetting ( COverlay *overlay, CyString cmd, CyString rest, CyString section );

        CTextureFile * GetTextureFile();
        RECT *GetFrame ( int frame );
        void SetFrames ( const STextureFrames *frames );
        bool Init( MyDirect3DDevice9 *device );
        void SetCenter();
        int GetWidth();
        int GetHeight();
        bool InitialiseData ();
        void render ( MyDirect3DDevice9 *device, int x, int y, LPD3DXSPRITE sprite );
        bool LoadFile ( const char *filename );

        CRenderSprite ( MyDirect3DDevice9 *device );
        virtual ~CRenderSprite();

        bool Init () { return m_init; }

private:
        LPDIRECT3DTEXTURE9 m_texture;
        LPDIRECT3DTEXTURE9 m_collisionTexture;

        bool CheckFile ( const char *filename );

        int  m_width;
        char m_file[30];
        int  m_height;
        bool *m_alphamap;

        bool m_center;

        CTextureFile *m_tfile;

        STextureFrames m_frames;
        bool  m_init;
        int m_type;

        float m_fRot;
        int       m_iCurFrame;

        SPlayAnimation m_anim;
        bool m_animStop;

        int m_iAnimation;
};

#endif // !defined(AFX_GFXENTITYSPRITE_H__8A261898_192A_4D9F_ADA1_A0FAA1A365F5__INCLUDED_)