pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r3776 - in trunk/pingus: . src/worldmap


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3776 - in trunk/pingus: . src/worldmap
Date: Fri, 11 Jul 2008 10:47:14 +0200

Author: grumbel
Date: 2008-07-11 10:47:14 +0200 (Fri, 11 Jul 2008)
New Revision: 3776

Added:
   trunk/pingus/src/worldmap/sprite_drawable.cpp
   trunk/pingus/src/worldmap/sprite_drawable.hpp
Removed:
   trunk/pingus/src/worldmap/surface_drawable.cpp
   trunk/pingus/src/worldmap/surface_drawable.hpp
Modified:
   trunk/pingus/SConstruct
   trunk/pingus/src/worldmap/drawable_factory.cpp
Log:
Renamed SurfaceDrawable to SpriteDrawable

Modified: trunk/pingus/SConstruct
===================================================================
--- trunk/pingus/SConstruct     2008-07-11 08:43:28 UTC (rev 3775)
+++ trunk/pingus/SConstruct     2008-07-11 08:47:14 UTC (rev 3776)
@@ -216,7 +216,7 @@
 'src/worldmap/path_graph.cpp', 
 'src/worldmap/pingus.cpp', 
 'src/worldmap/pingus_worldmap.cpp', 
-'src/worldmap/surface_drawable.cpp', 
+'src/worldmap/sprite_drawable.cpp', 
 'src/worldmap/worldmap.cpp', 
 'src/worldmap/worldmap_story.cpp', 
 'src/worldmap/worldmap_component.cpp', 

Modified: trunk/pingus/src/worldmap/drawable_factory.cpp
===================================================================
--- trunk/pingus/src/worldmap/drawable_factory.cpp      2008-07-11 08:43:28 UTC 
(rev 3775)
+++ trunk/pingus/src/worldmap/drawable_factory.cpp      2008-07-11 08:47:14 UTC 
(rev 3776)
@@ -15,8 +15,8 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <iostream>
-#include "surface_drawable.hpp"
 #include "sprite_drawable.hpp"
