-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathshape.h
41 lines (38 loc) · 1.08 KB
/
shape.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
// Shape class header file
// Author: M.D.Snellgrove
// Date: 27/1/2002
// History:
// Changes by M Harman for Windows version, June 2003:
// Changes for graphics related stuff.
#include "SDL/SDL.h"
#include <fstream>
using namespace std;
class shape{
private:
SDL_Surface *surface;
int width;
int height;
char *buffer;
int max(int, int);
int min(int, int);
public:
shape();
shape(SDL_Surface *source, int x, int y, int w, int h);
shape(const shape &);
~shape();
shape& operator= (const shape &);
int getwidth();
int getheight();
SDL_Surface* getSurface();
//char* getbuffer();
void grab(SDL_Surface *source, int x, int y, int w, int h);
bool read(ifstream &);
bool readfile(char*);
bool read(SDL_Surface*, ifstream &);
bool readfile(SDL_Surface*, char*);
void blit(SDL_Surface *dest, int x, int y);
void blit(SDL_Surface *dest, int x, int y, bool mask);
bool write(ofstream &);
bool writefile(char*);
bool collide(int, int, const shape &, int, int);
};