aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/surfacesdl
diff options
context:
space:
mode:
authorCameron Cawley2019-11-01 11:39:46 +0000
committerAntoniou Athanasios2019-11-01 13:39:46 +0200
commit177d709909808313eee720ce76465cf99f909c5e (patch)
tree6d11f166342ddea46deb1634b106d010b4ab5181 /backends/graphics/surfacesdl
parent5d0206b9c297837fddb038601bdfb42b0fcb8016 (diff)
downloadscummvm-rg350-177d709909808313eee720ce76465cf99f909c5e.tar.gz
scummvm-rg350-177d709909808313eee720ce76465cf99f909c5e.tar.bz2
scummvm-rg350-177d709909808313eee720ce76465cf99f909c5e.zip
OPENGL: Implement high DPI support on Android (#1895)
* OPENGL: Implement high DPI support on Android * PSP2: Fix build
Diffstat (limited to 'backends/graphics/surfacesdl')
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp11
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 052ae37b9a..3b2e3eaf6f 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -1021,7 +1021,7 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
}
#if !SDL_VERSION_ATLEAST(2, 0, 0)
- handleResize(_videoMode.hardwareWidth, _videoMode.hardwareHeight);
+ handleResize(_videoMode.hardwareWidth, _videoMode.hardwareHeight, 90, 90);
#endif
//
@@ -2507,8 +2507,8 @@ void SurfaceSdlGraphicsManager::drawOSD() {
#endif
-void SurfaceSdlGraphicsManager::handleResizeImpl(const int width, const int height) {
- SdlGraphicsManager::handleResizeImpl(width, height);
+void SurfaceSdlGraphicsManager::handleResizeImpl(const int width, const int height, const int xdpi, const int ydpi) {
+ SdlGraphicsManager::handleResizeImpl(width, height, xdpi, ydpi);
recalculateDisplayAreas();
}
@@ -2715,7 +2715,7 @@ void SurfaceSdlGraphicsManager::notifyVideoExpose() {
void SurfaceSdlGraphicsManager::notifyResize(const int width, const int height) {
#if SDL_VERSION_ATLEAST(2, 0, 0)
- handleResize(width, height);
+ handleResize(width, height, _xdpi, _ydpi);
#endif
}
@@ -2762,8 +2762,9 @@ SDL_Surface *SurfaceSdlGraphicsManager::SDL_SetVideoMode(int width, int height,
return nullptr;
}
+ // TODO: Implement high DPI support
getWindowSizeFromSdl(&_windowWidth, &_windowHeight);
- handleResize(_windowWidth, _windowHeight);
+ handleResize(_windowWidth, _windowHeight, 90, 90);
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, _videoMode.filtering ? "linear" : "nearest");
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index f5edd160f9..a51aa22e9b 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -185,7 +185,7 @@ protected:
return _videoMode.scaleFactor;
}
- virtual void handleResizeImpl(const int width, const int height) override;
+ virtual void handleResizeImpl(const int width, const int height, const int xdpi, const int ydpi) override;
virtual int getGraphicsModeScale(int mode) const override;
virtual ScalerProc *getGraphicsScalerProc(int mode) const;