[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3656 - trunk/pingus/src
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r3656 - trunk/pingus/src |
Date: |
Fri, 4 Jul 2008 04:51:49 +0200 |
Author: grumbel
Date: 2008-07-04 04:51:48 +0200 (Fri, 04 Jul 2008)
New Revision: 3656
Modified:
trunk/pingus/src/game_time.cpp
trunk/pingus/src/game_time.hpp
trunk/pingus/src/world.cpp
trunk/pingus/src/world.hpp
Log:
Removed some more junk from GameTime
Modified: trunk/pingus/src/game_time.cpp
===================================================================
--- trunk/pingus/src/game_time.cpp 2008-07-04 02:39:49 UTC (rev 3655)
+++ trunk/pingus/src/game_time.cpp 2008-07-04 02:51:48 UTC (rev 3656)
@@ -19,24 +19,6 @@
#include "globals.hpp"
#include "game_time.hpp"
-
-GameTime::GameTime()
- : count (0)
-{
-}
-
-int
-GameTime::get_ticks(void)
-{
- return count;
-}
-
-void
-GameTime::update(void)
-{
- count += 1;
-}
-
std::string
GameTime::ticks_to_realtime_string(int ticks)
{
Modified: trunk/pingus/src/game_time.hpp
===================================================================
--- trunk/pingus/src/game_time.hpp 2008-07-04 02:39:49 UTC (rev 3655)
+++ trunk/pingus/src/game_time.hpp 2008-07-04 02:51:48 UTC (rev 3656)
@@ -19,36 +19,17 @@
#include "pingus.hpp"
-
/** The GameTime represents the time which passes in the Pingus World.
Its behaviour is analogue to CL_System::get_time (), but with the
difference that it only increases if the game runs, if the game is
in pause mode, the time will not continue. */
class GameTime
{
-private:
- /** Tick counter */
- int count;
-
public:
- GameTime();
-
- /** Number of ticks since the time starts, a tick is one basically
- update call to the world */
- int get_ticks(void);
-
- /** Increase the tick count */
- void update(void);
-
/** Convert time given in ticks, into a string of Minutes:Seconds */
static std::string ticks_to_realtime_string(int ticks);
-
-private:
- GameTime (const GameTime&);
- GameTime& operator= (const GameTime&);
};
-
#endif
/* EOF */
Modified: trunk/pingus/src/world.cpp
===================================================================
--- trunk/pingus/src/world.cpp 2008-07-04 02:39:49 UTC (rev 3655)
+++ trunk/pingus/src/world.cpp 2008-07-04 02:51:48 UTC (rev 3656)
@@ -33,7 +33,6 @@
#include "pingus_level.hpp"
#include "worldobj_factory.hpp"
#include "col_map.hpp"
-#include "game_time.hpp"
#include "debug.hpp"
using Actions::Bomber;
@@ -47,7 +46,7 @@
World::World(const PingusLevel& plf)
: ambient_light(Color(plf.get_ambient_light())),
gfx_map(new GroundMap(plf)),
- game_time(new GameTime()),
+ game_time(0),
do_armageddon(false),
pingus(new PinguHolder(plf)),
colmap(gfx_map->get_colmap()),
@@ -108,7 +107,6 @@
for (WorldObjIter it = world_obj.begin(); it != world_obj.end(); ++it) {
delete *it;
}
- delete game_time;
}
void
@@ -140,11 +138,11 @@
{
WorldObj::set_world(this);
- game_time->update ();
+ game_time += 1;
if (do_armageddon)
{
- if (game_time->get_ticks() % 4 == 0)
+ if (game_time % 4 == 0)
{
while (armageddon_count < pingus->get_end_id())
{
@@ -200,7 +198,7 @@
int
World::get_time()
{
- return game_time->get_ticks();
+ return game_time;
}
void
Modified: trunk/pingus/src/world.hpp
===================================================================
--- trunk/pingus/src/world.hpp 2008-07-04 02:39:49 UTC (rev 3655)
+++ trunk/pingus/src/world.hpp 2008-07-04 02:51:48 UTC (rev 3656)
@@ -20,6 +20,7 @@
#include "pingus.hpp"
#include <vector>
#include <string>
+#include <memory>
#include "math/vector2i.hpp"
#include "math/color.hpp"
#include "groundtype.hpp"
@@ -65,7 +66,7 @@
GroundMap* gfx_map;
/** manager class for the time in the pingus world */
- GameTime* game_time;
+ int game_time;
/** set to true once an armageddon got started */
bool do_armageddon;
@@ -77,7 +78,6 @@
std::vector<WorldObj*> world_obj;
typedef std::vector<WorldObj*>::iterator WorldObjIter;
- // These pointers hold objects and must be deleted
Particles::PinguParticleHolder* pingu_particle_holder;
Particles::RainParticleHolder* rain_particle_holder;
Particles::SmokeParticleHolder* smoke_particle_holder;
@@ -85,7 +85,6 @@
PinguHolder* pingus;
// Pointers which are references to objects from other classes
- //ActionHolder* action_holder;
ColMap* colmap;
void init_worldobjs (const PingusLevel& plf);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3656 - trunk/pingus/src,
grumbel at BerliOS <=