[Scummvm-devel] Re: CVS: scummvm/base main.cpp,1.55,1.57
Max Horn
max at quendi.de
Tue Nov 23 01:33:02 CET 2004
Am 23.11.2004 um 02:39 schrieb Eugene Sandulenko:
>> // Start GFX transaction
>> system->beginGFXTransaction();
>>
>> // See if the game should default to 1x scaler
>> if (useDefaultGraphicsMode && (detector._game.features &
>> GF_DEFAULT_TO_1X_SCALER)) {
>> system->setGraphicsMode(GFX_NORMAL);
> ....
>>
>> // Init the engine (this might change the screen parameters
>> result = engine->init();
>>
>> system->endGFXTransaction();
> Albeit it looks logical, this will not work with most current
> engines. In their init() method they do these things:
>
> o Start SMUSH playing (FT)
> o Set cursor shape (ITE)
> o Print OSD message (MT-32)
> o set up palette (BASS)
>
> All these functions need access to screen, and that means that they
> cannot be called inside of transaction.
>
> There are 2 solutions. Either add yet another OSystem function
> initGfx() or move transaction into init() method.
>
There are more solutions, actually. Like, we could remove the above
"illegal" methods from the respective init() methods. In the case of
SMUSH playback, for example, that shouldn't be started by init() yet. I
moved our savegame loading to go() for this reason.
I don't know what you mean with adding "initGfx", what would that
method do ?
Moving the transaction into init() has pro and cons: it would be more
flexible regarding the default-to-1x-scaler handling, and avoid all of
the above problems. Drawback would be some code duplication between the
engines.
Bye,
Max
More information about the Scummvm-devel
mailing list