Commit Graph
1179 Commits
Author SHA1 Message Date
Walter Agazzi 74f0f5bf9b AGS: Fix loop flag not passed when loading mp3 files
Fixes a small oversight in commit
a4bf82bd35

Fixes TRAC #13757
2023-10-22 23:27:09 +02:00
Walter Agazzi 54c57bb23e AGS: Fix wrong detection of mod audio and enable IT playback
* Look for file extension inside the filename, instead of the
asset category (and always failing)
* Enable playback of ImpulseTracker streams using mikmod (if available)

Fixes TRAC #14437 and enables music playback in Heatwave and Death
Wore Endless Feathers
2023-10-19 01:46:08 +02:00
Walter Agazzi 21d57c04d2 AGS: Engine: fixed GUIControl_SetVisible()
This fixes another fix from commit dcec61b
From upstream cc247845762e12e924e36e0922149d3b862bbcce
2023-09-28 19:14:33 +02:00
Walter Agazzi 55112bf242 AGS: Engine: fixed DCMD_NEWROOM cmd may prevent "First Time enter room" evt
This is a backwards compatibility fix. It seems like "new room" dialog command was
resetting a `in_new_room` variable, disregarding its value set by `load_new_room`
function. Changed to only set it in case it was not set inside a NewRoom call.
From upstream 45927bf23ea4ca051f74154fa4d0561a7df379ed (branch 3.6.1)
2023-09-23 17:10:08 +02:00
Walter Agazzi 12e4bb39fa AGS: Engine: force clear event queue in processallevents()
Was broken by a2f9a5b, then tried to fix by 6a71d85, but not fully fixed still.
From upstream cbaeff15229bb81828d418ed71a11dfe0b30e6fd
2023-09-23 17:10:08 +02:00
Walter Agazzi c3589db569 AGS: Engine: don't Poll non-clickable GUIs
From upstream 95a2ef2c0d6a4c04e3985d78920bfc4a70a641c0
2023-09-23 17:10:08 +02:00
Walter Agazzi 6166993f42 AGS: Engine: fixed WalkStraight() was resetting animation
if called again

This makes Character.WalkStraight() have the same animation
keeping logic as Character.Walk().
Also reduce code duplication by calling walk_or_move_character()
 which handles blocking movement already.
 From upstream c5b04eb0c8991026ebca593d6f3254dfe96fd290
2023-09-16 13:32:59 +02:00
Walter Agazzi 47b3cb7de7 AGS: Engine: rename legacysaves config options, bring to consistency
From upstream e8d043327f896ce4f10aee04d55a4029ce81d1eb
2023-09-16 13:32:58 +02:00
Walter Agazzi ae30f78761 AGS: Engine: support mismatching GUI numbers in legacy saves
From upstream 9d2fa2c26dda45fa53141a625c71ec63601cd9e2
2023-09-16 13:32:58 +02:00
Walter Agazzi fd47e099e6 AGS: Properly enable vsync following ScummVM setting
This allows scummvm to override the vsync setting, instead of
 just using the value set in the game acsetup config file
