pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3708 - in trunk/pingus/src: . editor gui worldmap


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3708 - in trunk/pingus/src: . editor gui worldmap
Date: Mon, 7 Jul 2008 09:36:34 +0200

Author: grumbel
Date: 2008-07-07 09:36:31 +0200 (Mon, 07 Jul 2008)
New Revision: 3708

Modified:
   trunk/pingus/src/credits.cpp
   trunk/pingus/src/demo_session.cpp
   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/editor/panel.cpp
   trunk/pingus/src/exit_menu.cpp
   trunk/pingus/src/game_session.cpp
   trunk/pingus/src/gui/group_component.cpp
   trunk/pingus/src/gui/group_component.hpp
   trunk/pingus/src/level_menu.cpp
   trunk/pingus/src/option_menu.cpp
   trunk/pingus/src/pingus_menu.cpp
   trunk/pingus/src/result_screen.cpp
   trunk/pingus/src/start_screen.cpp
   trunk/pingus/src/story_screen.cpp
   trunk/pingus/src/worldmap/worldmap_screen.cpp
Log:
Changed void GroupComponent::add(Component*, bool) to just 
GroupComponent::add(Component* comp)

Modified: trunk/pingus/src/credits.cpp
===================================================================
--- trunk/pingus/src/credits.cpp        2008-07-07 07:21:21 UTC (rev 3707)
+++ trunk/pingus/src/credits.cpp        2008-07-07 07:36:31 UTC (rev 3708)
@@ -64,7 +64,7 @@
   background.scale(Display::get_width(), Display::get_height());
   pingu = Sprite("core/misc/creditpingu");
 
-  gui_manager->add(new CreditsOkButton(this), true);
+  gui_manager->add(new CreditsOkButton(this));
 
   font       = Fonts::chalk_normal;
   font_small = Fonts::chalk_large;

Modified: trunk/pingus/src/demo_session.cpp
===================================================================
--- trunk/pingus/src/demo_session.cpp   2008-07-07 07:21:21 UTC (rev 3707)
+++ trunk/pingus/src/demo_session.cpp   2008-07-07 07:36:31 UTC (rev 3708)
@@ -91,7 +91,7 @@
 
   // Create GUI
   pcounter = new PingusCounter(server.get());
-  gui_manager->add(pcounter, true);
+  gui_manager->add(pcounter);
 
   int world_width  = server->get_world()->get_width();
   int world_height = server->get_world()->get_height();
@@ -102,19 +102,19 @@
                                  Size(Math::min(Display::get_width(),  
world_width),
                                       Math::min(Display::get_height(), 
world_height))));
 
-  gui_manager->add(playfield, true);
+  gui_manager->add(playfield);
 
   small_map    = new SmallMap(server.get(), playfield);
-  gui_manager->add(small_map, true);
+  gui_manager->add(small_map);
 
   gui_manager->add(new BButton(32+50, 32, "core/demo/fastforward",
                                
boost::bind(&DemoSession::on_fast_forward_press, this),
-                               boost::bind(&DemoSession::is_fast_forward, 
this)), true);
+                               boost::bind(&DemoSession::is_fast_forward, 
this)));
   gui_manager->add(new BButton(32,  32, "core/demo/pause",
                                boost::bind(&DemoSession::on_pause_press, this),
-                               boost::bind(&DemoSession::is_pause, this)), 
true);
+                               boost::bind(&DemoSession::is_pause, this)));
   gui_manager->add(new BButton(Display::get_width() - 32 - 48, 32, 
"core/demo/reload",
-                               boost::bind(&DemoSession::restart, this)), 
true);
+                               boost::bind(&DemoSession::restart, this)));
 }
 
 DemoSession::~DemoSession()

Modified: trunk/pingus/src/editor/action_properties.cpp
===================================================================
--- trunk/pingus/src/editor/action_properties.cpp       2008-07-07 07:21:21 UTC 
(rev 3707)
+++ trunk/pingus/src/editor/action_properties.cpp       2008-07-07 07:36:31 UTC 
(rev 3708)
@@ -74,8 +74,8 @@
   comp.checkbox->set_checked(true);
   comp.inputbox->set_text("20");
  
-  add(comp.checkbox, true);
-  add(comp.inputbox, true);
+  add(comp.checkbox);
+  add(comp.inputbox);
   
   action_comps[id] = comp;
 

