huge CVS merge, see ChangeLog for details.
[supertux.git] / src / level.h
1 //
2 // C Interface: level
3 //
4 // Description: 
5 //
6 //
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2003
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12
13 #ifndef SUPERTUX_LEVEL_H
14 #define SUPERTUX_LEVEL_H
15
16 #include "texture.h"
17
18 /* This type holds meta-information about a level-subset. */
19 /* It could be extended to handle manipulation of subsets. */
20 typedef struct st_subset
21   {
22     char *name;
23     char *title;
24     char *description;
25     texture_type image;
26     int levels;
27   } st_subset;
28
29 void subset_init(st_subset* st_subset);
30 void subset_load(st_subset* st_subset, char *subset);
31 void subset_free(st_subset* st_subset);
32   
33 #define LEVEL_NAME_MAX 20
34
35 typedef struct st_level /*It is easier to read the sources IMHO, if we don't write something like int a,b,c; */
36   {
37     char name[LEVEL_NAME_MAX];
38     char theme[100];
39     char song_title[100];
40     char bkgd_image[100];   
41     unsigned char* tiles[15];
42     int time_left;
43     int bkgd_red;
44     int bkgd_green;
45     int bkgd_blue;
46     int width;
47   } st_level;
48   
49 extern texture_type img_bkgd, img_bkgd_tile[2][4], img_solid[4], img_brick[2];
50   
51 int level_load(st_level* plevel, char * subset, int level);
52 void level_save(st_level* plevel, char * subset, int level);
53 void level_free(st_level* plevel);
54 void level_load_gfx(st_level* plevel);
55 void level_free_gfx();
56 void level_load_image(texture_type* ptexture, char* theme, char * file, int use_alpha);
57 void level_change(st_level* plevel, float x, float y, unsigned char c);
58 void level_load_song(st_level* plevel);
59 void level_free_song(void);
60
61 #endif /*SUPERTUX_LEVEL_H*/