2023-09-02 17:55:18 +02:00
Walter Agazzi f1ce81461e AGS: Engine: hotfix game.top_inv_item script variable not working
Reimplemented from upstream a526a401cbf716ac7c0fc09eed92d24d60b54471
(branch 2.6.1)
This fixes the inventory scrolling in King's Quest 3 (Infamous Adventures)
and possibly other games of the era
2023-09-02 14:05:41 +02:00
Walter Agazzi 1c520e25a3 AGS: Engine: add proper asserts for number of GUI controls for legacy saves
From upstream ea34dd3e1758c6de4c8fc09d8d65dabc60c35b0f
2023-09-02 14:05:29 +02:00
Walter Agazzi 57e9963b2e AGS: Engine: fixed game package test when loading an old save
From upstream 40b679d25cd4ca41fc297ae37effac631d066bd3
2023-09-02 14:03:04 +02:00
Walter Agazzi 947acb21ec AGS: Engine: fixed improper cleanup of scrGUI array in unload_game_file()
From upstream 045b4a6ed1e09a2d563ee5ad0addf601f700173d
2023-09-02 14:02:52 +02:00
Walter Agazzi 4f069b677a AGS: Engine: fixed characters sometimes wait after moving before idle anim
Apparently "doing_nothing" flag was set too late, resetting previously set value.
From upstream bba8e84307e263953520a39bc5a31014e3bd04cf
2023-09-02 14:02:21 +02:00
Walter Agazzi 94a8518dd7 AGS: Engine: don't reset idle animation during speech with no speech view
This fixes idle animation getting reset to frame 0 at the blocking speech start
 if there's no speech view set. In such case the idle anim is expected to continue
 playing seamlessly.
 From upstream 7b399933a291a05e868cd9589b02d83d05f33314
2023-09-02 14:02:10 +02:00
Walter Agazzi 7cd860207d AGS: Engine: add object and char assertions in Get/SetProperty functions
Since older commit 5f3b8eb the properties are stored in vectors,
strictly resized to the number of characters and objects.
But the script functions that access these do not do any assertion
whether the object or char is valid, which could cause bad mem
access in case script loops over a array of objects of MAX_OBJECTS
size, or tries to access something using Object* pointer from another room.
From upstream 6ad4b220d75a32ea8df959e9a7b7f1ecb21d0c26
2023-09-02 13:23:59 +02:00
Walter Agazzi cca0be77a1 AGS: Engine: a config hint to assume data version when reading a legacy save
I did a terribly stupid mistake when was expanding the old save format in the
past (in pre-3.5.0 engines). Instead of checking for the save format,
I've been checking for the game's data format.

This causes following problem: if a game made in a particular range of versions
(something like 3.2.1 to 3.4.4) gets upgraded to a newer version (say 3.6.0),
then all the old saves made in a pre-3.5.0 game version will not load correctly,
as they are relying on the new compiled game data format.

Unfortunately there's no *proper* way to fix this, as the old save format
had been in use for years, nothing can be done about it.
Hence the workaround that I may think of is to provide a config hint,
that would tell the engine: whenever you load a legacy save format,
assume that it was written by a game of particular data version.

From upstream 0a2a0177dd8eaad817b39905bf0471663c431f96
2023-09-02 13:23:59 +02:00
Walter Agazzi 40e79d9e20 AGS: Engine: in legacy read save functions take game data ver as an argument
From upstream 8e280225f2c73980034db6866696f40d7bb63ad8
2023-09-02 13:23:59 +02:00
Walter Agazzi f5511afa82 AGS: Engine: also ignore special keys for skipping video and InventoryScreen
From upstream 7987e670fd58691de106f21d03c07fbc4094718c
2023-09-02 13:23:58 +02:00
Wyatt Radkiewicz 742f1f296d AGS: Fixed code formatting 2023-08-28 21:16:42 +02:00
Wyatt Radkiewicz 87656d66df AGS: Cleaned up blending/blitting pull request. 2023-08-28 21:16:42 +02:00
Wyatt Radkiewicz a22396163f AGS: Created test code for blending modes 2023-08-28 21:16:42 +02:00
Wyatt Radkiewicz 4ad7a30b38 AGS: Just fixed kTintBlenderMode 2023-08-28 21:16:42 +02:00
Wyatt Radkiewicz 07107b19bd AGS: Fixed ARGB blending and finished benchmark 2023-08-28 21:16:42 +02:00
Wyatt Radkiewicz d5b2cd4aea AGS: Added SIMD optimizations for stretchedDraw 2023-08-28 21:16:42 +02:00
Wyatt Radkiewicz 499dfd7d7a AGS: Added 2Bpp specifc code path optimization
Added a template specialization for 2bpp to 2bpp blits in
BITMAP::drawInner, makes 2bpp to 2bpp now around 2 times as fast as
normal 4bpp to 4bpp blitting.
2023-08-28 21:16:42 +02:00
Wyatt Radkiewicz aa9d13f84a AGS: Preliminary optimizations of blending funcs
Just commiting my first attempts at optimizing BITMAP::draw and the
blendPixel function. Here's an overview of the changes (some are
temporary):

