diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2005-11-28 09:51:54 +0300 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2005-11-28 09:51:54 +0300 |
commit | e1c66eb14509c9f6f4c59edd8a541e3d49d90cef (patch) | |
tree | 3237f6c534b1e7a5a801bb327f55de35425ff5e4 /source/gameengine/Ketsji | |
parent | 427cae9eebaceeac80f8e7a151661aa36f18db01 (diff) |
applied the 64-bit pointer patch submitted by Ken Hughes
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_CameraIpoSGController.cpp | 14 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_IPO_SGController.cpp | 14 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_LightIpoSGController.cpp | 14 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_ObColorIpoSGController.cpp | 15 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PyConstraintBinding.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_WorldIpoController.cpp | 14 |
7 files changed, 68 insertions, 27 deletions
diff --git a/source/gameengine/Ketsji/KX_CameraIpoSGController.cpp b/source/gameengine/Ketsji/KX_CameraIpoSGController.cpp index 425493dbe7e..38064739ff0 100644 --- a/source/gameengine/Ketsji/KX_CameraIpoSGController.cpp +++ b/source/gameengine/Ketsji/KX_CameraIpoSGController.cpp @@ -38,6 +38,12 @@ #include <config.h> #endif +#if defined(_WIN64) +typedef unsigned __int64 uint_ptr; +#else +typedef unsigned long uint_ptr; +#endif + bool KX_CameraIpoSGController::Update(double currentTime) { if (m_modified) @@ -92,10 +98,10 @@ SG_Controller* KX_CameraIpoSGController::GetReplica(class SG_Node* destnode) iporeplica->AddInterpolator(copyipo); MT_Scalar* scaal = ((KX_ScalarInterpolator*)*i)->GetTarget(); - int orgbase = (int)this; - int orgloc = (int)scaal; - int offset = orgloc-orgbase; - int newaddrbase = (int)iporeplica + offset; + uint_ptr orgbase = (uint_ptr)this; + uint_ptr orgloc = (uint_ptr)scaal; + uint_ptr offset = orgloc-orgbase; + uint_ptr newaddrbase = (uint_ptr)iporeplica + offset; MT_Scalar* blaptr = (MT_Scalar*) newaddrbase; copyipo->SetNewTarget((MT_Scalar*)blaptr); } diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index da81439fccb..93917151932 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -35,6 +35,12 @@ #include <config.h> #endif +#if defined(_WIN64) +typedef unsigned __int64 uint_ptr; +#else +typedef unsigned long uint_ptr; +#endif + #ifdef WIN32 // This warning tells us about truncation of __long__ stl-generated names. // It can occasionally cause DevStudio to have internal compiler warnings. @@ -1068,12 +1074,12 @@ PyObject* KX_GameObject::PyGetPhysicsId(PyObject* self, PyObject* kwds) { KX_IPhysicsController* ctrl = GetPhysicsController(); - int physid=0; + uint_ptr physid=0; if (ctrl) { - physid= (int)ctrl->GetUserData(); + physid= (uint_ptr)ctrl->GetUserData(); } - return PyInt_FromLong(physid); + return PyInt_FromLong((long)physid); } KX_PYMETHODDEF_DOC(KX_GameObject, getDistanceTo, diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.cpp b/source/gameengine/Ketsji/KX_IPO_SGController.cpp index e54fb11dc14..920a65be0fb 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.cpp +++ b/source/gameengine/Ketsji/KX_IPO_SGController.cpp @@ -35,6 +35,12 @@ #include <config.h> #endif +#if defined(_WIN64) +typedef unsigned __int64 uint_ptr; +#else +typedef unsigned long uint_ptr; +#endif + #ifdef WIN32 // This warning tells us about truncation of __long__ stl-generated names. // It can occasionally cause DevStudio to have internal compiler warnings. @@ -168,10 +174,10 @@ SG_Controller* KX_IpoSGController::GetReplica(class SG_Node* destnode) iporeplica->AddInterpolator(copyipo); MT_Scalar* scaal = ((KX_ScalarInterpolator*)*i)->GetTarget(); - int orgbase = (int)&m_ipo_xform; - int orgloc = (int)scaal; - int offset = orgloc-orgbase; - int newaddrbase = (int)&iporeplica->m_ipo_xform; + uint_ptr orgbase = (uint_ptr)&m_ipo_xform; + uint_ptr orgloc = (uint_ptr)scaal; + uint_ptr offset = orgloc-orgbase; + uint_ptr newaddrbase = (uint_ptr)&iporeplica->m_ipo_xform; newaddrbase += offset; MT_Scalar* blaptr = (MT_Scalar*) newaddrbase; copyipo->SetNewTarget((MT_Scalar*)blaptr); diff --git a/source/gameengine/Ketsji/KX_LightIpoSGController.cpp b/source/gameengine/Ketsji/KX_LightIpoSGController.cpp index e1bb3329ca8..45865b7a682 100644 --- a/source/gameengine/Ketsji/KX_LightIpoSGController.cpp +++ b/source/gameengine/Ketsji/KX_LightIpoSGController.cpp @@ -38,6 +38,12 @@ #include <config.h> #endif +#if defined(_WIN64) +typedef unsigned __int64 uint_ptr; +#else +typedef unsigned long uint_ptr; +#endif + bool KX_LightIpoSGController::Update(double currentTime) { if (m_modified) @@ -97,10 +103,10 @@ SG_Controller* KX_LightIpoSGController::GetReplica(class SG_Node* destnode) iporeplica->AddInterpolator(copyipo); MT_Scalar* scaal = ((KX_ScalarInterpolator*)*i)->GetTarget(); - int orgbase = (int)this; - int orgloc = (int)scaal; - int offset = orgloc-orgbase; - int newaddrbase = (int)iporeplica + offset; + uint_ptr orgbase = (uint_ptr)this; + uint_ptr orgloc = (uint_ptr)scaal; + uint_ptr offset = orgloc-orgbase; + uint_ptr newaddrbase = (uint_ptr)iporeplica + offset; MT_Scalar* blaptr = (MT_Scalar*) newaddrbase; copyipo->SetNewTarget((MT_Scalar*)blaptr); } diff --git a/source/gameengine/Ketsji/KX_ObColorIpoSGController.cpp b/source/gameengine/Ketsji/KX_ObColorIpoSGController.cpp index 58c1494724c..b6d385da8ca 100644 --- a/source/gameengine/Ketsji/KX_ObColorIpoSGController.cpp +++ b/source/gameengine/Ketsji/KX_ObColorIpoSGController.cpp @@ -37,6 +37,13 @@ #include <config.h> #endif +#if defined(_WIN64) +typedef unsigned __int64 uint_ptr; +#else +typedef unsigned long uint_ptr; +#endif + + bool KX_ObColorIpoSGController::Update(double currentTime) { if (m_modified) @@ -87,10 +94,10 @@ SG_Controller* KX_ObColorIpoSGController::GetReplica(class SG_Node* destnode) iporeplica->AddInterpolator(copyipo); MT_Scalar* scaal = ((KX_ScalarInterpolator*)*i)->GetTarget(); - int orgbase = (int)this; - int orgloc = (int)scaal; - int offset = orgloc-orgbase; - int newaddrbase = (int)iporeplica + offset; + uint_ptr orgbase = (uint_ptr)this; + uint_ptr orgloc = (uint_ptr)scaal; + uint_ptr offset = orgloc-orgbase; + uint_ptr newaddrbase = (uint_ptr)iporeplica + offset; MT_Scalar* blaptr = (MT_Scalar*) newaddrbase; copyipo->SetNewTarget((MT_Scalar*)blaptr); } diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index f11a9a763fe..2317f9c3a9c 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -352,13 +352,17 @@ static PyObject* gPyRemoveConstraint(PyObject* self, PyObject* args, PyObject* kwds) { - int constraintid; - - if (PyArg_ParseTuple(args,"i",&constraintid)) +#if defined(_WIN64) + __int64 constraintid; + if (PyArg_ParseTuple(args,"L",&constraintid)) +#else + long constraintid; + if (PyArg_ParseTuple(args,"l",&constraintid)) +#endif { if (PHY_GetActiveEnvironment()) { - PHY_GetActiveEnvironment()->removeConstraint(constraintid); + PHY_GetActiveEnvironment()->removeConstraint((void *)constraintid); } } Py_INCREF(Py_None); return Py_None; diff --git a/source/gameengine/Ketsji/KX_WorldIpoController.cpp b/source/gameengine/Ketsji/KX_WorldIpoController.cpp index c4800dc9d91..ded251f391e 100644 --- a/source/gameengine/Ketsji/KX_WorldIpoController.cpp +++ b/source/gameengine/Ketsji/KX_WorldIpoController.cpp @@ -37,6 +37,12 @@ #include <config.h> #endif +#if defined(_WIN64) +typedef unsigned __int64 uint_ptr; +#else +typedef unsigned long uint_ptr; +#endif + bool KX_WorldIpoController::Update(double currentTime) { if (m_modified) @@ -92,10 +98,10 @@ SG_Controller* KX_WorldIpoController::GetReplica(class SG_Node* destnode) iporeplica->AddInterpolator(copyipo); MT_Scalar* scaal = ((KX_ScalarInterpolator*)*i)->GetTarget(); - int orgbase = (int)this; - int orgloc = (int)scaal; - int offset = orgloc-orgbase; - int newaddrbase = (int)iporeplica + offset; + uint_ptr orgbase = (uint_ptr)this; + uint_ptr orgloc = (uint_ptr)scaal; + uint_ptr offset = orgloc-orgbase; + uint_ptr newaddrbase = (uint_ptr)iporeplica + offset; MT_Scalar* blaptr = (MT_Scalar*) newaddrbase; copyipo->SetNewTarget((MT_Scalar*)blaptr); } |