pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r4192 - in trunk/pingus/src: editor engine/screen math ping


From: grumbel
Subject: [Pingus-CVS] r4192 - in trunk/pingus/src: editor engine/screen math pingus/screens
Date: Mon, 29 Aug 2011 23:30:23 +0200

Author: grumbel
Date: 2011-08-29 23:30:22 +0200 (Mon, 29 Aug 2011)
New Revision: 4192

Modified:
   trunk/pingus/src/editor/action_properties.cpp
   trunk/pingus/src/editor/editor_screen.cpp
   trunk/pingus/src/editor/file_dialog.cpp
   trunk/pingus/src/editor/level_properties.cpp
   trunk/pingus/src/editor/object_properties.cpp
   trunk/pingus/src/editor/object_selector.cpp
   trunk/pingus/src/engine/screen/screen_manager.hpp
   trunk/pingus/src/math/quad_tree.hpp
   trunk/pingus/src/pingus/screens/demo_session.cpp
   trunk/pingus/src/pingus/screens/level_menu.cpp
   trunk/pingus/src/pingus/screens/option_menu.cpp
Log:
Replaced boost::function, boost::bind with std::function, std::bind


Modified: trunk/pingus/src/editor/action_properties.cpp
===================================================================
--- trunk/pingus/src/editor/action_properties.cpp       2011-08-28 21:17:09 UTC 
(rev 4191)
+++ trunk/pingus/src/editor/action_properties.cpp       2011-08-29 21:30:22 UTC 
(rev 4192)
@@ -16,8 +16,6 @@
 
 #include "editor/action_properties.hpp"
 
-#include <boost/bind.hpp>
-
 #include "editor/checkbox.hpp"
 #include "editor/editor_level.hpp"
 #include "editor/gui_style.hpp"
@@ -82,8 +80,8 @@
   
   action_comps[id] = comp;
 
-  
comp.checkbox->on_change.connect(boost::bind(&ActionProperties::on_checkbox_change,
 this, _1, id));
-  
comp.inputbox->on_change.connect(boost::bind(&ActionProperties::on_inputbox_change,
 this, _1, id));
+  
comp.checkbox->on_change.connect(std::bind(&ActionProperties::on_checkbox_change,
 this, std::placeholders::_1, id));
+  
comp.inputbox->on_change.connect(std::bind(&ActionProperties::on_inputbox_change,
 this, std::placeholders::_1, id));
 
   y_pos += 22;
 }

Modified: trunk/pingus/src/editor/editor_screen.cpp
===================================================================
--- trunk/pingus/src/editor/editor_screen.cpp   2011-08-28 21:17:09 UTC (rev 
4191)
+++ trunk/pingus/src/editor/editor_screen.cpp   2011-08-29 21:30:22 UTC (rev 
4192)
@@ -15,7 +15,6 @@
 //  You should have received a copy of the GNU General Public License
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-#include <boost/bind.hpp>
 #include <iostream>
 
 #include "editor/action_properties.hpp"
@@ -97,7 +96,7 @@
   file_save_dialog->hide();
   gui_manager->add(file_save_dialog);
 
-  
viewport->selection_changed.connect(boost::bind(&ObjectProperties::set_objects, 
object_properties, _1));
+  
viewport->selection_changed.connect(std::bind(&ObjectProperties::set_objects, 
object_properties, std::placeholders::_1));
   viewport->refresh();
 
   update_layout();

Modified: trunk/pingus/src/editor/file_dialog.cpp
===================================================================
--- trunk/pingus/src/editor/file_dialog.cpp     2011-08-28 21:17:09 UTC (rev 
4191)
+++ trunk/pingus/src/editor/file_dialog.cpp     2011-08-29 21:30:22 UTC (rev 
4192)
@@ -14,7 +14,6 @@
 //  You should have received a copy of the GNU General Public License
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-#include <boost/bind.hpp>
 #include <iostream>
 
 #include "editor/button.hpp"
