- Fixed formatting in credits
authorRyan Flegel <rflegel@gmail.com>
Fri, 1 May 2009 01:18:31 +0000 (01:18 +0000)
committerRyan Flegel <rflegel@gmail.com>
Fri, 1 May 2009 01:18:31 +0000 (01:18 +0000)
- Fixed slow credits framerate by only drawing items that are on the screen

SVN-Revision: 5882

data/credits.txt
src/mainloop.cpp
src/textscroller.cpp

index 75896cf..fbae640 100644 (file)
        nn - Karl Ove Hufthammer
        pl - Dominik Klementowski
        pt - Ricardo Cruz
-        ru - Constantin Baranov
+       ru - Constantin Baranov
        sv - Arvid Norlander
-        uk - Eugen Uvin
+       uk - Eugen Uvin
 
 
 -Thanks to
index 0add5f9..4b99735 100644 (file)
@@ -73,7 +73,7 @@ MainLoop::push_screen(Screen* screen, ScreenFade* screen_fade)
   this->screen_fade.reset(screen_fade);
   nextpush = !nextpop;
   nextpop = false;
-  speed = 1.0;
+  speed = 1.0f;
 }
 
 void
index 5c85867..94a74ee 100644 (file)
@@ -124,7 +124,10 @@ TextScroller::draw(DrawingContext& context)
 
   float y = SCREEN_HEIGHT - scroll;
   for(size_t i = 0; i < lines.size(); i++) {
-    lines[i]->draw(context, Rect(LEFT_BORDER, y, SCREEN_WIDTH - 2*LEFT_BORDER, y), LAYER_GUI);
+    if (y + lines[i]->get_height() >= 0 && SCREEN_HEIGHT - y >= 0) {
+        lines[i]->draw(context, Rect(LEFT_BORDER, y, SCREEN_WIDTH - 2*LEFT_BORDER, y), LAYER_GUI);
+    }
+
     y += lines[i]->get_height();
   }