[Scummvm-devel] Moving platform specific (down)scalers into the core of ScummVM
Max Horn
max at quendi.de
Thu Jul 30 00:16:34 CEST 2009
Hi John,
several backends need downscalers, and would benefit from ARM
optimized versions of those (and might even benefit from carefully
optimized C/C++ versions, for that matter). So it certainly makes
sense to have some of those in graphics/scalers -- at least as long as
they are only compiled on ports that want them. (Which is easy enough
to achieve). In particular, yes, downscalers are useful.
Actually, we listed this a long time ago as one of the desirable
features for the ominous "small devices meta backend", see <http://wiki.scummvm.org/index.php/Small_Devices_Backend
> ;).
The other issue is how to make it as easy as possible for backends to
use downscalers; i.e. how to interface with them, what API to use. For
a stand-alone backend, such as the NDS one, this is probably not
really an issue. Most of your questions seem to be only relevant to
backends that are based on the SDL backend and wish to reuse as much
of its code as possible; in particular, those backends ideally would
like to just tell the SDL backend to use a downscaler and be done with
it. As you already pointed out, the SDL backend is not well prepared
for this.
So, we could try to adapt the SDL backend to deal with that. But I
think that would make an already overly complicated rendering pipeline
even more complicated... So maybe here's a good opportunity to
introduce a OSystem_SDL_SmallDevice subclass, which provides a
graphics pipeline custom tailored towards downscaler mode... That
might help to keep the code clean, and would still allow backends
derived from it to use both up- *and* downscaling (the backend can
choose whether it invokes the OSystem_SDL or the
OSystem_SDL_SmallDevice renderer). Alternatively, this functionality
could be added directly into the SDL backend.
As for the overlay: I think on *any* port, whether it is SDL based or
not, the overlay should ideally be unscaled, i.e., use the native
screen resolution. At least in theory -- in reality, we don't define
themes for resolutions beyond 640x480, and while our GUI is vector
based, the fact that we don't use vector fonts means we can't scale it
arbitrarily without custom themes... So, in the real world, if your
native screen is around 320x200 or 320x240 or 640x480, use that
natively for the GUI; if it's bigger, then use an overlay size close
to 640x480.
Bye,
Max
More information about the Scummvm-devel
mailing list