Modified: trunk/pingus/src/editor/editor_screen.cpp
===================================================================
--- trunk/pingus/src/editor/editor_screen.cpp   2008-07-07 07:21:21 UTC (rev 
3707)
+++ trunk/pingus/src/editor/editor_screen.cpp   2008-07-07 07:36:31 UTC (rev 
3708)
@@ -57,7 +57,7 @@
   viewport = new Viewport(this, Rect(0, 38,
                                            Display::get_width() - 244, 
                                            Display::get_height()));
-  gui_manager->add(viewport, true);    
+  gui_manager->add(viewport);
        
   // Create the panel for the buttons
   panel = new Panel(this);
@@ -66,23 +66,23 @@
   //      Size(240, Display::get_height() - (600 - 495))),
 
   minimap = new Minimap(this, Rect());
-  gui_manager->add(minimap, true);
+  gui_manager->add(minimap);
 
   object_properties = new ObjectProperties(this, Rect(Vector2i(), Size(200, 
150)));
-  gui_manager->add(object_properties, true);
+  gui_manager->add(object_properties);
 
   action_properties = new ActionProperties(this, Rect());
   action_properties->hide();
-  gui_manager->add(action_properties, true);
+  gui_manager->add(action_properties);
 
   level_properties = new LevelProperties(this, Rect());
   level_properties->hide();
   level_properties->set_level(plf);
   action_properties->set_level(plf);
-  gui_manager->add(level_properties, true);
+  gui_manager->add(level_properties);
 
   object_selector = new ObjectSelector(this, Rect());
