pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src Makefile.static,1.10,1.11 client.hxx,


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src Makefile.static,1.10,1.11 client.hxx,1.19,1.20 game_session.cxx,1.11,1.12 pingu.cxx,1.28,1.29 pingu.hxx,1.18,1.19 pingu_action.hxx,1.16,1.17 pingu_holder.cxx,1.10,1.11 pingu_holder.hxx,1.8,1.9 server.cxx,1.17,1.18 server.hxx,1.7,1.8 sprite.cxx,1.7,1.8 sprite.hxx,1.7,1.8 true_server.cxx,1.11,1.12 true_server.hxx,1.6,1.7 world.cxx,1.27,1.28 world.hxx,1.14,1.15 worldobj.cxx,1.8,1.9 worldobj.hxx,1.9,1.10
Date: 1 Oct 2002 19:53:47 -0000

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

Modified Files:
        Makefile.static client.hxx game_session.cxx pingu.cxx 
        pingu.hxx pingu_action.hxx pingu_holder.cxx pingu_holder.hxx 
        server.cxx server.hxx sprite.cxx sprite.hxx true_server.cxx 
        true_server.hxx world.cxx world.hxx worldobj.cxx worldobj.hxx 
Log Message:
- riped 'float delta' out of the engine code
- some worldmap stuff


Index: Makefile.static
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Makefile.static,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Makefile.static     24 Sep 2002 14:51:36 -0000      1.10
+++ Makefile.static     1 Oct 2002 19:53:44 -0000       1.11
@@ -1,5 +1,6 @@
 LDADD = caimagemanipulation/libcaimagemanipulation.a \
         worldobjsdata/libpingus_worldobjsdata.a \
+        worldobjs/entrances/libpingus_worldobjs_entrances.a \
         worldobjs/libpingus_worldobjs.a \
         editorobjs/libpingus_editorobjs.a \
        actions/libpingu_actions.a \
@@ -12,7 +13,7 @@
         input/axes/libpingus_input_axes.a \
         input/buttons/libpingus_input_buttons.a \
        input/pointers/libpingus_input_pointers.a \
-       input/scrollers/libpingus_input_scrollers.a
+       input/scrollers/libpingus_input_scrollers.a \
 
 LIBS = -lclanGUI -lclanCore -lclanDisplay -lclanApp -lclanPNG -lclanJPEG 
-lHermes \
 -lclanDisplay -lclanMikMod -lclanVorbis -logg -lvorbis -logg -lmikmod 
-lclanCore -lclanSound \

Index: client.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/client.hxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- client.hxx  28 Sep 2002 11:52:21 -0000      1.19
+++ client.hxx  1 Oct 2002 19:53:44 -0000       1.20
@@ -91,7 +91,6 @@
   void set_finished();
 
   /** Update all parts of the world */
-  void update (float delta);
   void update (const GameDelta&);
 
   //void process_events ();
@@ -116,6 +115,8 @@
   void on_action_axis_move (float);
 
 private:
+  void update (float delta);
+
   Client (const Client&);
   Client& operator= (const Client&);
 };

Index: game_session.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/game_session.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- game_session.cxx    28 Sep 2002 11:52:21 -0000      1.11
+++ game_session.cxx    1 Oct 2002 19:53:44 -0000       1.12
@@ -65,7 +65,7 @@
 void
 PingusGameSession::update (const GameDelta& delta)
 {
-  server->update (delta.get_time ());
+  server->update ();
   client->update (delta);
 }
 

Index: pingu.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu.cxx,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- pingu.cxx   28 Sep 2002 11:52:22 -0000      1.28
+++ pingu.cxx   1 Oct 2002 19:53:44 -0000       1.29
@@ -301,7 +301,7 @@
 
 // Let the pingu do his job (i.e. walk his way)
 void
-Pingu::update (float delta)
+Pingu::update ()
 {
   if (status == PS_DEAD)
     return;
@@ -329,7 +329,7 @@
       return;
     }
   
-  action->update(delta);
+  action->update();
 }
 
 // Draws the pingu on the screen with the given offset

Index: pingu.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu.hxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- pingu.hxx   28 Sep 2002 11:52:22 -0000      1.18
+++ pingu.hxx   1 Oct 2002 19:53:44 -0000       1.19
@@ -176,7 +176,7 @@
   void draw (GraphicContext& gc);
   void apply_force (Vector);
   
-  void update (float delta);
+  void update();
   
   /** Indicate if the pingu's speed is above the deadly velocity */
   //bool is_tumbling () const;

