Commit Graph
269 Commits
Author SHA1 Message Date
Walter Agazzi 981c202e71 AGS: Add AGSBMFontRenderer plugin stub
Just a stub for now, but at least Falcon City is playable in English
Fixes #14893
2024-02-01 13:19:01 +01:00
Eugene Sandulenko 1d6f7b05ea JANITORIAL: Clean up some English language 2024-01-21 00:28:44 +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
Cameron Cawley 49b68d6756 ENGINES: Make use of M_PI where possible 2024-01-08 02:56:30 +01:00
Walter Agazzi 64edc1cdc2 AGS: Engine: restored faster String.Chars and Length variants for ASCII mode
The purpose is to at least keep string iteration relatively fast in ASCII
game mode, for backwards compatibility.
Also fixed String.Length for plugins in Unicode mode.
From upstream 052def762633796b5565fd0e79295392e5e43b52
2023-11-02 20:06:27 +01:00
Kaloyan Chehlarski 7e3de05c40 AGS: Fix triple delete of bitmap buffer 2023-10-28 16:19:35 +03:00
Kaloyan Chehlarski a9dac765fe AGS: Fix uninitialized variable compiler warning 2023-10-28 16:19:34 +03:00
Walter Agazzi cb2cb19256 AGS: Add ags_controller_arcnor plugin (used in Perfect Tides)
+ minor rework standard AGSController plugin
2023-10-16 17:34:44 +02:00
Walter Agazzi b1279dcbd1 AGS: Fix possible index out of bounds in PalRender plugin
From upstream 3e25fc6a550b471f472af80ac87966f8998d7fc7
Originally reported by mjunix@8b8a597
2023-08-25 16:47:21 +02:00
Walter Agazzi b70519b3c7 AGS: Preliminary implementation of ags_consoles plugin 2023-08-06 14:30:40 +02:00
Walter Agazzi 2b2fa06142 AGS: Inline some library functions + minor changes
This is the only relevant part of upstream commit
a46b97fc3bf7fdff82b84a863a3c0cacc37e7a2b
"Engine: explicitly search for plugins in a game's data dir too"

(ScummVM does not support external plugins)
2023-06-19 22:01:30 +03:00
Walter Agazzi d2336f3b70 AGS: Removed Dustbowl steam username workaround
Return a proper string in ags_steam plugin stub, avoiding script
workaround
2023-06-17 10:14:46 +02:00
Thierry Crozat a448f99a0f AGS: Implement ags_app_open_url plugin 2023-06-16 22:47:25 +01:00
Walter Agazzi fc4bb91340 AGS: Preliminary implementation of ags_sprite_video plugin
Add stubs for the ags_spritevideo plugin, which is a
replacement for the old D3D plugin.
2023-06-03 22:53:26 +02:00
Thierry Crozat 28a4c3d8da AGS: Remove mention of the DLL in plugin loading message
When starting a game that uses plugins, a message is printed
indicating 'Plugin X loaded from Y.dll, resolving imports...'.
However in ScummVM we do not use the DLLs, and provide replacements
for the plugins. So the message could be confusing for users.
2023-06-02 22:50:30 +01:00
Walter Agazzi f0eabd1952 AGS: Add workarounds in AGSController plugin for UIHY
* Use PluginSimulateMouseClick instead of eventmanager, this is needed
for the menus to work properly;
* Disable gamepad support - The current implementation does not work and
crashes in the options menu (controller support is problematic even in the
original game). Creating a map for ScummVM's keymapper specifically
for this game would probably be a better solution
2023-05-25 14:46:53 +02:00
Walter Agazzi d792d5e32f AGS: Implement Click method in agsjoy plugin
This is needed to use the keyboard in Until I Have You (Demo) menus
2023-05-25 11:11:07 +02:00
Walter Agazzi 7c4ba04d72 AGS: Fix typo in ags_controller plugin 2023-05-25 01:51:14 +02:00
Walter Agazzi 42b92554bd AGS: Improve GetCurrentGameLanguage Steam stub
Enables achievements in Heroine's Quest, fixing  TRAC 13591
2023-05-15 23:21:15 +02:00
Walter Agazzi d33d3e2536 AGS: Partial implementation of AGS_Collision_Detector plugin
This old plugin was used in Bear Story and a handful of other games
2023-05-14 23:05:39 +02:00
Eugene Sandulenko 20475e8b56 AGS: Comment out unused variables 2023-04-29 20:28:20 +02:00
Walter Agazzi 751c79e6ff AGS: Add stubs for AGSTrans plugin
This plugin was used in Death Wore Endless Feathers
to draw semi transparent window backgrounds.
2023-04-29 13:42:23 +02:00
Walter Agazzi 7ca114ea49 AGS: Engine: made FadeIn and FadeOut functions look consistent
From upstream 95c4362271734c5cb724b314d7cc555f752e06a8
2023-04-29 13:11:41 +02:00
Walter Agazzi 53a472650d AGS: Common: moved iagsstream to util dir (api dir proved to be excessive)
From upstream 2de0701f47cb189b51aa429cd8ef4812b6dae9ef
2023-04-29 13:11:41 +02:00
Walter Agazzi 72888a7a8c AGS: Engine: move cursor and cursor-over-gui updates to the game update fn
This is necessary for the touch-to-mouse emulation to work
properly (and perhaps true touch controls in the future).
The order of updates is a bit wrong historically, where cursor
position and gui control focus is updated later than the
handling of button events. This means, for example, that if the
cursor was positioned over button in game frame 1, then the
mouse click will only trigger button press not later than the frame 2.

