[Scummvm-git-logs] scummvm master -> ac06a27c062b3099cf1542fa5949062d072bcebb

bluegr noreply at scummvm.org
Fri Nov 22 08:30:46 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ac06a27c06 ENGINES: Define that a game is using 3D graphics on init - bug #15521


Commit: ac06a27c062b3099cf1542fa5949062d072bcebb
    https://github.com/scummvm/scummvm/commit/ac06a27c062b3099cf1542fa5949062d072bcebb
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-22T10:30:08+02:00

Commit Message:
ENGINES: Define that a game is using 3D graphics on init - bug #15521

Changed paths:
    engines/engine.cpp
    engines/sherlock/scalpel/scalpel.cpp
    engines/util.h


diff --git a/engines/engine.cpp b/engines/engine.cpp
index a5f557cb32b..bd37122427b 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -231,7 +231,7 @@ bool Engine::enhancementEnabled(int32 cls) {
 	return _activeEnhancements & cls;
 }
 
-void initCommonGFX() {
+void initCommonGFX(bool is3D) {
 	const Common::ConfigManager::Domain *gameDomain = ConfMan.getActiveDomain();
 
 	// Any global or command line settings already have been applied at the time
@@ -253,7 +253,7 @@ void initCommonGFX() {
 		g_system->setStretchMode(ConfMan.get("stretch_mode").c_str());
 
 	// Stop here for hardware-accelerated 3D games
-	if (g_system->hasFeature(OSystem::kFeatureOpenGLForGame))
+	if (is3D)
 		return;
 
 	// Set up filtering, scaling and shaders for 2D games
@@ -370,7 +370,7 @@ int initGraphicsAny(const Graphics::ModeWithFormatList &modes, int start) {
 
 	for (candidate = start; candidate < (int)modes.size(); candidate++) {
 		g_system->beginGFXTransaction();
-		initCommonGFX();
+		initCommonGFX(false);
 #ifdef USE_RGB_COLOR
 		if (modes[candidate].hasFormat)
 			g_system->initSize(modes[candidate].width, modes[candidate].height, &modes[candidate].format);
@@ -492,7 +492,7 @@ void initGraphics(int width, int height) {
 void initGraphics3d(int width, int height) {
 	g_system->beginGFXTransaction();
 		g_system->setGraphicsMode(0, OSystem::kGfxModeRender3d);
-		initCommonGFX();
+		initCommonGFX(true);
 		g_system->initSize(width, height);
 	g_system->endGFXTransaction();
 
@@ -518,7 +518,7 @@ void GUIErrorMessage(const Common::String &msg, const char *url) {
 void GUIErrorMessage(const Common::U32String &msg, const char *url) {
 	g_system->setWindowCaption(_("Error"));
 	g_system->beginGFXTransaction();
-		initCommonGFX();
+		initCommonGFX(false);
 		g_system->initSize(320, 200);
 	if (g_system->endGFXTransaction() == OSystem::kTransactionSuccess) {
 		if (url) {
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index 9c15d1f9aff..e502171f774 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -257,7 +257,7 @@ void ScalpelEngine::setupGraphics() {
 
 		// First try for a 640x400 mode
 		g_system->beginGFXTransaction();
-			initCommonGFX();
+			initCommonGFX(false);
 			g_system->initSize(640, 400, &pixelFormatRGB565);
 		OSystem::TransactionError gfxError = g_system->endGFXTransaction();
 
diff --git a/engines/util.h b/engines/util.h
index 37c00f689f0..db68ae24de6 100644
--- a/engines/util.h
+++ b/engines/util.h
@@ -39,8 +39,10 @@
 
 /**
  * Set up the graphics mode of the backend.
+ *
+ * @param is3D: set to true if the game to be launched uses 3D graphics
  */
-void initCommonGFX();
+void initCommonGFX(bool is3D);
 
 /**
  * Send a list of graphics modes to the backend so it can make a decision




More information about the Scummvm-git-logs mailing list