Commit Graph
543 Commits
Author SHA1 Message Date
Walter Agazzi e7d348f9a4 AGS: Updated build version (3.6.0.35)
From upstream b956da6dc1403dae7a25d880b4adfd3990f7b59b
2023-01-17 17:27:07 +00:00
Thierry Crozat 31c1d49762 AGS: fixed skip_rle_bitmap8() made no sense whatsoever
This fixes loading pre 2.55 games.

From upstream 3df6b7185685bcd6a2d6cbdb7b5c3b62ea5dc9b0
2022-12-17 22:10:55 +01:00
Thierry Crozat da8d47e72e AGS: Updated build version (3.6.0.34)
From upstream 01f3a19eb80bed3e0803c37a9649e9560485038b
2022-12-15 22:40:17 +01: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 6c18c2d5b5 AGS: Engine: support Clifftop Games custom engine's resolution mod
From upstream 6a238e9cb4acda222898dd4b597cf20581b401f6

This replaces a slightly different fix we had in ScummVM. But this new
code works better and fixes bug #12949
2022-12-15 22:40:17 +01:00
Thierry Crozat 9a14045e0e AGS: Common: fixed linker error at BufferedStream::BufferSize
From upstream 919f14226d1391bdee7ea50ac4825414b4dd5e95
2022-12-15 22:40:17 +01:00
Thierry Crozat 5c8287dfec AGS: Common: fixed BufferedSectionStream not preventing read past end
There have been this stupid oversight all along since the introduction
of the class: while it reported Length and EOS correctly, it still
allowed to read past the end.

This can cause issues if the user code relies, for example, on Read()
or ReadByte() return value.

For upstream code, in practice this fixes MP3 streaming, where the length
of data is not always possible to precalculate. In ScummVM we used a
different code for MP3, but this may fix other cases as well.

From upstream 6f02bedc65b902ce41858b7e92970662020a11cf
2022-12-15 22:40:17 +01:00
Thierry Crozat 54e99b36e9 AGS: Engine: support pre-3.5.0 Label.TextAlignment with legacy values
Some custom engines supported Label.TextAlignment before 3.5.0 got this
added officially, except they used old alignment constants.

From upstream 46fc9bac4fa6082561a1937861b3e567ccea2cd4
2022-12-15 22:40:17 +01:00
Thierry Crozat 7d88a52275 AGS: Engine: fixed restoring a legacy savegame
From upstream 9776df3c8403f252e981f5518c48eace2e83d373
2022-12-15 22:40:17 +01:00
Thierry Crozat 2548567c5d AGS: Updated build version (3.6.0.33)
From upstream 57423a7e7e790c43c71d408fd3a28ccfc2e6a3e2
2022-12-15 22:40:17 +01:00
Thierry Crozat ed8e6fb1ce AGS: added safety check for removing sprites
Part of upstream a9e0e47ecfeec205a49ceaf8dd681944eede5eca
2022-12-15 22:40:17 +01:00
Thierry Crozat 7ac540ed28 AGS: Updated build version (3.6.0.32)
From upstream c5ca2a632371b2509d380c3887ee8d9885c37f42
2022-12-15 22:40:17 +01:00
Vladimir Serbinenko 0006cf9aea AGS: Fix a new[]/delete[] mismatch in main_game_file.cpp 2022-12-04 21:19:22 +00:00
Vladimir Serbinenko db09df7d14 AGS: Support files coming from SearchMan 2022-11-18 01:22:59 +01:00
Vladimir Serbinenko 9caa5324bc AGS: Switch from getFSNode to getFile to hide whether file comes from an archive 2022-11-18 01:22:59 +01:00
Le Philousophe 1f2c78adfe ALL: Make sure str.h is included when using String
Fix all cases working because str.h is included in util.h
2022-10-30 18:37:16 +01:00
Hubert Maier 159ce658ec AGS: Correct spelling mistake
accomodate -> accommodate
2022-10-27 15:56:07 +02:00
Hubert Maier 0820688495 AGS: Correct spelling mistake
accomodate -> accommodate
2022-10-27 15:56:07 +02:00
Hubert Maier ed023bf09a AGS: Correct spelling mistake
accomodate -> accommodate
2022-10-27 15:56:07 +02:00
Hubert Maier 169a1e00a3 AGS: Correct spelling mistake
refered -> referred
2022-10-27 15:56:07 +02:00
Hubert Maier 491d8b0c6e AGS: Correct spelling mistake
accomodate -> accommodate
2022-10-27 15:56:07 +02:00
Hubert Maier 86a8279c59 AGS: Correct spelling mistake
loose -> lose
2022-10-27 15:56:07 +02:00
Le Philousophe ab0854d81a AGS: Don't use unsafe sprintf and vsprintf 2022-10-23 22:46:19 +02:00
Thierry Crozat 19514bc2ad AGS: Common: properly restore font metrics when setting an old font renderer
From upstream f07e8e20ddf715511012aa20861b9e8cecf7aa4f
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 b13b408972 AGS: renamed IAGSFontRenderer2 to IAGSFontRendererInternal
From upstream 6fc7c295728bf4d6815596f12a8587c80dbe4a5e
2022-10-10 00:16:16 +01:00
Thierry Crozat a06124e572 AGS: Updated build version (3.6.0.31)
From upstream ecaf7c59bb5cf7901d1429f2145954c665c85629
2022-10-10 00:16:16 +01:00
Thierry Crozat 0927821afd AGS: small refactor of key code variables (stricter names, types)
From upstream e04c8ff1fe77e4462babd21d2a103a12e68b4b84
2022-10-10 00:16:16 +01:00
Thierry Crozat 250e32f9a1 AGS: adjusted InputType and KeyMod for easier packing in int32
This allows to fully pack InputType, KeyMod and KeyCode/MouseButton/etc in a int32:

