diff options
author | Filippos Karapetis | 2009-05-25 16:30:39 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-05-25 16:30:39 +0000 |
commit | 5f7847d88d2c0a98d778ddd42a2f53df39b6a6fc (patch) | |
tree | 4249a6da2a9e059585c17b030e6afc68e67337e7 /engines | |
parent | db62ae8b332acf99e944d17e43b30485b153a6da (diff) | |
download | scummvm-rg350-5f7847d88d2c0a98d778ddd42a2f53df39b6a6fc.tar.gz scummvm-rg350-5f7847d88d2c0a98d778ddd42a2f53df39b6a6fc.tar.bz2 scummvm-rg350-5f7847d88d2c0a98d778ddd42a2f53df39b6a6fc.zip |
Re-enabled the code for correct text positioning - it should work correctly now
svn-id: r40891
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 3aefbe4c8d..884ac346db 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -3267,32 +3267,24 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) { } } - // 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) + if (halign == ALIGN_LEFT) { + // If the text does not fit on the screen, move it to the left and upwards until it does GFX_ASSERT(gfxop_get_text_params(s->gfx_state, font_nr, text, area.width, &area.width, &area.height, 0, NULL, NULL, NULL)); - // Make the text fit on the screen - if (area.x + area.width > 320) - area.x += 320 - area.x - area.width; // Plus negative number = subtraction + // Make the text fit on the screen + if (area.x + area.width > 320) + area.x += 320 - area.x - area.width; // Plus negative number = subtraction - if (area.y + area.height > 200) - area.y += 200 - area.y - area.height; // Plus negative number = subtraction -#else - // 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) { - 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 > 200) + area.y += 200 - area.y - area.height; // Plus negative number = subtraction + } else { + // 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 = s->gfx_state->pic_port_bounds.width - area.x; - 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; + if (area.y + area.height > s->gfx_state->pic_port_bounds.height) + area.height = s->gfx_state->pic_port_bounds.height - area.y; } -#endif - if (gray) color1 = &bg_color; |