Revert "Added typedef for chunk key type."

This reverts commit 6419c5827b.
This commit is contained in:
David Williams
2015-03-21 14:41:04 +01:00
parent 92eaaae765
commit 5fc0317260
3 changed files with 14 additions and 18 deletions

View File

@ -284,17 +284,17 @@ namespace PolyVox
struct ChunkKey
{
ChunkKey(int32_t x, int32_t y, int32_t z) : iZPos(z), iYPos(y), iXPos(x), iValid(~0) {}
PagedVolumeChunkKeyIntType iZPos : 10;
PagedVolumeChunkKeyIntType iYPos : 10;
PagedVolumeChunkKeyIntType iXPos : 10;
int32_t iZPos : 10;
int32_t iYPos : 10;
int32_t iXPos : 10;
// Should only be true when the last access chunk pointer is valid,
// so we don't need to have a seperate check for that before using it.
PagedVolumeChunkKeyIntType iValid : 2;
int32_t iValid : 2;
};
static_assert(sizeof(ChunkKey) == sizeof(PagedVolumeChunkKeyIntType), "");
static_assert(sizeof(ChunkKey) == sizeof(int32_t), "");
PagedVolumeChunkKeyIntType posToChunkKey(int32_t iXPos, int32_t iYPos, int32_t iZPos) const
int32_t posToChunkKey(int32_t iXPos, int32_t iYPos, int32_t iZPos) const
{
iXPos = iXPos >> m_uChunkSideLengthPower;
iYPos = iYPos >> m_uChunkSideLengthPower;
@ -314,14 +314,14 @@ namespace PolyVox
// If this kind of casting ever causes problems there are
// other solutions here: http://stackoverflow.com/a/2468738
PagedVolumeChunkKeyIntType iKeyAsInt32 = force_cast<PagedVolumeChunkKeyIntType>(chunkKey);
int32_t iKeyAsInt32 = force_cast<int32_t>(chunkKey);
return iKeyAsInt32;
}
Chunk* getChunk(PagedVolumeChunkKeyIntType iKeyAsInt32) const;
Chunk* getChunk(int32_t iKeyAsInt32) const;
mutable PagedVolumeChunkKeyIntType m_v3dLastAccessedChunkKey = 0;
mutable int32_t m_v3dLastAccessedChunkKey = 0;
mutable Chunk* m_pLastAccessedChunk = nullptr;
mutable std::unordered_map<uint32_t, std::unique_ptr< Chunk > > m_mapChunks;