Commit Graph

1245 Commits

Author SHA1 Message Date
mausimus
f9f1a3cbab AGS: Parser fixes from upstream
Compilation of three bug fixes to text parser I recently made in the AGS project, around alternatives syntax:
1. Stop parsing when reaching end during alternatives skipping (causing an out-of-bounds memory read)
2. Correctly skip over multi-word alternatives (incorrect parsing of alternative lists)
3. Use dedicated function to identify word boundaries (affecting dash and apostrophe containing alternatives)

Upstream commits (release-3.6.1 branch):
1. 17f8ea2f0efadec7b3696d4ba51733f1cddc0772 (check for end of input not to go beyond)
2. e98315393a34629b8935fdee7bd725a8299f941c (fix multi-word alternative skipping)
3. 9b0ccbd04e36e757392b1fc744919c785310c57b (consistently check for word boundaries)
2024-06-30 14:19:21 +03:00
Walter Agazzi
fbbb6f1840 AGS: Use the modXmS3m player for mod playback
Some games (e.g Reactor9) may include .mod files that are not playable
with the standard protracker player.
Also fix looping not working in rare occasions.
2024-06-27 23:10:42 +02:00
Walter Agazzi
659ac0794f AGS: Fix legacy upscaler not being enabled in a few old games
Fixes misbehaving hotspots in RRSTD3, Norman Cooks and possibly others
Fix #15229
2024-06-25 17:52:17 +02:00
Walter Agazzi
c7bb8a3a27 AGS: Engine: hack for pre-2.70 games to ignore RestartGame before NewRoom
Reimplemented from upstream 0711b6fdc0f1c71c341716a20de0d90a75f1ec92
2024-05-05 14:24:26 +02:00
Walter Agazzi
824e7507aa AGS: Add check for unsupported videos in Earl Mansin 2024-05-05 14:24:26 +02:00
Walter Agazzi
853c225331 AGS: Engine: fix legacy pathfinder imprecision in some old games
This complements c3a0553e25
adding a configurable parameter. There are no functional differences

From upstream 1c226816e2c3c9c18c3afb976e05535401fc5db4
2024-05-03 17:24:08 +02:00
Walter Agazzi
7abf9ab5fd AGS: Engine: fixed "mouse up" event could cause a recursive on_event
First "on_event" firing after mouse button is released may cause a sequence of blocking actions.
If there's any control checks during them, the global "wasbutdown" variable will be tested again,
potentially leading to a recursive "mouse up" event, except it's not run immediately, but scheduled
until after the first one has completed running.

For this reason "wasbutdown" must be reset BEFORE firing any events.

This was broken a VERY long time ago, it seems, probably by commit 2f54a16
From upstream ff1baccbffd8ee79fe3a5aff547e2ac7b8d8aaf5 (branch 3.6.1)
2024-05-03 12:49:51 +02:00
Walter Agazzi
6907a85fe4 AGS: Use guid instead of gameid for Donna AoB workaround 2024-04-25 18:58:30 +02:00
Walter Agazzi
c46b2feaca AGS: Engine: removed redundant quit_shutdown_scripts()
Scripts are shut down in unload_game().
It did not do what the function name implied anyway...
From upstream 67c0bdc9e854c558282d290ef5952ac211cc4133
2024-04-02 23:18:14 +02:00
Walter Agazzi
cc6bbd1083 AGS: Engine: hotfix potential exception if cc_error is called during quit()
From upstream a64e3424f70677f9393e4f8c506f03ed628aee47
2024-04-02 23:09:17 +02:00
Walter Agazzi
c3a0553e25 AGS: Use lower granularity in pathfinder for old games
This is a fix for the staircase bug in old Maniac Mansion Mania games.
2024-04-02 22:42:44 +02:00
Walter Agazzi
2bcaa19756 AGS: fix all_buttons_disabled check condition
completes commit c77989f2603cc1ff6d8ca27bf62668b16707bcb6
2024-03-28 12:03:33 +01:00
Walter Agazzi
6c8e783e4a AGS: Engine: add hotspot id assertion to GetHotspotProperty
This is made in line with previously added AssertObject().
from upstream 99f94c469636522bd2d89923901659476d816577
2024-03-28 12:03:33 +01:00
Walter Agazzi
f09519834c AGS: Engine: updated unload_game_file(), fix few things not reset
This is not as important in case of game quit, as it is in case of RunAGSGame().

* Adjusted order of data release in unload_game_file() to be in sync with 3.6.1 (as much as possible).
* Fixed GameSetupStruct not releasing some of the data in Free().

