Skip to content

Commit

Permalink
vphysics: some bald x64 bit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tyabus committed Oct 1, 2023
1 parent aa0ce7a commit b886cb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions vphysics/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ IPhysicsCollisionSet *CPhysicsInterface::FindOrCreateCollisionSet( uintptr_t id,
IPhysicsCollisionSet *pSet = FindCollisionSet( id );
if ( pSet )
return pSet;
int index = m_collisionSets.AddToTail();
m_pCollisionSetHash->add_elem( (void *)id, (void *)(index+1) );
intp index = m_collisionSets.AddToTail(); // 64 bit fix
m_pCollisionSetHash->add_elem( (void *)(intp)id, (void *)(intp)(index+1) );
return &m_collisionSets[index];
}

Expand All @@ -198,7 +198,7 @@ IPhysicsCollisionSet *CPhysicsInterface::FindCollisionSet( uintptr_t id )
{
//lwss - x64 fixes
//int index = (int)m_pCollisionSetHash->find_elem( (void *)id );
intptr_t index = (intptr_t)m_pCollisionSetHash->find_elem( (void*)id );
intptr_t index = (intptr_t)m_pCollisionSetHash->find_elem( (void*)(intp)id );
//lwss end
if ( index > 0 )
{
Expand Down
2 changes: 1 addition & 1 deletion vphysics/physics_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2161,7 +2161,7 @@ class CObjectPairHash : public IPhysicsObjectPairHash

// set the high bit, so zero means "not there"
hash |= 0x80000000;
return (void *)hash;
return (void *)(intp)hash; //lwss x64 fix
}

// Lookup this object and get a multilist entry
Expand Down

0 comments on commit b886cb2

Please sign in to comment.