- 8 bits (0xFF) - input type
- 8 bits (0xFF) - key mod flags
- 4 bits (0xF) - reserved (potentially for expanding mod flags, if that will be necessary)
- 12 bits (0xFFF) - KeyCode, mouse codes, gamepad buttons, etc.

Purpose:
1. Potentially allow to set keycodes + mods in an integer and assign to an integer variable/property, such as "skip key", instead of using existing "combo keys"
2. In fact, with InputType flags, this makes it possible to assign a mouse or gamepad button to the same variables.
3. Potentially allow to return keycode + mods from Wait* (currently returns only single key).

From upstream 0203e8feb73b96c501ac2439aa3fe3d6c182c8f4
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 06620b6e9f AGS: renamed Button's MouseButton enum to avoid name confusion
Was conflicting with the internal engine's eAGSMouseButton constants.

From upstream a5cfccee2d3681b55dafb8cfb9e0f38f84124855
2022-10-10 00:16:16 +01:00
Thierry Crozat 3e194453fa AGS: Updated build version (3.6.0.30)
From upstream 836a6bd1fb4f642272ed99eccae68eab33fa1ab8
2022-10-09 19:40:04 +01:00
Thierry Crozat 56f9bfba9e AGS: fixed GUISlider::IsOverControl() comparing abs with rel coords
Was broken likely by dec832ad4 (upstream 9394a2d)

From upstream 77c10eb3757029d8d185d9b161890d05203d90af
2022-10-09 19:36:47 +01:00
Thierry Crozat dd9595c8ce AGS: don't zero slider's HandleImage internally if sprite is missing
This may lead to unexpected effects when resources are not fully preloaded yet, but a Slider's "UpdateMetrics" was called.

From upstream 5654fb52a64904a6b0cdcec674224f7a0d91a8eb
2022-10-09 19:29:11 +01:00
Thierry Crozat eb252cf824 AGS: fixed case when imported sprite got flags from placeholder
This could make a new sprite look differently, depending on placeholder's (sprite 0) settings, until the game is saved once.

From upstream f2a922a9cefd40337502bde734503605a76550db
2022-10-09 19:23:13 +01:00
Thierry Crozat 9ced7b370c AGS: fixed GUIListBox drawing double border outside of the clip
From upstream 0cece949e68d4fe55c6943654643abdc3bbb40d4
2022-10-09 19:16:26 +01:00
Thierry Crozat fa87b3f28f AGS: force update gui metrics on load and on game start
This fixes some controls not reporting their metrics correctly until first displayed on screen.

