aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-12-24 09:44:15 -0500
committerPaul Gilbert2017-12-24 23:53:31 -0500
commit6b5eab62f6146beda92b686f10797b8e28a2ffe3 (patch)
treefd5456cdc4c15cbf408f39eb73c2c23b573c54cc
parentee1da05d0b7ade9e1f0e3062ca6e336a1dd80d59 (diff)
downloadscummvm-rg350-6b5eab62f6146beda92b686f10797b8e28a2ffe3.tar.gz
scummvm-rg350-6b5eab62f6146beda92b686f10797b8e28a2ffe3.tar.bz2
scummvm-rg350-6b5eab62f6146beda92b686f10797b8e28a2ffe3.zip
XEEN: Fix animated text cursor partialy overlapping prior char
-rw-r--r--engines/xeen/dialogs_input.cpp7
-rw-r--r--engines/xeen/font.cpp7
-rw-r--r--engines/xeen/font.h7
-rw-r--r--engines/xeen/window.h8
4 files changed, 24 insertions, 5 deletions
diff --git a/engines/xeen/dialogs_input.cpp b/engines/xeen/dialogs_input.cpp
index a0573d20ef..8346c8e47b 100644
--- a/engines/xeen/dialogs_input.cpp
+++ b/engines/xeen/dialogs_input.cpp
@@ -120,14 +120,11 @@ Common::KeyCode Input::waitForKey(const Common::String &msg) {
void Input::animateCursor() {
// Iterate through each frame
_cursorAnimIndex = _cursorAnimIndex ? _cursorAnimIndex - 1 : 5;
- static const int CURSOR_ANIMATION_IDS[] = { 32, 124, 126, 127, 126, 124 };
+ static const char CURSOR_ANIMATION_IDS[] = { 32, 124, 126, 127, 126, 124 };
// Form a string for the cursor and write it out
- Common::String cursorStr = Common::String::format("%c",
- CURSOR_ANIMATION_IDS[_cursorAnimIndex]);
-
Common::Point writePos = _window->_writePos;
- _window->writeString(cursorStr);
+ _window->writeCharacter(CURSOR_ANIMATION_IDS[_cursorAnimIndex]);
_window->_writePos = writePos;
}
diff --git a/engines/xeen/font.cpp b/engines/xeen/font.cpp
index 1d7dab7e21..3a70c4c8be 100644
--- a/engines/xeen/font.cpp
+++ b/engines/xeen/font.cpp
@@ -247,6 +247,13 @@ const char *FontSurface::writeString(const Common::String &s, const Common::Rect
return _displayString;
}
+void FontSurface::writeCharacter(char c, const Common::Rect &clipRect) {
+ Justify justify = _fontJustify;
+ _fontJustify = JUSTIFY_NONE;
+ writeString(Common::String::format("%c", c), clipRect);
+ _fontJustify = justify;
+}
+
char FontSurface::getNextChar() {
return *_displayString++ & 0x7f;
}
diff --git a/engines/xeen/font.h b/engines/xeen/font.h
index d4f10d64b9..ca2cf87ad4 100644
--- a/engines/xeen/font.h
+++ b/engines/xeen/font.h
@@ -96,6 +96,13 @@ public:
* justification is set, the message will be written at _writePos
*/
const char *writeString(const Common::String &s, const Common::Rect &clipRect);
+
+ /**
+ * Write a charcter to the window
+ * @param c Character
+ * @param clipRect Window bounds to display string within
+ */
+ void writeCharacter(char c, const Common::Rect &clipRect);
};
} // End of namespace Xeen
diff --git a/engines/xeen/window.h b/engines/xeen/window.h
index 2389065300..b63943f919 100644
--- a/engines/xeen/window.h
+++ b/engines/xeen/window.h
@@ -148,6 +148,14 @@ public:
const char *writeString(const Common::String &s) {
return FontSurface::writeString(s, _innerBounds);
}
+
+ /**
+ * Write a charcter to the window
+ * @param c Character
+ */
+ void writeCharacter(char c) {
+ FontSurface::writeCharacter(c, _innerBounds);
+ }
};
} // End of namespace Xeen