Commit Graph
139 Commits
Author SHA1 Message Date
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 ed8e6fb1ce AGS: added safety check for removing sprites
Part of upstream a9e0e47ecfeec205a49ceaf8dd681944eede5eca
2022-12-15 22:40:17 +01:00
Hubert Maier 159ce658ec AGS: Correct spelling mistake
accomodate -> accommodate
2022-10-27 15:56:07 +02: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 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 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
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 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 9e940e4360 AGS: Put more unused code under OBSOLETE
From upstream 0d129c9cf854fe12e277fe6b52a8dca076a51ad8
2022-06-19 20:50:24 +01:00
Thierry Crozat e90fb00412 AGS: Replaced more strcpy with snprintf, for safety
From upstream 1b6cf053ebbe85e7ba6c5828e2582d757503bc16
2022-06-19 20:50:24 +01:00
Thierry Crozat 4e3c2ec299 AGS: Invalidate iterators to MRU list in SpriteCache when the item is erased
The implementation of std::list::erase invalidates iterators to the
erased item. However our implementation in Common::List does not.
And the SpriteCache code relied on this behaviour. So instead we
have to invalidate the iterators manually.
2022-06-18 22:20:40 +01:00
Thierry Crozat 15563b5a7c AGS: Changed SpriteCache::FreeMem to comply with sound cache
From upstream 94a462d52d5533f4ebb4cef1bbddd280b4f876a2
2022-06-18 18:21:35 +01:00
Thierry Crozat ed8526f30a AGS: Updated Script API version for recent changes in wait skip values
This is to allow to distinguish implementations in case there were games
using older variants (although it's not clear if any had yet).

From upstream 11315b3487d22ce4830d60fad36ae7124aa45e55
2022-06-18 18:11:57 +01:00
Thierry Crozat ee23fde329 AGS: Fixed SpriteCache::FreeMem not using an argument
From upstream 0369250309f797eb5035fcdf75cd8ad882fa317e
2022-06-18 01:03:30 +01:00
Thierry Crozat 1414f0ba92 AGS: Slightly more detailed sprcache info on Ctrl+Alt+V
From upstream: 9f5b5d3afa86c8bf0925a358e3f581fe40f67c1c
2022-06-18 01:03:30 +01:00
Thierry Crozat fad62e8cef AGS: Refactored SpriteCache's MRU list
Using ideas from Nick Sonneveld (@sonneveld).
From upstream: 1f57208879ca278e5b3c45d05a8c29f30632a5bd
2022-06-18 01:03:30 +01:00
Thierry Crozat d6d464f898 AGS: Fixed sprite cache limit was reset on sprite file open
From upstream 4f57730e2b3d41af4fd0300e8b092d31d448f544
2022-06-16 23:16:20 +01:00
Paul Gilbert ec38c1c61c AGS: Refactor core overlay creation funcs to return ScreenOverlay*
From upstream f89b2e8e59da107fcbb7a75bf7e1aa293a45fb2b
2022-05-05 22:41:10 -07:00
Paul Gilbert b1649597d7 AGS: Replaced Math/std Min/Max with ScummVM macros
Inspired by 6dee5ee6f271c600e30879d892295ea6069e8cc9
2022-05-05 22:41:10 -07:00
Paul Gilbert bf5a649385 AGS: Managed wrapper for SpriteFileWriter
From upstream 13d7b02a146cc669e2862064467599b10c18cbf9
2022-04-29 22:20:39 -07:00
Paul Gilbert d2b03800c6 AGS: Allow to place sounds on a crossfade channels for compatibility
From upstream 86564e983572b4ffb3cd12b00c116ae91c6fcbe4
2022-04-29 22:20:39 -07:00
Paul Gilbert 4fa512da6e AGS: Fixed returning error from SpriteFile::LoadSprite/RawData()
From upstream e58569f1a1a95867cba00592b131372170c81c8b
2022-04-29 22:20:39 -07:00
Paul Gilbert 0490236774 AGS: Use old-style keycodes for internal engine commands
From upstream e2f8b0f2357d2587016425ff6629ef37601d8e0f
2022-04-29 22:20:38 -07:00
Paul Gilbert 2d21a7dfde AGS: Removed couple of unused constants
From upstream 223fdb3d4ccfc0a6d0c437ac9fbb25a6095d3d42
2022-04-25 22:18:21 -07:00
Paul Gilbert 7b13f47d04 AGS: Fixing unimplemented cases in switches
From upstream 55345ca2b19598aeac2362d726fcaf15adf698fd
2022-04-25 19:37:00 -07:00
Paul Gilbert f2399dc15c AGS: Fixing various "unused variable/arg" warnings
From upstream 4b3c27c1a2b39d6c6b089adee111c6889d19ad0e
2022-04-25 19:17:26 -07:00
Paul Gilbert 0be3602b44 AGS: In ScriptAudioClip changed index fields from char to unsigned
From upstream 012853058ecd3eb06abf51ad76f150d727dbad5e
2022-04-25 18:47:12 -07:00
Paul Gilbert 250190e997 AGS: Fixing various type-cast warnings
From upstream 82e89d3c3dccfa0aba0b18c1aa544130ac7e6902
2022-04-25 18:47:12 -07:00
Paul Gilbert 07e74fdd72 AGS: Typecast warning fixes in data serialization
From upstream efed621fda5adabac8937b8d0ca64e537fabdfeb
2022-04-25 18:47:08 -07:00
Paul Gilbert 9dd7ce9313 AGS: Store debug room names in std::vector
From upstream 83499b1afbb1a4c0717cf9b665969f4e4ca9b6b1
2022-04-23 19:36:22 -07:00
Paul Gilbert 1d38174881 AGS: Fixed new SpriteFileWriter saving of 16-bit sprites w palette
From upstream 972145a759c9a590cdf60197668191790b474000
2022-04-23 19:04:31 -07:00
Paul Gilbert 623e895971 AGS: Changed text alignment switches to use kGameVersion_360_21
From upstream 0948e6be65b46df8bd4b183f77655375d6a06e95
2022-04-22 21:01:38 -07:00
Paul Gilbert f5c7246752 AGS: Use CycleViewAnim() for character's animation
From upstream 814d489f3a67cac4956b6590618377693571add9
2022-04-22 20:15:47 -07:00
Paul Gilbert cc9bda9251 AGS: Added NumLock and CapsLock key mods
From upstream c845ac3450159fd54fec91e19dc857860fc8ac38
2022-04-21 21:35:00 -07:00
Paul Gilbert e0282d5064 AGS: Implemented key handling switch (old/new mode)
From upstream b9e23731d0d792d095c1d4e83fa1797a1afeee46
2022-04-21 20:55:38 -07:00
Paul Gilbert e736059bbe AGS: pass key modifiers as an extra arg to on_key_press
From upstream b00b82220cbabf44185e042ef33b543fe2ad3543
2022-04-21 20:23:53 -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 14209fafed AGS: Removed arbitrary character followers limit
From upstream c64850badd610b3ce90821a080e7e6b04d65193e
2022-04-13 21:55:19 -07:00
Paul Gilbert c87f807fd5 AGS: Added "GameTextEncoding" setting to the game
From upstream bda95e652a22463443c05cb5e006f3cd28df0a20
2022-04-12 22:27:58 -07:00
Paul Gilbert 4ecb2115ca AGS: Remove cursor limit
From upstream 612f5702ce7cdee0acb898705a0ae11c84651afb
2022-04-12 22:27:55 -07:00
Paul Gilbert 7fe18e925b AGS: Cleanup load room code a little
From upstream f9f49987d3109b8141648d603cafd03885bd148d
2022-04-12 22:27:55 -07:00
Paul Gilbert 1dd1946aff AGS: Attempt to clarify meaning of the Font's import size
From upstream 71adfaa57e83b36315fc36feddaa72dd46dd11c5
2022-04-12 22:27:53 -07:00
Paul Gilbert 97776f1b99 AGS: Fixed OPT_HIGHESTOPTION
From upstream 3bc36071ceb8d9ec6b6233bde22c957c7c4cf697
2022-04-12 22:27:52 -07:00
Paul Gilbert dcb1099f2b AGS: Cursor.AnimationDelay property and arg to ChangeModeView()
From upstream 7393b0a8ee8a23949b63cf8ba57eb1c4f4e381fd
2022-04-10 19:39:09 -07:00
Paul Gilbert dbcebe50d4 AGS: Added Character.IdleAnimationDelay and editor property
From upstream 73b2aaaa859f92b5a73d5ab78118653974529402
2022-04-10 19:39:09 -07:00
Paul Gilbert eaf4b00125 AGS: Fixed pre-3.6.0 games loosing object names on restoring a save
From upstream c745e75a62bee53dcdb0552a10c2b8053717b38f
2022-04-10 19:39:08 -07:00
Paul Gilbert 787d68277b AGS: Cleanup some unused code/comments
From upstream 585ab2b826ad4f319c660c1a898ec3eb009b20c5
2022-04-10 19:39:08 -07:00