New grow and skid sounds from remaxim
[supertux.git] / src / console.cpp
index 77a1fcd..9c82a0e 100644 (file)
@@ -19,6 +19,7 @@
 #include <config.h>
 
 #include <iostream>
+#include <math.h>
 #include <SDL_timer.h>
 #include <SDL_keyboard.h>
 #include "console.hpp"
@@ -52,9 +53,7 @@ Console::~Console()
 void
 Console::init_graphics()
 {
-  font.reset(new Font(Font::FIXED,
-                      "images/engine/fonts/andale12.png",
-                      "images/engine/fonts/andale12-shadow.png", 7, 14, 1));
+  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"));
@@ -232,7 +231,7 @@ sq_insert_command(std::list<std::string>& cmds, HSQUIRRELVM vm, std::string tabl
       key_string+=".";
       if (search_prefix.substr(0, key_string.length()) == key_string) {
         sq_getclass(vm, -1);
-       sq_insert_commands(cmds, vm, key_string, search_prefix);
+        sq_insert_commands(cmds, vm, key_string, search_prefix);
         sq_pop(vm, 1);
       }
       break;
@@ -240,7 +239,7 @@ sq_insert_command(std::list<std::string>& cmds, HSQUIRRELVM vm, std::string tabl
     case OT_CLASS:
       key_string+=".";
       if (search_prefix.substr(0, key_string.length()) == key_string) {
-       sq_insert_commands(cmds, vm, key_string, search_prefix);
+        sq_insert_commands(cmds, vm, key_string, search_prefix);
       }
       break;
     case OT_CLOSURE:
@@ -487,7 +486,9 @@ Console::draw(DrawingContext& context)
   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(background.get(), Vector(SCREEN_WIDTH/2 - background->get_width()/2, 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);
+  }
   backgroundOffset+=10;
   if (backgroundOffset > (int)background->get_width()) backgroundOffset -= (int)background->get_width();