aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/wincesdl
diff options
context:
space:
mode:
authorJohannes Schickel2011-08-08 23:46:05 +0200
committerJohannes Schickel2011-08-09 00:03:11 +0200
commit0630a88a04e9688d664751b6a68edf622d76b348 (patch)
tree87d7867c298c60272eff69777b16bff5c15c8bfe /backends/graphics/wincesdl
parentdedc74abfa44f7dac344da1868588193f91dd4f1 (diff)
downloadscummvm-rg350-0630a88a04e9688d664751b6a68edf622d76b348.tar.gz
scummvm-rg350-0630a88a04e9688d664751b6a68edf622d76b348.tar.bz2
scummvm-rg350-0630a88a04e9688d664751b6a68edf622d76b348.zip
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.
Diffstat (limited to 'backends/graphics/wincesdl')
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.cpp24
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.h2
2 files changed, 16 insertions, 10 deletions
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);