pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src client.cxx,1.40,1.41 demo_session.cx


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src client.cxx,1.40,1.41 demo_session.cxx,1.5,1.6 hurry_up.cxx,1.5,1.6 hurry_up.hxx,1.6,1.7 pingus_counter.cxx,1.12,1.13 playfield.cxx,1.30,1.31 playfield.hxx,1.13,1.14 smallmap.cxx,1.30,1.31 smallmap.hxx,1.15,1.16 time_display.cxx,1.11,1.12 time_display.hxx,1.9,1.10 world.cxx,1.37,1.38 world.hxx,1.23,1.24
Date: 19 Feb 2003 10:37:33 -0000

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

Modified Files:
        client.cxx demo_session.cxx hurry_up.cxx hurry_up.hxx 
        pingus_counter.cxx playfield.cxx playfield.hxx smallmap.cxx 
        smallmap.hxx time_display.cxx time_display.hxx world.cxx 
        world.hxx 
Log Message:
misc stuff


Index: client.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/client.cxx,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- client.cxx  19 Feb 2003 09:50:34 -0000      1.40
+++ client.cxx  19 Feb 2003 10:37:31 -0000      1.41
@@ -61,16 +61,11 @@
 
   // These object will get deleted by the gui_manager
   button_panel = new ButtonPanel(this, 2, CL_Display::get_height()/2);
-  playfield    = new Playfield(this, server->get_plf (), server->get_world());
-  hurry_up     = new HurryUp();
-  pcounter     = new PingusCounter(server);  
-  small_map    = new SmallMap();
-  time_display = new TimeDisplay();
-
-  // FIXME: add all this to the constructor
-  hurry_up->set_client(this);
-  small_map->set_client(this);
-  time_display->set_server(server);
+  playfield    = new Playfield(this);
+  hurry_up     = new HurryUp(this);
+  pcounter     = new PingusCounter(get_server());  
+  small_map    = new SmallMap(this);
+  time_display = new TimeDisplay(this);
 
   gui_manager->add (playfield, true);
   gui_manager->add (button_panel, true);

Index: demo_session.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/demo_session.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- demo_session.cxx    19 Feb 2003 09:50:35 -0000      1.5
+++ demo_session.cxx    19 Feb 2003 10:37:31 -0000      1.6
@@ -34,7 +34,7 @@
   pdf    = new XMLPDF(filename);
 
   // Create server
-  server = new TrueServer(pdf->get_plf());
+  server      = new TrueServer(pdf->get_plf());
   demo_player = new DemoPlayer(server, pdf);
 
   // Create GUI

Index: hurry_up.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/hurry_up.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- hurry_up.cxx        29 Dec 2002 23:29:00 -0000      1.5
+++ hurry_up.cxx        19 Feb 2003 10:37:31 -0000      1.6
@@ -23,12 +23,12 @@
 #include "pingus_resource.hxx"
 #include "hurry_up.hxx"
 
-HurryUp::HurryUp () 
+HurryUp::HurryUp (Client* c) 
   : font(PingusResource::load_font("Fonts/pingus","fonts")),
     is_running(false),
     is_finished(false),
     center_reached(false),
-    client(0),
+    client(c),
     wait_counter(0),
     x_pos(-200.0),
     speed(3.0f)
@@ -98,12 +98,6 @@
        is_running = true;
 #endif
     }
-}
-
-void
-HurryUp::set_client(Client* c)
-{
-  client = c;
 }
 
 /* EOF */

Index: hurry_up.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/hurry_up.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- hurry_up.hxx        27 Sep 2002 11:26:43 -0000      1.6
+++ hurry_up.hxx        19 Feb 2003 10:37:31 -0000      1.7
@@ -41,7 +41,7 @@
   float speed;
 
 public:
-  HurryUp();
+  HurryUp(Client*);
   virtual ~HurryUp();
 
   void draw(GraphicContext& gc);

Index: pingus_counter.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_counter.cxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- pingus_counter.cxx  28 Nov 2002 18:05:40 -0000      1.12
+++ pingus_counter.cxx  19 Feb 2003 10:37:31 -0000      1.13
@@ -25,7 +25,7 @@
 #include "pingus_counter.hxx"
 #include "world.hxx"
 #include "pingu_holder.hxx"
-#include "server.hxx"
+#include "true_server.hxx"
 #include "plf.hxx"
 #include "globals.hxx"
 

Index: playfield.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/playfield.cxx,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- playfield.cxx       15 Jan 2003 21:16:41 -0000      1.30
+++ playfield.cxx       19 Feb 2003 10:37:31 -0000      1.31
@@ -26,13 +26,14 @@
 #include "pingu_holder.hxx"
 #include "world.hxx"
 #include "server.hxx"
+#include "true_server.hxx"
 #include "pingu.hxx"
 #include "button_panel.hxx"
 
