[Scummvm-cvs-logs] CVS: scummvm/scumm scummvm.cpp,2.230,2.231 scumm.h,1.250,1.251 vars.cpp,1.55,1.56
Max Horn
max at quendi.de
Thu Jun 12 08:31:12 CEST 2003
Am Donnerstag, 12.06.03 um 14:23 Uhr schrieb Jonathan Gray:
> Update of /cvsroot/scummvm/scummvm/scumm
> In directory sc8-pr-cvs1:/tmp/cvs-serv1858
>
> Modified Files:
> scummvm.cpp scumm.h vars.cpp
> Log Message:
> hook subtitle variable up to f9 for loomcd
>
> Index: scummvm.cpp
> ===================================================================
> RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
> retrieving revision 2.230
> retrieving revision 2.231
> diff -u -d -r2.230 -r2.231
> --- scummvm.cpp 9 Jun 2003 01:32:36 -0000 2.230
> +++ scummvm.cpp 12 Jun 2003 12:22:56 -0000 2.231
> @@ -480,6 +480,7 @@
> VAR_SOUNDRESULT = 0xFF;
> VAR_TALKSTOP_KEY = 0xFF;
> VAR_59 = 0xFF;
> + VAR_SUBTITLES = 0xFF;
>
> VAR_SOUNDPARAM = 0xFF;
> VAR_SOUNDPARAM2 = 0xFF;
> @@ -2006,6 +2007,10 @@
> VAR(VAR_CHARINC) = _defaultTalkDelay / 20;
> } else if (_lastKeyHit == '~' || _lastKeyHit == '#') { // Debug
> console
> g_debugger->attach(this, NULL);
> + // F9 toggles subtitles for loomcd
> + } else if (_gameId == GID_LOOM256 && _lastKeyHit == 323) {
> + _noSubtitles = !_noSubtitles;
> + VAR(VAR_SUBTITLES) = !_noSubtitles;
> }
>
This is not a good way to handle this (a bit more research maybe would
have been useful :-). The F9 key is already handled by the loomcd input
script (i.e. script 5). Which also covers setting VAR_SUBTITLES, but of
course not _noSubtitles. But since _noSubtitles is not being used for
LoomCD anyway, that is of little consequence. OTOH, your patch does
*not* ensure VAR_SUBTITLES and _noSubtitles stay in sync - if
_noSubtitles is changed via the GUI, or from the command line, they can
be out of sync. Furthermore, if anything else in the script changes
VAR_SUBTITLES, that code won't notice it. Again, for the functionality
of loomcd that has no impact anyway, but it *does* mean that GUI and
engine will be out of sync, which is annoying for the user.
Better approach would be to modify readVar/writeVar to catch
modifications of VAR_SUBTITLES, and then force _noSubtitles to be in
sync to it.
In any case, we could consider enabling the F9 hotkey (for
en-/disabling subtitles) in all games, if that is deemed useful..
Max
More information about the Scummvm-git-logs
mailing list