[Scummvm-devel] To all engine maintainers. Detector failure behaviour.

Eugene Sandulenko sev at scummvm.org
Wed Apr 26 07:28:01 CEST 2006

On Wed, 26 Apr 2006 09:43:54 +0200
Max Horn <max at quendi.de> wrote:

> If the engine/plugin fails to find a game, it should not create and  
> return a fake engine object. Rather, Engine_FOO_create() should  
> return one of multiple possible error ids. The error message itself  
> should be displayed by the code which creates the engines, which  
> currently resides in main.cpp.
That was the first thing which came to my mind, but how would you
achieve it? If it would be Lisp or even Perl, I'd return multiple

Now you need both Engine instance and error code. How to do that? Pass
a pointer to error variable?

  int result;
  Engine *engine = plugin->createInstance(&system, &result);
  if (!engine) {
     switch (result) {}

Like above?


More information about the Scummvm-devel mailing list