Implemented scanline and silhouette effect #363
|
@ -41,7 +41,7 @@ namespace SHADE
|
|||
std::vector<SHAssetLoader*> SHAssetManager::loaders(TYPE_COUNT);
|
||||
|
||||
std::unordered_map<AssetID, SHAsset> SHAssetManager::assetCollection;
|
||||
std::unordered_map<AssetID, SHAssetData * const> SHAssetManager::assetData;
|
||||
std::unordered_map<AssetID, SHAssetData *> SHAssetManager::assetData;
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -460,18 +460,30 @@ namespace SHADE
|
|||
else
|
||||
{
|
||||
target = GetAssetIDFromPath(path);
|
||||
// send compile asset event
|
||||
SHCompileAssetEvent compileShaderEvent
|
||||
|
||||
//Reload data
|
||||
auto result = GetAsset(target);
|
||||
if (result.has_value())
|
||||
{
|
||||
.assetName = newPath.filename().stem().string(),
|
||||
.assetID = target,
|
||||
.assetType = AssetType::SHADER,
|
||||
};
|
||||
SHEventManager::BroadcastEvent<SHCompileAssetEvent>(compileShaderEvent, SH_ASSET_COMPILE_EVENT);
|
||||
auto const& asset{ result.value() };
|
||||
auto newData = loaders[static_cast<size_t>(asset.type)]->Load(asset.path);
|
||||
delete assetData[target];
|
||||
assetData[target] = newData;
|
||||
}
|
||||
else
|
||||
{
|
||||
SHLOG_ERROR("[Asset Manager] Critical: reload of existing compiled data failed");
|
||||
}
|
||||
}
|
||||
|
||||
//TODO SEND EVENT HERE
|
||||
|
||||
// send compile asset event
|
||||
SHCompileAssetEvent compileShaderEvent
|
||||
{
|
||||
.assetName = newPath.filename().stem().string(),
|
||||
.assetID = target,
|
||||
.assetType = AssetType::SHADER,
|
||||
};
|
||||
SHEventManager::BroadcastEvent<SHCompileAssetEvent>(compileShaderEvent, SH_ASSET_COMPILE_EVENT);
|
||||
}
|
||||
|
||||
FolderPointer SHAssetManager::GetRootFolder() noexcept
|
||||
|
|
|
@ -123,7 +123,7 @@ namespace SHADE
|
|||
|
||||
// For all resources
|
||||
static std::unordered_map<AssetID, SHAsset> assetCollection;
|
||||
static std::unordered_map<AssetID, SHAssetData * const> assetData;
|
||||
static std::unordered_map<AssetID, SHAssetData *> assetData;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue