This change should not alter any game behavior, because no game scripts
are known to contain an instruction that alters an invalid property.
If such a script does exist, it is now handled correctly.
This is to avoid file name inclusion clashes with graphics/palette.h
placed in common code, as uncovered by PR #6471
After discussing with @sluicebox, this is a simpler solution, where
only the offending palette.* files are renamed, without affecting
palette32.*, or introducing a sci prefix in files
Fixes comets not animating in the star field, bug #15622
Fixes speed and timing when exiting simulator, bug #15610
The introduction scenes are heavily dependent on both CPU speed and the
undefined lag that occurs in the original interpreter when animating
many actors at once. Now our speed throttler adjusts for this.
Thanks to @GermanTribun and @eriktorbjorn for reporting.
Big thanks to @PickledDog for testing and recording on a 386 and a 486.
gfxdrivers.cpp has become quite large. So I've now made a
separate file for each driver. I also separated the mode
validation and driver init code from the enigine and put
it into an extra file.
(items 1- 3 from bug ticket no. 15594)
I have added redrawing functionality for the hires GFX from the
original interpreter. I guess the original only needed that code
to handle WM_PAINT messages (= full window redraw). It also
does actually call a redraw in kDisposeWindow, the same way I
implemented it here, to refresh the inventory. But that is really
only needed for the speech+text mode which isn't supported
in the original. Maybe they ditched the mode only after they
had already implemented that, who knows...
I have also improved the workaround for the out-of-bounds
portraits to catch the case from the bug ticket.
I added a check in kDisposeWindow. It isn't strictly necessary,
but it it makes the code easier to understand.
I also renamed a var that I had previously renamed in a way
that makes no sense. I had renamed it from `upscaledHiresRect'
to 'portraitRect' since it is neither upscaled nor hires (it is just a
lowres rect). But it isn't a portrait rect either. The portraits get
drawn elsewhere. It's more likely to be a picture frame, a GUI
control or an inventory item.
I had issues to run any SCI1 game with MSVC ASan builds.They
always failed to start up with a 'DoSoundMasterVolume: no
previous signatures' error. When I recently had that issue (which
I quickly discussed with digitall on discord) I got it fixed by
simply doing a full rebuild. But not this time. So I looked into it
deeper. And I find it quite surprising that it usually works in 99,9%
of all cases, since it does a comparison of two pointers that are
meant to point to different strings. In the kDoSound_subops
table, each entry gets its own string. My only explanation is that
these string repetitions get optimized away (but apparently not
or not always for the MSVC ASan build). I have replaced it with
a strcmp which seems to work fine.
Fixes bug #15550
This began occurring in 2021 when kDoAudio was fixed to stop all
currently playing digital samples. The fix exposed that the KQ5 CD
mountain script is incompatible with playing digital samples from
within sound resources. The KQ5 CD sound driver never played these
samples, and the script was not written to handle this condition.
We play all samples when "prefer_digitalsfx" is enabled, and it is
enabled by default, so now we patch out the script incompatibility.
See: de9443407f
Thanks to @LaZar00 for reporting.
Thanks to @MusicallyInspired for audio consulting and testing.
- Replaces KQ5 FM-Towns workaround with generic initialization.
- Separates SCI1 audio language from unrelated engine components.
Confirmed in disassembly.
- Improves accuracy of error handling and return values.
This disables the feature, but allows users to enable it, if they want,
via a new checkbox. An appropriate warning has been added to the
checkbox, notifying the user that saves created through the GMM may be
corrupted and unusable. This addresses bug 15358
The original interpreter expects the same arguments for
kGraph 15 as for kGraph 7. The scripts never pass the last
arguments, though. So the engine would use undefined
values here (which apparently had no visual consequence).
I was just exploring this when trying to debug a glitch (which was
not connected to this). The changes do literally nothing to the
output. So the only purpose is to have a better documentation
of what the scripts actually do here.
- The main purpose was to move more upscaling logic out of the engine
- This actually contains various precision fixes to the hires code. There
were some comments about being unsure what to. I think I managed to
fix all of these, although it shouldn't make a visible difference, since the
workarounds worked as intended.
- It does actually fix a very minor glitch: The portraits were vertically off
by one pixel. And the opening AVI video is probably also vertically fixed
by one pixel (although the video display in the original is not done very
well, anyway).
This was done only for the ScummVM save/load dialogs, but there are situations
where the global pause counter runs out of sync regardless of whether these
dialogs or the original ones get used (e. g. bug no. 15336). The counter should
always be 0 after loading a savegame.