Fix cmake download path
[supertux.git] / src / object / spotlight.cpp
index c1037ea..2055b0e 100644 (file)
@@ -1,12 +1,10 @@
-//  $Id$
-//
 //  SuperTux
-//  Copyright (C) 2006 Ingo Ruhnke <grumbel@gmx.de>
+//  Copyright (C) 2006 Ingo Ruhnke <grumbel@gmail.com>
 //
-//  This program is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU General Public License
-//  as published by the Free Software Foundation; either version 2
-//  of the License, or (at your option) any later version.
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
 //
 //  This program is distributed in the hope that it will be useful,
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  GNU General Public License for more details.
 //
 //  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-#include <config.h>
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-#include "spotlight.hpp"
-#include "sprite/sprite_manager.hpp"
-#include "resources.hpp"
-#include "video/drawing_context.hpp"
-#include "object_factory.hpp"
-#include "player.hpp"
-#include "sector.hpp"
+#include "object/spotlight.hpp"
 #include "sprite/sprite.hpp"
-
-Spotlight::Spotlight(const lisp::Lisp& lisp)
-  : angle(0.0f),
-    color(1.0f, 1.0f, 1.0f)
+#include "sprite/sprite_manager.hpp"
+#include "supertux/object_factory.hpp"
+#include "util/reader.hpp"
+
+Spotlight::Spotlight(const Reader& lisp) :
+  position(),
+  angle(0.0f),
+  center(),
+  base(),
+  lights(),
+  light(),
+  lightcone(),
+  color(1.0f, 1.0f, 1.0f)
 {
   lisp.get("x", position.x);
   lisp.get("y", position.y);
@@ -42,22 +40,16 @@ Spotlight::Spotlight(const lisp::Lisp& lisp)
     color = Color( vColor );
   }
 
-  center    = sprite_manager->create("images/objects/spotlight/spotlight_center.sprite");
-  base      = sprite_manager->create("images/objects/spotlight/spotlight_base.sprite");
-  lights    = sprite_manager->create("images/objects/spotlight/spotlight_lights.sprite");
-  lightcone = sprite_manager->create("images/objects/spotlight/lightcone.sprite");
-  light     = sprite_manager->create("images/objects/spotlight/light.sprite");
-
+  center    = SpriteManager::current()->create("images/objects/spotlight/spotlight_center.sprite");
+  base      = SpriteManager::current()->create("images/objects/spotlight/spotlight_base.sprite");
+  lights    = SpriteManager::current()->create("images/objects/spotlight/spotlight_lights.sprite");
+  lightcone = SpriteManager::current()->create("images/objects/spotlight/lightcone.sprite");
+  light     = SpriteManager::current()->create("images/objects/spotlight/light.sprite");
 
 }
 
 Spotlight::~Spotlight()
 {
-  delete center;
-  delete base;
-  delete lights;
-  delete lightcone;
-  delete light;
 }
 
 void
@@ -96,4 +88,4 @@ Spotlight::draw(DrawingContext& context)
   context.pop_target();
 }
 
-IMPLEMENT_FACTORY(Spotlight, "spotlight");
+/* EOF */