From 8b60ebdd632eb48bd8cd99fc46043fa835b2149d Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 30 Oct 2024 11:06:14 +1100 Subject: [PATCH] Minor tweaks. --- .../IPrepareRendererResources.h | 1 - .../include/Cesium3DTilesSelection/Tileset.h | 2 +- Cesium3DTilesSelection/src/TilesetContentManager.cpp | 12 ++++++------ Cesium3DTilesSelection/src/TilesetContentManager.h | 2 +- Cesium3DTilesSelection/src/TilesetJsonLoader.cpp | 1 - Cesium3DTilesSelection/src/TilesetJsonLoader.h | 2 +- .../src/TilesetSharedAssetSystem.cpp | 2 -- .../include/CesiumGltfReader/GltfReader.h | 2 +- CesiumGltfReader/src/GltfReader.cpp | 6 +++--- 9 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Cesium3DTilesSelection/include/Cesium3DTilesSelection/IPrepareRendererResources.h b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/IPrepareRendererResources.h index b7977fd62..d6654fee3 100644 --- a/Cesium3DTilesSelection/include/Cesium3DTilesSelection/IPrepareRendererResources.h +++ b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/IPrepareRendererResources.h @@ -20,7 +20,6 @@ struct Rectangle; } namespace CesiumGltf { -struct ImageAsset; struct Model; } // namespace CesiumGltf diff --git a/Cesium3DTilesSelection/include/Cesium3DTilesSelection/Tileset.h b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/Tileset.h index 840d331a8..8bfd9d2ac 100644 --- a/Cesium3DTilesSelection/include/Cesium3DTilesSelection/Tileset.h +++ b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/Tileset.h @@ -184,7 +184,7 @@ class CESIUM3DTILESSELECTION_API Tileset final { const RasterOverlayCollection& getOverlays() const noexcept; /** - * @brief Returns the {@link SharedAssetDepot} of this tileset. + * @brief Returns the {@link TilesetSharedAssetSystem} of this tileset. */ TilesetSharedAssetSystem& getSharedAssetSystem() noexcept; diff --git a/Cesium3DTilesSelection/src/TilesetContentManager.cpp b/Cesium3DTilesSelection/src/TilesetContentManager.cpp index 3f953f7f7..266644707 100644 --- a/Cesium3DTilesSelection/src/TilesetContentManager.cpp +++ b/Cesium3DTilesSelection/src/TilesetContentManager.cpp @@ -566,7 +566,7 @@ postProcessContentInWorkerThread( gltfOptions.applyTextureTransform = tileLoadInfo.contentOptions.applyTextureTransform; if (tileLoadInfo.pSharedAssetSystem) { - gltfOptions.pSharedAssets = tileLoadInfo.pSharedAssetSystem; + gltfOptions.pSharedAssetSystem = tileLoadInfo.pSharedAssetSystem; } auto asyncSystem = tileLoadInfo.asyncSystem; @@ -666,7 +666,7 @@ TilesetContentManager::TilesetContentManager( _tileLoadsInProgress{0}, _loadedTilesCount{0}, _tilesDataUsed{0}, - _pSharedAssets(TilesetSharedAssetSystem::getDefault()), + _pSharedAssetSystem(TilesetSharedAssetSystem::getDefault()), _destructionCompletePromise{externals.asyncSystem.createPromise()}, _destructionCompleteFuture{ this->_destructionCompletePromise.getFuture().share()}, @@ -696,7 +696,7 @@ TilesetContentManager::TilesetContentManager( _tileLoadsInProgress{0}, _loadedTilesCount{0}, _tilesDataUsed{0}, - _pSharedAssets(TilesetSharedAssetSystem::getDefault()), + _pSharedAssetSystem(TilesetSharedAssetSystem::getDefault()), _destructionCompletePromise{externals.asyncSystem.createPromise()}, _destructionCompleteFuture{ this->_destructionCompletePromise.getFuture().share()}, @@ -848,7 +848,7 @@ TilesetContentManager::TilesetContentManager( _tileLoadsInProgress{0}, _loadedTilesCount{0}, _tilesDataUsed{0}, - _pSharedAssets(TilesetSharedAssetSystem::getDefault()), + _pSharedAssetSystem(TilesetSharedAssetSystem::getDefault()), _destructionCompletePromise{externals.asyncSystem.createPromise()}, _destructionCompleteFuture{ this->_destructionCompletePromise.getFuture().share()}, @@ -994,7 +994,7 @@ void TilesetContentManager::loadTileContent( this->_externals.pAssetAccessor, this->_externals.pPrepareRendererResources, this->_externals.pLogger, - this->_pSharedAssets, + this->_pSharedAssetSystem, tilesetOptions.contentOptions, tile}; @@ -1239,7 +1239,7 @@ TilesetContentManager::getTilesetCredits() const noexcept { const CesiumUtility::IntrusivePointer& TilesetContentManager::getSharedAssetSystem() const noexcept { - return this->_pSharedAssets; + return this->_pSharedAssetSystem; } int32_t TilesetContentManager::getNumberOfTilesLoading() const noexcept { diff --git a/Cesium3DTilesSelection/src/TilesetContentManager.h b/Cesium3DTilesSelection/src/TilesetContentManager.h index e3d32b2da..0a4af3831 100644 --- a/Cesium3DTilesSelection/src/TilesetContentManager.h +++ b/Cesium3DTilesSelection/src/TilesetContentManager.h @@ -173,7 +173,7 @@ class TilesetContentManager int64_t _tilesDataUsed; // Stores assets that might be shared between tiles. - CesiumUtility::IntrusivePointer _pSharedAssets; + CesiumUtility::IntrusivePointer _pSharedAssetSystem; CesiumAsync::Promise _destructionCompletePromise; CesiumAsync::SharedFuture _destructionCompleteFuture; diff --git a/Cesium3DTilesSelection/src/TilesetJsonLoader.cpp b/Cesium3DTilesSelection/src/TilesetJsonLoader.cpp index dd6ff117e..c9d733511 100644 --- a/Cesium3DTilesSelection/src/TilesetJsonLoader.cpp +++ b/Cesium3DTilesSelection/src/TilesetJsonLoader.cpp @@ -1005,5 +1005,4 @@ void TilesetJsonLoader::addChildLoader( std::unique_ptr pLoader) { this->_children.emplace_back(std::move(pLoader)); } - } // namespace Cesium3DTilesSelection diff --git a/Cesium3DTilesSelection/src/TilesetJsonLoader.h b/Cesium3DTilesSelection/src/TilesetJsonLoader.h index 55a5e8ae4..f70ce9b7c 100644 --- a/Cesium3DTilesSelection/src/TilesetJsonLoader.h +++ b/Cesium3DTilesSelection/src/TilesetJsonLoader.h @@ -56,7 +56,7 @@ class TilesetJsonLoader : public TilesetContentLoader { private: std::string _baseUrl; CesiumGeospatial::Ellipsoid _ellipsoid; - CesiumUtility::IntrusivePointer _pSharedAssets; + CesiumUtility::IntrusivePointer _pSharedAssetSystem; /** * @brief The axis that was declared as the "up-axis" for glTF content. diff --git a/Cesium3DTilesSelection/src/TilesetSharedAssetSystem.cpp b/Cesium3DTilesSelection/src/TilesetSharedAssetSystem.cpp index 3f6c0806b..95a8d384d 100644 --- a/Cesium3DTilesSelection/src/TilesetSharedAssetSystem.cpp +++ b/Cesium3DTilesSelection/src/TilesetSharedAssetSystem.cpp @@ -1,8 +1,6 @@ #include using namespace Cesium3DTilesSelection; -using namespace CesiumAsync; -using namespace CesiumGltf; using namespace CesiumGltfReader; using namespace CesiumUtility; diff --git a/CesiumGltfReader/include/CesiumGltfReader/GltfReader.h b/CesiumGltfReader/include/CesiumGltfReader/GltfReader.h index 26f39f8b5..39137bd0a 100644 --- a/CesiumGltfReader/include/CesiumGltfReader/GltfReader.h +++ b/CesiumGltfReader/include/CesiumGltfReader/GltfReader.h @@ -114,7 +114,7 @@ struct CESIUMGLTFREADER_API GltfReaderOptions { * The shared asset system that will be used to store all of the shared assets * that might appear in this glTF. */ - CesiumUtility::IntrusivePointer pSharedAssets = + CesiumUtility::IntrusivePointer pSharedAssetSystem = nullptr; }; diff --git a/CesiumGltfReader/src/GltfReader.cpp b/CesiumGltfReader/src/GltfReader.cpp index 47f7e02de..011340119 100644 --- a/CesiumGltfReader/src/GltfReader.cpp +++ b/CesiumGltfReader/src/GltfReader.cpp @@ -552,13 +552,13 @@ void CesiumGltfReader::GltfReader::postprocessGltf( {uri, headers}, options.ktx2TranscodeTargets}; - if (options.pSharedAssets == nullptr || - options.pSharedAssets->pImage == nullptr) { + if (options.pSharedAssetSystem == nullptr || + options.pSharedAssetSystem->pImage == nullptr) { // We don't have a depot, so fetch this asset directly. return assetKey.load(asyncSystem, pAssetAccessor).share(); } else { // We have a depot, so fetch this asset via that depot. - return options.pSharedAssets->pImage->getOrCreate( + return options.pSharedAssetSystem->pImage->getOrCreate( asyncSystem, pAssetAccessor, assetKey);