pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src multiplayer_client.cxx,1.1,1.2 multip


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src multiplayer_client.cxx,1.1,1.2 multiplayer_client.hxx,1.1,1.2 multiplayer_game.cxx,1.1,1.2 xml_plf.cxx,1.1,1.2
Date: 13 Jun 2002 10:49:09 -0000

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

Modified Files:
        multiplayer_client.cxx multiplayer_client.hxx 
        multiplayer_game.cxx xml_plf.cxx 
Log Message:
removed some more shared_ptr<>


Index: multiplayer_client.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/multiplayer_client.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- multiplayer_client.cxx      12 Jun 2002 19:09:37 -0000      1.1
+++ multiplayer_client.cxx      13 Jun 2002 10:49:06 -0000      1.2
@@ -21,31 +21,28 @@
 #include "smallmap_image.hxx"
 #include "multiplayer_client.hxx"
 
-using boost::shared_ptr;
-
 MultiplayerClient::MultiplayerClient (Server * s,
-                                     boost::shared_ptr<GuiObj> child1,
-                                     boost::shared_ptr<GuiObj> child2,
-                                     boost::shared_ptr<GuiObj> child3,
-                                     boost::shared_ptr<GuiObj> child4)
-  : server (s)
+                                     GuiObj* child1,
+                                     GuiObj* child2,
+                                     GuiObj* child3,
+                                     GuiObj* child4)
+  : gui_objs(5), server (s)
 {
-  gui_objs.push_back (child1);
-  gui_objs.push_back (child2);
-  gui_objs.push_back (child3);
-  gui_objs.push_back (child4);
-  gui_objs.push_back (shared_ptr<GuiObj> (new SmallMapImage (s, CL_Vector 
(CL_Display::get_width ()/2 - 100,
-                                                                          
CL_Display::get_height ()/2 - 75), 
-                                                            200, 150)));
+  gui_objs[0] = child1;
+  gui_objs[1] = child2;
+  gui_objs[2] = child3;
+  gui_objs[3] = child4;
+  gui_objs[4] = new SmallMapImage (s, CL_Vector (CL_Display::get_width ()/2 - 
100,
+                                  CL_Display::get_height ()/2 - 75), 200, 150);
 }
 
 MultiplayerClient::MultiplayerClient (Server * s,
-                                     boost::shared_ptr<GuiObj> child1,
-                                     boost::shared_ptr<GuiObj> child2)
-  : server (s)
+                                     GuiObj* child1,
+                                     GuiObj* child2)
+  : gui_objs(2), server (s)
 {
-  gui_objs.push_back (child1);
-  gui_objs.push_back (child2);
+  gui_objs[0] = child1;
+  gui_objs[1] = child2;
 }
 
 MultiplayerClient::~MultiplayerClient ()

Index: multiplayer_client.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/multiplayer_client.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- multiplayer_client.hxx      12 Jun 2002 19:09:37 -0000      1.1
+++ multiplayer_client.hxx      13 Jun 2002 10:49:06 -0000      1.2
@@ -21,26 +21,25 @@
 #define MULTIPLAYERCLIENT_HH
 
 #include "gui_obj.hxx"
-#include "boost/smart_ptr.hpp"
 
 class Server;
 
 class MultiplayerClient : public GuiObj
 {
 private:
-  std::vector<boost::shared_ptr<GuiObj> > gui_objs;
-  typedef std::vector<boost::shared_ptr<GuiObj> >::iterator GuiObjIter;
+  std::vector<GuiObj*> gui_objs;
+  typedef std::vector<GuiObj*>::iterator GuiObjIter;
   Server * server;
     
 public:
   MultiplayerClient (Server * s,
-                    boost::shared_ptr<GuiObj> child1,
-                    boost::shared_ptr<GuiObj> child2);
+                    GuiObj* child1,
+                    GuiObj* child2);
   MultiplayerClient (Server * s,
-                    boost::shared_ptr<GuiObj> child1,
-                    boost::shared_ptr<GuiObj> child2,
-                    boost::shared_ptr<GuiObj> child3,
-                    boost::shared_ptr<GuiObj> child4);
+                    GuiObj* child1,
+                    GuiObj* child2,
+                    GuiObj* child3,
+                    GuiObj* child4);
   ~MultiplayerClient ();
 
   void update (float delta);

