diff options
author | Filippos Karapetis | 2009-05-23 12:08:36 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-05-23 12:08:36 +0000 |
commit | 91d2fa2d0de0292292344736b56b7e646ac9772f (patch) | |
tree | 169779b236c51978d7de6b95d5b5f77cb1f75f4c /engines/sci/engine | |
parent | f77dfe9d23374733c2553765bcdc7037ed2b649d (diff) | |
download | scummvm-rg350-91d2fa2d0de0292292344736b56b7e646ac9772f.tar.gz scummvm-rg350-91d2fa2d0de0292292344736b56b7e646ac9772f.tar.bz2 scummvm-rg350-91d2fa2d0de0292292344736b56b7e646ac9772f.zip |
Fixed clipping code for texts which do not fit on screen, and added a warning when this happens
svn-id: r40807
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 865ed2dcc4..580ec4fc54 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -3268,7 +3268,8 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) { } } - // This code places texts incorrectly on screen + // FIXME: This code places texts incorrectly on screen. Apparently, it was used for latter SCI1 games + // (1.000.510 onwards), like Eco Quest 1. It has been replaced with clipping code instead #if 0 // If the text does not fit on the screen, move it to the left and upwards until it does if (halign == ALIGN_LEFT) @@ -3281,13 +3282,16 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) { if (area.y + area.height > 200) area.y += 200 - area.y - area.height; // Plus negative number = subtraction #else - // Replaced with this instead // If the text does not fit on the screen, clip it till it does - if (area.x + area.width > s->gfx_state->pic_port_bounds.width) - area.width = CLIP<int>(area.width, 0, s->gfx_state->pic_port_bounds.width); + if (area.x + area.width > s->gfx_state->pic_port_bounds.width) { + warning("Text does not fit on screen width, clipping it"); + area.width = s->gfx_state->pic_port_bounds.width - area.x; + } - if (area.y + area.height > s->gfx_state->pic_port_bounds.height) - area.height = CLIP<int>(area.height, 0, s->gfx_state->pic_port_bounds.height); + if (area.y + area.height > s->gfx_state->pic_port_bounds.height) { + warning("Text does not fit on screen height, clipping it"); + area.height = s->gfx_state->pic_port_bounds.height - area.y; + } #endif |