Commit Graph
61 Commits
Author SHA1 Message Date
Walter Agazzi 8cbd20943e AGS: Engine: fix ypermove comparison
From upstream 9cf99a3583fcb05dd983d9ce06a513851e47dd57
2024-11-07 00:05:37 +01:00
Walter Agazzi efc70d1e1d AGS: Engine: mark portrait sprite updated, as it's now a dynamic sprite
This is necessary since overlays keep custom images as dynamic sprites too.
From upstream b88167fd0ba608352482f9fd09e87e2c0246cdbc
2024-10-30 18:07:42 +02:00
Walter Agazzi 822842d038 AGS: Engine, Common: refactor guard using set_our_eip
Remove naked our_eip usages
From upstream 9f4371ab8c2fbc9ccf41b49f7b975ebe8bc5d1b8
2024-10-30 18:07:42 +02:00
Walter Agazzi 1ee7c47af2 AGS: Engine: fixed a condition in movelist_handle_remainer()
Should compare xpermove and ypermove using abs values,
as they may have different signs.
From upstream 234db6dc918490c1e2e4a82da8c6bd30987c227e
2024-10-30 18:07:42 +02:00
Walter Agazzi 9c7e414387 AGS: Engine: another small fix in do_movelist_move()
From upstream 354917c602144f5f1c902bfb44f970af860e799b
2024-10-30 18:07:42 +02:00
Walter Agazzi e3e6b75af5 AGS: Engine: reverted serializing movelist remainer, recalc on restore
Sorry for these changes, i decided that it's annoying to save the "fixup"
values used only in rare circumstances, that may be easily calculated
from basic MoveList members.
From upstream 13e59c4855a4ddcf9bfe5f935d6de1191debaf1e
2024-10-30 18:07:42 +02:00
Walter Agazzi 50b34a65c2 AGS: Engine: bit more refactor of movelist update, picked "move done" check
From upstream 36d18a543405b40f2259266707cc513e8e8f6646
2024-10-30 18:07:42 +02:00
Walter Agazzi 9021cd0f04 AGS: Engine: another small fix in do_movelist_move()
From upstream 5789ac12160f389fd880a494c154f740b3b9c715
2024-10-30 18:07:42 +02:00
Walter Agazzi 45f011ecd8 AGS; Engine: store MoveList final move as members, and serialize
This is to avoid recalculating exact same values on each movelist update.
The "final move" may continue for a while if the "short" axis of the move
vector is finished earlier than the "long" one.
When serializing, use 2 freed int32s, left after removing 2 unused member variables.

From upstream 57e369ec2bcf6a8eee61c45be8266f45e8a0c922
2024-10-30 18:07:42 +02:00
Walter Agazzi 56b3fd3299 AGS: Engine: converted MoveList::onpart to float
From upstream b0ba1ac225c0b4e5093e58ff70051cf0e297f06b
2024-10-30 18:07:42 +02:00
Walter Agazzi 2dc8b67350 AGS: Engine: in MoveList store steps as fractional values, for recalculation
Make MoveList::onpart a fixed point value too, allow more precise "current progress"
recalculation when the moving speed factor changes.
Possible TODO: on move update, the first step after recalculation should bring `onpart`
 the the nearest integer, to make the movement progress more consistent.

From upstream b28ca9f86b8b70a73e4f6fa6f1c72ce76f29ecf6
2024-10-30 18:07:42 +02:00
Walter Agazzi 19496a8e24 AGS: Engine: fixed walking remainer duplicates speed
This complements/fixes c3f03de
From upstream e699ca77b43da7c07691c52c50e6f786ec74a911
2024-10-30 18:07:42 +02:00
Walter Agazzi f1a9a35758 AGS: Engine: a new fix for character stalling before finishing movement
AGS historically has a hidden problem: its pathfinder and walking algorithm uses math with relatively low precision.
 This may result in rounding mistakes. What this means in practice is that under some circumstances the
  "movement direction" (vector) is slightly off, e.g. more towards X than Y (or other way). In such case the character
   may reach the X destination while Y destination is still few pixels away.

