pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] rev 2341 - in trunk: data/data src src/actions src/worldobj


From: Ingo Ruhnke
Subject: [Pingus-CVS] rev 2341 - in trunk: data/data src src/actions src/worldobjs
Date: Thu, 24 Jun 2004 14:23:48 +0200

Author: grumbel
Date: 2004-06-24 14:23:48 +0200 (Thu, 24 Jun 2004)
New Revision: 2341

Modified:
   trunk/data/data/pingus.xml
   trunk/src/actions/basher.cxx
   trunk/src/actions/basher.hxx
   trunk/src/actions/blocker.cxx
   trunk/src/actions/bomber.cxx
   trunk/src/actions/digger.cxx
   trunk/src/actions/digger.hxx
   trunk/src/actions/exiter.cxx
   trunk/src/actions/floater.cxx
   trunk/src/actions/floater.hxx
   trunk/src/actions/laser_kill.cxx
   trunk/src/actions/laser_kill.hxx
   trunk/src/actions/rocket_launcher.cxx
   trunk/src/actions/rocket_launcher.hxx
   trunk/src/actions/slider.cxx
   trunk/src/actions/slider.hxx
   trunk/src/actions/smashed.cxx
   trunk/src/actions/smashed.hxx
   trunk/src/actions/splashed.cxx
   trunk/src/actions/splashed.hxx
   trunk/src/actions/superman.cxx
   trunk/src/actions/superman.hxx
   trunk/src/actions/teleported.cxx
   trunk/src/actions/teleported.hxx
   trunk/src/actions/waiter.cxx
   trunk/src/actions/waiter.hxx
   trunk/src/actions/walker.cxx
   trunk/src/actions/walker.hxx
   trunk/src/state_sprite.cxx
   trunk/src/state_sprite.hxx
   trunk/src/worldobjs/hotspot.hxx
Log:
- some resource fixes

Modified: trunk/data/data/pingus.xml
===================================================================
--- trunk/data/data/pingus.xml  2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/data/data/pingus.xml  2004-06-24 12:23:48 UTC (rev 2341)
@@ -18,12 +18,16 @@
 
     <section name="rocketlauncher">
       <sprite name="left">
+        <animation speed="50" loop="no" />
+        <translation origin="bottom_center" x="0" y="2"/>
         <image file="../images/pingus/rocketlauncher.png">
           <grid pos="0,0" size="32,32" array="7,1"/>
         </image>
       </sprite>
 
       <sprite name="right">
+        <animation speed="50" loop="no" />
+        <translation origin="bottom_center" x="0" y="2"/>
         <image file="../images/pingus/rocketlauncher.png">
           <grid pos="0,32" size="32,32" array="7,1"/>
         </image>
@@ -311,6 +315,8 @@
     </sprite>
 
     <sprite name="splat">
+      <translation origin="bottom_center" x="0" y="2"/>
+      <animation speed="33" loop="no" />
       <image file="../images/pingus/splat.png">
         <grid pos="0,0" size="32,32" array="16,1"/>
       </image>
@@ -426,11 +432,22 @@
       <image file="../images/pingus/explo0.png">
       </image>
     </sprite>
-    <sprite name="laser_kill">
-      <image file="../images/pingus/laser_kill.png">
-        <grid pos="0,0" size="33,32" array="9,2"/>
-      </image>
-    </sprite>
+    <section name="laser_kill">
+      <sprite name="left">
+        <animation speed="60" loop="no" />
+        <translation origin="bottom_center" x="0" y="2"/>
+        <image file="../images/pingus/laser_kill.png">
+          <grid pos="0,0" size="33,32" array="9,1"/>
+        </image>
+      </sprite>
+      <sprite name="right">
+        <animation speed="60" loop="no" />
+        <translation origin="bottom_center" x="0" y="2"/>
+        <image file="../images/pingus/laser_kill.png">
+          <grid pos="0,32" size="33,32" array="9,1"/>
+        </image>
+      </sprite>
+    </section>
   </section>
   <section name="XMas">
     <sprite name="walker">

