Commit Graph
75 Commits
Author SHA1 Message Date
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 57464f3dce AGS: Engine: Complete "object interaction events take obj pointer and mode as params" commit
This completes cb6cce267d75ccdbca452873693a1ccadf0f688b
2024-10-30 18:07:42 +02:00
Walter Agazzi 815041ec6a AGS: Engine: store game's ccInstances as unique_ptrs instead
The script handling part of the engine appeared to be too fragile and dependent on
 a precise timing of **deleting** a ccInstance.
For example, restoring a saved game may execute in the midst of the call to
RunScriptFunction(), at the "post script cleanup" stage, while there are still references
to ccInstance on the engine's call stack (and few other places). If anything prevents
 ccInstance's disposal at this moment, that would in turn lead to logical errors due to
  the game scripts "instances" counting. The most outstanding consequence is that the
   script exports are kept pointing into the deleted memory and not re-registered after the save is restored.

Overall, the script handling part of the engine would benefit from a major refactor,
 with a goal to make it safe and consistent, but this is not something I might do at the moment.

From upstream 1f6abf4b678f77825c710d4ae18b57ff8f882c93
2024-10-30 18:07:42 +02:00
Walter Agazzi 09ffee9ed7 AGS: Engine: store ccInstances in shared_ptr, tidy freeing of instances (take two)
After the updates to cc_instance this should now work

