pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/worldobjs entrance.cxx,NONE,1.1 entra


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldobjs entrance.cxx,NONE,1.1 entrance.hxx,NONE,1.1 Makefile.am,1.15,1.16 bumper.hxx,1.4,1.5 conveyor_belt.hxx,1.12,1.13 fake_exit.hxx,1.3,1.4 groundpiece.hxx,1.3,1.4 guillotine.hxx,1.3,1.4 hammer.hxx,1.4,1.5 hotspot.hxx,1.2,1.3 ice_block.hxx,1.11,1.12 info_box.hxx,1.12,1.13 laser_exit.hxx,1.3,1.4 liquid.hxx,1.1,1.2 rain_generator.hxx,1.3,1.4 smasher.hxx,1.4,1.5 snow_generator.hxx,1.3,1.4 solid_color_background.hxx,1.1,1.2 spike.hxx,1.3,1.4 starfield_background.hxx,1.2,1.3 starfield_background_stars.hxx,1.2,1.3 surface_background.hxx,1.1,1.2 switch_door.hxx,1.14,1.15 teleporter.hxx,1.13,1.14 thunderstorm_background.hxx,1.1,1.2 worldobj_group.hxx,1.4,1.5
Date: 27 Sep 2002 11:26:51 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/worldobjs
In directory dark:/tmp/cvs-serv24897/worldobjs

Modified Files:
        Makefile.am bumper.hxx conveyor_belt.hxx fake_exit.hxx 
        groundpiece.hxx guillotine.hxx hammer.hxx hotspot.hxx 
        ice_block.hxx info_box.hxx laser_exit.hxx liquid.hxx 
        rain_generator.hxx smasher.hxx snow_generator.hxx 
        solid_color_background.hxx spike.hxx starfield_background.hxx 
        starfield_background_stars.hxx surface_background.hxx 
        switch_door.hxx teleporter.hxx thunderstorm_background.hxx 
        worldobj_group.hxx 
Added Files:
        entrance.cxx entrance.hxx 
Log Message:
- splitted Entrance
- changed operator= return value


--- NEW FILE: entrance.cxx ---
//  $Id: entrance.cxx,v 1.1 2002/09/27 11:26:49 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 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 2
//  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, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include "../graphic_context.hxx"
#include "../world.hxx"
#include "../pingu_holder.hxx"
#include "../globals.hxx"
#include "../pingu.hxx"
#include "../game_time.hxx"
#include "../worldobjsdata/entrance_data.hxx"
#include "entrance.hxx"

namespace WorldObjs {

Entrance::Entrance (const WorldObjsData::EntranceData& data_)
  : data(new WorldObjsData::EntranceData(data_)),
    last_release(-data->release_rate)
{
  if (verbose > 2)
    std::cout << "Creating Entrance" << std::endl;
}

Entrance::~Entrance ()
{
  delete data;
}

float
Entrance::get_z_pos () const
{
  return data->pos.z;
}

bool
Entrance::pingu_ready ()
{
  if (last_release < (world->get_game_time()->get_ticks() - 
data->release_rate)) {
    last_release = world->get_game_time()->get_ticks();
    return true;
  } else {
    return false;
  }
}

Pingu*
Entrance::get_pingu ()
{
  static int last_direction;
  Direction d;

  Pingu* pingu = world->get_pingu_p()->create_pingu(data->pos, data->owner_id);

  switch (data->direction) 
    {
    case WorldObjsData::EntranceData::LEFT:
      d.left();
      pingu->set_direction(d);
      break;

    case WorldObjsData::EntranceData::MISC:
      if (last_direction) 
        {
          d.left();
          last_direction = 0;
        } 
      else
        {
          d.right();
          last_direction = 1;
        }
      pingu->set_direction(d);
      break;
        
    case WorldObjsData::EntranceData::RIGHT:  
      d.right();
      pingu->set_direction(d);
      break;
    
    default:
      std::cout << "Entrance:: Warning direction is wrong: " << data->direction 
<< std::endl;
      d.right();
      pingu->set_direction(d);
      break;
    }
  return pingu;
}

void
Entrance::update (float /*delta*/)
{
  if (   pingu_ready() 
      && (world->get_released_pingus() < world->get_allowed_pingus())
      && (! world->check_armageddon()))
    {
      world->get_pingu_p()->add(get_pingu());
      world->inc_released_pingus();
    }
}

void
Entrance::draw (GraphicContext& gc)
{
  if (!surface) 
    {
      // Entrances have only a surface for historical reasons
      //std::cout << "Entrance::draw (GraphicContext& gc): entrance without a 
surface?!" << std::endl;
      return;
    }

  // FIXME: Why do we still have these hardcoded offsets?!
  gc.draw(surface, CL_Vector(data->pos.x - 32, data->pos.y - 16));
}

} // namespace WorldObjs

