diff options
author | Torbjörn Andersson | 2010-04-29 03:54:20 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2010-04-29 03:54:20 +0000 |
commit | 763b1c7cb07da20f6d7d8a43e06b874a77914456 (patch) | |
tree | 350a66c68cc5e2814abad6dcd99263c0781ca1b8 /engines | |
parent | a0d55ca586cd232488ccb7193cdf8787a1b9ab8d (diff) | |
download | scummvm-rg350-763b1c7cb07da20f6d7d8a43e06b874a77914456.tar.gz scummvm-rg350-763b1c7cb07da20f6d7d8a43e06b874a77914456.tar.bz2 scummvm-rg350-763b1c7cb07da20f6d7d8a43e06b874a77914456.zip |
Fixed a glitch when a one-word text (e.g. "TOTENKOPF" in the first room, when
playing the German translation) doesn't fit on the screen at the desired
position.
svn-id: r48850
Diffstat (limited to 'engines')
-rw-r--r-- | engines/drascula/graphics.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 80cfa05b8d..00399816da 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -335,6 +335,17 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) { return; } + // If it's a one-word message it can't be broken up. It's probably a + // mouse-over text, so try just sliding it to the side a bit to make it + // fit. This happens with the word "TOTENKOPF" in the very first room + // with the German translation. + if (!strchr(msg, ' ')) { + int len = strlen(msg); + x = CLIP<int>(textX - len * CHAR_WIDTH / 2, 0, 319 - len * CHAR_WIDTH); + print_abc(msg, x, y); + return; + } + // Message doesn't fit on screen, split it // Get a word from the message |