@@ -47,7 +46,7 @@
                                 rect.get_width()-4 - 30, rect.get_height() - 4 
- 35));
   add(file_list);
 
-  file_list->on_click.connect(boost::bind(&FileDialog::load_file, this, _1));
+  file_list->on_click.connect(std::bind(&FileDialog::load_file, this, 
std::placeholders::_1));
 
   Rect file_rect = file_list->get_rect();
   up_button = new Button(Rect(file_rect.right + 2, file_rect.top,
@@ -68,14 +67,14 @@
   cancel_button = new Button(Rect(Vector2i(rect.get_width() - 104 - 104, 
rect.get_height() - 4 - 30),
                                   Size(100, 30)), _("Cancel"));
   
-  up_button->on_click.connect(boost::bind(&FileDialog::on_up, this));
-  down_button->on_click.connect(boost::bind(&FileDialog::on_down, this));
+  up_button->on_click.connect(std::bind(&FileDialog::on_up, this));
+  down_button->on_click.connect(std::bind(&FileDialog::on_down, this));
 
-  datadir_button->on_click.connect(boost::bind(&FileDialog::on_datadir, this));
-  userdir_button->on_click.connect(boost::bind(&FileDialog::on_userdir, this));
+  datadir_button->on_click.connect(std::bind(&FileDialog::on_datadir, this));
+  userdir_button->on_click.connect(std::bind(&FileDialog::on_userdir, this));
 
-  open_button->on_click.connect(boost::bind(&FileDialog::on_open, this));
-  cancel_button->on_click.connect(boost::bind(&FileDialog::on_cancel, this));
+  open_button->on_click.connect(std::bind(&FileDialog::on_open, this));
+  cancel_button->on_click.connect(std::bind(&FileDialog::on_cancel, this));
 
   add(filename_label = new Label(Rect(6, 4+30, 4 + 60, 26+30), 
_("Filename:")));
   add(pathname_label = new Label(Rect(6, 4+60, 4 + 60, 26+60), 
_("Pathname:")));

Modified: trunk/pingus/src/editor/level_properties.cpp
===================================================================
--- trunk/pingus/src/editor/level_properties.cpp        2011-08-28 21:17:09 UTC 
(rev 4191)
+++ trunk/pingus/src/editor/level_properties.cpp        2011-08-29 21:30:22 UTC 
(rev 4192)
@@ -16,7 +16,6 @@
 
 #include "editor/level_properties.hpp"
 
-#include <boost/bind.hpp>
 #include <iostream>
 
 #include "editor/editor_level.hpp"
@@ -82,19 +81,19 @@
   add(new Label   (Rect(Vector2i( 10, y+154), Size( 80, 20)), "Music:"));
   add(music = new Inputbox(Rect(Vector2i(110, y+154), Size(  w, 20))));
 
-  author->on_change.connect(boost::bind(&LevelProperties::on_author_change, 
this, _1));
-  
levelname->on_change.connect(boost::bind(&LevelProperties::on_levelname_change, 
this, _1));
-  
description->on_change.connect(boost::bind(&LevelProperties::on_description_change,
 this, _1));
+  author->on_change.connect(std::bind(&LevelProperties::on_author_change, 
this, std::placeholders::_1));
+  
levelname->on_change.connect(std::bind(&LevelProperties::on_levelname_change, 
this, std::placeholders::_1));
+  
description->on_change.connect(std::bind(&LevelProperties::on_description_change,
 this, std::placeholders::_1));
 
-  
number_to_save->on_change.connect(boost::bind(&LevelProperties::on_number_to_save_change,
 this, _1));
-  
number_of_pingus->on_change.connect(boost::bind(&LevelProperties::on_number_of_pingus_change,
 this, _1));
+  
number_to_save->on_change.connect(std::bind(&LevelProperties::on_number_to_save_change,
 this, std::placeholders::_1));
+  
number_of_pingus->on_change.connect(std::bind(&LevelProperties::on_number_of_pingus_change,
 this, std::placeholders::_1));
 
-  width->on_change.connect(boost::bind(&LevelProperties::on_width_change, 
this, _1));
-  height->on_change.connect(boost::bind(&LevelProperties::on_height_change, 
this, _1));
-  time->on_change.connect(boost::bind(&LevelProperties::on_time_change, this, 
_1));
-  
difficulty->on_change.connect(boost::bind(&LevelProperties::on_difficulty_change,
 this, _1));
-  comment->on_change.connect(boost::bind(&LevelProperties::on_comment_change, 
this, _1));
-  music->on_change.connect(boost::bind(&LevelProperties::on_music_change, 
this, _1));
+  width->on_change.connect(std::bind(&LevelProperties::on_width_change, this, 
std::placeholders::_1));
+  height->on_change.connect(std::bind(&LevelProperties::on_height_change, 
this, std::placeholders::_1));
+  time->on_change.connect(std::bind(&LevelProperties::on_time_change, this, 
std::placeholders::_1));
+  
difficulty->on_change.connect(std::bind(&LevelProperties::on_difficulty_change, 
this, std::placeholders::_1));
+  comment->on_change.connect(std::bind(&LevelProperties::on_comment_change, 
this, std::placeholders::_1));
+  music->on_change.connect(std::bind(&LevelProperties::on_music_change, this, 
std::placeholders::_1));
 }
 
 LevelProperties::~LevelProperties()

Modified: trunk/pingus/src/editor/object_properties.cpp
===================================================================
--- trunk/pingus/src/editor/object_properties.cpp       2011-08-28 21:17:09 UTC 
(rev 4191)
+++ trunk/pingus/src/editor/object_properties.cpp       2011-08-29 21:30:22 UTC 
(rev 4192)
@@ -16,7 +16,6 @@
 
 #include "editor/object_properties.hpp"
 
-#include <boost/bind.hpp>
 #include <iostream>
 
 #include "editor/button.hpp"
@@ -97,7 +96,7 @@
   gptype_type->add(Groundtype::GP_REMOVE,      _("Remove"));
   gptype_type->set_selected_item(Groundtype::GP_GROUND);
 
-  
gptype_type->on_select.connect(boost::bind(&ObjectProperties::on_gptype_change, 
this, _1));
+  
gptype_type->on_select.connect(std::bind(&ObjectProperties::on_gptype_change, 
this, std::placeholders::_1));
   
   add(entrance_direction_label = new Label(label_rect, _("Direction:")));
   add(entrance_direction = new Combobox(box_rect));
@@ -106,12 +105,12 @@
   entrance_direction->add(2, _("Right"));
   entrance_direction->set_selected_item(0);
 
-  
entrance_direction->on_select.connect(boost::bind(&ObjectProperties::on_entrance_direction_change,
 this, _1));
+  
entrance_direction->on_select.connect(std::bind(&ObjectProperties::on_entrance_direction_change,
 this, std::placeholders::_1));
   
   add(release_rate_label = new Label(label_rect, _("ReleaseRate:")));
   add(release_rate_inputbox = new Inputbox(box_rect));
 
-  
release_rate_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_release_rate_change,
 this, _1));
