Made a bunch of changes to make the resource store system more friendly to multiple stores instead of just a single active one, and set up a resource database for editor assets

This commit is contained in:
parax0
2016-08-31 02:09:13 -06:00
parent 1de2691f33
commit a7b381f301
35 changed files with 848 additions and 178 deletions

View File

@@ -564,8 +564,9 @@ CScriptTemplate* CTemplateLoader::LoadScriptTemplate(XMLDocument *pDoc, const TS
// Validate file asset
else
{
TString Path = "../resources/" + ID;
if (!FileUtil::Exists(Path))
CResourceEntry *pEntry = gpEditorStore->FindEntry(ID);
if (!pEntry)
{
Log::Error(rkTemplateName + ": Invalid file for " + Type + " asset: " + ID);
pAsset = pAsset->NextSiblingElement();

View File

@@ -718,7 +718,7 @@ void CUnsupportedParticleLoader::ParseIntFunction(IInputStream& rFile)
case kIntCNST:
{
u32 Value = rFile.ReadLong();
ASSERT(gpResourceStore->FindEntry(Value) == nullptr);
ASSERT(gpResourceStore->FindEntry(CAssetID(Value)) == nullptr);
break;
}

View File

@@ -164,10 +164,7 @@ CResource* CScriptTemplate::FindDisplayAsset(CPropertyStruct *pProperties, u32&
// File
if (it->AssetSource == SEditorAsset::eFile)
{
TString Path = "../resources/" + it->AssetLocation;
pRes = gpResourceStore->LoadResource(Path);
}
pRes = gpEditorStore->LoadResource(it->AssetLocation);
// Property
else
@@ -214,10 +211,7 @@ CCollisionMeshGroup* CScriptTemplate::FindCollision(CPropertyStruct *pProperties
// File
if (it->AssetSource == SEditorAsset::eFile)
{
TString path = "../resources/" + it->AssetLocation;
pRes = gpResourceStore->LoadResource(path);
}
pRes = gpResourceStore->LoadResource(it->AssetLocation);
// Property
else