- updated TODO
[supertux.git] / src / menu.cpp
index 34dd529..b3ade4d 100644 (file)
@@ -65,10 +65,8 @@ std::vector<Menu*> Menu::last_menus;
 Menu* Menu::current_ = 0;
 
 /* just displays a Yes/No text that can be used to confirm stuff */
-bool confirm_dialog(std::string text)
+bool confirm_dialog(Surface *background, std::string text)
 {
-  // TODO
-#if 0
   //Surface* cap_screen = Surface::CaptureScreen();
   
   Menu* dialog = new Menu;
@@ -80,6 +78,8 @@ bool confirm_dialog(std::string text)
 
   Menu::set_current(dialog);
 
+  DrawingContext context;
+
   while(true)
   {
     SDL_Event event;
@@ -89,9 +89,9 @@ bool confirm_dialog(std::string text)
       dialog->event(event);
     }
 
-    //cap_screen->draw(0,0);
+    context.draw_surface(background, Vector(0,0), LAYER_BACKGROUND0);
 
-    dialog->draw();
+    dialog->draw(context);
     dialog->action();
 
     switch (dialog->check())
@@ -112,11 +112,11 @@ bool confirm_dialog(std::string text)
       break;
     }
 
-    mouse_cursor->draw();
-    flipscreen();
+    mouse_cursor->draw(context);
+    context.do_drawing();
     SDL_Delay(25);
   }
-#endif
+
   return false;
 }
 
@@ -722,9 +722,6 @@ Menu::draw(DrawingContext& context)
   int menu_height = get_height();
   int menu_width  = get_width();
 
-  context.push_transform();
-  context.set_translation(Vector(0, 0));  
-
   /* Draw a transparent background */
   context.draw_filled_rect(
       Vector(pos_x - menu_width/2, pos_y - 24*item.size()/2 - 10),
@@ -735,7 +732,6 @@ Menu::draw(DrawingContext& context)
   {
     draw_item(context, i, menu_width, menu_height);
   }
-  context.pop_transform();
 }
 
 MenuItem&