@@ -64,21 +64,21 @@ namespace
64
64
}
65
65
}
66
66
67
- bool LoadedChasmFloorComparer (const RenderVoxelChunkManager::LoadedChasmFloorTextureList &textureList, const ChasmDefinition &chasmDef)
67
+ bool LoadedChasmFloorComparer (const RenderVoxelChunkManager::LoadedChasmFloorTextureList &textureList, const VoxelChasmDefinition &chasmDef)
68
68
{
69
69
if (textureList.animType != chasmDef.animType )
70
70
{
71
71
return false ;
72
72
}
73
73
74
- if (textureList.animType == ChasmDefinition ::AnimationType::SolidColor)
74
+ if (textureList.animType == VoxelChasmDefinition ::AnimationType::SolidColor)
75
75
{
76
76
return textureList.paletteIndex == chasmDef.solidColor .paletteIndex ;
77
77
}
78
- else if (textureList.animType == ChasmDefinition ::AnimationType::Animated)
78
+ else if (textureList.animType == VoxelChasmDefinition ::AnimationType::Animated)
79
79
{
80
80
const int textureAssetCount = static_cast <int >(textureList.textureAssets .size ());
81
- const ChasmDefinition ::Animated &chasmDefAnimated = chasmDef.animated ;
81
+ const VoxelChasmDefinition ::Animated &chasmDefAnimated = chasmDef.animated ;
82
82
83
83
if (textureAssetCount != chasmDefAnimated.textureAssets .getCount ())
84
84
{
@@ -108,7 +108,7 @@ namespace
108
108
TextureManager &textureManager, Renderer &renderer)
109
109
{
110
110
const ChunkInt2 chunkPos = voxelChunk.getPosition ();
111
- const ChasmDefinition &chasmDef = voxelChunk.getChasmDef (chasmDefID);
111
+ const VoxelChasmDefinition &chasmDef = voxelChunk.getChasmDef (chasmDefID);
112
112
113
113
// Check if this chasm already has a mapping (i.e. have we seen this chunk before?).
114
114
const auto keyIter = std::find_if (chasmTextureKeys.begin (), chasmTextureKeys.end (),
@@ -138,7 +138,7 @@ namespace
138
138
{
139
139
// Load the required textures and add a key for them.
140
140
RenderVoxelChunkManager::LoadedChasmFloorTextureList newTextureList;
141
- if (chasmDef.animType == ChasmDefinition ::AnimationType::SolidColor)
141
+ if (chasmDef.animType == VoxelChasmDefinition ::AnimationType::SolidColor)
142
142
{
143
143
// Dry chasms are a single color, no texture asset.
144
144
ObjectTextureID dryChasmTextureID;
@@ -166,7 +166,7 @@ namespace
166
166
newTextureList.initColor (paletteIndex, std::move (dryChasmTextureRef));
167
167
chasmFloorTextureLists.emplace_back (std::move (newTextureList));
168
168
}
169
- else if (chasmDef.animType == ChasmDefinition ::AnimationType::Animated)
169
+ else if (chasmDef.animType == VoxelChasmDefinition ::AnimationType::Animated)
170
170
{
171
171
std::vector<TextureAsset> newTextureAssets;
172
172
std::vector<ScopedObjectTextureRef> newObjectTextureRefs;
@@ -289,22 +289,22 @@ void RenderVoxelChunkManager::LoadedTexture::init(const TextureAsset &textureAss
289
289
290
290
RenderVoxelChunkManager::LoadedChasmFloorTextureList::LoadedChasmFloorTextureList ()
291
291
{
292
- this ->animType = static_cast <ChasmDefinition ::AnimationType>(-1 );
292
+ this ->animType = static_cast <VoxelChasmDefinition ::AnimationType>(-1 );
293
293
this ->paletteIndex = 0 ;
294
294
}
295
295
296
296
void RenderVoxelChunkManager::LoadedChasmFloorTextureList::initColor (uint8_t paletteIndex,
297
297
ScopedObjectTextureRef &&objectTextureRef)
298
298
{
299
- this ->animType = ChasmDefinition ::AnimationType::SolidColor;
299
+ this ->animType = VoxelChasmDefinition ::AnimationType::SolidColor;
300
300
this ->paletteIndex = paletteIndex;
301
301
this ->objectTextureRefs .emplace_back (std::move (objectTextureRef));
302
302
}
303
303
304
304
void RenderVoxelChunkManager::LoadedChasmFloorTextureList::initTextured (std::vector<TextureAsset> &&textureAssets,
305
305
std::vector<ScopedObjectTextureRef> &&objectTextureRefs)
306
306
{
307
- this ->animType = ChasmDefinition ::AnimationType::Animated;
307
+ this ->animType = VoxelChasmDefinition ::AnimationType::Animated;
308
308
this ->textureAssets = std::move (textureAssets);
309
309
this ->objectTextureRefs = std::move (objectTextureRefs);
310
310
}
@@ -314,11 +314,11 @@ int RenderVoxelChunkManager::LoadedChasmFloorTextureList::getTextureIndex(double
314
314
const int textureCount = static_cast <int >(this ->objectTextureRefs .size ());
315
315
DebugAssert (textureCount >= 1 );
316
316
317
- if (this ->animType == ChasmDefinition ::AnimationType::SolidColor)
317
+ if (this ->animType == VoxelChasmDefinition ::AnimationType::SolidColor)
318
318
{
319
319
return 0 ;
320
320
}
321
- else if (this ->animType == ChasmDefinition ::AnimationType::Animated)
321
+ else if (this ->animType == VoxelChasmDefinition ::AnimationType::Animated)
322
322
{
323
323
const int index = std::clamp (static_cast <int >(static_cast <double >(textureCount) * chasmAnimPercent), 0 , textureCount - 1 );
324
324
return index ;
@@ -684,7 +684,7 @@ void RenderVoxelChunkManager::loadTransforms(RenderVoxelChunk &renderChunk, cons
684
684
if (voxelChunk.tryGetDoorDefID (x, y, z, &doorDefID))
685
685
{
686
686
// Door transform uniform buffers. These are separate because each voxel has a RenderTransform per door face.
687
- const DoorDefinition &doorDef = voxelChunk.getDoorDef (doorDefID);
687
+ const VoxelDoorDefinition &doorDef = voxelChunk.getDoorDef (doorDefID);
688
688
const ArenaTypes::DoorType doorType = doorDef.getType ();
689
689
DebugAssert (renderChunk.doorTransformBuffers .find (voxel) == renderChunk.doorTransformBuffers .end ());
690
690
@@ -758,7 +758,7 @@ void RenderVoxelChunkManager::updateChunkDrawCalls(RenderVoxelChunk &renderChunk
758
758
759
759
VoxelChunk::DoorDefID doorDefID;
760
760
const bool isDoor = voxelChunk.tryGetDoorDefID (voxel.x , voxel.y , voxel.z , &doorDefID);
761
- const DoorDefinition *doorDef = isDoor ? &voxelChunk.getDoorDef (doorDefID) : nullptr ;
761
+ const VoxelDoorDefinition *doorDef = isDoor ? &voxelChunk.getDoorDef (doorDefID) : nullptr ;
762
762
763
763
double doorAnimPercent = 0.0 ;
764
764
if (isDoor)
@@ -775,15 +775,15 @@ void RenderVoxelChunkManager::updateChunkDrawCalls(RenderVoxelChunk &renderChunk
775
775
VoxelChunk::ChasmDefID chasmDefID;
776
776
const bool isChasm = voxelChunk.tryGetChasmDefID (voxel.x , voxel.y , voxel.z , &chasmDefID);
777
777
778
- const ChasmDefinition *chasmDef = nullptr ;
778
+ const VoxelChasmDefinition *chasmDef = nullptr ;
779
779
bool isAnimatingChasm = false ;
780
780
bool isEmissiveChasm = false ;
781
781
bool hasChasmWall = false ;
782
782
IndexBufferID chasmWallIndexBufferID = -1 ;
783
783
if (isChasm)
784
784
{
785
785
chasmDef = &voxelChunk.getChasmDef (chasmDefID);
786
- isAnimatingChasm = chasmDef->animType == ChasmDefinition ::AnimationType::Animated;
786
+ isAnimatingChasm = chasmDef->animType == VoxelChasmDefinition ::AnimationType::Animated;
787
787
isEmissiveChasm = chasmDef->isEmissive ;
788
788
789
789
const auto chasmWallIndexBufferIdIter = renderChunk.chasmWallIndexBufferIDsMap .find (voxel);
@@ -1374,7 +1374,7 @@ void RenderVoxelChunkManager::update(BufferView<const ChunkInt2> activeChunkPosi
1374
1374
continue ;
1375
1375
}
1376
1376
1377
- const DoorDefinition &doorDef = voxelChunk.getDoorDef (doorDefID);
1377
+ const VoxelDoorDefinition &doorDef = voxelChunk.getDoorDef (doorDefID);
1378
1378
const ArenaTypes::DoorType doorType = doorDef.getType ();
1379
1379
const WorldDouble3 worldPosition = MakeVoxelWorldPosition (voxelChunk.getPosition (), doorVoxel, ceilingScale);
1380
1380
const double doorAnimPercent = DoorUtils::getAnimPercentOrZero (doorVoxel.x , doorVoxel.y , doorVoxel.z , voxelChunk);
0 commit comments