diff options
Diffstat (limited to 'engines/titanic/support')
-rw-r--r-- | engines/titanic/support/screen_manager.cpp | 18 | ||||
-rw-r--r-- | engines/titanic/support/screen_manager.h | 12 |
2 files changed, 22 insertions, 8 deletions
diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp index 0c9d3ab4e0..1a43d78dd0 100644 --- a/engines/titanic/support/screen_manager.cpp +++ b/engines/titanic/support/screen_manager.cpp @@ -201,12 +201,22 @@ void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src, void OSScreenManager::proc12() {} int OSScreenManager::writeString(int surfaceNum, const Rect &destRect, - int val1, const CString &str, CTextCursor *textCursor) { - if (_backSurfaces.empty()) + int yOffset, const CString &str, CTextCursor *textCursor) { + CVideoSurface *surface; + Rect bounds; + + if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size()) { + surface = _backSurfaces[surfaceNum]._surface; + bounds = _backSurfaces[surfaceNum]._bounds; + } else if (surfaceNum == -1) { + surface = _frontRenderSurface; + bounds = Rect(0, 0, surface->getWidth(), surface->getHeight()); + } else { return -1; + } - return _fonts[_fontNumber].writeString(_backSurfaces[surfaceNum]._surface, - destRect, _backSurfaces[surfaceNum]._bounds, val1, str, textCursor); + return _fonts[_fontNumber].writeString(surface, destRect, bounds, + yOffset, str, textCursor); } void OSScreenManager::proc14() {} diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h index b963fcd3d6..2e80869085 100644 --- a/engines/titanic/support/screen_manager.h +++ b/engines/titanic/support/screen_manager.h @@ -115,12 +115,14 @@ public: * Write a string * @param surfaceNum Destination surface * @param destRect Bounds within dest surface + * @param yOffset Y offset for drawing, to allow for parts of + * the text to be scrolled off-screen * @param str Line or lines to write * @param textCursor Optional text cursor pointer */ - virtual int writeString(int surfaceNum, const Rect &destRect, int val1, - const CString &str, CTextCursor *textCursor) = 0; - + virtual int writeString(int surfaceNum, const Rect &destRect, + int yOffset, const CString &str, CTextCursor *textCursor) = 0; + virtual void proc14() = 0; /** @@ -252,11 +254,13 @@ public: * Write a string * @param surfaceNum Destination surface * @param destRect Bounds within dest surface + * @param yOffset Y offset for drawing, to allow for parts of + * the text to be scrolled off-screen * @param str Line or lines to write * @param textCursor Optional text cursor pointer */ virtual int writeString(int surfaceNum, const Rect &destRect, - int val1, const CString &str, CTextCursor *textCursor); + int yOffset, const CString &str, CTextCursor *textCursor); virtual void proc14(); |