summaryrefslogtreecommitdiff
path: root/src/client/image.h
blob: 03e952de352ec3d8d124fdc5ea73626d9e36eb99 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60

#ifndef IMAGE_H

#    define IMAGE_H

#    include "main.h"
#    include "interface.h"

#    define IMAGE_NO_ALPHA	0
#    define IMAGE_ALPHA	1

#    define IMAGE_GROUP_BASE	"base"
#    define IMAGE_GROUP_EXTENDSIO	"extension"
#    define IMAGE_GROUP_USER	"user"
#    define IMAGE_GROUP_OTHER	"other"

#ifdef SUPPORT_OPENGL
#include <SDL_opengl.h>
#endif

/*
typedef struct image_struct
{
	char *name;
	char *group;
	SDL_Surface *image;
} image_data_t;
*/

#ifndef SUPPORT_OPENGL
typedef struct image_struct {
	int w;
	int h;
	SDL_Surface *image;
} image_t;
#endif

#ifdef SUPPORT_OPENGL
typedef struct image_struct
{
	int w; // width of actual picture
	int h; // height of actual picture
	GLuint tw; // width of allocated texture
	GLuint th; // height of allocated texture
	GLuint tex_id; // texture id
} image_t;
#endif

extern bool_t isImageInicialized();
extern void initImageData();
extern image_t* newImage(SDL_Surface *surface);
extern void destroyImage(image_t * p);
extern image_t *addImageData(char *file, int alpha, char *name, char *group);
extern image_t *getImage(char *group, char *name);
extern void delImage(char *group, char *name);
extern void delAllImageInGroup(char *group);
extern void drawImage(image_t * p, int x, int y, int px, int py, int w, int h);
extern void quitImageData();

#endif