/* EOF */

--- NEW FILE: entrance.hxx ---
//  $Id: entrance.hxx,v 1.1 2002/09/27 11:26:49 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 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 2
//  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, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PINGUS_ENTRANCE_HXX
#define HEADER_PINGUS_ENTRANCE_HXX

#include <ClanLib/Display/Display/surface.h>
#include "../worldobj.hxx"

namespace WorldObjsData {
class EntranceData;
}

class Pingu;

namespace WorldObjs {

/** A abstract representation of an entrance, the implementation
    currently sucks and needs to be rewritten */
class Entrance : public WorldObj
{
protected:
  WorldObjsData::EntranceData* const data;
  
  CL_Surface surface;
  int        last_release;
  
public:
  Entrance (const WorldObjsData::EntranceData& data_);
 ~Entrance ();

  float get_z_pos () const;
  
  virtual bool   pingu_ready ();
  virtual Pingu* get_pingu ();
  
  virtual void   update (float delta);
  
  virtual void   draw (GraphicContext& gc);
  
private:
  Entrance (const Entrance&);
  Entrance& operator= (const Entrance&);
};

} // namespace WorldObjs

#endif

/* EOF */

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/Makefile.am,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- Makefile.am 25 Sep 2002 17:21:39 -0000      1.15
+++ Makefile.am 27 Sep 2002 11:26:49 -0000      1.16
@@ -19,9 +19,12 @@
 
 noinst_LIBRARIES = libpingus_worldobjs.a
 
+SUBDIRS = entrances
+
 libpingus_worldobjs_a_SOURCES = \
        bumper.cxx                     bumper.hxx                     \
         conveyor_belt.cxx              conveyor_belt.hxx              \
+       entrance.cxx                   entrance.hxx                   \
        fake_exit.cxx                  fake_exit.hxx                  \
        guillotine.cxx                 guillotine.hxx                 \
         groundpiece.hxx                groundpiece.cxx                \

Index: bumper.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/bumper.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- bumper.hxx  16 Sep 2002 22:51:33 -0000      1.4
+++ bumper.hxx  27 Sep 2002 11:26:49 -0000      1.5
@@ -52,7 +52,7 @@
   void catch_pingu (Pingu* pingu);
 
   Bumper (const Bumper&);
-  Bumper operator= (const Bumper&);
+  Bumper& operator= (const Bumper&);
 };
 
 } // namespace WorldObjs

Index: conveyor_belt.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/conveyor_belt.hxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- conveyor_belt.hxx   16 Sep 2002 22:51:33 -0000      1.12
+++ conveyor_belt.hxx   27 Sep 2002 11:26:49 -0000      1.13
@@ -49,7 +49,7 @@
   
 private:
   ConveyorBelt (const ConveyorBelt&);
-  ConveyorBelt operator= (const ConveyorBelt&);
+  ConveyorBelt& operator= (const ConveyorBelt&);
 };
 
 } // namespace WorldObjs

Index: fake_exit.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/fake_exit.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- fake_exit.hxx       10 Sep 2002 19:24:19 -0000      1.3
+++ fake_exit.hxx       27 Sep 2002 11:26:49 -0000      1.4
@@ -53,7 +53,7 @@
   void catch_pingu (Pingu*);
     
   FakeExit (const FakeExit&);
-  FakeExit operator= (const FakeExit&);
+  FakeExit& operator= (const FakeExit&);
 };
 
 } // namespace WorldObjs

Index: groundpiece.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/groundpiece.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- groundpiece.hxx     16 Sep 2002 20:52:22 -0000      1.3
+++ groundpiece.hxx     27 Sep 2002 11:26:49 -0000      1.4
@@ -34,7 +34,7 @@
   CL_Surface surface;
 
 public:
-  Groundpiece(const WorldObjsData::GroundpieceData& data_);
+  Groundpiece (const WorldObjsData::GroundpieceData& data_);
   ~Groundpiece() {};
 
   float get_z_pos () const { return 0; }
@@ -44,7 +44,7 @@
   bool purge_after_startup() { return true; }
 private:
   Groundpiece (const Groundpiece&);
-  Groundpiece operator= (const Groundpiece&);
+  Groundpiece& operator= (const Groundpiece&);
 };
 
 } // namespace WorldObjs

