X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fconsole.cpp;h=fb1f5f3820e4bed50a11ed3b12f999a3c0669366;hb=c75799590ba936c673bea467b65518c3c2c2e284;hp=77a1fcd0b934e418dc54303c98e57de9c8097b68;hpb=acb34f126be4a62772ddab451cdca7127eec00a8;p=supertux.git diff --git a/src/console.cpp b/src/console.cpp index 77a1fcd0b..fb1f5f382 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include "console.hpp" @@ -232,7 +233,7 @@ sq_insert_command(std::list& 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 +241,7 @@ sq_insert_command(std::list& 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 +488,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(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();