[Super-tux-commit] supertux/src leveleditor.cpp,1.48,1.49
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-17 13:29:48
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28725 Modified Files: leveleditor.cpp Log Message: - removed level editors dependency on the World class Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- leveleditor.cpp 13 Apr 2004 12:25:22 -0000 1.48 +++ leveleditor.cpp 17 Apr 2004 13:29:38 -0000 1.49 @@ -24,7 +24,6 @@ #include <SDL_image.h> #include "leveleditor.h" -#include "world.h" #include "screen.h" #include "defines.h" #include "globals.h" @@ -79,13 +78,41 @@ void update_subset_settings_menu(); void save_subset_settings_menu(); +static Level* le_current_level; + +struct LevelEditorWorld +{ + std::vector<BadGuy> bad_guys; + void arrays_free(void) + { + bad_guys.clear(); + } + + void add_bad_guy(float x, float y, BadGuyKind kind) + { + bad_guys.push_back(BadGuy()); + BadGuy& new_bad_guy = bad_guys.back(); + + new_bad_guy.init(x,y,kind); + } + + void activate_bad_guys() + { + for (std::vector<BadGuyData>::iterator i = le_current_level->badguy_data.begin(); + i != le_current_level->badguy_data.end(); + ++i) + { + add_bad_guy(i->x, i->y, i->kind); + } + } +}; + /* leveleditor internals */ static string_list_type level_subsets; static bool le_level_changed; /* if changes, ask for saving, when quiting*/ static int pos_x, cursor_x, cursor_y, fire; static int le_level; -static Level* le_current_level; -static World le_world; +static LevelEditorWorld le_world; static st_subset le_level_subset; static int le_show_grid; static int le_frame; |