spirit/src/game/GameObject.h

44 lines
898 B
C++

#ifndef GAMEOBJECT
#define GAMEOBJECT
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
class Frame
{
public:
Frame(SDL_Rect dstrect, SDL_Rect srcrect, bool mirror = 0, int angle = 0)
{
this->dstrect = dstrect;
this->srcrect = srcrect;
this->mirror = mirror;
this->angle = angle;
}
public:
SDL_Rect dstrect;
SDL_Rect srcrect;
bool mirror;
int angle;
};
class GameObject
{
public:
GameObject(int x, int y, int w, int h)
{
(this->dstrect).x = x;
(this->dstrect).y = y;
(this->dstrect).w = w;
(this->dstrect).h = h;
}
virtual Frame frame()
{
return Frame((SDL_Rect){0,0,0,0}, (SDL_Rect){0,0,0,0});
}
protected:
SDL_Rect dstrect;
};
#endif //GAMEOBJECT