make GIMPACT compile under MSVC 6
This commit is contained in:
@@ -151,6 +151,8 @@ void gim_free(void *ptr);
|
|||||||
inline void gim_simd_memcpy(void * dst, const void * src, size_t copysize)
|
inline void gim_simd_memcpy(void * dst, const void * src, size_t copysize)
|
||||||
{
|
{
|
||||||
#ifdef GIM_SIMD_MEMORY
|
#ifdef GIM_SIMD_MEMORY
|
||||||
|
/*
|
||||||
|
//'long long int' is incompatible with visual studio 6...
|
||||||
//copy words
|
//copy words
|
||||||
SIMD_T * ui_src_ptr = (SIMD_T *)src;
|
SIMD_T * ui_src_ptr = (SIMD_T *)src;
|
||||||
SIMD_T * ui_dst_ptr = (SIMD_T *)dst;
|
SIMD_T * ui_dst_ptr = (SIMD_T *)dst;
|
||||||
@@ -160,9 +162,10 @@ inline void gim_simd_memcpy(void * dst, const void * src, size_t copysize)
|
|||||||
copysize-=SIMD_T_SIZE;
|
copysize-=SIMD_T_SIZE;
|
||||||
}
|
}
|
||||||
if(copysize==0) return;
|
if(copysize==0) return;
|
||||||
|
*/
|
||||||
|
|
||||||
char * c_src_ptr = (char *)ui_src_ptr;
|
char * c_src_ptr = (char *)src;
|
||||||
char * c_dst_ptr = (char *)ui_dst_ptr;
|
char * c_dst_ptr = (char *)dst;
|
||||||
while(copysize>0)
|
while(copysize>0)
|
||||||
{
|
{
|
||||||
*(c_dst_ptr++) = *(c_src_ptr++);
|
*(c_dst_ptr++) = *(c_src_ptr++);
|
||||||
|
|||||||
@@ -86,7 +86,9 @@ struct GIM_TRIANGLE_CONTACT_DATA
|
|||||||
|
|
||||||
GUINT point_indices[MAX_TRI_CLIPPING];
|
GUINT point_indices[MAX_TRI_CLIPPING];
|
||||||
|
|
||||||
for(GUINT _k=0;_k<point_count;_k++)
|
GUINT _k;
|
||||||
|
|
||||||
|
for(_k=0;_k<point_count;_k++)
|
||||||
{
|
{
|
||||||
GREAL _dist = -distance_func(plane,points[_k]) + margin;
|
GREAL _dist = -distance_func(plane,points[_k]) + margin;
|
||||||
|
|
||||||
@@ -106,7 +108,7 @@ struct GIM_TRIANGLE_CONTACT_DATA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(GUINT _k=0;_k<m_point_count;_k++)
|
for( _k=0;_k<m_point_count;_k++)
|
||||||
{
|
{
|
||||||
m_points[_k] = points[point_indices[_k]];
|
m_points[_k] = points[point_indices[_k]];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ void btContactArray::merge_contacts(
|
|||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
|
int i;
|
||||||
if(contacts.size()==0) return;
|
if(contacts.size()==0) return;
|
||||||
|
|
||||||
|
|
||||||
@@ -85,7 +86,7 @@ void btContactArray::merge_contacts(
|
|||||||
|
|
||||||
//fill key contacts
|
//fill key contacts
|
||||||
|
|
||||||
for (int i = 0;i<contacts.size() ;i++ )
|
for ( i = 0;i<contacts.size() ;i++ )
|
||||||
{
|
{
|
||||||
keycontacts.push_back(CONTACT_KEY_TOKEN(contacts[i].calc_key_contact(),i));
|
keycontacts.push_back(CONTACT_KEY_TOKEN(contacts[i].calc_key_contact(),i));
|
||||||
}
|
}
|
||||||
@@ -104,7 +105,7 @@ void btContactArray::merge_contacts(
|
|||||||
|
|
||||||
BT_CONTACT * pcontact = &(*this)[0];
|
BT_CONTACT * pcontact = &(*this)[0];
|
||||||
|
|
||||||
for(int i=1;i<keycontacts.size();i++)
|
for( i=1;i<keycontacts.size();i++)
|
||||||
{
|
{
|
||||||
key = keycontacts[i].m_key;
|
key = keycontacts[i].m_key;
|
||||||
const BT_CONTACT * scontact = &contacts[keycontacts[i].m_value];
|
const BT_CONTACT * scontact = &contacts[keycontacts[i].m_value];
|
||||||
|
|||||||
@@ -865,12 +865,14 @@ btGImpactCollisionAlgorithm::CreateFunc g_gimpact_cf;
|
|||||||
void btGImpactCollisionAlgorithm::registerAlgorithm(btCollisionDispatcher * dispatcher)
|
void btGImpactCollisionAlgorithm::registerAlgorithm(btCollisionDispatcher * dispatcher)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int i = 0;i < MAX_BROADPHASE_COLLISION_TYPES ;i++ )
|
int i;
|
||||||
|
|
||||||
|
for ( i = 0;i < MAX_BROADPHASE_COLLISION_TYPES ;i++ )
|
||||||
{
|
{
|
||||||
dispatcher->registerCollisionCreateFunc(GIMPACT_SHAPE_PROXYTYPE,i ,&g_gimpact_cf);
|
dispatcher->registerCollisionCreateFunc(GIMPACT_SHAPE_PROXYTYPE,i ,&g_gimpact_cf);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0;i < MAX_BROADPHASE_COLLISION_TYPES ;i++ )
|
for ( i = 0;i < MAX_BROADPHASE_COLLISION_TYPES ;i++ )
|
||||||
{
|
{
|
||||||
dispatcher->registerCollisionCreateFunc(i,GIMPACT_SHAPE_PROXYTYPE ,&g_gimpact_cf);
|
dispatcher->registerCollisionCreateFunc(i,GIMPACT_SHAPE_PROXYTYPE ,&g_gimpact_cf);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ void BT_TRIANGLE_CONTACT::merge_points(const btVector4 & plane,
|
|||||||
|
|
||||||
int point_indices[MAX_TRI_CLIPPING];
|
int point_indices[MAX_TRI_CLIPPING];
|
||||||
|
|
||||||
for (int _k=0;_k<point_count;_k++)
|
int _k;
|
||||||
|
|
||||||
|
for ( _k=0;_k<point_count;_k++)
|
||||||
{
|
{
|
||||||
btScalar _dist = - bt_distance_point_plane(plane,points[_k]) + margin;
|
btScalar _dist = - bt_distance_point_plane(plane,points[_k]) + margin;
|
||||||
|
|
||||||
@@ -53,7 +55,7 @@ void BT_TRIANGLE_CONTACT::merge_points(const btVector4 & plane,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int _k=0;_k<m_point_count;_k++)
|
for ( _k=0;_k<m_point_count;_k++)
|
||||||
{
|
{
|
||||||
m_points[_k] = points[point_indices[_k]];
|
m_points[_k] = points[point_indices[_k]];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,9 @@ void gim_contact_array::merge_contacts(
|
|||||||
|
|
||||||
//fill key contacts
|
//fill key contacts
|
||||||
|
|
||||||
for (GUINT i = 0;i<contacts.size() ;i++ )
|
GUINT i;
|
||||||
|
|
||||||
|
for (i = 0;i<contacts.size() ;i++ )
|
||||||
{
|
{
|
||||||
keycontacts[i].m_key = contacts[i].calc_key_contact();
|
keycontacts[i].m_key = contacts[i].calc_key_contact();
|
||||||
keycontacts[i].m_value = i;
|
keycontacts[i].m_value = i;
|
||||||
@@ -68,7 +70,9 @@ void gim_contact_array::merge_contacts(
|
|||||||
push_back(contacts[keycontacts[0].m_value]);
|
push_back(contacts[keycontacts[0].m_value]);
|
||||||
GIM_CONTACT * pcontact = &back();
|
GIM_CONTACT * pcontact = &back();
|
||||||
|
|
||||||
for(GUINT i=1;i<keycontacts.size();i++)
|
|
||||||
|
|
||||||
|
for( i=1;i<keycontacts.size();i++)
|
||||||
{
|
{
|
||||||
key = keycontacts[i].m_key;
|
key = keycontacts[i].m_key;
|
||||||
const GIM_CONTACT * scontact = &contacts[keycontacts[i].m_value];
|
const GIM_CONTACT * scontact = &contacts[keycontacts[i].m_value];
|
||||||
|
|||||||
Reference in New Issue
Block a user