From 78fd335a4260a16664083fbf3333b8fba52e75ea Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 7 Dec 2008 18:49:35 +0000 Subject: More dirty rectangle related changes (dirty rectangle handling is still broken) svn-id: r35281 --- engines/saga/font.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'engines/saga/font.cpp') diff --git a/engines/saga/font.cpp b/engines/saga/font.cpp index d9d8a4ab8a..58c37a9e74 100644 --- a/engines/saga/font.cpp +++ b/engines/saga/font.cpp @@ -30,6 +30,7 @@ #include "saga/rscfile.h" #include "saga/font.h" +#include "saga/render.h" namespace Saga { @@ -304,15 +305,15 @@ void Font::outFont(const FontStyle &drawFont, const char *text, size_t count, co const byte *textPointer; byte *c_dataPointer; int c_code; - int charRow; + int charRow = 0; Point textPoint(point); byte *outputPointer; byte *outputPointer_min; byte *outputPointer_max; - int row; - int rowLimit; + int row = 0; + int rowLimit = 0; int c_byte_len; int c_byte; @@ -406,6 +407,10 @@ void Font::outFont(const FontStyle &drawFont, const char *text, size_t count, co // Advance tracking position textPoint.x += drawFont.fontCharEntry[c_code].tracking; } // end per-character processing + + rowLimit = (_vm->_gfx->getBackBufferHeight() < (textPoint.y + drawFont.header.charHeight)) ? _vm->_gfx->getBackBufferHeight() : textPoint.y + drawFont.header.charHeight; + // TODO: for now we add a dirty rect that ends at the right of the screen + _vm->_render->addDirtyRect(Common::Rect(textPoint.x, textPoint.y, _vm->_gfx->getBackBufferWidth(), rowLimit)); } -- cgit v1.2.3