[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src TrueServer.cc,1.31,1.32 World.cc,1.71
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src TrueServer.cc,1.31,1.32 World.cc,1.71,1.72 World.hh,1.36,1.37 |
Date: |
9 Jun 2002 14:28:05 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv11900
Modified Files:
TrueServer.cc World.cc World.hh
Log Message:
Some minimal cleanup, removed obsolete constructor
Index: TrueServer.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/TrueServer.cc,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- TrueServer.cc 8 Jun 2002 22:38:32 -0000 1.31
+++ TrueServer.cc 9 Jun 2002 14:28:03 -0000 1.32
@@ -48,13 +48,11 @@
last_time = 0;
local_game_speed = game_speed;
- world = new World ();
+ world = new World (plf);
// FIXME: this is complete trash, delete it and place it in world
// object or so...
world->set_action_holder(&action_holder);
-
- world->init(plf);
GameTime::reset();
}
Index: World.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/World.cc,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- World.cc 9 Jun 2002 14:04:10 -0000 1.71
+++ World.cc 9 Jun 2002 14:28:03 -0000 1.72
@@ -52,22 +52,32 @@
}
};
-World::World()
- : view (0)
-{
- released_pingus = 0;
- exit_world = false;
- WorldObj::set_world(this);
-}
-
-World::World(PLF* plf)
+World::World(PLF* arg_plf)
+ : particle_holder (new ParticleHolder()),
+ pingus (new PinguHolder()),
+ plf (arg_plf),
+ view (0)
{
+ // Not perfect, but works
WorldObj::set_world(this);
- init (plf);
+
+ do_armageddon = false;
+ allowed_pingus = plf->get_pingus();
+ number_to_save = plf->get_number_to_save();
+ released_pingus = 0;
+
+ exit_time = plf->get_time();
+ if (exit_time != -1 && !(exit_time > 100))
+ std::cout << "World: Time is not in the tolerated range: " << exit_time <<
std::endl;
+ shutdown_time = -1;
+
+ init_map();
+ init_worldobjs();
}
World::~World()
{
+ delete particle_holder;
}
// Merge the different layers on the screen together
@@ -155,28 +165,6 @@
ForcesHolder::clear_explo_list();
}
-void
-World::init(PLF* plf_data)
-{
- plf = plf_data;
- do_armageddon = false;
- allowed_pingus = plf->get_pingus();
- number_to_save = plf->get_number_to_save();
- released_pingus = 0;
-
- exit_time = plf->get_time();
- if (exit_time != -1 && !(exit_time > 100))
- std::cout << "World: Time is not in the tolerated range: " << exit_time <<
std::endl;
- shutdown_time = -1;
-
- init_map();
-
- particle_holder = shared_ptr<ParticleHolder>(new ParticleHolder());
- pingus = new PinguHolder();
-
- init_worldobjs();
-}
-
void
World::init_map()
{
@@ -328,7 +316,7 @@
ParticleHolder*
World::get_particle_holder()
{
- return particle_holder.get();
+ return particle_holder;
}
PLF*
Index: World.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/World.hh,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- World.hh 9 Jun 2002 14:04:10 -0000 1.36
+++ World.hh 9 Jun 2002 14:28:03 -0000 1.37
@@ -71,22 +71,22 @@
typedef std::list<boost::shared_ptr<WorldObj> >::iterator WorldObjIter;
std::list<boost::shared_ptr<WorldObj> > world_obj;
- boost::shared_ptr<ParticleHolder> particle_holder;
- ActionHolder* action_holder;
- PinguHolder* pingus;
- ColMap* colmap;
- PLF* plf;
+ // These pointers hold objects and must be deleted
+ ParticleHolder* particle_holder;
+ PinguHolder* pingus;
+
+ // Pointers which are references to objects from other classes
+ ActionHolder* action_holder;
+ ColMap* colmap;
+ PLF* plf;
boost::shared_ptr<View> view;
void init_worldobjs (void);
void init_map (void);
public:
- World();
World(PLF*);
virtual ~World();
-
- void init (PLF*);
/** Draws the world onto the screen
@param x1 The left corner of the drawing area.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src TrueServer.cc,1.31,1.32 World.cc,1.71,1.72 World.hh,1.36,1.37,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/backgrounds ThunderstormBackground.hh,1.11,1.12 ThunderstormBackgroundData.cc,1.12,1.13
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src ButtonPanel.cc,1.29,1.30 ButtonPanel.hh,1.15,1.16 Client.cc,1.82,1.83 Client.hh,1.38,1.39 Controllable.cc,1.5,1.6 Controllable.hh,1.5,1.6 Cursor.cc,1.4,1.5 Cursor.hh,1.6,1.7 MultiplayerClientChild.cc,1.12,1.13 MultiplayerClientChild.hh,1.8,1.9 MultiplayerGame.cc,1.8,1.9 PingusGameSession.cc,1.15,1.16 PingusGameSession.hh,1.9,1.10 PingusLevelDesc.cc,1.27,1.28 PingusLevelDesc.hh,1.12,1.13 PingusLevelResult.cc,1.26,1.27 PingusLevelResult.hh,1.7,1.8 PingusMenu.hh,1.22,1.23 Playfield.cc,1.36,1.37 Playfield.hh,1.26,1.27 View.cc,1.20,1.21 View.hh,1.12,1.13
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/backgrounds ThunderstormBackground.hh,1.11,1.12 ThunderstormBackgroundData.cc,1.12,1.13
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src ButtonPanel.cc,1.29,1.30 ButtonPanel.hh,1.15,1.16 Client.cc,1.82,1.83 Client.hh,1.38,1.39 Controllable.cc,1.5,1.6 Controllable.hh,1.5,1.6 Cursor.cc,1.4,1.5 Cursor.hh,1.6,1.7 MultiplayerClientChild.cc,1.12,1.13 MultiplayerClientChild.hh,1.8,1.9 MultiplayerGame.cc,1.8,1.9 PingusGameSession.cc,1.15,1.16 PingusGameSession.hh,1.9,1.10 PingusLevelDesc.cc,1.27,1.28 PingusLevelDesc.hh,1.12,1.13 PingusLevelResult.cc,1.26,1.27 PingusLevelResult.hh,1.7,1.8 PingusMenu.hh,1.22,1.23 Playfield.cc,1.36,1.37 Playfield.hh,1.26,1.27 View.cc,1.20,1.21 View.hh,1.12,1.13
- Index(es):