-
Notifications
You must be signed in to change notification settings - Fork 0
Cache asset handles #65
Description
With the introduction of AssetHandles as a wrapper type around AssetId (done in: #61), now we also need to cache them as creating them on the fly everytime an asset is request causes a HUGE issue:
When creating an AssetHandle from AssetId (for example during scene deserialization), currently we just always create a new handle, even if the Id of the asset was encountered before, which leads to 2 different AssetHandles with possible different lifetimes pointing to the same asset, and currently if one of them dies it marks that asset as being stale, despite the fact that there is still a surviving handle point to it. This is a major resource problem, that during #61 was present but not prevalent as there was no functional way to create an AssetHandle from AssetId in the other systems, with the new LibGraphics library this will change as it will define component serializers for SpriteComponent and TextComponent which will point to Texture/Font assets.