Modified: trunk/src/actions/basher.cxx
===================================================================
--- trunk/src/actions/basher.cxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/basher.cxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -37,8 +37,8 @@
     basher_c(0),
     first_bash(true)
 {
-  sprite.load(Direction::LEFT,  Resource::load_sprite("pingus/basher"));
-  sprite.load(Direction::RIGHT, Resource::load_sprite("pingus/basher"));
+  sprite.load(Direction::LEFT,  Resource::load_sprite("pingus/basher/left"));
+  sprite.load(Direction::RIGHT, Resource::load_sprite("pingus/basher/right"));
 
   bash_radius_width     = bash_radius.get_width();
   bash_radius_gfx_width = bash_radius_gfx.get_width();

Modified: trunk/src/actions/basher.hxx
===================================================================
--- trunk/src/actions/basher.hxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/basher.hxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -20,6 +20,7 @@
 #ifndef HEADER_PINGUS_ACTIONS_BASHER_HXX
 #define HEADER_PINGUS_ACTIONS_BASHER_HXX
 
+#include <ClanLib/Display/pixel_buffer.h>
 #include "../state_sprite.hxx"
 #include "../pingu_action.hxx"
 

Modified: trunk/src/actions/blocker.cxx
===================================================================
--- trunk/src/actions/blocker.cxx       2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/blocker.cxx       2004-06-24 12:23:48 UTC (rev 2341)
@@ -22,7 +22,6 @@
 #include "../col_map.hxx"
 #include "../gui/graphic_context.hxx"
 #include "../pingu.hxx"
-#include "../resource.hxx"
 #include "../string_converter.hxx"
 #include "../pingu_holder.hxx"
 #include "../world.hxx"
@@ -34,8 +33,8 @@
 Blocker::Blocker(Pingu* p)
   : PinguAction(p)
 {
-  sprite.load(Direction::LEFT,  Resource::load_sprite("pingus/blocker/left"));
-  sprite.load(Direction::RIGHT, Resource::load_sprite("pingus/blocker/right"));
+  sprite.load(Direction::LEFT,  "pingus/blocker/left");
+  sprite.load(Direction::RIGHT, "pingus/blocker/right");
 
   if (   rel_getpixel(0,-1)  ==  Groundtype::GP_NOTHING
       && rel_getpixel(0, -2) ==  Groundtype::GP_GROUND)

Modified: trunk/src/actions/bomber.cxx
===================================================================
--- trunk/src/actions/bomber.cxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/bomber.cxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -25,9 +25,9 @@
 #include "../pingu.hxx"
 #include "../pingu_enums.hxx"
 #include "../pingu_map.hxx"
-#include "../resource.hxx"
 #include "../string_converter.hxx"
 #include "../world.hxx"
+#include "../resource.hxx"
 #include "../particles/pingu_particle_holder.hxx"
 #include "../colliders/pingu_collider.hxx"
 #include "../movers/linear_mover.hxx"
@@ -48,8 +48,8 @@
     colmap_exploded(false),
     explo_surf(Resource::load_sprite("other/explo"))
 {
-  sprite.load(Direction::LEFT,  Resource::load_sprite("pingus/bomber/left"));
-  sprite.load(Direction::RIGHT, Resource::load_sprite("pingus/bomber/right"));
+  sprite.load(Direction::LEFT,  "pingus/bomber/left");
+  sprite.load(Direction::RIGHT, "pingus/bomber/right");
 
   // Only load the surface again if no static_surface is available
   if (!static_surface_loaded)

Modified: trunk/src/actions/digger.cxx
===================================================================
--- trunk/src/actions/digger.cxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/digger.cxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -35,16 +35,15 @@
   : PinguAction(p),
     digger_radius(Resource::load_pixelbuffer("other/digger_radius")),
     digger_radius_gfx(Resource::load_pixelbuffer("other/digger_radius")),
-    sprite("pingus/digger"),
     digger_c(0)
 {
-  sprite.set_align_center_bottom();
-
   digger_radius_width  = digger_radius.get_width();
   digger_radius_height = digger_radius.get_height();
 
   digger_radius_gfx_width  = digger_radius_gfx.get_width();
   digger_radius_gfx_height = digger_radius_gfx.get_height();
+
+  sprite = Resource::load_sprite("pingus/digger/left");
 }
 
 void

Modified: trunk/src/actions/digger.hxx
===================================================================
--- trunk/src/actions/digger.hxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/digger.hxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -21,7 +21,6 @@
 #define HEADER_PINGUS_ACTIONS_DIGGER_HXX
 
 #include "../pingu_action.hxx"
-#include "../sprite.hxx"
 
 namespace Pingus {
 namespace Actions {
@@ -31,7 +30,7 @@
 private:
   CL_PixelBuffer digger_radius;
   CL_PixelBuffer digger_radius_gfx;
-  Sprite sprite;
+  CL_Sprite sprite;
   int digger_c;
 
   /** Width of the digger_radius surface */

Modified: trunk/src/actions/exiter.cxx
===================================================================
--- trunk/src/actions/exiter.cxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/exiter.cxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -31,8 +31,8 @@
   : PinguAction(p),
     sound_played(false)
 {
-  sprite.load(Direction::LEFT,  Resource::load_sprite("pingus/exit"));
-  sprite.load(Direction::RIGHT, Resource::load_sprite("pingus/exit"));
+  sprite.load(Direction::LEFT,  Resource::load_sprite("pingus/exit/left"));
+  sprite.load(Direction::RIGHT, Resource::load_sprite("pingus/exit/right"));
 }
 
 void

Modified: trunk/src/actions/floater.cxx
===================================================================
--- trunk/src/actions/floater.cxx       2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/floater.cxx       2004-06-24 12:23:48 UTC (rev 2341)
@@ -17,6 +17,7 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "../resource.hxx"
 #include "../pingu.hxx"
 #include "../gui/graphic_context.hxx"
 #include "../groundtype.hxx"
@@ -28,10 +29,9 @@
 Floater::Floater(Pingu* p)
   : PinguAction(p),
     falling_depth(0),
-    step(0),
-    sprite(Sprite ("pingus/floater0"))
+    step(0)
 {
-  sprite.set_align_center_bottom();
+  sprite = Resource::load_sprite("pingus/floater/left");
 }
 
 void
@@ -59,7 +59,7 @@
 void
 Floater::draw (GraphicContext& gc)
 {
-  gc.draw (sprite, pingu->get_pos());
+  gc.draw(sprite, pingu->get_pos());
 }
 
 bool

Modified: trunk/src/actions/floater.hxx
===================================================================
--- trunk/src/actions/floater.hxx       2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/floater.hxx       2004-06-24 12:23:48 UTC (rev 2341)
@@ -20,7 +20,6 @@
 #ifndef HEADER_PINGUS_ACTIONS_FLOATER_HXX
 #define HEADER_PINGUS_ACTIONS_FLOATER_HXX
 
-#include "../sprite.hxx"
 #include "../pingu_action.hxx"
 
 namespace Pingus {
@@ -31,7 +30,7 @@
 private:
   int falling_depth;
   int step;
-  Sprite sprite;
+  CL_Sprite sprite;
 public:
   Floater(Pingu* p);
 

Modified: trunk/src/actions/laser_kill.cxx
===================================================================
--- trunk/src/actions/laser_kill.cxx    2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/laser_kill.cxx    2004-06-24 12:23:48 UTC (rev 2341)
@@ -18,6 +18,7 @@
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "../vector.hxx"
+#include "../resource.hxx"
 #include "../gui/graphic_context.hxx"
 #include "../pingu.hxx"
 #include "laser_kill.hxx"
@@ -26,30 +27,25 @@
 namespace Actions {
 
 LaserKill::LaserKill(Pingu* p)
-  : PinguAction(p),
-    sprite(Sprite ("other/laser_kill", "", 20.0f, Sprite::NONE, Sprite::ONCE))
+  : PinguAction(p)
 {
-  sprite.set_align_center_bottom();
+  sprite.load(Direction::LEFT,  
Resource::load_sprite("other/laser_kill/left"));
+  sprite.load(Direction::RIGHT, 
Resource::load_sprite("other/laser_kill/right"));
 }
 
 void
 LaserKill::draw (GraphicContext& gc)
 {
-  if (pingu->direction.is_left())
-    sprite.set_direction(Sprite::LEFT);
-  else
-    sprite.set_direction(Sprite::RIGHT);
-
-  gc.draw(sprite, pingu->get_pos () + Vector (0, 2));
+  gc.draw(sprite[pingu->direction], pingu->get_pos () + Vector (0, 2));
 }
 
 void
 LaserKill::update ()
 {
-  if (sprite.finished())
+  if (sprite[pingu->direction].is_finished())
     pingu->set_status(PS_DEAD);
   else
-    sprite.update();
+    sprite[pingu->direction].update();
 }
 
 } // namespace Actions

Modified: trunk/src/actions/laser_kill.hxx
===================================================================
--- trunk/src/actions/laser_kill.hxx    2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/laser_kill.hxx    2004-06-24 12:23:48 UTC (rev 2341)
@@ -20,7 +20,7 @@
 #ifndef HEADER_PINGUS_ACTIONS_LASER_KILL_HXX
 #define HEADER_PINGUS_ACTIONS_LASER_KILL_HXX
 
-#include "../sprite.hxx"
+#include "../state_sprite.hxx"
 #include "../pingu_action.hxx"
 
 namespace Pingus {
@@ -31,7 +31,7 @@
 class LaserKill : public PinguAction
 {
 private:
-  Sprite sprite;
+  StateSprite sprite;
 
 public:
   LaserKill (Pingu*);

Modified: trunk/src/actions/rocket_launcher.cxx
===================================================================
--- trunk/src/actions/rocket_launcher.cxx       2004-06-23 23:15:46 UTC (rev 
2340)
+++ trunk/src/actions/rocket_launcher.cxx       2004-06-24 12:23:48 UTC (rev 
2341)
@@ -32,10 +32,11 @@
 
 RocketLauncher::RocketLauncher (Pingu* p)
   : PinguAction(p),
-    sprite("pingus/rocketlauncher", "", 10.0f, Sprite::NONE, Sprite::ONCE),
     launched(false)
 {
-  sprite.set_align_center_bottom();
+  sprite.load(Direction::LEFT,  "pingus/rocketlauncher/left");
+  sprite.load(Direction::RIGHT, "pingus/rocketlauncher/right");
+
 /* Explosive Particles not supported right now
   WorldObj::get_world()->get_particle_holder()->add_particle
     (new ExplosiveParticle (static_cast<int>(pingu->get_x()),
@@ -48,7 +49,7 @@
 void
 RocketLauncher::update ()
 {
-  if (sprite.finished())
+  if (sprite[pingu->direction].is_finished())
     {
       pingu->set_action(Actions::Walker);
     }
@@ -59,12 +60,7 @@
 void
 RocketLauncher::draw (GraphicContext& gc)
 {
-  if (pingu->direction.is_left())
-    sprite.set_direction(Sprite::LEFT);
-  else
-    sprite.set_direction(Sprite::RIGHT);
-
-  gc.draw (sprite, pingu->get_pos());
+  gc.draw(sprite[pingu->direction], pingu->get_pos());
 }
 
 } // namespace Actions

Modified: trunk/src/actions/rocket_launcher.hxx
===================================================================
--- trunk/src/actions/rocket_launcher.hxx       2004-06-23 23:15:46 UTC (rev 
2340)
+++ trunk/src/actions/rocket_launcher.hxx       2004-06-24 12:23:48 UTC (rev 
2341)
@@ -20,7 +20,7 @@
 #ifndef HEADER_PINGUS_ACTIONS_ROCKET_LAUNCHER_HXX
 #define HEADER_PINGUS_ACTIONS_ROCKET_LAUNCHER_HXX
 
-#include "../sprite.hxx"
+#include "../state_sprite.hxx"
 #include "../pingu_action.hxx"
 
 namespace Pingus {
@@ -29,7 +29,7 @@
 class RocketLauncher : public PinguAction
 {
 private:
-  Sprite sprite;
+  StateSprite sprite;
   bool launched;
 public:
   RocketLauncher(Pingu*);

Modified: trunk/src/actions/slider.cxx
===================================================================
--- trunk/src/actions/slider.cxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/slider.cxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -17,6 +17,7 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "../resource.hxx"
 #include "../col_map.hxx"
 #include "../gui/graphic_context.hxx"
 #include "../string_converter.hxx"
@@ -28,22 +29,17 @@
 
 Slider::Slider (Pingu* p)
   : PinguAction(p),
-    sprite("pingus/slider"),
     speed(10)
 {
-  sprite.set_align_center_bottom();
+  sprite.load(Direction::LEFT,  "pingus/slider/left");
+  sprite.load(Direction::RIGHT, "pingus/slider/right");
 }
 
 void
 Slider::update ()
 {
-  if (pingu->direction.is_left())
-    sprite.set_direction(Sprite::LEFT);
-  else
-    sprite.set_direction(Sprite::RIGHT);
+  sprite[pingu->direction].update();
 
-  sprite.update();
-
   for (int i = 0; i < speed && rel_getpixel(1, 0) == Groundtype::GP_NOTHING; 
++i)
     {
       pingu->set_x(pingu->get_x() + pingu->direction);
@@ -77,7 +73,7 @@
 void
 Slider::draw (GraphicContext& gc)
 {
-  gc.draw(sprite, pingu->get_pos() + Vector(0, -2));
+  gc.draw(sprite[pingu->direction], pingu->get_pos() + Vector(0, -2));
 }
 
 } // namespace Actions

Modified: trunk/src/actions/slider.hxx
===================================================================
--- trunk/src/actions/slider.hxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/slider.hxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -20,7 +20,7 @@
 #ifndef HEADER_PINGUS_ACTIONS_SLIDER_HXX
 #define HEADER_PINGUS_ACTIONS_SLIDER_HXX
 
-#include "../sprite.hxx"
+#include "../state_sprite.hxx"
 #include "../pingu_action.hxx"
 
 namespace Pingus {
@@ -29,7 +29,7 @@
 class Slider : public PinguAction
 {
 private:
-  Sprite sprite;
+  StateSprite sprite;
   float  speed;
 public:
   Slider (Pingu* p);

Modified: trunk/src/actions/smashed.cxx
===================================================================
--- trunk/src/actions/smashed.cxx       2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/smashed.cxx       2004-06-24 12:23:48 UTC (rev 2341)
@@ -17,6 +17,7 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "../resource.hxx"
 #include "../vector.hxx"
 #include "../gui/graphic_context.hxx"
 #include "../pingu.hxx"
@@ -27,16 +28,15 @@
 
 Smashed::Smashed (Pingu* p)
   : PinguAction(p),
-    sound_played(false),
-    sprite("pingus/bomber")
+    sound_played(false)
 {
-  sprite.set_align_center_bottom();
+  sprite = Resource::load_sprite("pingus/bomber");
 }
 
 void
 Smashed::draw (GraphicContext& gc)
 {
-  gc.draw (sprite, pingu->get_pos ());
+  gc.draw(sprite, pingu->get_pos ());
 }
 
 void
@@ -44,7 +44,7 @@
 {
   sprite.update();
   //  pingu->particle->add_pingu_explo(pingu->x_pos, pingu->y_pos - 16);
-  if (sprite.finished())
+  if (sprite.is_finished())
     pingu->set_status(PS_DEAD);
 }
 

Modified: trunk/src/actions/smashed.hxx
===================================================================
--- trunk/src/actions/smashed.hxx       2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/smashed.hxx       2004-06-24 12:23:48 UTC (rev 2341)
@@ -20,7 +20,7 @@
 #ifndef HEADER_PINGUS_ACTIONS_SMASHED_HXX
 #define HEADER_PINGUS_ACTIONS_SMASHED_HXX
 
-#include "../sprite.hxx"
+#include <ClanLib/Display/sprite.h>
 #include "../pingu_action.hxx"
 
 namespace Pingus {
@@ -32,8 +32,8 @@
 {
 private:
   bool sound_played;
-  Sprite sprite;
-
+  CL_Sprite sprite;
+  
 public:
   Smashed (Pingu*);
 

Modified: trunk/src/actions/splashed.cxx
===================================================================
--- trunk/src/actions/splashed.cxx      2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/splashed.cxx      2004-06-24 12:23:48 UTC (rev 2341)
@@ -17,6 +17,7 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "../resource.hxx"
 #include "../vector.hxx"
 #include "../gui/graphic_context.hxx"
 #include "../world.hxx"
@@ -30,16 +31,15 @@
 Splashed::Splashed (Pingu* p)
   : PinguAction(p),
     particle_thrown(false),
-    sound_played(false),
-    sprite("pingus/splat", "", 30.0f, Sprite::NONE, Sprite::ONCE)
+    sound_played(false)
 {
-  sprite.set_align_center_bottom();
+  sprite = Resource::load_sprite("pingus/splat");
 }
 
 void
 Splashed::update ()
 {
-  sprite.update ();
+  sprite.update();
 
   if (!particle_thrown)
     {
@@ -47,7 +47,7 @@
       WorldObj::get_world()->play_sound("splash", pingu->get_pos());
     }
 
-  if (sprite.finished())
+  if (sprite.is_finished())
     {
       pingu->set_status(PS_DEAD);
     }
@@ -56,7 +56,7 @@
 void
 Splashed::draw (GraphicContext& gc)
 {
-  gc.draw (sprite, pingu->get_pos ());
+  gc.draw(sprite, pingu->get_pos ());
 }
 
 } // namespace Actions

Modified: trunk/src/actions/splashed.hxx
===================================================================
--- trunk/src/actions/splashed.hxx      2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/splashed.hxx      2004-06-24 12:23:48 UTC (rev 2341)
@@ -20,7 +20,6 @@
 #ifndef HEADER_PINGUS_ACTIONS_SPLASHED_HXX
 #define HEADER_PINGUS_ACTIONS_SPLASHED_HXX
 
-#include "../sprite.hxx"
 #include "../pingu_action.hxx"
 
 namespace Pingus {
@@ -31,7 +30,7 @@
 private:
   bool particle_thrown;
   bool sound_played;
-  Sprite sprite;
+  CL_Sprite sprite;
 public:
   Splashed (Pingu*);
 

Modified: trunk/src/actions/superman.cxx
===================================================================
--- trunk/src/actions/superman.cxx      2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/superman.cxx      2004-06-24 12:23:48 UTC (rev 2341)
@@ -30,9 +30,8 @@
   : PinguAction(p),
     counter(0.0f),
     x_pos(pingu->get_x()),
-    sprite("pingus/superman")
+    sprite(Resource::load_sprite("pingus/superman"))
 {
-  sprite.set_align_center_bottom();
 }
 
 void

Modified: trunk/src/actions/superman.hxx
===================================================================
--- trunk/src/actions/superman.hxx      2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/superman.hxx      2004-06-24 12:23:48 UTC (rev 2341)
@@ -20,7 +20,6 @@
 #ifndef HEADER_PINGUS_ACTIONS_SUPERMAN_HXX
 #define HEADER_PINGUS_ACTIONS_SUPERMAN_HXX
 
-#include "../sprite.hxx"
 #include "../pingu_action.hxx"
 
 namespace Pingus {
@@ -31,7 +30,7 @@
 private:
   double counter;
   double x_pos;
-  Sprite sprite;
+  CL_Sprite sprite;
 
 public:
   Superman (Pingu*);

Modified: trunk/src/actions/teleported.cxx
===================================================================
--- trunk/src/actions/teleported.cxx    2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/teleported.cxx    2004-06-24 12:23:48 UTC (rev 2341)
@@ -17,6 +17,7 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "../resource.hxx"
 #include "../gui/graphic_context.hxx"
 #include "../pingu.hxx"
 #include "teleported.hxx"
@@ -26,9 +27,9 @@
 
 Teleported::Teleported(Pingu* p)
   : PinguAction(p),
-    sound_played(false),
-    sprite("pingus/bomber")
+    sound_played(false)
 {
+  sprite = Resource::load_sprite("pingus/bomber");
 }
 
 

Modified: trunk/src/actions/teleported.hxx
===================================================================
--- trunk/src/actions/teleported.hxx    2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/teleported.hxx    2004-06-24 12:23:48 UTC (rev 2341)
@@ -18,7 +18,7 @@
 #ifndef HEADER_PINGUS_ACTIONS_TELEPORTED_HXX
 #define HEADER_PINGUS_ACTIONS_TELEPORTED_HXX
 
-#include "../sprite.hxx"
+#include <ClanLib/Display/sprite.h>
 #include "../pingu_action.hxx"
 
 namespace Pingus {
@@ -29,7 +29,7 @@
 private:
   //bool particle_thrown;
   bool sound_played;
-  Sprite sprite;
+  CL_Sprite sprite;
 public:
   Teleported (Pingu*);
 

Modified: trunk/src/actions/waiter.cxx
===================================================================
--- trunk/src/actions/waiter.cxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/waiter.cxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -28,10 +28,9 @@
 
 Waiter::Waiter (Pingu* p)
   : PinguAction(p),
-    countdown(2.0f),
-    sprite("pingus/waiter", "", 5.0f)
+    countdown(2.0f)
 {
-  sprite.set_align_center_bottom();
+  sprite = Resource::load_sprite("pingus/waiter");
 }
 
 void

Modified: trunk/src/actions/waiter.hxx
===================================================================
--- trunk/src/actions/waiter.hxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/waiter.hxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -20,7 +20,6 @@
 #ifndef HEADER_PINGUS_ACTIONS_WAITER_HXX
 #define HEADER_PINGUS_ACTIONS_WAITER_HXX
 
-#include "../sprite.hxx"
 #include "../pingu_action.hxx"
 
 namespace Pingus {
@@ -33,7 +32,7 @@
 {
 private:
   float countdown;
-  Sprite sprite;
+  CL_Sprite sprite;
 
 public:
   Waiter (Pingu*);

Modified: trunk/src/actions/walker.cxx
===================================================================
--- trunk/src/actions/walker.cxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/walker.cxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -22,7 +22,6 @@
 #include "../gui/graphic_context.hxx"
 #include "../string_converter.hxx"
 #include "../pingu.hxx"
-#include "../resource.hxx"
 #include "../debug.hxx"
 #include "walker.hxx"
 
@@ -32,11 +31,11 @@
 Walker::Walker (Pingu* p)
   : PinguAction(p)
 {
-  walker.load(Direction::LEFT,  Resource::load_sprite("pingus/walker/left"));
-  walker.load(Direction::RIGHT, Resource::load_sprite("pingus/walker/right"));
+  walker.load(Direction::LEFT,  "pingus/walker/left");
+  walker.load(Direction::RIGHT, "pingus/walker/right");
 
-  floaterlayer.load(Direction::LEFT,  
Resource::load_sprite("pingus/floaterlayer/left"));
-  floaterlayer.load(Direction::RIGHT, 
Resource::load_sprite("pingus/floaterlayer/right"));
+  floaterlayer.load(Direction::LEFT,  "pingus/floaterlayer/left");
+  floaterlayer.load(Direction::RIGHT, "pingus/floaterlayer/right");
 
   // Reset the velocity
   pingu->set_velocity(Vector());

Modified: trunk/src/actions/walker.hxx
===================================================================
--- trunk/src/actions/walker.hxx        2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/actions/walker.hxx        2004-06-24 12:23:48 UTC (rev 2341)
@@ -22,7 +22,6 @@
 
 #include "../pingu_action.hxx"
 #include "../state_sprite.hxx"
-#include "../sprite.hxx"
 
 namespace Pingus {
 namespace Actions {

Modified: trunk/src/state_sprite.cxx
===================================================================
--- trunk/src/state_sprite.cxx  2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/state_sprite.cxx  2004-06-24 12:23:48 UTC (rev 2341)
@@ -17,6 +17,7 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+#include "resource.hxx"
 #include "pingus_error.hxx"
 #include "state_sprite.hxx"
 
@@ -27,6 +28,12 @@
 }
 
 void
+StateSprite::load(int state, const std::string& name)
+{
+  load(state, Resource::load_sprite(name));
+}
+
+void
 StateSprite::load(int state, CL_Sprite sprite)
 {
   sprites[state] = sprite;

Modified: trunk/src/state_sprite.hxx
===================================================================
--- trunk/src/state_sprite.hxx  2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/state_sprite.hxx  2004-06-24 12:23:48 UTC (rev 2341)
@@ -39,6 +39,7 @@
   void update(float delta);
   void update();
 
+  void load(int state, const std::string& name);
   void load(int state, CL_Sprite);
   CL_Sprite& operator[](int state);
 };

Modified: trunk/src/worldobjs/hotspot.hxx
===================================================================
--- trunk/src/worldobjs/hotspot.hxx     2004-06-23 23:15:46 UTC (rev 2340)
+++ trunk/src/worldobjs/hotspot.hxx     2004-06-24 12:23:48 UTC (rev 2341)
@@ -41,7 +41,7 @@
   Hotspot (const WorldObjsData::HotspotData& data_);
  ~Hotspot ();
 
-  void  draw (GraphicContext& gc);
+  void  draw(GraphicContext& gc);
   void  update();
   float get_z_pos () const;
 





reply via email to

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