+  
release_rate_inputbox->on_change.connect(std::bind(&ObjectProperties::on_release_rate_change,
 this, std::placeholders::_1));
   
   // Background Stretch
   add(stretch_label = new Label(label_rect, "Stretch:"));
@@ -122,8 +121,8 @@
                                              Size(box_rect.get_width()/2, 
box_rect.get_height())),
                                         "Y"));
 
-  
stretch_x_checkbox->on_change.connect(boost::bind(&ObjectProperties::on_stretch_x_change,
 this, _1));
-  
stretch_y_checkbox->on_change.connect(boost::bind(&ObjectProperties::on_stretch_y_change,
 this, _1));
+  
stretch_x_checkbox->on_change.connect(std::bind(&ObjectProperties::on_stretch_x_change,
 this, std::placeholders::_1));
+  
stretch_y_checkbox->on_change.connect(std::bind(&ObjectProperties::on_stretch_y_change,
 this, std::placeholders::_1));
   
   add(para_x_label = new Label(label_rect, _("Para-X:")));
   add(para_y_label = new Label(label_rect, _("Para-Y:")));
@@ -131,8 +130,8 @@
   add(para_x_inputbox = new Inputbox(box_rect));
   add(para_y_inputbox = new Inputbox(box_rect));
 
-  
para_x_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_para_x_change,
 this, _1));