From upstream b1e4f75141ce88b3146f55ecd9d7a95378428072
and 49e8aa0b566dea4ce025f9530a9f2392dbe67a33
2024-10-30 18:07:42 +02:00
Walter Agazzi f62f270423 AGS: Engine: use enum for Text script callback types
From upstream 047f6fb020564bca9c6d99d1f6c1474386e3da97
2024-10-30 18:07:42 +02:00
Walter Agazzi 720b7a53ec AGS: Engine: object interaction events take obj pointer and mode as params
Partially from upstream 1897504aa30fda5f7d5cc9d9538cb49944c70151
2024-10-30 18:07:42 +02:00
Walter Agazzi 51cf1f1568 AGS: Engine: tidied code in RunObjectInteraction functions
From upstream c20764239b3a8a234c473feb4f7009afdc3c4c6d
2024-10-30 18:07:42 +02:00
Walter Agazzi dd8c13c1f0 AGS: Engine: replaced global evblock* vars with a local ObjectEvent argument
From upstream 279d3d78ff04423fce137a4907fd42d44ee12969
2024-10-30 18:07:42 +02:00
Walter Agazzi 8153a59121 Revert "AGS: Engine: store ccInstances in shared_ptr, tidy freeing of instances"
This reverts commit 016323f1f9797827a36a77ae3a5859b56d3b0998.
2024-10-30 18:07:42 +02:00
Walter Agazzi 253187f4e2 Revert "AGS: Engine: store game's ccInstances as unique_ptrs instead"
This reverts commit 547cd40186876f17914f6a96261aaf5c4dfc21b4.
2024-10-30 18:07:42 +02:00
Walter Agazzi b1e7617964 AGS: Engine: store game's ccInstances as unique_ptrs instead
From upstream 1f6abf4b678f77825c710d4ae18b57ff8f882c93
2024-10-30 18:07:42 +02:00
Walter Agazzi 4019f9305b AGS: Engine: store ccInstances in shared_ptr, tidy freeing of instances
From upstream b1e4f75141ce88b3146f55ecd9d7a95378428072
and 49e8aa0b566dea4ce025f9530a9f2392dbe67a33
2024-10-30 18:07:42 +02:00
Walter Agazzi 96257b87cb AGS: Engine: ensure that all AnimateObject variants lead to the same impl 2024-10-30 18:07:42 +02:00
Walter Agazzi c4f25a16ed AGS: Engine: ensure that all AnimateCharacter variants lead to the same impl
from upstream eb623b4557c91e353fe6fa1bbcfc109e614ceac2
2024-10-30 18:07:42 +02:00
Hubert Maier e94b47c01a JANITORIAL: AGS: Fix typos 2024-09-11 11:01:26 +03: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 cce6aff754 AGS: Engine: replaced uses of strncpy with snprintf for safety
From upstream 02feb81b34f041dccd8a4bb33ff060cc532d979b
2024-01-17 03:12:30 +01:00
D G Turner a162a731d8 AGS: Fix Signed vs. Unsigned Comparison GCC Compiler Warning 2023-08-13 23:37:58 +01: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 e3bf334921 AGS: Engine: made run_interaction_script() safer in case evt is too high
From upstream 4d7565099652c019d0dcbac5c60f62d735dfae3e
2023-08-13 10:58:26 +02:00
Hubert Maier a316869e7c AGS: Correct spelling mistake
occured -> occurred
2022-10-27 15:56:08 +02: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
Paul Gilbert 1607b2530b AGS: Fixed script errors when non-obligatory callbacks are missing
From upstream 29aaa19d712c3edf5701c648833283011c2f7298
2022-05-08 11:37:49 -07:00
Paul Gilbert 28a2b6aa9c AGS: Added extra checks for abort_engine being set
This fixes an intermittant error I noticed when
qutting QFG2AGDI via the quit dialog could open
the debugger with an error rather than exitting
2022-05-05 22:41:09 -07:00
Paul Gilbert 540a92a6c5 AGS: Necessary fixes to build with latest changes to ccError
From upstream 238b18e2ea0a34742d50c5d4298a06cc3077dcdd
2022-05-05 22:41:07 -07:00
Paul Gilbert 8e132f7b3f AGS: cc_error returns stack from all script threads
From upstream 9e76800d668d8d0af7d47d815e6d1b781c7601f6
2022-05-05 22:41:07 -07:00
Paul Gilbert 16d0d89787 AGS: Grouped ccError variables in a struct
From upstream 48ef387226e4d420dc62d0a0b204cf4cd89a1139
2022-05-05 22:41:07 -07:00
Paul Gilbert a2a5f2575d AGS: Reorganized few cc_ headers
From upstream ea1f8b9ece69fc7c49c4d3aa7b9af51c4ca736e5
2022-05-05 22:41:07 -07:00
Paul Gilbert 480be2134b AGS: Added script instance thread stack, replacing current_instance
From upstream f3443cb7a4ae5858e5d2d28131aaf6cf138bc0ec
2022-05-05 22:41:06 -07:00
Paul Gilbert a6f42ad1ab AGS: Fixing various "unused va/arg" warnings + removed empty funcs
From upstream 61771ecd638338806c40d0da2bf1addea06cac90
2022-04-25 21:44:40 -07:00
Paul Gilbert 9533c0e028 AGS: Made script module index an unsigned value
From upstream bd4e65677eb0319ff746e519ee40016000a4f4f9
2022-04-24 16:00:04 -07:00
Paul Gilbert 7ebdd8f304 AGS: Removed redundant <3 params check from DoRunScriptFuncCantBlock
From upstream f156586fa9d6b99249eaff54230179f784fdec09
2022-04-22 21:04:25 -07:00
Paul Gilbert c0010986ac AGS: Implemented on_text_input(int chr) callback
From upstream ba866abab0ba5a48b8577c4a01f0533a2d7e68de
2022-04-18 19:10:39 -07:00
Paul Gilbert b2d8bcad75 AGS: Refactor RunTextScript* functions for the purpose of clarity
From upstream 17af6ca2cb1fba310900f5189da788fa52ef7dab
2022-04-18 19:10:39 -07:00
Paul Gilbert 2e24e08d5b AGS: Brought few "run script" functions to similar arg list
From upstream 78163a07400353013dd939ca86f5513f3196394a
2022-04-18 19:10:39 -07:00
Paul Gilbert 27ad60df72 AGS: Unify video flags in VideoPlayer, convert in script functions
From upstream e5c8293a8c8350c38a8df338f56e3806fdc4f119
Plus changes to local video player implementation to reflect changes
2022-04-12 22:27:56 -07:00
Paul Gilbert fb52856d7e AGS: Reorder function linking steps
From upstream 0f977a56f0b1cf293f711e8380bb9ddaa54d2573
2022-03-29 21:43:59 -07:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Paul Gilbert 80dbcd7fc8 AGS: Fix inventory scroll buttons in 5 Days a Stranger 2021-09-29 21:47:59 -07:00
Thunderforge 35c3668275 COMMON: Fixing misspellings "occured" -> "occurred"
Fixing this misspelled word across multiple parts of the codebase.
2021-09-25 21:36:42 +03:00
Paul Gilbert 6a8f1f9a71 AGS: More accurate notification of GUI control changes for redrawing
From upstream fd7cb8dc822e50cc485aa0dfc937217ead1cb996
2021-08-20 21:49:38 -07:00
Paul Gilbert 46eeb0aa2a AGS: Fix crash quitting app when speech dialog is active 2021-07-10 20:23:52 -07:00
Paul Gilbert 44828747f4 AGS: Fix crash quitting Whispers of a Machine from main menu 2021-06-25 22:29:35 -07:00
D G Turner efc9e04ce0 AGS: Fix Various GCC Compiler Warnings 2021-06-15 11:07:23 +01:00
Paul Gilbert 73347d4559 AGS: Remove _G macros from comments 2021-06-13 21:09:00 -07:00
Paul Gilbert eb1e337edd AGS: Removed String's "const char*" conversion operator
From upstream 7c426674e7e53bffe9120f8ffc059b77fa03a606
2021-06-13 21:08:59 -07:00
Paul Gilbert adb44e0336 AGS: Replaced few cases of strcmp with String::Compare and equivs
From upstream 69288fb93cbc78fc76eb9212e3e23f504b0d50e1
2021-06-13 21:08:58 -07:00
Paul Gilbert 87dba2e276 AGS: Re-added checks for SHOULD_QUIT and abort_engine 2021-06-13 21:08:52 -07:00
Paul Gilbert 701396361c AGS: Import of fresh codebase 2021-06-13 21:08:44 -07:00