aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/graphics.h2
-rw-r--r--backends/graphics/null/null-graphics.h2
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp54
-rw-r--r--backends/graphics/opengl/opengl-graphics.h4
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp2
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp96
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h4
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.cpp2
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.h2
-rw-r--r--backends/modular-backend.cpp4
-rw-r--r--backends/modular-backend.h2
-rw-r--r--backends/platform/android/android.h2
-rw-r--r--backends/platform/android/gfx.cpp7
-rw-r--r--backends/platform/dc/dc.h2
-rw-r--r--backends/platform/dc/display.cpp2
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.cpp6
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.h2
-rw-r--r--backends/platform/iphone/osys_main.h2
-rw-r--r--backends/platform/iphone/osys_video.mm4
-rw-r--r--backends/platform/n64/osys_n64.h2
-rw-r--r--backends/platform/n64/osys_n64_base.cpp2
-rw-r--r--backends/platform/ps2/systemps2.cpp2
-rw-r--r--backends/platform/ps2/systemps2.h2
-rw-r--r--backends/platform/psp/osys_psp.cpp6
-rw-r--r--backends/platform/psp/osys_psp.h2
-rw-r--r--backends/platform/wii/osystem.h2
-rw-r--r--backends/platform/wii/osystem_gfx.cpp5
27 files changed, 103 insertions, 121 deletions
diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h
index 3f282df587..0d6fa30418 100644
--- a/backends/graphics/graphics.h
+++ b/backends/graphics/graphics.h
@@ -80,7 +80,7 @@ public:
virtual bool showMouse(bool visible) = 0;
virtual void warpMouse(int x, int y) = 0;
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) = 0;
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL) = 0;
virtual void setCursorPalette(const byte *colors, uint start, uint num) = 0;
virtual void displayMessageOnOSD(const char *msg) {}
diff --git a/backends/graphics/null/null-graphics.h b/backends/graphics/null/null-graphics.h
index 2e6b24d147..2f8baae3e8 100644
--- a/backends/graphics/null/null-graphics.h
+++ b/backends/graphics/null/null-graphics.h
@@ -78,7 +78,7 @@ public:
bool showMouse(bool visible) { return !visible; }
void warpMouse(int x, int y) {}
- void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) {}
+ void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL) {}
void setCursorPalette(const byte *colors, uint start, uint num) {}
};
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index cd820ae3b2..8449048997 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -49,7 +49,7 @@ OpenGLGraphicsManager::OpenGLGraphicsManager()
_transactionMode(kTransactionNone),
_cursorNeedsRedraw(false), _cursorPaletteDisabled(true),
_cursorVisible(false), _cursorKeyColor(0),
- _cursorTargetScale(1),
+ _cursorDontScale(false),
_formatBGR(false),
_displayX(0), _displayY(0), _displayWidth(0), _displayHeight(0) {
@@ -591,7 +591,7 @@ void OpenGLGraphicsManager::warpMouse(int x, int y) {
setInternalMousePosition(scaledX, scaledY);
}
-void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
+void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
#ifdef USE_RGB_COLOR
if (format)
_cursorFormat = *format;
@@ -616,7 +616,7 @@ void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int
_cursorState.hotX = hotspotX;
_cursorState.hotY = hotspotY;
_cursorKeyColor = keycolor;
- _cursorTargetScale = cursorTargetScale;
+ _cursorDontScale = dontScale;
_cursorNeedsRedraw = true;
refreshCursorScale();
@@ -829,28 +829,19 @@ void OpenGLGraphicsManager::refreshCursor() {
}
void OpenGLGraphicsManager::refreshCursorScale() {
- // Calculate the scale factors of the screen. We limit ourselves to 3 at
- // most here to avoid really big (and ugly) cursors for big resolutions.
- // It might be noteworthy that 3 is the (current) target scale for the
- // modern theme and thus assures the cursor is *never* scaled.
+ // Calculate the scale factors of the screen.
// We also totally ignore the aspect of the overlay cursor, since aspect
// ratio correction only applies to the game screen.
- uint screenScaleFactorX = MIN(30000, _videoMode.hardwareWidth * 10000 / _videoMode.screenWidth);
- uint screenScaleFactorY = MIN(30000, _videoMode.hardwareHeight * 10000 / _videoMode.screenHeight);
-
- // Apply the target scale factor to the cursor.
- // It might be noteworthy we only apply any scaling to the cursor in case
- // the current scale factor is bigger than the target scale to match
- // SurfaceSdlGraphicsManager's behavior. Otherwise we would downscale the
- // GUI cursor of the modern theme for example.
- if (screenScaleFactorX > uint(_cursorTargetScale * 10000))
- screenScaleFactorX /= _cursorTargetScale;
- else
+ // TODO: It might make sense to always ignore scaling of the mouse cursor
+ // when the overlay is visible.
+ uint screenScaleFactorX = _videoMode.hardwareWidth * 10000 / _videoMode.screenWidth;
+ uint screenScaleFactorY = _videoMode.hardwareHeight * 10000 / _videoMode.screenHeight;
+
+ // Ignore scaling when the cursor should not be scaled.
+ if (_cursorDontScale) {
screenScaleFactorX = 10000;
- if (screenScaleFactorY > uint(_cursorTargetScale * 10000))
- screenScaleFactorY /= _cursorTargetScale;
- else
screenScaleFactorY = 10000;
+ }
// Apply them (without any possible) aspect ratio correction to the
// overlay.
@@ -859,16 +850,19 @@ void OpenGLGraphicsManager::refreshCursorScale() {
_cursorState.rHotX = (int16)(_cursorState.hotX * screenScaleFactorX / 10000);
_cursorState.rHotY = (int16)(_cursorState.hotY * screenScaleFactorY / 10000);
- // Make sure we properly scale the cursor according to the desired aspect.
- // It might be noteworthy that, unlike with the overlay, we do not limit
- // the scale factor here to avoid odd looks if the game uses items as
- // mouse cursor, which would otherwise suddenly be smaller.
- int width, height;
- calculateDisplaySize(width, height);
- screenScaleFactorX = (width * 10000 / _videoMode.screenWidth) / _cursorTargetScale;
- screenScaleFactorY = (height * 10000 / _videoMode.screenHeight) / _cursorTargetScale;
+ // Only apply scaling when it's desired.
+ if (_cursorDontScale) {
+ screenScaleFactorX = 10000;
+ screenScaleFactorY = 10000;
+ } else {
+ // Make sure we properly scale the cursor according to the desired aspect.
+ int width, height;
+ calculateDisplaySize(width, height);
+ screenScaleFactorX = (width * 10000 / _videoMode.screenWidth);
+ screenScaleFactorY = (height * 10000 / _videoMode.screenHeight);
+ }
- // Always scale the cursor for the game.
+ // Apply the scale cursor scaling for the game screen.
_cursorState.vW = (int16)(_cursorState.w * screenScaleFactorX / 10000);
_cursorState.vH = (int16)(_cursorState.h * screenScaleFactorY / 10000);
_cursorState.vHotX = (int16)(_cursorState.hotX * screenScaleFactorX / 10000);
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index ad8765bab1..956722c08f 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -104,7 +104,7 @@ public:
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual void displayMessageOnOSD(const char *msg);
@@ -283,7 +283,7 @@ protected:
MousePos _cursorState;
bool _cursorVisible;
uint32 _cursorKeyColor;
- int _cursorTargetScale;
+ bool _cursorDontScale;
bool _cursorNeedsRedraw;
/**
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index b37d631c6d..67041ae17b 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -160,7 +160,7 @@ void OpenGLSdlGraphicsManager::detectSupportedFormats() {
_hwscreen->format->Rshift, _hwscreen->format->Gshift,
_hwscreen->format->Bshift, _hwscreen->format->Ashift);
- // Workaround to MacOSX SDL not providing an accurate Aloss value.
+ // Workaround to SDL not providing an accurate Aloss value on Mac OS X.
if (_hwscreen->format->Amask == 0)
format.aLoss = 8;
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 9631c3c07e..652c08dc45 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -63,17 +63,12 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
DECLARE_TRANSLATION_ADDITIONAL_CONTEXT("Normal (no scaling)", "lowres")
-// Table of relative scalers magnitudes
-// [definedScale - 1][scaleFactor - 1]
-static ScalerProc *scalersMagn[3][3] = {
+// Table of the cursor scalers [scaleFactor - 1]
+static ScalerProc *scalersMagn[3] = {
#ifdef USE_SCALERS
- { Normal1x, AdvMame2x, AdvMame3x },
- { Normal1x, Normal1x, Normal1o5x },
- { Normal1x, Normal1x, Normal1x }
+ Normal1x, AdvMame2x, AdvMame3x
#else // remove dependencies on other scalers
- { Normal1x, Normal1x, Normal1x },
- { Normal1x, Normal1x, Normal1x },
- { Normal1x, Normal1x, Normal1x }
+ Normal1x, Normal1x, Normal1x
#endif
};
@@ -135,7 +130,7 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
_overlayscreen(0), _tmpscreen2(0),
_scalerProc(0), _screenChangeCount(0),
_mouseVisible(false), _mouseNeedsRedraw(false), _mouseData(0), _mouseSurface(0),
- _mouseOrigSurface(0), _cursorTargetScale(1), _cursorPaletteDisabled(true),
+ _mouseOrigSurface(0), _cursorDontScale(false), _cursorPaletteDisabled(true),
_currentShakePos(0), _newShakePos(0),
_paletteDirtyStart(0), _paletteDirtyEnd(0),
_screenIsLocked(false),
@@ -458,7 +453,7 @@ void SurfaceSdlGraphicsManager::detectSupportedFormats() {
_hwscreen->format->Rshift, _hwscreen->format->Gshift,
_hwscreen->format->Bshift, _hwscreen->format->Ashift);
- // Workaround to MacOSX SDL not providing an accurate Aloss value.
+ // Workaround to SDL not providing an accurate Aloss value on Mac OS X.
if (_hwscreen->format->Amask == 0)
format.aLoss = 8;
@@ -1718,7 +1713,7 @@ void SurfaceSdlGraphicsManager::warpMouse(int x, int y) {
}
}
-void SurfaceSdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
+void SurfaceSdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
#ifdef USE_RGB_COLOR
if (!format)
_cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
@@ -1739,7 +1734,7 @@ void SurfaceSdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h,
_mouseKeyColor = keycolor;
- _cursorTargetScale = cursorTargetScale;
+ _cursorDontScale = dontScale;
if (_mouseCurState.w != (int)w || _mouseCurState.h != (int)h) {
_mouseCurState.w = w;
@@ -1847,51 +1842,34 @@ void SurfaceSdlGraphicsManager::blitCursor() {
}
int rW, rH;
+ int cursorScale;
- if (_cursorTargetScale >= _videoMode.scaleFactor) {
- // The cursor target scale is greater or equal to the scale at
- // which the rest of the screen is drawn. We do not downscale
- // the cursor image, we draw it at its original size. It will
- // appear too large on screen.
-
- rW = w;
- rH = h;
- _mouseCurState.rHotX = _mouseCurState.hotX;
- _mouseCurState.rHotY = _mouseCurState.hotY;
-
- // The virtual dimensions may be larger than the original.
-
- _mouseCurState.vW = w * _cursorTargetScale / _videoMode.scaleFactor;
- _mouseCurState.vH = h * _cursorTargetScale / _videoMode.scaleFactor;
- _mouseCurState.vHotX = _mouseCurState.hotX * _cursorTargetScale /
- _videoMode.scaleFactor;
- _mouseCurState.vHotY = _mouseCurState.hotY * _cursorTargetScale /
- _videoMode.scaleFactor;
+ if (_cursorDontScale) {
+ // Don't scale the cursor at all if the user requests this behavior.
+ cursorScale = 1;
} else {
- // The cursor target scale is smaller than the scale at which
- // the rest of the screen is drawn. We scale up the cursor
- // image to make it appear correct.
+ // Scale the cursor with the game screen scale factor.
+ cursorScale = _videoMode.scaleFactor;
+ }
- rW = w * _videoMode.scaleFactor / _cursorTargetScale;
- rH = h * _videoMode.scaleFactor / _cursorTargetScale;
- _mouseCurState.rHotX = _mouseCurState.hotX * _videoMode.scaleFactor /
- _cursorTargetScale;
- _mouseCurState.rHotY = _mouseCurState.hotY * _videoMode.scaleFactor /
- _cursorTargetScale;
+ // Adapt the real hotspot according to the scale factor.
+ rW = w * cursorScale;
+ rH = h * cursorScale;
+ _mouseCurState.rHotX = _mouseCurState.hotX * cursorScale;
+ _mouseCurState.rHotY = _mouseCurState.hotY * cursorScale;
- // The virtual dimensions will be the same as the original.
+ // The virtual dimensions will be the same as the original.
- _mouseCurState.vW = w;
- _mouseCurState.vH = h;
- _mouseCurState.vHotX = _mouseCurState.hotX;
- _mouseCurState.vHotY = _mouseCurState.hotY;
- }
+ _mouseCurState.vW = w;
+ _mouseCurState.vH = h;
+ _mouseCurState.vHotX = _mouseCurState.hotX;
+ _mouseCurState.vHotY = _mouseCurState.hotY;
#ifdef USE_SCALERS
int rH1 = rH; // store original to pass to aspect-correction function later
#endif
- if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1) {
+ if (!_cursorDontScale && _videoMode.aspectRatioCorrection) {
rH = real2Aspect(rH - 1) + 1;
_mouseCurState.rHotY = real2Aspect(_mouseCurState.rHotY);
}
@@ -1922,21 +1900,25 @@ void SurfaceSdlGraphicsManager::blitCursor() {
ScalerProc *scalerProc;
- // If possible, use the same scaler for the cursor as for the rest of
- // the game. This only works well with the non-blurring scalers so we
- // actually only use the 1x, 1.5x, 2x and AdvMame scalers.
-
- if (_cursorTargetScale == 1 && (_videoMode.mode == GFX_DOUBLESIZE || _videoMode.mode == GFX_TRIPLESIZE))
- scalerProc = _scalerProc;
- else
- scalerProc = scalersMagn[_cursorTargetScale - 1][_videoMode.scaleFactor - 1];
+ // Only apply scaling, when the user allows it.
+ if (!_cursorDontScale) {
+ // If possible, use the same scaler for the cursor as for the rest of
+ // the game. This only works well with the non-blurring scalers so we
+ // actually only use the 1x, 2x and AdvMame scalers.
+ if (_videoMode.mode == GFX_DOUBLESIZE || _videoMode.mode == GFX_TRIPLESIZE)
+ scalerProc = _scalerProc;
+ else
+ scalerProc = scalersMagn[_videoMode.scaleFactor - 1];
+ } else {
+ scalerProc = Normal1x;
+ }
scalerProc((byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch + 2,
_mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch,
_mouseCurState.w, _mouseCurState.h);
#ifdef USE_SCALERS
- if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1)
+ if (!_cursorDontScale && _videoMode.aspectRatioCorrection)
cursorStretch200To240((uint8 *)_mouseSurface->pixels, _mouseSurface->pitch, rW, rH1, 0, 0, 0);
#endif
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index f71096d43e..32fb219bcd 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -131,7 +131,7 @@ public:
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
#ifdef USE_OSD
@@ -281,7 +281,7 @@ protected:
#else
byte _mouseKeyColor;
#endif
- int _cursorTargetScale;
+ bool _cursorDontScale;
bool _cursorPaletteDisabled;
SDL_Surface *_mouseOrigSurface;
SDL_Surface *_mouseSurface;
diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp
index 58b735ef8b..bb79813f3b 100644
--- a/backends/graphics/wincesdl/wincesdl-graphics.cpp
+++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp
@@ -1128,7 +1128,7 @@ void WINCESdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x
SDL_UnlockSurface(_screen);
}
-void WINCESdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
+void WINCESdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
undrawMouse();
if (w == 0 || h == 0)
diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h
index 2e8c3313b3..7cff8a16d9 100644
--- a/backends/graphics/wincesdl/wincesdl-graphics.h
+++ b/backends/graphics/wincesdl/wincesdl-graphics.h
@@ -73,7 +73,7 @@ public:
void internDrawMouse();
void undrawMouse();
bool showMouse(bool visible);
- void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format); // overloaded by CE backend
+ void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format); // overloaded by CE backend
void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
void copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h); // overloaded by CE backend (FIXME)
Graphics::Surface *lockScreen();
diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp
index 525170d685..f133c65ed5 100644
--- a/backends/modular-backend.cpp
+++ b/backends/modular-backend.cpp
@@ -195,8 +195,8 @@ void ModularBackend::warpMouse(int x, int y) {
_graphicsManager->warpMouse(x, y);
}
-void ModularBackend::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
- _graphicsManager->setMouseCursor(buf, w, h, hotspotX, hotspotY, keycolor, cursorTargetScale, format);
+void ModularBackend::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
+ _graphicsManager->setMouseCursor(buf, w, h, hotspotX, hotspotY, keycolor, dontScale, format);
}
void ModularBackend::setCursorPalette(const byte *colors, uint start, uint num) {
diff --git a/backends/modular-backend.h b/backends/modular-backend.h
index 072ee805b6..150c12c3c8 100644
--- a/backends/modular-backend.h
+++ b/backends/modular-backend.h
@@ -100,7 +100,7 @@ public:
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
//@}
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index 47a6515a2a..4dad1ee7ed 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -269,7 +269,7 @@ public:
virtual void warpMouse(int x, int y);
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
int hotspotY, uint32 keycolor,
- int cursorTargetScale,
+ bool dontScale,
const Graphics::PixelFormat *format);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index 8bc914f567..304031b4ba 100644
--- a/backends/platform/android/gfx.cpp
+++ b/backends/platform/android/gfx.cpp
@@ -687,10 +687,10 @@ bool OSystem_Android::showMouse(bool visible) {
void OSystem_Android::setMouseCursor(const byte *buf, uint w, uint h,
int hotspotX, int hotspotY,
- uint32 keycolor, int cursorTargetScale,
+ uint32 keycolor, bool dontScale,
const Graphics::PixelFormat *format) {
ENTER("%p, %u, %u, %d, %d, %u, %d, %p", buf, w, h, hotspotX, hotspotY,
- keycolor, cursorTargetScale, format);
+ keycolor, dontScale, format);
GLTHREADCHECK;
@@ -766,7 +766,8 @@ void OSystem_Android::setMouseCursor(const byte *buf, uint w, uint h,
}
_mouse_hotspot = Common::Point(hotspotX, hotspotY);
- _mouse_targetscale = cursorTargetScale;
+ // TODO: Adapt to the new "do not scale" cursor logic.
+ _mouse_targetscale = 1;
}
void OSystem_Android::setCursorPaletteInternal(const byte *colors,
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index 8ca48bf19e..ffe003ea1d 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -142,7 +142,7 @@ public:
void warpMouse(int x, int y);
// Set the bitmap that's used when drawing the cursor.
- void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
+ void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format);
// Replace the specified range of cursor the palette with new colors.
void setCursorPalette(const byte *colors, uint start, uint num);
diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp
index e886b55869..e4e9a94ec8 100644
--- a/backends/platform/dc/display.cpp
+++ b/backends/platform/dc/display.cpp
@@ -293,7 +293,7 @@ void OSystem_Dreamcast::warpMouse(int x, int y)
void OSystem_Dreamcast::setMouseCursor(const byte *buf, uint w, uint h,
int hotspot_x, int hotspot_y,
- uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format)
+ uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format)
{
_ms_cur_w = w;
_ms_cur_h = h;
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp
index 73340ed18a..a6b85f207f 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.cpp
+++ b/backends/platform/ds/arm9/source/osystem_ds.cpp
@@ -580,7 +580,7 @@ bool OSystem_DS::showMouse(bool visible) {
void OSystem_DS::warpMouse(int x, int y) {
}
-void OSystem_DS::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, u32 keycolor, int targetCursorScale, const Graphics::PixelFormat *format) {
+void OSystem_DS::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, u32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
if ((w > 0) && (w < 64) && (h > 0) && (h < 64)) {
memcpy(_cursorImage, buf, w * h);
_cursorW = w;
@@ -588,7 +588,9 @@ void OSystem_DS::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, i
_cursorHotX = hotspotX;
_cursorHotY = hotspotY;
_cursorKey = keycolor;
- _cursorScale = targetCursorScale;
+ // TODO: The old target scales was saved, but never used. Should the
+ // new "do not scale" logic be implemented?
+ //_cursorScale = targetCursorScale;
refreshCursor();
}
}
diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h
index 6aa3731916..11b0988666 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.h
+++ b/backends/platform/ds/arm9/source/osystem_ds.h
@@ -114,7 +114,7 @@ public:
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, u32 keycolor, int targetCursorScale, const Graphics::PixelFormat *format);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, u32 keycolor, bool dontScale, const Graphics::PixelFormat *format);
virtual bool pollEvent(Common::Event &event);
virtual uint32 getMillis();
diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h
index b443e22f56..e06c7973ab 100644
--- a/backends/platform/iphone/osys_main.h
+++ b/backends/platform/iphone/osys_main.h
@@ -161,7 +161,7 @@ public:
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 255, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 255, bool dontScale = false, const Graphics::PixelFormat *format = NULL);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual bool pollEvent(Common::Event &event);
diff --git a/backends/platform/iphone/osys_video.mm b/backends/platform/iphone/osys_video.mm
index c6b6e6d757..ddfa8f5030 100644
--- a/backends/platform/iphone/osys_video.mm
+++ b/backends/platform/iphone/osys_video.mm
@@ -398,8 +398,8 @@ void OSystem_IPHONE::dirtyFullOverlayScreen() {
}
}
-void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
- //printf("setMouseCursor(%p, %u, %u, %i, %i, %u, %d, %p)\n", (const void *)buf, w, h, hotspotX, hotspotY, keycolor, cursorTargetScale, (const void *)format);
+void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
+ //printf("setMouseCursor(%p, %u, %u, %i, %i, %u, %d, %p)\n", (const void *)buf, w, h, hotspotX, hotspotY, keycolor, dontScale, (const void *)format);
const Graphics::PixelFormat pixelFormat = format ? *format : Graphics::PixelFormat::createFormatCLUT8();
#if 0
diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h
index 4788beb1ca..b8519eeea6 100644
--- a/backends/platform/n64/osys_n64.h
+++ b/backends/platform/n64/osys_n64.h
@@ -182,7 +182,7 @@ public:
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual bool pollEvent(Common::Event &event);
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index c3adb9691c..f36f7399e1 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -773,7 +773,7 @@ void OSystem_N64::warpMouse(int x, int y) {
_dirtyOffscreen = true;
}
-void OSystem_N64::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
+void OSystem_N64::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
if (!w || !h) return;
_mouseHotspotX = hotspotX;
diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp
index d4e993da63..668ac93a07 100644
--- a/backends/platform/ps2/systemps2.cpp
+++ b/backends/platform/ps2/systemps2.cpp
@@ -618,7 +618,7 @@ void OSystem_PS2::warpMouse(int x, int y) {
_screen->setMouseXy(x, y);
}
-void OSystem_PS2::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
+void OSystem_PS2::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
_screen->setMouseOverlay(buf, w, h, hotspot_x, hotspot_y, keycolor);
}
diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h
index 3a0e247737..7bbe061e42 100644
--- a/backends/platform/ps2/systemps2.h
+++ b/backends/platform/ps2/systemps2.h
@@ -80,7 +80,7 @@ public:
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = 0);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = 0);
virtual uint32 getMillis();
virtual void delayMillis(uint msecs);
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 5fa5110684..958a3a22c6 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -303,7 +303,7 @@ void OSystem_PSP::warpMouse(int x, int y) {
_cursor.setXY(x, y);
}
-void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
+void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format) {
DEBUG_ENTER_FUNC();
_displayManager.waitUntilRenderFinished();
_pendingUpdate = false;
@@ -314,7 +314,9 @@ void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
}
_cursor.setKeyColor(keycolor);
- _cursor.setCursorTargetScale(cursorTargetScale);
+ // TODO: The old target scale was saved but never used. Should the new
+ // "do not scale" logic be implemented?
+ //_cursor.setCursorTargetScale(cursorTargetScale);
_cursor.setSizeAndScummvmPixelFormat(w, h, format);
_cursor.setHotspot(hotspotX, hotspotY);
_cursor.clearKeyColor();
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index e6b445e232..c72053f52c 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -118,7 +118,7 @@ public:
// Mouse related
bool showMouse(bool visible);
void warpMouse(int x, int y);
- void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
+ void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format);
// Events and input
bool pollEvent(Common::Event &event);
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index 64197f913a..b6784d59e4 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -189,7 +189,7 @@ public:
virtual void warpMouse(int x, int y);
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
int hotspotY, uint32 keycolor,
- int cursorTargetScale,
+ bool dontScale,
const Graphics::PixelFormat *format);
virtual bool pollEvent(Common::Event &event);
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index 83607984cc..a00cea8252 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -644,7 +644,7 @@ void OSystem_Wii::warpMouse(int x, int y) {
void OSystem_Wii::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
int hotspotY, uint32 keycolor,
- int cursorTargetScale,
+ bool dontScale,
const Graphics::PixelFormat *format) {
gfx_tex_format_t tex_format = GFX_TF_PALETTE_RGB5A3;
uint tw, th;
@@ -742,7 +742,8 @@ void OSystem_Wii::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
_mouseHotspotX = hotspotX;
_mouseHotspotY = hotspotY;
- _cursorScale = cursorTargetScale;
+ // TODO: Adapt to new dontScale logic!
+ _cursorScale = 1;
if ((_texMouse.palette) && (oldKeycolor != _mouseKeyColor))
_cursorPaletteDirty = true;