|
|
@ -1220,29 +1220,31 @@ void CSMWorld::Data::assetsChanged()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mVFS->rebuildIndex();
|
|
|
|
mVFS->rebuildIndex();
|
|
|
|
|
|
|
|
|
|
|
|
ResourceTable* meshTable = static_cast<ResourceTable*>(getTableModel(UniversalId::Type_Meshes));
|
|
|
|
const UniversalId assetTableIds[] = {
|
|
|
|
ResourceTable* iconTable = static_cast<ResourceTable*>(getTableModel(UniversalId::Type_Icons));
|
|
|
|
UniversalId::Type_Meshes,
|
|
|
|
ResourceTable* musicTable = static_cast<ResourceTable*>(getTableModel(UniversalId::Type_Musics));
|
|
|
|
UniversalId::Type_Icons,
|
|
|
|
ResourceTable* soundResTable = static_cast<ResourceTable*>(getTableModel(UniversalId::Type_SoundsRes));
|
|
|
|
UniversalId::Type_Musics,
|
|
|
|
ResourceTable* texTable = static_cast<ResourceTable*>(getTableModel(UniversalId::Type_Textures));
|
|
|
|
UniversalId::Type_SoundsRes,
|
|
|
|
ResourceTable* vidTable = static_cast<ResourceTable*>(getTableModel(UniversalId::Type_Videos));
|
|
|
|
UniversalId::Type_Textures,
|
|
|
|
|
|
|
|
UniversalId::Type_Videos
|
|
|
|
meshTable->beginReset();
|
|
|
|
};
|
|
|
|
iconTable->beginReset();
|
|
|
|
|
|
|
|
musicTable->beginReset();
|
|
|
|
size_t numAssetTables = sizeof(assetTableIds) / sizeof(UniversalId);
|
|
|
|
soundResTable->beginReset();
|
|
|
|
|
|
|
|
texTable->beginReset();
|
|
|
|
for (size_t i = 0; i < numAssetTables; ++i)
|
|
|
|
vidTable->beginReset();
|
|
|
|
{
|
|
|
|
|
|
|
|
ResourceTable* table = static_cast<ResourceTable*>(getTableModel(assetTableIds[i]));
|
|
|
|
|
|
|
|
table->beginReset();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Trigger recreation
|
|
|
|
// Trigger recreation
|
|
|
|
mResourcesManager.recreateResources();
|
|
|
|
mResourcesManager.recreateResources();
|
|
|
|
|
|
|
|
|
|
|
|
meshTable->endReset();
|
|
|
|
for (size_t i = 0; i < numAssetTables; ++i)
|
|
|
|
iconTable->endReset();
|
|
|
|
{
|
|
|
|
musicTable->endReset();
|
|
|
|
ResourceTable* table = static_cast<ResourceTable*>(getTableModel(assetTableIds[i]));
|
|
|
|
soundResTable->endReset();
|
|
|
|
table->endReset();
|
|
|
|
texTable->endReset();
|
|
|
|
}
|
|
|
|
vidTable->endReset();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get rid of potentially old cached assets
|
|
|
|
// Get rid of potentially old cached assets
|
|
|
|
mResourceSystem->clearCache();
|
|
|
|
mResourceSystem->clearCache();
|
|
|
|