From 23a0f5318c50cdf3dce19e4de0c98fb5ae1c2618 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 7 Aug 2011 11:39:54 +0200 Subject: JANITORIAL: Remove trailing empty lines. --- backends/graphics/wincesdl/wincesdl-graphics.cpp | 1 - backends/graphics/wincesdl/wincesdl-graphics.h | 1 - 2 files changed, 2 deletions(-) (limited to 'backends/graphics/wincesdl') diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index 2ca78cedde..b1b4d4cbe7 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -1657,4 +1657,3 @@ WINCESdlGraphicsManager::zoneDesc WINCESdlGraphicsManager::_zones[TOTAL_ZONES] = }; #endif /* _WIN32_WCE */ - diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h index 92894e0dcd..c9fc145194 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.h +++ b/backends/graphics/wincesdl/wincesdl-graphics.h @@ -206,4 +206,3 @@ private: }; #endif /* BACKENDS_GRAPHICS_WINCE_SDL_H */ - -- cgit v1.2.3 From 0630a88a04e9688d664751b6a68edf622d76b348 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 8 Aug 2011 23:46:05 +0200 Subject: SDL: Let SDL based graphics managers inherit from SdlGraphicsManager. This also adapts port I can not test (not even the compilation). So if this breaks anything I am sorry about it. --- backends/graphics/wincesdl/wincesdl-graphics.cpp | 24 ++++++++++++++---------- backends/graphics/wincesdl/wincesdl-graphics.h | 2 ++ 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'backends/graphics/wincesdl') diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index b1b4d4cbe7..023000d6c1 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -1162,20 +1162,24 @@ void WINCESdlGraphicsManager::adjustMouseEvent(const Common::Event &event) { if (!event.synthetic) { Common::Event newEvent(event); newEvent.synthetic = true; - /* - if (!_overlayVisible) { - newEvent.mouse.x = newEvent.mouse.x * _scaleFactorXd / _scaleFactorXm; - newEvent.mouse.y = newEvent.mouse.y * _scaleFactorYd / _scaleFactorYm; - newEvent.mouse.x /= _videoMode.scaleFactor; - newEvent.mouse.y /= _videoMode.scaleFactor; - if (_videoMode.aspectRatioCorrection) - newEvent.mouse.y = aspect2Real(newEvent.mouse.y); - } - */ + transformMouseCoordinates(newEvent.mouse); g_system->getEventManager()->pushEvent(newEvent); } } +void WINCESdlGraphicsManager::transformMouseCoordinates(Common::Point &point) { + /* + if (!_overlayVisible) { + point.x = point.x * _scaleFactorXd / _scaleFactorXm; + point.y = point.y * _scaleFactorYd / _scaleFactorYm; + point.x /= _videoMode.scaleFactor; + point.y /= _videoMode.scaleFactor; + if (_videoMode.aspectRatioCorrection) + point.y = aspect2Real(point.y); + } + */ +} + void WINCESdlGraphicsManager::setMousePos(int x, int y) { if (x != _mouseCurState.x || y != _mouseCurState.y) { undrawMouse(); diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h index c9fc145194..f80a72b553 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.h +++ b/backends/graphics/wincesdl/wincesdl-graphics.h @@ -158,6 +158,8 @@ public: static zoneDesc _zones[TOTAL_ZONES]; + virtual void transformMouseCoordinates(Common::Point &point); + protected: virtual void adjustMouseEvent(const Common::Event &event); -- cgit v1.2.3 From 04ab0e58b4142bf58db2180a2bac6897821d069f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 8 Aug 2011 23:56:54 +0200 Subject: 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. --- backends/graphics/wincesdl/wincesdl-graphics.cpp | 9 --------- backends/graphics/wincesdl/wincesdl-graphics.h | 3 +-- 2 files changed, 1 insertion(+), 11 deletions(-) (limited to 'backends/graphics/wincesdl') diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index 023000d6c1..b0cbb872b0 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -1158,15 +1158,6 @@ void WINCESdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, in } } -void WINCESdlGraphicsManager::adjustMouseEvent(const Common::Event &event) { - if (!event.synthetic) { - Common::Event newEvent(event); - newEvent.synthetic = true; - transformMouseCoordinates(newEvent.mouse); - g_system->getEventManager()->pushEvent(newEvent); - } -} - void WINCESdlGraphicsManager::transformMouseCoordinates(Common::Point &point) { /* if (!_overlayVisible) { diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h index f80a72b553..edf3cc5769 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.h +++ b/backends/graphics/wincesdl/wincesdl-graphics.h @@ -160,8 +160,7 @@ public: virtual void transformMouseCoordinates(Common::Point &point); -protected: - virtual void adjustMouseEvent(const Common::Event &event); + virtual void transformMouseCoordinates(Common::Point &point); private: bool update_scalers(); -- cgit v1.2.3 From a72ab2f448b880a30dbce319808fca64c4121e40 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 9 Aug 2011 14:56:38 +0200 Subject: BACKENDS: Fix compilation. --- backends/graphics/wincesdl/wincesdl-graphics.cpp | 2 +- backends/graphics/wincesdl/wincesdl-graphics.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'backends/graphics/wincesdl') diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index b0cbb872b0..58b735ef8b 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -934,7 +934,7 @@ bool WINCESdlGraphicsManager::loadGFXMode() { _toolbarHigh = NULL; // keyboard cursor control, some other better place for it? - _sdlEventSource->resetKeyboadEmulation(_videoMode.screenWidth * _scaleFactorXm / _scaleFactorXd - 1, _videoMode.screenHeight * _scaleFactorXm / _scaleFactorXd - 1); + _eventSource->resetKeyboadEmulation(_videoMode.screenWidth * _scaleFactorXm / _scaleFactorXd - 1, _videoMode.screenHeight * _scaleFactorXm / _scaleFactorXd - 1); return true; } diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h index edf3cc5769..2e8c3313b3 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.h +++ b/backends/graphics/wincesdl/wincesdl-graphics.h @@ -160,8 +160,6 @@ public: virtual void transformMouseCoordinates(Common::Point &point); - virtual void transformMouseCoordinates(Common::Point &point); - private: bool update_scalers(); void drawToolbarMouse(SDL_Surface *surf, bool draw); -- cgit v1.2.3