pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src ActionButton.cc,1.34,1.35 ActionButto


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src ActionButton.cc,1.34,1.35 ActionButton.hh,1.23,1.24 ActionData.hh,1.3,1.4 AlphaButton.cc,1.6,1.7 AnimCounter.cc,1.4,1.5 ButtonPanel.cc,1.33,1.34 Client.cc,1.86,1.87
Date: 11 Jun 2002 09:55:15 -0000

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

Modified Files:
        ActionButton.cc ActionButton.hh ActionData.hh AlphaButton.cc 
        AnimCounter.cc ButtonPanel.cc Client.cc 
Log Message:
moved member initialization from constructor body into initialization list


Index: ActionButton.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/ActionButton.cc,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- ActionButton.cc     10 Jun 2002 15:01:23 -0000      1.34
+++ ActionButton.cc     11 Jun 2002 09:55:12 -0000      1.35
@@ -33,15 +33,17 @@
 {
 }
 
-Button::~Button()
+Button::Button (int x, int y) : x_pos(x), y_pos(y)
 {
 }
 
-EventButton::EventButton(int x, int y, std::string str)
+Button::~Button()
 {
+}
+
+EventButton::EventButton(int x, int y, std::string str) : Button(x, y) 
+{ 
   surface = PingusResource::load_surface(str, "global");
-  x_pos = x;
-  y_pos = y;
 }
 
 EventButton::~EventButton() {}
@@ -73,6 +75,7 @@
 }
 
 ActionButton::ActionButton() {}
+
 ActionButton::~ActionButton() {}
 
 void
@@ -144,8 +147,8 @@
   action_holder = h;
 }
 
-VerticalActionButton::VerticalActionButton(int x, int y, std::string str, int 
owner_id)
-  : background (PingusResource::load_surface("buttons/buttonbackground", 
"core")),
+VerticalActionButton::VerticalActionButton(int x, int y, std::string str, int 
owner_id) :
+    background (PingusResource::load_surface("buttons/buttonbackground", 
"core")),
     backgroundhl (PingusResource::load_surface("buttons/buttonbackgroundhl", 
"core"))
 {
   init(x, y, str, owner_id);
@@ -219,18 +222,15 @@
                     action_c);
 }
 
-ArmageddonButton::ArmageddonButton(int x, int y) 
+ArmageddonButton::ArmageddonButton(int x, int y) : 
+        Button      (x, y),
+        background  (PingusResource::load_surface("buttons/hbuttonbgb", 
"core")),
+        backgroundhl(PingusResource::load_surface("buttons/hbuttonbg", "core"))
 {
-  surface = PingusResource::load_surface("buttons/armageddon_anim", "core");
-
-  background = PingusResource::load_surface("buttons/hbuttonbgb", "core");
-  backgroundhl = PingusResource::load_surface("buttons/hbuttonbg", "core");
-
+  pressed      = false;
+  surface      = PingusResource::load_surface("buttons/armageddon_anim", 
"core");
   counter.set_size(surface.get_num_frames());
   counter = 0;
-  x_pos = x;
-  y_pos = y;
-  pressed = false;
 }
 
 ArmageddonButton::~ArmageddonButton() { }
@@ -262,14 +262,12 @@
     } 
 }
 
-ForwardButton::ForwardButton(int x, int y)
-{
+ForwardButton::ForwardButton(int x, int y) :
+        Button      (x, y),
+        background  (PingusResource::load_surface("buttons/hbuttonbgb", 
"core")),
+        backgroundhl(PingusResource::load_surface("buttons/hbuttonbg", "core"))
+{ 
   surface = PingusResource::load_surface("buttons/fast_forward", "core");
-  background = PingusResource::load_surface("buttons/hbuttonbgb", "core");
-  backgroundhl = PingusResource::load_surface("buttons/hbuttonbg", "core");
-
-  x_pos = x;
-  y_pos = y;
 }
 
 ForwardButton::~ForwardButton() {}
@@ -297,15 +295,12 @@
     } 
 }
 
