From 05a0f8b5b6fb8da3923010df89e397f3f57fbc6f Mon Sep 17 00:00:00 2001 From: DimasfromLavoisier Date: Tue, 12 Nov 2024 13:23:49 +0100 Subject: [PATCH] addition --- src/assetloading/XmlAssetsLoader.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/assetloading/XmlAssetsLoader.cpp b/src/assetloading/XmlAssetsLoader.cpp index 9ac5bc363..3c8c506b8 100644 --- a/src/assetloading/XmlAssetsLoader.cpp +++ b/src/assetloading/XmlAssetsLoader.cpp @@ -86,7 +86,6 @@ XmlAssetsLoader::createAssetFromXml( logging::ERR("ERROR: Asset definition XML node is null!"); exit(-1); } - std::shared_ptr result = nullptr; if (type == "platform") { result = std::dynamic_pointer_cast( @@ -931,7 +930,7 @@ XmlAssetsLoader::createScannerFromXml(tinyxml2::XMLElement *scannerNode) { scanner = std::make_shared( 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(XmlUtils::getAttribute( @@ -1135,7 +1134,6 @@ XmlAssetsLoader::createScannerSettingsFromXml( std::shared_ptr template1 = \ std::make_shared(defaultScannerTemplate.get()); std::string const DEFAULT_TEMPLATE_ID = template1->id; - // Load specified template if(XmlUtils::hasAttribute(node, "template")){ std::string templateId = node->Attribute("template"); @@ -1144,6 +1142,7 @@ XmlAssetsLoader::createScannerSettingsFromXml( // If scanner template has not been loaded yet, load it bla = std::dynamic_pointer_cast( getAssetByLocation("scannerSettings", node->Attribute("template"))); + bla->id = templateId; scannerTemplates.emplace(templateId, bla); std::unordered_set templateFields; @@ -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(*bla); - } + if (bla != nullptr) template1 = std::make_shared(*bla); else { std::stringstream ss; ss << "XML Assets Loader: " @@ -1661,7 +1658,6 @@ std::shared_ptr 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) { @@ -1711,7 +1707,6 @@ XmlAssetsLoader::getAssetByLocation( id = vec[1].erase(vec[1].find_last_not_of('#') + 1); freeLoader = true; } - std::shared_ptr asset = loader->getAssetById(type, id, extraOutput); if (freeLoader) delete loader;