aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorThierry Crozat2018-07-01 19:24:25 +0100
committerThierry Crozat2018-07-08 16:54:51 +0100
commit8526c2c31a07e57f7166047a87474bffd82e8a03 (patch)
tree76fbe1cfb1ef04e573aa64687e3ced1071dece9f /backends
parentff220fffa58142b5a049bcc5067538442ea7c677 (diff)
downloadscummvm-rg350-8526c2c31a07e57f7166047a87474bffd82e8a03.tar.gz
scummvm-rg350-8526c2c31a07e57f7166047a87474bffd82e8a03.tar.bz2
scummvm-rg350-8526c2c31a07e57f7166047a87474bffd82e8a03.zip
OSYSTEM: Add Stretch Mode API
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/graphics.h7
-rw-r--r--backends/modular-backend.cpp16
-rw-r--r--backends/modular-backend.h4
3 files changed, 27 insertions, 0 deletions
diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h
index d5c36c13c4..e7be2369ed 100644
--- a/backends/graphics/graphics.h
+++ b/backends/graphics/graphics.h
@@ -53,6 +53,13 @@ public:
};
virtual bool setShader(int id) { return false; }
virtual int getShader() const { return 0; }
+ virtual const OSystem::GraphicsMode *getSupportedStretchModes() const {
+ static const OSystem::GraphicsMode noStretchModes[] = {{"NONE", "Normal", 0}, {nullptr, nullptr, 0 }};
+ return noStretchModes;
+ }
+ virtual int getDefaultStretchMode() const { return 0; }
+ virtual bool setStretchMode(int mode) { return false; }
+ virtual int getStretchMode() const { return 0; }
#ifdef USE_RGB_COLOR
virtual Graphics::PixelFormat getScreenFormat() const = 0;
diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp
index 944ddd5a47..2c6aaba5a8 100644
--- a/backends/modular-backend.cpp
+++ b/backends/modular-backend.cpp
@@ -93,6 +93,22 @@ int ModularBackend::getShader() const {
return _graphicsManager->getShader();
}
+const OSystem::GraphicsMode *ModularBackend::getSupportedStretchModes() const {
+ return _graphicsManager->getSupportedStretchModes();
+}
+
+int ModularBackend::getDefaultStretchMode() const {
+ return _graphicsManager->getDefaultStretchMode();
+}
+
+bool ModularBackend::setStretchMode(int mode) {
+ return _graphicsManager->setStretchMode(mode);
+}
+
+int ModularBackend::getStretchMode() const {
+ return _graphicsManager->getStretchMode();
+}
+
void ModularBackend::resetGraphicsScale() {
_graphicsManager->resetGraphicsScale();
}
diff --git a/backends/modular-backend.h b/backends/modular-backend.h
index fa34f2921f..ead559cd8b 100644
--- a/backends/modular-backend.h
+++ b/backends/modular-backend.h
@@ -69,6 +69,10 @@ public:
virtual const GraphicsMode *getSupportedShaders() const override;
virtual int getShader() const override;
virtual bool setShader(int id) override;
+ virtual const GraphicsMode *getSupportedStretchModes() const override;
+ virtual int getDefaultStretchMode() const override;
+ virtual bool setStretchMode(int mode) override;
+ virtual int getStretchMode() const override;
virtual void resetGraphicsScale() override;
#ifdef USE_RGB_COLOR
virtual Graphics::PixelFormat getScreenFormat() const override;