Skip to content

Commit

Permalink
Merge pull request #524 from CesiumGS/update-native
Browse files Browse the repository at this point in the history
Update cesium-native to latest
  • Loading branch information
kring authored Nov 1, 2024
2 parents a023792 + 9598636 commit ef010b3
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions native~/Editor/src/CesiumIonSessionImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "UnityExternals.h"
#include "UnityTaskProcessor.h"

#include <CesiumAsync/AsyncSystem.h>
#include <CesiumUtility/Uri.h>

#include <DotNet/CesiumForUnity/CesiumIonServer.h>
Expand Down
1 change: 1 addition & 0 deletions native~/Editor/src/UnityExternals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "UnityAssetAccessor.h"
#include "UnityTaskProcessor.h"

#include <CesiumAsync/AsyncSystem.h>
#include <CesiumAsync/CachingAssetAccessor.h>
#include <CesiumAsync/GunzipAssetAccessor.h>
#include <CesiumAsync/SqliteCache.h>
Expand Down
14 changes: 7 additions & 7 deletions native~/Runtime/src/TestGltfModelImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ TestGltfModelImpl::AddFeatureIdTexture(

// Copy feature IDs to texture.
CesiumGltf::Image& image = this->_nativeModel.images.emplace_back();
image.pCesium.emplace();
image.pCesium->width = 2;
image.pCesium->height = 2;
image.pCesium->bytesPerChannel = 1;
image.pCesium->channels = 2;
image.pCesium->pixelData.resize(featureIdsLength * sizeof(std::uint16_t));
image.pAsset.emplace();
image.pAsset->width = 2;
image.pAsset->height = 2;
image.pAsset->bytesPerChannel = 1;
image.pAsset->channels = 2;
image.pAsset->pixelData.resize(featureIdsLength * sizeof(std::uint16_t));

std::uint16_t* pFeatureId =
reinterpret_cast<std::uint16_t*>(image.pCesium->pixelData.data());
reinterpret_cast<std::uint16_t*>(image.pAsset->pixelData.data());
for (int32_t i = 0; i < featureIdsLength; i++) {
*pFeatureId = featureIds[i];
pFeatureId++;
Expand Down
2 changes: 1 addition & 1 deletion native~/Runtime/src/TextureLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ UnityEngine::Texture TextureLoader::loadTexture(
return UnityEngine::Texture(nullptr);
}

const ImageAsset& imageCesium = *pImage->pCesium;
const ImageAsset& imageCesium = *pImage->pAsset;
UnityEngine::Texture unityTexture = loadTexture(imageCesium, sRGB);

const Sampler* pSampler = Model::getSafe(&model.samplers, texture.sampler);
Expand Down
4 changes: 2 additions & 2 deletions native~/Runtime/src/UnityPrepareRendererResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void generateMipMaps(
case CesiumGltf::Sampler::MinFilter::LINEAR_MIPMAP_NEAREST:
case CesiumGltf::Sampler::MinFilter::NEAREST_MIPMAP_LINEAR:
case CesiumGltf::Sampler::MinFilter::NEAREST_MIPMAP_NEAREST:
CesiumGltfReader::GltfReader::generateMipMaps(*pImage->pCesium);
CesiumGltfReader::ImageDecoder::generateMipMaps(*pImage->pAsset);
}
}
}
Expand Down Expand Up @@ -1724,7 +1724,7 @@ void UnityPrepareRendererResources::free(
void* UnityPrepareRendererResources::prepareRasterInLoadThread(
CesiumGltf::ImageAsset& image,
const std::any& rendererOptions) {
CesiumGltfReader::GltfReader::generateMipMaps(image);
CesiumGltfReader::ImageDecoder::generateMipMaps(image);
return nullptr;
}

Expand Down
1 change: 1 addition & 0 deletions native~/Runtime/src/UnityTilesetExternals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "UnityPrepareRendererResources.h"
#include "UnityTaskProcessor.h"

#include <CesiumAsync/AsyncSystem.h>
#include <CesiumAsync/CachingAssetAccessor.h>
#include <CesiumAsync/GunzipAssetAccessor.h>
#include <CesiumAsync/SqliteCache.h>
Expand Down
1 change: 1 addition & 0 deletions native~/Shared/src/UnityAssetAccessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "Cesium.h"

#include <CesiumAsync/AsyncSystem.h>
#include <CesiumAsync/IAssetResponse.h>
#include <CesiumUtility/ScopeGuard.h>

Expand Down
2 changes: 1 addition & 1 deletion native~/extern/cesium-native
Submodule cesium-native updated 74 files
+38 −0 CHANGES.md
+0 −1 Cesium3DTilesSelection/include/Cesium3DTilesSelection/IPrepareRendererResources.h
+5 −4 Cesium3DTilesSelection/include/Cesium3DTilesSelection/Tileset.h
+8 −0 Cesium3DTilesSelection/include/Cesium3DTilesSelection/TilesetExternals.h
+18 −0 Cesium3DTilesSelection/include/Cesium3DTilesSelection/TilesetSharedAssetSystem.h
+2 −2 Cesium3DTilesSelection/src/Tile.cpp
+3 −3 Cesium3DTilesSelection/src/TileContentLoadInfo.cpp
+4 −5 Cesium3DTilesSelection/src/TileContentLoadInfo.h
+2 −4 Cesium3DTilesSelection/src/Tileset.cpp
+13 −18 Cesium3DTilesSelection/src/TilesetContentManager.cpp
+4 −4 Cesium3DTilesSelection/src/TilesetContentManager.h
+15 −8 Cesium3DTilesSelection/src/TilesetHeightQuery.cpp
+5 −0 Cesium3DTilesSelection/src/TilesetHeightQuery.h
+0 −1 Cesium3DTilesSelection/src/TilesetJsonLoader.cpp
+2 −3 Cesium3DTilesSelection/src/TilesetJsonLoader.h
+32 −0 Cesium3DTilesSelection/src/TilesetSharedAssetSystem.cpp
+18 −1 Cesium3DTilesSelection/test/TestTilesetContentManager.cpp
+2 −1 CesiumAsync/include/CesiumAsync/IAssetAccessor.h
+67 −0 CesiumAsync/include/CesiumAsync/NetworkAssetDescriptor.h
+342 −185 CesiumAsync/include/CesiumAsync/SharedAssetDepot.h
+1 −1 CesiumAsync/src/GunzipAssetAccessor.cpp
+72 −0 CesiumAsync/src/NetworkAssetDescriptor.cpp
+1 −0 CesiumAsync/test/MockAssetAccessor.h
+126 −0 CesiumAsync/test/TestSharedAssetDepot.cpp
+1 −5 CesiumGeometry/include/CesiumGeometry/QuadtreeTileID.h
+12 −0 CesiumGeometry/include/CesiumGeometry/Transforms.h
+15 −0 CesiumGeometry/src/QuadtreeTileID.cpp
+41 −0 CesiumGeometry/src/Transforms.cpp
+73 −18 CesiumGeometry/test/TestTransforms.cpp
+12 −13 CesiumGltf/CMakeLists.txt
+0 −8 CesiumGltf/include/CesiumGltf/FeatureIdTextureView.h
+4 −6 CesiumGltf/include/CesiumGltf/Image.h
+4 −4 CesiumGltf/include/CesiumGltf/ImageAsset.h
+1 −1 CesiumGltf/include/CesiumGltf/PropertyTextureView.h
+2 −2 CesiumGltf/src/PropertyTextureView.cpp
+2 −2 CesiumGltf/src/TextureView.cpp
+94 −94 CesiumGltf/test/TestFeatureIdTextureView.cpp
+28 −28 CesiumGltf/test/TestPropertyTextureView.cpp
+11 −17 CesiumGltfReader/include/CesiumGltfReader/GltfReader.h
+11 −16 CesiumGltfReader/include/CesiumGltfReader/GltfSharedAssetSystem.h
+6 −23 CesiumGltfReader/include/CesiumGltfReader/ImageDecoder.h
+56 −0 CesiumGltfReader/include/CesiumGltfReader/NetworkImageAssetDescriptor.h
+99 −72 CesiumGltfReader/src/GltfReader.cpp
+16 −10 CesiumGltfReader/src/GltfSharedAssetSystem.cpp
+74 −0 CesiumGltfReader/src/NetworkImageAssetDescriptor.cpp
+6 −6 CesiumGltfReader/src/decodeDataUrls.cpp
+0 −1 CesiumGltfReader/src/decodeDataUrls.h
+5 −66 CesiumGltfReader/test/TestGltfReader.cpp
+72 −0 CesiumGltfReader/test/TestImageDecoder.cpp
+0 −1 CesiumJsonReader/include/CesiumJsonReader/IgnoreValueJsonHandler.h
+1 −0 CesiumNativeTests/include/CesiumNativeTests/SimpleAssetAccessor.h
+1 −0 CesiumNativeTests/src/FileAccessor.cpp
+7 −7 CesiumQuantizedMeshTerrain/src/QuantizedMeshLoader.cpp
+1 −0 CesiumRasterOverlays/include/CesiumRasterOverlays/RasterOverlay.h
+0 −2 CesiumRasterOverlays/include/CesiumRasterOverlays/RasterOverlayTileProvider.h
+2 −7 CesiumRasterOverlays/src/RasterOverlayTileProvider.cpp
+4 −3 CesiumRasterOverlays/test/TestAddRasterOverlayToGltf.cpp
+1 −0 CesiumUtility/CMakeLists.txt
+28 −16 CesiumUtility/include/CesiumUtility/DoublyLinkedList.h
+16 −0 CesiumUtility/include/CesiumUtility/ErrorList.h
+0 −14 CesiumUtility/include/CesiumUtility/Gunzip.h
+45 −0 CesiumUtility/include/CesiumUtility/Gzip.h
+23 −0 CesiumUtility/include/CesiumUtility/Hash.h
+43 −0 CesiumUtility/include/CesiumUtility/IDepotOwningAsset.h
+86 −0 CesiumUtility/include/CesiumUtility/Result.h
+56 −62 CesiumUtility/include/CesiumUtility/SharedAsset.h
+8 −0 CesiumUtility/src/ErrorList.cpp
+0 −51 CesiumUtility/src/Gunzip.cpp
+103 −0 CesiumUtility/src/Gzip.cpp
+79 −0 CesiumUtility/src/Hash.cpp
+79 −0 CesiumUtility/test/TestGzip.cpp
+ CesiumUtility/test/data/Gzip/CesiumMilkTruck.png
+ CesiumUtility/test/data/Gzip/CesiumMilkTruck.png.gz
+ CesiumUtility/test/data/Gzip/CesiumMilkTruck.png.gz.invalid

0 comments on commit ef010b3

Please sign in to comment.