#9094 closed patch
MADE engine fixes
Reported by: | agent-q | Owned by: | bluegr |
---|---|---|---|
Priority: | normal | Component: | Engine: MADE |
Version: | Keywords: | ||
Cc: | Game: |
Description
This patch includes the following fixes: - Call free() on bitmapped surfaces before deleting them. If this isn't done, the surface leaks it's graphics data - In RedReader.cpp, large objects were allocated on the stack. Changed these so they're allocated on the heap instead (The DS doesn't have a large enough stack to cope). - Missing 'virtual' on resource destructors meant that the destuctors were not called, and the game leaked all resources. Made resource destructors virtual to fix this. - In scriptfuncs.cpp, added missing freeResource() when a sound finishes playing. Without this, sound resources never had their reference count decremented and therefore would never be freed from the resource cache. - To speed up script execution, only check shouldQuit() every 500 script cycles rather than on every one. This makes a huge difference to performance on the DS. - The resource cache stored up to 100 cache items before purging. Because the size of the items varies so much, the memory usage of this cache was unpredictable. I changed the cache behaviour to purge when the cache reaches a certain data size instead. kMaxResourceCacheSize in resource.h is used to set the size at which a purge should take place.
With these fixes, Return to Zork is fully playable on the DS.
It would be great if these could be applied to both trunk and 1.0 branch.
Ticket imported from: #2872409. Ticket imported from: patches/1199.
Attachments (1)
Change History (4)
by , 15 years ago
Attachment: | made_fixes.patch added |
---|
comment:1 by , 15 years ago
Looks good, applied with a small modification (initialized _soundStarted in the ScriptFunctions constructor). Thanks :)
comment:2 by , 15 years ago
Owner: | set to |
---|---|
Status: | new → closed |
comment:3 by , 6 years ago
Component: | → Engine: MADE |
---|
MADE engine fixes