OpenMW-CS: Should use one resource manager per document
With Ogre, we were locked into one global resource manager for meshes, textures and other resources. However, in OpenCS we may get into cases where with multiple documents open, the same resource name (virtual file name) could lead to different files, depending on the document using the resource. This is because each document has its own stack of data directories and BSA files.
This doesn't cause any issues at the moment because data directories and BSA's are defined prior to launch in openmw.cfg, but will start to become relevant when we start to associate the data directories/BSA's to specific content files.
The newly merged OSG branch lays the groundwork for supporting a separate resource manager per document - there is no longer a singleton. A bit more work is required to actually create and assign the different resource managers in OpenCS.
#1 Updated by Marc Zinnschlag about 2 years ago
If I am getting this correctly, that would mean the same resources could be loaded x times, if you have x documents loaded that share the same resource. Eventually we may want a way to share these, because that is a very common use case.
However I am okay with the per-document resource managers for now, because otherwise it could get very complicated. Adding a resource to a document might for example require splitting a shared resource because the new resources is different but has the same name. There are probably other edge cases.