removed STL usage of Extras/ConvexBuilder and replaced by btAlignedObjectArray

fixed several warnings, thanks to sparkprime
added comments patch for linear math, thanks to Tully Foote
This commit is contained in:
erwin.coumans
2008-10-28 18:52:46 +00:00
parent c5112e68e5
commit 28e580c203
39 changed files with 435 additions and 196 deletions

View File

@@ -157,7 +157,7 @@ void* createCollisionLocalStoreMemory()
void* createCollisionLocalStoreMemory()
{
return new CollisionTask_LocalStoreMemory;
};
}
#endif

View File

@@ -84,7 +84,7 @@ static unsigned int getObjectIndex (btCollisionObject* object)
int cz = (int)floorf(center.z() / SPU_HASH_PHYSSIZE);
return spuGetHashCellIndex(cx, cy, cz);
};
}

View File

@@ -52,13 +52,13 @@ void* SamplelsMemoryFunc()
extern "C" {
extern char SPU_SAMPLE_ELF_SYMBOL[];
};
}
SpuSampleTaskProcess::SpuSampleTaskProcess(btThreadSupportInterface* threadInterface, unsigned int maxNumOutstandingTasks)
SpuSampleTaskProcess::SpuSampleTaskProcess(btThreadSupportInterface* threadInterface, int maxNumOutstandingTasks)
:m_threadInterface(threadInterface),
m_maxNumOutstandingTasks(maxNumOutstandingTasks)
{
@@ -159,7 +159,7 @@ void SpuSampleTaskProcess::issueTask(void* sampleMainMemPtr,int sampleValue,int
}
// find new task buffer
for (unsigned int i = 0; i < m_maxNumOutstandingTasks; i++)
for (int i = 0; i < m_maxNumOutstandingTasks; i++)
{
if (!m_taskBusy[i])
{

View File

@@ -43,10 +43,10 @@ class SpuSampleTaskProcess
btAlignedObjectArray<bool> m_taskBusy;
btAlignedObjectArray<SpuSampleTaskDesc>m_spuSampleTaskDesc;
unsigned int m_numBusyTasks;
int m_numBusyTasks;
// the current task and the current entry to insert a new work unit
unsigned int m_currentTask;
int m_currentTask;
bool m_initialized;
@@ -54,12 +54,12 @@ class SpuSampleTaskProcess
class btThreadSupportInterface* m_threadInterface;
unsigned int m_maxNumOutstandingTasks;
int m_maxNumOutstandingTasks;
public:
SpuSampleTaskProcess(btThreadSupportInterface* threadInterface, unsigned int maxNumOutstandingTasks);
SpuSampleTaskProcess(btThreadSupportInterface* threadInterface, int maxNumOutstandingTasks);
~SpuSampleTaskProcess();

View File

@@ -69,7 +69,7 @@ void* createSolverLocalStoreMemory()
void* createSolverLocalStoreMemory()
{
return new SolverTask_LocalStoreMemory;
};
}
#endif
@@ -250,7 +250,7 @@ static void updateLocalMask(SolverTask_LocalStoreMemory* localMemory, SpuSolverT
cellDmaWaitTagStatusAll(DMA_MASK(1));
}
static unsigned int getZeroIndex(unsigned int start, uint32_t* mask, uint32_t* finished, unsigned int numRegs)
static unsigned int getZeroIndex(unsigned int start, uint32_t* mask, uint32_t* finished, int numRegs)
{
// Find the index of some zero within mask|finished
unsigned int index = start;
@@ -288,7 +288,7 @@ static unsigned int getZeroIndex(unsigned int start, uint32_t* mask, uint32_t* f
return SPU_HASH_NUMCELLS;
}
static bool isAllOne (uint32_t* mask, unsigned int numRegs)
static bool isAllOne (uint32_t* mask, int numRegs)
{
uint32_t totalMask = ~0;
for (int reg = 0; reg < numRegs; ++reg)
@@ -299,7 +299,7 @@ static bool isAllOne (uint32_t* mask, unsigned int numRegs)
return totalMask == ~0;
}
static bool checkDependency(unsigned int tryIndex, uint32_t* mask, uint32_t matrix[SPU_HASH_NUMCELLS][SPU_HASH_NUMCELLDWORDS], unsigned int numRegs)
static bool checkDependency( int tryIndex, uint32_t* mask, uint32_t matrix[SPU_HASH_NUMCELLS][SPU_HASH_NUMCELLDWORDS], int numRegs)
{
for (int reg = 0; reg < numRegs; ++reg)
{
@@ -313,9 +313,9 @@ static bool checkDependency(unsigned int tryIndex, uint32_t* mask, uint32_t matr
return true;
}
static unsigned int getNextFreeCell(SolverTask_LocalStoreMemory* localMemory, SpuSolverTaskDesc& taskDesc, btSpinlock& lock)
static int getNextFreeCell(SolverTask_LocalStoreMemory* localMemory, SpuSolverTaskDesc& taskDesc, btSpinlock& lock)
{
unsigned int cellIndex = SPU_HASH_NUMCELLS;
int cellIndex = SPU_HASH_NUMCELLS;
uint32_t myMask[SPU_HASH_NUMCELLDWORDS] = {0};
@@ -345,8 +345,8 @@ static unsigned int getNextFreeCell(SolverTask_LocalStoreMemory* localMemory, Sp
}
// Find first zero, starting with offset
unsigned int tryIndex;
unsigned int start = 0;
int tryIndex;
int start = 0;
bool haveTry = false;
while (!haveTry)
{
@@ -1550,7 +1550,7 @@ void processSolverTask(void* userPtr, void* lsMemory)
btSpinlock hashLock (taskDesc.m_commandData.m_iterate.m_spinLockVar);
unsigned int cellToProcess;
int cellToProcess;
while (1)
{
cellToProcess = getNextFreeCell(localMemory, taskDesc, hashLock);
@@ -1609,7 +1609,7 @@ void processSolverTask(void* userPtr, void* lsMemory)
// Solve
for (int j = 0; j < packetSize; ++j)
for (size_t j = 0; j < packetSize; ++j)
{
SpuSolverConstraint& constraint = constraints[j];
SpuSolverBody& bodyA = bodyList[constraint.m_localOffsetBodyA];
@@ -1655,7 +1655,7 @@ void processSolverTask(void* userPtr, void* lsMemory)
cellDmaWaitTagStatusAll(DMA_MASK(1));
int j;
size_t j;
// Solve
for ( j = 0; j < packetSize*3; j += 3)
{

View File

@@ -95,7 +95,7 @@ struct SpuSolverHash
// Hash meta-data
};
inline unsigned int spuHash(unsigned int k) { return k*2654435769u; };
inline unsigned int spuHash(unsigned int k) { return k*2654435769u; }
inline unsigned int spuGetHashCellIndex(int x, int y, int z)
{
//int n = 0x8da6b343 * x + 0xd8163841 * y + 0xcb1ab31f * z;

View File

@@ -69,7 +69,7 @@ DWORD WINAPI Thread_no_1( LPVOID lpParam )
//exit Thread
status->m_status = 3;
SetEvent(status->m_eventCompletetHandle);
printf("Thread with taskId %i with handle %i exiting\n",status->m_taskId, status->m_threadHandle);
printf("Thread with taskId %i with handle %p exiting\n",status->m_taskId, status->m_threadHandle);
break;
}
@@ -218,7 +218,7 @@ void Win32ThreadSupport::startThreads(const Win32ThreadConstructionInfo& threadC
spuStatus.m_lsMemory = threadConstructionInfo.m_lsMemoryFunc();
spuStatus.m_userThreadFunc = threadConstructionInfo.m_userThreadFunc;
printf("started thread %d with threadHandle %d\n",i,handle);
printf("started thread %d with threadHandle %p\n",i,handle);
}