pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r2610 - in trunk/src: display editor worldobjs


From: jave27
Subject: [Pingus-CVS] r2610 - in trunk/src: display editor worldobjs
Date: Thu, 19 Jan 2006 02:30:10 +0100

Author: jave27
Date: 2006-01-19 02:29:43 +0100 (Thu, 19 Jan 2006)
New Revision: 2610

Modified:
   trunk/src/display/drawing_context.cxx
   trunk/src/editor/editor_panel.hxx
   trunk/src/worldobjs/fake_exit.cxx
   trunk/src/worldobjs/fake_exit.hxx
   trunk/src/worldobjs/laser_exit.cxx
   trunk/src/worldobjs/laser_exit.hxx
   trunk/src/worldobjs/smasher.cxx
   trunk/src/worldobjs/surface_background.hxx
   trunk/src/worldobjs/woodthing.cxx
   trunk/src/worldobjs/woodthing.hxx
Log:
Removed a bunch of old GameCounter objects and old comments.



Modified: trunk/src/display/drawing_context.cxx
===================================================================
--- trunk/src/display/drawing_context.cxx       2006-01-19 00:57:13 UTC (rev 
2609)
+++ trunk/src/display/drawing_context.cxx       2006-01-19 01:29:43 UTC (rev 
2610)
@@ -255,8 +255,6 @@
 void
 DrawingContext::draw(const CL_Sprite& sprite, const Vector& pos)
 {
-  // FIXME: Z handling isn't working correctly - sprite with negative Z values
-       // FIXME: aren't being displayed.
        draw(sprite, pos.x, pos.y, pos.z);
 }
 

Modified: trunk/src/editor/editor_panel.hxx
===================================================================
--- trunk/src/editor/editor_panel.hxx   2006-01-19 00:57:13 UTC (rev 2609)
+++ trunk/src/editor/editor_panel.hxx   2006-01-19 01:29:43 UTC (rev 2610)
@@ -25,7 +25,6 @@
 #include "../gui/component.hxx"
 #include "../gui/checkbox_listener.hxx"
 #include "../gui/combobox_listener.hxx"
-//#include "../gui/combobox.hxx"
 
 namespace Pingus {
 

Modified: trunk/src/worldobjs/fake_exit.cxx
===================================================================
--- trunk/src/worldobjs/fake_exit.cxx   2006-01-19 00:57:13 UTC (rev 2609)
+++ trunk/src/worldobjs/fake_exit.cxx   2006-01-19 01:29:43 UTC (rev 2610)
@@ -34,12 +34,6 @@
     smashing(false)
 {
   reader.read_vector("position", pos);
-
-  counter.set_size(surface.get_frame_count());
-  counter.set_type(GameCounter::once);
-  counter.set_speed(2.5);
-  counter = surface.get_frame_count() - 1;
-
   pos -= Vector(surface.get_width ()/2, surface.get_height ());
 }
 
@@ -59,43 +53,41 @@
 void
 FakeExit::update ()
 {
-  PinguHolder* holder = world->get_pingus();
-  for (PinguIter pingu = holder->begin (); pingu != holder->end (); ++pingu){
-    catch_pingu(*pingu);
-  }
+       PinguHolder* holder = world->get_pingus();
+       for (PinguIter pingu = holder->begin (); pingu != holder->end (); 
++pingu)
+               catch_pingu(*pingu);
 
-  if (smashing)
-    ++counter;
+       if (smashing)
+               surface.update();
 }
 
 void
 FakeExit::catch_pingu (Pingu* pingu)
 {
-  if (counter.finished()) {
-    smashing = false;
-  }
+       if (surface.is_finished())
+               smashing = false;
 
-  if (   pingu->get_x() > pos.x + 31 && pingu->get_x() < pos.x + 31 + 15
-      && pingu->get_y() > pos.y + 56 && pingu->get_y() < pos.y + 56 + 56)
-    {
-      if (pingu->get_action() != Actions::Splashed)
+       if (   pingu->get_pos().x > pos.x + 31 && pingu->get_pos().x < pos.x + 
31 + 15
+      && pingu->get_pos().y > pos.y + 56 && pingu->get_pos().y < pos.y + 56 + 
56)
        {
-         if (!smashing) {
-           counter = 0;
-           smashing = true;
-         }
-
-         if (counter >= 3 && counter <= 5) {
-           pingu->set_action(Actions::Splashed);
-         }
+               if (pingu->get_action() != Actions::Splashed)
+               {
+                       if (!smashing) 
+                       {
+                       surface.restart();
+                       smashing = true;
+                       }
+       
+                       if (surface.get_current_frame() == 4)
+                               pingu->set_action(Actions::Splashed);
+               }
        }
-    }
 }
 
 void
 FakeExit::draw_smallmap(SmallMap* smallmap)
 {
-  smallmap->draw_sprite(smallmap_symbol, pos);
+       smallmap->draw_sprite(smallmap_symbol, pos);
 }
 
 } // namespace WorldObjs