-  gui_manager->add(object_selector, true);
+  gui_manager->add(object_selector);
 
   file_load_dialog = new FileDialog(this, Rect(Vector2i(50, 50), 
                                                Size(Display::get_width() - 
100, 
@@ -90,7 +90,7 @@
                                     FileDialog::LOAD);
   file_load_dialog->set_directory(".");
   file_load_dialog->hide();
-  gui_manager->add(file_load_dialog, true);
+  gui_manager->add(file_load_dialog);
 
   file_save_dialog = new FileDialog(this, Rect(Vector2i(50, 50), 
                                                Size(Display::get_width() - 
100, 
@@ -98,7 +98,7 @@
                                     FileDialog::SAVE);
   file_save_dialog->set_directory(".");
   file_save_dialog->hide();
-  gui_manager->add(file_save_dialog, true);
+  gui_manager->add(file_save_dialog);
 
   
viewport->selection_changed.connect(boost::bind(&ObjectProperties::set_objects, 
object_properties, _1));
   viewport->refresh();

Modified: trunk/pingus/src/editor/file_dialog.cpp
===================================================================
--- trunk/pingus/src/editor/file_dialog.cpp     2008-07-07 07:21:21 UTC (rev 
3707)
+++ trunk/pingus/src/editor/file_dialog.cpp     2008-07-07 07:36:31 UTC (rev 
3708)
@@ -38,7 +38,7 @@
 {
   file_list = new FileList(Rect(4, 30 + 30 + 30,
                                 rect.get_width()-4 - 30, rect.get_height() - 4 
- 35));
-  add(file_list, true);
+  add(file_list);
 
   file_list->on_click.connect(boost::bind(&FileDialog::load_file, this, _1));
 
@@ -70,20 +70,20 @@
   open_button->on_click.connect(boost::bind(&FileDialog::on_open, this));
   cancel_button->on_click.connect(boost::bind(&FileDialog::on_cancel, this));
 
-  add(filename_label = new Label(Rect(6, 4+30, 4 + 60, 26+30), 
_("Filename:")), true);
-  add(pathname_label = new Label(Rect(6, 4+60, 4 + 60, 26+60), 
_("Pathname:")), true);
+  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:")));
   
-  add(filename_inputbox = new Inputbox(Rect(4 + 60, 4+30, rect.get_width()-4, 
26+30)), true);
-  add(pathname_inputbox = new Inputbox(Rect(4 + 60, 4+60, rect.get_width()-4, 
26+60)), true);
+  add(filename_inputbox = new Inputbox(Rect(4 + 60, 4+30, rect.get_width()-4, 
26+30)));
+  add(pathname_inputbox = new Inputbox(Rect(4 + 60, 4+60, rect.get_width()-4, 
26+60)));
 
-  add(up_button, true);
-  add(down_button, true);
+  add(up_button);
+  add(down_button);
 
-  add(datadir_button, true);
-  add(userdir_button, true);
+  add(datadir_button);
+  add(userdir_button);
 
-  add(open_button, true);
-  add(cancel_button, true);
+  add(open_button);
+  add(cancel_button);
 }
 
 FileDialog::~FileDialog()

Modified: trunk/pingus/src/editor/level_properties.cpp
===================================================================
--- trunk/pingus/src/editor/level_properties.cpp        2008-07-07 07:21:21 UTC 
(rev 3707)
+++ trunk/pingus/src/editor/level_properties.cpp        2008-07-07 07:36:31 UTC 
(rev 3708)
@@ -42,32 +42,32 @@
     level(0)
 {
   int w = rect.get_width() - 120;
-  add(new Label   (Rect(Vector2i( 10,  10), Size( 80, 20)), "Author:"), true);
-  add(author = new Inputbox(Rect(Vector2i(110,  10), Size(  w, 20))), true);
-  add(new Label   (Rect(Vector2i( 10,  32), Size( 80, 20)), "Levelname:"), 
true);
-  add(levelname = new Inputbox(Rect(Vector2i(110,  32), Size(  w, 20))), true);
-  add(new Label   (Rect(Vector2i( 10,  54), Size( 80, 20)), "Description:"), 
true);
-  add(description = new Inputbox(Rect(Vector2i(110,  54), Size(  w, 20*3))), 
true);
+  add(new Label   (Rect(Vector2i( 10,  10), Size( 80, 20)), "Author:"));
+  add(author = new Inputbox(Rect(Vector2i(110,  10), Size(  w, 20))));
+  add(new Label   (Rect(Vector2i( 10,  32), Size( 80, 20)), "Levelname:"));
+  add(levelname = new Inputbox(Rect(Vector2i(110,  32), Size(  w, 20))));
+  add(new Label   (Rect(Vector2i( 10,  54), Size( 80, 20)), "Description:"));
+  add(description = new Inputbox(Rect(Vector2i(110,  54), Size(  w, 20*3))));
 
   int y = 116;
-  add(new Label   (Rect(Vector2i( 10,  y), Size( 80, 20)), "Pingus Count:"), 
true);
-  add(number_of_pingus = new Inputbox(Rect(Vector2i(110,  y), Size(  w, 20))), 
true);
-  add(new Label   (Rect(Vector2i( 10,  y+22), Size( 80, 20)), "Pingus to 
Save:"), true);
-  add(number_to_save = new Inputbox(Rect(Vector2i(110,  y+22), Size(  w, 
20))), true);
+  add(new Label   (Rect(Vector2i( 10,  y), Size( 80, 20)), "Pingus Count:"));
+  add(number_of_pingus = new Inputbox(Rect(Vector2i(110,  y), Size(  w, 20))));
+  add(new Label   (Rect(Vector2i( 10,  y+22), Size( 80, 20)), "Pingus to 
Save:"));
+  add(number_to_save = new Inputbox(Rect(Vector2i(110,  y+22), Size(  w, 
20))));
 
-  add(new Label   (Rect(Vector2i( 10,  y+44), Size( 80, 20)), "Time:"), true);
-  add(time = new Inputbox(Rect(Vector2i(110,  y+44), Size(  w, 20))), true);
-  add(new Label   (Rect(Vector2i( 10,  y+66), Size( 80, 20)), "Width:"), true);
-  add(width = new Inputbox(Rect(Vector2i(110,  y+66), Size(  w, 20))), true);
-  add(new Label   (Rect(Vector2i( 10,  y+88), Size( 80, 20)), "Height:"), 
true);
-  add(height = new Inputbox(Rect(Vector2i(110,  y+88), Size(  w, 20))), true);
+  add(new Label   (Rect(Vector2i( 10,  y+44), Size( 80, 20)), "Time:"));
+  add(time = new Inputbox(Rect(Vector2i(110,  y+44), Size(  w, 20))));
+  add(new Label   (Rect(Vector2i( 10,  y+66), Size( 80, 20)), "Width:"));
+  add(width = new Inputbox(Rect(Vector2i(110,  y+66), Size(  w, 20))));
+  add(new Label   (Rect(Vector2i( 10,  y+88), Size( 80, 20)), "Height:"));
+  add(height = new Inputbox(Rect(Vector2i(110,  y+88), Size(  w, 20))));
 
-  add(new Label   (Rect(Vector2i( 10, y+110), Size( 80, 20)), "Difficulty:"), 
true);
-  add(difficulty = new Inputbox(Rect(Vector2i(110, y+110), Size(  w, 20))), 
true);
-  add(new Label   (Rect(Vector2i( 10, y+132), Size( 80, 20)), "Comment:"), 
true);
-  add(comment = new Inputbox(Rect(Vector2i(110, y+132), Size(  w, 20))), true);
-  add(new Label   (Rect(Vector2i( 10, y+154), Size( 80, 20)), "Music:"), true);
-  add(music = new Inputbox(Rect(Vector2i(110, y+154), Size(  w, 20))), true);
+  add(new Label   (Rect(Vector2i( 10, y+110), Size( 80, 20)), "Difficulty:"));
+  add(difficulty = new Inputbox(Rect(Vector2i(110, y+110), Size(  w, 20))));
+  add(new Label   (Rect(Vector2i( 10, y+132), Size( 80, 20)), "Comment:"));
+  add(comment = new Inputbox(Rect(Vector2i(110, y+132), Size(  w, 20))));
+  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));

Modified: trunk/pingus/src/editor/object_properties.cpp
===================================================================
--- trunk/pingus/src/editor/object_properties.cpp       2008-07-07 07:21:21 UTC 
(rev 3707)
+++ trunk/pingus/src/editor/object_properties.cpp       2008-07-07 07:36:31 UTC 
(rev 3708)
@@ -37,15 +37,15 @@
   : GUI::GroupComponent(rect, false),
     editor(editor_)
 {
-  add(type_label = new Label(Rect(Vector2i(4, 4), Size(120, 20)), 
_("Object:")), true);
-  add(mesg_label = new Label(Rect(Vector2i(10, 0), Size(180, 20)), _("Nothing 
selected")), true);
+  add(type_label = new Label(Rect(Vector2i(4, 4), Size(120, 20)), 
_("Object:")));
+  add(mesg_label = new Label(Rect(Vector2i(10, 0), Size(180, 20)), _("Nothing 
selected")));
     
   Rect label_rect(10,0, 80, 20);
   Rect box_rect(80,0, 190, 20);
   
   // Groundpiece Type
-  add(gptype_label = new Label(label_rect, "GPType:"), true);
-  add(gptype_type  = new Combobox(box_rect), true);
+  add(gptype_label = new Label(label_rect, "GPType:"));
+  add(gptype_type  = new Combobox(box_rect));
 
   gptype_type->add(Groundtype::GP_TRANSPARENT, _("Transparent"));
   gptype_type->add(Groundtype::GP_SOLID,       _("Solid"));
@@ -58,8 +58,8 @@
 
   
gptype_type->on_select.connect(boost::bind(&ObjectProperties::on_gptype_change, 
this, _1));
   
-  add(entrance_direction_label = new Label(label_rect, _("Direction:")), true);
-  add(entrance_direction = new Combobox(box_rect), true);
+  add(entrance_direction_label = new Label(label_rect, _("Direction:")));
+  add(entrance_direction = new Combobox(box_rect));
   entrance_direction->add(0, _("Left"));
   entrance_direction->add(1, _("Misc"));
   entrance_direction->add(2, _("Right"));
@@ -67,57 +67,57 @@
 
   
entrance_direction->on_select.connect(boost::bind(&ObjectProperties::on_entrance_direction_change,
 this, _1));
   
-  add(release_rate_label = new Label(label_rect, _("ReleaseRate:")), true);
-  add(release_rate_inputbox = new Inputbox(box_rect), true);
+  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));
   
   // Background Stretch
-  add(stretch_label = new Label(label_rect, "Stretch:"), true);
+  add(stretch_label = new Label(label_rect, "Stretch:"));
   add(stretch_x_checkbox = new Checkbox(Rect(Vector2i(box_rect.left, 
box_rect.top), 
                                              Size(box_rect.get_width()/2, 
box_rect.get_height())),
-                                        "X"), true);
+                                        "X"));
   add(stretch_y_checkbox = new 
Checkbox(Rect(Vector2i(box_rect.left+box_rect.get_width()/2, box_rect.top), 
                                              Size(box_rect.get_width()/2, 
box_rect.get_height())),
-                                        "Y"), true);
+                                        "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));
   
-  add(para_x_label = new Label(label_rect, _("Para-X:")), true);
-  add(para_y_label = new Label(label_rect, _("Para-Y:")), true);
+  add(para_x_label = new Label(label_rect, _("Para-X:")));
+  add(para_y_label = new Label(label_rect, _("Para-Y:")));
 
-  add(para_x_inputbox = new Inputbox(box_rect), true);
-  add(para_y_inputbox = new Inputbox(box_rect), true);
+  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));
   
-  add(scroll_x_label = new Label(label_rect, _("Scroll-X:")), true);
-  add(scroll_y_label = new Label(label_rect, _("Scroll-Y:")), true);
+  add(scroll_x_label = new Label(label_rect, _("Scroll-X:")));
+  add(scroll_y_label = new Label(label_rect, _("Scroll-Y:")));
 
-  add(scroll_x_inputbox = new Inputbox(box_rect), true);
-  add(scroll_y_inputbox = new Inputbox(box_rect), true);
+  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));
   
-  add(owner_label    = new Label(label_rect, _("Owner Id:")), true);
-  add(owner_inputbox = new Inputbox(box_rect), true);
+  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));
   
-  add(pos_z_label    = new Label(label_rect, _("Z-Pos:")), true);
-  add(pos_z_inputbox = new Inputbox(box_rect), true);
+  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));
   // ___________________________________________________________________
   //  
   Size color_s(box_rect.get_width()/4, box_rect.get_height());
 
-  add(color_label = new Label(label_rect, _("Color:")), true);
-  add(color_r_inputbox = new Inputbox(Rect(Vector2i(box_rect.left + 
0*color_s.width, box_rect.top), color_s)), true);
-  add(color_g_inputbox = new Inputbox(Rect(Vector2i(box_rect.left + 
1*color_s.width, box_rect.top), color_s)), true);
-  add(color_b_inputbox = new Inputbox(Rect(Vector2i(box_rect.left + 
2*color_s.width, box_rect.top), color_s)), true);
-  add(color_a_inputbox = new Inputbox(Rect(Vector2i(box_rect.left + 
3*color_s.width, box_rect.top), color_s)), true);
+  add(color_label = new Label(label_rect, _("Color:")));
+  add(color_r_inputbox = new Inputbox(Rect(Vector2i(box_rect.left + 
0*color_s.width, box_rect.top), color_s)));
+  add(color_g_inputbox = new Inputbox(Rect(Vector2i(box_rect.left + 
1*color_s.width, box_rect.top), color_s)));
+  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));
@@ -125,29 +125,29 @@
   
