Ticket #504 (closed enhancement: completed)

Opened 4 years ago

Last modified 3 years ago

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:1 Changed 4 years ago by prock

  • Description modified (diff)

comment:2 Changed 4 years ago by prock

  • Blocking 510 added

comment:3 Changed 4 years ago by prock

  • Blocking 491 added

comment:4 Changed 4 years ago by prock

  • Blocking 509 added

comment:5 Changed 4 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....

comment:6 Changed 4 years ago by prock

(In [3569]) Major work on ticket 504. This branch now mostly compiles (not including the python interfaces). Stripped out the remaining references to Pool. refs #504

comment:7 Changed 4 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 4 years ago by prock

AudioClipManager? is complete. Major cleanup happening now. Loaders are mostly fixed. Savers have yet to be updated.

comment:9 Changed 4 years ago by prock

(In [3641]) * Updated the light renderer infos to use ImagePtr? and AnimationPtr?. refs #504

comment:10 Changed 4 years ago by prock

(In [3642]) * Savers work now. Need to be tested more. Next up are the editor plugins. refs #504

comment:11 Changed 4 years ago by prock

Quick note so I dont forget... ObjectVisual::addStaticImage() should take an ImagePtr?

comment:12 Changed 4 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 4 years ago by prock

Need to be able to hide the cursor as well.

comment:14 Changed 4 years ago by prock

  • Blocking 509 removed

comment:15 Changed 4 years ago by prock

(In [3645]) * Added the 0.3.3 release to the CHANGES document.

Really I'm just testing the pre-commit hook for codesion. refs #504

comment:16 Changed 4 years ago by prock

(In [3647]) * Fixed the remaining editor plugins. Editor should be fully functional again (as functional as trunk is). refs #504

comment:17 Changed 4 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 4 years ago by helios2000

(In [3651]) * Updated the Generic and OffRenderer? infos to use ImagePtr?. refs #504

comment:19 Changed 4 years ago by prock

(In [3652]) * Made the creation of animations a lot cleaner. Extended the Animation class with swig. refs #504

comment:20 Changed 4 years ago by prock

(In [3653]) * Object Editor plugin now saves objects again refs #504

comment:21 Changed 4 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 4 years ago by prock

(In [3655]) * Initialize the Image x_shift and y_shift to 0 in the constructors. refs #504

comment:23 Changed 4 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 4 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 4 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 4 years ago by vtchill

(In [3674]) Fixed a small bug in the editor where the object selector plugin was still trying to use the old method to get the image resource instead of using the new image manager. refs #504

comment:27 Changed 4 years ago by kozmo

(In [3675]) * Changed Animation methods to return ImagePtr? instead of its ID refs #504

comment:28 Changed 4 years ago by kozmo

(In [3680]) * During adding frames the image is ensured to be loaded

  • Modified Image::copySubimage to work correctly with shared images
  • Removed dead code
  • Moved set*Shift methods so they can be inlined refs #504

comment:29 Changed 4 years ago by kozmo

(In [3685]) * Changed the interfaces and underlying architecture of Image and Renderbackend classses refs #504

comment:30 Changed 4 years ago by prock

(In [3686]) * Small changes to fix compilation on arch linux refs #504

comment:31 Changed 3 years ago by vtchill

(In [3694]) These fixes go along with kozmo's changes in revision 3675 where changes were made to the animation class to return the image resource directly instead of just the resource handle. This should fix exceptions when using either the object editor or object selector plugins. refs #504

comment:32 Changed 3 years 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 3 years 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.

Note: See TracTickets for help on using tickets.