Fix for 64-bit Zone MMF compiles

This commit is contained in:
Uleat 2016-07-29 18:26:23 -04:00
parent 3a4b341ad6
commit 6b3078d0f7

View File

@ -3,6 +3,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <vector>
@ -1048,7 +1049,7 @@ MyRaycastMesh::MyRaycastMesh(std::vector<char>& 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<char>& 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);
}