aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
authorCameron Cawley2019-06-21 16:12:23 +0100
committerFilippos Karapetis2019-06-22 01:15:39 +0300
commit0ddfe927cec767631161a23d55b9c07fff925745 (patch)
tree0d4cfb762a1b3358da3824df465eb6d1ac3d2ed4 /backends/graphics
parent6d2da5c6f1c3ecebe73d070637b912edbf486ffd (diff)
downloadscummvm-rg350-0ddfe927cec767631161a23d55b9c07fff925745.tar.gz
scummvm-rg350-0ddfe927cec767631161a23d55b9c07fff925745.tar.bz2
scummvm-rg350-0ddfe927cec767631161a23d55b9c07fff925745.zip
OPENGLSDL: Move getSupportedFormats into OpenGLGraphicsManager
Diffstat (limited to 'backends/graphics')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp48
-rw-r--r--backends/graphics/opengl/opengl-graphics.h2
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp50
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.h5
4 files changed, 49 insertions, 56 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 6eb961a9d4..c603070751 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -184,6 +184,54 @@ int OpenGLGraphicsManager::getGraphicsMode() const {
Graphics::PixelFormat OpenGLGraphicsManager::getScreenFormat() const {
return _currentState.gameFormat;
}
+
+Common::List<Graphics::PixelFormat> OpenGLGraphicsManager::getSupportedFormats() const {
+ Common::List<Graphics::PixelFormat> formats;
+
+ // Our default mode is (memory layout wise) RGBA8888 which is a different
+ // logical layout depending on the endianness. We chose this mode because
+ // it is the only 32bit color mode we can safely assume to be present in
+ // OpenGL and OpenGL ES implementations. Thus, we need to supply different
+ // logical formats based on endianness.
+#ifdef SCUMM_LITTLE_ENDIAN
+ // ABGR8888
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24));
+#else
+ // RGBA8888
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
+#endif
+ // RGB565
+ formats.push_back(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
+ // RGBA5551
+ formats.push_back(Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0));
+ // RGBA4444
+ formats.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0));
+
+#if !USE_FORCED_GLES && !USE_FORCED_GLES2
+#if !USE_FORCED_GL
+ if (!isGLESContext()) {
+#endif
+#ifdef SCUMM_LITTLE_ENDIAN
+ // RGBA8888
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
+#else
+ // ABGR8888
+ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24));
+#endif
+#if !USE_FORCED_GL
+ }
+#endif
+#endif
+
+ // RGB555, this is used by SCUMM HE 16 bit games.
+ // This is not natively supported by OpenGL ES implementations, we convert
+ // the pixel format internally.
+ formats.push_back(Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0));
+
+ formats.push_back(Graphics::PixelFormat::createFormatCLUT8());
+
+ return formats;
+}
#endif
void OpenGLGraphicsManager::beginGFXTransaction() {
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index df968aa67e..2e1df99534 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -72,7 +72,7 @@ public:
#ifdef USE_RGB_COLOR
virtual Graphics::PixelFormat getScreenFormat() const override;
- virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const override = 0;
+ virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const override;
#endif
virtual void beginGFXTransaction() override;
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index a7e7cb1ba0..f76a100521 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -330,56 +330,6 @@ void OpenGLSdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFor
return OpenGLGraphicsManager::initSize(w, h, format);
}
-#ifdef USE_RGB_COLOR
-Common::List<Graphics::PixelFormat> OpenGLSdlGraphicsManager::getSupportedFormats() const {
- Common::List<Graphics::PixelFormat> formats;
-
- // Our default mode is (memory layout wise) RGBA8888 which is a different
- // logical layout depending on the endianness. We chose this mode because
- // it is the only 32bit color mode we can safely assume to be present in
- // OpenGL and OpenGL ES implementations. Thus, we need to supply different
- // logical formats based on endianness.
-#ifdef SCUMM_LITTLE_ENDIAN
- // ABGR8888
- formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24));
-#else
- // RGBA8888
- formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
-#endif
- // RGB565
- formats.push_back(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
- // RGBA5551
- formats.push_back(Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0));
- // RGBA4444
- formats.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0));
-
-#if !USE_FORCED_GLES && !USE_FORCED_GLES2
-#if !USE_FORCED_GL
- if (!isGLESContext()) {
-#endif
-#ifdef SCUMM_LITTLE_ENDIAN
- // RGBA8888
- formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
-#else
- // ABGR8888
- formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24));
-#endif
-#if !USE_FORCED_GL
- }
-#endif
-#endif
-
- // RGB555, this is used by SCUMM HE 16 bit games.
- // This is not natively supported by OpenGL ES implementations, we convert
- // the pixel format internally.
- formats.push_back(Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0));
-
- formats.push_back(Graphics::PixelFormat::createFormatCLUT8());
-
- return formats;
-}
-#endif
-
void OpenGLSdlGraphicsManager::updateScreen() {
if (_ignoreResizeEvents) {
--_ignoreResizeEvents;
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h
index e30c2b8e49..ff2277669e 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.h
+++ b/backends/graphics/openglsdl/openglsdl-graphics.h
@@ -49,11 +49,6 @@ public:
virtual int getStretchMode() const override;
virtual void initSize(uint w, uint h, const Graphics::PixelFormat *format) override;
-
-#ifdef USE_RGB_COLOR
- virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const override;
-#endif
-
virtual void updateScreen() override;
// EventObserver API