diff --git a/Engine/lib/opcode/OPC_AABBTree.cpp b/Engine/lib/opcode/OPC_AABBTree.cpp index 0ad32a6e1..7da56c2f7 100644 --- a/Engine/lib/opcode/OPC_AABBTree.cpp +++ b/Engine/lib/opcode/OPC_AABBTree.cpp @@ -291,21 +291,21 @@ bool AABBTreeNode::Subdivide(AABBTreeBuilder* builder) // Set last bit to tell it shouldn't be freed ### pretty ugly, find a better way. Maybe one bit in mNbPrimitives ASSERT(!(udword(&Pool[Count+0])&1)); ASSERT(!(udword(&Pool[Count+1])&1)); - mPos = udword(&Pool[Count+0])|1; + mPos = size_t(&Pool[Count+0])|1; #ifndef OPC_NO_NEG_VANILLA_TREE - mNeg = udword(&Pool[Count+1])|1; + mNeg = size_t(&Pool[Count+1])|1; #endif } else { // Non-complete trees and/or Opcode 1.2 allocate nodes on-the-fly #ifndef OPC_NO_NEG_VANILLA_TREE - mPos = (udword)new AABBTreeNode; CHECKALLOC(mPos); - mNeg = (udword)new AABBTreeNode; CHECKALLOC(mNeg); + mPos = (size_t)new AABBTreeNode; CHECKALLOC(mPos); + mNeg = (size_t)new AABBTreeNode; CHECKALLOC(mNeg); #else AABBTreeNode* PosNeg = new AABBTreeNode[2]; CHECKALLOC(PosNeg); - mPos = (udword)PosNeg; + mPos = (size_t)PosNeg; #endif } diff --git a/Engine/lib/opcode/OPC_AABBTree.h b/Engine/lib/opcode/OPC_AABBTree.h index 298f4827a..ee2533db6 100644 --- a/Engine/lib/opcode/OPC_AABBTree.h +++ b/Engine/lib/opcode/OPC_AABBTree.h @@ -43,7 +43,7 @@ /* Following data always belong to the BV-tree, regardless of what the tree actually contains.*/ \ /* Whatever happens we need the two children and the enclosing volume.*/ \ volume mBV; /* Global bounding-volume enclosing all the node-related primitives */ \ - udword mPos; /* "Positive" & "Negative" children */ + size_t mPos; /* "Positive" & "Negative" children */ #else //! TO BE DOCUMENTED #define IMPLEMENT_TREE(base_class, volume) \ @@ -68,8 +68,8 @@ /* Following data always belong to the BV-tree, regardless of what the tree actually contains.*/ \ /* Whatever happens we need the two children and the enclosing volume.*/ \ volume mBV; /* Global bounding-volume enclosing all the node-related primitives */ \ - udword mPos; /* "Positive" child */ \ - udword mNeg; /* "Negative" child */ + size_t mPos; /* "Positive" child */ \ + size_t mNeg; /* "Negative" child */ #endif typedef void (*CullingCallback) (udword nb_primitives, udword* node_primitives, BOOL need_clipping, void* user_data); diff --git a/Engine/lib/opcode/OPC_OptimizedTree.cpp b/Engine/lib/opcode/OPC_OptimizedTree.cpp index 81b3a2462..0779795c4 100644 --- a/Engine/lib/opcode/OPC_OptimizedTree.cpp +++ b/Engine/lib/opcode/OPC_OptimizedTree.cpp @@ -118,7 +118,7 @@ static void _BuildCollisionTree(AABBCollisionNode* linear, const udword box_id, udword PosID = current_id++; // Get a new id for positive child udword NegID = current_id++; // Get a new id for negative child // Setup box data as the forthcoming new P pointer - linear[box_id].mData = (udword)&linear[PosID]; + linear[box_id].mData = (size_t)&linear[PosID]; // Make sure it's not marked as leaf ASSERT(!(linear[box_id].mData&1)); // Recurse with new IDs @@ -171,7 +171,7 @@ static void _BuildNoLeafTree(AABBNoLeafNode* linear, const udword box_id, udword // Get a new id for positive child udword PosID = current_id++; // Setup box data - linear[box_id].mPosData = (udword)&linear[PosID]; + linear[box_id].mPosData = (size_t)&linear[PosID]; // Make sure it's not marked as leaf ASSERT(!(linear[box_id].mPosData&1)); // Recurse @@ -192,7 +192,7 @@ static void _BuildNoLeafTree(AABBNoLeafNode* linear, const udword box_id, udword // Get a new id for negative child udword NegID = current_id++; // Setup box data - linear[box_id].mNegData = (udword)&linear[NegID]; + linear[box_id].mNegData = (size_t)&linear[NegID]; // Make sure it's not marked as leaf ASSERT(!(linear[box_id].mNegData&1)); // Recurse @@ -549,8 +549,8 @@ bool AABBNoLeafTree::Walk(GenericWalkingCallback callback, void* user_data) cons if(!(Data&1)) \ { \ /* Compute box number */ \ - udword Nb = (Data - udword(Nodes))/Nodes[i].GetNodeSize(); \ - Data = udword(&mNodes[Nb]); \ + udword Nb = (Data - size_t(Nodes))/Nodes[i].GetNodeSize(); \ + Data = (size_t) &mNodes[Nb] ; \ } \ /* ...remapped */ \ mNodes[i].member = Data; @@ -612,7 +612,7 @@ bool AABBQuantizedTree::Build(AABBTree* tree) INIT_QUANTIZATION // Quantize - udword Data; + size_t Data; for(udword i=0;i