summaryrefslogtreecommitdiffstats
path: root/source/ChunkMap.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-27 11:01:20 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-27 11:01:20 +0100
commit71cd0199fda68a84c5f9a5252bf63e69712b177b (patch)
treef53d9488a3b5663aa6697fb3e6f68c9a4ea03939 /source/ChunkMap.cpp
parentAnvilStats: Added ChunkExtract mode of operation, splitting Anvil files into individual chunks. (diff)
downloadcuberite-71cd0199fda68a84c5f9a5252bf63e69712b177b.tar
cuberite-71cd0199fda68a84c5f9a5252bf63e69712b177b.tar.gz
cuberite-71cd0199fda68a84c5f9a5252bf63e69712b177b.tar.bz2
cuberite-71cd0199fda68a84c5f9a5252bf63e69712b177b.tar.lz
cuberite-71cd0199fda68a84c5f9a5252bf63e69712b177b.tar.xz
cuberite-71cd0199fda68a84c5f9a5252bf63e69712b177b.tar.zst
cuberite-71cd0199fda68a84c5f9a5252bf63e69712b177b.zip
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);
}