How is this issue solved currently in AGS (and for a long time): when AGS finds out that one coordinate is complete,
 but another is not (for example X done and Y is still not reached), it starts waiting until character reaches Y, but also
  accepts a certain "mistake", in 2-3 pixels. If character is already within 2-3 pixels from the destination, then it just stops.
 This makes its real stopping point inaccurate, but nothing else happens.
 However, if character is further away, then it keeps "walking", but because the movement vector is still pointing
  in the same direction, usually it takes few moments for it to reach the proper Y coordinate.
   This results in a buggy effect known as "walking in place".

This commit introduces a new solution: turn the walking vector to make it point right along the unfinished axis,
 while keeping its length (that means - walking speed), in order to reach the destination faster.
This should make character make some extra short move, properly animating, but this may look more natural
 than just moving legs in place.

NOTE: I still keep the "destination fix" for the old games, as they may be scripted specifically to test
 where character has stopped moving.
 From upstream c3f03dea01a897b23795298e77db56506e44902f
2024-10-30 18:07:42 +02:00
Walter Agazzi 56c790c838 AGS: Engine: tidy do_movelist_move() and MoveList further
From upstream 3292c4cf7ff549832fdd0249ac1ee6d805e91f93
2024-10-30 18:07:42 +02:00
Walter Agazzi 22cb981566 AGS: Engine: rewrote MoveList to avoid packed shorts
From upstream d463adac63817fd08eb757038f90c730726124d3
and 09203df6efb19cf0f2eafd098c798733bd85cfe0
2024-10-30 18:07:42 +02:00
Walter Agazzi 5b66b860af AGS: Engine: separate functions for getting game's set and real fps
From upstream cacaa9be6f7a0194b89fd2255acc9b8b612622b4
2024-10-30 18:07:42 +02:00
Walter Agazzi f866475b7f AGS: Engine: REALLY apply character's anim volume to portrait animation
+ process frame features for the first portrait frame too.
From upstream efc3941fe335d0cf4a34dbb65a75c012f8d6df40
2024-10-30 18:07:42 +02:00
Walter Agazzi 2ae4a1ebd8 AGS: Engine: some refactor + apply volume for character face animations
From upstream a31beb6b76243902e75a49e901165c9565e8553a
2024-10-30 18:07:42 +02:00
Walter Agazzi f9087ab378 AGS: Engine: optimized ScreenOverlays storage (vector variant)
Keep ScreenOverlays in std::vector, but do not erase elements
 in the middle and invalidate them instead. Record free indexes
 in a helper stack.
 When creating a new overlay, first check for the recorded free indexes.
Overlay's type now equals storage index.

This speeds up both creation/deletion of overlays, and their access.

Removed the gap between "fixed" overlay types and custom ones,
 to save space. If we ever need more special overlays, these could
 be created as custom and their ids saved in a variable (similar to
 how background speech works). Previously present special overlay
  types are left for backwards compatibility (and to simplify the transition).
  From upstream f7d2f162fa55aa1b6f37195d890ebe047a204154
2024-10-30 18:07:42 +02:00
Walter Agazzi d8d4a77724 AGS: Engine: hide "screenover" vector behind interface functions
From upstream 3b049092875293b0960013910586f3adb017c862
2024-10-30 18:07:42 +02:00
Walter Agazzi 5acc31c4ed AGS: Engine: remake LipSync arrays into std::vectors
From upstream b4f937a5c9900c0b05ef6ae2bc6051e970c2889a
2024-10-30 18:07:42 +02:00
Le Philousophe 49b4c1b3c4 AGS: Revert to use std namespace
This allows to minimize changes from upstream
2024-07-08 21:37:28 +02:00
Paul Gilbert c2a476411c AGS: Move std namespace into common/std/ 2024-07-07 15:28:31 -07: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
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
Thierry Crozat 4dcde68f4a AGS: Remove unnecessary include of std/math.h 2023-06-06 08:59:58 +01:00
Walter Agazzi c537416279 AGS: Engine: renamed WalkArea.Light to PlayerView, matching its real purpose
Apparently, this field was used to store light level of the
walkable area in pre-2.55 engines, prior to introduction of the
Regions.
In current engine, when loading games that old, this value is
copied into Regions for backwards compatibility.
While in newer games it actually stores "player character
view" override.

