7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2003
9 // Copyright: See COPYING file that comes with this distribution
13 #ifndef SUPERTUX_LEVEL_H
14 #define SUPERTUX_LEVEL_H
19 #include "lispreader.h"
23 /** This type holds meta-information about a level-subset.
24 It could be extended to handle manipulation of subsets. */
29 static void create(const std::string& subset_name);
30 void load(char *subset);
36 std::string description;
41 void parse(lisp_object_t* cursor);
44 #define LEVEL_NAME_MAX 20
53 extern texture_type img_bkgd;
54 extern texture_type img_bkgd_tile[2][4];
55 extern texture_type img_solid[4];
56 extern texture_type img_brick[2];
63 std::string song_title;
64 std::string bkgd_image;
65 std::string particle_system;
66 unsigned int* bg_tiles[15]; /* Tiles in the background */
67 unsigned int* ia_tiles[15]; /* Tiles which can interact in the game (solids for example)*/
68 unsigned int* fg_tiles[15]; /* Tiles in the foreground */
76 std::vector<BadGuyData> badguy_data;
78 /** Will the Level structure with default values */
81 /** Cleanup the level struct from allocated tile data and such */
84 int load(const char * subset, int level);
85 int load(const char* filename);
89 void level_save (st_level* plevel, const char * subset, int level);
90 void level_load_gfx (st_level* plevel);
91 void level_change (st_level* plevel, float x, float y, int tm, unsigned int c);
92 void level_change_size (st_level* plevel, int new_width);
93 void level_load_song(st_level* plevel);
94 void level_free_gfx();
95 void level_load_image(texture_type* ptexture, std::string theme, const char * file, int use_alpha);
96 void level_free_song(void);
98 /** Return the id of the tile at the given x/y coordinates */
99 unsigned int gettileid(float x, float y);
101 /** Return a pointer to the tile at the given x/y coordinates */
102 Tile* gettile(float x, float y);
104 // Some little helper function to check for tile properties
105 bool issolid(float x, float y);
106 bool isbrick(float x, float y);
107 bool isice(float x, float y);
108 bool isfullbox(float x, float y);
110 #endif /*SUPERTUX_LEVEL_H*/