fix miniswig using wrong stack numbers in functions with HSQUIRRELVM arguments
[supertux.git] / src / gui / menu.cpp
index 87d083d..37d74c6 100644 (file)
 #include <cassert>
 #include <stdexcept>
 
-#include "menu.h"
-#include "video/screen.h"
-#include "video/drawing_context.h"
-#include "gettext.h"
-#include "math/vector.h"
-#include "main.h"
-#include "resources.h"
-#include "control/joystickkeyboardcontroller.h"
+#include "menu.hpp"
+#include "video/screen.hpp"
+#include "video/drawing_context.hpp"
+#include "gettext.hpp"
+#include "math/vector.hpp"
+#include "main.hpp"
+#include "resources.hpp"
+#include "control/joystickkeyboardcontroller.hpp"
 
 static const int MENU_REPEAT_INITIAL = 400;
 static const int MENU_REPEAT_RATE = 200;
@@ -76,11 +76,10 @@ bool confirm_dialog(Surface *background, std::string text)
   while(true)
     {
       SDL_Event event;
-
-      if(event.type == SDL_QUIT)
-        throw std::runtime_error("received window close event");
-      
       while (SDL_PollEvent(&event)) {
+        if(event.type == SDL_QUIT)
+          throw std::runtime_error("received window close event");
+        main_controller->process_event(event);
         dialog->event(event);
       }
 
@@ -691,6 +690,10 @@ int Menu::get_height() const
 void
 Menu::draw(DrawingContext& context)
 {
+  if(MouseCursor::current()) {
+    MouseCursor::current()->draw(context);
+  }
+  
   int menu_height = get_height();
   int menu_width = get_width();