-  
para_y_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_para_y_change,
 this, _1));
+  
para_x_inputbox->on_change.connect(std::bind(&ObjectProperties::on_para_x_change,
 this, std::placeholders::_1));
+  
para_y_inputbox->on_change.connect(std::bind(&ObjectProperties::on_para_y_change,
 this, std::placeholders::_1));
   
   add(scroll_x_label = new Label(label_rect, _("Scroll-X:")));
   add(scroll_y_label = new Label(label_rect, _("Scroll-Y:")));
@@ -140,16 +139,16 @@
   add(scroll_x_inputbox = new Inputbox(box_rect));
   add(scroll_y_inputbox = new Inputbox(box_rect));
 
-  
scroll_x_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_scroll_x_change,
 this, _1));
-  
scroll_y_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_scroll_y_change,
 this, _1));
+  
scroll_x_inputbox->on_change.connect(std::bind(&ObjectProperties::on_scroll_x_change,
 this, std::placeholders::_1));
+  
scroll_y_inputbox->on_change.connect(std::bind(&ObjectProperties::on_scroll_y_change,
 this, std::placeholders::_1));
   
   add(owner_label    = new Label(label_rect, _("Owner Id:")));
   add(owner_inputbox = new Inputbox(box_rect));
-  
owner_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_owner_change,
 this, _1));
+  
owner_inputbox->on_change.connect(std::bind(&ObjectProperties::on_owner_change, 
this, std::placeholders::_1));
   
   add(pos_z_label    = new Label(label_rect, _("Z-Pos:")));
   add(pos_z_inputbox = new Inputbox(box_rect));
-  
pos_z_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_pos_z_change,
 this, _1));
+  
pos_z_inputbox->on_change.connect(std::bind(&ObjectProperties::on_pos_z_change, 
this, std::placeholders::_1));
   // ___________________________________________________________________
   //  
   Size color_s(box_rect.get_width()/4, box_rect.get_height());
@@ -160,10 +159,10 @@
   add(color_b_inputbox = new Inputbox(Rect(Vector2i(box_rect.left + 
2*color_s.width, box_rect.top), color_s)));
   add(color_a_inputbox = new Inputbox(Rect(Vector2i(box_rect.left + 
3*color_s.width, box_rect.top), color_s)));
 
-  
color_r_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_color_r_change,
 this, _1));
-  
color_g_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_color_g_change,
 this, _1));
-  
color_b_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_color_b_change,
 this, _1));
-  
color_a_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_color_a_change,
 this, _1));
+  
color_r_inputbox->on_change.connect(std::bind(&ObjectProperties::on_color_r_change,
 this, std::placeholders::_1));
+  
color_g_inputbox->on_change.connect(std::bind(&ObjectProperties::on_color_g_change,
 this, std::placeholders::_1));
+  
color_b_inputbox->on_change.connect(std::bind(&ObjectProperties::on_color_b_change,
 this, std::placeholders::_1));
+  
color_a_inputbox->on_change.connect(std::bind(&ObjectProperties::on_color_a_change,
 this, std::placeholders::_1));
   // ___________________________________________________________________
   //
   add(small_stars_label    = new Label(label_rect, _("Small Stars:")));
@@ -175,14 +174,14 @@
   add(large_stars_label    = new Label(label_rect, _("Large Stars:")));
   add(large_stars_inputbox = new Inputbox(box_rect));
 
-  
small_stars_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_small_stars_change,
 this, _1));
-  
middle_stars_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_middle_stars_change,
 this, _1));
-  
large_stars_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_large_stars_change,
 this, _1));