+#include "sprite_drawable.hpp"
 #include "drawable_factory.hpp"
 
 namespace WorldmapNS {

Copied: trunk/pingus/src/worldmap/sprite_drawable.cpp (from rev 3774, 
trunk/pingus/src/worldmap/surface_drawable.cpp)
===================================================================
--- trunk/pingus/src/worldmap/surface_drawable.cpp      2008-07-10 18:34:38 UTC 
(rev 3774)
+++ trunk/pingus/src/worldmap/sprite_drawable.cpp       2008-07-11 08:47:14 UTC 
(rev 3776)
@@ -0,0 +1,77 @@
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  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
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  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, see <http://www.gnu.org/licenses/>.
+
+#include <iostream>
+
+#include "../resource.hpp"
+#include "../display/drawing_context.hpp"
+#include "worldmap_screen.hpp"
+#include "worldmap.hpp"
+#include "pingus.hpp"
+#include "sprite_drawable.hpp"
+
+namespace WorldmapNS {
+
+SpriteDrawable::SpriteDrawable(FileReader reader)
+  : Drawable(reader)
+{
+  auto_uncover = false;
+  ResDescriptor desc;
+
+  reader.read_desc  ("surface", desc);
+  reader.read_vector("position", pos);
+  reader.read_bool  ("auto-uncover", auto_uncover);
+
+  surface = Sprite(desc);
+  //std::cout << "XXX Desc: " << desc.res_name << std::endl;
+}
+
+void
+SpriteDrawable::update(float delta)
+{
+  UNUSED_ARG(delta);
+}
+
+void
+SpriteDrawable::draw(DrawingContext& gc)
+{
+  if (surface)
+    {
+      if (auto_uncover)
+        {
+          Vector3f pingus_pos = Worldmap::current()->get_pingus()->get_pos();
+          // Pingu is not over the surface
+          if (!(pingus_pos.x > pos.x && pingus_pos.x < pos.x + 
surface.get_width()
+                &&
+                pingus_pos.y > pos.y && pingus_pos.y < pos.y + 
surface.get_height()))
+            {
+              gc.draw(surface, pos);
+            }
+          else if (pingus_pos.z > pos.z + 1000)
+            { // FIXME: Hack for the 0.6.0 release/tutorial world remove later
+              gc.draw(surface, pos);
+            }
+        }
+      else
+        {
+          gc.draw(surface, pos);
+        }
+    }
+}
+
+} // namespace WorldmapNS
+
+/* EOF */

Copied: trunk/pingus/src/worldmap/sprite_drawable.hpp (from rev 3774, 
trunk/pingus/src/worldmap/surface_drawable.hpp)
===================================================================
--- trunk/pingus/src/worldmap/surface_drawable.hpp      2008-07-10 18:34:38 UTC 
(rev 3774)
+++ trunk/pingus/src/worldmap/sprite_drawable.hpp       2008-07-11 08:47:14 UTC 
(rev 3776)
@@ -0,0 +1,50 @@
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  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
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  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, see <http://www.gnu.org/licenses/>.
+
+#ifndef HEADER_SURFACE_DRAWABLE_HPP
+#define HEADER_SURFACE_DRAWABLE_HPP
+
+#include "../sprite.hpp"
+#include "../math/vector3f.hpp"
+#include "drawable.hpp"
+
+namespace WorldmapNS {
+
+class SpriteDrawable : public Drawable
+{
+private:
+  Sprite surface;
+  Vector3f  pos;
+  /** If set to true the surface will disappear if the pingu gets
+      covered by it, so that the Pingu can travel into caves and other
+      things, while the roof will disapear */
+  bool       auto_uncover;
+public:
+  SpriteDrawable(FileReader reader);
+
+  void update(float delta);
+  void draw(DrawingContext&);
+
+private:
+  SpriteDrawable (const SpriteDrawable&);
+  SpriteDrawable& operator= (const SpriteDrawable&);
+};
+
+} // namespace WorldmapNS
+
+#endif
+
+/* EOF */

Deleted: trunk/pingus/src/worldmap/surface_drawable.cpp
===================================================================
--- trunk/pingus/src/worldmap/surface_drawable.cpp      2008-07-11 08:43:28 UTC 
(rev 3775)
+++ trunk/pingus/src/worldmap/surface_drawable.cpp      2008-07-11 08:47:14 UTC 
(rev 3776)
@@ -1,77 +0,0 @@
-//  Pingus - A free Lemmings clone
-//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
-//
-//  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
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  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, see <http://www.gnu.org/licenses/>.
-
-#include <iostream>
-
-#include "../resource.hpp"
-#include "../display/drawing_context.hpp"
-#include "worldmap_screen.hpp"
-#include "worldmap.hpp"
-#include "pingus.hpp"
-#include "surface_drawable.hpp"
-
-namespace WorldmapNS {
-
-SurfaceDrawable::SurfaceDrawable(FileReader reader)
-  : Drawable(reader)
-{
-  auto_uncover = false;
-  ResDescriptor desc;
-
-  reader.read_desc  ("surface", desc);
-  reader.read_vector("position", pos);
-  reader.read_bool  ("auto-uncover", auto_uncover);
-
-  surface = Sprite(desc);
-  //std::cout << "XXX Desc: " << desc.res_name << std::endl;
-}
-
-void
-SurfaceDrawable::update(float delta)
-{
-  UNUSED_ARG(delta);
-}
-
-void
-SurfaceDrawable::draw(DrawingContext& gc)
-{
-  if (surface)
-    {
-      if (auto_uncover)
-        {
-          Vector3f pingus_pos = Worldmap::current()->get_pingus()->get_pos();
-          // Pingu is not over the surface
-          if (!(pingus_pos.x > pos.x && pingus_pos.x < pos.x + 
surface.get_width()
-                &&
-                pingus_pos.y > pos.y && pingus_pos.y < pos.y + 
surface.get_height()))
-            {
-              gc.draw(surface, pos);
-            }
-          else if (pingus_pos.z > pos.z + 1000)
-            { // FIXME: Hack for the 0.6.0 release/tutorial world remove later
-              gc.draw(surface, pos);
-            }
-        }
-      else
-        {
-          gc.draw(surface, pos);
-        }
-    }
-}
-
-} // namespace WorldmapNS
-
-/* EOF */

Deleted: trunk/pingus/src/worldmap/surface_drawable.hpp
===================================================================
--- trunk/pingus/src/worldmap/surface_drawable.hpp      2008-07-11 08:43:28 UTC 
(rev 3775)
+++ trunk/pingus/src/worldmap/surface_drawable.hpp      2008-07-11 08:47:14 UTC 
(rev 3776)
@@ -1,51 +0,0 @@
-//  Pingus - A free Lemmings clone
-//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
-//
-//  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
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  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, see <http://www.gnu.org/licenses/>.
-
-#ifndef HEADER_SURFACE_DRAWABLE_HPP
-#define HEADER_SURFACE_DRAWABLE_HPP
-
-#include "../sprite.hpp"
-#include "../math/vector3f.hpp"
-#include "drawable.hpp"
-
-namespace WorldmapNS {
-
-/** */
-class SurfaceDrawable : public Drawable
-{
-private:
-  Sprite surface;
-  Vector3f  pos;
-  /** If set to true the surface will disappear if the pingu gets
-      covered by it, so that the Pingu can travel into caves and other
-      things, while the roof will disapear */
-  bool       auto_uncover;
-public:
-  SurfaceDrawable(FileReader reader);
-
-  void update(float delta);
-  void draw(DrawingContext&);
-
-private:
-  SurfaceDrawable (const SurfaceDrawable&);
-  SurfaceDrawable& operator= (const SurfaceDrawable&);
-};
-
-} // namespace WorldmapNS
-
-#endif
-
-/* EOF */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]