Prechádzať zdrojové kódy

Redefined typeReverseJointHash

Mike Lilligreen 11 rokov pred
rodič
commit
edb768816e

+ 4 - 4
engine/source/2d/scene/Scene.cc

@@ -1592,11 +1592,11 @@ S32 Scene::findJointId( b2Joint* pJoint )
     AssertFatal( pJoint != NULL, "Joint cannot be NULL." );
 
     // Find joint.
-    typeReverseJointHash::iterator itr = mReverseJoints.find( (U32)((U64)pJoint) );
+    typeReverseJointHash::iterator itr = mReverseJoints.find( pJoint );
 
     if ( itr == mReverseJoints.end() )
     {
-        Con::warnf("The joint Id could not be found via a joint reference of %x", (U64)pJoint);
+        Con::warnf("The joint Id could not be found via a joint reference of %x", pJoint);
         return 0;
     }
 
@@ -1624,7 +1624,7 @@ S32 Scene::createJoint( b2JointDef* pJointDef )
     AssertFatal( itr != mJoints.end(), "Joint already in hash table." );
 
     // Insert reverse joint.
-    mReverseJoints.insert( (U32)((U64)pJoint), jointId );
+    mReverseJoints.insert( pJoint, jointId );
 
     return jointId;
 }
@@ -3776,7 +3776,7 @@ void Scene::SayGoodbye( b2Joint* pJoint )
 
     // Remove joint references.
     mJoints.erase( jointId );
-    mReverseJoints.erase( (U32)((U64)pJoint) );
+    mReverseJoints.erase( pJoint );
 }
 
 //-----------------------------------------------------------------------------

+ 1 - 1
engine/source/2d/scene/Scene.h

@@ -167,7 +167,7 @@ class Scene :
 {
 public:
     typedef HashMap<S32, b2Joint*>              typeJointHash;
-    typedef HashMap<U32, S32>                   typeReverseJointHash;
+    typedef HashMap<b2Joint*, S32>              typeReverseJointHash;
     typedef Vector<tDeleteRequest>              typeDeleteVector;
     typedef Vector<TickContact>                 typeContactVector;
     typedef HashMap<b2Contact*, TickContact>    typeContactHash;