Skip to content

Commit

Permalink
addition
Browse files Browse the repository at this point in the history
  • Loading branch information
DimasfromLavoisier committed Nov 12, 2024
1 parent d64d174 commit 05a0f8b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/assetloading/XmlAssetsLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ XmlAssetsLoader::createAssetFromXml(
logging::ERR("ERROR: Asset definition XML node is null!");
exit(-1);
}

std::shared_ptr<Asset> result = nullptr;
if (type == "platform") {
result = std::dynamic_pointer_cast<Asset>(
Expand Down Expand Up @@ -931,7 +930,7 @@ XmlAssetsLoader::createScannerFromXml(tinyxml2::XMLElement *scannerNode) {
scanner = std::make_shared<SingleScanner>(
beamDiv_rad, emitterPosition, emitterAttitude, pulseFreqs,
pulseLength_ns, id, avgPower, beamQuality, efficiency,
receiverDiameter, visibility, wavelength, rangeErrExpr
receiverDiameter, visibility, wavelength, false, false, false, false, false, rangeErrExpr
);
// Parse max number of returns per pulse
scanner->setMaxNOR(boost::get<int>(XmlUtils::getAttribute(
Expand Down Expand Up @@ -1135,7 +1134,6 @@ XmlAssetsLoader::createScannerSettingsFromXml(
std::shared_ptr<ScannerSettings> template1 = \
std::make_shared<ScannerSettings>(defaultScannerTemplate.get());
std::string const DEFAULT_TEMPLATE_ID = template1->id;

// Load specified template
if(XmlUtils::hasAttribute(node, "template")){
std::string templateId = node->Attribute("template");
Expand All @@ -1144,6 +1142,7 @@ XmlAssetsLoader::createScannerSettingsFromXml(
// If scanner template has not been loaded yet, load it
bla = std::dynamic_pointer_cast<ScannerSettings>(
getAssetByLocation("scannerSettings", node->Attribute("template")));

bla->id = templateId;
scannerTemplates.emplace(templateId, bla);
std::unordered_set<std::string> templateFields;
Expand All @@ -1155,9 +1154,7 @@ XmlAssetsLoader::createScannerSettingsFromXml(
else { // If scanner template has been loaded, then use already loaded
bla = scannerTemplates[templateId];
}
if (bla != nullptr) {
template1 = std::make_shared<ScannerSettings>(*bla);
}
if (bla != nullptr) template1 = std::make_shared<ScannerSettings>(*bla);
else {
std::stringstream ss;
ss << "XML Assets Loader: "
Expand Down Expand Up @@ -1661,7 +1658,6 @@ std::shared_ptr<Asset> XmlAssetsLoader::getAssetById(
if(isProceduralAsset(type, id)){ // Generate procedural assets
return createProceduralAssetFromXml(type, id, extraOutput);
}

while (assetNodes != nullptr) { // Load standard assets
std::string str(assetNodes->Attribute("id"));
if (str.compare(id) == 0) {
Expand Down Expand Up @@ -1711,7 +1707,6 @@ XmlAssetsLoader::getAssetByLocation(
id = vec[1].erase(vec[1].find_last_not_of('#') + 1);
freeLoader = true;
}

std::shared_ptr<Asset> asset = loader->getAssetById(type, id, extraOutput);
if (freeLoader)
delete loader;
Expand Down

0 comments on commit 05a0f8b

Please sign in to comment.