diff --git a/apps/Launcher/syncwidget.cpp b/apps/Launcher/syncwidget.cpp index 37c9fff281..ae188d2356 100644 --- a/apps/Launcher/syncwidget.cpp +++ b/apps/Launcher/syncwidget.cpp @@ -134,8 +134,8 @@ SyncWidget::SyncWidget(QWidget* parent, Qt::WindowFlags f) setLayout(layout); ghoul::initialize(); - _downloadManager = std::make_unique( - "http://data.openspaceproject.com/request", DownloadApplicationVersion); + // _downloadManager = std::make_unique( + // "http://data.openspaceproject.com/request", DownloadApplicationVersion); libtorrent::error_code ec; _session->listen_on(std::make_pair(20280, 20290), ec); diff --git a/data/placeholder.png b/data/placeholder.png new file mode 100644 index 0000000000..4fde9d13c3 Binary files /dev/null and b/data/placeholder.png differ diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 8f9c07736a..3f5522d28b 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -220,7 +220,7 @@ void RenderableModel::update(const UpdateData&) { _programObject->rebuildFromFile(); } - _sunPos = OsEng.renderEngine().scene()->sceneGraphNode("Sun")->worldPosition(); + _sunPos = OsEng.renderEngine().scene()->sceneGraphNode("SolarSystemBarycenter")->worldPosition(); } void RenderableModel::loadTexture() { diff --git a/modules/spacecraftinstruments/util/hongkangparser.cpp b/modules/spacecraftinstruments/util/hongkangparser.cpp index 5df2265aa5..e6f2060e21 100644 --- a/modules/spacecraftinstruments/util/hongkangparser.cpp +++ b/modules/spacecraftinstruments/util/hongkangparser.cpp @@ -46,7 +46,7 @@ HongKangParser::HongKangParser(std::string name, std::string fileName, ghoul::Dictionary translationDictionary, std::vector potentialTargets) : _defaultCaptureImage( - absPath("${OPENSPACE_DATA}/scene/common/textures/placeholder.png") + absPath("${OPENSPACE_DATA}/placeholder.png") ) , _name(std::move(name)) , _fileName(std::move(fileName)) diff --git a/modules/spacecraftinstruments/util/projectioncomponent.cpp b/modules/spacecraftinstruments/util/projectioncomponent.cpp index 13a058b64a..206968dd0f 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.cpp +++ b/modules/spacecraftinstruments/util/projectioncomponent.cpp @@ -68,7 +68,7 @@ namespace { constexpr const char* sequenceTypeInstrumentTimes = "instrument-times"; const char* placeholderFile = - "${OPENSPACE_DATA}/scene/common/textures/placeholder.png"; + "${OPENSPACE_DATA}/placeholder.png"; constexpr const char* _loggerCat = "ProjectionComponent"; diff --git a/modules/sync/syncs/torrentsynchronization.cpp b/modules/sync/syncs/torrentsynchronization.cpp index ebc3db3d05..70c67cef57 100644 --- a/modules/sync/syncs/torrentsynchronization.cpp +++ b/modules/sync/syncs/torrentsynchronization.cpp @@ -48,14 +48,20 @@ namespace openspace { TorrentSynchronization::TorrentSynchronization(const ghoul::Dictionary& dict, const std::string& synchronizationRoot, TorrentClient* torrentClient) - : openspace::ResourceSynchronization(dict) + : ResourceSynchronization(dict) , _synchronizationRoot(synchronizationRoot) , _torrentClient(torrentClient) { + documentation::testSpecificationAndThrow( + ResourceSynchronization::Documentation(), + dict, + "ResourceSynchronization::TorrentSynchronization" + ); + documentation::testSpecificationAndThrow( Documentation(), dict, - "TorrentSynchroniztion" + "TorrentSynchronization::TorrentSynchronization" ); _identifier = dict.value(KeyIdentifier); diff --git a/src/mission/missionmanager.cpp b/src/mission/missionmanager.cpp index f35bbb7e37..17051aa68a 100644 --- a/src/mission/missionmanager.cpp +++ b/src/mission/missionmanager.cpp @@ -60,7 +60,7 @@ bool MissionManager::hasCurrentMission() const { void MissionManager::loadMission(const std::string& filename) { ghoul_assert(!filename.empty(), "filename must not be empty"); ghoul_assert(!FileSys.containsToken(filename), "filename must not contain tokens"); - ghoul_assert(FileSys.fileExists(filename), "filename must exist"); + ghoul_assert(FileSys.fileExists(filename), "filename " + filename + " must exist"); // Changing the values might invalidate the _currentMission iterator std::string currentMission = hasCurrentMission() ? _currentMission->first : ""; diff --git a/src/scene/assetloader.cpp b/src/scene/assetloader.cpp index 619f583b15..cbc6c8ba1f 100644 --- a/src/scene/assetloader.cpp +++ b/src/scene/assetloader.cpp @@ -34,6 +34,8 @@ #include #include +#include + #include "assetloader_lua.inl" namespace { @@ -56,6 +58,7 @@ namespace { const char* _loggerCat = "AssetLoader"; const char* AssetFileSuffix = "asset"; + const char* SceneFileSuffix = "scene"; enum class PathType : int { RelativeToAsset = 0, @@ -288,16 +291,50 @@ std::string AssetLoader::generateAssetPath(const std::string& baseDirectory, prefix = _assetRootDirectory + ghoul::filesystem::FileSystem::PathSeparator; } - // Support paths with and without ".asset" suffix. - std::string suffix = std::string(".") + AssetFileSuffix; - if (assetPath.size() > suffix.size() && - assetPath.substr(assetPath.size() - suffix.size()) == suffix) - { - suffix = ""; + // Construct the full path including the .asset extension + std::string assetSuffix = std::string(".") + AssetFileSuffix; + bool hasAssetSuffix = + (assetPath.size() > assetSuffix.size()) && + (assetPath.substr(assetPath.size() - assetSuffix.size()) == assetSuffix); + std::string fullAssetPath = + hasAssetSuffix ? + prefix + assetPath : + prefix + assetPath + assetSuffix; + bool fullAssetPathExists = FileSys.fileExists(FileSys.absPath(fullAssetPath)); + + // Construct the full path including the .scene extension + std::string sceneSuffix = std::string(".") + SceneFileSuffix; + bool hasSceneSuffix = + (assetPath.size() > sceneSuffix.size()) && + (assetPath.substr(assetPath.size() - sceneSuffix.size()) == sceneSuffix); + std::string fullScenePath = + hasSceneSuffix ? + prefix + assetPath : + prefix + assetPath + sceneSuffix; + bool fullScenePathExists = FileSys.fileExists(FileSys.absPath(fullScenePath)); + + if (fullAssetPathExists && fullScenePathExists) { + LWARNING( + fmt::format( + "'{}' and '{}' file found with non-specific request '{}'. Loading '{}'. " + "Explicitly add extension to suppress this warning.", + fullAssetPath, + fullScenePath, + prefix + assetPath, + fullAssetPath + ) + ); + + return ghoul::filesystem::File(FileSys.absPath(fullAssetPath)); } - return ghoul::filesystem::File(FileSys.absPath( - prefix + assetPath + suffix - )); + + if (fullScenePathExists) { + return ghoul::filesystem::File(FileSys.absPath(fullScenePath)); + } + + // We don't check whether the file exists here as the error will be more + // comprehensively logged by Lua either way + return ghoul::filesystem::File(FileSys.absPath(fullAssetPath)); } std::shared_ptr AssetLoader::getAsset(std::string name) {