Noteably this fixes font infos to not getting fully reset on RunAGSGame().
from upstream 1cc9d22095d0ee90541ce506fa54c538de7ca4ad
2024-03-28 12:03:33 +01:00
Walter Agazzi
79f3b6eec5 AGS: Engine: for Software mode fixed disabled controls leaving traces on gui
from upstream fb15befa124a9b3202263eb79e20e0060de5410a
2024-03-28 12:03:32 +01:00
Walter Agazzi
ecc7642775 AGS: Engine: fixed kGuiDis_Blackout in "draw controls as textures" mode
partially from upstream 21664626e69e559a14c9159ceaa7a10eef681867
2024-03-28 12:03:32 +01:00
Walter Agazzi
59e2d4955e AGS: Common: fix all_buttons_disabled's type, for clarity
from upstream a60eb5d2f484c1783f4a52f46dfcae94f5e07865
2024-03-28 12:02:40 +01:00
Walter Agazzi
9d0e82c4d3 AGS: Engine: fixed camera may fail to restore its position in the room 2024-03-28 12:02:40 +01:00
Walter Agazzi
27aceb5888 AGS: Engine: fixed text parser in Dialog Options in "new key handling" mode
from upstream b9c3bb51e6f437ee574f550956b34a672b47b5e5
2024-03-28 12:02:40 +01:00
Walter Agazzi
bb72a09404 AGS: Engine: fixed "lowest compatible save version"
This was broken by a typo made in fac1a5b
From upstream 44a3fcd03b4df0f16faee4ce70ca2c4c7b0469ab
2024-03-28 12:02:39 +01:00
Walter Agazzi
de31994dd0 AGS: Engine: safeguard Overlay.Create in case of non-existing sprite
From upstream 57e21b06b99b53f38d0491e5cb17991738f552bd
2024-03-28 12:01:52 +01:00
Walter Agazzi
2e5560fd1e AGS: Remove no longer used move_speed global vars 2024-03-28 12:01:52 +01:00
Walter Agazzi
0b50067abb AGS: Engine: implement add_waypoint_direct(), fix AddWaypoint's resolution
This fixes Character.AddWaypoint not applying room<->mask resolution conversion,
which result in character's speed being different if room has non 1:1 mask resolution.

Hide calculate_move_stage() inside pathfinder, and expose add_waypoint_direct()
in the pathfinder interface instead.
From upstream 093354d78849dc3b4f13a244d4400c4e71f7d687
2024-03-28 12:01:52 +01:00
Walter Agazzi
dacccc343e AGS: Engine: fix use of global "walkspeed" variables in the pathfinder
These variables had to be set using set_route_move_speed() call in order for
the find_route() and calculate_move_stage() work properly.
But it's not obvious, and easy to forget. So turn them into function arguments instead.

This fixes Character.AddWaypoint potentially using wrong walkspeed, if there are
multiple characters or objects moving simultaneously.
An example of a script that would cause a bug:

    cEgo.AddWaypoint(20, 20);
    oObject0.Move(0, 160, 1, eNoBlock, eAnywhere);
    cEgo.AddWaypoint(200, 200);

from upstream 9a00255a2699845bd0e53054d81c24e6955f663e
2024-03-28 12:01:52 +01:00
Walter Agazzi
42a26dc75b AGS: Engine: renamed cant_skip_speech to speech_skip_style for clarity
Also... the old name had inverse meaning to what the variable really did.
From upstream 44f1188992691c118aea15cffa0a73d6d4302601
2024-03-28 12:01:51 +01:00
Walter Agazzi
092ef64fc6 AGS: Engine: fixed speech stuck in "post state" under some conditions
This fixes repeated post-state on/off switching, and as a consequence - endless loop
 in cause of a "..." sentence, that  is run until messagetime reaches -1 on its own,
  which did not happen because of repeated post-state.

NOTE: looks like an original bug introduced along with the DisplayPostTimeMs property.

From upstream 37360990b22a79380f2a5b34e686a2d2fbcf7de1
2024-03-28 12:00:55 +01:00
Matthew Jimenez
771dc751db GRAPHICS: Switch ManagedSurface to use Palette class 2024-03-18 21:06:04 +02:00
PushmePullyu
13b7608492 AGS: Replace local static "last_cutscene_script_pos" with field
Fixes #15015
 "AGS games lead to a reproducable crash on exiting ScummVM"
