00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CSPRITE_HPP_INCLUDED
00020 #define CSPRITE_HPP_INCLUDED
00021
00022 #undef AFX_EXT_CLASS
00023 #undef AFX_EXT_API
00024 #undef AFX_EXT_DATA
00025 #define AFX_EXT_CLASS AFX_CLASS_IMPORT
00026 #define AFX_EXT_API AFX_API_IMPORT
00027 #define AFX_EXT_DATA AFX_DATA_IMPORT
00028
00029 #include <SDL.h>
00030 #include <sdl_image.h>
00031
00032 #undef AFX_EXT_CLASS
00033 #undef AFX_EXT_API
00034 #undef AFX_EXT_DATA
00035 #define AFX_EXT_CLASS AFX_CLASS_EXPORT
00036 #define AFX_EXT_API AFX_API_EXPORT
00037 #define AFX_EXT_DATA AFX_DATA_EXPORT
00038
00039 #include "start_code.hpp"
00040
00041 namespace SPACE
00042 {
00043 namespace Graphic
00044 {
00045 class DLL_EXPORT cSprite
00046 {
00047 public:
00048 cSprite(SDL_Surface* _Screen);
00049 ~cSprite();
00050
00052 bool Load(const char* _ImagePath);
00053
00055 void SetColorKey(int _R, int _G, int _B);
00056
00058 void SetPos(float _X, float _Y);
00059
00064 void Move(float _dX, float _dY);
00065
00067 bool Render();
00068
00070 SDL_Rect GetRect() {return m_Rect;}
00071
00072 void SetH(int h) {m_Rect.h -= h;}
00073 void SetW(int h) {m_Rect.w -= h;}
00074
00076
00077
00083
00084
00085 private:
00086 SDL_Surface* m_pScreen;
00087 SDL_Surface* m_pImage;
00088 SDL_Rect m_Rect;
00089
00090 };
00091 }
00092 }
00093
00094 #endif // CSPRITE_HPP_INCLUDED