+  
small_stars_inputbox->on_change.connect(std::bind(&ObjectProperties::on_small_stars_change,
 this, std::placeholders::_1));
+  
middle_stars_inputbox->on_change.connect(std::bind(&ObjectProperties::on_middle_stars_change,
 this, std::placeholders::_1));
+  
large_stars_inputbox->on_change.connect(std::bind(&ObjectProperties::on_large_stars_change,
 this, std::placeholders::_1));
   // ___________________________________________________________________
   //
   add(repeat_label    = new Label(label_rect, _("Repeat:")));
   add(repeat_inputbox = new Inputbox(box_rect));
-  
repeat_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_repeat_change,
 this, _1));
+  
repeat_inputbox->on_change.connect(std::bind(&ObjectProperties::on_repeat_change,
 this, std::placeholders::_1));
   // ___________________________________________________________________
   //
   add(flip_horizontal_button  = new Button(Rect(Vector2i(15+40*0-3, 0), 
Size(34, 34)), "|"));
@@ -190,10 +189,10 @@
   add(rotate_270_button       = new Button(Rect(Vector2i(15+40*2-3 + 20, 0), 
Size(34, 34)), "<-."));
   add(rotate_90_button        = new Button(Rect(Vector2i(15+40*3-3 + 20, 0), 
Size(34, 34)), ".->"));
 
-  
flip_vertical_button->on_click.connect(boost::bind(&ObjectProperties::on_flip_vertical,
 this));
-  
flip_horizontal_button->on_click.connect(boost::bind(&ObjectProperties::on_flip_horizontal,
 this));
-  
rotate_90_button->on_click.connect(boost::bind(&ObjectProperties::on_rotate_90, 
this));
-  
rotate_270_button->on_click.connect(boost::bind(&ObjectProperties::on_rotate_270,
 this));
+  
flip_vertical_button->on_click.connect(std::bind(&ObjectProperties::on_flip_vertical,
 this));
+  
flip_horizontal_button->on_click.connect(std::bind(&ObjectProperties::on_flip_horizontal,
 this));
+  
rotate_90_button->on_click.connect(std::bind(&ObjectProperties::on_rotate_90, 
this));
+  
rotate_270_button->on_click.connect(std::bind(&ObjectProperties::on_rotate_270, 
this));
   // ___________________________________________________________________
   //
   set_object(0);

Modified: trunk/pingus/src/editor/object_selector.cpp
===================================================================
--- trunk/pingus/src/editor/object_selector.cpp 2011-08-28 21:17:09 UTC (rev 
4191)
+++ trunk/pingus/src/editor/object_selector.cpp 2011-08-29 21:30:22 UTC (rev 
4192)
@@ -16,7 +16,6 @@
 
 #include "editor/object_selector.hpp"
 
-#include <boost/bind.hpp>
 #include <boost/signal.hpp>
 #include <iostream>
 
@@ -360,7 +359,7 @@
                                         Vector2i(2 + button_pos.x * 30,  
                                                  2 + button_pos.y * 30),
                                         image, tooltip));
-  button->on_click.connect(boost::bind(&ObjectSelectorList::set_objects, 
object_list, set));
+  button->on_click.connect(std::bind(&ObjectSelectorList::set_objects, 
object_list, set));
 
   button_pos.x += 1;
   if (button_pos.x > 7)

Modified: trunk/pingus/src/engine/screen/screen_manager.hpp
===================================================================
--- trunk/pingus/src/engine/screen/screen_manager.hpp   2011-08-28 21:17:09 UTC 
(rev 4191)
+++ trunk/pingus/src/engine/screen/screen_manager.hpp   2011-08-29 21:30:22 UTC 
(rev 4192)
@@ -17,7 +17,6 @@
 #ifndef HEADER_PINGUS_ENGINE_SCREEN_SCREEN_MANAGER_HPP
 #define HEADER_PINGUS_ENGINE_SCREEN_SCREEN_MANAGER_HPP
 
