666 Commits

Author SHA1 Message Date
Walter Agazzi
6f82ba6008 AGS: Engine: fixed ScriptOverlay loosing ID when changing text
From upstream acd7ac23d35aafbceb0115b3c3ae1a946e4de20a
2023-01-20 14:14:56 +00:00
Walter Agazzi
dcba4db6f1 AGS: Engine: fixed voice is disabled if tried to enable already enabled vox
From upstream 24eb9c8f16cfc518ae343f825d49f05cefaee32e
2023-01-20 14:14:56 +00:00
Walter Agazzi
2ef1dfd3a6 AGS: Engine: fixed few typos in error messages
From upstream dd961852cf3e94c202dd0d9a7984f90e48ccd2fa
2023-01-20 14:14:56 +00:00
Walter Agazzi
50a655871f AGS: Engine: fixed dialog parser not drawn on the correct position
From upstream 394866b2928433475fcfd0a3ab298e2b70570cbc
2023-01-17 17:27:07 +00:00
Walter Agazzi
028567e890 AGS: Engine: improved parameter logging in SetAudioTypeVolume
from upstream 94598f32ff20494a3239f258ac972f8108bc05bf
2023-01-17 17:27:07 +00:00
Walter Agazzi
902b92341d AGS: Engine: prevent invalid parameter in video player
partially from upstream 4efaf8116a2bd0bcf909b174dc28b945e4b52745
2023-01-17 17:27:07 +00:00
Walter Agazzi
43bdb0d5c5 AGS: Script API: Mouse.AutoLock
From upstream f49501a18b48767184e5f3d5da355405e29ad9e
2023-01-17 17:27:07 +00:00
Walter Agazzi
de34fdbe68 AGS: Fix mousepress not being tracked
This caused the "autoclick/skipping lines" bugs
2023-01-03 14:31:27 +00:00
D G Turner
d5277a95c0 AGS: Fix Enumerated Type Comparison Mismatch GCC Compiler Warning
This is emitted when -Wenum-compare is passed to GCC.
2022-12-19 00:07:37 +00:00
Thierry Crozat
1d4d6d501e AGS: Engine: corrected some of the key evt queue exceeding loops
Part of upstream 66738a0c4550ec349dcf45ec39030b56332e1ea8
2022-12-17 22:10:55 +01:00
Thierry Crozat
b052270504 AGS: Engine: in built-in dialogs exceed all the keypress buffer at once
From upstream ec194e7fbd964f29e590d3b446db9dd3804e9e02
2022-12-17 22:10:55 +01:00
Thierry Crozat
3286cf18ec AGS: Engine: in display_main exceed all the keypress buffer
From upstream d2100b01ee4a85219b481dcd7593f0e0d419523e
2022-12-17 22:10:55 +01:00
Thierry Crozat
871d4b54e1 AGS: Engine: in DialogOptions exceed all the keypress buffer
From upstream 5488f02bae108c1f191a5b6ca3a46eee6497058a
2022-12-17 22:10:55 +01:00
Thierry Crozat
c156608796 AGS: Engine: fixed dangerous use of String::Wrapper in logging
From upstream 588d91ab6a09877eab06bf66073239db0d28271b
2022-12-17 22:10:55 +01:00
Thierry Crozat
3dee5bb762 AGS: Script API: add "restrictToViewport" arg to Screen.ScreenToRoomPoint()
This argument works similarily to Viewport.ScreenToRoomPoint():
if it's set to true then the function returns null if there's no
viewport under the cursor; if it's set to false it converts
coordinates through the primary viewport in such case.

From upstream 5014c502aa487d3cbdf01e99d57306f2131d4c54
2022-12-15 22:40:17 +01:00
Thierry Crozat
54e99b36e9 AGS: Engine: support pre-3.5.0 Label.TextAlignment with legacy values
Some custom engines supported Label.TextAlignment before 3.5.0 got this
added officially, except they used old alignment constants.

From upstream 46fc9bac4fa6082561a1937861b3e567ccea2cd4
2022-12-15 22:40:17 +01:00
Thierry Crozat
7d88a52275 AGS: Engine: fixed restoring a legacy savegame
From upstream 9776df3c8403f252e981f5518c48eace2e83d373
2022-12-15 22:40:17 +01:00
Thierry Crozat
75a67377d6 AGS: Script API: added File.WriteRawInt(), complementing ReadRawInt
From upstream cf23239bcce2e50377866090a11f1489602fdd65
2022-12-15 22:40:17 +01:00
Hubert Maier
472c51b27c
AGS: Correct spelling mistake
accomodate -> accommodate
2022-10-27 15:56:08 +02:00
Hubert Maier
f1c3261837
AGS: Correct spelling mistake
lightening -> lightning
2022-10-27 15:56:08 +02:00
Le Philousophe
ab0854d81a AGS: Don't use unsafe sprintf and vsprintf 2022-10-23 22:46:19 +02:00
Le Philousophe
7f90669bdd AGS: Don't use unsafe strcat and strcpy 2022-10-23 22:46:19 +02:00
Thierry Crozat
26716156af AGS: added AudioChannel.SeekMs() to coplement PositionMs
From upstream 59a5cacb8ed61e41dd8ef0641dd5de156caf8d32
2022-10-10 23:42:34 +01:00
D G Turner
0c2ae0357a AGS: Fix Signed vs. Unsigned GCC Compiler Warning 2022-10-10 08:40:27 +01:00
Thierry Crozat
58212aeebd AGS: added render callback AGSE_POSTROOMDRAW
This render stage overlays the room with objects and characters, but
stays within room transform, therefore will work with non-standard
viewport positions and multiple cameras.
The next closest stage is AGSE_PREGUIDRAW, which is rendered outside
room viewport. The new one fills the missing stage, lacking after the
viewport/camera update in 3.5.0.

