Tidying up...
This commit is contained in:
		| @@ -223,9 +223,14 @@ namespace PolyVox | ||||
| 			const uint16_t yOffset = static_cast<uint16_t>(uYPos - (blockY << m_uBlockSideLengthPower)); | ||||
| 			const uint16_t zOffset = static_cast<uint16_t>(uZPos - (blockZ << m_uBlockSideLengthPower)); | ||||
|  | ||||
| 			Block<VoxelType>* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); | ||||
| 			VoxelType* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ)->m_tUncompressedData; | ||||
|  | ||||
| 			return pUncompressedBlock->getVoxel(xOffset,yOffset,zOffset); | ||||
| 			return pUncompressedBlock | ||||
| 			[ | ||||
| 				xOffset +  | ||||
| 				yOffset * m_uBlockSideLength +  | ||||
| 				zOffset * m_uBlockSideLength * m_uBlockSideLength | ||||
| 			]; | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| @@ -312,9 +317,14 @@ namespace PolyVox | ||||
| 		const uint16_t yOffset = static_cast<uint16_t>(uYPos - (blockY << m_uBlockSideLengthPower)); | ||||
| 		const uint16_t zOffset = static_cast<uint16_t>(uZPos - (blockZ << m_uBlockSideLengthPower)); | ||||
|  | ||||
| 		Block<VoxelType>* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); | ||||
| 		VoxelType* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ)->m_tUncompressedData; | ||||
|  | ||||
| 		pUncompressedBlock->setVoxelAt(xOffset,yOffset,zOffset, tValue); | ||||
| 		pUncompressedBlock | ||||
| 		[ | ||||
| 			xOffset +  | ||||
| 			yOffset * m_uBlockSideLength +  | ||||
| 			zOffset * m_uBlockSideLength * m_uBlockSideLength | ||||
| 		] = tValue; | ||||
| 	} | ||||
|  | ||||
| 	//////////////////////////////////////////////////////////////////////////////// | ||||
| @@ -350,9 +360,14 @@ namespace PolyVox | ||||
| 		const uint16_t yOffset = static_cast<uint16_t>(uYPos - (blockY << m_uBlockSideLengthPower)); | ||||
| 		const uint16_t zOffset = static_cast<uint16_t>(uZPos - (blockZ << m_uBlockSideLengthPower)); | ||||
|  | ||||
| 		Block<VoxelType>* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); | ||||
| 		VoxelType* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ)->m_tUncompressedData; | ||||
|  | ||||
| 		pUncompressedBlock->setVoxelAt(xOffset,yOffset,zOffset, tValue); | ||||
| 		pUncompressedBlock | ||||
| 		[ | ||||
| 			xOffset +  | ||||
| 			yOffset * m_uBlockSideLength +  | ||||
| 			zOffset * m_uBlockSideLength * m_uBlockSideLength | ||||
| 		] = tValue; | ||||
|  | ||||
| 		//Return true to indicate that we modified a voxel. | ||||
| 		return true; | ||||
| @@ -840,9 +855,14 @@ namespace PolyVox | ||||
| 		const uint16_t yOffset = static_cast<uint16_t>(uYPos - (blockY << m_uBlockSideLengthPower)); | ||||
| 		const uint16_t zOffset = static_cast<uint16_t>(uZPos - (blockZ << m_uBlockSideLengthPower)); | ||||
|  | ||||
| 		Block<VoxelType>* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ); | ||||
| 		VoxelType* pUncompressedBlock = getUncompressedBlock(blockX, blockY, blockZ)->m_tUncompressedData; | ||||
|  | ||||
| 		return pUncompressedBlock->getVoxel(xOffset,yOffset,zOffset); | ||||
| 		return pUncompressedBlock | ||||
| 		[ | ||||
| 			xOffset +  | ||||
| 			yOffset * m_uBlockSideLength +  | ||||
| 			zOffset * m_uBlockSideLength * m_uBlockSideLength | ||||
| 		]; | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -119,9 +119,9 @@ namespace PolyVox | ||||
| 					uYPosInBlock * this->mVolume->m_uBlockSideLength +  | ||||
| 					uZPosInBlock * this->mVolume->m_uBlockSideLength * this->mVolume->m_uBlockSideLength; | ||||
|  | ||||
| 			Block<VoxelType>* pUncompressedCurrentBlock = this->mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock); | ||||
| 			VoxelType* pUncompressedCurrentBlock = this->mVolume->getUncompressedBlock(uXBlock, uYBlock, uZBlock)->m_tUncompressedData; | ||||
|  | ||||
| 			mCurrentVoxel = pUncompressedCurrentBlock->m_tUncompressedData + uVoxelIndexInBlock; | ||||
| 			mCurrentVoxel = pUncompressedCurrentBlock + uVoxelIndexInBlock; | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user