[Scummvm-devel] backend factory functions (ATTN porters)

Max Horn max at quendi.de
Sat Feb 11 15:56:00 CET 2006


Hi there,

first off, in case you haven't noticed already, I moved the engines  
to the new "engines/" directory as previously announced.


While doing that, I once again stumbled over our backend factory  
functions (see common/system.cpp and backends/intern.h). That left me  
wondering: Why do we have one function for every backend, considering  
that we don't allow multiple backends in parallel anyway?

The only reason I can think of is the desired to add support for  
multiple backends in a single binary. That might be, hypothetical, a  
nice thing for X11+SDL, or maybe the PalmOS port, but I don't see it  
as useful in any other case. And even there, I have my doubts...


So, what do you think -- can we change all ports to simply provide a  
single OSystem_create() function ? If so, the transition could occur  
progressively, each porter could simply change his port, and do the  
appropriate modifications to intern.h (i.e. remove the old factor  
function there) and system.cpp (replace the old name with the new  
OSystem_create() name).

The gain: Makes it a little simple to write backends, simplifies  
intern.h and system.cpp, gets rid of various #defines that are only  
there to select a backend.


Any thoughts on this?


Cheers,
Max




More information about the Scummvm-devel mailing list