[Scummvm-git-logs] scummvm master -> f17a7a96da9f51c5c4735ff34f985516157fcbef
bgK
bastien.bouclet at gmail.com
Sat Jan 4 16:50:52 UTC 2020
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
cb2bb8fac7 GUI: Add clear button for the plugins path
f17a7a96da BASE: Fix being unable to run games when using dynamic plugins
Commit: cb2bb8fac7356e5f8231f855a8aa26d32ea9befa
https://github.com/scummvm/scummvm/commit/cb2bb8fac7356e5f8231f855a8aa26d32ea9befa
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2020-01-04T17:48:13+01:00
Commit Message:
GUI: Add clear button for the plugins path
The other paths have one.
Changed paths:
gui/ThemeEngine.h
gui/options.cpp
gui/options.h
gui/themes/default.inc
gui/themes/scummclassic.zip
gui/themes/scummclassic/THEMERC
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
gui/themes/scummmodern.zip
gui/themes/scummmodern/THEMERC
gui/themes/scummmodern/scummmodern_layout.stx
gui/themes/scummmodern/scummmodern_layout_lowres.stx
gui/themes/scummremastered.zip
gui/themes/scummremastered/THEMERC
gui/themes/scummremastered/remastered_layout.stx
gui/themes/scummremastered/remastered_layout_lowres.stx
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 23d920c..85750b7 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -37,7 +37,7 @@
#include "graphics/pixelformat.h"
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.29"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.30"
class OSystem;
diff --git a/gui/options.cpp b/gui/options.cpp
index 137494f..239c88b 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -78,6 +78,7 @@ enum {
kChooseExtraDirCmd = 'chex',
kExtraPathClearCmd = 'clex',
kChoosePluginsDirCmd = 'chpl',
+ kPluginsPathClearCmd = 'clpl',
kChooseThemeCmd = 'chtf',
kUpdatesCheckCmd = 'updc',
kKbdMouseSpeedChanged = 'kmsc',
@@ -1465,6 +1466,7 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher)
_extraPathClearButton = 0;
#ifdef DYNAMIC_MODULES
_pluginsPath = 0;
+ _pluginsPathClearButton = 0;
#endif
_curTheme = 0;
_rendererPopUpDesc = 0;
@@ -1649,6 +1651,8 @@ void GlobalOptionsDialog::build() {
else
new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _c("Plugins Path:", "lowres"), 0, kChoosePluginsDirCmd);
_pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", _c("None", "path"));
+
+ _pluginsPathClearButton = addClearButton(tab, "GlobalOptions_Paths.PluginsPathClearButton", kPluginsPathClearCmd);
#endif
#endif
@@ -2271,6 +2275,11 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
case kSavePathClearCmd:
_savePath->setLabel(_("Default"));
break;
+#ifdef DYNAMIC_MODULES
+ case kPluginsPathClearCmd:
+ _pluginsPath->setLabel(_c("None", "path"));
+ break;
+#endif
#ifdef USE_CLOUD
#ifdef USE_SDL_NET
case kRootPathClearCmd:
diff --git a/gui/options.h b/gui/options.h
index 559ecbe..4674177 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -269,6 +269,7 @@ protected:
ButtonWidget *_extraPathClearButton;
#ifdef DYNAMIC_MODULES
StaticTextWidget *_pluginsPath;
+ ButtonWidget *_pluginsPathClearButton;
#endif
//
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index affbcb9..251126b 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -1409,6 +1409,10 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"<widget name='PluginsPath' "
"height='Globals.Line.Height' "
"/>"
+"<widget name='PluginsPathClearButton' "
+"height='Globals.Line.Height' "
+"width='Globals.Line.Height' "
+"/>"
"</layout>"
"</layout>"
"</dialog>"
@@ -3155,6 +3159,10 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"<widget name='PluginsPath' "
"height='Globals.Line.Height' "
"/>"
+"<widget name='PluginsPathClearButton' "
+"height='Globals.Line.Height' "
+"width='Globals.Line.Height' "
+"/>"
"</layout>"
"</layout>"
"</dialog>"
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 4b8a77c..4d5ad8d 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index 4134f2b..63a24a1 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.29:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.8.30:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 0cbe043..de2d686 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -540,6 +540,10 @@
<widget name = 'PluginsPath'
height = 'Globals.Line.Height'
/>
+ <widget name = 'PluginsPathClearButton'
+ height = 'Globals.Line.Height'
+ width = 'Globals.Line.Height'
+ />
</layout>
</layout>
</dialog>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index f735acb..a89a511 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -536,6 +536,10 @@
<widget name = 'PluginsPath'
height = 'Globals.Line.Height'
/>
+ <widget name = 'PluginsPathClearButton'
+ height = 'Globals.Line.Height'
+ width = 'Globals.Line.Height'
+ />
</layout>
</layout>
</dialog>
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 771182d..054fbe7 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index a1f5ca0..1071753 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.29:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.8.30:ScummVM Modern Theme:No Author]
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 537368f..a90ed89 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -554,6 +554,10 @@
<widget name = 'PluginsPath'
height = 'Globals.Line.Height'
/>
+ <widget name = 'PluginsPathClearButton'
+ height = 'Globals.Line.Height'
+ width = 'Globals.Line.Height'
+ />
</layout>
</layout>
</dialog>
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 6d26505..4ea4606 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -534,6 +534,10 @@
<widget name = 'PluginsPath'
height = 'Globals.Line.Height'
/>
+ <widget name = 'PluginsPathClearButton'
+ height = 'Globals.Line.Height'
+ width = 'Globals.Line.Height'
+ />
</layout>
</layout>
</dialog>
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index ffe16bd..9d666c2 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ
diff --git a/gui/themes/scummremastered/THEMERC b/gui/themes/scummremastered/THEMERC
index c2ce0ef..e2d57b1 100644
--- a/gui/themes/scummremastered/THEMERC
+++ b/gui/themes/scummremastered/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.29:ScummVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.8.30:ScummVM Modern Theme Remastered:No Author]
diff --git a/gui/themes/scummremastered/remastered_layout.stx b/gui/themes/scummremastered/remastered_layout.stx
index 895b0b9..782c2b1 100644
--- a/gui/themes/scummremastered/remastered_layout.stx
+++ b/gui/themes/scummremastered/remastered_layout.stx
@@ -554,6 +554,10 @@
<widget name = 'PluginsPath'
height = 'Globals.Line.Height'
/>
+ <widget name = 'PluginsPathClearButton'
+ height = 'Globals.Line.Height'
+ width = 'Globals.Line.Height'
+ />
</layout>
</layout>
</dialog>
diff --git a/gui/themes/scummremastered/remastered_layout_lowres.stx b/gui/themes/scummremastered/remastered_layout_lowres.stx
index 6d26505..4ea4606 100644
--- a/gui/themes/scummremastered/remastered_layout_lowres.stx
+++ b/gui/themes/scummremastered/remastered_layout_lowres.stx
@@ -534,6 +534,10 @@
<widget name = 'PluginsPath'
height = 'Globals.Line.Height'
/>
+ <widget name = 'PluginsPathClearButton'
+ height = 'Globals.Line.Height'
+ width = 'Globals.Line.Height'
+ />
</layout>
</layout>
</dialog>
Commit: f17a7a96da9f51c5c4735ff34f985516157fcbef
https://github.com/scummvm/scummvm/commit/f17a7a96da9f51c5c4735ff34f985516157fcbef
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2020-01-04T17:49:32+01:00
Commit Message:
BASE: Fix being unable to run games when using dynamic plugins
When the plugin-engine mapping is not cached in the configuration file,
we were not scanning all the plugins to establish the mapping.
This is a regression from commit: e2d91258b7bfb989dc099f516bb31ceb44554529
This commit reverts the offending commit and implements a proper fix for
the case where there are no dynamic plugins.
Fixes #11300.
Changed paths:
backends/plugins/elf/elf-provider.cpp
backends/plugins/elf/memory-manager.cpp
base/plugins.cpp
diff --git a/backends/plugins/elf/elf-provider.cpp b/backends/plugins/elf/elf-provider.cpp
index 6d461c7..d06c4c1 100644
--- a/backends/plugins/elf/elf-provider.cpp
+++ b/backends/plugins/elf/elf-provider.cpp
@@ -181,15 +181,15 @@ PluginList ELFPluginProvider::getPlugins() {
PluginList pl = FilePluginProvider::getPlugins();
#if defined(UNCACHED_PLUGINS) && !defined(ELF_NO_MEM_MANAGER)
- if (!pl.empty()) {
- // This static downcast is safe because all of the plugins must
- // be ELF plugins
- for (PluginList::iterator p = pl.begin(); p != pl.end(); ++p) {
- (static_cast<ELFPlugin *>(*p))->trackSize();
- }
+ // This static downcast is safe because all of the plugins must
+ // be ELF plugins
+ for (PluginList::iterator p = pl.begin(); p != pl.end(); ++p) {
+ (static_cast<ELFPlugin *>(*p))->trackSize();
+ }
- // The Memory Manager should now allocate space based on the information
- // it collected
+ // The Memory Manager should now allocate space based on the information
+ // it collected
+ if (!pl.empty()) {
ELFMemMan.allocateHeap();
}
#endif
diff --git a/backends/plugins/elf/memory-manager.cpp b/backends/plugins/elf/memory-manager.cpp
index 5014718..6e54cb8 100644
--- a/backends/plugins/elf/memory-manager.cpp
+++ b/backends/plugins/elf/memory-manager.cpp
@@ -78,9 +78,13 @@ void ELFMemoryManager::trackAlloc(uint32 align, uint32 size) {
}
void ELFMemoryManager::allocateHeap() {
+ if (!_heapSize) {
+ warning("ELFMemoryManager: Unable to allocate the heap as its size could not be determined.");
+ return;
+ }
+
// The memory manager should only allocate once
assert (!_heap);
- assert (_heapSize);
// clear the list
_allocList.clear();
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 490ca33..cb9d172 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -357,6 +357,9 @@ void PluginManagerUncached::loadFirstPlugin() {
bool PluginManagerUncached::loadNextPlugin() {
unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false);
+ if (!_currentPlugin)
+ return false;
+
for (++_currentPlugin; _currentPlugin != _allEnginePlugins.end(); ++_currentPlugin) {
if ((*_currentPlugin)->loadPlugin()) {
addToPluginsInMemList(*_currentPlugin);
@@ -533,7 +536,7 @@ DetectionResults EngineManager::detectGames(const Common::FSList &fslist) const
DetectedGames candidates;
PluginList plugins;
PluginList::const_iterator iter;
- PluginManager::instance().loadFirstPlugin();
+ PluginMan.loadFirstPlugin();
do {
plugins = getPlugins();
// Iterate over all known games and for each check if it might be
@@ -549,7 +552,7 @@ DetectionResults EngineManager::detectGames(const Common::FSList &fslist) const
}
}
- } while (PluginManager::instance().loadNextPlugin());
+ } while (PluginMan.loadNextPlugin());
return DetectionResults(candidates);
}
@@ -641,18 +644,15 @@ const Plugin *EngineManager::findPlugin(const Common::String &engineId) const {
}
// We failed to find it using the engine ID. Scan the list of plugins
- const PluginList &plugins = getPlugins();
- if (!plugins.empty()) {
- PluginMan.loadFirstPlugin();
- do {
- plugin = findLoadedPlugin(engineId);
- if (plugin) {
- // Update with new plugin file name
- PluginMan.updateConfigWithFileName(engineId);
- return plugin;
- }
- } while (PluginMan.loadNextPlugin());
- }
+ PluginMan.loadFirstPlugin();
+ do {
+ plugin = findLoadedPlugin(engineId);
+ if (plugin) {
+ // Update with new plugin file name
+ PluginMan.updateConfigWithFileName(engineId);
+ return plugin;
+ }
+ } while (PluginMan.loadNextPlugin());
return 0;
}
More information about the Scummvm-git-logs
mailing list