Commit Graph
979 Commits
Author SHA1 Message Date
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
Cameron Cawley 138a983d80 COMMON: Refactor VSync handling to match the other options 2023-01-16 18:09:53 +01: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
Donovan Watteau 2c804b9c71 AGS: Fix AmigaOS and NDS builds 2022-12-18 14:03:39 +01: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 ccbe6f5419 AGS: Engine: in video_check_user_input() exceed all the keypress buffer
From upstream f7b90bbaaa242e4dc79d26fdddaf7e269e7ce600 and 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 57266951a9 AGS: Engine: fixed built-in textboxes not responding to printed chars
From upstream f1064e91c3b71e2bed4d866bb57b2d32fc1fed25
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 5772893340 AGS: Engine: fixed CallScriptFunction for the ancient games + added comments
Was broken by dec92f05ea
(e38df03c5d1658a2c44a26ba4ee6f22663c1e701 in upstream).

Some games do not have function arg count appended to the function names in
the export table; in that case `export_args` remained uninitialized.

From upstream cdbb7a7367db57e14983015232ecc97f6a3dd212
2022-12-17 22:10:55 +01:00
Thierry Crozat 6c18c2d5b5 AGS: Engine: support Clifftop Games custom engine's resolution mod
From upstream 6a238e9cb4acda222898dd4b597cf20581b401f6

This replaces a slightly different fix we had in ScummVM. But this new
code works better and fixes bug #12949
2022-12-15 22:40:17 +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 9a3ff9b285 AGS: Implement shake screen and flip screen support
This is partially based on upstream 675560f7c2060528ba7c75d5ecca78c56b9f0d8e
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 39c98f652c AGS: Engine: initialize SDL audio using env variables, don't SDL_AudioInit
The code is present but not used in ScummVM. Keeping it synchronized
with upstream might help in the future.

From upstream fcf4b76914a25daaf5a7b711b7ed287e5eaae9f6
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
Thierry Crozat 887f156f73 AGS: Engine: OpenGL, Software drivers also try 24bit display modes for 32bit
This is mostly a cosmetic fix, as graphic mode was created successfully anyway.
But the engine was incorrectly reporting no suitable modes available.

From upstream 4399d6448c579c648fe7e0c157a6d5f1adc74a6c
2022-12-15 22:40:17 +01:00
Hubert Maier 1d8c47257a JANITORIAL: AGS: Correct Spelling Mistake
alot -> a lot
2022-11-15 22:52:43 +02: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
Hubert Maier 912adcf19b AGS: Correct spelling mistake
accomodate -> accommodate
2022-10-27 15:56:08 +02:00
Hubert Maier a316869e7c AGS: Correct spelling mistake
occured -> occurred
2022-10-27 15:56:08 +02:00
Hubert Maier e5336d1400 AGS: Correct spelling mistake
accomodate -> accommodate
2022-10-27 15:56:08 +02:00
Hubert Maier 255730b227 AGS: Correct spelling mistake
occured -> occurred
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 f9e3580237 AGS: reimplemented clear division of clip position by sound type
Currently only MP3/OGG and WAVs are reporting correct sound type dependent pos.

Adapted from upstream 19bdee979c80f339d0ada0bee99b7517c8b595c5
2022-10-10 23:42:34 +01: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 6bae4af005 AGS: rename "multitasking" option to "background" and added cmd arg
From upstream cb83231c03764c74b8f8f09f8c876207a475f7b9
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 bcb854370d AGS: key plugin callback and game. vars must use "CompatKey"
From upstream 555a3060491523d2c236f0bbb77b981eab2d4359
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 fa87b3f28f AGS: force update gui metrics on load and on game start
This fixes some controls not reporting their metrics correctly until first displayed on screen.

From upstream ea4e6762236a13621ba0771b9d5d8ac4bcf33ee8
2022-10-09 19:12:22 +01:00