Made WARNING build option usable again
[supertux.git] / src / object / floating_image.cpp
index c7e586a..856bafc 100644 (file)
@@ -20,7 +20,7 @@
 #include "supertux/globals.hpp"
 
 FloatingImage::FloatingImage(const std::string& spritefile) :
-  sprite(),
+  sprite(sprite_manager->create(spritefile)),
   layer(LAYER_FOREGROUND1 + 1), 
   visible(false), 
   anchor(ANCHOR_MIDDLE), 
@@ -28,7 +28,6 @@ FloatingImage::FloatingImage(const std::string& spritefile) :
   fading(0), 
   fadetime(0)
 {
-  sprite = sprite_manager->create(spritefile);
 }
 
 FloatingImage::~FloatingImage()
@@ -96,7 +95,7 @@ FloatingImage::draw(DrawingContext& context)
     return;
   }
 
-  Vector spos = pos + get_anchor_pos(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
+  Vector spos = pos + get_anchor_pos(Rectf(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
                                      sprite->get_width(), sprite->get_height(), anchor);
 
   sprite->draw(context, spos, layer);