Changes:
* moved "cursor over gui" poll from draw_gui_and_overlays()
to update_cursor_over_gui(), call it in the main game update fn.
* moved update_mouse_cursor() call from
construct_game_screen_overlay() to the game update fn
(renamed to update_cursor_view().
* picked out "cursor over location" trigger out of the "render"
function into update_cursor_over_location(), call it explicitly in
the main game update fn.

Effect on user script callbacks:
* the cursor position (and gui focus) will now be updated prior
to `late_repeatedly_execute_always()` callback. Other callbacks
will not be affected, as their relative order won't change
compared with these updates.

From upstream 23493a681d4f66ae0b1088cddb82241b0bc80dbb
2023-04-29 13:11:41 +02:00
Walter Agazzi 4258a430b4 AGS: Engine: add plugin stub for agsappopenurl
Reimplemented from upstream f7cf17e279ad44e94fadf21b7922b35dd9134fa2
2023-04-29 13:11:41 +02:00
Walter Agazzi 40b40d6d8f AGS: Fix a couple casts in AGSWaves plugin
This fixes a segfault in the second part of Strangeland and the
forcefield near the end
2023-04-25 21:17:37 +02:00
Walter Agazzi ca27d4bf5a AGS: Properly address bitmaps in AGSWaves plugin
This fixes the weather (rain) and particle effects in Strangeland.
2023-04-25 00:59:29 +02:00
Walter Agazzi ea5a479fc8 AGS: Skip SFX_SetPosition in AGSWaves plugin
Positional sound is not yet implemented
2023-04-25 00:59:29 +02:00
Walter Agazzi 07bbbcd233 AGS: Engine: replaced couple more shared_ptr<char> with vector<char>
From upstream 1cccdfea5c1009123de7ba25be72b2757f74d06f
2023-03-12 20:58:28 +00:00
Walter Agazzi 50d8eaddcf AGS: Engine: in IAGSEngine::SetVirtualScreen set Stage buffer, not whole VS
When plugin calls SetVirtualScreen (for software renderer), don't
replace whole virtual screen, instead replace only the current
render stage buffer.
This is complementary to the older changes in software renderer,
made during development of AGS 3.5.0, which featured advanced
room viewports and cameras. Since that change, separate render
stages could draw on sub-bitmaps of smaller size.

While IAGSEngine::GetVirtualScreen() was adjusted to follow that
change, and return not the whole virtual screen, but only a "stage
buffer" (which may be a VS sub-bitmap, or an intermediate bitmap
created specifically for this render stage), SetVirtualScreen() was
NOT adjusted accordingly and kept replacing whole VS. As a
result, this discrepancy could cause logical errors, as well as
crashes with plugins that use this API (e.g. original SnowRain
plugin).

The immediate reason of error is that plugin would remember a
pointer returned from GetVirtualScreen (which is a stage buffer),
and then try to set it back with SetVirtualScreen. As a result,
engine's own stage buffer is assigned as a full virtual screen.