color_a_inputbox->on_change.connect(boost::bind(&ObjectProperties::on_color_a_change,
 this, _1));
   // ___________________________________________________________________
   //
-  add(small_stars_label    = new Label(label_rect, _("Small Stars:")), true);
-  add(small_stars_inputbox = new Inputbox(box_rect), true);
+  add(small_stars_label    = new Label(label_rect, _("Small Stars:")));
+  add(small_stars_inputbox = new Inputbox(box_rect));
 
-  add(middle_stars_label    = new Label(label_rect, _("Middle Stars:")), true);
-  add(middle_stars_inputbox = new Inputbox(box_rect), true);
+  add(middle_stars_label    = new Label(label_rect, _("Middle Stars:")));
+  add(middle_stars_inputbox = new Inputbox(box_rect));
 
-      add(large_stars_label    = new Label(label_rect, _("Large Stars:")), 
true);
-  add(large_stars_inputbox = new Inputbox(box_rect), true);
+  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));
   // ___________________________________________________________________
   //
-  add(repeat_label    = new Label(label_rect, _("Repeat:")), true);
-  add(repeat_inputbox = new Inputbox(box_rect), true);
+  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));
   // ___________________________________________________________________
   //
-  add(flip_horizontal_button  = new Button(Rect(Vector2i(15+40*0-3, 0), 
Size(34, 34)), "|"), true);
-  add(flip_vertical_button    = new Button(Rect(Vector2i(15+40*1-3, 0), 
Size(34, 34)), "--"), true);
-  add(rotate_270_button       = new Button(Rect(Vector2i(15+40*2-3 + 20, 0), 
Size(34, 34)), "<-."), true);
-  add(rotate_90_button        = new Button(Rect(Vector2i(15+40*3-3 + 20, 0), 
Size(34, 34)), ".->"), true);
+  add(flip_horizontal_button  = new Button(Rect(Vector2i(15+40*0-3, 0), 
Size(34, 34)), "|"));
+  add(flip_vertical_button    = new Button(Rect(Vector2i(15+40*1-3, 0), 
Size(34, 34)), "--"));
+  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));