Index: guillotine.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/guillotine.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- guillotine.hxx      10 Sep 2002 19:24:19 -0000      1.3
+++ guillotine.hxx      27 Sep 2002 11:26:49 -0000      1.4
@@ -50,7 +50,7 @@
 
 private:
   Guillotine (const Guillotine&);
-  Guillotine operator= (const Guillotine&);
+  Guillotine& operator= (const Guillotine&);
 };
 
 } // namespace WorldObjs

Index: hammer.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/hammer.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- hammer.hxx  14 Sep 2002 19:06:34 -0000      1.4
+++ hammer.hxx  27 Sep 2002 11:26:49 -0000      1.5
@@ -50,7 +50,7 @@
 
 private:
   Hammer (const Hammer&);
-  Hammer operator= (const Hammer&);
+  Hammer& operator= (const Hammer&);
 };
 
 } // namespace WorldObjs

Index: hotspot.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/hotspot.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hotspot.hxx 24 Sep 2002 16:46:45 -0000      1.2
+++ hotspot.hxx 27 Sep 2002 11:26:49 -0000      1.3
@@ -44,7 +44,7 @@
   
 private:
   Hotspot (const Hotspot&);
-  Hotspot operator= (const Hotspot&);
+  Hotspot& operator= (const Hotspot&);
 };
 
 } // namespace WorldObjs

Index: ice_block.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/ice_block.hxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ice_block.hxx       16 Sep 2002 22:51:33 -0000      1.11
+++ ice_block.hxx       27 Sep 2002 11:26:49 -0000      1.12
@@ -49,7 +49,7 @@
   
 private:
   IceBlock (const IceBlock&);
-  IceBlock operator= (const IceBlock&);
+  IceBlock& operator= (const IceBlock&);
 };
 
 } // namespace WorldObjs

Index: info_box.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/info_box.hxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- info_box.hxx        17 Sep 2002 16:23:30 -0000      1.12
+++ info_box.hxx        27 Sep 2002 11:26:49 -0000      1.13
@@ -46,7 +46,7 @@
   
 private:
   InfoBox (const InfoBox&);
-  InfoBox operator= (const InfoBox&);
+  InfoBox& operator= (const InfoBox&);
 };
 
 } // namespace WorldObjs

Index: laser_exit.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/laser_exit.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- laser_exit.hxx      10 Sep 2002 19:24:19 -0000      1.3
+++ laser_exit.hxx      27 Sep 2002 11:26:49 -0000      1.4
@@ -50,7 +50,7 @@
 
 private:
   LaserExit (const LaserExit&);
-  LaserExit operator= (const LaserExit&);
+  LaserExit& operator= (const LaserExit&);
 }; 
 
 } // namespace WorldObjs

Index: liquid.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/liquid.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- liquid.hxx  25 Sep 2002 17:21:39 -0000      1.1
+++ liquid.hxx  27 Sep 2002 11:26:49 -0000      1.2
@@ -49,7 +49,7 @@
   
 private:
   Liquid (const Liquid&);
-  Liquid operator= (const Liquid&);
+  Liquid& operator= (const Liquid&);
 };
 
 } // namespace WorldObjs

Index: rain_generator.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/rain_generator.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rain_generator.hxx  16 Sep 2002 16:47:41 -0000      1.3
+++ rain_generator.hxx  27 Sep 2002 11:26:49 -0000      1.4
@@ -40,7 +40,7 @@
 
 private:
   RainGenerator (const RainGenerator&);
-  RainGenerator operator= (const RainGenerator&);
+  RainGenerator& operator= (const RainGenerator&);
 };
 
 } // namespace WorldObjs

Index: smasher.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/smasher.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- smasher.hxx 16 Sep 2002 22:51:33 -0000      1.4
+++ smasher.hxx 27 Sep 2002 11:26:49 -0000      1.5
@@ -53,7 +53,7 @@
 
 private:
   Smasher (const Smasher&);
-  Smasher operator= (const Smasher&);
+  Smasher& operator= (const Smasher&);
 };
 
 } // namespace WorldObjs

Index: snow_generator.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/snow_generator.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- snow_generator.hxx  16 Sep 2002 17:17:17 -0000      1.3
+++ snow_generator.hxx  27 Sep 2002 11:26:49 -0000      1.4
@@ -39,7 +39,7 @@
   float get_z_pos() const { return 1000; }
 private:
   SnowGenerator (const SnowGenerator&);
-  SnowGenerator operator= (const SnowGenerator&);
+  SnowGenerator& operator= (const SnowGenerator&);
 };
 
 } // namespace WorldObjs

