fix Mac OSX build
This commit is contained in:
@@ -18,6 +18,10 @@ subject to the following restrictions:
|
|||||||
#include "btBulletDynamicsCommon.h"
|
#include "btBulletDynamicsCommon.h"
|
||||||
#include "string_split.h"
|
#include "string_split.h"
|
||||||
|
|
||||||
|
#if defined(__APPLE__) || defined(__CELLOS_LV2__)
|
||||||
|
#define stricmp(a, b) strcasecmp((a), (b))
|
||||||
|
#endif
|
||||||
|
|
||||||
btBulletXmlWorldImporter::btBulletXmlWorldImporter(btDynamicsWorld* world)
|
btBulletXmlWorldImporter::btBulletXmlWorldImporter(btDynamicsWorld* world)
|
||||||
:btWorldImporter(world),
|
:btWorldImporter(world),
|
||||||
m_fileVersion(-1),
|
m_fileVersion(-1),
|
||||||
@@ -290,6 +294,11 @@ void btBulletXmlWorldImporter::deSerializeStaticPlaneShapeData(TiXmlNode* pParen
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void btBulletXmlWorldImporter::deSerializeDynamicsWorldData(TiXmlNode* pParent)
|
||||||
|
{
|
||||||
|
//gravity and world info
|
||||||
|
}
|
||||||
|
|
||||||
void btBulletXmlWorldImporter::deSerializeConvexInternalShapeData(TiXmlNode* pParent)
|
void btBulletXmlWorldImporter::deSerializeConvexInternalShapeData(TiXmlNode* pParent)
|
||||||
{
|
{
|
||||||
int ptr;
|
int ptr;
|
||||||
@@ -485,13 +494,13 @@ void btBulletXmlWorldImporter::fixupConstraintData(btTypedConstraintData* tcd)
|
|||||||
{
|
{
|
||||||
if (tcd->m_rbA)
|
if (tcd->m_rbA)
|
||||||
{
|
{
|
||||||
btRigidBodyData** ptrptr = (btRigidBodyData**)m_pointerLookup.find((int)tcd->m_rbA);
|
btRigidBodyData** ptrptr = (btRigidBodyData**)m_pointerLookup.find((intptr_t)tcd->m_rbA);
|
||||||
btAssert(ptrptr);
|
btAssert(ptrptr);
|
||||||
tcd->m_rbA = ptrptr? *ptrptr : 0;
|
tcd->m_rbA = ptrptr? *ptrptr : 0;
|
||||||
}
|
}
|
||||||
if (tcd->m_rbB)
|
if (tcd->m_rbB)
|
||||||
{
|
{
|
||||||
btRigidBodyData** ptrptr = (btRigidBodyData**)m_pointerLookup.find((int)tcd->m_rbB);
|
btRigidBodyData** ptrptr = (btRigidBodyData**)m_pointerLookup.find((intptr_t)tcd->m_rbB);
|
||||||
btAssert(ptrptr);
|
btAssert(ptrptr);
|
||||||
tcd->m_rbB = ptrptr? *ptrptr : 0;
|
tcd->m_rbB = ptrptr? *ptrptr : 0;
|
||||||
}
|
}
|
||||||
@@ -507,7 +516,7 @@ void btBulletXmlWorldImporter::fixupCollisionDataPointers(btCollisionShapeData*
|
|||||||
case COMPOUND_SHAPE_PROXYTYPE:
|
case COMPOUND_SHAPE_PROXYTYPE:
|
||||||
{
|
{
|
||||||
btCompoundShapeData* compound = (btCompoundShapeData*) shapeData;
|
btCompoundShapeData* compound = (btCompoundShapeData*) shapeData;
|
||||||
int ptr = (int) compound->m_childShapePtr;
|
int ptr = (intptr_t) compound->m_childShapePtr;
|
||||||
btCompoundShapeChildData** c = (btCompoundShapeChildData**)m_pointerLookup.find(ptr);
|
btCompoundShapeChildData** c = (btCompoundShapeChildData**)m_pointerLookup.find(ptr);
|
||||||
btAssert(c);
|
btAssert(c);
|
||||||
if (c)
|
if (c)
|
||||||
@@ -520,7 +529,7 @@ void btBulletXmlWorldImporter::fixupCollisionDataPointers(btCollisionShapeData*
|
|||||||
case CONVEX_HULL_SHAPE_PROXYTYPE:
|
case CONVEX_HULL_SHAPE_PROXYTYPE:
|
||||||
{
|
{
|
||||||
btConvexHullShapeData* convexData = (btConvexHullShapeData*)shapeData;
|
btConvexHullShapeData* convexData = (btConvexHullShapeData*)shapeData;
|
||||||
int ptr = (int)convexData->m_unscaledPointsFloatPtr;
|
int ptr = (intptr_t)convexData->m_unscaledPointsFloatPtr;
|
||||||
btVector3FloatData** ptrptr = (btVector3FloatData**)m_pointerLookup.find(ptr);
|
btVector3FloatData** ptrptr = (btVector3FloatData**)m_pointerLookup.find(ptr);
|
||||||
btAssert(ptrptr);
|
btAssert(ptrptr);
|
||||||
if (ptrptr)
|
if (ptrptr)
|
||||||
@@ -600,6 +609,11 @@ void btBulletXmlWorldImporter::auto_serialize_root_level_children(TiXmlNode* pPa
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!stricmp(pChild->Value(),"btDynamicsWorldFloatData"))
|
||||||
|
{
|
||||||
|
deSerializeDynamicsWorldData(pChild);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!stricmp(pChild->Value(),"btConvexInternalShapeData"))
|
if (!stricmp(pChild->Value(),"btConvexInternalShapeData"))
|
||||||
@@ -613,6 +627,7 @@ void btBulletXmlWorldImporter::auto_serialize_root_level_children(TiXmlNode* pPa
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("Error: btBulletXmlWorldImporter doesn't support %s yet\n", pChild->Value());
|
||||||
btAssert(0);
|
btAssert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -624,7 +639,7 @@ void btBulletXmlWorldImporter::auto_serialize_root_level_children(TiXmlNode* pPa
|
|||||||
for (int i=0;i<m_compoundShapeChildData.size();i++)
|
for (int i=0;i<m_compoundShapeChildData.size();i++)
|
||||||
{
|
{
|
||||||
btCompoundShapeChildData* childData = m_compoundShapeChildData[i];
|
btCompoundShapeChildData* childData = m_compoundShapeChildData[i];
|
||||||
int hashKey = (int) childData->m_childShape;
|
int hashKey = (intptr_t) childData->m_childShape;
|
||||||
btCollisionShapeData** ptrptr = (btCollisionShapeData**)m_pointerLookup[hashKey];
|
btCollisionShapeData** ptrptr = (btCollisionShapeData**)m_pointerLookup[hashKey];
|
||||||
btAssert(ptrptr);
|
btAssert(ptrptr);
|
||||||
if (ptrptr)
|
if (ptrptr)
|
||||||
@@ -637,7 +652,7 @@ void btBulletXmlWorldImporter::auto_serialize_root_level_children(TiXmlNode* pPa
|
|||||||
for (int i=0;i<m_rigidBodyData.size();i++)
|
for (int i=0;i<m_rigidBodyData.size();i++)
|
||||||
{
|
{
|
||||||
btRigidBodyData* rbData = m_rigidBodyData[i];
|
btRigidBodyData* rbData = m_rigidBodyData[i];
|
||||||
int hashKey = (int)rbData->m_collisionObjectData.m_collisionShape;
|
int hashKey = (intptr_t)rbData->m_collisionObjectData.m_collisionShape;
|
||||||
void** ptrptr = m_pointerLookup.find(hashKey);
|
void** ptrptr = m_pointerLookup.find(hashKey);
|
||||||
btAssert(ptrptr);
|
btAssert(ptrptr);
|
||||||
rbData->m_collisionObjectData.m_broadphaseHandle = 0;
|
rbData->m_collisionObjectData.m_broadphaseHandle = 0;
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ protected:
|
|||||||
void deSerializeCompoundShapeData(TiXmlNode* pParent);
|
void deSerializeCompoundShapeData(TiXmlNode* pParent);
|
||||||
void deSerializeCompoundShapeChildData(TiXmlNode* pParent);
|
void deSerializeCompoundShapeChildData(TiXmlNode* pParent);
|
||||||
void deSerializeConvexHullShapeData(TiXmlNode* pParent);
|
void deSerializeConvexHullShapeData(TiXmlNode* pParent);
|
||||||
|
void deSerializeDynamicsWorldData(TiXmlNode* parent);
|
||||||
|
|
||||||
///bodies
|
///bodies
|
||||||
void deSerializeRigidBodyFloatData(TiXmlNode* pParent);
|
void deSerializeRigidBodyFloatData(TiXmlNode* pParent);
|
||||||
|
|||||||
Reference in New Issue
Block a user