-/***************************************************************************
- leveleditor.h - built'in level editor
- -------------------
- begin : June, 23 2004
- copyright : (C) 2004 by Ricardo Cruz
- email : rick2@aeiou.pt
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+// $Id$
+//
+// SuperTux
+// Copyright (C) 2005 Matthias Braun <matze@braunis.de>
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
#ifndef SUPERTUX_LEVELEDITOR_H
#define SUPERTUX_LEVELEDITOR_H
-#include "SDL.h"
-
#include <set>
#include <string>
namespace SuperTux {
class ButtonGroup;
-class Menu;
-class Surface;
}
+class Menu;
class Sector;
class TileMap;
+class Surface;
enum {
MN_ID_RETURN,
void load_level_subset(std::string filename);
void load_level(std::string filename);
void load_level(int nb);
- void load_sector(std::string name);
- void load_sector(Sector* sector);
+ void load_sector(size_t num);
void save_level();
void test_level();
Level* level;
std::string level_filename;
+ size_t sectornum; // number of current sector
Sector* sector; // current sector
TileMap *solids, *foregrounds, *backgrounds;
std::string sector_name;
Menu* settings_menu;
bool left_button, middle_button, mouse_moved;
+ int mouse_x, mouse_y;
bool done;
bool show_grid;
Vector scroll;
float zoom;
- SDL_Event event;
Timer2 level_name_timer;
Surface *img_background_bt, *img_foreground_bt, *img_interactive_bt;
Surface *img_previous_level_bt, *img_next_level_bt, *img_previous_sector_bt, *img_next_sector_bt;
ButtonGroup *tiles_board, *tiles_layer, *level_options;
- int cur_layer;
+ int gameobjs_first_id, cur_layer;
std::vector <std::vector <int> > selection;
Vector selection_ini, selection_end;
bool level_changed;
+
+private:
+ Sector* create_sector(const std::string& name, size_t width, size_t height);
};
#endif