Index: solid_color_background.hxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/worldobjs/solid_color_background.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- solid_color_background.hxx  15 Sep 2002 09:54:34 -0000      1.1
+++ solid_color_background.hxx  27 Sep 2002 11:26:49 -0000      1.2
@@ -45,7 +45,7 @@
   
 private:
   SolidColorBackground (const SolidColorBackground&);
-  SolidColorBackground operator= (const SolidColorBackground&);
+  SolidColorBackground& operator= (const SolidColorBackground&);
 };
 
 } // namespace WorldObjs

Index: spike.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/spike.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- spike.hxx   10 Sep 2002 19:24:19 -0000      1.3
+++ spike.hxx   27 Sep 2002 11:26:49 -0000      1.4
@@ -51,7 +51,7 @@
 
 private:
   Spike (const Spike&);
-  Spike operator= (const Spike&);
+  Spike& operator= (const Spike&);
 };
 
 } // namespace WorldObjs

Index: starfield_background.hxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/worldobjs/starfield_background.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- starfield_background.hxx    24 Sep 2002 14:51:36 -0000      1.2
+++ starfield_background.hxx    27 Sep 2002 11:26:49 -0000      1.3
@@ -49,7 +49,7 @@
   
 private:
   StarfieldBackground (const StarfieldBackground&);
-  StarfieldBackground operator= (const StarfieldBackground&);
+  StarfieldBackground& operator= (const StarfieldBackground&);
 };
 
 } // namespace WorldObjs

Index: starfield_background_stars.hxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/worldobjs/starfield_background_stars.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- starfield_background_stars.hxx      24 Sep 2002 14:51:36 -0000      1.2
+++ starfield_background_stars.hxx      27 Sep 2002 11:26:49 -0000      1.3
@@ -56,7 +56,7 @@
 
 private:
   StarfieldBackgroundStars (const StarfieldBackgroundStars&);
-  StarfieldBackgroundStars operator= (const StarfieldBackgroundStars&);
+  StarfieldBackgroundStars& operator= (const StarfieldBackgroundStars&);
 };
 
 } // namespace WorldObjs

Index: surface_background.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/surface_background.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- surface_background.hxx      16 Sep 2002 20:52:22 -0000      1.1
+++ surface_background.hxx      27 Sep 2002 11:26:49 -0000      1.2
@@ -55,7 +55,7 @@
   
 private:
   SurfaceBackground (const SurfaceBackground&);
-  SurfaceBackground operator= (const SurfaceBackground&);
+  SurfaceBackground& operator= (const SurfaceBackground&);
 };
 
 } // namespace WorldObjs

Index: switch_door.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/switch_door.hxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- switch_door.hxx     16 Sep 2002 22:51:33 -0000      1.14
+++ switch_door.hxx     27 Sep 2002 11:26:49 -0000      1.15
@@ -60,7 +60,7 @@
   
 private:
   SwitchDoor (const SwitchDoor&);
-  SwitchDoor operator= (const SwitchDoor&);
+  SwitchDoor& operator= (const SwitchDoor&);
 };
 
 } // namespace WorldObjs

Index: teleporter.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/teleporter.hxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- teleporter.hxx      14 Sep 2002 19:06:34 -0000      1.13
+++ teleporter.hxx      27 Sep 2002 11:26:49 -0000      1.14
@@ -44,7 +44,7 @@
   
 private:
   Teleporter (const Teleporter&);
-  Teleporter operator= (const Teleporter&);
+  Teleporter& operator= (const Teleporter&);
 };
 
 } // namespace WorldObjs

Index: thunderstorm_background.hxx
===================================================================
RCS file: 
/usr/local/cvsroot/Games/Pingus/src/worldobjs/thunderstorm_background.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- thunderstorm_background.hxx 18 Sep 2002 15:00:37 -0000      1.1
+++ thunderstorm_background.hxx 27 Sep 2002 11:26:49 -0000      1.2
@@ -47,7 +47,7 @@
   
 private:
   ThunderstormBackground (const ThunderstormBackground&);
-  ThunderstormBackground operator= (const ThunderstormBackground&);
+  ThunderstormBackground& operator= (const ThunderstormBackground&);
 };
 
 } // namespace WorldObjs

Index: worldobj_group.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjs/worldobj_group.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- worldobj_group.hxx  16 Sep 2002 10:18:51 -0000      1.4
+++ worldobj_group.hxx  27 Sep 2002 11:26:49 -0000      1.5
@@ -42,7 +42,7 @@
 
 private:
   WorldObjGroup (const WorldObjGroup&);
-  WorldObjGroup operator= (const WorldObjGroup&);
+  WorldObjGroup& operator= (const WorldObjGroup&);
 };
 
 } // namespace WorldObjs





reply via email to

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