[Scummvm-git-logs] scummvm master -> fe5efeecb80cf1d00784a66ca0102cb1c4c3c6e2
bluegr
noreply at scummvm.org
Fri Oct 23 05:10:29 UTC 2026
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:
b0243d6c21 BASE: Fix --list-games and --list-engines with uncached plugins
fe5efeecb8 BASE: Fix invalid JSON output of --list-games-json
Commit: b0243d6c2159a038f5f051726f292349125d8427
https://github.com/scummvm/scummvm/commit/b0243d6c2159a038f5f051726f292349125d8427
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2026-10-23T08:10:23+03:00
Commit Message:
BASE: Fix --list-games and --list-engines with uncached plugins
Both commands printed only the table header on platforms using the
uncached plugin manager (Atari, 3DS, PSP, Wii, ...), because at that
point no engine plugin is in memory.
Since commit 003d4cda09d and commit 17740940890, the lists are built
from the engine plugins in memory, which assumes all of them have been
loaded.
Load the engine plugins one at a time instead (and unload afterwards).
Changed paths:
base/commandLine.cpp
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index c29d1eb09ac..9242b917528 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -1096,33 +1096,37 @@ static void listGames(const Common::String &engineID, bool jsonOutput) {
"------------------------------ -----------------------------------------------------------\n");
}
- const PluginList &plugins = EngineMan.getPlugins(PLUGIN_TYPE_ENGINE);
- for (const auto &plugin : plugins) {
- const Plugin *p = EngineMan.findDetectionPlugin(plugin->getName());
- /* If for some reason, we can't find the MetaEngineDetection for this Engine, just ignore it */
- if (!p) {
- continue;
- }
+ // The uncached plugin manager keeps only one engine plugin in memory at a time
+ PluginMan.loadFirstPlugin();
+ do {
+ const PluginList &plugins = EngineMan.getPlugins(PLUGIN_TYPE_ENGINE);
+ for (const auto &plugin : plugins) {
+ const Plugin *p = EngineMan.findDetectionPlugin(plugin->getName());
+ /* If for some reason, we can't find the MetaEngineDetection for this Engine, just ignore it */
+ if (!p) {
+ continue;
+ }
- if (all || Common::find(engines.begin(), engines.end(), p->getName()) != engines.end()) {
- PlainGameList list = p->get<MetaEngineDetection>().getSupportedGames();
- bool first = true;
- for (const auto &v : list) {
- const Common::String &gameId = buildQualifiedGameName(p->get<MetaEngineDetection>().getName(), v.gameId);
- if (jsonOutput) {
- if (!first) {
- printf(",\n");
+ if (all || Common::find(engines.begin(), engines.end(), p->getName()) != engines.end()) {
+ PlainGameList list = p->get<MetaEngineDetection>().getSupportedGames();
+ bool first = true;
+ for (const auto &v : list) {
+ const Common::String &gameId = buildQualifiedGameName(p->get<MetaEngineDetection>().getName(), v.gameId);
+ if (jsonOutput) {
+ if (!first) {
+ printf(",\n");
+ } else {
+ printf("\n");
+ }
+ first = false;
+ printf(" \"%s\": \"%s\"", gameId.c_str(), v.description);
} else {
- printf("\n");
+ printf("%-30s %s\n", gameId.c_str(), v.description);
}
- first = false;
- printf(" \"%s\": \"%s\"", gameId.c_str(), v.description);
- } else {
- printf("%-30s %s\n", gameId.c_str(), v.description);
}
}
}
- }
+ } while (PluginMan.loadNextPlugin());
if (jsonOutput) {
printf("\n}\n");
}
@@ -1162,28 +1166,32 @@ static void listEngines(bool jsonOutput) {
"--------------- ------------------------------------------------------\n");
}
- const PluginList &plugins = EngineMan.getPlugins(PLUGIN_TYPE_ENGINE);
bool first = true;
- for (const auto &plugin : plugins) {
- const Plugin *p = EngineMan.findDetectionPlugin(plugin->getName());
- /* If for some reason, we can't find the MetaEngineDetection for this Engine, just ignore it */
- if (!p) {
- continue;
- }
+ // The uncached plugin manager keeps only one engine plugin in memory at a time
+ PluginMan.loadFirstPlugin();
+ do {
+ const PluginList &plugins = EngineMan.getPlugins(PLUGIN_TYPE_ENGINE);
+ for (const auto &plugin : plugins) {
+ const Plugin *p = EngineMan.findDetectionPlugin(plugin->getName());
+ /* If for some reason, we can't find the MetaEngineDetection for this Engine, just ignore it */
+ if (!p) {
+ continue;
+ }
- if (jsonOutput) {
- if (!first) {
- printf(",\n");
+ if (jsonOutput) {
+ if (!first) {
+ printf(",\n");
+ } else {
+ printf("\n");
+ first = false;
+ }
+ printf(" \"%s\": \"%s\"", p->get<MetaEngineDetection>().getName(),
+ p->get<MetaEngineDetection>().getEngineName());
} else {
- printf("\n");
- first = false;
+ printf("%-15s %s\n", p->get<MetaEngineDetection>().getName(), p->get<MetaEngineDetection>().getEngineName());
}
- printf(" \"%s\": \"%s\"", p->get<MetaEngineDetection>().getName(),
- p->get<MetaEngineDetection>().getEngineName());
- } else {
- printf("%-15s %s\n", p->get<MetaEngineDetection>().getName(), p->get<MetaEngineDetection>().getEngineName());
}
- }
+ } while (PluginMan.loadNextPlugin());
if (jsonOutput) {
printf("\n}\n");
}
Commit: fe5efeecb80cf1d00784a66ca0102cb1c4c3c6e2
https://github.com/scummvm/scummvm/commit/fe5efeecb80cf1d00784a66ca0102cb1c4c3c6e2
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2026-10-23T08:10:23+03:00
Commit Message:
BASE: Fix invalid JSON output of --list-games-json
The comma separator was reset for every engine, so the last game of one
engine and the first game of the next one were not separated.
Changed paths:
base/commandLine.cpp
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 9242b917528..87b0fafe9f2 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -1096,6 +1096,7 @@ static void listGames(const Common::String &engineID, bool jsonOutput) {
"------------------------------ -----------------------------------------------------------\n");
}
+ bool first = true;
// The uncached plugin manager keeps only one engine plugin in memory at a time
PluginMan.loadFirstPlugin();
do {
@@ -1109,7 +1110,6 @@ static void listGames(const Common::String &engineID, bool jsonOutput) {
if (all || Common::find(engines.begin(), engines.end(), p->getName()) != engines.end()) {
PlainGameList list = p->get<MetaEngineDetection>().getSupportedGames();
- bool first = true;
for (const auto &v : list) {
const Common::String &gameId = buildQualifiedGameName(p->get<MetaEngineDetection>().getName(), v.gameId);
if (jsonOutput) {
More information about the Scummvm-git-logs
mailing list