1
0
Fork 0
Commit Graph

6 Commits (f404f3154e51cd592ead7ab80c3ee69a0460eaa3)

Author SHA1 Message Date
Peter Nelson b890dab2b4
Change: Treat recolour sprites as regular sprites in the SpriteCache. (#13107)
Recolour sprites are loaded when seen, instead of being loaded when needed. This could result in the sprite cache being filled up with recolour sprites, and also mean that replacing recolour sprites didn't release the previously allocated memory.

Instead, allow recolour sprites to be loaded as needed and freed when unneeded, like regular sprites.
2024-11-23 12:14:46 +00:00
Peter Nelson 7b717fcccb Codechange: Replace AllocatorProc with SpriteAllocator class.
This allows for state to be passed to or maintained by the allocator.
2024-05-30 20:16:28 +01:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Rubidium 3a676a5af0 Codechange: replace static inline with static for non-class functions 2024-01-06 13:37:33 +01:00
Peter Nelson 1c94fb0389 Add: Mock sprite cache intialization.
This fills up the sprite cache with SPR_OPENTTD_BASE + OPENTTD_SPRITE_COUNT zero-size sprites, to
allow GetSpriteSize() calls to continue from unit-tests.
2023-11-05 19:24:59 +00:00
Peter Nelson 05436d9c2f Add: Expose minimal parts of SpriteCache internals.
These parts are needed to be able to mock the SpriteCache for unit-tests.
2023-11-05 19:24:59 +00:00