Modified: trunk/src/worldobjs/fake_exit.hxx
===================================================================
--- trunk/src/worldobjs/fake_exit.hxx   2006-01-19 00:57:13 UTC (rev 2609)
+++ trunk/src/worldobjs/fake_exit.hxx   2006-01-19 01:29:43 UTC (rev 2610)
@@ -20,7 +20,6 @@
 #ifndef HEADER_PINGUS_TRAPS_FAKE_EXIT_HXX
 #define HEADER_PINGUS_TRAPS_FAKE_EXIT_HXX
 
-#include "../game_counter.hxx"
 #include "../worldobj.hxx"
 
 namespace Pingus {
@@ -43,9 +42,8 @@
   CL_Sprite   smallmap_symbol;
 
   Vector      pos;
-  GameCounter counter;
 
-  bool smashing;
+       bool smashing;
 
 public:
   FakeExit(const FileReader& reader);

Modified: trunk/src/worldobjs/laser_exit.cxx
===================================================================
--- trunk/src/worldobjs/laser_exit.cxx  2006-01-19 00:57:13 UTC (rev 2609)
+++ trunk/src/worldobjs/laser_exit.cxx  2006-01-19 01:29:43 UTC (rev 2610)
@@ -30,11 +30,6 @@
   : killing(false)
 {
   reader.read_vector("position", pos);
-
-  counter.set_size(surface.get_frame_count());
-  counter.set_type(GameCounter::once);
-  counter.set_speed(5);
-  counter = 0;
 }
 
 float
@@ -59,11 +54,11 @@
   }
 
   if (killing) {
-    if (counter.finished()) {
-      counter = 0;
+    if (surface.is_finished()) {
+                       surface.restart();
       killing = false;
     } else {
-      ++counter;
+      surface.update();
     }
   }
 }

Modified: trunk/src/worldobjs/laser_exit.hxx
===================================================================
--- trunk/src/worldobjs/laser_exit.hxx  2006-01-19 00:57:13 UTC (rev 2609)
+++ trunk/src/worldobjs/laser_exit.hxx  2006-01-19 01:29:43 UTC (rev 2610)
@@ -20,7 +20,6 @@
 #ifndef HEADER_PINGUS_WORLDOBJS_LASER_EXIT_HXX
 #define HEADER_PINGUS_WORLDOBJS_LASER_EXIT_HXX
 