-#include <boost/smart_ptr.hpp>
 #include <memory>
 #include <vector>
 

Modified: trunk/pingus/src/math/quad_tree.hpp
===================================================================
--- trunk/pingus/src/math/quad_tree.hpp 2011-08-28 21:17:09 UTC (rev 4191)
+++ trunk/pingus/src/math/quad_tree.hpp 2011-08-29 21:30:22 UTC (rev 4192)
@@ -19,7 +19,6 @@
 #ifndef HEADER_PINGUS_MATH_QUAD_TREE_HPP
 #define HEADER_PINGUS_MATH_QUAD_TREE_HPP
 
-#include <boost/scoped_ptr.hpp>
 #include <memory>
 #include <vector>
 
@@ -54,10 +53,10 @@
   Items    m_items;
   int      m_depth;
 
-  boost::scoped_ptr<QuadTreeNode<C> > m_nw;
-  boost::scoped_ptr<QuadTreeNode<C> > m_ne;
-  boost::scoped_ptr<QuadTreeNode<C> > m_sw;
-  boost::scoped_ptr<QuadTreeNode<C> > m_se;
+  std::unique_ptr<QuadTreeNode<C> > m_nw;
+  std::unique_ptr<QuadTreeNode<C> > m_ne;
+  std::unique_ptr<QuadTreeNode<C> > m_sw;
+  std::unique_ptr<QuadTreeNode<C> > m_se;
 
 public:
   QuadTreeNode(int depth, const Rectf& bounding_rect) :
@@ -195,7 +194,7 @@
 class QuadTree 
 {
 private:
-  boost::scoped_ptr<QuadTreeNode<C> > m_main_node;
+  std::unique_ptr<QuadTreeNode<C> > m_main_node;
 
 public: 
   QuadTree(const Rectf& bounding_rect) :

Modified: trunk/pingus/src/pingus/screens/demo_session.cpp
===================================================================
--- trunk/pingus/src/pingus/screens/demo_session.cpp    2011-08-28 21:17:09 UTC 
(rev 4191)
+++ trunk/pingus/src/pingus/screens/demo_session.cpp    2011-08-29 21:30:22 UTC 
(rev 4192)
@@ -16,8 +16,7 @@
 
 #include "pingus/screens/demo_session.hpp"
 
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
+#include <algorithm>
 #include <iostream>
 
 #include "engine/gui/gui_manager.hpp"
@@ -37,13 +36,13 @@
 {
 private:
   Sprite highlight;
-  boost::function<void(void)> callback;
-  boost::function<bool(void)> highlight_func;
+  std::function<void(void)> callback;
+  std::function<bool(void)> highlight_func;
   
 public:
   BButton(int x, int y, const std::string& name, 
-          boost::function<void (void)> callback_,
-          boost::function<bool(void)> highlight_func_ = &false_func) :
+          std::function<void (void)> callback_,
+          std::function<bool(void)> highlight_func_ = &false_func) :
     SurfaceButton(x, y, name, name + "-pressed", name + "-hover"),
     highlight("core/demo/highlight"),
     callback(callback_),
@@ -122,13 +121,13 @@
   gui_manager->add(small_map);
 
   gui_manager->add(fastforward_button= new BButton(32+50, 32, 
"core/demo/fastforward",
-                                                   
boost::bind(&DemoSession::on_fast_forward_press, this),
-                                                   
boost::bind(&DemoSession::is_fast_forward, this)));
+                                                   
std::bind(&DemoSession::on_fast_forward_press, this),
+                                                   
std::bind(&DemoSession::is_fast_forward, this)));
   gui_manager->add(pause_button =new BButton(32,  32, "core/demo/pause",
-                                             
boost::bind(&DemoSession::on_pause_press, this),
-                                             
boost::bind(&DemoSession::is_pause, this)));
+                                             
std::bind(&DemoSession::on_pause_press, this),
+                                             std::bind(&DemoSession::is_pause, 
this)));
   gui_manager->add(restart_button = new BButton(size.width - 32 - 48, 32, 
"core/demo/reload",
-                                                
boost::bind(&DemoSession::restart, this)));
+                                                
std::bind(&DemoSession::restart, this)));
 }
 
 DemoSession::~DemoSession()

