From 6b3078d0f77af8a943b69edb1e093055699cde37 Mon Sep 17 00:00:00 2001 From: Uleat Date: Fri, 29 Jul 2016 18:26:23 -0400 Subject: [PATCH] Fix for 64-bit Zone MMF compiles --- zone/raycast_mesh.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zone/raycast_mesh.cpp b/zone/raycast_mesh.cpp index 28427339e..0fa411836 100644 --- a/zone/raycast_mesh.cpp +++ b/zone/raycast_mesh.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -1048,7 +1049,7 @@ MyRaycastMesh::MyRaycastMesh(std::vector& rm_buffer) mNodes = new NodeAABB[mMaxNodeCount]; mRoot = &mNodes[0]; - for (int index = 0; index < mNodeCount; ++index) { + for (RmUint32 index = 0; index < mNodeCount; ++index) { chunk_size = (sizeof(RmReal) * 3); memcpy(&mNodes[index].mBounds.mMin, buf, chunk_size); buf += chunk_size; @@ -1179,13 +1180,13 @@ void MyRaycastMesh::serialize(std::vector& rm_buffer) RmUint32 lNodeIndex = TRI_EOF; if (mNodes[index].mLeft) - lNodeIndex = ((RmUint32)mNodes[index].mLeft - (RmUint32)mNodes) / sizeof(NodeAABB); + lNodeIndex = ((uintptr_t)mNodes[index].mLeft - (uintptr_t)mNodes) / sizeof(NodeAABB); memcpy(buf, &lNodeIndex, sizeof(RmUint32)); buf += sizeof(RmUint32); RmUint32 rNodeIndex = TRI_EOF; if (mNodes[index].mRight) - rNodeIndex = ((RmUint32)mNodes[index].mRight - (RmUint32)mNodes) / sizeof(NodeAABB); + rNodeIndex = ((uintptr_t)mNodes[index].mRight - (uintptr_t)mNodes) / sizeof(NodeAABB); memcpy(buf, &rNodeIndex, sizeof(RmUint32)); buf += sizeof(RmUint32); }