[ scummvm-Patches-2872409 ] MADE engine fixes

SourceForge.net noreply at sourceforge.net
Sun Oct 4 01:58:55 CEST 2009


Patches item #2872409, was opened at 2009-10-03 23:58
Message generated for change (Tracker Item Submitted) made by agent-q
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=2872409&group_id=37116

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: agent-q (agent-q)
Assigned to: Nobody/Anonymous (nobody)
Summary: MADE engine fixes

Initial Comment:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=2872409&group_id=37116




More information about the Scummvm-tracker mailing list