-Playfield::Playfield (Client* client_, PLF* level_data, World* w)
+Playfield::Playfield (Client* client_)
   : client(client_), current_pingu(0), current_view(0)
 {
-  world = w;
+  world = client->get_server()->get_world();
   mouse_scrolling = false;
   View::set_world(world);
 
@@ -75,8 +76,8 @@
       { // !gimmicks_enabled
        view.push_back(new View(client, x1, y1, x2, y2));
        
-       view[0]->set_x_offset(((x2 - x1) / 2) - level_data->get_startx());
-       view[0]->set_y_offset(((y2 - y1) / 2) - level_data->get_starty());
+       view[0]->set_x_offset(((x2 - x1) / 2) - world->get_start_x());
+       view[0]->set_y_offset(((y2 - y1) / 2) - world->get_start_y());
        
        world->set_view (view[0]);
       }

Index: playfield.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/playfield.hxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- playfield.hxx       12 Oct 2002 00:49:10 -0000      1.13
+++ playfield.hxx       19 Feb 2003 10:37:31 -0000      1.14
@@ -61,7 +61,7 @@
   int mouse_x;
   int mouse_y;
 public:
-  Playfield (Client*, PLF* plf, World*);
+  Playfield (Client*);
   virtual ~Playfield();
 
   int get_x_offset();

Index: smallmap.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/smallmap.cxx,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- smallmap.cxx        19 Feb 2003 09:50:36 -0000      1.30
+++ smallmap.cxx        19 Feb 2003 10:37:31 -0000      1.31
@@ -31,8 +31,9 @@
 #include "math.hxx"
 #include "globals.hxx"
 
-SmallMap::SmallMap()
-  : canvas(0),
+SmallMap::SmallMap(Client* c)
+  : client(c),
+    canvas(0),
     update_count(0),
     gc_ptr(0)
 {
@@ -45,6 +46,8 @@
   height = 100;
 
   scroll_mode = false;
+  
+  init();
 }
 
 SmallMap::~SmallMap()
@@ -165,13 +168,6 @@
 
   rwidth = CL_Display::get_width() * width / 
client->get_server()->get_world()->get_colmap()->get_width();
   rheight = CL_Display::get_height() * height / 
client->get_server()->get_world()->get_colmap()->get_height();
-}
-
-void
-SmallMap::set_client (Client* c)
-{
-  client = c;
-  init();
 }
 
 void

Index: smallmap.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/smallmap.hxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- smallmap.hxx        28 Dec 2002 16:57:38 -0000      1.15
+++ smallmap.hxx        19 Feb 2003 10:37:31 -0000      1.16
@@ -86,7 +86,7 @@
   GraphicContext* gc_ptr;
 
 public:
-  SmallMap();
+  SmallMap(Client* c);
   virtual ~SmallMap();
 
   /*{ @name Stuff called from the GUIManager */

Index: time_display.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/time_display.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- time_display.cxx    28 Nov 2002 18:05:40 -0000      1.11
+++ time_display.cxx    19 Feb 2003 10:37:31 -0000      1.12
@@ -25,11 +25,13 @@
 #include "pingus_resource.hxx"
 #include "time_display.hxx"
 #include "world.hxx"
-#include "server.hxx"
+#include "true_server.hxx"
+#include "client.hxx"
 #include "plf.hxx"
 
-TimeDisplay::TimeDisplay ()
-  : infinity_symbol(PingusResource::load_surface("misc/infinity", "core"))
+TimeDisplay::TimeDisplay (Client* c)
+  : server(c->get_server()),
+    infinity_symbol(PingusResource::load_surface("misc/infinity", "core"))
 {
   //font = PingusResource::load_font("Fonts/numbers","fonts");
   //font = PingusResource::load_font("Fonts/pingus_small","fonts");
@@ -73,13 +75,6 @@
     }
 
   UNUSED_ARG(gc);
-}
-
-void
-TimeDisplay::set_server(Server* s)
-{
-  assert(s);
-  server = s;
 }
 
 /* EOF */

Index: time_display.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/time_display.hxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- time_display.hxx    28 Dec 2002 16:57:38 -0000      1.9
+++ time_display.hxx    19 Feb 2003 10:37:31 -0000      1.10
@@ -25,6 +25,7 @@
 
 class CL_Font;
 class Server;
+class Client;
 
 class TimeDisplay : public GUI::Component
 {
@@ -34,11 +35,10 @@
   CL_Surface infinity_symbol;
   
 public:
-  TimeDisplay();
+  TimeDisplay(Client* c);
   virtual ~TimeDisplay() {}
 
   void draw(GraphicContext& gc);
-  void set_server(Server*);
   
 private:
   TimeDisplay (const TimeDisplay&);

Index: world.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/world.cxx,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- world.cxx   18 Feb 2003 15:04:47 -0000      1.37
+++ world.cxx   19 Feb 2003 10:37:31 -0000      1.38
@@ -65,6 +65,9 @@
     colmap(gfx_map->get_colmap()),
     view(0)
 { 
+  start_x_pos = plf->get_startx();
+  start_y_pos = plf->get_starty();
+
   // Not perfect, but works
   WorldObj::set_world(this);
 

Index: world.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/world.hxx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- world.hxx   25 Jan 2003 18:34:36 -0000      1.23
+++ world.hxx   19 Feb 2003 10:37:31 -0000      1.24
@@ -59,6 +59,11 @@
 class World
 {
 private:
+  /** Start x-position of the camera */
+  int  start_x_pos;
+  /** Start y-position of the camera */
+  int  start_y_pos;
+
   /** groundmap for the pingus */
   PinguMap* gfx_map;
 
@@ -165,6 +170,8 @@
   /** Return a pointer to the GameTime object of this World */
   GameTime* get_game_time ();
   
+  int get_start_x() const { return start_x_pos; }
+  int get_start_y() const { return start_y_pos; }
 private:
   World (const World&);
   World& operator= (const World&);





reply via email to

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