X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmainloop.hpp;h=cb5bbeda250e537a486ece6ea7d54703685a1ef1;hb=7504b8ef1155259916f0e38eeb74a6024bb1d85b;hp=dfb2f9ed4d3a6787b826896a6fe0b05c5ef9e185;hpb=fc73efa7ff699fe3c9c237845b6f4fda0d999862;p=supertux.git diff --git a/src/mainloop.hpp b/src/mainloop.hpp index dfb2f9ed4..cb5bbeda2 100644 --- a/src/mainloop.hpp +++ b/src/mainloop.hpp @@ -21,9 +21,11 @@ #include #include +#include "scripting/thread_queue.hpp" class Screen; class Console; +class ScreenFade; class DrawingContext; class MainLoop @@ -31,28 +33,39 @@ 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); - + void draw(DrawingContext& context); + void update_gamelogic(float elapsed_time); + void process_events(); + void handle_screen_switch(); + bool running; float speed; + bool nextpop; bool nextpush; + /// measured fps + float fps; std::auto_ptr next_screen; std::auto_ptr current_screen; std::auto_ptr console; + std::auto_ptr screen_fade; std::vector screen_stack; }; extern MainLoop* main_loop; #endif -