diff options
author | Alyssa Milburn | 2011-08-22 20:03:05 +0200 |
---|---|---|
committer | Alyssa Milburn | 2011-08-22 20:03:05 +0200 |
commit | 84063dc9727a9f55e09d39574027beab695680e6 (patch) | |
tree | d71a9599cb550d9f7949a2d3209574064e054d85 /backends/graphics/dinguxsdl | |
parent | c6e89df3d940747a85d447f172e2323c800f5eaf (diff) | |
parent | a39a3eda46aea108a51556f001617ad28d29e520 (diff) | |
download | scummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.tar.gz scummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.tar.bz2 scummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.zip |
Merge remote-tracking branch 'origin/master' into soltys_wip2
Diffstat (limited to 'backends/graphics/dinguxsdl')
-rw-r--r-- | backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp | 39 | ||||
-rw-r--r-- | backends/graphics/dinguxsdl/dinguxsdl-graphics.h | 2 |
2 files changed, 21 insertions, 20 deletions
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp index 8075d0d45b..17a95688f3 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp @@ -122,7 +122,7 @@ void DINGUXSdlGraphicsManager::initSize(uint w, uint h) { if (w > 320 || h > 240) { setGraphicsMode(GFX_HALF); setGraphicsModeIntern(); - _sdlEventSource->toggleMouseGrab(); + _eventSource->toggleMouseGrab(); } _transactionDetails.sizeChanged = true; @@ -427,6 +427,7 @@ void DINGUXSdlGraphicsManager::hideOverlay() { } bool DINGUXSdlGraphicsManager::loadGFXMode() { + debug("Game ScreenMode = %d*%d", _videoMode.screenWidth, _videoMode.screenHeight); // Forcefully disable aspect ratio correction for games // which starts with a native 240px height resolution. @@ -435,7 +436,6 @@ bool DINGUXSdlGraphicsManager::loadGFXMode() { _videoMode.aspectRatioCorrection = false; } - debug("Game ScreenMode = %d*%d", _videoMode.screenWidth, _videoMode.screenHeight); if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) { _videoMode.aspectRatioCorrection = false; setGraphicsMode(GFX_HALF); @@ -473,9 +473,13 @@ bool DINGUXSdlGraphicsManager::hasFeature(OSystem::Feature f) { void DINGUXSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) { switch (f) { - case OSystem::kFeatureAspectRatioCorrection: + case OSystem::kFeatureAspectRatioCorrection: setAspectRatioCorrection(enable); break; + case OSystem::kFeatureCursorPalette: + _cursorPaletteDisabled = !enable; + blitCursor(); + break; default: break; } @@ -485,8 +489,10 @@ bool DINGUXSdlGraphicsManager::getFeatureState(OSystem::Feature f) { assert(_transactionMode == kTransactionNone); switch (f) { - case OSystem::kFeatureAspectRatioCorrection: - return _videoMode.aspectRatioCorrection; + case OSystem::kFeatureAspectRatioCorrection: + return _videoMode.aspectRatioCorrection; + case OSystem::kFeatureCursorPalette: + return !_cursorPaletteDisabled; default: return false; } @@ -510,21 +516,16 @@ void DINGUXSdlGraphicsManager::warpMouse(int x, int y) { SurfaceSdlGraphicsManager::warpMouse(x, y); } -void DINGUXSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) { - if (!event.synthetic) { - Common::Event newEvent(event); - newEvent.synthetic = true; - if (!_overlayVisible) { - if (_videoMode.mode == GFX_HALF) { - newEvent.mouse.x *= 2; - newEvent.mouse.y *= 2; - } - newEvent.mouse.x /= _videoMode.scaleFactor; - newEvent.mouse.y /= _videoMode.scaleFactor; - if (_videoMode.aspectRatioCorrection) - newEvent.mouse.y = aspect2Real(newEvent.mouse.y); +void DINGUXSdlGraphicsManager::transformMouseCoordinates(Common::Point &point) { + if (!_overlayVisible) { + if (_videoMode.mode == GFX_HALF) { + point.x *= 2; + point.y *= 2; } - g_system->getEventManager()->pushEvent(newEvent); + point.x /= _videoMode.scaleFactor; + point.y /= _videoMode.scaleFactor; + if (_videoMode.aspectRatioCorrection) + point.y = aspect2Real(point.y); } } diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h index 84a784b771..ecdd01d166 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h @@ -57,7 +57,7 @@ public: SurfaceSdlGraphicsManager::MousePos *getMouseCurState(); SurfaceSdlGraphicsManager::VideoState *getVideoMode(); - virtual void adjustMouseEvent(const Common::Event &event); + virtual void transformMouseCoordinates(Common::Point &point); }; #endif /* BACKENDS_GRAPHICS_SDL_DINGUX_H */ |