Commit Graph
26 Commits
Author SHA1 Message Date
Thierry Crozat ed8e6fb1ce AGS: added safety check for removing sprites
Part of upstream a9e0e47ecfeec205a49ceaf8dd681944eede5eca
2022-12-15 22:40:17 +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
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 ee23fde329 AGS: Fixed SpriteCache::FreeMem not using an argument
From upstream 0369250309f797eb5035fcdf75cd8ad882fa317e
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 959b8a78e1 AGS: Fixed SaveSpriteFile unintentionally restoring deleted sprites
From upstream f2973226e29120d4ef193e81a1d098c6c40f5b36
2022-04-10 19:39:07 -07:00
Paul Gilbert a2cf1dd946 AGS: Properly reset SpriteCache and SpiteFile when they reinit
From upstream 938d7300f70180f55b6f2056ec5fb0d894a63735
2022-04-10 19:39:07 -07:00
Paul Gilbert 6d4a816fb4 AGS: SpriteFile supports compression type selection (RLE/LZW)
From upstream 1526a939223974a88abf4c9601f1d4e421296a65
2022-03-30 22:13:18 -07:00
Paul Gilbert 6912f58a2f AGS: SpriteFile's extended format, let store as indexed bitmaps
From upstream 34f32e3b71b2f8d0f7480aa04a2fcd38d77fb83b
2022-03-30 22:13:17 -07:00
Paul Gilbert d2bb96db47 AGS: Fixed printing error in SpriteCache::LoadSprite()
From upstream 2398b431552b182f98c9fd5ee48204e8688694a5
2022-03-29 22:09:00 -07:00
Paul Gilbert fc9473d175 AGS: Picked a sprite file writing code into SpriteFileWriter class
From upstream 62a87664fc9249bad2886b44d10affc4d60071c3
2022-03-17 21:49:23 -07:00
Paul Gilbert ea65fe3c69 AGS: Moved SpriteFile class to a separate code unit for convenience
From upstream 393ef2c24bbc835d8e7a7229d40f638a6f172304
2022-03-17 21:49:22 -07:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Alexandre Detiste 6044504762 JANITORIAL: typos
some in the variable names, some in the comments;
no change for the strings that interract with original games assets
2021-10-31 20:46:31 +01:00
Paul Gilbert 0aba516dac AGS: fixed SpriteFile may try loading a non-existing sprite
From upstream 5800e80ceaa26b8725d6bd3337de3aec5b204dc5
2021-07-31 14:34:08 -07:00
Paul Gilbert 7e322be394 AGS: Moved image (de)compression functions out from SpriteFile
From upstream a3c6e7cfded18daadab00474ff6d148904581f08
2021-07-07 22:07:09 -07:00
Paul Gilbert 41b1126aed AGS: Split SpriteCache, picking out read/write into SpriteFile class
From upstream 565eaaf90e63ad444798cd949b1e4c60dfb4a0f8
2021-07-07 22:07:09 -07:00
Paul Gilbert 313a824fb9 AGS: Fix int pointer type mismatches 2021-06-15 19:16:10 -07:00
Paul Gilbert edb1ac0f6c AGS: fixed formatting type for several size_t and soff_t values
From upstream 548573740a5c8acc48600f9b069b7d1dc94d0dc3
2021-06-13 21:09:01 -07:00
Paul Gilbert c7ce28934a AGS: fixed formatting in SpriteCache::InitFile()
From upstream 25bc13eb548a5f6e0e8201163809ba038f5b362e
2021-06-13 21:09:00 -07:00
Paul Gilbert d57474ce59 AGS: Provided more function variants accepting const String&
From upstream 44402962003db439e54d79e0c562fba1cf59e455
2021-06-13 21:08:58 -07:00
Paul Gilbert 701396361c AGS: Import of fresh codebase 2021-06-13 21:08:44 -07:00