[Scummvm-devel] Avoiding loading of all plugins during startup

Marcus Comstedt marcus at mc.pp.se
Wed Jun 23 22:58:59 CEST 2010


Max Horn <max at quendi.de> writes:

> 1) Quick and simple refinement
> ------------------------------
>
> A very simple way to improve this situation slightly is to not load all engine plugins at once, but rather load one, ask it whether it supports the given game; if not, unload it and proceed to the next. This way only one plugin is held in memory and fragmentation should be kept to a minimum. But we still have an overhead (as in the worst case we still have to load all plugins). Might be worse investigating this as a quick temporary measure, though.


This would not work so well on the Dreamcast, reason being that the
plugins may be on a different CD than the game to be detected
(usually, LucasArts did not ship ScummVM plugins on their game discs
:).  So with this approach, it would be like

* Insert ScummVM CD to load first plugin
* Swap to game disc, to attempt detection using that plugin (I'm
  assuming the plugin needs to see the files in order to determine if
  a game is detected or not)
* Swap to ScummVM CD to load next plugin
* Swap to game game disc
* ...

So in worst case 2*N swaps for N plugins.  Not pretty.

However, this approach does not really change any of the base
functionality, so there's no reason why it couldn't coexist with the
old behaviour.  The Dreamcast port has its own selector anyway, so as
long as it is still possible to call EngineMan.detectGames() in the
old way, there shouldn't be any trouble.


  // Marcus






More information about the Scummvm-devel mailing list