Renamed Rect to Rectf
[supertux.git] / src / supertux / textscroller.cpp
index 48725fb..e3a3d45 100644 (file)
@@ -22,7 +22,7 @@
 #include "supertux/fadeout.hpp"
 #include "supertux/info_box_line.hpp"
 #include "supertux/globals.hpp"
-#include "supertux/mainloop.hpp"
+#include "supertux/screen_manager.hpp"
 #include "supertux/resources.hpp"
 #include "util/reader.hpp"
 #include "video/drawing_context.hpp"
@@ -70,7 +70,7 @@ TextScroller::TextScroller(const std::string& filename) :
   lines = InfoBoxLine::split(text, SCREEN_WIDTH - 2*LEFT_BORDER);
 
   // load background image
-  background.reset(new Surface("images/background/" + background_file));
+  background = Surface::create("images/background/" + background_file);
 
   scroll = 0;
   fading = false;
@@ -102,7 +102,7 @@ TextScroller::update(float elapsed_time)
      || g_main_controller->pressed(Controller::MENU_SELECT))
     scroll += SCROLL;
   if(g_main_controller->pressed(Controller::PAUSE_MENU)) {
-    g_main_loop->exit_screen(new FadeOut(0.5));
+    g_screen_manager->exit_screen(new FadeOut(0.5));
   }
 
   scroll += speed * elapsed_time;
@@ -121,7 +121,7 @@ TextScroller::draw(DrawingContext& context)
   float y = SCREEN_HEIGHT - scroll;
   for(size_t i = 0; i < lines.size(); i++) {
     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);
+      lines[i]->draw(context, Rectf(LEFT_BORDER, y, SCREEN_WIDTH - 2*LEFT_BORDER, y), LAYER_GUI);
     }
 
     y += lines[i]->get_height();
@@ -129,7 +129,7 @@ TextScroller::draw(DrawingContext& context)
 
   if(y < 0 && !fading ) {
     fading = true;
-    g_main_loop->exit_screen(new FadeOut(0.5));
+    g_screen_manager->exit_screen(new FadeOut(0.5));
   }
 }