I want to optimize loading/unloading of event data and I’m now looking at EventProject::loadSampleData function, which looks exactly what I need.

On build time I collect required event IDs for each scene (list of projectnames + event IDs).

On runtime, I keep a reference counter for each event ID. If ref count was zero before the new increment, I put the event ID into int array, which will be fed to loadSampleData function.

When scene wants to unload, I again take the event ID list, loop over them and decrement the ref counter. When the ref counter hits zero I want to unload the event data. I thought of using EventProject::getEventByProjectID to get event and his parent group, on which I would call EventGroup::freeEventData.

1) is there a better approach to unloading?
2) can I use FMOD_EVENT_INFOONLY in EventProject::getEventByProjectID to get event and then his parent group?
3) when is EventProject::unloadSampleData coming? :)
4) is it required to sort event IDs which are passed to EventProject::loadSampleData?

  • You must to post comments

Hi vesoljc,

1) Your method sounds good, I can’t think of a better approach.
2) Yes you should be able to access the parent EventGroup via the INFO_ONLY event.
3) Unfortunately EventProject::unloadSampleData is not planned for any time in the near future. It is on our (long) list of features for designer but we haven’t scheduled it.
4) You shouldn’t need to sort that list.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.