pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src ButtonPanel.cc,1.29,1.30 ButtonPanel.


From: grumbel
Subject: [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
Date: 9 Jun 2002 20:59:46 -0000

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

Modified Files:
        ButtonPanel.cc ButtonPanel.hh Client.cc Client.hh 
        Controllable.cc Controllable.hh Cursor.cc Cursor.hh 
        MultiplayerClientChild.cc MultiplayerClientChild.hh 
        MultiplayerGame.cc PingusGameSession.cc PingusGameSession.hh 
        PingusLevelDesc.cc PingusLevelDesc.hh PingusLevelResult.cc 
        PingusLevelResult.hh PingusMenu.hh Playfield.cc Playfield.hh 
        View.cc View.hh 
Log Message:
replaced shared_ptr<Controller> with Controller*

Index: ButtonPanel.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/ButtonPanel.cc,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- ButtonPanel.cc      8 Jun 2002 23:11:07 -0000       1.29
+++ ButtonPanel.cc      9 Jun 2002 20:59:43 -0000       1.30
@@ -31,7 +31,7 @@
 CL_Surface ButtonPanel::button_cap;
 
 ButtonPanel::ButtonPanel(PLF* plf,
-                        boost::shared_ptr<Controller> arg_controller,
+                        Controller* arg_controller,
                         int arg_x_pos, int arg_y_pos)
   : controller (arg_controller),
     x_pos (arg_x_pos), y_pos (arg_y_pos)

Index: ButtonPanel.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/ButtonPanel.hh,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- ButtonPanel.hh      7 Jun 2002 19:10:33 -0000       1.15
+++ ButtonPanel.hh      9 Jun 2002 20:59:43 -0000       1.16
@@ -54,12 +54,11 @@
   static CL_Surface button_cap;
   World* world;
 
-  boost::shared_ptr<Controller> controller;
+  Controller* controller;
 
   int x_pos, y_pos;
 public:
-  ButtonPanel(PLF* plf,
-             boost::shared_ptr<Controller>,int arg_x_pos, int arg_y_pos);
+  ButtonPanel(PLF* plf, Controller*, int arg_x_pos, int arg_y_pos);
   ~ButtonPanel();
 
   void on_button_press(const CL_Key& key);

Index: Client.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Client.cc,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- Client.cc   8 Jun 2002 23:11:07 -0000       1.82
+++ Client.cc   9 Jun 2002 20:59:43 -0000       1.83
@@ -46,7 +46,7 @@
 
 using boost::shared_ptr;
 
-Client::Client(boost::shared_ptr<Controller> arg_controller, Server * s)
+Client::Client(Controller* arg_controller, Server * s)
   : controller (arg_controller),
     cursor (new Cursor ("cursors/animcross", "core", controller))
 {
@@ -65,14 +65,14 @@
   time_display = 0;
   hurry_up = 0;
  
-  Display::add_flip_screen_hook(cursor.get ());
+  Display::add_flip_screen_hook(cursor);
   //Display::add_flip_screen_hook(new Cursor ("cursors/cursor", "core", 
boost::shared_ptr<Controller>(new MouseController ())));
 }
 
 Client::~Client()
 {
   //std::cout << "Client:~Client" << std::endl;
-  Display::remove_flip_screen_hook(cursor.get ());
+  Display::remove_flip_screen_hook(cursor);
   deinit_display();
 
   delete playfield;    
@@ -81,6 +81,7 @@
   delete small_map;
   delete time_display;
   delete hurry_up;
+  delete cursor;
 }
 
 void

Index: Client.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Client.hh,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- Client.hh   8 Jun 2002 18:39:57 -0000       1.38
+++ Client.hh   9 Jun 2002 20:59:43 -0000       1.39
@@ -66,8 +66,8 @@
   SmallMap*      small_map;
   HurryUp*       hurry_up;
 
-  boost::shared_ptr<Controller> controller;
-  boost::shared_ptr<Cursor>     cursor;
+  Controller* controller;
+  Cursor*     cursor;
 
   CL_Slot on_button_press_slot;
   CL_Slot on_button_release_slot;
@@ -88,7 +88,7 @@
   
   bool enabled;
 public:
-  Client(boost::shared_ptr<Controller> arg_controller, Server * s);
+  Client(Controller* arg_controller, Server * s);
   virtual ~Client();
 
   Server* get_server() { return server; }

Index: Controllable.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Controllable.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Controllable.cc     22 Dec 2001 15:15:09 -0000      1.5
+++ Controllable.cc     9 Jun 2002 20:59:43 -0000       1.6
@@ -19,7 +19,7 @@
 
 #include "Controllable.hh"
 
