-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframe.h
44 lines (35 loc) · 1.04 KB
/
frame.h
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
#ifndef FRAME__H
#define FRAME__H
#include <iostream>
#include <string>
#include <SDL.h>
class Frame {
public:
Frame( SDL_Surface*);
Frame( SDL_Surface* spr, Uint16 sprite_width, Uint16 sprite_height,
Sint16 src_x, Sint16 src_y);
// ExplodingSprite::makeChunks needs this constructor if
// we are not going to keep each chunk on a separate surface:
Frame(const Frame&);
Frame& operator=(const Frame&);
SDL_Surface* getSurface() const { return surface; }
void draw(Sint16 x, Sint16 y) const;
// Chunk::draw needs the next function if the chunk is not
// on a separate surface:
void draw(Sint16 sx, Sint16 sy, Sint16 dx, Sint16 dy) const;
void draw(Sint16 x, Sint16 y, double angle) const;
Uint16 getWidth() const { return surface->w; }
Uint16 getHeight() const { return surface->h; }
private:
SDL_Surface * screen;
SDL_Surface * surface;
Uint16 width;
Uint16 height;
// SDL_Surface * spriteSurface;
Uint16 spriteWidth;
Uint16 spriteHeight;
Sint16 spriteSourceX;
Sint16 spriteSourceY;
Frame();
};
#endif