Modified: trunk/pingus/src/editor/object_selector.cpp
===================================================================
--- trunk/pingus/src/editor/object_selector.cpp 2008-07-07 07:21:21 UTC (rev 
3707)
+++ trunk/pingus/src/editor/object_selector.cpp 2008-07-07 07:36:31 UTC (rev 
3708)
@@ -288,8 +288,7 @@
     button_pos(0,0)
 {
   add(object_list = new ObjectSelectorList(editor, this, 
-                                           Rect(2, 2 + 60 + 2, 
rect.get_width() - 2, rect.get_height() - 2)), 
-      true);
+                                           Rect(2, 2 + 60 + 2, 
rect.get_width() - 2, rect.get_height() - 2)));
 
   gp_ground_set  = create_gp_ground();
   gp_solid_set   = create_gp_solid();
@@ -352,7 +351,7 @@
   add(button = new ObjectSelectorButton(object_list,
                                Vector2i(2 + button_pos.x * 30,  
                                         2 + button_pos.y * 30),
-                               image, tooltip), true);
+                               image, tooltip));
   button->on_click.connect(boost::bind(&ObjectSelectorList::set_objects, 
object_list, set));
 
   button_pos.x += 1;

Modified: trunk/pingus/src/editor/panel.cpp
===================================================================
--- trunk/pingus/src/editor/panel.cpp   2008-07-07 07:21:21 UTC (rev 3707)
+++ trunk/pingus/src/editor/panel.cpp   2008-07-07 07:36:31 UTC (rev 3708)
@@ -145,7 +145,7 @@
     logo("core/editor/logo"),
     pos(2,2)
 {  
-  editor->get_gui_manager()->add(this, true);
+  editor->get_gui_manager()->add(this);
 
   add_button("core/editor/document-new",  _("    New level"),
              &EditorScreen::level_new);
@@ -233,7 +233,7 @@
 {
   PanelButton* comp = new PanelButton(editor, pos, image, tooltip, callback);
   pos.x += comp->get_width();
-  editor->get_gui_manager()->add(comp, true);
+  editor->get_gui_manager()->add(comp);
 }
 
 void
@@ -241,7 +241,7 @@
 {
   PanelButton* comp = new PanelButton(editor, pos, image, "");
   pos.x += comp->get_width();
-  editor->get_gui_manager()->add(comp, true);
+  editor->get_gui_manager()->add(comp);
 }
 
 void
@@ -249,7 +249,7 @@
 {
   PanelSeparator* comp = new PanelSeparator(pos);
   pos.x += comp->get_width();
-  editor->get_gui_manager()->add(comp, true);
+  editor->get_gui_manager()->add(comp);
 }
 
 } // namespace Editor

