Renamed namespaces to all lowercase
[supertux.git] / src / object / scripted_object.cpp
index b3c1158..726a21b 100644 (file)
@@ -1,12 +1,10 @@
-//  $Id$
-//
 //  SuperTux
 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
-//  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 <stdexcept>
-#include <math.h>
+#include "object/scripted_object.hpp"
 
-#include "scripted_object.hpp"
-#include "video/drawing_context.hpp"
-#include "scripting/squirrel_util.hpp"
-#include "resources.hpp"
-#include "object_factory.hpp"
-#include "math/vector.hpp"
+#include <stdio.h>
 
-ScriptedObject::ScriptedObject(const lisp::Lisp& lisp)
-  : MovingSprite(lisp, LAYER_OBJECTS, COLGROUP_MOVING_STATIC),
-    solid(true), physic_enabled(true), visible(true), new_vel_set(false)
+#include "scripting/squirrel_util.hpp"
+#include "sprite/sprite.hpp"
+#include "supertux/object_factory.hpp"
+#include "util/reader.hpp"
+
+ScriptedObject::ScriptedObject(const Reader& lisp) :
+  MovingSprite(lisp, LAYER_OBJECTS, COLGROUP_MOVING_STATIC),
+  physic(),
+  name(),
+  solid(true), 
+  physic_enabled(true), 
+  visible(true), 
+  new_vel_set(false),
+  new_vel()
 {
   lisp.get("name", name);
   if(name == "")
@@ -58,14 +59,14 @@ void
 ScriptedObject::expose(HSQUIRRELVM vm, SQInteger table_idx)
 {
   if (name.empty()) return;
-  expose_object(vm, table_idx, dynamic_cast<Scripting::ScriptedObject *>(this), name, false);
+  expose_object(vm, table_idx, dynamic_cast<scripting::ScriptedObject *>(this), name, false);
 }
 
 void
 ScriptedObject::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
 {
   if (name.empty()) return;
-  Scripting::unexpose_object(vm, table_idx, name);
+  scripting::unexpose_object(vm, table_idx, name);
 }
 
 void
@@ -142,7 +143,6 @@ ScriptedObject::is_solid()
   return solid;
 }
 
-
 void
 ScriptedObject::set_action(const std::string& animation)
 {
@@ -193,7 +193,7 @@ ScriptedObject::collision_solid(const CollisionHit& hit)
     if(physic.get_velocity_y() > 0)
       physic.set_velocity_y(0);
   } else if(hit.top) {
-    physic.set_velocity_y(.1);
+    physic.set_velocity_y(.1f);
   }
 
   if(hit.left || hit.right) {
@@ -208,3 +208,5 @@ ScriptedObject::collision(GameObject& , const CollisionHit& )
 }
 
 IMPLEMENT_FACTORY(ScriptedObject, "scriptedobject");
+
+/* EOF */