summaryrefslogtreecommitdiff
path: root/Sprite.h
blob: 72a5270011cf44362434085bb4b6161a9fae94c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef SPRITE_H
#define SPRITE_H

#include <string>
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "intensemarcus.h"

class Sprite {
    public:
        Sprite();

        // Get coordinates
        int getX();
        int getY();

        // Set coordinates
        void setX(int x);
        void setY(int y);

        bool visible();

        // Load in this sprite's image
        bool setImage(std::string path);
        // TODO: Add method that can set reference to an already loaded image
        // This sprite's image
        SDL_Surface *image;

        SDL_Rect* getClip();

        void setClip(int clipNo, int x, int y, int w, int h);

    protected:
        // Coordinates
        int x, y;

        // Visability
        bool isVisible;

        // Sprite clip
        SDL_Rect clip[5];
        // Clip number
        int clipNo;
};

#endif