Index: pingu_action.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_action.hxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- pingu_action.hxx    27 Sep 2002 11:26:44 -0000      1.16
+++ pingu_action.hxx    1 Oct 2002 19:53:44 -0000       1.17
@@ -73,7 +73,7 @@
   virtual void init (void) {};
 
   /// The "AI" of the pingu.
-  virtual void update (float delta) = 0;
+  virtual void update () = 0;
 
   /** Draws the action */
   virtual void draw (GraphicContext& gc) =0;

Index: pingu_holder.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_holder.cxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- pingu_holder.cxx    28 Sep 2002 11:52:22 -0000      1.10
+++ pingu_holder.cxx    1 Oct 2002 19:53:44 -0000       1.11
@@ -86,13 +86,13 @@
 }
 
 void
-PinguHolder::update(float delta)
+PinguHolder::update()
 {
   PinguIter pingu = pingus.begin();
   
   while(pingu != pingus.end())
     {
-      (*pingu)->update(delta);
+      (*pingu)->update();
       
       // FIXME: The draw-loop is not the place for things like this,
       // this belongs in the update loop

Index: pingu_holder.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_holder.hxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- pingu_holder.hxx    28 Sep 2002 11:52:22 -0000      1.8
+++ pingu_holder.hxx    1 Oct 2002 19:53:44 -0000       1.9
@@ -53,7 +53,7 @@
   ~PinguHolder();
 
   void draw (GraphicContext& gc);
-  void update(float delta);
+  void update();
 
   int  total_size();
   int  get_saved() { return saved_pingus; }

Index: server.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/server.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- server.cxx  27 Sep 2002 11:26:44 -0000      1.17
+++ server.cxx  1 Oct 2002 19:53:44 -0000       1.18
@@ -87,7 +87,7 @@
 }
 
 void
-Server::update(float /*delta*/)
+Server::update()
 {
   /*  static PingusEvent event;
   

Index: server.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/server.hxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- server.hxx  27 Sep 2002 11:26:44 -0000      1.7
+++ server.hxx  1 Oct 2002 19:53:44 -0000       1.8
@@ -63,16 +63,13 @@
   Server(PLF*);
   virtual ~Server();
 
-  virtual bool enough_time_passed() = 0;
-  virtual void update(float delta);
+  virtual void update();
   
   virtual void set_fast_forward(bool) = 0;
   virtual bool get_fast_forward() = 0;
 
   virtual bool get_pause() = 0;
   virtual void set_pause(bool) = 0;
-
-  virtual bool needs_redraw() = 0;
 
   virtual void set_armageddon () =0;
   virtual bool get_armageddon () =0;

Index: sprite.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/sprite.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- sprite.cxx  28 Sep 2002 11:52:22 -0000      1.7
+++ sprite.cxx  1 Oct 2002 19:53:44 -0000       1.8
@@ -22,6 +22,7 @@
 #include "vector.hxx"
 #include "pingus_resource.hxx"
 #include "sprite.hxx"
+#include "globals.hxx"
 
 int round (float f) 
 {
@@ -204,6 +205,13 @@
     default:
       assert (0);
     }
+}
+
+void
+Sprite::update ()
+{
+  // FIXME: game_speed is incorrect, but should work
+  update(game_speed/1000.0f);
 }
 
 void

Index: sprite.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/sprite.hxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- sprite.hxx  28 Sep 2002 11:52:22 -0000      1.7
+++ sprite.hxx  1 Oct 2002 19:53:44 -0000       1.8
@@ -123,6 +123,11 @@
       last update in seconds */
   void update (float delta);
 
+  /** Update the sprite with the global delta value, note this is not
+      a goto_next_frame, but instead a update(game_speed), so it might
+      actually skip frames */
+  void update ();
+
   // @return width of the sprite
   int get_width () { return sur.get_width (); }
 

Index: true_server.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/true_server.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- true_server.cxx     28 Sep 2002 18:34:21 -0000      1.11
+++ true_server.cxx     1 Oct 2002 19:53:44 -0000       1.12
@@ -33,7 +33,6 @@
   armageddon = false;
   world = 0;
   finished = false;
-  client_needs_redraw = true;
   fast_forward = false;
   pause = false;
   last_time = 0;
@@ -51,62 +50,23 @@
 }
 
 void
-TrueServer::update(float delta)
+TrueServer::update()
 {
-  if (enough_time_passed()) 
+  if (fast_forward)
     {
-      client_needs_redraw = true;
-
-      if (fast_forward)
-       {
-         // To let the game run faster we just update it multiple
-         // times
-         for (int i = 0; i < 4; ++i)
-           {
-             Server::update(delta);
-             world->update(delta);
-           }
-       }
-      else
+      // To let the game run faster we just update it multiple
+      // times
+      for (int i = 0; i < 4; ++i)
        {
-         Server::update(delta);
-         world->update(delta);
+         Server::update();
+         world->update();
        }
     }
   else
     {
-      //std::cout << "Sleeping: " << time_till_next_update() << std::endl;
-      //CL_System::sleep(time_till_next_update());
-    }
-}
-
-bool
-TrueServer::enough_time_passed(void)
-{
-  if (pause) {
-    return false;
-  }
-
-  if (fast_forward) {
-    // FIXME: This should skip some frames, so it also works on slower
-    // machines
-    last_time = CL_System::get_time();
-    return true;
-  } else {
-    if (last_time + local_game_speed > CL_System::get_time()) {
-      return false;
-    } else {
-      delta = (CL_System::get_time () - last_time)/1000.0f;
-      last_time = CL_System::get_time();
-      return true;
+      Server::update();
+      world->update();
     }
-  }
-}
-
-int
-TrueServer::time_till_next_update()
-{
-  return last_time + local_game_speed - CL_System::get_time();
 }
 
 void
@@ -131,16 +91,6 @@
 TrueServer::get_pause()
 {
   return pause;
-}
-
-bool
-TrueServer::needs_redraw()
-{
-  if (client_needs_redraw) {
-    client_needs_redraw = false;
-    return true;
-  }
-  return false;
 }
 
 PLF*

Index: true_server.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/true_server.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- true_server.hxx     27 Sep 2002 11:26:44 -0000      1.6
+++ true_server.hxx     1 Oct 2002 19:53:44 -0000       1.7
@@ -30,7 +30,6 @@
   bool pause;
   unsigned int  last_time;
   int  local_game_speed;
-  bool client_needs_redraw;
   float delta;
   bool armageddon;
 
@@ -41,8 +40,7 @@
   TrueServer(PLF* plf);
   virtual ~TrueServer();
 
-  void update(float delta);
-  bool needs_redraw();
+  void update();
   /** Return a reference to the plf used for this level */
   PLF* get_plf ();
   void set_fast_forward(bool value);
@@ -54,10 +52,7 @@
   void set_armageddon ();
   bool get_armageddon ();
   
-private:
-  bool enough_time_passed(void);
-  int  time_till_next_update();
-  
+private: 
   TrueServer (const TrueServer&);
   TrueServer& operator= (const TrueServer&);
 };

