[Scummvm-devel] Adding support for selecting a 'pluginpath' on the command line?

Max Horn max at quendi.de
Tue Sep 28 13:20:29 CEST 2010


You could simply put the equivalent of
 #define PLUGIN_DIRECTORY "../plugins"
somewhere, e.g. in configure add a -D for it to DEFINES..

I would recommend doing that in any case, so that it works even if the user (hypothetically) tried to start the game from the command line and did not specify the custom plugin path...

Anyway, I also don't see any harm in allowing to override the pluginpath from the command line just like the savepath, extrapath, etc. It's a trivial change, too (though, since it is an *untested* feature addition, I'd be a bit reluctant to add it to the 1.2.x branch).


While we are at it, this is what FilePluginProvider::getPlugins()  currently does:

  pluginDirs.push_back(Common::FSNode("."));
  pluginDirs.push_back(Common::FSNode("plugins"));
  addCustomDirectories(pluginDirs);	// <- virtual method, default impl adds PLUGIN_DIRECTORY if set
  if ("pluginpath" config entry specified)
    pluginDirs.push_back(Common::FSNode(pluginsPath));


Ho-hum. That might be a bit of an overkill, esp. since some targets are sensitive to needlessly searching many directories. How about we replace this by a single

  addPluginSearchDirs(pluginDirs)

which by default just adds PLUGIN_DIRECTORY (if specified), and then "pluginpath". Also, add
  ConfMan.registerDefault("pluginpath", "plugins");

This way we search less directories by default (which is faster and safer anyway), allow backends to fully customize where we search, if at all, and the code is cleaner and simpler ;).


Cheers,
Max


Am 28.09.2010 um 12:50 schrieb John Willis:

> Hi,
> 
>  
> 
> I have a requirement for one of my ports (OpenPandora) to override the plugin path with a non-standard value (../plugins) rather than the default . or ./plugins that are setup in base/plugins.cpp. This is due to a quirk of the packaging system.
> 
>  
> 
> While this is very easy to do with the custom config file setting ‘pluginspath’ this is not then parsed until ScummVM is restarted (and requires the user to do this step manually or ship a pre-munged config file, neither good in my book).
> 
>  
> 
> Rather than hack about with setting the custom path in the code (early ConfMan.set("pluginspath", pluginsPath ); type things before the plugins are loaded (so very early on)) I wanted to ask why setting the ‘pluginspath’ on the command line was not supported?
> 
>  
> 
> I have a simple patch to ‘base/ commandLine.cpp’ that I am testing that I think should work fine and I can’t see how it should cause any regressions but before I pushed it to trunk I wanted to check there was not a good reason that the variable was not exposed on the command line already?
> 
>  
> 
> It seems quite sensible to let the users specify where the plugins are on the command line so I was left thinking it was left out for a good reason I am not aware of ;).
> 
>  
> 
> Any comments or shall I just test and push? I would also like to push said patch (after some more testing) to 1.2.0.
> 
>  
> 
> Cheers,
> 
>  
> 
> John
> 
>  
> 
> --
> 
>  
> 
> > What is a grue?
> 
> The grue is a sinister, lurking presence in the dark places of the earth. Its favourite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
> 
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev_______________________________________________
> Scummvm-devel mailing list
> Scummvm-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scummvm-devel





More information about the Scummvm-devel mailing list