diff options
author | Johannes Schickel | 2011-08-08 23:56:54 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-08-09 00:03:11 +0200 |
commit | 04ab0e58b4142bf58db2180a2bac6897821d069f (patch) | |
tree | 90d2ac00281dddf627a72b4ceb6e1add0c5960fd /backends/graphics/surfacesdl/surfacesdl-graphics.cpp | |
parent | 0630a88a04e9688d664751b6a68edf622d76b348 (diff) | |
download | scummvm-rg350-04ab0e58b4142bf58db2180a2bac6897821d069f.tar.gz scummvm-rg350-04ab0e58b4142bf58db2180a2bac6897821d069f.tar.bz2 scummvm-rg350-04ab0e58b4142bf58db2180a2bac6897821d069f.zip |
SDL: Take advantage of SdlGraphicsManager.
This gets rid of the hacks, where SdlEventSource added events with custom type
numbers to pass SDL_VIDEOEXPOSE and SDL_VIDEORESIZE to the graphics manager.
Furthermore it get rids of the uninituitive and hard to trace way of assigning
the proper mouse coordinates to mouse related events. Formerly it passed the
real screen coordinates through the even dispatching api to the graphics
manager (at least hopefully ;-) and let that handle creating a new event with
the proper coordinates. Now instead SdlEventSource handles the proper
coordinate setup itself.
Since this is a behavior change and I can not test all the SDL based small
devices ports this commit might break compilation for them and more serve it
might also break mouse position behavior. If any of that occurs I am sorry
about it.
Diffstat (limited to 'backends/graphics/surfacesdl/surfacesdl-graphics.cpp')
-rw-r--r-- | backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index 293fd9b188..f2dfdb8ff3 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -2235,20 +2235,6 @@ bool SurfaceSdlGraphicsManager::isScalerHotkey(const Common::Event &event) { return false; } -void SurfaceSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) { - if (!event.synthetic) { - Common::Event newEvent(event); - newEvent.synthetic = true; - if (!_overlayVisible) { - newEvent.mouse.x /= _videoMode.scaleFactor; - newEvent.mouse.y /= _videoMode.scaleFactor; - if (_videoMode.aspectRatioCorrection) - newEvent.mouse.y = aspect2Real(newEvent.mouse.y); - } - g_system->getEventManager()->pushEvent(newEvent); - } -} - void SurfaceSdlGraphicsManager::toggleFullScreen() { beginGFXTransaction(); setFullscreenMode(!_videoMode.fullscreen); @@ -2297,26 +2283,10 @@ bool SurfaceSdlGraphicsManager::notifyEvent(const Common::Event &event) { if (handleScalerHotkeys(event.kbd.keycode)) return true; } + case Common::EVENT_KEYUP: return isScalerHotkey(event); - case Common::EVENT_MOUSEMOVE: - if (event.synthetic) - setMousePos(event.mouse.x, event.mouse.y); - case Common::EVENT_LBUTTONDOWN: - case Common::EVENT_RBUTTONDOWN: - case Common::EVENT_WHEELUP: - case Common::EVENT_WHEELDOWN: - case Common::EVENT_MBUTTONDOWN: - case Common::EVENT_LBUTTONUP: - case Common::EVENT_RBUTTONUP: - case Common::EVENT_MBUTTONUP: - adjustMouseEvent(event); - return !event.synthetic; - - // HACK: Handle special SDL event - case OSystem_SDL::kSdlEventExpose: - _forceFull = true; - return false; + default: break; } |