aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
authorCameron Cawley2019-12-12 23:01:10 +0000
committerFilippos Karapetis2019-12-15 16:06:56 +0200
commite92ac655be8ec5af44e00c5601380bd8f62ff70e (patch)
treee0f92900a055ae285dce7d2301ec626f4400afe7 /backends/graphics
parent2dc8b845c1768fda50943f6e9a78a8e6c3c361b6 (diff)
downloadscummvm-rg350-e92ac655be8ec5af44e00c5601380bd8f62ff70e.tar.gz
scummvm-rg350-e92ac655be8ec5af44e00c5601380bd8f62ff70e.tar.bz2
scummvm-rg350-e92ac655be8ec5af44e00c5601380bd8f62ff70e.zip
BACKENDS: Add default implementation for GraphicsMode functions
Diffstat (limited to 'backends/graphics')
-rw-r--r--backends/graphics/graphics.h13
-rw-r--r--backends/graphics/null/null-graphics.h7
-rw-r--r--backends/graphics/opengl/opengl-graphics.h2
3 files changed, 8 insertions, 14 deletions
diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h
index df4fb6a9e2..2f6cd0550f 100644
--- a/backends/graphics/graphics.h
+++ b/backends/graphics/graphics.h
@@ -42,11 +42,14 @@ public:
virtual void setFeatureState(OSystem::Feature f, bool enable) = 0;
virtual bool getFeatureState(OSystem::Feature f) const = 0;
- virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const = 0;
- virtual int getDefaultGraphicsMode() const = 0;
- virtual bool setGraphicsMode(int mode) = 0;
- virtual void resetGraphicsScale() = 0;
- virtual int getGraphicsMode() const = 0;
+ virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const {
+ static const OSystem::GraphicsMode noGraphicsModes[] = {{"NONE", "Normal", 0}, {nullptr, nullptr, 0 }};
+ return noGraphicsModes;
+ };
+ virtual int getDefaultGraphicsMode() const { return 0; }
+ virtual bool setGraphicsMode(int mode) { return (mode == 0); }
+ virtual void resetGraphicsScale() {}
+ virtual int getGraphicsMode() const { return 0; }
virtual const OSystem::GraphicsMode *getSupportedShaders() const {
static const OSystem::GraphicsMode no_shader[2] = {{"NONE", "Normal (no shader)", 0}, {0, 0, 0}};
return no_shader;
diff --git a/backends/graphics/null/null-graphics.h b/backends/graphics/null/null-graphics.h
index 3972904578..d050e98a03 100644
--- a/backends/graphics/null/null-graphics.h
+++ b/backends/graphics/null/null-graphics.h
@@ -25,8 +25,6 @@
#include "backends/graphics/graphics.h"
-static const OSystem::GraphicsMode s_noGraphicsModes[] = { {0, 0, 0} };
-
class NullGraphicsManager : public GraphicsManager {
public:
virtual ~NullGraphicsManager() {}
@@ -35,11 +33,6 @@ public:
void setFeatureState(OSystem::Feature f, bool enable) override {}
bool getFeatureState(OSystem::Feature f) const override { return false; }
- const OSystem::GraphicsMode *getSupportedGraphicsModes() const override { return s_noGraphicsModes; }
- int getDefaultGraphicsMode() const override { return 0; }
- bool setGraphicsMode(int mode) override { return true; }
- void resetGraphicsScale() override {}
- int getGraphicsMode() const override { return 0; }
inline Graphics::PixelFormat getScreenFormat() const override {
return Graphics::PixelFormat::createFormatCLUT8();
}
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 322f1d8017..e849c017b4 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -68,8 +68,6 @@ public:
virtual bool setGraphicsMode(int mode) override;
virtual int getGraphicsMode() const override;
- virtual void resetGraphicsScale() override {}
-
#ifdef USE_RGB_COLOR
virtual Graphics::PixelFormat getScreenFormat() const override;
virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const override;