Index: multiplayer_game.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/multiplayer_game.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- multiplayer_game.cxx        12 Jun 2002 19:09:37 -0000      1.1
+++ multiplayer_game.cxx        13 Jun 2002 10:49:06 -0000      1.2
@@ -30,8 +30,6 @@
 #include "multiplayer_game.hxx"
 #include "multiplayer_client_child.hxx"
 
-using boost::shared_ptr;
-
 MultiplayerGame::MultiplayerGame ()
 {
 }
@@ -46,7 +44,7 @@
   std::cout << "Starting Multiplayer Game" << std::endl;
   try {
     PLF* plf = new XMLPLF (path_manager.complete("levels/multi2-grumbel.xml"));
-    shared_ptr<Server>     server (new TrueServer (plf));
+    std::auto_ptr<Server>     server (new TrueServer (plf));
     std::auto_ptr<Controller> controller1;
     std::auto_ptr<Controller> controller2;
     std::auto_ptr<Controller> controller3;
@@ -69,54 +67,62 @@
 
     controller4 = std::auto_ptr<Controller>(new MouseController (3));
 
-    shared_ptr<MultiplayerClient> client;
+    std::auto_ptr<MultiplayerClient> client;
     int player = 2;
     if (player == 2)
       {
-       client = shared_ptr<MultiplayerClient> 
-         (new MultiplayerClient 
-          (server.get (),
-           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.get(),
-                                                          server.get (),
-                                                          CL_Rect 
(CL_Display::get_width ()/2, 0,
-                                                                   
CL_Display::get_width (), 
-                                                                   
CL_Display::get_height ())))));
+       client = new MultiplayerClient (server.get (),
+                                        new MultiplayerClientChild 
(controller1.get(),
+                                                                   server.get 
(),
+                                                                   CL_Rect 
(0,0, 
+                                                                            
CL_Display::get_width ()/2-2,
+                                                                             
CL_Display::get_height ()
+                                                                            )
+                                                                   ),
+                                        new MultiplayerClientChild 
(controller2.get(),
+                                                                   server.get 
(),
+                                                                    CL_Rect 
(CL_Display::get_width ()/2, 0,
+                                                                             
CL_Display::get_width (), 
+                                                                             
CL_Display::get_height ()
+                                                                            )
+                                                                   )
+                                       );
       }
     else
       {
-       client = shared_ptr<MultiplayerClient> 
-         (new MultiplayerClient 
-          (server.get (),
-           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.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.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.get(),
-                                                          server.get (),
-                                                          CL_Rect 
(CL_Display::get_width ()/2 + 4,
-                                                                   
CL_Display::get_height ()/2 + 4,
-                                                                   
CL_Display::get_width (), 
-                                                                   
CL_Display::get_height ())))
-           ));
+       client = new MultiplayerClient (server.get (),
+                                        new MultiplayerClientChild 
(controller1.get(),
+                                                                   server.get 
(),
+                                                                   CL_Rect (0,
+                                                                            0,
+                                                                            
CL_Display::get_width  ()/2 - 4,
+                                                                            
CL_Display::get_height ()/2 - 4)
+                                                                           ),
+                                       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
+                                                                           )
+                                                                  ),
+                                        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 ()
+                                                                           )
+                                                                  ),
+                                       new MultiplayerClientChild 
(controller4.get(),
+                                                                   server.get 
(),
+                                                                   CL_Rect 
(CL_Display::get_width ()/2 + 4,
+                                                                            
CL_Display::get_height ()/2 + 4,
+                                                                            
CL_Display::get_width (),
+                                                                            
CL_Display::get_height ()
+                                                                           )
+                                                                  )
+                                      );
       }
 
     DeltaManager delta_manager;

Index: xml_plf.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_plf.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- xml_plf.cxx 12 Jun 2002 19:09:38 -0000      1.1
+++ xml_plf.cxx 13 Jun 2002 10:49:06 -0000      1.2
@@ -276,7 +276,6 @@
 {
   // The allocated objects are delete'd in the destructor
   //FIXME: Repair me backgrounds.push_back(BackgroundData::create (doc, cur));
-  //boost::shared_ptr<WorldObjData> data;
   char* type_cstr = (char*)xmlGetProp(cur, (xmlChar*)"type");
 
   if (type_cstr != 0)




reply via email to

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