This change simplifies the AGI engine volume handling by using the music
and sound fx volumes set in the ScummVM GUI as the maximum levels which
can be set by the scripts. This avoids the complexity of synchronising
changes between these and the scripts (which only had a single 16 step
volume range which is inverted in meaning by quite a large number of
fangames).
This still allows the game scripts to adjust the volumes, but only within
the maximum range set in the Launcher / GMM.
This avoids issues such as https://bugs.scummvm.org/ticket/10732 where
users complained about extremely loud output in some cases.
This fixes these, but adding constructors causes further memset usage
warnings on the structures which are now "non-trivial" due to the addition
of constructors. Should be able to fix by repeating this process to remove
further memset usage.
It was also necessary to make sure that the Common::String objects
were initialised correctly by switching to use a C++ container
for engine objects instead of calloc, since they were no longer
C-compatible PODs.
Original AGI only created a stationary event, when the last
pressed direction key was released. We do that now as well.
Makes cursor in MH1 behave properly.
Thanks to waltervn for pointing this out.
- User option to force Hercules hires font for any rendering mode
- Also change mouse cursor hotspots from 1,1 to 0,0
- Fix inaccuracy in mouse controlled game menu
- Change render_Block(), drawBox(), drawDisplayRect() to use
upper Y instead of lower Y. Original AGI uses lower Y, but
upper Y makes upscaling way easier.
Plenty of fan games set volume to mute, because they thought 15
would be loudest. It's in fact "mute" in AGI. Those games were
made primarily for PC AGI, which did not use the volume setting.
We do, so such games would get muted audio. We try to detect
such games. Hopefully fully fixes bug #7035.
Too many games to try them all out.
And in that case poll events, delay for a few milliseconds and
update screen.
This somewhat worked before the graphics rewrite because of
a timer hack.
This one tries to detect actual inner loops.
Happens in at least Police Quest 1 when playing poker.
Also add a table for Apple IIgs games for music issues like in PQ1
intro, where the developers thought that loading a new room would
take X amount of time and they started loading before the music was
done. In our AGI music may get cut off because of this.
It of course also happens, when using the original interpreter,
as soon as you emulate a faster processor. Which means this
is also a workaround.
See bug #7026
Palette + mouse cursor + box frame color only atm
Thanks to wjp for gamma correction
Not sure, if our current color adjustment is correct
Should be checked by using actual hardware
Hold-Key-Mode got introduced v2.425, it was simply not possible
to disable it until 3.098.
Now creating a AGI_KEY_STATIONARY event, so that it works properly
Fixes Mixed Up Mother Goose
Removed pollTimer()
Renamed pause() to wait()
Doing 10 msec delays instead of at least 50 msec per EventProcess
Seems to fix weird Gold Rush ingame timer issue?! bug #4147
processEvents() renamed to processScummVMEvents()
mainCycle() renamed to processAGIEvents()
have.key now sets up an inner loop and calls processAGIEvents()
to avoid any further cycle work processing
This mostly enforces tabs for indentation and spaces for formatting. But also
fixes spaces on empty lines, some extra/missing spaces.
astyle + manual fixup
Original code did assume that AGI volume level is 0-15
(0 for silence, 15 for maximum volume). It actually is the
other way. 0 is maximum, 15 is silence.
Fixed that. Also implemented sync with ScummVM settings dialog.
In case "mute" is enabled by the user, any volume changes done by
scripts are ignored.
Fixes Manhunter 1 Apple IIgs not getting sound anymore since the
VM Var cleanup (the script volume change by the scripts didn't
reach us before)
in game timer is now updated, when scripts read in game timer
VM variables and during main loop. ScummVM total play time feature
is used for it. Game cycle syncing is done at the same time.
Don't access variables directly, but through method
Shouldn't include any functional differences
Also changed several hardcoded values to the corresponding enums.