MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / doPost

Method doPost

source/base/StarAssets.cpp:1111–1132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1109}
1110
1111bool Assets::doPost(AssetId const& id) const {
1112 shared_ptr<AssetData> assetData;
1113 try {
1114 assetData = m_assetsCache.get(id);
1115 if (id.type == AssetType::Audio)
1116 assetData = postProcessAudio(assetData);
1117 } catch (std::exception const& e) {
1118 Logger::error("Exception caught post-processing asset: {}, {}", id.path, outputException(e, true));
1119 } catch (...) {
1120 Logger::error("Unknown exception caught post-processing asset: {}", id.path);
1121 }
1122
1123 m_queue.remove(id);
1124 if (assetData) {
1125 assetData->needsPostProcessing = false;
1126 m_assetsCache[id] = assetData;
1127 freshen(assetData);
1128 m_assetsDone.broadcast();
1129 }
1130
1131 return true;
1132}
1133
1134shared_ptr<Assets::AssetData> Assets::loadAsset(AssetId const& id) const {
1135 if (auto asset = m_assetsCache.value(id))

Callers

nothing calls this directly

Calls 5

errorFunction · 0.85
outputExceptionFunction · 0.50
getMethod · 0.45
removeMethod · 0.45
broadcastMethod · 0.45

Tested by

no test coverage detected