From upstream 09143ea7fbf8474f78932116ae1c81ceff4de95a
2023-03-12 20:58:28 +00:00
Walter Agazzi da88b81fdf AGS: SnowRain: do not override user-set baselines
Reimplemented from upstream a01f58a826e56746b3fc5e503bebb3f3dcbcf884
2023-03-12 20:58:28 +00:00
Walter Agazzi 88a1083e0d AGS: Move strlen out of loops
From upstream b476dfca4b40bc2ca59b7f0fd793543524397ccf
2023-03-12 20:58:28 +00:00
Walter Agazzi 491f59d3fe AGS: Plugin: fix pal_render logic mistakes
From upstream 91ecc267e8ab607e0948416c82433da6f7802dde
2023-03-12 20:58:28 +00:00
Walter Agazzi af16689b2b AGS: Plugin: SnowRain adjust height/baseline before entering room
From upstream 1e3a66df0e3bc0f7bbb743a5fec4b2966ea9df66
2023-03-12 20:58:28 +00:00
Walter Agazzi 48592b9eee AGS: Engine: add screen functions to plugin exports
Reimplemented from upstream 5497c87cc1443d155bd89a76dddf91934b7e0bb5
2023-03-12 20:58:28 +00:00
Walter Agazzi ecc1d17655 AGS: Engine: register missing SetProperty script functions for plugins
Reimplemented from upstream 96d52b258dd226bc8c2243c1a5bc95a9ceeecd2a
2023-03-12 20:58:28 +00:00
Walter Agazzi c366ce5eef AGS: Removed update_polled_stuff_if_runtime() from data loading functions
Leave it with a new name as `update_polled_stuff()` only in functions
related to the game update.
From upstream 95dc139f51e704da19792e5480e69bbfe7ec27aa
2023-03-12 20:58:28 +00:00
Thierry Crozat aa6c07f03e AGS: Plugin API: few adjustments to recently added methods
From upstream ddf9aee9c360a60edcc2f3107fbac41f8efbe93c
2022-12-15 22:40:17 +01:00
Thierry Crozat c8eae1fa27 AGS: SpriteFont: corrected Clifftop's VariableWidth font height values
Got their meaning wrong on the first time.

From upstream d94f20742284ea75abbde86905159c490a7b4d46
2022-12-15 22:40:17 +01:00
Thierry Crozat d9a52bac54 AGS: SpriteFont: compatibility fix for engine interface < 26
From upstream 29741334fc18c9cf5f55e5032087f72031a25954
2022-12-15 22:40:17 +01:00
Eugene Sandulenko 8f8d522913 COMMON: Move achievements.* to engines/ 2022-12-02 00:12:22 +01:00
Le Philousophe 7f90669bdd AGS: Don't use unsafe strcat and strcpy 2022-10-23 22:46:19 +02:00
Thierry Crozat f380f418de AGS: implement IAGSFontRenderer2 and use NotifyFontUpdated for AGSSpriteFont
From upstream 63304da8ad002549930c3b894b56f4babec25902
2022-10-10 23:42:34 +01:00
Thierry Crozat 98f4b82f36 AGS: added IAGSFontRenderer2 and NotifyFontUpdated
From upstream e42b1371a8258ddd47c79af04a6f78fab2a136f4
2022-10-10 23:42:34 +01:00
Thierry Crozat 69eeb18d36 AGS: Added GetGameInfo to plugin interface
From upstream 97d02b47babb0cdd0e82e8815f3f5dbf8e7b2e1b
2022-10-10 23:42:34 +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 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 23f15cfb2d AGS: Fix detection for The Excavation of Hob's Barrow
This game needs to use the Clifftop Games variant of the AGSSpriteFont
plugin. Also it uses an alternate name for the plugin. That name
was already supported when loading builtin plugins, but not for the
Clifftop Games variant.

This commit also adds detection for the Mac version from Steam.
2022-10-03 18:44:22 +01:00
Thierry Crozat 88c56f912d AGS: Fix access to uninitialized memory in base SpriteFont plugin
When using the base SpriteFont plugin and not the ClifftopGames variant,
the renderers pointer were not initialized in the constructor, which
could lead to them not being instantiated, and then causing a crash.
2022-10-03 18:44:22 +01:00