fixed some "solids" to be non-solid
[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 <string>
17 #include "texture.h"
18 #include "badguy.h"
19 #include "lispreader.h"
20
21 /* This type holds meta-information about a level-subset. */
22 /* It could be extended to handle manipulation of subsets. */
23 class st_subset
24   {
25   public:
26     st_subset();
27     static void create(const std::string& subset_name);
28     void load(char *subset);
29     void save();
30     void free();
31
32     std::string name;
33     std::string title;
34     std::string description;
35     texture_type image;
36     int levels;
37  
38   private:
39     void parse(lisp_object_t* cursor);
40   };
41
42 #define LEVEL_NAME_MAX 20
43
44
45 enum {
46  TM_BG,
47  TM_IA,
48  TM_DN,
49  TM_FG
50  };
51
52 extern texture_type img_bkgd;
53 extern texture_type img_bkgd_tile[2][4];
54 extern texture_type img_solid[4];
55 extern texture_type img_brick[2];
56
57 class st_level 
58 {
59  public:
60   std::string name;
61   std::string theme;
62   std::string song_title;
63   std::string bkgd_image;
64   std::string particle_system;
65   unsigned int* bg_tiles[15]; /* Tiles in the background */
66   unsigned int* ia_tiles[15]; /* Tiles which can interact in the game (solids for example)*/
67   unsigned int* dn_tiles[15]; /* Dynamic tiles (bad guys and moving platforms for example)*/
68   unsigned int* fg_tiles[15]; /* Tiles in the foreground */
69   int time_left;
70   int bkgd_red;
71   int bkgd_green;
72   int bkgd_blue;
73   int width;
74   float gravity;
75
76   std::vector<BadGuyData> badguy_data;
77  public:
78 };
79
80 void level_default  (st_level* plevel);
81 int  level_load     (st_level* plevel, const char * subset, int level);
82 void level_parse    (st_level* plevel, lisp_object_t* cursor);
83 int  level_load     (st_level* plevel, const char* filename);
84 void level_save     (st_level* plevel, const char * subset, int level);
85 void level_free     (st_level* plevel);
86 void level_load_gfx (st_level* plevel);
87 void level_change   (st_level* plevel, float x, float y, int tm, unsigned int c);
88 void level_change_size (st_level* plevel, int new_width);
89 void level_load_song(st_level* plevel);
90 void level_free_gfx();
91 void level_load_image(texture_type* ptexture, std::string theme, const char * file, int use_alpha);
92 void level_free_song(void);
93
94 #endif /*SUPERTUX_LEVEL_H*/