Pause music when pressing ESC during a level and resume it when exiting the pause...
[supertux.git] / src / supertux / object_factory.cpp
index 096e82a..006060f 100644 (file)
@@ -88,6 +88,7 @@
 #include "object/bullet.hpp"
 #include "object/camera.hpp"
 #include "object/candle.hpp"
+#include "object/torch.hpp"
 #include "object/cloud_particle_system.hpp"
 #include "object/coin.hpp"
 #include "object/coin_explode.hpp"
@@ -244,6 +245,7 @@ ObjectFactory::init_factories()
   add_factory<Explosion>("explosion");
   add_factory<Firefly>("firefly");
   add_factory<Gradient>("gradient");
+  add_factory<HeavyCoin>("heavycoin");
   add_factory<HurtingPlatform>("hurting_platform");
   add_factory<IceCrusher>("icecrusher");
   add_factory<InfoBlock>("infoblock");
@@ -262,6 +264,7 @@ ObjectFactory::init_factories()
   add_factory<Spotlight>("spotlight");
   add_factory<Thunderstorm>("thunderstorm");
   add_factory<TileMap>("tilemap");
+  add_factory<Torch>("torch");
   add_factory<Trampoline>("trampoline");
   add_factory<RustyTrampoline>("rustytrampoline");
   add_factory<UnstableTile>("unstable_tile");
@@ -277,12 +280,12 @@ ObjectFactory::init_factories()
   add_factory<Switch>("switch");
 }
 
-GameObject*
+GameObjectPtr
 ObjectFactory::create(const std::string& name, const Reader& reader)
 {
   Factories::iterator i = factories.find(name);
 
-  if (i == factories.end()) 
+  if (i == factories.end())
   {
     std::stringstream msg;
     msg << "No factory for object '" << name << "' found.";
@@ -294,7 +297,7 @@ ObjectFactory::create(const std::string& name, const Reader& reader)
   }
 }
 
-GameObject*
+GameObjectPtr
 ObjectFactory::create(const std::string& name, const Vector& pos, const Direction dir)
 {
   std::stringstream lisptext;
@@ -305,9 +308,8 @@ ObjectFactory::create(const std::string& name, const Vector& pos, const Directio
 
   lisp::Parser parser;
   const lisp::Lisp* lisp = parser.parse(lisptext, "create_object");
-  
-  GameObject* object = create(name, *(lisp->get_car()));
-  return object;
+
+  return create(name, *(lisp->get_car()));
 }
 
 /* EOF */