From upstream 4ff7e14400ab81693fb64195d9ada70e979647ac
2022-10-10 00:16:16 +01:00
Thierry Crozat
c7f44082b8 AGS: more explicit code for the video flag parsing (PlayVideo/Flic)
This is just for easier to maintain / safer code.

From upstream ee2f91560969d22bd92a5e75af5a447937afb5c5
2022-10-10 00:16:16 +01:00
Thierry Crozat
2f8d4cb072 AGS: PlayVideo supports playing game and video sound together
From commit f2a9f3043aac24b0e70b48602a664541ec12df8d
2022-10-10 00:16:16 +01:00
Thierry Crozat
483ff1bc30 AGS: fixed object cache may sometimes keep an old dynsprite ref
This may result in object texture not updating if the old sprite was deleted but a new dynamic sprite was created right after having same ID.

Was broken by upstream 9dffb04 in 3.5.1, and also some later changes in 3.6.0.

From upstream 7ed51861898d864902b0f61b0cb7d0acadef1fe3
2022-10-10 00:16:16 +01:00
Thierry Crozat
6163d4880a AGS: fixed CompatKey may be "none" in some cases for valid key press
From upstream f0e699392866b1b737a6b5be08790cbddbc6767d
2022-10-10 00:16:16 +01:00
Thierry Crozat
9f24f6eda4 AGS: fixed ags_misbuttondown()
Complementing afdccb3d3 (upstream 471098d)

From upstream f6e23781c4895ab79b42f97324743356aa401eec
2022-10-10 00:16:16 +01:00
Thierry Crozat
0927821afd AGS: small refactor of key code variables (stricter names, types)
From upstream e04c8ff1fe77e4462babd21d2a103a12e68b4b84
2022-10-10 00:16:16 +01:00
Thierry Crozat
e2497cff42 AGS: include KeyMods flags in the WaitSkipResult
From upstream 65bfbb9bde733457b8ab958bb3cd273f7fadcb25
2022-10-10 00:16:16 +01:00
Thierry Crozat
250e32f9a1 AGS: adjusted InputType and KeyMod for easier packing in int32
This allows to fully pack InputType, KeyMod and KeyCode/MouseButton/etc in a int32:

- 8 bits (0xFF) - input type
- 8 bits (0xFF) - key mod flags
- 4 bits (0xF) - reserved (potentially for expanding mod flags, if that will be necessary)
- 12 bits (0xFFF) - KeyCode, mouse codes, gamepad buttons, etc.

Purpose:
1. Potentially allow to set keycodes + mods in an integer and assign to an integer variable/property, such as "skip key", instead of using existing "combo keys"
2. In fact, with InputType flags, this makes it possible to assign a mouse or gamepad button to the same variables.
3. Potentially allow to return keycode + mods from Wait* (currently returns only single key).

From upstream 0203e8feb73b96c501ac2439aa3fe3d6c182c8f4
2022-10-10 00:16:16 +01:00
Thierry Crozat
5987bc5e6e AGS: rewrote eAGSMouseButton enum to sync with the script API
* Changed from -1 - based constants to 0 - based constants;
* These were purely internal values, therefore no API would be harmed;
* Removed necessity of converting from internal mouse button code to script and back all the time;
* On a side note, this fixes a bug where WaitMouse etc were returning incorrect values on mouse skip, because we forgot to convert from internal to script code.

From upstream 471098d239b076c494beb2d554572ccb69372667
2022-10-10 00:16:16 +01:00
Thierry Crozat
06620b6e9f AGS: renamed Button's MouseButton enum to avoid name confusion
Was conflicting with the internal engine's eAGSMouseButton constants.

From upstream a5cfccee2d3681b55dafb8cfb9e0f38f84124855
2022-10-10 00:16:16 +01:00
Thierry Crozat
61e3a92963 AGS: fixed few more warnings related to typecasts
From upstream 7946be9e75a0edda6fc9d955ea771f60f9b8e968
2022-10-09 18:49:17 +01:00
Thierry Crozat
5fd47e4055 AGS: define verbose sprite cache log through a macro function
From upstream a3e762c55b9424ebfc3f311b57ac30a8bcedf945
2022-10-09 18:34:44 +01:00
Thierry Crozat
7f6d7f41d4 AGS: use #if instead of #ifdef for log macros
Sprite Cache and Managed Objects produce a lot of entries in the log currently.
They use a macro to set if they should be on or not, but this macro may be set =0, with the intent of disabling.
Let's instead use #if when testing these macros.

