1 /***************************************************************************
2 leveleditor.h - built'in level editor
5 copyright : (C) 2004 by Ricardo Cruz
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
18 #ifndef SUPERTUX_LEVELEDITOR_H
19 #define SUPERTUX_LEVELEDITOR_H
24 #include "video/drawing_context.h"
27 #include "level_subset.h"
29 using namespace SuperTux;
52 // creating subset menu ids:
53 MN_ID_FILENAME_SUBSET,
55 MN_ID_DESCRIPTION_SUBSET,
71 OBJ_TRAMPOLINE = -100,
72 OBJ_FLYING_PLATFORM = -101,
82 void run(const std::string filename = "");
87 void draw(DrawingContext& context);
89 void load_level_subset(std::string filename);
90 void load_level(std::string filename);
91 void load_level(int nb);
92 void load_sector(size_t num);
100 void change(int x, int y, int newtile, int layer);
102 void load_buttons_gfx();
103 void free_buttons_gfx();
106 std::string level_filename;
108 size_t sectornum; // number of current sector
109 Sector* sector; // current sector
110 TileMap *solids, *foregrounds, *backgrounds;
111 std::string sector_name;
113 std::set<std::string> level_subsets;
114 LevelSubset* level_subset;
119 Menu* create_subset_menu;
122 bool left_button, middle_button, mouse_moved;
123 int mouse_x, mouse_y;
130 Timer2 level_name_timer;
132 Surface *img_background_bt, *img_foreground_bt, *img_interactive_bt;
133 Surface *img_save_level_bt, *img_setup_level_bt, *img_test_level_bt;
134 Surface *img_rubber_bt;
135 Surface *img_previous_level_bt, *img_next_level_bt, *img_previous_sector_bt, *img_next_sector_bt;
137 ButtonGroup *tiles_board, *tiles_layer, *level_options;
138 int gameobjs_first_id, cur_layer;
140 std::vector <std::vector <int> > selection;
141 Vector selection_ini, selection_end;
146 Sector* create_sector(const std::string& name, size_t width, size_t height);