From e7a070520aa3c241979f73fb67d6a62df4e86b66 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Sun, 16 Dec 2007 00:32:13 +0000 Subject: [PATCH] Improved console rendering at 16:10 aspect ratio SVN-Revision: 5194 --- src/console.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/console.cpp b/src/console.cpp index 77a1fcd0b..28ea36ce7 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include "console.hpp" @@ -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(); -- 2.11.0