summaryrefslogtreecommitdiffstats
path: root/source/ChunkMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/ChunkMap.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/ChunkMap.cpp b/source/ChunkMap.cpp
index 142a009f5..fd0d5892a 100644
--- a/source/ChunkMap.cpp
+++ b/source/ChunkMap.cpp
@@ -87,8 +87,8 @@ cChunkMap::cChunkLayer * cChunkMap::GetLayer(int a_LayerX, int a_LayerZ)
cChunkMap::cChunkLayer * cChunkMap::FindLayerForChunk(int a_ChunkX, int a_ChunkZ)
{
- const int LayerX = (int)(floorf((float)a_ChunkX / (float)(LAYER_SIZE)));
- const int LayerZ = (int)(floorf((float)a_ChunkZ / (float)(LAYER_SIZE)));
+ const int LayerX = FAST_FLOOR_DIV(a_ChunkX, LAYER_SIZE);
+ const int LayerZ = FAST_FLOOR_DIV(a_ChunkZ, LAYER_SIZE);
return FindLayer(LayerX, LayerZ);
}
@@ -118,9 +118,9 @@ cChunkMap::cChunkLayer * cChunkMap::FindLayer(int a_LayerX, int a_LayerZ)
cChunkMap::cChunkLayer * cChunkMap::GetLayerForChunk(int a_ChunkX, int a_ChunkZ)
{
- const int LayerX = (int)(floorf((float)a_ChunkX / (float)(LAYER_SIZE)));
- const int LayerZ = (int)(floorf((float)a_ChunkZ / (float)(LAYER_SIZE)));
- return GetLayer( LayerX, LayerZ );
+ const int LayerX = FAST_FLOOR_DIV(a_ChunkX, LAYER_SIZE);
+ const int LayerZ = FAST_FLOOR_DIV(a_ChunkX, LAYER_SIZE);
+ return GetLayer(LayerX, LayerZ);
}