From a718713925ef79ddfa9dd545134a46eb918441ba Mon Sep 17 00:00:00 2001 From: Kostas Nakos Date: Sun, 1 Mar 2009 21:03:46 +0000 Subject: only center vertically in DW2 svn-id: r39052 --- engines/tinsel/graphics.cpp | 2 +- engines/tinsel/tinsel.cpp | 6 +++--- engines/tinsel/tinsel.h | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'engines') diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp index 4af2f0067a..73d8f03511 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -501,7 +501,7 @@ void ClearScreen() { * Updates the screen surface within the following rectangle */ void UpdateScreenRect(const Common::Rect &pClip) { - int yOffset = (g_system->getHeight() - SCREEN_HEIGHT) / 2; + int yOffset = TinselV2 ? (g_system->getHeight() - SCREEN_HEIGHT) / 2 : 0; byte *pSrc = (byte *)_vm->screen().getBasePtr(pClip.left, pClip.top); g_system->copyRectToScreen(pSrc, _vm->screen().pitch, pClip.left, pClip.top + yOffset, pClip.width(), pClip.height()); diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 80c71a70c5..9562d57bc2 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -1099,9 +1099,9 @@ bool TinselEngine::pollEvent() { { // This fragment takes care of Tinsel 2 when it's been compiled with // blank areas at the top and bottom of thes creen - int ySize = (g_system->getHeight() - _vm->screen().h) / 2; - if ((event.mouse.y >= ySize) && (event.mouse.y < (g_system->getHeight() - ySize))) - _mousePos = Common::Point(event.mouse.x, event.mouse.y - ySize); + int ySkip = TinselV2 ? (g_system->getHeight() - _vm->screen().h) / 2 : 0; + if ((event.mouse.y >= ySkip) && (event.mouse.y < (g_system->getHeight() - ySkip))) + _mousePos = Common::Point(event.mouse.x, event.mouse.y - ySkip); } break; diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h index d95b43564c..4806d499ef 100644 --- a/engines/tinsel/tinsel.h +++ b/engines/tinsel/tinsel.h @@ -124,6 +124,9 @@ typedef bool (*KEYFPTR)(const Common::KeyState &); #define TinselV1 (TinselVersion == TINSEL_V1) #define TinselV2 (TinselVersion == TINSEL_V2) +// Global reference to the TinselEngine object +extern TinselEngine *_vm; + class TinselEngine : public Engine { int _gameId; Common::KeyState _keyPressed; @@ -197,8 +200,8 @@ public: Common::Point getMousePosition() const { return _mousePos; } void setMousePosition(const Common::Point &pt) { - int ySize = (g_system->getHeight() - _screenSurface.h) / 2; - g_system->warpMouse(pt.x, pt.y + ySize); + int yOffset = TinselV2 ? (g_system->getHeight() - _screenSurface.h) / 2 : 0; + g_system->warpMouse(pt.x, pt.y + yOffset); _mousePos = pt; } void divertKeyInput(KEYFPTR fptr) { _keyHandler = fptr; } @@ -206,9 +209,6 @@ public: uint8 getKeyDirection() const { return _dosPlayerDir; } }; -// Global reference to the TinselEngine object -extern TinselEngine *_vm; - // Externally available methods void CuttingScene(bool bCutting); void CDChangeForRestore(int cdNumber); -- cgit v1.2.3