The general resource manager unloads definitions (which include sounds, textures and various per-type defined datas) which are no longer in use between level loads. This keeps the memory usage nice and tight. Objects that are not defined or scripted into a level never get loaded at all.
The texture manager keeps track of textures via reference counting and unloads textures that are no longer in use. No one texture is loaded twice, and the same goes for sounds. Sprite and level definitions have an automated system for releasing their handles to textures and sounds when deleted, which then get cleaned up by the related manager.
The audio manager keeps track of sound resources via reference counting as well, and in addition it can optionally continue a playing sound until completion and then unload the sound if it is no longer in use at end of play.

No comments:
Post a Comment