Modified: trunk/pingus/src/exit_menu.cpp
===================================================================
--- trunk/pingus/src/exit_menu.cpp      2008-07-07 07:21:21 UTC (rev 3707)
+++ trunk/pingus/src/exit_menu.cpp      2008-07-07 07:36:31 UTC (rev 3708)
@@ -103,8 +103,8 @@
 ExitMenu::ExitMenu(PingusMenuManager* manager_)
   : PingusSubMenu(manager_)
 {
-  gui_manager->add(new ExitMenuYesButton(manager), true);
-  gui_manager->add(new ExitMenuNoButton(manager), true);
+  gui_manager->add(new ExitMenuYesButton(manager));
+  gui_manager->add(new ExitMenuNoButton(manager));
 
   sur = Sprite("core/menu/exit_menu");
 }

Modified: trunk/pingus/src/game_session.cpp
===================================================================
--- trunk/pingus/src/game_session.cpp   2008-07-07 07:21:21 UTC (rev 3707)
+++ trunk/pingus/src/game_session.cpp   2008-07-07 07:36:31 UTC (rev 3708)
@@ -74,19 +74,19 @@
   small_map    = new SmallMap(get_server(), playfield);
   time_display = new TimeDisplay(this);
 
-  gui_manager->add(playfield,    true);
-  gui_manager->add(button_panel, true);
-  gui_manager->add(pcounter,     true);
-  gui_manager->add(small_map,    true);
-  gui_manager->add(time_display, true);
+  gui_manager->add(playfield);
+  gui_manager->add(button_panel);
+  gui_manager->add(pcounter);
+  gui_manager->add(small_map);
+  gui_manager->add(time_display);
 
   armageddon_button = new ArmageddonButton(get_server(), Display::get_width() 
- 40,     Display::get_height() - 62);
   forward_button    = new ForwardButton(this, Display::get_width() - 40 * 2, 
Display::get_height() - 62);
   pause_button      = new PauseButton(this, Display::get_width() - 40 * 3, 
Display::get_height() - 62);
 
-  gui_manager->add(armageddon_button, true);
-  gui_manager->add(forward_button, true);
-  gui_manager->add(pause_button, true);
+  gui_manager->add(armageddon_button);
+  gui_manager->add(forward_button);
+  gui_manager->add(pause_button);
 }
 
 GameSession::~GameSession ()

