aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-20 12:00:37 +0000
committerMartin Kiewitz2009-10-20 12:00:37 +0000
commit53e08b32e8a082e6451dc8768bf6859b1531f167 (patch)
tree203a4f3a99703d23a349d241ad229e3e44c5b827
parent255349b262b3ad0d000fe2e9c573263fa40a5faa (diff)
downloadscummvm-rg350-53e08b32e8a082e6451dc8768bf6859b1531f167.tar.gz
scummvm-rg350-53e08b32e8a082e6451dc8768bf6859b1531f167.tar.bz2
scummvm-rg350-53e08b32e8a082e6451dc8768bf6859b1531f167.zip
SCI/newgui: kDisplay fixed so text centering will work correctly (based on sierra sci disassembly) - fixes kq5 credits, lb2 intro selection
svn-id: r45264
-rw-r--r--engines/sci/gui/gui.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 49d6df2f72..24b87f68b9 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -177,7 +177,7 @@ void SciGui::display(const char *text, int argc, reg_t *argv) {
GuiTextAlignment alignment = SCI_TEXT_ALIGNMENT_LEFT;
int16 bgcolor = -1, width = -1, bRedraw = 1;
bool doSaveUnder = false;
- Common::Rect rect, *orect = &((GuiWindow *)_gfx->GetPort())->dims;
+ Common::Rect rect;
// Make a "backup" of the port settings
GuiPort oldPort = *_gfx->GetPort();
@@ -239,15 +239,12 @@ void SciGui::display(const char *text, int argc, reg_t *argv) {
}
}
- // FIXME: this code seems to be broken somewhat. KQ5 sets coordinates to 90, 80 and sets width to 320
- // our code can not handle this currently, so the text wont get centered as it should
- // clipping coordinates to 0, 0 isnt working either, because kq5 writes to coordinates 90, 80 AND 89, 80
- // to create a shadow of the font. Investigation into disassembly needed
-
// now drawing the text
_gfx->TextSize(rect, text, -1, width);
- _gfx->Move((orect->left <= _screen->_width ? 0 : _screen->_width - orect->left), (orect->top <= _screen->_height ? 0 : _screen->_height - orect->top)); // move port to (0,0)
rect.moveTo(_gfx->GetPort()->curLeft, _gfx->GetPort()->curTop);
+ _gfx->Move(rect.right <= _screen->_width ? 0 : _screen->_width - rect.right, rect.bottom <= _screen->_height ? 0 : _screen->_width - rect.bottom);
+ rect.moveTo(_gfx->GetPort()->curLeft, _gfx->GetPort()->curTop);
+
if (doSaveUnder)
_s->r_acc = _gfx->BitsSave(rect, SCI_SCREEN_MASK_VISUAL);
if (bgcolor != -1)