-Controllable::Controllable (boost::shared_ptr<Controller> arg_controller)
+Controllable::Controllable (Controller* arg_controller)
   : controller (arg_controller)
 {
   //std::cout << "Basic buttons..." << std::endl;

Index: Controllable.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Controllable.hh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Controllable.hh     8 Jun 2002 23:11:07 -0000       1.5
+++ Controllable.hh     9 Jun 2002 20:59:43 -0000       1.6
@@ -57,9 +57,9 @@
   CL_Slot next_action_release_slot;
   CL_Slot previous_action_release_slot;
 
-  boost::shared_ptr<Controller> controller;
+  Controller* controller;
 public:
-  Controllable (boost::shared_ptr<Controller> arg_controller);
+  Controllable (Controller* arg_controller);
   virtual ~Controllable ();
 
   void wrapper_on_left_press (const CL_Vector& pos) { on_left_press (pos); }

Index: Cursor.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Cursor.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Cursor.cc   14 Jan 2002 23:37:59 -0000      1.4
+++ Cursor.cc   9 Jun 2002 20:59:43 -0000       1.5
@@ -20,7 +20,7 @@
 #include "Cursor.hh"
 
 Cursor::Cursor (std::string ident, std::string datafile,
-               boost::shared_ptr<Controller> arg_controller)
+               Controller* arg_controller)
   : sprite (ident, datafile, 15.0f),
     controller (arg_controller)
 {

Index: Cursor.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Cursor.hh,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Cursor.hh   8 Jun 2002 23:11:07 -0000       1.6
+++ Cursor.hh   9 Jun 2002 20:59:43 -0000       1.7
@@ -32,10 +32,10 @@
 {
 private:
   Sprite sprite;
-  boost::shared_ptr<Controller> controller;
+  Controller* controller;
   
 public:
-  Cursor (std::string ident, std::string datafile, 
boost::shared_ptr<Controller>);
+  Cursor (std::string ident, std::string datafile, Controller*);
   virtual ~Cursor ();
   
   virtual void update (float delta);

Index: MultiplayerClientChild.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/MultiplayerClientChild.cc,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- MultiplayerClientChild.cc   8 Jun 2002 23:11:07 -0000       1.12
+++ MultiplayerClientChild.cc   9 Jun 2002 20:59:43 -0000       1.13
@@ -21,8 +21,8 @@
 
 using boost::shared_ptr;
 
-MultiplayerClientChild::MultiplayerClientChild (boost::shared_ptr<Controller> 
arg_controller,
-                                       Server * s, const CL_Rect& arg_rect)
+MultiplayerClientChild::MultiplayerClientChild (Controller* arg_controller,
+                                               Server * s, const CL_Rect& 
arg_rect)
   : Controllable (arg_controller),
     server (s),
     cursor (new Cursor ("cursors/cross", "core", controller)),

Index: MultiplayerClientChild.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/MultiplayerClientChild.hh,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- MultiplayerClientChild.hh   8 Jun 2002 23:11:07 -0000       1.8
+++ MultiplayerClientChild.hh   9 Jun 2002 20:59:43 -0000       1.9
@@ -48,7 +48,7 @@
   CL_Vector scroll_vec;
 
 public:
-  MultiplayerClientChild (boost::shared_ptr<Controller> arg_controller, 
+  MultiplayerClientChild (Controller* arg_controller, 
                          Server * s, const CL_Rect& arg_rect);
   ~MultiplayerClientChild ();
 

Index: MultiplayerGame.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/MultiplayerGame.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- MultiplayerGame.cc  8 Jun 2002 23:11:07 -0000       1.8
+++ MultiplayerGame.cc  9 Jun 2002 20:59:43 -0000       1.9
@@ -72,12 +72,12 @@
        client = shared_ptr<MultiplayerClient> 
          (new MultiplayerClient 
           (server.get (),
-           shared_ptr<GuiObj>(new MultiplayerClientChild (controller1,
+           shared_ptr<GuiObj>(new MultiplayerClientChild (controller1.get(),
                                                           server.get (),
                                                           CL_Rect (0,0, 
                                                                    
CL_Display::get_width ()/2-2,
                                                                    
CL_Display::get_height ()))),
-           shared_ptr<GuiObj>(new MultiplayerClientChild (controller2,
+           shared_ptr<GuiObj>(new MultiplayerClientChild (controller2.get(),
                                                           server.get (),
                                                           CL_Rect 
(CL_Display::get_width ()/2, 0,
                                                                    
CL_Display::get_width (), 
@@ -88,25 +88,25 @@
        client = shared_ptr<MultiplayerClient> 
          (new MultiplayerClient 
           (server.get (),
-           shared_ptr<GuiObj>(new MultiplayerClientChild (controller1,
+           shared_ptr<GuiObj>(new MultiplayerClientChild (controller1.get(),
                                                           server.get (),
                                                           CL_Rect (0,
                                                                    0, 
                                                                    
CL_Display::get_width ()/2 - 4,
                                                                    
CL_Display::get_height ()/2 - 4))),
-           shared_ptr<GuiObj>(new MultiplayerClientChild (controller2,
+           shared_ptr<GuiObj>(new MultiplayerClientChild (controller2.get(),
                                                           server.get (),
                                                           CL_Rect 
(CL_Display::get_width ()/2 + 4,
                                                                    0,
                                                                    
CL_Display::get_width (), 
                                                                    
CL_Display::get_height ()/2 - 4))),
-           shared_ptr<GuiObj>(new MultiplayerClientChild (controller3,
+           shared_ptr<GuiObj>(new MultiplayerClientChild (controller3.get(),
                                                           server.get (),
                                                           CL_Rect (0,
                                                                    
CL_Display::get_height ()/2 + 4,
                                                                    
CL_Display::get_width ()/2 - 4, 
                                                                    
CL_Display::get_height ()))),
-           shared_ptr<GuiObj>(new MultiplayerClientChild (controller4,
+           shared_ptr<GuiObj>(new MultiplayerClientChild (controller4.get(),
                                                           server.get (),
                                                           CL_Rect 
(CL_Display::get_width ()/2 + 4,
                                                                    
CL_Display::get_height ()/2 + 4,

Index: PingusGameSession.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PingusGameSession.cc,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- PingusGameSession.cc        9 Jun 2002 13:03:11 -0000       1.15
+++ PingusGameSession.cc        9 Jun 2002 20:59:43 -0000       1.16
@@ -28,10 +28,10 @@
 
 PingusGameSession::PingusGameSession (std::string arg_filename)
   : filename (arg_filename),
+    controller (new MouseController ()),
     plf(PLF::create (filename)),
     server (new TrueServer (plf)),
-    client (new Client(shared_ptr<Controller>(new MouseController ()), 
-                      server))
+    client (new Client(controller, server))
 {
 }
 
@@ -40,6 +40,7 @@
   delete client;
   delete server;
   delete plf;
+  delete controller;
 }
 
 void 

Index: PingusGameSession.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PingusGameSession.hh,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- PingusGameSession.hh        8 Jun 2002 20:19:53 -0000       1.9
+++ PingusGameSession.hh        9 Jun 2002 20:59:43 -0000       1.10
@@ -25,6 +25,7 @@
 class Client;
 class Server;
 class PLF;
+class Controller;
 class PingusGameSessionResult;
 
 /** You can use this class to start up a game session, which consist
@@ -34,6 +35,8 @@
 private:
   /// The filename of the level
   std::string filename;
+
+  Controller* controller;
 
   /// The level data
   PLF* plf;

Index: PingusLevelDesc.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PingusLevelDesc.cc,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- PingusLevelDesc.cc  8 Jun 2002 23:11:07 -0000       1.27
+++ PingusLevelDesc.cc  9 Jun 2002 20:59:43 -0000       1.28
@@ -32,7 +32,7 @@
 
 
 PingusLevelDesc::PingusLevelDesc(PLF* arg_plf,
-                                boost::shared_ptr<Controller> arg_controller)
+                                Controller* arg_controller)
   : controller (arg_controller)
 {
   plf = arg_plf;

Index: PingusLevelDesc.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PingusLevelDesc.hh,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- PingusLevelDesc.hh  8 Jun 2002 23:11:07 -0000       1.12
+++ PingusLevelDesc.hh  9 Jun 2002 20:59:43 -0000       1.13
@@ -35,11 +35,11 @@
   PLF* plf;
   
   MultiLineText description;
-  boost::shared_ptr<Controller> controller;
+  Controller* controller;
   std::string         levelname;
 public:
   enum LoadingStatus { LOADING, FINISHED };
-  PingusLevelDesc(PLF*,  boost::shared_ptr<Controller>);
+  PingusLevelDesc(PLF*, Controller*);
   
   void draw(PingusLevelDesc::LoadingStatus status);
 };

Index: PingusLevelResult.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PingusLevelResult.cc,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- PingusLevelResult.cc        8 Jun 2002 23:11:07 -0000       1.26
+++ PingusLevelResult.cc        9 Jun 2002 20:59:43 -0000       1.27
@@ -31,7 +31,7 @@
 #include "my_gettext.hh"
 
 
-PingusLevelResult::PingusLevelResult(World* w, boost::shared_ptr<Controller> c)
+PingusLevelResult::PingusLevelResult(World* w, Controller* c)
   : controller (c)
 {
   font = PingusResource::load_font("Fonts/pingus_small","fonts");

Index: PingusLevelResult.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PingusLevelResult.hh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- PingusLevelResult.hh        13 Apr 2001 14:50:59 -0000      1.7
+++ PingusLevelResult.hh        9 Jun 2002 20:59:43 -0000       1.8
@@ -27,26 +27,18 @@
 class PingusLevelResult
 {
 private:
-  ///
   CL_Surface background;
-  ///
   CL_Font*    title;
-  ///
   CL_Font*    font;
-  ///
   World*      world;
-  boost::shared_ptr<Controller> controller;
+  Controller* controller;
 
 public:
-  ///
-  PingusLevelResult(World*, boost::shared_ptr<Controller> c);
+  PingusLevelResult(World*, Controller* c);
 
-  ///
   void   draw(void);
-  ///
   std::string get_message(int);
-}///
-;
+};
 
 #endif
 

Index: PingusMenu.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/PingusMenu.hh,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- PingusMenu.hh       8 Jun 2002 23:11:08 -0000       1.22
+++ PingusMenu.hh       9 Jun 2002 20:59:43 -0000       1.23
@@ -50,25 +50,20 @@
   
   void on_resize(int w, int h);
 public:
-  ///
   PingusMenu(PingusMenuManager* m);
-  ///
   ~PingusMenu();
+
   /// Load all images and other stuff for the menu
   void preload ();
-  ////
+
   void update (float /*delta*/) {}
-  ///
   void draw(void);
-  ///
+
   void select(void);
-  ///
   bool event_enabled;
-  ///
+
   void on_button_press(CL_InputDevice *device, const CL_Key &key);
-  ///
   void on_button_release(CL_InputDevice *device, const CL_Key &key);
-  ///
   void on_mouse_move(CL_InputDevice *,int mouse_x, int mouse_y);
 };
 

Index: Playfield.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Playfield.cc,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- Playfield.cc        8 Jun 2002 23:11:08 -0000       1.36
+++ Playfield.cc        9 Jun 2002 20:59:43 -0000       1.37
@@ -21,6 +21,7 @@
 #include <cstdio>
 #include <cassert>
 
+#include "Controller.hh"
 #include "algo.hh"
 #include "globals.hh"
 #include "Playfield.hh"
@@ -35,7 +36,7 @@
 using boost::shared_ptr;
 
 Playfield::Playfield(PLF* level_data, World* w,
-                    boost::shared_ptr<Controller> arg_controller)
+                    Controller* arg_controller)
   : controller (arg_controller)
 {
   world = w;

Index: Playfield.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Playfield.hh,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- Playfield.hh        8 Jun 2002 23:11:08 -0000       1.26
+++ Playfield.hh        9 Jun 2002 20:59:43 -0000       1.27
@@ -23,7 +23,6 @@
 #include "ButtonPanel.hh"
 #include "View.hh"
 #include "Client.hh"
-#include "Controller.hh"
 
 class Pingu;
 class World;
@@ -31,6 +30,7 @@
 class PinguInfo;
 class PinguHolder;
 class ButtonPanel;
+class Controller;
 
 ///
 class Playfield : public GuiObj
@@ -70,10 +70,10 @@
 
   std::vector<Rect> clipping_rectangles;
 
-  boost::shared_ptr<Controller> controller;
+  Controller* controller;
 public:
   Playfield(PLF* plf, World*,
-           boost::shared_ptr<Controller>);
+           Controller*);
   ~Playfield();
 
   int get_x_offset();

Index: View.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/View.cc,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- View.cc     9 Jun 2002 14:04:10 -0000       1.20
+++ View.cc     9 Jun 2002 20:59:43 -0000       1.21
@@ -50,6 +50,12 @@
   make_range();
 }
 
+View::~View()
+{
+  //FIXME: This is dangerous and might cause throuble when the code is 
reordered
+  delete controller;
+}
+
 void
 View::draw()
 {
@@ -81,10 +87,6 @@
                  size);
   
   CL_Display::pop_clip_rect();
-}
-
-View::~View()
-{
 }
 
 void

Index: View.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/View.hh,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- View.hh     8 Jun 2002 21:43:36 -0000       1.12
+++ View.hh     9 Jun 2002 20:59:43 -0000       1.13
@@ -48,7 +48,7 @@
 
   ///
   void make_range();
-  boost::shared_ptr<Controller> controller;
+  Controller* controller;
 public:
   /** @name The position of the View.
       




reply via email to

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