diff --git a/engines/xeen/dialogs_input.cpp b/engines/xeen/dialogs_input.cpp index a0573d20ef6..8346c8e47bf 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 1d7dab7e210..3a70c4c8bec 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 d4f10d64b91..ca2cf87ad4f 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 23890653007..b63943f9190 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