Modified: trunk/pingus/src/gui/group_component.cpp
===================================================================
--- trunk/pingus/src/gui/group_component.cpp    2008-07-07 07:21:21 UTC (rev 
3707)
+++ trunk/pingus/src/gui/group_component.cpp    2008-07-07 07:36:31 UTC (rev 
3708)
@@ -33,7 +33,7 @@
 
 GroupComponent::~GroupComponent()
 {
-  for(Components::iterator i = delete_children.begin(); i != 
delete_children.end(); ++i)
+  for(Components::iterator i = children.begin(); i != children.end(); ++i)
     {
       delete *i;
     }
@@ -244,14 +244,10 @@
 }
 
 void
-GroupComponent::add(Component* comp, bool delete_comp)
+GroupComponent::add(Component* comp)
 {
-  assert(delete_comp == true);
-
   comp->set_parent(this);
   children.push_back(comp);
-  if (delete_comp)
-    delete_children.push_back(comp);
 }
 
 void

Modified: trunk/pingus/src/gui/group_component.hpp
===================================================================
--- trunk/pingus/src/gui/group_component.hpp    2008-07-07 07:21:21 UTC (rev 
3707)
+++ trunk/pingus/src/gui/group_component.hpp    2008-07-07 07:36:31 UTC (rev 
3708)
@@ -28,7 +28,6 @@
 private:
   typedef std::vector<Component*> Components;
   Components     children;
-  Components     delete_children;
   DrawingContext drawing_context;
 
   /** Used to detect enter/leave events */
@@ -69,7 +68,8 @@
 
   void on_pointer_move(int x, int y);
 
-  void add(Component*, bool delete_comp);
+  /** \a comp will be deleted by GroupComponent */
+  void add(Component* comp);
 
   void update_layout();
 

Modified: trunk/pingus/src/level_menu.cpp
===================================================================
--- trunk/pingus/src/level_menu.cpp     2008-07-07 07:21:21 UTC (rev 3707)
+++ trunk/pingus/src/level_menu.cpp     2008-07-07 07:36:31 UTC (rev 3708)
@@ -354,18 +354,16 @@
   gui_manager->add(new LevelScrollButton(Display::get_width()/2  + 160,
                                          Display::get_height()/2 + 145,
                                          "core/menu/arrow_left",
-                                         boost::bind(&LevelMenu::prev_page, 
this)),
-                   true);
+                                         boost::bind(&LevelMenu::prev_page, 
this)));
 
   gui_manager->add(new LevelScrollButton(Display::get_width()/2  + 230,
                                          Display::get_height()/2 + 145,
                                          "core/menu/arrow_right",
-                                         boost::bind(&LevelMenu::next_page, 
this)),
-                   true);
+                                         boost::bind(&LevelMenu::next_page, 
this)));
 
-  gui_manager->add(levelset_selector, true);
-  gui_manager->add(level_selector,    true);
-  gui_manager->add(new LevelMenuAbortButton(this), true);
+  gui_manager->add(levelset_selector);
+  gui_manager->add(level_selector);
+  gui_manager->add(new LevelMenuAbortButton(this));
 
   level_selector->hide();
 }

Modified: trunk/pingus/src/option_menu.cpp
===================================================================
--- trunk/pingus/src/option_menu.cpp    2008-07-07 07:21:21 UTC (rev 3707)
+++ trunk/pingus/src/option_menu.cpp    2008-07-07 07:36:31 UTC (rev 3708)
@@ -139,9 +139,8 @@
 OptionMenu::add_item(const std::string& label, GUI::RectComponent* control)
 {
   gui_manager->add(new Label(label, Rect(Vector2i(120 + x_pos * 312, 177 + 
y_pos*32), 
-                                         Size(140, 32))),
-                   true);
-  gui_manager->add(control, true);
+                                         Size(140, 32))));
+  gui_manager->add(control);
 
   if (dynamic_cast<ChoiceBox*>(control))
     {

Modified: trunk/pingus/src/pingus_menu.cpp
===================================================================
--- trunk/pingus/src/pingus_menu.cpp    2008-07-07 07:21:21 UTC (rev 3707)
+++ trunk/pingus/src/pingus_menu.cpp    2008-07-07 07:36:31 UTC (rev 3708)
@@ -62,10 +62,10 @@
                                   _("Levelsets"),
                                   _("..:: Play User Built levels ::.."));
 
-  gui_manager->add(quit_button,    true);
-  gui_manager->add(contrib_button, true);
-  gui_manager->add(start_button,   true);
-  gui_manager->add(editor_button,  true);
+  gui_manager->add(quit_button);
+  gui_manager->add(contrib_button);
+  gui_manager->add(start_button);
+  gui_manager->add(editor_button);
 
   logo = Sprite("core/misc/logo");
 

