[Scummvm-git-logs] scummvm master -> 6fd76c7efb60cf92583e619c2fe1320f5690460a
Helco
noreply at scummvm.org
Sun Sep 14 20:02:02 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
883674604a ALCACHOFA: Cleanly separate OpenGL-using interfaces
6fd76c7efb ALCACHOFA: Remove noexcept usage
Commit: 883674604a0263ebe74da9b898b4b88f2df945a0
https://github.com/scummvm/scummvm/commit/883674604a0263ebe74da9b898b4b88f2df945a0
Author: Helco (hermann.noll at hotmail.com)
Date: 2025-09-14T22:01:41+02:00
Commit Message:
ALCACHOFA: Cleanly separate OpenGL-using interfaces
Changed paths:
A engines/alcachofa/graphics-opengl-base.cpp
A engines/alcachofa/graphics-opengl-base.h
engines/alcachofa/configure.engine
engines/alcachofa/graphics-opengl-classic.cpp
engines/alcachofa/graphics-opengl-shaders.cpp
engines/alcachofa/graphics-opengl.cpp
engines/alcachofa/graphics-opengl.h
engines/alcachofa/graphics-tinygl.cpp
engines/alcachofa/graphics.h
engines/alcachofa/module.mk
diff --git a/engines/alcachofa/configure.engine b/engines/alcachofa/configure.engine
index d1f40219a55..76b390cff60 100644
--- a/engines/alcachofa/configure.engine
+++ b/engines/alcachofa/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine alcachofa "Alcachofa" no "" "" "highres mpeg2" "tinygl"
+add_engine alcachofa "Alcachofa" no "" "" "highres mpeg2 3d" "tinygl"
diff --git a/engines/alcachofa/graphics-opengl-base.cpp b/engines/alcachofa/graphics-opengl-base.cpp
new file mode 100644
index 00000000000..06361664888
--- /dev/null
+++ b/engines/alcachofa/graphics-opengl-base.cpp
@@ -0,0 +1,187 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "alcachofa/graphics-opengl-base.h"
+
+#include "common/config-manager.h"
+#include "common/system.h"
+#include "graphics/renderer.h"
+
+using namespace Common;
+using namespace Graphics;
+using namespace Math;
+
+namespace Alcachofa {
+
+static bool areComponentsInOrder(const PixelFormat &format, int r, int g, int b, int a) {
+ return format == PixelFormat(4, 8, 8, 8, 8, r * 8, g * 8, b * 8, a * 8);
+}
+
+bool isCompatibleFormat(const PixelFormat &format) {
+ return areComponentsInOrder(format, 0, 1, 2, 3) ||
+ areComponentsInOrder(format, 3, 2, 1, 0);
+}
+
+OpenGLTextureBase::OpenGLTextureBase(int32 w, int32 h, bool withMipmaps)
+ : ITexture({ (int16)w, (int16)h })
+ , _withMipmaps(withMipmaps) {}
+
+void OpenGLTextureBase::update(const Surface &surface) {
+ assert(isCompatibleFormat(surface.format));
+ assert(surface.w == size().x && surface.h == size().y);
+
+ // GLES2 only supports GL_RGBA but we need BlendBlit::getSupportedPixelFormat to use blendBlit
+ // We also do not want to keep surface memory for textures that are not updated repeatedly
+ const void *pixels;
+ if (!areComponentsInOrder(surface.format, 0, 1, 2, 3)) {
+ if (_tmpSurface.empty())
+ _tmpSurface.create(surface.w, surface.h, PixelFormat::createFormatRGBA32());
+ crossBlit(
+ (byte *)_tmpSurface.getPixels(),
+ (const byte *)surface.getPixels(),
+ _tmpSurface.pitch,
+ surface.pitch,
+ surface.w,
+ surface.h,
+ _tmpSurface.format,
+ surface.format);
+ pixels = _tmpSurface.getPixels();
+ } else {
+ pixels = surface.getPixels();
+ }
+
+ updateInner(pixels);
+
+ if (!_tmpSurface.empty()) {
+ if (!_didConvertOnce)
+ _tmpSurface.free();
+ _didConvertOnce = true;
+ }
+}
+
+OpenGLRendererBase::OpenGLRendererBase(Point resolution) : _resolution(resolution) {}
+
+bool OpenGLRendererBase::hasOutput() const {
+ return _currentOutput != nullptr;
+}
+
+void OpenGLRendererBase::resetState() {
+ setViewportToScreen();
+ _currentOutput = nullptr;
+ _currentLodBias = -1000.0f;
+ _currentBlendMode = (BlendMode)-1;
+ _isFirstDrawCommand = true;
+}
+
+void OpenGLRendererBase::setViewportToScreen() {
+ int32 screenWidth = g_system->getWidth();
+ int32 screenHeight = g_system->getHeight();
+ Rect viewport(
+ MIN<int32>(screenWidth, screenHeight * (float)_resolution.x / _resolution.y),
+ MIN<int32>(screenHeight, screenWidth * (float)_resolution.y / _resolution.x));
+ viewport.translate(
+ (screenWidth - viewport.width()) / 2,
+ (screenHeight - viewport.height()) / 2);
+
+ setViewportInner(viewport.left, viewport.top, viewport.width(), viewport.height());
+ setMatrices(true);
+}
+
+void OpenGLRendererBase::setViewportToRect(int16 outputWidth, int16 outputHeight) {
+ _outputSize.x = MIN(outputWidth, g_system->getWidth());
+ _outputSize.y = MIN(outputHeight, g_system->getHeight());
+ setViewportInner(0, 0, _outputSize.x, _outputSize.y);
+ setMatrices(false);
+}
+
+void OpenGLRendererBase::getQuadPositions(Vector2d topLeft, Vector2d size, Angle rotation, Vector2d positions[]) const {
+ positions[0] = topLeft + Vector2d(0, 0);
+ positions[1] = topLeft + Vector2d(0, +size.getY());
+ positions[2] = topLeft + Vector2d(+size.getX(), +size.getY());
+ positions[3] = topLeft + Vector2d(+size.getX(), 0);
+ if (abs(rotation.getDegrees()) > epsilon) {
+ const Vector2d zero(0, 0);
+ for (int i = 0; i < 4; i++)
+ positions[i].rotateAround(zero, rotation);
+ }
+}
+
+void OpenGLRendererBase::getQuadTexCoords(Vector2d texMin, Vector2d texMax, Vector2d texCoords[]) const {
+ texCoords[0] = { texMin.getX(), texMin.getY() };
+ texCoords[1] = { texMin.getX(), texMax.getY() };
+ texCoords[2] = { texMax.getX(), texMax.getY() };
+ texCoords[3] = { texMax.getX(), texMin.getY() };
+}
+
+IRenderer *IRenderer::createOpenGLRenderer(Point resolution) {
+ const auto available = Renderer::getAvailableTypes();
+ const auto &rendererCode = ConfMan.get("renderer");
+ RendererType rendererType = Renderer::parseTypeCode(rendererCode);
+ rendererType = (RendererType)(rendererType & available);
+
+ IRenderer *renderer = nullptr;
+ switch (rendererType) {
+ case kRendererTypeOpenGLShaders:
+ renderer = createOpenGLRendererShaders(resolution);
+ break;
+ case kRendererTypeOpenGL:
+ renderer = createOpenGLRendererClassic(resolution);
+ break;
+ case kRendererTypeTinyGL:
+ renderer = createTinyGLRenderer(resolution);
+ break;
+ default:
+ if (available & kRendererTypeOpenGLShaders)
+ renderer = createOpenGLRendererShaders(resolution);
+ else if (available & kRendererTypeOpenGL)
+ renderer = createOpenGLRendererClassic(resolution);
+ else if (available & kRendererTypeTinyGL)
+ renderer = createTinyGLRenderer(resolution);
+ break;
+ }
+
+ if (renderer == nullptr)
+ error("Could not create a renderer, available: %d", (int)available);
+ return renderer;
+}
+
+#ifndef USE_OPENGL_SHADERS
+IRenderer *IRenderer::createOpenGLRendererShaders(Point _) {
+ (void)_;
+ return nullptr;
+}
+#endif
+
+#ifndef USE_OPENGL_GAME
+IRenderer *IRenderer::createOpenGLRendererClassic(Point _) {
+ (void)_;
+ return nullptr;
+}
+#endif
+
+#ifndef USE_TINYGL
+IRenderer *IRenderer::createTinyGLRenderer(Point _) {
+ (void)_;
+ return nullptr;
+}
+#endif
+
+}
diff --git a/engines/alcachofa/graphics-opengl-base.h b/engines/alcachofa/graphics-opengl-base.h
new file mode 100644
index 00000000000..a9344b2e3db
--- /dev/null
+++ b/engines/alcachofa/graphics-opengl-base.h
@@ -0,0 +1,73 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef ALCACHOFA_GRAPHICS_OPENGL_BASE_H
+#define ALCACHOFA_GRAPHICS_OPENGL_BASE_H
+
+// This file shall not use any OpenGL API surface or include headers related to it
+
+#include "alcachofa/graphics.h"
+
+namespace Alcachofa {
+
+bool isCompatibleFormat(const Graphics::PixelFormat &format);
+
+class OpenGLTextureBase : public ITexture {
+public:
+ OpenGLTextureBase(int32 w, int32 h, bool withMipmaps);
+ ~OpenGLTextureBase() override = default;
+ void update(const Graphics::Surface &surface) override;
+
+protected:
+ virtual void updateInner(const void *pixels) = 0; ///< expects pixels to be RGBA32
+
+ bool _withMipmaps;
+ bool _mirrorWrap = true;
+ bool _didConvertOnce = false;
+ Graphics::ManagedSurface _tmpSurface;
+};
+
+class OpenGLRendererBase : public virtual IRenderer {
+public:
+ OpenGLRendererBase(Common::Point resolution);
+
+ bool hasOutput() const override;
+
+protected:
+ virtual void setViewportInner(int x, int y, int width, int height) = 0;
+ virtual void setMatrices(bool flipped) = 0;
+
+ void resetState();
+ void setViewportToScreen();
+ void setViewportToRect(int16 outputWidth, int16 outputHeight);
+ void getQuadPositions(Math::Vector2d topLeft, Math::Vector2d size, Math::Angle rotation, Math::Vector2d positions[]) const;
+ void getQuadTexCoords(Math::Vector2d texMin, Math::Vector2d texMax, Math::Vector2d texCoords[]) const;
+
+ Common::Point _resolution, _outputSize;
+ Graphics::Surface *_currentOutput = nullptr;
+ BlendMode _currentBlendMode = (BlendMode)-1;
+ float _currentLodBias = 0.0f;
+ bool _isFirstDrawCommand = false;
+};
+
+}
+
+#endif // ALCACHOFA_GRAPHICS_OPENGL_BASE_H
diff --git a/engines/alcachofa/graphics-opengl-classic.cpp b/engines/alcachofa/graphics-opengl-classic.cpp
index df10ab5ea13..8bf311c4d61 100644
--- a/engines/alcachofa/graphics-opengl-classic.cpp
+++ b/engines/alcachofa/graphics-opengl-classic.cpp
@@ -217,7 +217,7 @@ public:
}
};
-IRenderer *createOpenGLRendererClassic(Point resolution) {
+IRenderer *IRenderer::createOpenGLRendererClassic(Point resolution) {
debug("Use OpenGL classic renderer");
return new OpenGLRendererClassic(resolution);
}
diff --git a/engines/alcachofa/graphics-opengl-shaders.cpp b/engines/alcachofa/graphics-opengl-shaders.cpp
index 2f06d294544..90a82b6e8f7 100644
--- a/engines/alcachofa/graphics-opengl-shaders.cpp
+++ b/engines/alcachofa/graphics-opengl-shaders.cpp
@@ -248,7 +248,7 @@ private:
})";
};
-IRenderer *createOpenGLRendererShaders(Point resolution) {
+IRenderer *IRenderer::createOpenGLRendererShaders(Point resolution) {
debug("Use OpenGL shaders renderer");
return new OpenGLRendererShaders(resolution);
}
diff --git a/engines/alcachofa/graphics-opengl.cpp b/engines/alcachofa/graphics-opengl.cpp
index 57e7f4866be..2562071e588 100644
--- a/engines/alcachofa/graphics-opengl.cpp
+++ b/engines/alcachofa/graphics-opengl.cpp
@@ -36,110 +36,6 @@ using namespace Graphics;
namespace Alcachofa {
-static bool areComponentsInOrder(const PixelFormat &format, int r, int g, int b, int a) {
- return format == PixelFormat(4, 8, 8, 8, 8, r * 8, g * 8, b * 8, a * 8);
-}
-
-static bool isCompatibleFormat(const PixelFormat &format) {
- return areComponentsInOrder(format, 0, 1, 2, 3) ||
- areComponentsInOrder(format, 3, 2, 1, 0);
-}
-
-//
-// Base classes, no calls to gl* or tgl* in this area
-//
-
-OpenGLTextureBase::OpenGLTextureBase(int32 w, int32 h, bool withMipmaps)
- : ITexture({ (int16)w, (int16)h })
- , _withMipmaps(withMipmaps) { }
-
-void OpenGLTextureBase::update(const Surface &surface) {
- assert(isCompatibleFormat(surface.format));
- assert(surface.w == size().x && surface.h == size().y);
-
- // GLES2 only supports GL_RGBA but we need BlendBlit::getSupportedPixelFormat to use blendBlit
- // We also do not want to keep surface memory for textures that are not updated repeatedly
- const void *pixels;
- if (!areComponentsInOrder(surface.format, 0, 1, 2, 3)) {
- if (_tmpSurface.empty())
- _tmpSurface.create(surface.w, surface.h, PixelFormat::createFormatRGBA32());
- crossBlit(
- (byte *)_tmpSurface.getPixels(),
- (const byte *)surface.getPixels(),
- _tmpSurface.pitch,
- surface.pitch,
- surface.w,
- surface.h,
- _tmpSurface.format,
- surface.format);
- pixels = _tmpSurface.getPixels();
- } else {
- pixels = surface.getPixels();
- }
-
- updateInner(pixels);
-
- if (!_tmpSurface.empty()) {
- if (!_didConvertOnce)
- _tmpSurface.free();
- _didConvertOnce = true;
- }
-}
-
-OpenGLRendererBase::OpenGLRendererBase(Point resolution) : _resolution(resolution) {}
-
-bool OpenGLRendererBase::hasOutput() const {
- return _currentOutput != nullptr;
-}
-
-void OpenGLRendererBase::resetState() {
- setViewportToScreen();
- _currentOutput = nullptr;
- _currentLodBias = -1000.0f;
- _currentBlendMode = (BlendMode)-1;
- _isFirstDrawCommand = true;
-}
-
-void OpenGLRendererBase::setViewportToScreen() {
- int32 screenWidth = g_system->getWidth();
- int32 screenHeight = g_system->getHeight();
- Rect viewport(
- MIN<int32>(screenWidth, screenHeight * (float)_resolution.x / _resolution.y),
- MIN<int32>(screenHeight, screenWidth * (float)_resolution.y / _resolution.x));
- viewport.translate(
- (screenWidth - viewport.width()) / 2,
- (screenHeight - viewport.height()) / 2);
-
- setViewportInner(viewport.left, viewport.top, viewport.width(), viewport.height());
- setMatrices(true);
-}
-
-void OpenGLRendererBase::setViewportToRect(int16 outputWidth, int16 outputHeight) {
- _outputSize.x = MIN(outputWidth, g_system->getWidth());
- _outputSize.y = MIN(outputHeight, g_system->getHeight());
- setViewportInner(0, 0, _outputSize.x, _outputSize.y);
- setMatrices(false);
-}
-
-void OpenGLRendererBase::getQuadPositions(Vector2d topLeft, Vector2d size, Angle rotation, Vector2d positions[]) const {
- positions[0] = topLeft + Vector2d(0, 0);
- positions[1] = topLeft + Vector2d(0, +size.getY());
- positions[2] = topLeft + Vector2d(+size.getX(), +size.getY());
- positions[3] = topLeft + Vector2d(+size.getX(), 0);
- if (abs(rotation.getDegrees()) > epsilon) {
- const Vector2d zero(0, 0);
- for (int i = 0; i < 4; i++)
- positions[i].rotateAround(zero, rotation);
- }
-}
-
-void OpenGLRendererBase::getQuadTexCoords(Vector2d texMin, Vector2d texMax, Vector2d texCoords[]) const {
- texCoords[0] = { texMin.getX(), texMin.getY() };
- texCoords[1] = { texMin.getX(), texMax.getY() };
- texCoords[2] = { texMax.getX(), texMax.getY() };
- texCoords[3] = { texMax.getX(), texMin.getY() };
-}
-
OpenGLTexture::OpenGLTexture(int32 w, int32 h, bool withMipmaps)
: OpenGLTextureBase(w, h, withMipmaps) {
glEnable(GL_TEXTURE_2D); // will error on GLES2, but that is okay
@@ -292,57 +188,4 @@ void OpenGLRenderer::checkFirstDrawCommand() {
GL_CALL(glClear(GL_COLOR_BUFFER_BIT));
}
-IRenderer *IRenderer::createOpenGLRenderer(Point resolution) {
- const auto available = Renderer::getAvailableTypes();
- const auto &rendererCode = ConfMan.get("renderer");
- RendererType rendererType = Renderer::parseTypeCode(rendererCode);
- rendererType = (RendererType)(rendererType & available);
-
- IRenderer *renderer = nullptr;
- switch (rendererType) {
- case kRendererTypeOpenGLShaders:
- renderer = createOpenGLRendererShaders(resolution);
- break;
- case kRendererTypeOpenGL:
- renderer = createOpenGLRendererClassic(resolution);
- break;
- case kRendererTypeTinyGL:
- renderer = createTinyGLRenderer(resolution);
- break;
- default:
- if (available & kRendererTypeOpenGLShaders)
- renderer = createOpenGLRendererShaders(resolution);
- else if (available & kRendererTypeOpenGL)
- renderer = createOpenGLRendererClassic(resolution);
- else if (available & kRendererTypeTinyGL)
- renderer = createTinyGLRenderer(resolution);
- break;
- }
-
- if (renderer == nullptr)
- error("Could not create a renderer, GL context type: %d", (int)OpenGLContext.type);
- return renderer;
-}
-
-#ifndef USE_OPENGL_SHADERS
-IRenderer *createOpenGLRendererShaders(Point _) {
- (void)_;
- return nullptr;
-}
-#endif
-
-#ifndef USE_OPENGL_GAME
-IRenderer *createOpenGLRendererClassic(Point _) {
- (void)_;
- return nullptr;
-}
-#endif
-
-#ifndef USE_TINYGL
-IRenderer *createTinyGLRenderer(Point _) {
- (void)_;
- return nullptr;
-}
-#endif
-
}
diff --git a/engines/alcachofa/graphics-opengl.h b/engines/alcachofa/graphics-opengl.h
index 6badc386fb3..867b95b8d5f 100644
--- a/engines/alcachofa/graphics-opengl.h
+++ b/engines/alcachofa/graphics-opengl.h
@@ -22,7 +22,7 @@
#ifndef ALCACHOFA_GRAPHICS_OPENGL_H
#define ALCACHOFA_GRAPHICS_OPENGL_H
-#include "alcachofa/graphics.h"
+#include "alcachofa/graphics-opengl-base.h"
#include "graphics/managed_surface.h"
#include "graphics/opengl/system_headers.h"
@@ -30,57 +30,18 @@
namespace Alcachofa {
-/** This base class does not call any gl* functions so we can use it for TinyGL as well */
-class OpenGLTextureBase : public ITexture {
-public:
- OpenGLTextureBase(int32 w, int32 h, bool withMipmaps);
- ~OpenGLTextureBase() override = default;
- void update(const Graphics::Surface &surface) override;
-
- inline GLuint handle() const { return _handle; }
-
-protected:
- virtual void updateInner(const void *pixels) = 0; ///< expects pixels to be RGBA32
-
- GLuint _handle = 0;
- bool _withMipmaps;
- bool _mirrorWrap = true;
- bool _didConvertOnce = false;
- Graphics::ManagedSurface _tmpSurface;
-};
-
class OpenGLTexture : public OpenGLTextureBase {
public:
OpenGLTexture(int32 w, int32 h, bool withMipmaps);
~OpenGLTexture() override;
+ inline GLuint handle() const { return _handle; }
void setMirrorWrap(bool wrap);
protected:
void updateInner(const void *pixels) override;
-};
-
-class OpenGLRendererBase : public virtual IRenderer {
-public:
- OpenGLRendererBase(Common::Point resolution);
- bool hasOutput() const override;
-
-protected:
- virtual void setViewportInner(int x, int y, int width, int height) = 0;
- virtual void setMatrices(bool flipped) = 0;
-
- void resetState();
- void setViewportToScreen();
- void setViewportToRect(int16 outputWidth, int16 outputHeight);
- void getQuadPositions(Math::Vector2d topLeft, Math::Vector2d size, Math::Angle rotation, Math::Vector2d positions[]) const;
- void getQuadTexCoords(Math::Vector2d texMin, Math::Vector2d texMax, Math::Vector2d texCoords[]) const;
-
- Common::Point _resolution, _outputSize;
- Graphics::Surface *_currentOutput = nullptr;
- BlendMode _currentBlendMode = (BlendMode)-1;
- float _currentLodBias = 0.0f;
- bool _isFirstDrawCommand = false;
+ GLuint _handle = 0;
};
class OpenGLRenderer : public OpenGLRendererBase {
@@ -99,10 +60,6 @@ protected:
OpenGLTexture *_currentTexture = nullptr;
};
-IRenderer *createOpenGLRendererClassic(Common::Point resolution);
-IRenderer *createOpenGLRendererShaders(Common::Point resolution);
-IRenderer *createTinyGLRenderer(Common::Point resolution);
-
}
#endif // ALCACHOFA_GRAPHICS_OPENGL_H
diff --git a/engines/alcachofa/graphics-tinygl.cpp b/engines/alcachofa/graphics-tinygl.cpp
index 3c28184d44c..4ce2dd68dc2 100644
--- a/engines/alcachofa/graphics-tinygl.cpp
+++ b/engines/alcachofa/graphics-tinygl.cpp
@@ -21,7 +21,7 @@
#include "alcachofa/graphics.h"
#include "alcachofa/detection.h"
-#include "alcachofa/graphics-opengl.h"
+#include "alcachofa/graphics-opengl-base.h"
#include "common/system.h"
#include "common/config-manager.h"
@@ -52,6 +52,8 @@ public:
tglDeleteTextures(1, &_handle);
}
+ inline TGLuint handle() const { return _handle; }
+
protected:
void updateInner(const void *pixels) override {
tglEnable(TGL_TEXTURE_2D);
@@ -62,6 +64,8 @@ protected:
else
tglTexParameteri(TGL_TEXTURE_2D, TGL_TEXTURE_MAX_LEVEL, 0);
}
+
+ TGLuint _handle;
};
class TinyGLRenderer : public OpenGLRendererBase {
@@ -282,7 +286,7 @@ private:
TinyGLTexture *_currentTexture = nullptr;
};
-IRenderer *createTinyGLRenderer(Point resolution) {
+IRenderer *IRenderer::createTinyGLRenderer(Point resolution) {
debug("Use TinyGL renderer");
return new TinyGLRenderer(resolution);
}
diff --git a/engines/alcachofa/graphics.h b/engines/alcachofa/graphics.h
index 7687084cc48..fcd421d7d3d 100644
--- a/engines/alcachofa/graphics.h
+++ b/engines/alcachofa/graphics.h
@@ -93,6 +93,9 @@ public:
virtual void end() = 0;
static IRenderer *createOpenGLRenderer(Common::Point resolution);
+ static IRenderer *createOpenGLRendererClassic(Common::Point resolution);
+ static IRenderer *createOpenGLRendererShaders(Common::Point resolution);
+ static IRenderer *createTinyGLRenderer(Common::Point resolution);
};
class IDebugRenderer : public virtual IRenderer {
diff --git a/engines/alcachofa/module.mk b/engines/alcachofa/module.mk
index d4e01639654..294ea76ce07 100644
--- a/engines/alcachofa/module.mk
+++ b/engines/alcachofa/module.mk
@@ -11,7 +11,7 @@ MODULE_OBJS = \
general-objects.o \
global-ui.o \
graphics.o \
- graphics-opengl.o \
+ graphics-opengl-base.o \
input.o \
menu.o \
metaengine.o \
@@ -23,6 +23,14 @@ MODULE_OBJS = \
sounds.o \
ui-objects.o
+ifdef USE_OPENGL_GAME
+MODULE_OBJS += graphics-opengl.o
+else # create_project cannot handle else and ifdef on the same line
+ifdef USE_OPENGL_SHADERS
+MODULE_OBJS += graphics-opengl.o
+endif
+endif
+
ifdef USE_OPENGL_GAME
MODULE_OBJS += \
graphics-opengl-classic.o
Commit: 6fd76c7efb60cf92583e619c2fe1320f5690460a
https://github.com/scummvm/scummvm/commit/6fd76c7efb60cf92583e619c2fe1320f5690460a
Author: Helco (hermann.noll at hotmail.com)
Date: 2025-09-14T22:01:42+02:00
Commit Message:
ALCACHOFA: Remove noexcept usage
In order to try fix the RiscOS compilation
Changed paths:
engines/alcachofa/common.cpp
engines/alcachofa/common.h
diff --git a/engines/alcachofa/common.cpp b/engines/alcachofa/common.cpp
index 1f202eee319..9973fe98fc2 100644
--- a/engines/alcachofa/common.cpp
+++ b/engines/alcachofa/common.cpp
@@ -78,7 +78,7 @@ FakeLock::FakeLock(const FakeLock &other)
debug("copy");
}
-FakeLock::FakeLock(FakeLock &&other) noexcept
+FakeLock::FakeLock(FakeLock &&other)
: _name(other._name)
, _semaphore(other._semaphore) {
other._name = "<moved>";
@@ -91,7 +91,7 @@ FakeLock::~FakeLock() {
release();
}
-void FakeLock::operator= (FakeLock &&other) noexcept {
+void FakeLock::operator= (FakeLock &&other) {
release();
_name = other._name;
_semaphore = other._semaphore;
diff --git a/engines/alcachofa/common.h b/engines/alcachofa/common.h
index 8690dd66241..4009645aaaf 100644
--- a/engines/alcachofa/common.h
+++ b/engines/alcachofa/common.h
@@ -99,9 +99,9 @@ struct FakeLock {
FakeLock();
FakeLock(const char *name, FakeSemaphore &semaphore);
FakeLock(const FakeLock &other);
- FakeLock(FakeLock &&other) noexcept;
+ FakeLock(FakeLock &&other);
~FakeLock();
- void operator = (FakeLock &&other) noexcept;
+ void operator = (FakeLock &&other);
void release();
inline bool isReleased() const { return _semaphore == nullptr; }
More information about the Scummvm-git-logs
mailing list