-#include "../game_counter.hxx"
 #include "../worldobj.hxx"
 
 namespace Pingus {
@@ -38,7 +37,6 @@
 private:
   CL_Sprite   surface;
   Vector      pos;
-  GameCounter counter;
 
   bool killing;
 

Modified: trunk/src/worldobjs/smasher.cxx
===================================================================
--- trunk/src/worldobjs/smasher.cxx     2006-01-19 00:57:13 UTC (rev 2609)
+++ trunk/src/worldobjs/smasher.cxx     2006-01-19 01:29:43 UTC (rev 2610)
@@ -126,12 +126,12 @@
 {
   // Activate the smasher if a Pingu is under it
   if ((   pingu->direction.is_left()
-         && pingu->get_x() > pos.x + 65
-         && pingu->get_x() < pos.x + 85)
+         && pingu->get_pos().x > pos.x + 65
+         && pingu->get_pos().x < pos.x + 85)
       ||
       (   pingu->direction.is_right()
-         && pingu->get_x() > pos.x + 190
-         && pingu->get_x() < pos.x + 210))
+         && pingu->get_pos().x > pos.x + 190
+         && pingu->get_pos().x < pos.x + 210))
     {
       if (pingu->get_action() != Actions::Splashed)
        {

Modified: trunk/src/worldobjs/surface_background.hxx
===================================================================
--- trunk/src/worldobjs/surface_background.hxx  2006-01-19 00:57:13 UTC (rev 
2609)
+++ trunk/src/worldobjs/surface_background.hxx  2006-01-19 01:29:43 UTC (rev 
2610)
@@ -22,7 +22,6 @@
 
 #include <ClanLib/Display/sprite.h>
 #include "../res_descriptor.hxx"
-#include "../game_counter.hxx"
 #include "../worldobj.hxx"
 
 namespace Pingus {
@@ -64,11 +63,9 @@
   /** If streched in x or y direction keep the aspect ratio */
   bool keep_aspect;
 
+       /** Background image */
+       CL_Sprite bg_surface;
 
-  GameCounter counter;
-
-  CL_Sprite bg_surface;
-
   /** The horizontal scrolling speed in pixels per tick */
   float scroll_ox;
 

Modified: trunk/src/worldobjs/woodthing.cxx
===================================================================
--- trunk/src/worldobjs/woodthing.cxx   2006-01-19 00:57:13 UTC (rev 2609)
+++ trunk/src/worldobjs/woodthing.cxx   2006-01-19 01:29:43 UTC (rev 2610)
@@ -33,11 +33,6 @@
 {
   surface  = Resource::load_sprite("entrances/woodthing_mov");
   surface2 = Resource::load_sprite("entrances/woodthing_nmov");
-
-  counter.set_size(surface.get_frame_count());
-  counter.set_type(GameCounter::once);
-  counter.set_speed(2);
-  counter = surface.get_frame_count() - 1;
 }
 
 void
@@ -45,8 +40,6 @@
 {
   Entrance::update ();
 
-  --counter;
-
   if (rand() % 5 == 0)
     {
       world->get_smoke_particle_holder()->
@@ -59,9 +52,15 @@
 void
 WoodThing::draw (SceneContext& gc)
 {
-  gc.color().draw(surface,
-                  Vector(pos.x - surface.get_width () /  2,
-                         pos.y - surface.get_height() + 32));
+       // FIXME: What are these hard-codes in here for?
+       if (last_release > 0)
+               gc.color().draw(surface,
+                       Vector(pos.x - surface.get_width () /  2,
+                       pos.y - surface.get_height() + 32, pos.z));
+       else
+               gc.color().draw(surface2,
+                       Vector(pos.x - surface.get_width () /  2,
+                       pos.y - surface.get_height() + 32, pos.z));
 }
 
 } // namespace Entrances

Modified: trunk/src/worldobjs/woodthing.hxx
===================================================================
--- trunk/src/worldobjs/woodthing.hxx   2006-01-19 00:57:13 UTC (rev 2609)
+++ trunk/src/worldobjs/woodthing.hxx   2006-01-19 01:29:43 UTC (rev 2610)
@@ -20,7 +20,6 @@
 #ifndef HEADER_PINGUS_WORLDOBJS_ENTRANCES_WOODTHING_HXX
 #define HEADER_PINGUS_WORLDOBJS_ENTRANCES_WOODTHING_HXX
 
-#include "../game_counter.hxx"
 #include "entrance.hxx"
 
 namespace Pingus {
@@ -30,7 +29,6 @@
 class WoodThing : public Entrance
 {
 private:
-  GameCounter counter;
   CL_Sprite   surface2;
 
 public:
@@ -51,4 +49,3 @@
 #endif
 
 /* EOF */
-





reply via email to

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