Modified: trunk/pingus/src/result_screen.cpp
===================================================================
--- trunk/pingus/src/result_screen.cpp  2008-07-07 07:21:21 UTC (rev 3707)
+++ trunk/pingus/src/result_screen.cpp  2008-07-07 07:36:31 UTC (rev 3708)
@@ -252,16 +252,16 @@
   ResDescriptor cancel_desc("core/result/retry");
 
   ResultScreenComponent* comp = new ResultScreenComponent(result);
-  gui_manager->add(comp, true);
+  gui_manager->add(comp);
 
   if (result.success())
     {
-      gui_manager->add(new ResultScreenOkButton(this), true);
+      gui_manager->add(new ResultScreenOkButton(this));
     }
   else
     {
-      gui_manager->add(new ResultScreenAbortButton(this), true);
-      gui_manager->add(new ResultScreenRetryButton(this), true);
+      gui_manager->add(new ResultScreenAbortButton(this));
+      gui_manager->add(new ResultScreenRetryButton(this));
     }
 
   //gui_manager->add(new GUI::SurfaceButton(500, 500, cancel_desc, 
cancel_desc, cancel_desc), true);

Modified: trunk/pingus/src/start_screen.cpp
===================================================================
--- trunk/pingus/src/start_screen.cpp   2008-07-07 07:21:21 UTC (rev 3707)
+++ trunk/pingus/src/start_screen.cpp   2008-07-07 07:36:31 UTC (rev 3708)
@@ -191,9 +191,9 @@
   : plf(arg_plf)
 {
   StartScreenComponent* comp = new StartScreenComponent(plf);
-  gui_manager->add(comp, true);
-  gui_manager->add(new StartScreenOkButton(this), true);
-  gui_manager->add(new StartScreenAbortButton(this), true);
+  gui_manager->add(comp);
+  gui_manager->add(new StartScreenOkButton(this));
+  gui_manager->add(new StartScreenAbortButton(this));
 }
 
 StartScreen::~StartScreen()

Modified: trunk/pingus/src/story_screen.cpp
===================================================================
--- trunk/pingus/src/story_screen.cpp   2008-07-07 07:21:21 UTC (rev 3707)
+++ trunk/pingus/src/story_screen.cpp   2008-07-07 07:36:31 UTC (rev 3708)
@@ -125,9 +125,9 @@
   : story(new WorldmapNS::WorldmapStory(reader))
 {
   story_comp = new StoryScreenComponent(story.get());
-  gui_manager->add(story_comp, true);
-  gui_manager->add(new StoryScreenContinueButton(story_comp), true);
-  gui_manager->add(new StoryScreenSkipButton(story_comp), true);
+  gui_manager->add(story_comp);
+  gui_manager->add(new StoryScreenContinueButton(story_comp));
+  gui_manager->add(new StoryScreenSkipButton(story_comp));
 }
 
 StoryScreen::~StoryScreen()

Modified: trunk/pingus/src/worldmap/worldmap_screen.cpp
===================================================================
--- trunk/pingus/src/worldmap/worldmap_screen.cpp       2008-07-07 07:21:21 UTC 
(rev 3707)
+++ trunk/pingus/src/worldmap/worldmap_screen.cpp       2008-07-07 07:36:31 UTC 
(rev 3708)
@@ -218,10 +218,10 @@
   // FIXME: a bit ugly because of the proteced member, but should work
   // FIXME: well enough. GUIScreen could also use multi-inheritage,
   // FIXME: but that could lead to member function name conflicts
-  gui_manager->add(new WorldmapComponent(this), true);
-  gui_manager->add(new WorldmapScreenCloseButton(this), true);
-  gui_manager->add(new WorldmapScreenEnterButton(this), true);
-  gui_manager->add(new WorldmapScreenStoryButton(this), true);
+  gui_manager->add(new WorldmapComponent(this));
+  gui_manager->add(new WorldmapScreenCloseButton(this));
+  gui_manager->add(new WorldmapScreenEnterButton(this));
+  gui_manager->add(new WorldmapScreenStoryButton(this));
 }
 
 WorldmapScreen::~WorldmapScreen ()
@@ -237,7 +237,7 @@
   //StatManager::instance()->get_bool(worldmap->get_short_name() + 
"-endstory-seen", credits_unlocked);
   if (credits_unlocked)
     {
-      gui_manager->add(new WorldmapScreenCreditsButton(this), true);
+      gui_manager->add(new WorldmapScreenCreditsButton(this));
     }
 }
 





reply via email to

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