aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kgraphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/kgraphics.cpp')
-rw-r--r--engines/sci/engine/kgraphics.cpp34
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;