Modified: trunk/pingus/src/pingus/screens/level_menu.cpp
===================================================================
--- trunk/pingus/src/pingus/screens/level_menu.cpp      2011-08-28 21:17:09 UTC 
(rev 4191)
+++ trunk/pingus/src/pingus/screens/level_menu.cpp      2011-08-29 21:30:22 UTC 
(rev 4192)
@@ -16,9 +16,7 @@
 
 #include "pingus/screens/level_menu.hpp"
 
-#include <boost/bind.hpp>
 #include <boost/format.hpp>
-#include <boost/function.hpp>
 
 #include "engine/display/display.hpp"
 #include "engine/gui/gui_manager.hpp"
@@ -69,10 +67,10 @@
 class LevelScrollButton : public GUI::SurfaceButton
 {
 private:
-  boost::function<void(void)> callback;
+  std::function<void(void)> callback;
 
 public:
-  LevelScrollButton(int x, int y, const std::string& str, boost::function<void 
(void)> callback_)
+  LevelScrollButton(int x, int y, const std::string& str, std::function<void 
(void)> callback_)
     : GUI::SurfaceButton(x, y,
                          str,
                          str + "_pressed",
@@ -374,12 +372,12 @@
   gui_manager->add(prev_button = new LevelScrollButton(Display::get_width()/2  
+ 160,
                                                        Display::get_height()/2 
+ 145,
                                                        "core/menu/arrow_left",
-                                                       
boost::bind(&LevelMenu::prev_page, this)));
+                                                       
std::bind(&LevelMenu::prev_page, this)));
 
   gui_manager->add(next_button = new LevelScrollButton(Display::get_width()/2  
+ 230,
                                                        Display::get_height()/2 
+ 145,
                                                        "core/menu/arrow_right",
-                                                       
boost::bind(&LevelMenu::next_page, this)));
+                                                       
std::bind(&LevelMenu::next_page, this)));
 
   gui_manager->add(levelset_selector);
   gui_manager->add(level_selector);

Modified: trunk/pingus/src/pingus/screens/option_menu.cpp
===================================================================
--- trunk/pingus/src/pingus/screens/option_menu.cpp     2011-08-28 21:17:09 UTC 
(rev 4191)
+++ trunk/pingus/src/pingus/screens/option_menu.cpp     2011-08-29 21:30:22 UTC 
(rev 4192)
@@ -16,7 +16,6 @@
 
 #include "pingus/screens/option_menu.hpp"
 
-#include <boost/bind.hpp>
 #include <iostream>
 #include <sstream>
 
@@ -164,18 +163,18 @@
   sound_volume_box  = new SliderBox(Rect());
   music_volume_box  = new SliderBox(Rect());
 
-  
C(swcursor_box->on_change.connect(boost::bind(&OptionMenu::on_swcursor_change, 
this, _1)));
-  
C(fullscreen_box->on_change.connect(boost::bind(&OptionMenu::on_fullscreen_change,
 this, _1)));
-  
C(autoscroll_box->on_change.connect(boost::bind(&OptionMenu::on_autoscroll_change,
 this, _1)));
-  
C(mousegrab_box->on_change.connect(boost::bind(&OptionMenu::on_mousegrab_change,
 this, _1)));
-  
C(printfps_box->on_change.connect(boost::bind(&OptionMenu::on_printfps_change, 
this, _1)));
+  C(swcursor_box->on_change.connect(std::bind(&OptionMenu::on_swcursor_change, 
this, std::placeholders::_1)));
+  
C(fullscreen_box->on_change.connect(std::bind(&OptionMenu::on_fullscreen_change,
 this, std::placeholders::_1)));
+  
C(autoscroll_box->on_change.connect(std::bind(&OptionMenu::on_autoscroll_change,
 this, std::placeholders::_1)));