-PauseButton::PauseButton(int x, int y)
-{
+PauseButton::PauseButton(int x, int y) :
+        Button      (x, y),
+        background  (PingusResource::load_surface("buttons/hbuttonbgb", 
"core")),
+        backgroundhl(PingusResource::load_surface("buttons/hbuttonbg", "core"))
+{ 
   surface = PingusResource::load_surface("buttons/pause", "core");
-
-  background = PingusResource::load_surface("buttons/hbuttonbgb", "core");
-  backgroundhl = PingusResource::load_surface("buttons/hbuttonbg", "core");
-
-  x_pos = x;
-  y_pos = y;
 }
 
 PauseButton::~PauseButton() {}

Index: ActionButton.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/ActionButton.hh,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- ActionButton.hh     10 Jun 2002 11:00:25 -0000      1.23
+++ ActionButton.hh     11 Jun 2002 09:55:12 -0000      1.24
@@ -45,6 +45,8 @@
 public:
   ///
   Button();
+  
+  Button (int x, int y);
   ///
   virtual ~Button();
 

Index: ActionData.hh
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/ActionData.hh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ActionData.hh       10 Jun 2002 13:03:34 -0000      1.3
+++ ActionData.hh       11 Jun 2002 09:55:12 -0000      1.4
@@ -30,10 +30,8 @@
   ActionData() {}
 
   ///
-  ActionData(const std::string& str, int i) 
+  ActionData(const std::string& str, int i) : name(str), number_of(i)
   {
-    name = str;
-    number_of = i;
   }
 
   ///

Index: AlphaButton.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/AlphaButton.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- AlphaButton.cc      10 Jun 2002 11:00:25 -0000      1.6
+++ AlphaButton.cc      11 Jun 2002 09:55:12 -0000      1.7
@@ -24,16 +24,15 @@
 
 #include "AlphaButton.hh"
 
-AlphaButton::AlphaButton(std::string str, int x1, int y1, int w, int h)
+AlphaButton::AlphaButton(std::string str, int x1, int y1, int w, int h) :
+    font  (PingusResource::load_font("Fonts/smallfont_h", "fonts")),
+    font_h(PingusResource::load_font("Fonts/smallfont", "fonts")),
+    name  (str),
+    x1_pos(x1),
+    y1_pos(y1),
+    x2_pos(x1 + w - 1),
+    y2_pos(y1 + h - 1)
 {
-  name = str;
-  x1_pos = x1;
-  y1_pos = y1;
-  x2_pos = x1 + w - 1;
-  y2_pos = y1 + h - 1;
- 
-  font_h = PingusResource::load_font("Fonts/smallfont", "fonts");
-  font   = PingusResource::load_font("Fonts/smallfont_h", "fonts");
 }
 
 void

Index: AnimCounter.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/AnimCounter.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- AnimCounter.cc      10 Jun 2002 11:00:25 -0000      1.4
+++ AnimCounter.cc      11 Jun 2002 09:55:12 -0000      1.5
@@ -20,16 +20,12 @@
 #include "AnimCounter.hh"
 #include <ClanLib/Core/System/system.h>
 
-AnimCounter::AnimCounter()
+AnimCounter::AnimCounter() : last_time(0), speed(100)
 {
-  speed = 100;
-  last_time = 0;
 }
 
-AnimCounter::AnimCounter(int s)
+AnimCounter::AnimCounter(int s) : last_time(0), speed(s)
 {
-  last_time = 0;
-  speed = s;
 }
 
 bool 

Index: ButtonPanel.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/ButtonPanel.cc,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- ButtonPanel.cc      10 Jun 2002 15:01:23 -0000      1.33
+++ ButtonPanel.cc      11 Jun 2002 09:55:12 -0000      1.34
@@ -33,13 +33,13 @@
 using boost::shared_ptr;
 CL_Surface ButtonPanel::button_cap;
 
-ButtonPanel::ButtonPanel(PLF* plf,
-                        Controller* arg_controller,
-                        int arg_x_pos, int arg_y_pos)
-  : controller (arg_controller),
-    x_pos (arg_x_pos), y_pos (arg_y_pos)
+ButtonPanel::ButtonPanel(PLF* plf, Controller* arg_controller,
+                                        int arg_x_pos, int arg_y_pos)
+  : last_press(0),
+    controller (arg_controller),
+    x_pos (arg_x_pos), 
+    y_pos (arg_y_pos)
 {
-  last_press = 0;
 
   std::vector<ActionData> buttons_data = plf->get_actions();
 

Index: Client.cc
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Client.cc,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- Client.cc   10 Jun 2002 15:01:23 -0000      1.86
+++ Client.cc   11 Jun 2002 09:55:12 -0000      1.87
@@ -51,23 +51,26 @@
 using boost::shared_ptr;
 
 Client::Client(Controller* arg_controller, Server * s)
-  : controller (arg_controller),
-    cursor (new Cursor ("cursors/animcross", "core", controller))
+  : // plf ?
+    // result ?
+    server       (s),
+    fast_forward (false),
+    pause        (false),
+    skip_frame   (0),
+    do_replay    (false),
+    is_finished  (false),
+    // obj ?
+    button_panel (0),
+    pcounter     (0),
+    playfield    (0),
+    time_display (0),
+    small_map    (0),
+    hurry_up     (0),
+    controller   (arg_controller),
+    cursor       (new Cursor ("cursors/animcross", "core", controller))
+    // slot_x ?
 {
   //player = 0;
-  server = s;
-  fast_forward = false;
-  pause = false;
-  skip_frame = 0;
-  do_replay = false;
-  is_finished = false;
-
-  playfield = 0;    
-  button_panel = 0;
-  pcounter = 0;
-  small_map = 0;
-  time_display = 0;
-  hurry_up = 0;
  
   Display::add_flip_screen_hook(cursor);
   //Display::add_flip_screen_hook(new Cursor ("cursors/cursor", "core", 
boost::shared_ptr<Controller>(new MouseController ())));




reply via email to

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