Make it build with -DCOMPILE_AMALGATION=ON. Still not certain how intern_draw/next_po...
[supertux.git] / src / supertux / console.cpp
index ba171d0..e4f246c 100644 (file)
@@ -60,8 +60,8 @@ Console::init_graphics()
 {
   font.reset(new Font(Font::FIXED,"fonts/andale12.stf",1));
   fontheight = font->get_height();
-  background.reset(new Surface("images/engine/console.png"));
-  background2.reset(new Surface("images/engine/console2.png"));
+  background = Surface::create("images/engine/console.png");
+  background2 = Surface::create("images/engine/console2.png");
 }
 
 void
@@ -488,10 +488,10 @@ Console::draw(DrawingContext& context)
 
   context.push_transform();
   context.set_alpha(alpha);
-  context.draw_surface(background2.get(), Vector(SCREEN_WIDTH/2 - background->get_width()/2 - background->get_width() + backgroundOffset, height - background->get_height()), layer);
-  context.draw_surface(background2.get(), Vector(SCREEN_WIDTH/2 - background->get_width()/2 + backgroundOffset, height - background->get_height()), layer);
+  context.draw_surface(background2, Vector(SCREEN_WIDTH/2 - background->get_width()/2 - background->get_width() + backgroundOffset, height - background->get_height()), layer);
+  context.draw_surface(background2, Vector(SCREEN_WIDTH/2 - background->get_width()/2 + backgroundOffset, height - background->get_height()), layer);
   for (int x = (SCREEN_WIDTH/2 - background->get_width()/2 - (static_cast<int>(ceilf((float)SCREEN_WIDTH / (float)background->get_width()) - 1) * background->get_width())); x < SCREEN_WIDTH; x+=background->get_width()) {
-    context.draw_surface(background.get(), Vector(x, height - background->get_height()), layer);
+    context.draw_surface(background, Vector(x, height - background->get_height()), layer);
   }
   backgroundOffset+=10;
   if (backgroundOffset > (int)background->get_width()) backgroundOffset -= (int)background->get_width();
@@ -501,10 +501,10 @@ Console::draw(DrawingContext& context)
   if (focused) {
     lineNo++;
     float py = height-4-1 * font->get_height();
-    context.draw_text(font.get(), "> "+inputBuffer, Vector(4, py), ALIGN_LEFT, layer);
+    context.draw_text(font, "> "+inputBuffer, Vector(4, py), ALIGN_LEFT, layer);
     if (SDL_GetTicks() % 1000 < 750) {
       int cursor_px = 2 + inputBufferPosition;
-      context.draw_text(font.get(), "_", Vector(4 + (cursor_px * font->get_text_width("X")), py), ALIGN_LEFT, layer);
+      context.draw_text(font, "_", Vector(4 + (cursor_px * font->get_text_width("X")), py), ALIGN_LEFT, layer);
     }
   }
 
@@ -514,7 +514,7 @@ Console::draw(DrawingContext& context)
     lineNo++;
     float py = height - 4 - lineNo*font->get_height();
     if (py < -font->get_height()) break;
-    context.draw_text(font.get(), *i, Vector(4, py), ALIGN_LEFT, layer);
+    context.draw_text(font, *i, Vector(4, py), ALIGN_LEFT, layer);
   }
   context.pop_transform();
 }