fix cr/lfs and remove trailing whitespaces...
[supertux.git] / src / mainloop.hpp
index 20d2107..a69baaf 100644 (file)
@@ -1,5 +1,5 @@
-//  $Id: worldmap.hpp 2800 2005-10-02 22:57:31Z matzebraun $
-// 
+//  $Id$
+//
 //  SuperTux
 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
@@ -12,7 +12,7 @@
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //  GNU General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <memory>
 #include <vector>
+#include "scripting/thread_queue.hpp"
 
 class Screen;
 class Console;
+class ScreenFade;
+class DrawingContext;
 
 class MainLoop
 {
 public:
   MainLoop();
   ~MainLoop();
-  
+
   void run();
-  void exit_screen();
-  void quit();
+  void exit_screen(ScreenFade* fade = NULL);
+  void quit(ScreenFade* fade = NULL);
   void set_speed(float speed);
 
   // push new screen on screen_stack
-  void push_screen(Screen* screen);
+  void push_screen(Screen* screen, ScreenFade* fade = NULL);
+  void set_screen_fade(ScreenFade* fade);
+
+  /// threads that wait for a screenswitch
+  Scripting::ThreadQueue waiting_threads;
 
 private:
+  void draw_fps(DrawingContext& context, float fps);
+
   bool running;
   float speed;
+  bool nextpop;
   bool nextpush;
   std::auto_ptr<Screen> next_screen;
   std::auto_ptr<Screen> current_screen;
   std::auto_ptr<Console> console;
+  std::auto_ptr<ScreenFade> screen_fade;
   std::vector<Screen*> screen_stack;
 };
 
 extern MainLoop* main_loop;
 
 #endif
-