mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Merge pull request #811 from LuisAntonRebollo/fix_opcode_x64
Fixed OPCODE problems with x64.
This commit is contained in:
commit
b8b762805f
4 changed files with 18 additions and 18 deletions
|
|
@ -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
|
// 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+0])&1));
|
||||||
ASSERT(!(udword(&Pool[Count+1])&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
|
#ifndef OPC_NO_NEG_VANILLA_TREE
|
||||||
mNeg = udword(&Pool[Count+1])|1;
|
mNeg = size_t(&Pool[Count+1])|1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Non-complete trees and/or Opcode 1.2 allocate nodes on-the-fly
|
// Non-complete trees and/or Opcode 1.2 allocate nodes on-the-fly
|
||||||
#ifndef OPC_NO_NEG_VANILLA_TREE
|
#ifndef OPC_NO_NEG_VANILLA_TREE
|
||||||
mPos = (udword)new AABBTreeNode; CHECKALLOC(mPos);
|
mPos = (size_t)new AABBTreeNode; CHECKALLOC(mPos);
|
||||||
mNeg = (udword)new AABBTreeNode; CHECKALLOC(mNeg);
|
mNeg = (size_t)new AABBTreeNode; CHECKALLOC(mNeg);
|
||||||
#else
|
#else
|
||||||
AABBTreeNode* PosNeg = new AABBTreeNode[2];
|
AABBTreeNode* PosNeg = new AABBTreeNode[2];
|
||||||
CHECKALLOC(PosNeg);
|
CHECKALLOC(PosNeg);
|
||||||
mPos = (udword)PosNeg;
|
mPos = (size_t)PosNeg;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
/* Following data always belong to the BV-tree, regardless of what the tree actually contains.*/ \
|
/* 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.*/ \
|
/* Whatever happens we need the two children and the enclosing volume.*/ \
|
||||||
volume mBV; /* Global bounding-volume enclosing all the node-related primitives */ \
|
volume mBV; /* Global bounding-volume enclosing all the node-related primitives */ \
|
||||||
udword mPos; /* "Positive" & "Negative" children */
|
size_t mPos; /* "Positive" & "Negative" children */
|
||||||
#else
|
#else
|
||||||
//! TO BE DOCUMENTED
|
//! TO BE DOCUMENTED
|
||||||
#define IMPLEMENT_TREE(base_class, volume) \
|
#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.*/ \
|
/* 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.*/ \
|
/* Whatever happens we need the two children and the enclosing volume.*/ \
|
||||||
volume mBV; /* Global bounding-volume enclosing all the node-related primitives */ \
|
volume mBV; /* Global bounding-volume enclosing all the node-related primitives */ \
|
||||||
udword mPos; /* "Positive" child */ \
|
size_t mPos; /* "Positive" child */ \
|
||||||
udword mNeg; /* "Negative" child */
|
size_t mNeg; /* "Negative" child */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef void (*CullingCallback) (udword nb_primitives, udword* node_primitives, BOOL need_clipping, void* user_data);
|
typedef void (*CullingCallback) (udword nb_primitives, udword* node_primitives, BOOL need_clipping, void* user_data);
|
||||||
|
|
|
||||||
|
|
@ -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 PosID = current_id++; // Get a new id for positive child
|
||||||
udword NegID = current_id++; // Get a new id for negative child
|
udword NegID = current_id++; // Get a new id for negative child
|
||||||
// Setup box data as the forthcoming new P pointer
|
// 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
|
// Make sure it's not marked as leaf
|
||||||
ASSERT(!(linear[box_id].mData&1));
|
ASSERT(!(linear[box_id].mData&1));
|
||||||
// Recurse with new IDs
|
// 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
|
// Get a new id for positive child
|
||||||
udword PosID = current_id++;
|
udword PosID = current_id++;
|
||||||
// Setup box data
|
// 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
|
// Make sure it's not marked as leaf
|
||||||
ASSERT(!(linear[box_id].mPosData&1));
|
ASSERT(!(linear[box_id].mPosData&1));
|
||||||
// Recurse
|
// Recurse
|
||||||
|
|
@ -192,7 +192,7 @@ static void _BuildNoLeafTree(AABBNoLeafNode* linear, const udword box_id, udword
|
||||||
// Get a new id for negative child
|
// Get a new id for negative child
|
||||||
udword NegID = current_id++;
|
udword NegID = current_id++;
|
||||||
// Setup box data
|
// 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
|
// Make sure it's not marked as leaf
|
||||||
ASSERT(!(linear[box_id].mNegData&1));
|
ASSERT(!(linear[box_id].mNegData&1));
|
||||||
// Recurse
|
// Recurse
|
||||||
|
|
@ -549,8 +549,8 @@ bool AABBNoLeafTree::Walk(GenericWalkingCallback callback, void* user_data) cons
|
||||||
if(!(Data&1)) \
|
if(!(Data&1)) \
|
||||||
{ \
|
{ \
|
||||||
/* Compute box number */ \
|
/* Compute box number */ \
|
||||||
udword Nb = (Data - udword(Nodes))/Nodes[i].GetNodeSize(); \
|
udword Nb = (Data - size_t(Nodes))/Nodes[i].GetNodeSize(); \
|
||||||
Data = udword(&mNodes[Nb]); \
|
Data = (size_t) &mNodes[Nb] ; \
|
||||||
} \
|
} \
|
||||||
/* ...remapped */ \
|
/* ...remapped */ \
|
||||||
mNodes[i].member = Data;
|
mNodes[i].member = Data;
|
||||||
|
|
@ -612,7 +612,7 @@ bool AABBQuantizedTree::Build(AABBTree* tree)
|
||||||
INIT_QUANTIZATION
|
INIT_QUANTIZATION
|
||||||
|
|
||||||
// Quantize
|
// Quantize
|
||||||
udword Data;
|
size_t Data;
|
||||||
for(udword i=0;i<mNbNodes;i++)
|
for(udword i=0;i<mNbNodes;i++)
|
||||||
{
|
{
|
||||||
PERFORM_QUANTIZATION
|
PERFORM_QUANTIZATION
|
||||||
|
|
@ -727,7 +727,7 @@ bool AABBQuantizedNoLeafTree::Build(AABBTree* tree)
|
||||||
INIT_QUANTIZATION
|
INIT_QUANTIZATION
|
||||||
|
|
||||||
// Quantize
|
// Quantize
|
||||||
udword Data;
|
size_t Data;
|
||||||
for(udword i=0;i<mNbNodes;i++)
|
for(udword i=0;i<mNbNodes;i++)
|
||||||
{
|
{
|
||||||
PERFORM_QUANTIZATION
|
PERFORM_QUANTIZATION
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
inline_ udword GetNodeSize() const { return SIZEOFOBJECT; } \
|
inline_ udword GetNodeSize() const { return SIZEOFOBJECT; } \
|
||||||
\
|
\
|
||||||
volume mAABB; \
|
volume mAABB; \
|
||||||
udword mData;
|
size_t mData;
|
||||||
|
|
||||||
//! Common interface for a node of a no-leaf tree
|
//! Common interface for a node of a no-leaf tree
|
||||||
#define IMPLEMENT_NOLEAF_NODE(base_class, volume) \
|
#define IMPLEMENT_NOLEAF_NODE(base_class, volume) \
|
||||||
|
|
@ -56,8 +56,8 @@
|
||||||
inline_ udword GetNodeSize() const { return SIZEOFOBJECT; } \
|
inline_ udword GetNodeSize() const { return SIZEOFOBJECT; } \
|
||||||
\
|
\
|
||||||
volume mAABB; \
|
volume mAABB; \
|
||||||
udword mPosData; \
|
size_t mPosData; \
|
||||||
udword mNegData;
|
size_t mNegData;
|
||||||
|
|
||||||
class OPCODE_API AABBCollisionNode
|
class OPCODE_API AABBCollisionNode
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue