- committed patch from Richard Smith
[supertux.git] / src / leveleditor.cpp
index c423e18..260c9d3 100644 (file)
@@ -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<Background*> (*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);