X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fleveleditor.cpp;h=260c9d359543cae2cb20b515cf7f7cede8411f1f;hb=e68610f027ad6f35025d9aca87202ceb4501e97e;hp=c423e186fb285437334e6bbc6a7e21fb4f5d99d1;hpb=b431d0dbe74fbe0a9a453fd5021fd1d67a02d647;p=supertux.git diff --git a/src/leveleditor.cpp b/src/leveleditor.cpp index c423e186f..260c9d359 100644 --- a/src/leveleditor.cpp +++ b/src/leveleditor.cpp @@ -126,6 +126,10 @@ for(unsigned int id = 1; id < tilemanager->total_ids(); id++) } for(int i = 0; i < NUM_BadGuyKinds; i++) { + // filter bomb, since it is only for internal use, not for levels + if(i == BAD_BOMB) + continue; + BadGuyKind kind = BadGuyKind(i); BadGuy badguy(kind, 0,0); badguy.activate(LEFT); @@ -677,12 +681,12 @@ if(sector) (*i)->draw(context); context.pop_transform(); + continue; } Background* background = dynamic_cast (*i); if(background) { // don't resize background context.push_transform(); - context.set_translation(scroll); context.set_zooming(1.0); (*i)->draw(context); context.pop_transform(); @@ -836,7 +840,8 @@ if(level_changed) GameSession session(level_filename, ST_GL_TEST); session.run(); // player_status.reset(); -sound_manager->halt_music(); +if(sound_manager) + sound_manager->halt_music(); } void LevelEditor::change(int x, int y, int newtile, int layer) @@ -865,7 +870,7 @@ if(newtile < 0) // add object else if(newtile == OBJ_DOOR) sector->add_object(new Door(x, y)); else - sector->add_object(new BadGuy(BadGuyKind((-newtile)-1), x, y)); + sector->add_bad_guy(x, y, BadGuyKind((-newtile)-1), true); sector->update_game_objects(); } @@ -992,7 +997,7 @@ for(unsigned int i = 0; i < sizeof(text) / sizeof(text[0]); i++) context.draw_text(blue_text, _("- Level Editor's Help -"), Vector(screen->w/2, 60), CENTER_ALLIGN, LAYER_GUI); - context.draw_text(white_small_text, *text[i], Vector(/*20*/screen->w/2, 120), CENTER_ALLIGN, LAYER_GUI); + context.draw_text(white_small_text, *text[i], Vector(20, 120), LEFT_ALLIGN, LAYER_GUI); sprintf(str,_("Press any key to continue - Page %d/%d"), i+1, sizeof(text) / sizeof(text[0])); context.draw_text(gold_text, str, Vector(screen->w/2, screen->h-60), CENTER_ALLIGN, LAYER_GUI);