[cppcheck] Part 2: Some further style fixes etc.
[supertux.git] / src / object / candle.cpp
index 10c549d..ec0ff01 100644 (file)
 #include "util/reader.hpp"
 
 Candle::Candle(const Reader& lisp)
-  : MovingSprite(lisp, "images/objects/candle/candle.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_DISABLED), 
-    burning(true), 
+  : MovingSprite(lisp, "images/objects/candle/candle.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_DISABLED),
+    burning(true),
     flicker(true),
     lightcolor(1.0f, 1.0f, 1.0f),
-    candle_light_1(sprite_manager->create("images/objects/candle/candle-light-1.sprite")),
-    candle_light_2(sprite_manager->create("images/objects/candle/candle-light-2.sprite"))
+    candle_light_1(SpriteManager::current()->create("images/objects/candle/candle-light-1.sprite")),
+    candle_light_2(SpriteManager::current()->create("images/objects/candle/candle-light-2.sprite"))
 {
   lisp.get("name", name);
   lisp.get("burning", burning);
@@ -48,7 +48,7 @@ Candle::Candle(const Reader& lisp)
     candle_light_1->set_action("white");
     candle_light_2->set_action("white");
   }
-    
+
   if (burning) {
     sprite->set_action("on");
   } else {
@@ -107,7 +107,11 @@ Candle::puff_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));
 }
 
 bool
@@ -117,11 +121,11 @@ Candle::get_burning()
 }
 
 void
-Candle::set_burning(bool burning)
+Candle::set_burning(bool burning_)
 {
-  if (this->burning == burning) return;
-  this->burning = burning;
-  if (burning) {
+  if (this->burning == burning_) return;
+  this->burning = burning_;
+  if (burning_) {
     sprite->set_action("on");
   } else {
     sprite->set_action("off");