+  
C(mousegrab_box->on_change.connect(std::bind(&OptionMenu::on_mousegrab_change, 
this, std::placeholders::_1)));
+  C(printfps_box->on_change.connect(std::bind(&OptionMenu::on_printfps_change, 
this, std::placeholders::_1)));
 
-  
C(master_volume_box->on_change.connect(boost::bind(&OptionMenu::on_master_volume_change,
 this, _1)));
-  
C(sound_volume_box->on_change.connect(boost::bind(&OptionMenu::on_sound_volume_change,
 this, _1)));
-  
C(music_volume_box->on_change.connect(boost::bind(&OptionMenu::on_music_volume_change,
 this, _1)));
+  
C(master_volume_box->on_change.connect(std::bind(&OptionMenu::on_master_volume_change,
 this, std::placeholders::_1)));
+  
C(sound_volume_box->on_change.connect(std::bind(&OptionMenu::on_sound_volume_change,
 this, std::placeholders::_1)));
+  
C(music_volume_box->on_change.connect(std::bind(&OptionMenu::on_music_volume_change,
 this, std::placeholders::_1)));
 
-  
C(language_box->on_change.connect(boost::bind(&OptionMenu::on_language_change, 
this, _1)));
-  
C(resolution_box->on_change.connect(boost::bind(&OptionMenu::on_resolution_change,
 this, _1)));
+  C(language_box->on_change.connect(std::bind(&OptionMenu::on_language_change, 
this, std::placeholders::_1)));
+  
C(resolution_box->on_change.connect(std::bind(&OptionMenu::on_resolution_change,
 this, std::placeholders::_1)));
 
   add_item(_("Language:"),        language_box);
   //  add_item(_("Scroll Mode:"),     scroll_box);
@@ -191,19 +190,19 @@
 
   // Connect with ConfigManager
   mousegrab_box->set_state(config_manager.get_mouse_grab(), false);
-  
C(config_manager.on_mouse_grab_change.connect(boost::bind(&CheckBox::set_state, 
mousegrab_box, _1, false)));
+  
C(config_manager.on_mouse_grab_change.connect(std::bind(&CheckBox::set_state, 
mousegrab_box, std::placeholders::_1, false)));
 
   printfps_box->set_state(config_manager.get_print_fps(), false);
-  
C(config_manager.on_print_fps_change.connect(boost::bind(&CheckBox::set_state, 
printfps_box, _1, false)));
+  C(config_manager.on_print_fps_change.connect(std::bind(&CheckBox::set_state, 
printfps_box, std::placeholders::_1, false)));
 
   fullscreen_box->set_state(config_manager.get_fullscreen(), false);
-  
C(config_manager.on_fullscreen_change.connect(boost::bind(&CheckBox::set_state, 
fullscreen_box, _1, false)));
+  
C(config_manager.on_fullscreen_change.connect(std::bind(&CheckBox::set_state, 
fullscreen_box, std::placeholders::_1, false)));
 
   swcursor_box->set_state(config_manager.get_swcursor(), false);
-  
C(config_manager.on_swcursor_change.connect(boost::bind(&CheckBox::set_state, 
swcursor_box, _1, false)));
+  C(config_manager.on_swcursor_change.connect(std::bind(&CheckBox::set_state, 
swcursor_box, std::placeholders::_1, false)));
 
   autoscroll_box->set_state(config_manager.get_autoscroll(), false);
-  
C(config_manager.on_autoscroll_change.connect(boost::bind(&CheckBox::set_state, 
autoscroll_box, _1, false)));
+  
C(config_manager.on_autoscroll_change.connect(std::bind(&CheckBox::set_state, 
autoscroll_box, std::placeholders::_1, false)));
 
   defaults_label = new Label(_("Reset to Defaults:"), 
Rect(Vector2i(Display::get_width()/2 - 100, Display::get_height()/2 + 160), 
Size(170, 32)));
   gui_manager->add(defaults_label);




reply via email to

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