CreateImpl() is called with either the text or the length parameter,
thus there is no reason to set the length parameter, which is unsigned,
to -1. Therefore, using 0 for the length when a text buffer is used
yields the same result
Instead of allocating the GameState and GameSetupStruct variables on
stack and erase the heap version, deallocate the old ones and reallocate
new ones.
Add it to engines that have MIDI playback.
This essentially compiles the emulator only when an engine that
can potentially use it (e.g. MIDI) is enabled
The flashlight plugin didn't consider the legacy upscale mode
used in few old AGS games (Maniac Mansion Deluxe and
some Maniac Mansion Mania episodes).
This commit adds this feature per-game, although there's room
for improvement as the legacy upscale setting should be made
accessible from the plugin.
Fix#15547
This also fixed a potential memory leak in ccInstance::CreateEx().
From upstream 30167df0690e0a771a8eb4f14a4d6a72da526b49
Also remove unreachable code (same condition checked twice in a
function) as that caused a compilation error with the changes above
otherwise. This change is part of upstream commit
881d31966cf7600c9b5628fff4c194d628196f4a
This fixes a regression after db71d92
in case Character.Animate() called during idling, and Loop number assertion is done
prior to view changing back to normal view, could cause game to error.
Pick out "stop_character_idling" function that checks idle state and releases the locked idle view.
From upstream 946fa71c9332cae98f31d8b7672a1fe7b76d46c5
Fix#15523
For completeness, this adds functions sys_window_fit_in_display
and sys_get_window_display_index.
Practically it has no effect as in ScummVM we don't support
multiscreen and the resolution is hardcoded.
Partially from upstream 1afc61df54681ffe2fddc0d30bb2221c38a0fa79 and
b17f58d90061c3b12c9e4c04183dc59b094d66cb
The implementation of Overlay_SetText() was rewritten in aaf6144 , with a purpose of replacing
only the internal image of overlay, but not going all the way of removing/creating a new overlay
into the same slot.
In addition to the initial reasons, it became even more essential after the overlay storage
optimization (see merge commit 77b8264), as overlay system now records free ids on overlay
removal. As recreating overlay with exact same id would now require extra hacks into overlay
logic.
Unfortunately, an old SetTextOverlay() function was forgotten about, and it still doing this
remove/create way of resetting a text. This results in engine wrongly considering certain ids to
be free, while they are already taken.
This commit fixes this by making SetTextOverlay delegate to the new Overlay_SetText()
algorithm instead.
From upstream 4caf0765ef36b4ebc2fb609f99a36a56d0736255
AudioChannel.Pause and Resume commands were added back in 3.6.0,
but I forgot to write the paused state to save format...
From upstream e18091c2f32a057d4c6538b9b26e4f31ef9b6296
Prior to 3.6.0 script API Wait function was treating negative values as "no time",
but since 3.6.0 it treats it as "infinite time".
Also, old engines let overflow happen when assigning > INT16_MAX values to the wait counter
(which is int16).
In the old engine this resulted in immediate timer stop, by pure accident.
From upstream 6777dad163b3f8c2678e5fc001feb15b78c36849
This results in post-cutscene state being different if it's skipped compared to
a normal run if a pairing FadeOut or FadeIn was not inside StartCutscene/EndCutscene too.
From upstream 14bc225fb64bef8aae56c2f791194d515d7a664b
This is a regression since around 3.6.0, but apparently Inventory Window had always some problem
updating after SetAsPlayer is called.
In much older versions of AGS, even prior to GUI optimizations, it also did not update until player
moved mouse cursor around some interactive elements. Which probably made an impression
that it's not working without explicitly assigning InvWindow.CharacterToUse.
From upstream 0b758225a7801700a03e48fa72b733fd122ca1c9
Loop fixup was introduced earlier to avoid crashes in certain old games,
and also in case users forgot to unlock a custom animation View.
But apparently I missed a case when a loop may be adjusted later on during walking update.
From upstream f04c4d7d9adff5134e48c1062b0214251797efdc
This is what upstream AGS does in the 3.6.1 and master branches,
while our code corresponded to the 3.6.0 branch.
This fixes an issue where deleting the screenoverlay vector later
on would try to access an already cleared SpriteCache.
This sould fix bugs #15488 and bug #15510.