Renamed update_shadow_areas() into update_player_view(),
and tidied the code for clarity.

From upstream 71e7dc880b4496dd6937cec00a56f0de66137482
2023-04-29 13:11:41 +02:00
Thierry Crozat 282ee9ad97 AGS: Fixing more trivial warnings
From upstream 83f7d9857e70f7d1d10fedf61196740d20ba0b0a
2022-06-18 01:08:54 +01:00
Paul Gilbert 3ac6998a98 AGS: Support Overlays not copying the image, but storing a sprite id
From upstream fd14bd4075bd9e6a577235f2434275b260250c46
2022-05-08 11:37:49 -07:00
Paul Gilbert cf091f2d3e AGS: Replaced couple of variables in ScreenOverlay with flags
From upstream 38a4e8c262f0ec796225494fc939b283680caf57
2022-05-06 20:16:41 -07:00
Paul Gilbert 6482e38803 AGS: CharacterExtras and MoveLists are stored in std::vector
From upstream 0c81cfefb788c0dcfdb2cad914f939f28110edca
2022-05-05 22:41:08 -07:00
Paul Gilbert b2d5b6e586 AGS: Implemented Overlay.Width & Height working as scaling
From upstream 3a27e81a710a1c3de4b745d84dca39554dc64385
2022-05-01 17:23:24 -07:00
Paul Gilbert 14209fafed AGS: Removed arbitrary character followers limit
From upstream c64850badd610b3ce90821a080e7e6b04d65193e
2022-04-13 21:55:19 -07:00
Paul Gilbert c25b08448d AGS: Removed AudioChannelsLock as it's no longer needed
From upstream 43f9320f66bb881920e6f812d1c642e793b134b6
2022-03-18 21:29:56 -07:00
Paul Gilbert a3dda03cf1 AGS: Store Views in std::vector
From upstream 095db88ae0f1acceb298f793a2e1b81dbe06fcff
2022-03-18 21:29:56 -07:00
Paul Gilbert 6bf83c7f39 AGS: Removed Overlays' arbitrary limit
From upstream 735dcfb14069b38aace4cef9468d44b63349d1bd
2022-03-15 22:28:36 -07:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Paul Gilbert d90cb0d203 AGS: Removed excessive headers containing random group of includes
From upstream 9e5149457a4638694fb1366b3fa59b08816f522c
2021-08-17 21:31:56 -07:00
Paul Gilbert 65f992979e AGS: Implemented Game.BlockingWaitSkipped
From upstream ce6bd0173f668932a0a5cab41119d2a476f7e73c
2021-07-27 22:03:38 -07:00
Paul Gilbert 9612b5cb35 AGS: distinct overlay types of speech and messagebox
From upstream d7c091890d2cde07776cca4ebbed7352d379612d
2021-07-27 22:03:37 -07:00
Paul Gilbert b104d78888 AGS: Enabling disabled blocks, and making ScummVM needed changes 2021-06-13 21:08:50 -07:00
Paul Gilbert 701396361c AGS: Import of fresh codebase 2021-06-13 21:08:44 -07:00
Paul Gilbert 2d82d32577 AGS: Move draw.cpp globals to Globals 2021-03-09 21:14:02 -08:00
Paul Gilbert dc019af530 AGS: Move character.cpp globals to Globals 2021-03-08 19:04:35 -08:00
Paul Gilbert 37b563ef35 AGS: Move game globals to Globals 2021-03-07 19:23:24 -08:00
Paul Gilbert acf3a6e080 AGS: Move overlay.cpp globals to Globals 2021-03-01 19:52:51 -08:00
Paul Gilbert 887472c8c1 AGS: Moved a lot of game.cpp globals to Globals 2021-02-28 13:27:21 -08:00
Paul Gilbert ef245e2104 AGS: Move thisroom to Globals 2021-02-28 13:27:21 -08:00
Paul Gilbert 334b2a9d48 AGS: Move play to Globals 2021-02-27 15:31:34 -08:00