From upstream ea4e6762236a13621ba0771b9d5d8ac4bcf33ee8
2022-10-09 19:12:22 +01:00
Thierry Crozat 5fd47e4055 AGS: define verbose sprite cache log through a macro function
From upstream a3e762c55b9424ebfc3f311b57ac30a8bcedf945
2022-10-09 18:34:44 +01:00
Thierry Crozat 7f6d7f41d4 AGS: use #if instead of #ifdef for log macros
Sprite Cache and Managed Objects produce a lot of entries in the log currently.
They use a macro to set if they should be on or not, but this macro may be set =0, with the intent of disabling.
Let's instead use #if when testing these macros.

Additionally

- only define DEBUG_MANAGED_OBJECTS if AGS_DEBUG_MANAGED_OBJECTS is true
- adds a new command line flag AGS_DEBUG_SPRITECACHE, which will only define DEBUG_SPRITECACHE if true
- guard indefinition through core/platform.h

From upstream e8bd58da2e09d844068dc087f1da153a693b7aa8
2022-10-09 18:11:02 +01:00
Thierry Crozat 151d391188 AGS: Updated build version (3.6.0.29)
From upstream 13ccc39f2027c9fcf07308440981221629b67b75
2022-10-09 18:01:55 +01:00
Donovan Watteau a82501b638 AGS: Fix ReadEncInt32() on big-endian systems
Fixes kq1agdi crashing on big-endian systems, since it tried to allocate
a gigantic amount of memory from MFLUtil::ReadV21() because of the
misread values.

From upstream 5e29a339fc83bf5c06a3a9a3b1c65a2fc4b4e72c
Also includes upstream 427752da015fd93549deef1a31d5e533e5c9319e
2022-10-03 18:42:58 +01:00
Le Philousophe 748461c57d JANITORIAL: Remove useless headers
System headers are not allowed in engines code and are not used
2022-08-22 12:17:58 +02:00
Thierry Crozat c6c502ffe1 AGS: Partially revert "Make IAGSFontRenderer destructor virtual"
After discussing with upstream ags developers, it was indicated that
making the destructor virtual changes the vtable and could cause
issues with plugins used by old games. This is unlikely to be an
issue with ScummVM since we do not use the original plugin DLL, but
to be consistent with upstream code I am reverting the change here.

And furthermore there was no need to make the IAGSFontRenderer
destructor virtual, as long as we do make the destructor of the base
renderers in the AGSSpriteFont plugin virtual (so that the Clifftop
Games versions of the renderers are properly destroyed).
2022-07-22 11:24:05 +01:00
Thierry Crozat c5636ddb32 AGS: Fix resolution for Whispers of a Machine
The engine for that game was modified to hardcode a resolution of
640x360.

This fixes bug #12518.
2022-07-22 11:24:05 +01:00
Thierry Crozat 26d135d298 AGS: Make IAGSFontRenderer destructor virtual
This fixes issues with the font renderers deletion in the ags_sprite_font
plugin since we do deletion using pointers that may not be of the final
class.
2022-06-25 23:33:30 +01:00
Thierry Crozat e9c84767f7 AGS: Merged BitmapFlip with engine's GlobalFlipType (same values)
From upstream a747deafe67d536b6bcaf408077ca83f6e61a33d
2022-06-24 20:54:47 +01:00
Thierry Crozat 7372aa4040 AGS: Updated build version (3.6.0.28)
From upstream ad7c27a8bbf8a9e827ebd052472887cf4f47a299
2022-06-23 23:57:27 +01:00
Thierry Crozat 0c936b888d AGS: Fixed GUI textual controls not redrawn when translation changes
From upstream 618d2e38a118f47389aaf7e57972b2520b81fc1b
2022-06-21 23:28:01 +01:00
Thierry Crozat fe80834639 AGS: Store DialogTopics in std::vector
From upstream 2609c0d1ee43a4f997021ce48ca2a4f70ca1a6c7
2022-06-20 23:52:25 +01:00
Thierry Crozat 9e940e4360 AGS: Put more unused code under OBSOLETE
From upstream 0d129c9cf854fe12e277fe6b52a8dca076a51ad8
2022-06-19 20:50:24 +01:00