From: Wolfgang Becker Date: Sat, 10 Jun 2006 23:44:39 +0000 (+0000) Subject: Fadeout textscroller only once or it will never quit. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=54e868d71846a48c7f49f370a1bc05bf944e9181;p=supertux.git Fadeout textscroller only once or it will never quit. SVN-Revision: 3649 --- diff --git a/src/textscroller.cpp b/src/textscroller.cpp index ecf8fc765..b2d60bf91 100644 --- a/src/textscroller.cpp +++ b/src/textscroller.cpp @@ -41,8 +41,6 @@ static const float LEFT_BORDER = 50; static const float SCROLL = 60; static const float ITEMS_SPACE = 4; - - TextScroller::TextScroller(const std::string& filename) { defaultspeed = DEFAULT_SPEED; @@ -78,6 +76,7 @@ TextScroller::TextScroller(const std::string& filename) background.reset(new Surface("images/background/" + background_file)); scroll = 0; + fading = false; } TextScroller::~TextScroller() @@ -127,7 +126,8 @@ TextScroller::draw(DrawingContext& context) y += lines[i]->get_height(); } - if(y < 0) { + if(y < 0 && !fading ) { + fading = true; main_loop->exit_screen(new FadeOut(0.5)); } } diff --git a/src/textscroller.hpp b/src/textscroller.hpp index 604af0894..b9c534c8e 100644 --- a/src/textscroller.hpp +++ b/src/textscroller.hpp @@ -92,6 +92,7 @@ private: std::auto_ptr background; std::vector lines; float scroll; + bool fading; }; #endif