SDL: Backend transaction / rollback support
|Reported by:||lordhoto||Owned by:||lordhoto|
This patch adds proper transaction support to the SDL backend and also adds support for rollback to the backend. Rollback means if a newly set configuration, done inside a transaction block, can't be setup correctly it will try to switch back to the former configuration.
What needs to be discussed: - Somehow endGFXTransaction needs to return a error code on failure, for example if a new mode can't be setup so the client code is able to take care of it
Things that need to be reflected in common OSystem documentation: - Now setFeatureState called with kFeatureFullscreenMode and kFeatureAspectRatioCorrection needs to be called within a transaction block - Now setGraphicsMode has to be called inside a transaction block
- Porters subclassing the SDL backend should need to update their code, it would be wise to hear what they think of it
- Engines / other code calling setFeatureState and/or setGraphicsMode might be updated to do it inside a gfx transaction block
Things this patch breakes: - '-f' switch, since code in base/main.cpp will setup the fullscreen mode specified in the config file after transient domain is cleared. - '-g' switch for the same reasons as with '-f' as I would say, but I'm not really sure how this is done really (a.k.a: CALL FOR HELP, please somebody check this!)
Both are related to bug #2120780 "GUI: gui-theme command-line option ignored" as far as I can tell it. At least it has the same reason, that the transient domain is not kept when code relies on it.
What is tested: - I was able to switch scalers on run time, fullscreen toggle and aspect ratio toggle - Rollback should work, it successfully switched back from 3x to 2x mode when 3x is not supported by the system (tested with Xephyr)
It is of course still heavy work in progress as you see from the description.
Ticket imported from: #2123680. Ticket imported from: patches/1031.