50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#ifndef DEF_XSPRITE_H
|
|
|
|
#define DEF_XSPRITE_H
|
|
|
|
class xSprite{
|
|
|
|
public:
|
|
xSprite(xManager *m); // Sprite vide
|
|
xSprite(xManager *m, const int rgb[]); // Sprite couleur
|
|
xSprite(xManager *m, const char *url); // Sprite image
|
|
xSprite(xManager *m, SDL_Texture *t); // Sprite texture
|
|
~xSprite();
|
|
|
|
|
|
vector<int> move(SDL_Rect newpos); // Deplace le sprite
|
|
vector<int> move(int x, int y); // Deplace le sprite
|
|
|
|
void dimensions(); // Dimensions par defaut
|
|
void dimensions(SDL_Rect r); // Dimensions sortie
|
|
void dimensions(SDL_Rect r, SDL_Rect clip); // Dimensions in/out
|
|
|
|
virtual void push(string index); // Ajoute a l'affichage
|
|
void pull(string index); // Retire de l'affichage
|
|
void pull(); // Retire de l'affichage
|
|
|
|
void update(); // Fait renmonter la mise a jour du manager
|
|
|
|
// GETTERS
|
|
SDL_Texture *texture();
|
|
xManager *manager();
|
|
|
|
SDL_Rect *dst();
|
|
SDL_Rect *src();
|
|
|
|
protected:
|
|
xManager *_manager;
|
|
SDL_Texture *_texture;
|
|
|
|
SDL_Rect _dst;
|
|
SDL_Rect _src;
|
|
|
|
// Enregistre le dernier index utilise
|
|
string _index;
|
|
|
|
// Protection inter-thread
|
|
mutex _mutex_move;
|
|
|
|
};
|
|
|
|
#endif |