The ags_snowrain plugin seems to have logic in it to transparently
translate 320x200 based coordinates when the game is run in
640x400 mode. Since the current plugin code is a recreation rather
than a reimplementation, I wasn't sure where to do the fixes,
so for now simply put a hack in the set baseline script, which was
all that was needed for KQ3
It seems the older version of AGSFlashlight didn't persist
it's fields in the savegame like the latest version does.
I decided against trying to explicitly figure out which
version of AGSFlashlight different games used, and instead
simply have fallback handling if the savegame doesn't
have the data.
The only minor disadvantage is that this means that whilst
savegames are portable from standalone AGS to ScummVM for
the game, it won't in the other direction. But I don't
think that's too major an issue, since it's only for the
few games that do use the old AGSFlashlight
In order to specify that they should be treated as signed
Some ports may treat an (unspecified) "char" as unsigned by default. Android does this for its ARM architectures and while we did fix this by enforcing -fsigned-char to its compiler, the issue may come up for other ports. Also it should be better to clarify in the engine when a variable is not actually storing string characters.
I've spotted and changed the most "safe" cases I could find for this. As far as I can tell, out of these, only the Outline field and fontoutline array could potentially be assigned valid negative values which would cause bugs for ports treating chars as unsigned.
This is currently not implemented, and is not trivial to implement
with the current way we implemented the plugin.
Playing overlapping sound is for example used when moving the cursor
over the buttons in the options or quit dialogs in Strangeland.
In Strangeland, it seems to start the same sound again and again
(multiple times per second, the sound itself is 45s long). In
ScummVM we were stopping and restarting the sound each time. It
seams the original was only starting the sound if it was not
already playing.
This fixes noise (as we played again and again the first few ms
of the same sound) when starting Strangeland. And this means we
can now hear the music!
The plugin previously had a bunch of hacks since the
AGS engine was rendering the screen at 32-bits rather than
16-bits the original was designed for. But with more recent
engine changes, the screen is 16-bits again. So I was able
to revert the hacks and return to the original code
Due to the declaration order of the member variables, the _screenWidth
and _screenHeight where used before being initialized to initialize
the _snow and _rain variables. This could then lead to a division by
zero.
This fixes bug #12771: AGS King's Quest 3 VGA from IA crashes on startup
There is a circulating version of AGS Shell plugin as agsshell.dll
used by some games (Rosewater). Internally it's the same
ags_shell.dll so simply an alias will allow these games to run.
I was havbing a bunch of troubles trying to get the SFX loading
to work like the original, particularly when to free audio streams.
In the end, I decided to load sound effects from scratch each time
they're needed.