Index: world.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/world.cxx,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- world.cxx   28 Sep 2002 11:52:22 -0000      1.27
+++ world.cxx   1 Oct 2002 19:53:44 -0000       1.28
@@ -155,7 +155,7 @@
 }
 
 void 
-World::update(float delta)
+World::update()
 {
   game_time->update ();
 
@@ -186,11 +186,11 @@
     {
       // catch_pingu() is now done in relevant update() if WorldObj
       // needs to catch pingus.
-      (*obj)->update(delta);
+      (*obj)->update();
     }
 
   // FIXME: Why is the particle holder still a seperate object?
-  particle_holder->update(delta);
+  particle_holder->update();
 
   // Clear the explosion force list
   ForcesHolder::clear_explo_list();

Index: world.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/world.hxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- world.hxx   28 Sep 2002 11:52:22 -0000      1.14
+++ world.hxx   1 Oct 2002 19:53:44 -0000       1.15
@@ -109,7 +109,7 @@
   void    draw (GraphicContext& gc);
 
   /** Update the World */
-  void    update (float delta);
+  void    update ();
 
   /** Issue an armageddon, all Pingus will explode in some seconds. */
   void    armageddon ();

Index: worldobj.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobj.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- worldobj.cxx        16 Sep 2002 15:47:35 -0000      1.8
+++ worldobj.cxx        1 Oct 2002 19:53:44 -0000       1.9
@@ -48,7 +48,7 @@
 }
   
 void 
-WorldObj::update(float /*delta*/)
+WorldObj::update()
 {
   // do nothing
 }

Index: worldobj.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobj.hxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- worldobj.hxx        27 Sep 2002 11:26:44 -0000      1.9
+++ worldobj.hxx        1 Oct 2002 19:53:44 -0000       1.10
@@ -82,7 +82,7 @@
   /** The update function is called once a game loop, the delta
    * specifies how much time is passed since the last update
    * delta = 1.0 means that one second of realtime has passed. */
-  virtual void update (float delta);
+  virtual void update ();
   
   virtual WorldObjData* get_data () { return 0; }
 };





reply via email to

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