- Put the loop of BITMAP::draw into its own function drawInner.
 I templated it so that I could put different paths into the loop that
 could be optimized out at compile time if a certain blending function
 didn't need it etc.

- I added apple NEON (SIMD) intrensics to the drawInner function,
 haven't ported it to SSE yet, but there is a small library that actually
 maps neon intrensics to sse ones.

- Removed a few ifs from the normal x loop and put it in the y loop.
2023-08-28 21:16:42 +02:00
wyatt-radkiewicz bf1f3dbb8b AGS: Refined the temporary bitmap benchmark
The old benchmark benchmarked the render_to_screen function, which
wasn't specific enough to what is needing to be benchmarked (
BITMAP::draw, and blending functions), so it was changed to just use the
drawing functions of allegro's bitmap directly. Also from just looking
at other games, it seems like AGS games use truecolor graphics more
often than not, so the benchmark test graphic was changed to truecolor.
2023-08-28 21:16:42 +02:00
wyatt-radkiewicz 9b77e3bf03 AGS: Preliminary bitmap benchmark code
Made basic benchmarking code in engines/ags/engine/main/engine.cpp, by
adding the code into the seemingly unused allegro_bitmap_test_init
function.
2023-08-28 21:16:42 +02:00
Walter Agazzi 2a255da048 AGS: Engine: Fix possible index out of bounds in SetBlender
From upstream 0f8e385d23f419e2faed7465d871c0260eda1a1c
Originally reported by mjunix@74037c7
2023-08-25 16:41:57 +02:00
Walter Agazzi 0a6991b586 AGS: Fix for inventory icons in old games
This fixes a regression in some old games such as ben jordan 3
Partially from upstream df30fc1edd30d4f334addaf7883286e745dea2c3
(branch 2.6.1)
2023-08-20 14:18:15 +02:00
Walter Agazzi 18b8335fea AGS: Engine: fixed the bw-compat SetObjectFrame() behavior
This was broken by eb376e6

1. Treating negative loop and frame as an instruction to keep latest object's
loop and frame values was introduced around AGS 2.70 by Object.SetView(),
but this behavior also propagated to SetObjectFrame() command.

2. Removed clamping of loop and frame values inside Object.SetView(),
as that prevented applying a historical behavior of SetObjectFrame(),
where any invalid loop and frame value would be changed to just 0.

3. Don't quit the game in case of invalid loop and frame, but fallback
to default 0 value, and print a warning.

Also removed some redundant assignments to RoomObject,
possibly a result of a commit merge from another branch.

From upstream 66bb18f0224eebfb2a130395e9b18ce59b584e13
This is the 3.6.1 branch, but the fix is required to solve a game-breaking
bug in Chronicle of Innsmouth
2023-08-14 18:34:58 +02:00
D G Turner a162a731d8 AGS: Fix Signed vs. Unsigned Comparison GCC Compiler Warning 2023-08-13 23:37:58 +01:00
Walter Agazzi 5039b5f3a6 AGS: Engine: small refactor, rem duplicate list of restricted game options
From upstream c4efd74fd28b31ee786e85a0ecc4a7c1fcb0685a
2023-08-13 10:58:26 +02:00
Walter Agazzi 6ea6675b3c AGS: Engine: tidy some code related to the old save format constants
From upstream fac1a5bed8e84d210a7ac6878133e13c39bde20b
2023-08-13 10:58:26 +02:00
Walter Agazzi e946f9f99d AGS: Engine: fixed GfxDriverSpriteEvtCallback return value for no room case
From upstream e3bb8a85d2af9c425528eb7a2f16741e2de7b9ab
2023-08-13 10:58:26 +02:00
Walter Agazzi 9e6dfbf258 AGS: Engine: ensure that restricted game options not loaded from save
This fixes occasional problem with save overriding game options that
must not be changed at runtime.
From upstream cf093f3a6ea657a2082edfc08c35cc7650961ab6
2023-08-13 10:58:26 +02:00
Walter Agazzi 7688ff025f AGS: Engine: sync audio in case of scheduled post-script actions
This fixes a case when a clip was ordered to Play right before
a Room change, or similar game mode change, but is delayed
 until after the change occurs.