Additionally

- only define DEBUG_MANAGED_OBJECTS if AGS_DEBUG_MANAGED_OBJECTS is true
- adds a new command line flag AGS_DEBUG_SPRITECACHE, which will only define DEBUG_SPRITECACHE if true
- guard indefinition through core/platform.h

From upstream e8bd58da2e09d844068dc087f1da153a693b7aa8
2022-10-09 18:11:02 +01:00
Thierry Crozat
57fb47275b AGS: Restored "Button::Animate^7" in API and fixed volume default
"Animate^7" was an intermediate API function during 3.6.0 alpha
development, and apparently there are games which used it.

From upstream eb4c0aec426c1501c84e93851e9aa31eaf8e2f27
2022-06-25 23:33:30 +01:00
Thierry Crozat
119e09e56e AGS: Removed a too early call to pl_stop_plugins() and fixed another
There's one call in unload_game_file(), which should be called after
all objects that may have been provided by plugins are disposed
(fonts, managed objects).

From upstream 462cabe7353fc75f3cf70222a97028066f12f030
2022-06-24 20:54:47 +01:00
Thierry Crozat
f52c6a25ab AGS: Fixed forgot to save SetMultitasking in usetup.multitasking
Complements 3a4d94bf0

From upstream dd76b001a64105d1d7ad5b4878bbd646e19c6391
2022-06-24 20:54:47 +01:00
Thierry Crozat
e9c84767f7 AGS: Merged BitmapFlip with engine's GlobalFlipType (same values)
From upstream a747deafe67d536b6bcaf408077ca83f6e61a33d
2022-06-24 20:54:47 +01:00
Thierry Crozat
7372aa4040 AGS: Updated build version (3.6.0.28)
From upstream ad7c27a8bbf8a9e827ebd052472887cf4f47a299
2022-06-23 23:57:27 +01:00
Thierry Crozat
aa9983c28d AGS: Update commented out exception handling code
This code is not used in ScummVM, but since it was still there in
comments it's probably better to keep it in sync with upstream.
The code was updated in upstream 0d1034df1a0e6593e7e61bbdb75d2996b8721b14
(tidy Direct3D renderer code, remove redundant parts, etc)
and 2f04e3b81db598eb7950668ce9d88a145f796f2c
(fixed Ali3DException's message string misuse)
2022-06-23 23:57:27 +01:00
Thierry Crozat
40c85968e1 AGS: Fixed restoring a exclusive fullscreen mode on switch in
Fixed getting stuck in a render attempt loop, because the window
events are not being processed.

From upstream 25329949f4d4a17ea8e6ad11fc7bd0ecccdfaca7
2022-06-23 23:57:27 +01:00
Thierry Crozat
3a4d94bf0b AGS: Updated Multitasking setting
* Added `[misc] multitasking=[0,1]` to config, acting as a *starting*
  setting, which may be changed by runtime call to `SetMultitaskingMode`;
* Ensure multitasking mode is overridden by connected external debugger
  (always on, if possible);
* Let multitasking mode work in "fullscreen desktop" gfx mode (still
  disabled in exclusive fullscreen);
* Now correctly reset multitasking mode if gfx mode changes.

From upstream 9f091926e393f75c90c951f9597710bf17395332
2022-06-23 23:57:27 +01:00
Thierry Crozat
8b8a7fffbf AGS: Tidied code around GameSetup a tiny bit
From upstream 850ae917fe7477dd83cc905cdb48982ef107877c
2022-06-23 23:57:26 +01:00
Thierry Crozat
305fdb853a AGS: Abort current scripts on close window event
This helps kill "hanging" scripts if user closed the window while
there's no real engine update.

From upstream a758fd6de2dccd0c948fc7f9e5b65200df902a65
2022-06-23 23:57:26 +01:00
Thierry Crozat
fe8c21366a AGS: Added comments to ScriptSystem
From upstream 9698d329e84ce4450aeb0bd3fbc3b43b8c29a3e2
2022-06-21 23:28:01 +01:00
Thierry Crozat
2389e64223 AGS: Fixed character's loop fixup in UpdateMoveAndAnim()
Was broken by 7a1ee192e2
Fixes bug #13477 AGS: Heroine's Quest intro shows portrait bug

This old commit was trying to fix a problem in old game(s), when
character was set to a loop with no frames. In such case the old
engine would seek for the first loop with frames, starting with 0.
The condition for doing so was made incorrect though: instead of
testing simply for a empty loop, it tested for frame number being
outside of the current loop's frame range.
This broke games where e.g. some walking view's loops were shorter
than the others.

A replacement is a condition that tests exactly for an empty loop
instead. The frame exceeding a loop's frame count is fixed later
along the way, so it's not a problem here.

From upstream ac73a555d737fb3f759cc7da9eeaf488a3bdcb2f
2022-06-21 23:28:01 +01:00