Replaced Ref and RefCounter with std::shared_ptr<>
[supertux.git] / src / badguy / livefire.cpp
index 46b0ba5..dd9c165 100644 (file)
@@ -25,9 +25,9 @@
 
 LiveFire::LiveFire(const Reader& reader) :
   WalkingBadguy(reader, "images/creatures/livefire/livefire.sprite", "left", "right"),
-  lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-medium.sprite")),
+  lightsprite(SpriteManager::current()->create("images/objects/lightmap_light/lightmap_light-medium.sprite")),
   death_sound("sounds/fall.wav"),
-  state(STATE_WALKING)  
+  state(STATE_WALKING)
 {
   walk_speed = 80;
   max_drop_height = 20;
@@ -131,12 +131,15 @@ LiveFire::is_flammable() const
 void
 LiveFire::kill_fall()
 {
-  sound_manager->play(death_sound, get_pos());
+  SoundManager::current()->play(death_sound, get_pos());
   // throw a puff of smoke
   Vector ppos = bbox.get_middle();
   Vector pspeed = Vector(0, -150);
   Vector paccel = Vector(0,0);
-  Sector::current()->add_object(new SpriteParticle("images/objects/particles/smoke.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_BACKGROUNDTILES+2));
+  Sector::current()->add_object(std::make_shared<SpriteParticle>("images/objects/particles/smoke.sprite",
+                                                                 "default", ppos, ANCHOR_MIDDLE,
+                                                                 pspeed, paccel,
+                                                                 LAYER_BACKGROUNDTILES+2));
   // extinguish the flame
   sprite->set_action(dir == LEFT ? "extinguish-left" : "extinguish-right", 1);
   physic.set_velocity_y(0);