From upstream d327b06bf5f3d8fff02b454d07560fcd5fc05b24
2023-08-13 10:58:26 +02:00
Walter Agazzi 793a5d6273 AGS: Engine: fixed System.Log() may cause exceptions with wrong format
From upstream ec9c494e391db23d587708cbe20cc6203b503396
2023-08-13 10:58:26 +02:00
Walter Agazzi d9377bbb63 AGS: Engine: Fix typo in commit b81abc533f508e5831e7ca6d2512c66d506ef09d
loopIterations -> loopCheckIterations
2023-08-13 10:58:26 +02:00
Walter Agazzi a6edbb5701 AGS: Engine: fixed few game warnings, may fill up the log in some games
Partially from upstream 8b2c97672d179f0ea33890c66bb2baa7131dd3a4
2023-08-13 10:58:26 +02:00
Walter Agazzi 3c4b80e14c AGS: Engine: report missing speech.vox as an "info", since this is optional
From upstream c6b5654a9cc7af05529c76b2a1d8ec3ad75c2c73
2023-08-13 10:58:26 +02:00
Walter Agazzi 4966d2a896 AGS: Engine: apply character's anim volume to portrait animation
+ process frame features for the first portrait frame too.
From upstream 59d4f740001b61af370ec0bca676a24d597f66b2
2023-08-13 10:58:26 +02:00
Walter Agazzi ff0298be68 AGS: Engine: ignore mod and special keys when skipping speech and wait
Partially from upstream 8079c87ca11fa6b60ed2dd2ce345cda6c384c00b
2023-08-13 10:58:26 +02:00
Walter Agazzi 2e784f5cd0 AGS: Engine: report "voice available" only if Speech dir contains any files
This fixes IsSpeechVoxAvailable() returning positive when game is run from
 the Editor, because Speech folder is always created in the project.
From upstream 0ca660e998e69283484f74818e17e837889e5896
2023-08-13 10:58:26 +02:00
Walter Agazzi cf90c85cd4 AGS: Engine: fixed crash upon resizing DynamicSprite while it's on screen
The bug is in UpdateSharedDDB(), the short-term texture cache did not test
whether the bitmap resolution is still matching the texture.
From upstream 1537ed77c875bbe660face3c07a3c4843b8bd95a
2023-08-13 10:58:26 +02:00
Walter Agazzi 8d3a2f07ce AGS: Engine: fixed crash upon resizing DynamicSprite while it's on screen
The bug is in UpdateSharedDDB(), the short-term texture cache did not
test whether the bitmap resolution is still matching the texture.
From upstream 1537ed77c875bbe660face3c07a3c4843b8bd95a
2023-08-13 10:58:26 +02:00
Walter Agazzi a31aac3bf2 AGS: Engine: fixed GUI controls not updated on set OPT_RIGHTLEFTWRITE
From upstream 3360f4a2f279d135d1107dd4fcda2031eed95fae
2023-08-13 10:58:26 +02:00
Walter Agazzi cd6a6ddc8c AGS; Engine: tidied SetGameOption()
* handle readonly options;
* don't do anything if new value equals old value;
* replace if/else sequence with a switch;
From upstream 2476bc3e517c13ef1abde83fca2e55571bcfff4a
2023-08-13 10:58:26 +02:00