Skip to content

Commit

Permalink
Minor tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Oct 30, 2024
1 parent 33d4948 commit 8b60ebd
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ struct Rectangle;
}

namespace CesiumGltf {
struct ImageAsset;
struct Model;
} // namespace CesiumGltf

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions Cesium3DTilesSelection/src/TilesetContentManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -666,7 +666,7 @@ TilesetContentManager::TilesetContentManager(
_tileLoadsInProgress{0},
_loadedTilesCount{0},
_tilesDataUsed{0},
_pSharedAssets(TilesetSharedAssetSystem::getDefault()),
_pSharedAssetSystem(TilesetSharedAssetSystem::getDefault()),
_destructionCompletePromise{externals.asyncSystem.createPromise<void>()},
_destructionCompleteFuture{
this->_destructionCompletePromise.getFuture().share()},
Expand Down Expand Up @@ -696,7 +696,7 @@ TilesetContentManager::TilesetContentManager(
_tileLoadsInProgress{0},
_loadedTilesCount{0},
_tilesDataUsed{0},
_pSharedAssets(TilesetSharedAssetSystem::getDefault()),
_pSharedAssetSystem(TilesetSharedAssetSystem::getDefault()),
_destructionCompletePromise{externals.asyncSystem.createPromise<void>()},
_destructionCompleteFuture{
this->_destructionCompletePromise.getFuture().share()},
Expand Down Expand Up @@ -848,7 +848,7 @@ TilesetContentManager::TilesetContentManager(
_tileLoadsInProgress{0},
_loadedTilesCount{0},
_tilesDataUsed{0},
_pSharedAssets(TilesetSharedAssetSystem::getDefault()),
_pSharedAssetSystem(TilesetSharedAssetSystem::getDefault()),
_destructionCompletePromise{externals.asyncSystem.createPromise<void>()},
_destructionCompleteFuture{
this->_destructionCompletePromise.getFuture().share()},
Expand Down Expand Up @@ -994,7 +994,7 @@ void TilesetContentManager::loadTileContent(
this->_externals.pAssetAccessor,
this->_externals.pPrepareRendererResources,
this->_externals.pLogger,
this->_pSharedAssets,
this->_pSharedAssetSystem,
tilesetOptions.contentOptions,
tile};

Expand Down Expand Up @@ -1239,7 +1239,7 @@ TilesetContentManager::getTilesetCredits() const noexcept {

const CesiumUtility::IntrusivePointer<TilesetSharedAssetSystem>&
TilesetContentManager::getSharedAssetSystem() const noexcept {
return this->_pSharedAssets;
return this->_pSharedAssetSystem;
}

int32_t TilesetContentManager::getNumberOfTilesLoading() const noexcept {
Expand Down
2 changes: 1 addition & 1 deletion Cesium3DTilesSelection/src/TilesetContentManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class TilesetContentManager
int64_t _tilesDataUsed;

// Stores assets that might be shared between tiles.
CesiumUtility::IntrusivePointer<TilesetSharedAssetSystem> _pSharedAssets;
CesiumUtility::IntrusivePointer<TilesetSharedAssetSystem> _pSharedAssetSystem;

CesiumAsync::Promise<void> _destructionCompletePromise;
CesiumAsync::SharedFuture<void> _destructionCompleteFuture;
Expand Down
1 change: 0 additions & 1 deletion Cesium3DTilesSelection/src/TilesetJsonLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1005,5 +1005,4 @@ void TilesetJsonLoader::addChildLoader(
std::unique_ptr<TilesetContentLoader> pLoader) {
this->_children.emplace_back(std::move(pLoader));
}

} // namespace Cesium3DTilesSelection
2 changes: 1 addition & 1 deletion Cesium3DTilesSelection/src/TilesetJsonLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class TilesetJsonLoader : public TilesetContentLoader {
private:
std::string _baseUrl;
CesiumGeospatial::Ellipsoid _ellipsoid;
CesiumUtility::IntrusivePointer<TilesetSharedAssetSystem> _pSharedAssets;
CesiumUtility::IntrusivePointer<TilesetSharedAssetSystem> _pSharedAssetSystem;

/**
* @brief The axis that was declared as the "up-axis" for glTF content.
Expand Down
2 changes: 0 additions & 2 deletions Cesium3DTilesSelection/src/TilesetSharedAssetSystem.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include <Cesium3DTilesSelection/TilesetSharedAssetSystem.h>

using namespace Cesium3DTilesSelection;
using namespace CesiumAsync;
using namespace CesiumGltf;
using namespace CesiumGltfReader;
using namespace CesiumUtility;

Expand Down
2 changes: 1 addition & 1 deletion CesiumGltfReader/include/CesiumGltfReader/GltfReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<GltfSharedAssetSystem> pSharedAssets =
CesiumUtility::IntrusivePointer<GltfSharedAssetSystem> pSharedAssetSystem =
nullptr;
};

Expand Down
6 changes: 3 additions & 3 deletions CesiumGltfReader/src/GltfReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8b60ebd

Please sign in to comment.