Ticket #504 (closed enhancement: completed)
Improve FIFE resource handling
| Reported by: | prock | Owned by: | FIFE |
|---|---|---|---|
| Priority: | highest | Milestone: | 0.3.3 |
| Component: | engine/core/util | Version: | trunk |
| Severity: | major | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | #491, #510 | Time planned: | |
| Time remaining: | Time spent: |
Description (last modified by prock) (diff)
This is the major ticket in this milestone and it is focused on the way FIFE handles resources. Currently the resource section of FIFE is lacking some functionality. It is also not used throughout the entire engine.
- Time to live for resources - Interface for clients to free unused resources - Reference counting needs to be strictly used - Ability to add generated resources to the pool
Interesting WIKI article on Memory Management
Change History
comment:5 Changed 2 years ago by prock
(In [3568]) Starting on the resource management ticket . Lots of changes ahead. This branch will No LONGER COMPILE for a long long while.
Started tearing out the old Pool interfaces. Not complete yet. Details follow....
- SoundClip? is now derived from IResource
- Removed SoundClipPool?
- Action, Object, Map and Layer now derive from FifeClass?
- Cleaned up the fifelcass.h header a bit
- Removed ResourceClass?
- Removed Pool
- Removed ResourceLocation?
- Added a skeleton of ResourceManager?
- Animation now derives from IResource
- Renamed AbstractImage? to IImage
- Image is now derived from IImage and IResource
- Removed ImagePool?
- Removed TextureRenderPool? refs #504
comment:7 Changed 2 years ago by prock
Continuing work on this ticket. Latest commit is r3626. ImageManager? is in place. Animations are all working. Next up is the AudioClipManager?.
comment:8 Changed 2 years ago by prock
AudioClipManager? is complete. Major cleanup happening now. Loaders are mostly fixed. Savers have yet to be updated.
comment:9 Changed 2 years ago by prock
(In [3641]) * Updated the light renderer infos to use ImagePtr? and AnimationPtr?. refs #504
comment:10 Changed 2 years ago by prock
comment:11 Changed 2 years ago by prock
Quick note so I dont forget... ObjectVisual::addStaticImage() should take an ImagePtr?
comment:12 Changed 2 years ago by prock
Another note... should create a shared pointer for sound emitters as well instead of passing resource handles around.
comment:13 Changed 2 years ago by prock
Need to be able to hide the cursor as well.
comment:15 Changed 2 years ago by prock
comment:16 Changed 2 years ago by prock
comment:17 Changed 2 years ago by prock
(In [3649]) * SoundClips? are now stored in emitters as a SoundClipPtr?. Added getSounClip() to FIFE::SoundEmitter?.
- Modified the SoundManager? python extension to work again with the above changes. Consequentially it seems that the shooter demo doesn't segfault after killing the boss anymore. This has to be tested more. refs #504
comment:18 Changed 2 years ago by helios2000
(In [3651]) * Updated the Generic and OffRenderer? infos to use ImagePtr?. refs #504
comment:19 Changed 2 years ago by prock
comment:20 Changed 2 years ago by prock
comment:21 Changed 2 years ago by prock
(In [3654]) * Fixed a problem where the images x and y shift values were getting reset to 0 when being loaded. This happened because the ImageManager? allows you to create images, set their x and y shifts and load them into memory later (which resets the x and y shifts). This fixes that problem and should be re-visited at some point when the Images get sorted out in the future. refs #504
comment:22 Changed 2 years ago by prock
comment:23 Changed 2 years ago by prock
(In [3657]) * FIFE::GuiImage? now takes an ImagePtr? for a constructor argument rather than the image handle. Updated the pychan to reflect this change. Interestingly enough in FIFE::GuiImageLoader? it always used 0 as the image Handle which was a bug introduced in this branch that no one noticed. It should be fixed now.
- Fixed a bug in FIFE::SdlGuiGraphics? that was introduced in this branch that caused none of the GUI images to be rendered when using the SDL renderer. refs #504
comment:24 Changed 2 years ago by prock
(In [3658]) * Added some guards to the ImageManager? and SoundClipManager? to not allow the creation of duplicate named resources.
- Removed some unneeded comments.
- Added some comments to FIFE::Image refs #504
comment:25 Changed 2 years ago by prock
(In [3669]) * Some work on the SubImageLoader?. It has yet to be tested. This could potentially be used by SDL to help mimic the OpenGL texture atlases.
- Fixed a warning when compiling the swig interface in video.i. refs #504
comment:26 Changed 2 years ago by vtchill
comment:27 Changed 2 years ago by kozmo
comment:28 Changed 2 years ago by kozmo
comment:29 Changed 2 years ago by kozmo
comment:30 Changed 2 years ago by prock
comment:31 Changed 2 years ago by vtchill
comment:32 Changed 23 months ago by prock
(In [3724]) * Updated the throws in ImageLoader? to also display the SDL error produced
- Small fix to the fife_settings module so it doesn't try to fill the settings widget with data if it hasn't been initialized yet. refs #504
comment:33 Changed 21 months ago by prock
- Status changed from new to closed
- Resolution set to completed
This ticket it complete. Additional features for the resource managers can be implemented at a later time. Closing ticket.