2024-03-18 12:39:59 +01:00
Walter Agazzi
ab27a90568 AGS: Add sanity check for cursor value
While upstream AGS just silently ignores the value,
ScummVM isn't as permissive. Prevents assert in Alum
2024-03-04 15:38:53 +01:00
polyesterswing
28883f9dfe AGS: Add support for libopenmpt 2024-02-21 18:45:25 +01:00
polyesterswing
ea03d64b62 AUDIO: Rename impulsetracker to universaltracker 2024-02-21 18:45:25 +01:00
Walter Agazzi
71e453930a AGS: Fix partial outlines for some letters in Kathy Rain
Clifftop's Spritefont plugin returns a off-by one size for font2 that
causes a broken outline for some characters. Fixing the value on
the plugin side breaks line spacing, this adds a workaround to the
autooutliner to avoid the issue.
2024-02-11 23:22:14 +01:00
Torbjörn Andersson
2e3f4619fb JANITORIA: Remove redundant semicolons 2024-02-08 21:20:02 +01:00
Walter Agazzi
3f4d9e4a16 AGS: Fix luminance=0 being improperly set to 255
The sanity check should only be  applied for negative values,
otherwise a fully dark sprite ends up fully lit.
This is clearly noticeable in Unavowed during the
encounters and during the intro.
Fixes #14176
2024-01-31 22:36:30 +01:00
Walter Agazzi
015937d586 AGS: Add workaround for qfg2agdi to allow importing sci exported chars
Fixes TRAC #12335
2024-01-31 14:50:07 +01:00
Walter Agazzi
d42e55212c AGS: Return more meaningful message in GetDriverName 2024-01-17 03:12:32 +01:00
Walter Agazzi
a660cd67a4 AGS: Engine: fixed bytecode fixup assertion done for unapplicable case
Was broken by 973845a
From upstream 9d86d5ab1a6e84115c33ffbfc8a96185e6b9fd63
2024-01-17 03:12:32 +01:00
Walter Agazzi
7a281232f6 AGS: Remove leftover lines breaking save/load 2024-01-17 03:12:32 +01:00
Walter Agazzi
de715bab92 AGS: Engine: fixed uses of scsystem.color_depth
This complements 67c3bdc
From upstream 79c70aac2b0df604cdb7adab8fc596a18c7d4c74
2024-01-17 03:12:31 +01:00
Walter Agazzi
30fc1a911d AGS: Engine: fixed System.ColorDepth to returning game's native depth
This logic got confused at some point in engine development. This property had a meaning back when display mode matched the game's native color depth.
Plugins also could rely on this, when drawing on a software renderer's virtual screen, which must match game's native depth and not the final display resolution.
From upstream 67c3bdc403d5178f1c5c390af820bc446f94f21b
2024-01-17 03:12:31 +01:00
Walter Agazzi
7e003f30e9 AGS: Engine: allow old-style resolution upscale for kGameResolution_Default
From upstream a7f3c775de0f1a82c34b5f3acd67418aec31bf17
2024-01-17 03:12:31 +01:00
Walter Agazzi
46b14a21c6 AGS: Engine: safety check for fixups with out of range code reference
From upstream 973845a15ed9726956895161c8847bc668c3e787
2024-01-17 03:12:31 +01:00
Walter Agazzi
d18f7cac25 AGS: Engine: replaced another case of strncpy with snprintf
From upstream 73e49b44db8042aa307bff7fadf51f67156658be
2024-01-17 03:12:31 +01:00
Walter Agazzi
cce6aff754 AGS: Engine: replaced uses of strncpy with snprintf for safety
From upstream 02feb81b34f041dccd8a4bb33ff060cc532d979b
2024-01-17 03:12:30 +01:00
Walter Agazzi
4eaac90e4e AGS: Common: safer reading of fixed-len string fields
From upstream 458a524a418f30142f5fe2e512902b7e00e97eec
2024-01-17 03:12:30 +01:00
Walter Agazzi
4e6d475e17 AGS: Engine: fixed gamename label not updating if Game.Name changes
From upstream ae34b8881f64d422971aab3d70758c5184aca0b4
2024-01-17 03:12:29 +01:00
Walter Agazzi
a7266499a5 AGS: Engine: misspelling fix: perfomance->performance
From upstream c4cf67ac5bc5ac3463609eeefea16c1caa8abab9
2024-01-17 03:12:29 +01:00
Walter Agazzi
8aa46edc16 AGS: Common: account for Font's height when calculating ListBox and TextBox
Historically these controls could draw text beyond their vertical bounds too (in non-clipping mode).
From upstream c9572541a6f8d38ed2ca1ba7af8e235c5d56c8f2
2024-01-17 03:12:28 +01:00
Walter Agazzi
b395603107 AGS: Engine: print which gfx driver is set to the log
Partially from upstream f58f9634422ae28f54d1fd9dc6112c62ad283597
2024-01-17 03:12:28 +01:00
Walter Agazzi
95b0b2fc4d AGS: Engine: when drawing TextWindow clip border pieces, fix over corners
This fixes vertical or horizontal borders to be drawn under rightmost and bottom
corners, which may have transparent parts.
From upstream a77393abc2353a7d8309b7edf1f0ff582c34778c
2024-01-17 03:12:27 +01:00