From 4be752a93cf37700668c604296f37ea08248f13b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Jun 2018 17:01:43 +0200 Subject: Cleanup: trailing space in source/gameengine/ --- source/gameengine/Converter/BL_ActionActuator.cpp | 78 ++-- source/gameengine/Converter/BL_ActionActuator.h | 10 +- .../gameengine/Converter/BL_ArmatureActuator.cpp | 12 +- source/gameengine/Converter/BL_ArmatureActuator.h | 6 +- source/gameengine/Converter/BL_ArmatureChannel.cpp | 18 +- source/gameengine/Converter/BL_ArmatureChannel.h | 2 +- .../gameengine/Converter/BL_ArmatureConstraint.cpp | 8 +- .../gameengine/Converter/BL_ArmatureConstraint.h | 8 +- source/gameengine/Converter/BL_ArmatureObject.cpp | 36 +- source/gameengine/Converter/BL_ArmatureObject.h | 10 +- .../Converter/BL_BlenderDataConversion.cpp | 496 ++++++++++----------- .../Converter/BL_BlenderDataConversion.h | 4 +- .../Converter/BL_DeformableGameObject.cpp | 4 +- .../gameengine/Converter/BL_DeformableGameObject.h | 8 +- source/gameengine/Converter/BL_MeshDeformer.cpp | 6 +- source/gameengine/Converter/BL_MeshDeformer.h | 4 +- .../gameengine/Converter/BL_ModifierDeformer.cpp | 2 +- source/gameengine/Converter/BL_ModifierDeformer.h | 2 +- .../Converter/BL_ShapeActionActuator.cpp | 58 +-- .../gameengine/Converter/BL_ShapeActionActuator.h | 8 +- source/gameengine/Converter/BL_ShapeDeformer.cpp | 8 +- source/gameengine/Converter/BL_ShapeDeformer.h | 2 +- source/gameengine/Converter/BL_SkinDeformer.cpp | 8 +- source/gameengine/Converter/BL_SkinDeformer.h | 6 +- .../Converter/KX_BlenderScalarInterpolator.cpp | 4 +- .../Converter/KX_BlenderScalarInterpolator.h | 2 +- .../Converter/KX_BlenderSceneConverter.cpp | 64 +-- .../Converter/KX_BlenderSceneConverter.h | 22 +- .../gameengine/Converter/KX_ConvertActuators.cpp | 102 ++--- .../gameengine/Converter/KX_ConvertControllers.cpp | 14 +- .../gameengine/Converter/KX_ConvertControllers.h | 2 +- .../gameengine/Converter/KX_ConvertProperties.cpp | 12 +- source/gameengine/Converter/KX_ConvertSensors.cpp | 2 +- source/gameengine/Converter/KX_ConvertSensors.h | 2 +- source/gameengine/Converter/KX_LibLoadStatus.cpp | 6 +- .../gameengine/Converter/KX_SoftBodyDeformer.cpp | 2 +- source/gameengine/Converter/KX_SoftBodyDeformer.h | 2 +- 37 files changed, 520 insertions(+), 520 deletions(-) (limited to 'source/gameengine/Converter') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index d28cdb84275..558fd6cd2b5 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -74,9 +74,9 @@ BL_ActionActuator::BL_ActionActuator(SCA_IObject *gameobj, float layer_weight, short ipo_flags, short end_reset, - float stride) + float stride) : SCA_IActuator(gameobj, KX_ACT_ACTION), - + m_lastpos(0, 0, 0), m_blendframe(0), m_flag(0), @@ -112,7 +112,7 @@ void BL_ActionActuator::ProcessReplica() m_localtime=m_startframe; m_lastUpdate=-1; - + } void BL_ActionActuator::SetBlendTime(float newtime) @@ -128,7 +128,7 @@ void BL_ActionActuator::SetLocalTime(float curtime) dt = -dt; m_localtime = m_startframe + dt; - + // Handle wrap around if (m_localtime < min(m_startframe, m_endframe) || m_localtime > max(m_startframe, m_endframe)) { @@ -198,7 +198,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) // We handle ping pong ourselves to increase compabitility // with files made prior to animation changes from GSoC 2011. playtype = BL_Action::ACT_MODE_PLAY; - + if (m_flag & ACT_FLAG_REVERSE) { start = m_endframe; @@ -220,8 +220,8 @@ bool BL_ActionActuator::Update(double curtime, bool frame) if (m_flag & ACT_FLAG_CONTINUE) bUseContinue = true; - - + + // Handle events if (frame) { @@ -265,7 +265,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) return false; } } - + // If a different action is playing, we've been overruled and are no longer active if (obj->GetCurrentAction(m_layer) != m_action && !obj->IsActionDone(m_layer)) m_flag &= ~ACT_FLAG_ACTIVE; @@ -320,7 +320,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) m_flag |= ACT_FLAG_PLAY_END; break; - + case ACT_ACTION_FLIPPER: // Convert into a play action and play back to the beginning float temp = end; @@ -365,19 +365,19 @@ PyObject *BL_ActionActuator::PyGetChannel(PyObject *value) PyErr_SetString(PyExc_NotImplementedError, "actuator.getChannel(): Only armatures support channels"); return NULL; } - + if (!string) { PyErr_SetString(PyExc_TypeError, "expected a single string"); return NULL; } - + bPoseChannel *pchan; - + if (m_userpose==NULL && m_pose==NULL) { BL_ArmatureObject *obj = (BL_ArmatureObject*)GetParent(); obj->GetPose(&m_pose); /* Get the underlying pose from the armature */ } - + // BKE_pose_channel_find_name accounts for NULL pose, run on both in case one exists but // the channel doesnt if ( !(pchan=BKE_pose_channel_find_name(m_userpose, string)) && @@ -388,19 +388,19 @@ PyObject *BL_ActionActuator::PyGetChannel(PyObject *value) } PyObject *ret = PyTuple_New(3); - - PyObject *list = PyList_New(3); + + PyObject *list = PyList_New(3); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(pchan->loc[0])); PyList_SET_ITEM(list, 1, PyFloat_FromDouble(pchan->loc[1])); PyList_SET_ITEM(list, 2, PyFloat_FromDouble(pchan->loc[2])); PyTuple_SET_ITEM(ret, 0, list); - + list = PyList_New(3); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(pchan->size[0])); PyList_SET_ITEM(list, 1, PyFloat_FromDouble(pchan->size[1])); PyList_SET_ITEM(list, 2, PyFloat_FromDouble(pchan->size[2])); PyTuple_SET_ITEM(ret, 1, list); - + list = PyList_New(4); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(pchan->quat[0])); PyList_SET_ITEM(list, 1, PyFloat_FromDouble(pchan->quat[1])); @@ -440,7 +440,7 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, PyErr_SetString(PyExc_NotImplementedError, "actuator.setChannel(): Only armatures support channels"); return NULL; } - + if (PyTuple_Size(args)==2) { if (!PyArg_ParseTuple(args,"sO:setChannel", &string, &pymat)) // matrix return NULL; @@ -453,18 +453,18 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, PyErr_SetString(PyExc_ValueError, "Expected a string and a 4x4 matrix (2 args) or a string and loc/size/quat sequences (4 args)"); return NULL; } - + if (pymat) { float matrix[4][4]; MT_Matrix4x4 mat; - + if (!PyMatTo(pymat, mat)) return NULL; - + mat.getValue((float*)matrix); - + BL_ArmatureObject *obj = (BL_ArmatureObject*)GetParent(); - + if (!m_userpose) { if (!m_pose) obj->GetPose(&m_pose); /* Get the underlying pose from the armature */ @@ -472,7 +472,7 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, } // pchan= BKE_pose_channel_verify(m_userpose, string); // adds the channel if its not there. pchan= BKE_pose_channel_find_name(m_userpose, string); // adds the channel if its not there. - + if (pchan) { copy_v3_v3(pchan->loc, matrix[3]); mat4_to_size(pchan->size, matrix); @@ -483,10 +483,10 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, MT_Vector3 loc; MT_Vector3 size; MT_Quaternion quat; - + if (!PyVecTo(pyloc, loc) || !PyVecTo(pysize, size) || !PyQuatTo(pyquat, quat)) return NULL; - + // same as above if (!m_userpose) { if (!m_pose) @@ -495,7 +495,7 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, } // pchan= BKE_pose_channel_verify(m_userpose, string); pchan= BKE_pose_channel_find_name(m_userpose, string); // adds the channel if its not there. - + // for some reason loc.setValue(pchan->loc) fails if (pchan) { pchan->loc[0] = loc[0]; pchan->loc[1] = loc[1]; pchan->loc[2] = loc[2]; @@ -503,12 +503,12 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, pchan->quat[0] = quat[3]; pchan->quat[1] = quat[0]; pchan->quat[2] = quat[1]; pchan->quat[3] = quat[2]; /* notice xyzw -> wxyz is intentional */ } } - + if (pchan==NULL) { PyErr_SetString(PyExc_ValueError, "Channel could not be found, use the 'channelNames' attribute to get a list of valid channels"); return NULL; } - + Py_RETURN_NONE; #endif } @@ -572,7 +572,7 @@ PyObject *BL_ActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUT int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { BL_ActionActuator* self = static_cast(self_v); - + if (!PyUnicode_Check(value)) { PyErr_SetString(PyExc_ValueError, "actuator.action = val: Action Actuator, expected the string name of the action"); @@ -581,7 +581,7 @@ int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF bAction *action= NULL; STR_String val = _PyUnicode_AsString(value); - + if (val != "") { action= (bAction*)self->GetLogicManager()->GetActionByName(val); @@ -591,7 +591,7 @@ int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF return PY_SET_ATTR_FAIL; } } - + self->SetAction(action); return PY_SET_ATTR_SUCCESS; @@ -606,7 +606,7 @@ PyObject *BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA BL_ActionActuator* self = static_cast(self_v); PyObject *ret= PyList_New(0); PyObject *item; - + if (self->GetParent()->GetGameObjectType() != SCA_IObject::OBJ_ARMATURE) { PyErr_SetString(PyExc_NotImplementedError, "actuator.channelNames: Only armatures support channels"); @@ -614,7 +614,7 @@ PyObject *BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA } bPose *pose= ((BL_ArmatureObject*)self->GetParent())->GetOrigPose(); - + if (pose) { bPoseChannel *pchan; for (pchan= (bPoseChannel *)pose->chanbase.first; pchan; pchan= (bPoseChannel *)pchan->next) { @@ -623,7 +623,7 @@ PyObject *BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA Py_DECREF(item); } } - + return ret; #endif } @@ -637,12 +637,12 @@ PyObject *BL_ActionActuator::pyattr_get_use_continue(void *self_v, const KX_PYAT int BL_ActionActuator::pyattr_set_use_continue(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { BL_ActionActuator* self = static_cast(self_v); - + if (PyObject_IsTrue(value)) self->m_flag |= ACT_FLAG_CONTINUE; else self->m_flag &= ~ACT_FLAG_CONTINUE; - + return PY_SET_ATTR_SUCCESS; } @@ -655,9 +655,9 @@ PyObject *BL_ActionActuator::pyattr_get_frame(void *self_v, const KX_PYATTRIBUTE int BL_ActionActuator::pyattr_set_frame(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { BL_ActionActuator* self = static_cast(self_v); - + ((KX_GameObject*)self->m_gameobj)->SetActionFrame(self->m_layer, PyFloat_AsDouble(value)); - + return PY_SET_ATTR_SUCCESS; } diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index a43cf0f0a7b..a1ba2e4a98f 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -37,7 +37,7 @@ #include "DNA_actuator_types.h" #include "MT_Point3.h" -class BL_ActionActuator : public SCA_IActuator +class BL_ActionActuator : public SCA_IActuator { public: Py_Header @@ -61,11 +61,11 @@ public: virtual bool Update(double curtime, bool frame); virtual CValue* GetReplica(); virtual void ProcessReplica(); - + void SetBlendTime(float newtime); void SetLocalTime(float curtime); void ResetStartTime(float curtime); - + bAction* GetAction() { return m_action; } void SetAction(bAction* act) { m_action= act; } @@ -112,7 +112,7 @@ public: } } #endif /* WITH_PYTHON */ - + protected: MT_Point3 m_lastpos; float m_blendframe; @@ -125,7 +125,7 @@ protected: float m_starttime; /** The current time of the action */ float m_localtime; - + float m_lastUpdate; float m_blendin; float m_blendstart; diff --git a/source/gameengine/Converter/BL_ArmatureActuator.cpp b/source/gameengine/Converter/BL_ArmatureActuator.cpp index 67cc7d2c291..21364075429 100644 --- a/source/gameengine/Converter/BL_ArmatureActuator.cpp +++ b/source/gameengine/Converter/BL_ArmatureActuator.cpp @@ -41,8 +41,8 @@ /** * This class is the conversion of the Pose channel constraint. * It makes a link between the pose constraint and the KX scene. - * The main purpose is to give access to the constraint target - * to link it to a game object. + * The main purpose is to give access to the constraint target + * to link it to a game object. * It also allows to activate/deactivate constraints during the game. * Later it will also be possible to create constraint on the fly */ @@ -242,18 +242,18 @@ int BL_ArmatureActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBU BL_ArmatureActuator* actuator = static_cast(self); KX_GameObject* &target = (!strcmp(attrdef->m_name, "target")) ? actuator->m_gametarget : actuator->m_gamesubtarget; KX_GameObject *gameobj; - + if (!ConvertPythonToGameObject(actuator->GetLogicManager(), value, &gameobj, true, "actuator.object = value: BL_ArmatureActuator")) return PY_SET_ATTR_FAIL; // ConvertPythonToGameObject sets the error - + if (target != NULL) target->UnregisterActuator(actuator); target = gameobj; - + if (target) target->RegisterActuator(actuator); - + return PY_SET_ATTR_SUCCESS; } diff --git a/source/gameengine/Converter/BL_ArmatureActuator.h b/source/gameengine/Converter/BL_ArmatureActuator.h index ba02c5aa362..3c455498508 100644 --- a/source/gameengine/Converter/BL_ArmatureActuator.h +++ b/source/gameengine/Converter/BL_ArmatureActuator.h @@ -38,8 +38,8 @@ /** * This class is the conversion of the Pose channel constraint. * It makes a link between the pose constraint and the KX scene. - * The main purpose is to give access to the constraint target - * to link it to a game object. + * The main purpose is to give access to the constraint target + * to link it to a game object. * It also allows to activate/deactivate constraints during the game. * Later it will also be possible to create constraint on the fly */ @@ -69,7 +69,7 @@ public: virtual void Relink(CTR_Map *obj_map); virtual bool Update(double curtime, bool frame); virtual void ReParent(SCA_IObject* parent); - + #ifdef WITH_PYTHON /* These are used to get and set m_target */ diff --git a/source/gameengine/Converter/BL_ArmatureChannel.cpp b/source/gameengine/Converter/BL_ArmatureChannel.cpp index 2b8dfd8f8d1..711c96e32c1 100644 --- a/source/gameengine/Converter/BL_ArmatureChannel.cpp +++ b/source/gameengine/Converter/BL_ArmatureChannel.cpp @@ -80,7 +80,7 @@ PyObject *BL_ArmatureChannel::NewProxy(bool py_owns) #endif // WITH_PYTHON BL_ArmatureChannel::BL_ArmatureChannel( - BL_ArmatureObject *armature, + BL_ArmatureObject *armature, bPoseChannel *posechannel) : PyObjectPlus(), m_posechannel(posechannel), m_armature(armature) { @@ -106,7 +106,7 @@ PyAttributeDef BL_ArmatureChannel::Attributes[] = { // Keep these attributes in order of BCA_ defines!!! used by py_attr_getattr and py_attr_setattr KX_PYATTRIBUTE_RO_FUNCTION("bone",BL_ArmatureChannel,py_attr_getattr), KX_PYATTRIBUTE_RO_FUNCTION("parent",BL_ArmatureChannel,py_attr_getattr), - + { NULL } //Sentinel }; @@ -190,7 +190,7 @@ int BL_ArmatureChannel::py_attr_setattr(void *self_v, const struct KX_PYATTRIBUT PyErr_SetString(PyExc_AttributeError, "channel is NULL"); return PY_SET_ATTR_FAIL; } - + switch (attr_order) { default: break; @@ -396,13 +396,13 @@ PyTypeObject BL_ArmatureBone::Type = { }; // not used since this class is never instantiated -PyObject *BL_ArmatureBone::GetProxy() -{ - return NULL; +PyObject *BL_ArmatureBone::GetProxy() +{ + return NULL; } -PyObject *BL_ArmatureBone::NewProxy(bool py_owns) -{ - return NULL; +PyObject *BL_ArmatureBone::NewProxy(bool py_owns) +{ + return NULL; } PyObject *BL_ArmatureBone::py_bone_repr(PyObject *self) diff --git a/source/gameengine/Converter/BL_ArmatureChannel.h b/source/gameengine/Converter/BL_ArmatureChannel.h index a07097f8178..8e6bc94c488 100644 --- a/source/gameengine/Converter/BL_ArmatureChannel.h +++ b/source/gameengine/Converter/BL_ArmatureChannel.h @@ -56,7 +56,7 @@ private: BL_ArmatureObject* m_armature; public: - BL_ArmatureChannel(class BL_ArmatureObject *armature, + BL_ArmatureChannel(class BL_ArmatureObject *armature, struct bPoseChannel *posechannel); virtual ~BL_ArmatureChannel(); diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.cpp b/source/gameengine/Converter/BL_ArmatureConstraint.cpp index d0c7e061fb7..224ae259fa2 100644 --- a/source/gameengine/Converter/BL_ArmatureConstraint.cpp +++ b/source/gameengine/Converter/BL_ArmatureConstraint.cpp @@ -70,9 +70,9 @@ PyObject *BL_ArmatureConstraint::py_repr(void) #endif // WITH_PYTHON BL_ArmatureConstraint::BL_ArmatureConstraint( - BL_ArmatureObject *armature, + BL_ArmatureObject *armature, bPoseChannel *posechannel, - bConstraint *constraint, + bConstraint *constraint, KX_GameObject* target, KX_GameObject* subtarget) : PyObjectPlus(), m_constraint(constraint), m_posechannel(posechannel), m_armature(armature) @@ -282,7 +282,7 @@ PyAttributeDef BL_ArmatureConstraint::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("ik_flag",BL_ArmatureConstraint,py_attr_getattr), KX_PYATTRIBUTE_RW_FUNCTION("ik_dist",BL_ArmatureConstraint,py_attr_getattr,py_attr_setattr), KX_PYATTRIBUTE_RW_FUNCTION("ik_mode",BL_ArmatureConstraint,py_attr_getattr,py_attr_setattr), - + { NULL } //Sentinel }; @@ -368,7 +368,7 @@ int BL_ArmatureConstraint::py_attr_setattr(void *self_v, const struct KX_PYATTRI PyErr_SetString(PyExc_AttributeError, "constraint is NULL"); return PY_SET_ATTR_FAIL; } - + switch (attr_order) { case BCA_ENFORCE: dval = PyFloat_AsDouble(value); diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.h b/source/gameengine/Converter/BL_ArmatureConstraint.h index 1d9f7f0d548..a2c70f37902 100644 --- a/source/gameengine/Converter/BL_ArmatureConstraint.h +++ b/source/gameengine/Converter/BL_ArmatureConstraint.h @@ -46,7 +46,7 @@ struct Object; struct bPose; /** - * SG_DList : element of controlled constraint list + * SG_DList : element of controlled constraint list * head = BL_ArmatureObject::m_controlledConstraints * SG_QList : not used */ @@ -69,9 +69,9 @@ private: struct bPose* m_subpose; public: - BL_ArmatureConstraint(class BL_ArmatureObject *armature, - struct bPoseChannel *posechannel, - struct bConstraint *constraint, + BL_ArmatureConstraint(class BL_ArmatureObject *armature, + struct bPoseChannel *posechannel, + struct bConstraint *constraint, KX_GameObject* target, KX_GameObject* subtarget); virtual ~BL_ArmatureConstraint(); diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index a5af525e13a..d9ecfd1cbee 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -67,13 +67,13 @@ extern "C" { #include "MT_Matrix4x4.h" -/** +/** * Move here pose function for game engine so that we can mix with GE objects * Principle is as follow: * Use Blender structures so that BKE_pose_where_is can be used unchanged * Copy the constraint so that they can be enabled/disabled/added/removed at runtime * Don't copy the constraints for the pose used by the Action actuator, it does not need them. - * Scan the constraint structures so that the KX equivalent of target objects are identified and + * Scan the constraint structures so that the KX equivalent of target objects are identified and * stored in separate list. * When it is about to evaluate the pose, set the KX object position in the obmat of the corresponding * Blender objects and restore after the evaluation. @@ -83,7 +83,7 @@ static void game_copy_pose(bPose **dst, bPose *src, int copy_constraint) bPose *out; bPoseChannel *pchan, *outpchan; GHash *ghash; - + /* the game engine copies the current armature pose and then swaps * the object pose pointer. this makes it possible to change poses * without affecting the original blender data. */ @@ -97,7 +97,7 @@ static void game_copy_pose(bPose **dst, bPose *src, int copy_constraint) *dst=NULL; return; } - + out= (bPose*)MEM_dupallocN(src); out->chanhash = NULL; out->agroups.first= out->agroups.last= NULL; @@ -167,14 +167,14 @@ static void game_blend_poses(bPose *dst, bPose *src, float srcweight, short mode } else { dstweight = 1.0f; } - + schan= (bPoseChannel *)src->chanbase.first; for (dchan = (bPoseChannel *)dst->chanbase.first; dchan; dchan=(bPoseChannel *)dchan->next, schan= (bPoseChannel *)schan->next) { // always blend on all channels since we don't know which one has been set /* quat interpolation done separate */ if (schan->rotmode == ROT_MODE_QUAT) { float dquat[4], squat[4]; - + copy_qt_qt(dquat, dchan->quat); copy_qt_qt(squat, schan->quat); // Normalize quaternions so that interpolation/multiplication result is correct. @@ -187,7 +187,7 @@ static void game_blend_poses(bPose *dst, bPose *src, float srcweight, short mode mul_fac_qt_fl(squat, srcweight); mul_qt_qtqt(dchan->quat, dquat, squat); } - + normalize_qt(dchan->quat); } @@ -195,7 +195,7 @@ static void game_blend_poses(bPose *dst, bPose *src, float srcweight, short mode /* blending for loc and scale are pretty self-explanatory... */ dchan->loc[i] = (dchan->loc[i]*dstweight) + (schan->loc[i]*srcweight); dchan->size[i] = 1.0f + ((dchan->size[i]-1.0f)*dstweight) + ((schan->size[i]-1.0f)*srcweight); - + /* euler-rotation interpolation done here instead... */ // FIXME: are these results decent? if (schan->rotmode) @@ -209,14 +209,14 @@ static void game_blend_poses(bPose *dst, bPose *src, float srcweight, short mode dcon->enforce= dcon->enforce*(1.0f-srcweight) + scon->enforce*srcweight; } } - + /* this pose is now in src time */ dst->ctime= src->ctime; } BL_ArmatureObject::BL_ArmatureObject( - void* sgReplicationInfo, - SG_Callbacks callbacks, + void* sgReplicationInfo, + SG_Callbacks callbacks, Object *armature, Scene *scene, int vert_deform_type) @@ -375,7 +375,7 @@ void BL_ArmatureObject::LoadChannels() if (m_poseChannels.Empty()) { bPoseChannel* pchan; BL_ArmatureChannel* proxy; - + m_channelNumber = 0; for (pchan = (bPoseChannel *)m_pose->chanbase.first; pchan; pchan=(bPoseChannel *)pchan->next) { proxy = new BL_ArmatureChannel(this, pchan); @@ -389,7 +389,7 @@ BL_ArmatureChannel* BL_ArmatureObject::GetChannel(bPoseChannel* pchan) { LoadChannels(); SG_DList::iterator cit(m_poseChannels); - for (cit.begin(); !cit.end(); ++cit) + for (cit.begin(); !cit.end(); ++cit) { BL_ArmatureChannel* channel = *cit; if (channel->m_posechannel == pchan) @@ -402,7 +402,7 @@ BL_ArmatureChannel* BL_ArmatureObject::GetChannel(const char* str) { LoadChannels(); SG_DList::iterator cit(m_poseChannels); - for (cit.begin(); !cit.end(); ++cit) + for (cit.begin(); !cit.end(); ++cit) { BL_ArmatureChannel* channel = *cit; if (!strcmp(channel->m_posechannel->name, str)) @@ -535,11 +535,11 @@ void BL_ArmatureObject::GetPose(bPose **pose) { /* If the caller supplies a null pose, create a new one. */ /* Otherwise, copy the armature's pose channels into the caller-supplied pose */ - + if (!*pose) { /* probably not to good of an idea to - * duplicate everything, but it clears up - * a crash and memory leakage when + * duplicate everything, but it clears up + * a crash and memory leakage when * &BL_ActionActuator::m_pose is freed */ game_copy_pose(pose, m_pose, 0); @@ -674,7 +674,7 @@ PyObject *BL_ArmatureObject::pyattr_get_channels(void *self_v, const KX_PYATTRIB NULL))->NewProxy(true); } -KX_PYMETHODDEF_DOC_NOARGS(BL_ArmatureObject, update, +KX_PYMETHODDEF_DOC_NOARGS(BL_ArmatureObject, update, "update()\n" "Make sure that the armature will be updated on next graphic frame.\n" "This is automatically done if a KX_ArmatureActuator with mode run is active\n" diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h index 691e73d6bde..65513aa579c 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.h +++ b/source/gameengine/Converter/BL_ArmatureObject.h @@ -49,7 +49,7 @@ class MT_Matrix4x4; struct Object; class KX_BlenderSceneConverter; -class BL_ArmatureObject : public KX_GameObject +class BL_ArmatureObject : public KX_GameObject { Py_Header public: @@ -80,11 +80,11 @@ public: void RestorePose(); bool UpdateTimestep(double curtime); - + struct bArmature *GetArmature() { return (bArmature*)m_objArma->data; } const struct bArmature * GetArmature() const { return (bArmature*)m_objArma->data; } const struct Scene * GetScene() const { return m_scene; } - + Object* GetArmatureObject() {return m_objArma;} Object* GetOrigArmatureObject() {return m_origObjArma;} @@ -106,7 +106,7 @@ public: /// Retrieve the pose matrix for the specified bone. /// Returns true on success. bool GetBoneMatrix(Bone* bone, MT_Matrix4x4& matrix); - + /// Returns the bone length. The end of the bone is in the local y direction. float GetBoneLength(Bone* bone) const; @@ -130,7 +130,7 @@ protected: Object *m_origObjArma; struct bPose *m_pose; struct bPose *m_armpose; - struct Scene *m_scene; // need for BKE_pose_where_is + struct Scene *m_scene; // need for BKE_pose_where_is double m_lastframe; double m_timestep; // delta since last pose evaluation. int m_vert_deform_type; diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index a12437befaa..e31ad6b5cc4 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -185,7 +185,7 @@ static bool default_light_mode = 0; static std::map create_translate_table() { std::map m; - + /* The reverse table. In order to not confuse ourselves, we */ /* immediately convert all events that come in to KX codes. */ m[LEFTMOUSE ] = SCA_IInputDevice::KX_LEFTMOUSE; @@ -195,136 +195,136 @@ static std::map create_translate_table() m[WHEELDOWNMOUSE ] = SCA_IInputDevice::KX_WHEELDOWNMOUSE; m[MOUSEX ] = SCA_IInputDevice::KX_MOUSEX; m[MOUSEY ] = SCA_IInputDevice::KX_MOUSEY; - - // TIMERS - - m[TIMER0 ] = SCA_IInputDevice::KX_TIMER0; - m[TIMER1 ] = SCA_IInputDevice::KX_TIMER1; - m[TIMER2 ] = SCA_IInputDevice::KX_TIMER2; - - // SYSTEM - + + // TIMERS + + m[TIMER0 ] = SCA_IInputDevice::KX_TIMER0; + m[TIMER1 ] = SCA_IInputDevice::KX_TIMER1; + m[TIMER2 ] = SCA_IInputDevice::KX_TIMER2; + + // SYSTEM + #if 0 /* **** XXX **** */ - m[KEYBD ] = SCA_IInputDevice::KX_KEYBD; - m[RAWKEYBD ] = SCA_IInputDevice::KX_RAWKEYBD; - m[REDRAW ] = SCA_IInputDevice::KX_REDRAW; - m[INPUTCHANGE ] = SCA_IInputDevice::KX_INPUTCHANGE; - m[QFULL ] = SCA_IInputDevice::KX_QFULL; - m[WINFREEZE ] = SCA_IInputDevice::KX_WINFREEZE; - m[WINTHAW ] = SCA_IInputDevice::KX_WINTHAW; - m[WINCLOSE ] = SCA_IInputDevice::KX_WINCLOSE; - m[WINQUIT ] = SCA_IInputDevice::KX_WINQUIT; - m[Q_FIRSTTIME ] = SCA_IInputDevice::KX_Q_FIRSTTIME; + m[KEYBD ] = SCA_IInputDevice::KX_KEYBD; + m[RAWKEYBD ] = SCA_IInputDevice::KX_RAWKEYBD; + m[REDRAW ] = SCA_IInputDevice::KX_REDRAW; + m[INPUTCHANGE ] = SCA_IInputDevice::KX_INPUTCHANGE; + m[QFULL ] = SCA_IInputDevice::KX_QFULL; + m[WINFREEZE ] = SCA_IInputDevice::KX_WINFREEZE; + m[WINTHAW ] = SCA_IInputDevice::KX_WINTHAW; + m[WINCLOSE ] = SCA_IInputDevice::KX_WINCLOSE; + m[WINQUIT ] = SCA_IInputDevice::KX_WINQUIT; + m[Q_FIRSTTIME ] = SCA_IInputDevice::KX_Q_FIRSTTIME; /* **** XXX **** */ #endif - - // standard keyboard - - m[AKEY ] = SCA_IInputDevice::KX_AKEY; - m[BKEY ] = SCA_IInputDevice::KX_BKEY; - m[CKEY ] = SCA_IInputDevice::KX_CKEY; - m[DKEY ] = SCA_IInputDevice::KX_DKEY; - m[EKEY ] = SCA_IInputDevice::KX_EKEY; - m[FKEY ] = SCA_IInputDevice::KX_FKEY; - m[GKEY ] = SCA_IInputDevice::KX_GKEY; - m[HKEY ] = SCA_IInputDevice::KX_HKEY; - m[IKEY ] = SCA_IInputDevice::KX_IKEY; - m[JKEY ] = SCA_IInputDevice::KX_JKEY; - m[KKEY ] = SCA_IInputDevice::KX_KKEY; - m[LKEY ] = SCA_IInputDevice::KX_LKEY; - m[MKEY ] = SCA_IInputDevice::KX_MKEY; - m[NKEY ] = SCA_IInputDevice::KX_NKEY; - m[OKEY ] = SCA_IInputDevice::KX_OKEY; - m[PKEY ] = SCA_IInputDevice::KX_PKEY; - m[QKEY ] = SCA_IInputDevice::KX_QKEY; - m[RKEY ] = SCA_IInputDevice::KX_RKEY; - m[SKEY ] = SCA_IInputDevice::KX_SKEY; - m[TKEY ] = SCA_IInputDevice::KX_TKEY; - m[UKEY ] = SCA_IInputDevice::KX_UKEY; - m[VKEY ] = SCA_IInputDevice::KX_VKEY; - m[WKEY ] = SCA_IInputDevice::KX_WKEY; - m[XKEY ] = SCA_IInputDevice::KX_XKEY; - m[YKEY ] = SCA_IInputDevice::KX_YKEY; - m[ZKEY ] = SCA_IInputDevice::KX_ZKEY; - - m[ZEROKEY ] = SCA_IInputDevice::KX_ZEROKEY; - m[ONEKEY ] = SCA_IInputDevice::KX_ONEKEY; - m[TWOKEY ] = SCA_IInputDevice::KX_TWOKEY; - m[THREEKEY ] = SCA_IInputDevice::KX_THREEKEY; - m[FOURKEY ] = SCA_IInputDevice::KX_FOURKEY; - m[FIVEKEY ] = SCA_IInputDevice::KX_FIVEKEY; - m[SIXKEY ] = SCA_IInputDevice::KX_SIXKEY; - m[SEVENKEY ] = SCA_IInputDevice::KX_SEVENKEY; - m[EIGHTKEY ] = SCA_IInputDevice::KX_EIGHTKEY; - m[NINEKEY ] = SCA_IInputDevice::KX_NINEKEY; - - m[CAPSLOCKKEY ] = SCA_IInputDevice::KX_CAPSLOCKKEY; - - m[LEFTCTRLKEY ] = SCA_IInputDevice::KX_LEFTCTRLKEY; - m[LEFTALTKEY ] = SCA_IInputDevice::KX_LEFTALTKEY; - m[RIGHTALTKEY ] = SCA_IInputDevice::KX_RIGHTALTKEY; - m[RIGHTCTRLKEY ] = SCA_IInputDevice::KX_RIGHTCTRLKEY; - m[RIGHTSHIFTKEY ] = SCA_IInputDevice::KX_RIGHTSHIFTKEY; - m[LEFTSHIFTKEY ] = SCA_IInputDevice::KX_LEFTSHIFTKEY; - - m[ESCKEY ] = SCA_IInputDevice::KX_ESCKEY; - m[TABKEY ] = SCA_IInputDevice::KX_TABKEY; - m[RETKEY ] = SCA_IInputDevice::KX_RETKEY; - m[SPACEKEY ] = SCA_IInputDevice::KX_SPACEKEY; - m[LINEFEEDKEY ] = SCA_IInputDevice::KX_LINEFEEDKEY; - m[BACKSPACEKEY ] = SCA_IInputDevice::KX_BACKSPACEKEY; - m[DELKEY ] = SCA_IInputDevice::KX_DELKEY; - m[SEMICOLONKEY ] = SCA_IInputDevice::KX_SEMICOLONKEY; - m[PERIODKEY ] = SCA_IInputDevice::KX_PERIODKEY; - m[COMMAKEY ] = SCA_IInputDevice::KX_COMMAKEY; - m[QUOTEKEY ] = SCA_IInputDevice::KX_QUOTEKEY; - m[ACCENTGRAVEKEY ] = SCA_IInputDevice::KX_ACCENTGRAVEKEY; - m[MINUSKEY ] = SCA_IInputDevice::KX_MINUSKEY; + + // standard keyboard + + m[AKEY ] = SCA_IInputDevice::KX_AKEY; + m[BKEY ] = SCA_IInputDevice::KX_BKEY; + m[CKEY ] = SCA_IInputDevice::KX_CKEY; + m[DKEY ] = SCA_IInputDevice::KX_DKEY; + m[EKEY ] = SCA_IInputDevice::KX_EKEY; + m[FKEY ] = SCA_IInputDevice::KX_FKEY; + m[GKEY ] = SCA_IInputDevice::KX_GKEY; + m[HKEY ] = SCA_IInputDevice::KX_HKEY; + m[IKEY ] = SCA_IInputDevice::KX_IKEY; + m[JKEY ] = SCA_IInputDevice::KX_JKEY; + m[KKEY ] = SCA_IInputDevice::KX_KKEY; + m[LKEY ] = SCA_IInputDevice::KX_LKEY; + m[MKEY ] = SCA_IInputDevice::KX_MKEY; + m[NKEY ] = SCA_IInputDevice::KX_NKEY; + m[OKEY ] = SCA_IInputDevice::KX_OKEY; + m[PKEY ] = SCA_IInputDevice::KX_PKEY; + m[QKEY ] = SCA_IInputDevice::KX_QKEY; + m[RKEY ] = SCA_IInputDevice::KX_RKEY; + m[SKEY ] = SCA_IInputDevice::KX_SKEY; + m[TKEY ] = SCA_IInputDevice::KX_TKEY; + m[UKEY ] = SCA_IInputDevice::KX_UKEY; + m[VKEY ] = SCA_IInputDevice::KX_VKEY; + m[WKEY ] = SCA_IInputDevice::KX_WKEY; + m[XKEY ] = SCA_IInputDevice::KX_XKEY; + m[YKEY ] = SCA_IInputDevice::KX_YKEY; + m[ZKEY ] = SCA_IInputDevice::KX_ZKEY; + + m[ZEROKEY ] = SCA_IInputDevice::KX_ZEROKEY; + m[ONEKEY ] = SCA_IInputDevice::KX_ONEKEY; + m[TWOKEY ] = SCA_IInputDevice::KX_TWOKEY; + m[THREEKEY ] = SCA_IInputDevice::KX_THREEKEY; + m[FOURKEY ] = SCA_IInputDevice::KX_FOURKEY; + m[FIVEKEY ] = SCA_IInputDevice::KX_FIVEKEY; + m[SIXKEY ] = SCA_IInputDevice::KX_SIXKEY; + m[SEVENKEY ] = SCA_IInputDevice::KX_SEVENKEY; + m[EIGHTKEY ] = SCA_IInputDevice::KX_EIGHTKEY; + m[NINEKEY ] = SCA_IInputDevice::KX_NINEKEY; + + m[CAPSLOCKKEY ] = SCA_IInputDevice::KX_CAPSLOCKKEY; + + m[LEFTCTRLKEY ] = SCA_IInputDevice::KX_LEFTCTRLKEY; + m[LEFTALTKEY ] = SCA_IInputDevice::KX_LEFTALTKEY; + m[RIGHTALTKEY ] = SCA_IInputDevice::KX_RIGHTALTKEY; + m[RIGHTCTRLKEY ] = SCA_IInputDevice::KX_RIGHTCTRLKEY; + m[RIGHTSHIFTKEY ] = SCA_IInputDevice::KX_RIGHTSHIFTKEY; + m[LEFTSHIFTKEY ] = SCA_IInputDevice::KX_LEFTSHIFTKEY; + + m[ESCKEY ] = SCA_IInputDevice::KX_ESCKEY; + m[TABKEY ] = SCA_IInputDevice::KX_TABKEY; + m[RETKEY ] = SCA_IInputDevice::KX_RETKEY; + m[SPACEKEY ] = SCA_IInputDevice::KX_SPACEKEY; + m[LINEFEEDKEY ] = SCA_IInputDevice::KX_LINEFEEDKEY; + m[BACKSPACEKEY ] = SCA_IInputDevice::KX_BACKSPACEKEY; + m[DELKEY ] = SCA_IInputDevice::KX_DELKEY; + m[SEMICOLONKEY ] = SCA_IInputDevice::KX_SEMICOLONKEY; + m[PERIODKEY ] = SCA_IInputDevice::KX_PERIODKEY; + m[COMMAKEY ] = SCA_IInputDevice::KX_COMMAKEY; + m[QUOTEKEY ] = SCA_IInputDevice::KX_QUOTEKEY; + m[ACCENTGRAVEKEY ] = SCA_IInputDevice::KX_ACCENTGRAVEKEY; + m[MINUSKEY ] = SCA_IInputDevice::KX_MINUSKEY; m[PLUSKEY ] = SCA_IInputDevice::KX_PLUSKEY; m[SLASHKEY ] = SCA_IInputDevice::KX_SLASHKEY; - m[BACKSLASHKEY ] = SCA_IInputDevice::KX_BACKSLASHKEY; - m[EQUALKEY ] = SCA_IInputDevice::KX_EQUALKEY; - m[LEFTBRACKETKEY ] = SCA_IInputDevice::KX_LEFTBRACKETKEY; - m[RIGHTBRACKETKEY ] = SCA_IInputDevice::KX_RIGHTBRACKETKEY; - - m[LEFTARROWKEY ] = SCA_IInputDevice::KX_LEFTARROWKEY; - m[DOWNARROWKEY ] = SCA_IInputDevice::KX_DOWNARROWKEY; - m[RIGHTARROWKEY ] = SCA_IInputDevice::KX_RIGHTARROWKEY; - m[UPARROWKEY ] = SCA_IInputDevice::KX_UPARROWKEY; - - m[PAD2 ] = SCA_IInputDevice::KX_PAD2; - m[PAD4 ] = SCA_IInputDevice::KX_PAD4; - m[PAD6 ] = SCA_IInputDevice::KX_PAD6; - m[PAD8 ] = SCA_IInputDevice::KX_PAD8; - - m[PAD1 ] = SCA_IInputDevice::KX_PAD1; - m[PAD3 ] = SCA_IInputDevice::KX_PAD3; - m[PAD5 ] = SCA_IInputDevice::KX_PAD5; - m[PAD7 ] = SCA_IInputDevice::KX_PAD7; - m[PAD9 ] = SCA_IInputDevice::KX_PAD9; - - m[PADPERIOD ] = SCA_IInputDevice::KX_PADPERIOD; - m[PADSLASHKEY ] = SCA_IInputDevice::KX_PADSLASHKEY; - m[PADASTERKEY ] = SCA_IInputDevice::KX_PADASTERKEY; - - m[PAD0 ] = SCA_IInputDevice::KX_PAD0; - m[PADMINUS ] = SCA_IInputDevice::KX_PADMINUS; - m[PADENTER ] = SCA_IInputDevice::KX_PADENTER; - m[PADPLUSKEY ] = SCA_IInputDevice::KX_PADPLUSKEY; - - - m[F1KEY ] = SCA_IInputDevice::KX_F1KEY; - m[F2KEY ] = SCA_IInputDevice::KX_F2KEY; - m[F3KEY ] = SCA_IInputDevice::KX_F3KEY; - m[F4KEY ] = SCA_IInputDevice::KX_F4KEY; - m[F5KEY ] = SCA_IInputDevice::KX_F5KEY; - m[F6KEY ] = SCA_IInputDevice::KX_F6KEY; - m[F7KEY ] = SCA_IInputDevice::KX_F7KEY; - m[F8KEY ] = SCA_IInputDevice::KX_F8KEY; - m[F9KEY ] = SCA_IInputDevice::KX_F9KEY; - m[F10KEY ] = SCA_IInputDevice::KX_F10KEY; - m[F11KEY ] = SCA_IInputDevice::KX_F11KEY; + m[BACKSLASHKEY ] = SCA_IInputDevice::KX_BACKSLASHKEY; + m[EQUALKEY ] = SCA_IInputDevice::KX_EQUALKEY; + m[LEFTBRACKETKEY ] = SCA_IInputDevice::KX_LEFTBRACKETKEY; + m[RIGHTBRACKETKEY ] = SCA_IInputDevice::KX_RIGHTBRACKETKEY; + + m[LEFTARROWKEY ] = SCA_IInputDevice::KX_LEFTARROWKEY; + m[DOWNARROWKEY ] = SCA_IInputDevice::KX_DOWNARROWKEY; + m[RIGHTARROWKEY ] = SCA_IInputDevice::KX_RIGHTARROWKEY; + m[UPARROWKEY ] = SCA_IInputDevice::KX_UPARROWKEY; + + m[PAD2 ] = SCA_IInputDevice::KX_PAD2; + m[PAD4 ] = SCA_IInputDevice::KX_PAD4; + m[PAD6 ] = SCA_IInputDevice::KX_PAD6; + m[PAD8 ] = SCA_IInputDevice::KX_PAD8; + + m[PAD1 ] = SCA_IInputDevice::KX_PAD1; + m[PAD3 ] = SCA_IInputDevice::KX_PAD3; + m[PAD5 ] = SCA_IInputDevice::KX_PAD5; + m[PAD7 ] = SCA_IInputDevice::KX_PAD7; + m[PAD9 ] = SCA_IInputDevice::KX_PAD9; + + m[PADPERIOD ] = SCA_IInputDevice::KX_PADPERIOD; + m[PADSLASHKEY ] = SCA_IInputDevice::KX_PADSLASHKEY; + m[PADASTERKEY ] = SCA_IInputDevice::KX_PADASTERKEY; + + m[PAD0 ] = SCA_IInputDevice::KX_PAD0; + m[PADMINUS ] = SCA_IInputDevice::KX_PADMINUS; + m[PADENTER ] = SCA_IInputDevice::KX_PADENTER; + m[PADPLUSKEY ] = SCA_IInputDevice::KX_PADPLUSKEY; + + + m[F1KEY ] = SCA_IInputDevice::KX_F1KEY; + m[F2KEY ] = SCA_IInputDevice::KX_F2KEY; + m[F3KEY ] = SCA_IInputDevice::KX_F3KEY; + m[F4KEY ] = SCA_IInputDevice::KX_F4KEY; + m[F5KEY ] = SCA_IInputDevice::KX_F5KEY; + m[F6KEY ] = SCA_IInputDevice::KX_F6KEY; + m[F7KEY ] = SCA_IInputDevice::KX_F7KEY; + m[F8KEY ] = SCA_IInputDevice::KX_F8KEY; + m[F9KEY ] = SCA_IInputDevice::KX_F9KEY; + m[F10KEY ] = SCA_IInputDevice::KX_F10KEY; + m[F11KEY ] = SCA_IInputDevice::KX_F11KEY; m[F12KEY ] = SCA_IInputDevice::KX_F12KEY; m[F13KEY ] = SCA_IInputDevice::KX_F13KEY; m[F14KEY ] = SCA_IInputDevice::KX_F14KEY; @@ -336,11 +336,11 @@ static std::map create_translate_table() m[OSKEY ] = SCA_IInputDevice::KX_OSKEY; - m[PAUSEKEY ] = SCA_IInputDevice::KX_PAUSEKEY; - m[INSERTKEY ] = SCA_IInputDevice::KX_INSERTKEY; - m[HOMEKEY ] = SCA_IInputDevice::KX_HOMEKEY; - m[PAGEUPKEY ] = SCA_IInputDevice::KX_PAGEUPKEY; - m[PAGEDOWNKEY ] = SCA_IInputDevice::KX_PAGEDOWNKEY; + m[PAUSEKEY ] = SCA_IInputDevice::KX_PAUSEKEY; + m[INSERTKEY ] = SCA_IInputDevice::KX_INSERTKEY; + m[HOMEKEY ] = SCA_IInputDevice::KX_HOMEKEY; + m[PAGEUPKEY ] = SCA_IInputDevice::KX_PAGEUPKEY; + m[PAGEDOWNKEY ] = SCA_IInputDevice::KX_PAGEDOWNKEY; m[ENDKEY ] = SCA_IInputDevice::KX_ENDKEY; return m; @@ -360,13 +360,13 @@ static unsigned int KX_rgbaint2uint_new(unsigned int icol) unsigned int integer; unsigned char cp[4]; } out_color, in_color; - + in_color.integer = icol; out_color.cp[0] = in_color.cp[3]; // red out_color.cp[1] = in_color.cp[2]; // green out_color.cp[2] = in_color.cp[1]; // blue out_color.cp[3] = in_color.cp[0]; // alpha - + return out_color.integer; } @@ -386,7 +386,7 @@ static unsigned int KX_Mcol2uint_new(MCol col) out_color.cp[1] = in_color.cp[2]; // green out_color.cp[2] = in_color.cp[1]; // blue out_color.cp[3] = in_color.cp[0]; // alpha - + return out_color.integer; } @@ -487,19 +487,19 @@ static void GetUVs(BL_Material *material, MTF_localLayer *layers, MFace *mface, int unit = 0; if (tface) { - + uvs[0][0].setValue(tface->uv[0]); uvs[1][0].setValue(tface->uv[1]); uvs[2][0].setValue(tface->uv[2]); - if (mface->v4) + if (mface->v4) uvs[3][0].setValue(tface->uv[3]); } else { uvs[0][0] = uvs[1][0] = uvs[2][0] = uvs[3][0] = MT_Point2(0.f, 0.f); } - + vector found_layers; for (int vind = 0; vinduv[0]); uvs[1][unit].setValue(tface->uv[1]); uvs[2][unit].setValue(tface->uv[2]); - if (mface->v4) + if (mface->v4) uvs[3][unit].setValue(tface->uv[3]); ++unit; @@ -537,7 +537,7 @@ static void GetUVs(BL_Material *material, MTF_localLayer *layers, MFace *mface, uvs[1][unit].setValue(layer.face->uv[1]); uvs[2][unit].setValue(layer.face->uv[2]); - if (mface->v4) + if (mface->v4) uvs[3][unit].setValue(layer.face->uv[3]); else uvs[3][unit].setValue(0.0f, 0.0f); @@ -565,7 +565,7 @@ static bool ConvertMaterial( const bool validmat = (mat != NULL); const bool validface = (tface != NULL); const bool use_vcol = GetMaterialUseVColor(mat, glslmat); - + material->IdMode = DEFAULT_BLENDER; material->glslmat = (validmat) ? glslmat: false; material->materialindex = mface->mat_nr; @@ -685,7 +685,7 @@ static bool ConvertMaterial( if (mat->septex & (1 << i)) { // If this texture slot isn't in use, set it to disabled to prevent multi-uv problems material->mapping[i].mapping = DISABLE; - } + } else { material->mapping[i].mapping |= (mttmp->texco & TEXCO_REFL) ? USEREFL : 0; @@ -728,7 +728,7 @@ static bool ConvertMaterial( material->mapping[i].projplane[2] = mttmp->projz; } /// -------------------------------- - + switch (mttmp->blendtype) { case MTEX_BLEND: material->blend_mode[i] = BLEND_MIX; @@ -913,10 +913,10 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace if (ma && (ma->mode & MA_FACETEXTURE) == 0) converter->CachePolyMaterial(scene, ma, polymat); } - + // see if a bucket was reused or a new one was created // this way only one KX_BlenderMaterial object has to exist per bucket - bool bucketCreated; + bool bucketCreated; RAS_MaterialBucket* bucket = scene->FindBucket(polymat, bucketCreated); // this is needed to free up memory afterwards. @@ -1087,7 +1087,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene, /* mark face as flat, so vertices are split */ bool flat = (mface->flag & ME_SMOOTH) == 0; - + int nverts = (mface->v4)? 4: 3; RAS_Polygon *poly = meshobj->AddPolygon(bucket, nverts); @@ -1105,7 +1105,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene, meshobj->AddVertex(poly,3,pt[3],uvs[3],tan[3],rgb[3],no[3],flat,mface->v4); } - if (tface) + if (tface) tface++; if (mcol) mcol+=4; @@ -1134,27 +1134,27 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene, if (layers) delete []layers; - + dm->release(dm); converter->RegisterGameMesh(meshobj, mesh); return meshobj; } - - + + static PHY_MaterialProps *CreateMaterialFromBlenderObject(struct Object* blenderobject) { PHY_MaterialProps *materialProps = new PHY_MaterialProps; - + MT_assert(materialProps && "Create physics material properties failed"); - + Material* blendermat = give_current_material(blenderobject, 1); - + if (blendermat) { MT_assert(0.0f <= blendermat->reflect && blendermat->reflect <= 1.0f); - + materialProps->m_restitution = blendermat->reflect; materialProps->m_friction = blendermat->friction; materialProps->m_fh_spring = blendermat->fh; @@ -1172,38 +1172,38 @@ static PHY_MaterialProps *CreateMaterialFromBlenderObject(struct Object* blender materialProps->m_fh_normal = false; } - + return materialProps; } static PHY_ShapeProps *CreateShapePropsFromBlenderObject(struct Object* blenderobject) { PHY_ShapeProps *shapeProps = new PHY_ShapeProps; - + MT_assert(shapeProps); - + shapeProps->m_mass = blenderobject->mass; - + // This needs to be fixed in blender. For now, we use: - + // in Blender, inertia stands for the size value which is equivalent to // the sphere radius shapeProps->m_inertia = blenderobject->formfactor; - + MT_assert(0.0f <= blenderobject->damping && blenderobject->damping <= 1.0f); MT_assert(0.0f <= blenderobject->rdamping && blenderobject->rdamping <= 1.0f); - + shapeProps->m_lin_drag = 1.0f - blenderobject->damping; shapeProps->m_ang_drag = 1.0f - blenderobject->rdamping; - - shapeProps->m_friction_scaling[0] = blenderobject->anisotropicFriction[0]; + + shapeProps->m_friction_scaling[0] = blenderobject->anisotropicFriction[0]; shapeProps->m_friction_scaling[1] = blenderobject->anisotropicFriction[1]; shapeProps->m_friction_scaling[2] = blenderobject->anisotropicFriction[2]; shapeProps->m_do_anisotropic = ((blenderobject->gameflag & OB_ANISOTROPIC_FRICTION) != 0); - - shapeProps->m_do_fh = (blenderobject->gameflag & OB_DO_FH) != 0; + + shapeProps->m_do_fh = (blenderobject->gameflag & OB_DO_FH) != 0; shapeProps->m_do_rot_fh = (blenderobject->gameflag & OB_ROT_FH) != 0; - + // velocity clamping XXX shapeProps->m_clamp_vel_min = blenderobject->min_vel; shapeProps->m_clamp_vel_max = blenderobject->max_vel; @@ -1219,12 +1219,12 @@ static PHY_ShapeProps *CreateShapePropsFromBlenderObject(struct Object* blendero return shapeProps; } - - - - + + + + ////////////////////////////////////////////////////////// - + static float my_boundbox_mesh(Mesh *me, float *loc, float *size) @@ -1235,36 +1235,36 @@ static float my_boundbox_mesh(Mesh *me, float *loc, float *size) float mloc[3], msize[3]; float radius_sq=0.0f, vert_radius_sq, *co; int a; - + if (me->bb==0) { me->bb = BKE_boundbox_alloc_unit(); } bb= me->bb; - + INIT_MINMAX(min, max); if (!loc) loc= mloc; if (!size) size= msize; - + mvert= me->mvert; for (a = 0; atotvert; a++, mvert++) { co = mvert->co; - + /* bounds */ minmax_v3v3_v3(min, max, co); - + /* radius */ vert_radius_sq = len_squared_v3(co); if (vert_radius_sq > radius_sq) radius_sq = vert_radius_sq; } - + if (me->totvert) { loc[0] = (min[0] + max[0]) / 2.0f; loc[1] = (min[1] + max[1]) / 2.0f; loc[2] = (min[2] + max[2]) / 2.0f; - + size[0] = (max[0] - min[0]) / 2.0f; size[1] = (max[1] - min[1]) / 2.0f; size[2] = (max[2] - min[2]) / 2.0f; @@ -1273,10 +1273,10 @@ static float my_boundbox_mesh(Mesh *me, float *loc, float *size) loc[0] = loc[1] = loc[2] = 0.0f; size[0] = size[1] = size[2] = 0.0f; } - + bb->vec[0][0] = bb->vec[1][0] = bb->vec[2][0] = bb->vec[3][0] = loc[0]-size[0]; bb->vec[4][0] = bb->vec[5][0] = bb->vec[6][0] = bb->vec[7][0] = loc[0]+size[0]; - + bb->vec[0][1] = bb->vec[1][1] = bb->vec[4][1] = bb->vec[5][1] = loc[1]-size[1]; bb->vec[2][1] = bb->vec[3][1] = bb->vec[6][1] = bb->vec[7][1] = loc[1]+size[1]; @@ -1377,8 +1377,8 @@ static void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, PHY_ShapeProps* shapeprops = CreateShapePropsFromBlenderObject(blenderobject); - - PHY_MaterialProps* smmaterial = + + PHY_MaterialProps* smmaterial = CreateMaterialFromBlenderObject(blenderobject); DerivedMesh* dm = NULL; @@ -1415,7 +1415,7 @@ static KX_LightObject *gamelight_from_blamp(Object *ob, Lamp *la, unsigned int l { RAS_ILightObject *lightobj = rasterizer->CreateLight(); KX_LightObject *gamelight; - + lightobj->m_att1 = la->att1; lightobj->m_att2 = (la->mode & LA_QUAD) ? la->att2 : 0.0f; lightobj->m_coeff_const = la->coeff_const; @@ -1438,10 +1438,10 @@ static KX_LightObject *gamelight_from_blamp(Object *ob, Lamp *la, unsigned int l lightobj->m_layer = layerflag; lightobj->m_spotblend = la->spotblend; lightobj->m_spotsize = la->spotsize; - + lightobj->m_nodiffuse = (la->mode & LA_NO_DIFF) != 0; lightobj->m_nospecular = (la->mode & LA_NO_SPEC) != 0; - + bool glslmat = converter->GetGLSLMaterials(); // in GLSL NEGATIVE LAMP is handled inside the lamp update function @@ -1453,7 +1453,7 @@ static KX_LightObject *gamelight_from_blamp(Object *ob, Lamp *la, unsigned int l lightobj->m_color[2] = -lightobj->m_color[2]; } } - + if (la->type==LA_SUN) { lightobj->m_type = RAS_ILightObject::LIGHT_SUN; } else if (la->type==LA_SPOT) { @@ -1464,7 +1464,7 @@ static KX_LightObject *gamelight_from_blamp(Object *ob, Lamp *la, unsigned int l gamelight = new KX_LightObject(kxscene, KX_Scene::m_callbacks, rasterizer, lightobj, glslmat); - + return gamelight; } @@ -1473,29 +1473,29 @@ static KX_Camera *gamecamera_from_bcamera(Object *ob, KX_Scene *kxscene, KX_Blen Camera* ca = static_cast(ob->data); RAS_CameraData camdata(ca->lens, ca->ortho_scale, ca->sensor_x, ca->sensor_y, ca->sensor_fit, ca->shiftx, ca->shifty, ca->clipsta, ca->clipend, ca->type == CAM_PERSP, ca->YF_dofdist); KX_Camera *gamecamera; - + gamecamera= new KX_Camera(kxscene, KX_Scene::m_callbacks, camdata); gamecamera->SetName(ca->id.name + 2); - + return gamecamera; } static KX_GameObject *gameobject_from_blenderobject( - Object *ob, - KX_Scene *kxscene, + Object *ob, + KX_Scene *kxscene, RAS_IRasterizer *rendertools, KX_BlenderSceneConverter *converter, - bool libloading) + bool libloading) { KX_GameObject *gameobj = NULL; Scene *blenderscene = kxscene->GetBlenderScene(); - + switch (ob->type) { case OB_LAMP: { KX_LightObject* gamelight = gamelight_from_blamp(ob, static_cast(ob->data), ob->lay, kxscene, rendertools, converter); gameobj = gamelight; - + if (blenderscene->lay & ob->lay) { gamelight->AddRef(); @@ -1504,26 +1504,26 @@ static KX_GameObject *gameobject_from_blenderobject( break; } - + case OB_CAMERA: { KX_Camera* gamecamera = gamecamera_from_bcamera(ob, kxscene, converter); gameobj = gamecamera; - + //don't add a reference: the camera list in kxscene->m_cameras is not released at the end //gamecamera->AddRef(); kxscene->AddCamera(gamecamera); - + break; } - + case OB_MESH: { Mesh* mesh = static_cast(ob->data); float center[3], extents[3]; float radius = my_boundbox_mesh((Mesh*) ob->data, center, extents); RAS_MeshObject* meshobj = BL_ConvertMesh(mesh,ob,kxscene,converter, libloading); - + // needed for python scripting kxscene->GetLogicManager()->RegisterMeshName(meshobj->GetName(),meshobj); @@ -1535,7 +1535,7 @@ static KX_GameObject *gameobject_from_blenderobject( } gameobj = new BL_DeformableGameObject(ob,kxscene,KX_Scene::m_callbacks); - + // set transformation gameobj->AddMesh(meshobj); @@ -1560,10 +1560,10 @@ static KX_GameObject *gameobject_from_blenderobject( kxscene->SetLodHysteresisValue(blenderscene->gm.scehysteresis); } } - + // for all objects: check whether they want to // respond to updates - bool ignoreActivityCulling = + bool ignoreActivityCulling = ((ob->gameflag2 & OB_NEVER_DO_ACTIVITY_CULLING)!=0); gameobj->SetIgnoreActivityCulling(ignoreActivityCulling); gameobj->SetOccluder((ob->gameflag & OB_OCCLUDER) != 0, false); @@ -1572,7 +1572,7 @@ static KX_GameObject *gameobject_from_blenderobject( // that requires it Material *mat= NULL; bool bUseObjectColor=false; - + for (int i=0;itotcol;i++) { mat=mesh->mat[i]; if (!mat) break; @@ -1583,7 +1583,7 @@ static KX_GameObject *gameobject_from_blenderobject( } if (bUseObjectColor) gameobj->SetObjectColor(ob->col); - + // two options exists for deform: shape keys and armature // only support relative shape key bool bHasShapeKey = mesh->key != NULL && mesh->key->type==KEY_RELATIVE; @@ -1598,8 +1598,8 @@ static KX_GameObject *gameobject_from_blenderobject( kxscene->GetBlenderScene(), ob, meshobj); ((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont); } else if (bHasShapeKey) { - // not that we can have shape keys without dvert! - BL_ShapeDeformer *dcont = new BL_ShapeDeformer((BL_DeformableGameObject*)gameobj, + // not that we can have shape keys without dvert! + BL_ShapeDeformer *dcont = new BL_ShapeDeformer((BL_DeformableGameObject*)gameobj, ob, meshobj); ((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont); } else if (bHasArmature) { @@ -1619,16 +1619,16 @@ static KX_GameObject *gameobject_from_blenderobject( ((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont); #endif } - + MT_Point3 min = MT_Point3(center) - MT_Vector3(extents); MT_Point3 max = MT_Point3(center) + MT_Vector3(extents); SG_BBox bbox = SG_BBox(min, max); gameobj->GetSGNode()->SetBBox(bbox); gameobj->GetSGNode()->SetRadius(radius); - + break; } - + case OB_ARMATURE: { bArmature *arm = (bArmature*)ob->data; @@ -1642,7 +1642,7 @@ static KX_GameObject *gameobject_from_blenderobject( /* Get the current pose from the armature object and apply it as the rest pose */ break; } - + case OB_EMPTY: { gameobj = new KX_EmptyObject(kxscene,KX_Scene::m_callbacks); @@ -1672,7 +1672,7 @@ static KX_GameObject *gameobject_from_blenderobject( #endif } - if (gameobj) + if (gameobj) { gameobj->SetLayer(ob->lay); gameobj->SetBlenderObject(ob); @@ -1691,13 +1691,13 @@ static bPoseChannel *get_active_posechannel2(Object *ob) { bArmature *arm= (bArmature*)ob->data; bPoseChannel *pchan; - + /* find active */ for (pchan= (bPoseChannel *)ob->pose->chanbase.first; pchan; pchan= pchan->next) { if (pchan->bone && (pchan->bone == arm->act_bone) && (pchan->bone->layer & arm->layer)) return pchan; } - + return NULL; } @@ -1707,14 +1707,14 @@ static ListBase *get_active_constraints2(Object *ob) return NULL; // XXX - shouldnt we care about the pose data and not the mode??? - if (ob->mode & OB_MODE_POSE) { + if (ob->mode & OB_MODE_POSE) { bPoseChannel *pchan; pchan = get_active_posechannel2(ob); if (pchan) return &pchan->constraints; } - else + else return &ob->constraints; return NULL; @@ -1753,7 +1753,7 @@ static KX_GameObject* getGameOb(STR_String busc,CListValue* sumolist) if (gameobje->GetName()==busc) return gameobje; } - + return 0; } @@ -1945,11 +1945,11 @@ void BL_ConvertBlenderObjects(struct Main* maggie, } else { frame_type = RAS_FrameSettings::e_frame_scale; } - + aspect_width = (int)(blenderscene->r.xsch * blenderscene->r.xasp); aspect_height = (int)(blenderscene->r.ysch * blenderscene->r.yasp); } - + RAS_FrameSettings frame_settings( frame_type, blenderscene->gm.framing.col[0], @@ -1961,33 +1961,33 @@ void BL_ConvertBlenderObjects(struct Main* maggie, kxscene->SetFramingType(frame_settings); kxscene->SetGravity(MT_Vector3(0,0, -blenderscene->gm.gravity)); - + /* set activity culling parameters */ kxscene->SetActivityCulling( (blenderscene->gm.mode & WO_ACTIVITY_CULLING) != 0); kxscene->SetActivityCullingRadius(blenderscene->gm.activityBoxRadius); kxscene->SetDbvtCulling((blenderscene->gm.mode & WO_DBVT_CULLING) != 0); - + // no occlusion culling by default kxscene->SetDbvtOcclusionRes(0); int activeLayerBitInfo = blenderscene->lay; - + // list of all object converted, active and inactive CListValue* sumolist = new CListValue(); - + vector vec_parent_child; - + CListValue* objectlist = kxscene->GetObjectList(); CListValue* inactivelist = kxscene->GetInactiveList(); CListValue* parentlist = kxscene->GetRootParentList(); - + SCA_LogicManager* logicmgr = kxscene->GetLogicManager(); SCA_TimeEventManager* timemgr = kxscene->GetTimeEventManager(); - + CListValue* logicbrick_conversionlist = new CListValue(); - + //SG_TreeFactory tf; - + // Convert actions to actionmap bAction *curAct; for (curAct = (bAction*)maggie->action.first; curAct; curAct=(bAction*)curAct->id.next) @@ -2009,9 +2009,9 @@ void BL_ConvertBlenderObjects(struct Main* maggie, allblobj.insert(blenderobject); KX_GameObject* gameobj = gameobject_from_blenderobject( - base->object, - kxscene, - rendertools, + base->object, + kxscene, + rendertools, converter, libloading); @@ -2061,9 +2061,9 @@ void BL_ConvertBlenderObjects(struct Main* maggie, allblobj.insert(blenderobject); groupobj.insert(blenderobject); KX_GameObject* gameobj = gameobject_from_blenderobject( - blenderobject, - kxscene, - rendertools, + blenderobject, + kxscene, + rendertools, converter, libloading); @@ -2097,7 +2097,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, // non-camera objects not supported as camera currently if (blenderscene->camera && blenderscene->camera->type == OB_CAMERA) { KX_Camera *gamecamera= (KX_Camera*) converter->FindGameObject(blenderscene->camera); - + if (gamecamera) kxscene->SetActiveCamera(gamecamera); } @@ -2109,7 +2109,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, Object* blenderobj = *oit; if (blenderobj->type==OB_MESH) { Mesh *me = (Mesh*)blenderobj->data; - + if (me->dvert) { BL_DeformableGameObject *obj = (BL_DeformableGameObject*)converter->FindGameObject(blenderobj); @@ -2121,14 +2121,14 @@ void BL_ConvertBlenderObjects(struct Main* maggie, } } } - + // create hierarchy information int i; vector::iterator pcit; - + for (pcit = vec_parent_child.begin();!(pcit==vec_parent_child.end());++pcit) { - + struct Object* blenderchild = pcit->m_blenderchild; struct Object* blenderparent = blenderchild->parent; KX_GameObject* parentobj = converter->FindGameObject(blenderparent); @@ -2138,7 +2138,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if (!parentobj || objectlist->SearchValue(childobj) != objectlist->SearchValue(parentobj)) { - // special case: the parent and child object are not in the same layer. + // special case: the parent and child object are not in the same layer. // This weird situation is used in Apricot for test purposes. // Resolve it by not converting the child childobj->GetSGNode()->DisconnectFromParent(); @@ -2158,11 +2158,11 @@ void BL_ConvertBlenderObjects(struct Main* maggie, obj->Release(); } childrenlist->Release(); - + // now destroy recursively converter->UnregisterGameObject(childobj); // removing objects during conversion make sure this runs too kxscene->RemoveObject(childobj); - + continue; } @@ -2192,7 +2192,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, KX_BoneParentRelation *bone_parent_relation = KX_BoneParentRelation::New(parent_bone); pcit->m_gamechildnode->SetParentRelation(bone_parent_relation); } - + break; } case PARSKEL: // skinned - ignore @@ -2203,11 +2203,11 @@ void BL_ConvertBlenderObjects(struct Main* maggie, // unhandled break; } - + parentobj-> GetSGNode()->AddChild(pcit->m_gamechildnode); } vec_parent_child.clear(); - + // find 'root' parents (object that has not parents in SceneGraph) for (i=0;iGetCount();++i) { @@ -2226,7 +2226,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, for (i=0; iGetCount();i++) { KX_GameObject* gameobj = (KX_GameObject*) sumolist->GetValue(i); - if (gameobj->GetMeshCount() > 0) + if (gameobj->GetMeshCount() > 0) { MT_Point3 box[2]; gameobj->GetSGNode()->BBox().getmm(box, MT_Transform::Identity()); @@ -2322,7 +2322,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, continue; bRigidBodyJointConstraint *dat = (bRigidBodyJointConstraint *)curcon->data; - + /* Skip if no target or a child object is selected or constraints are deactivated */ if (!dat->tar || dat->child || (curcon->flag & CONSTRAINT_OFF)) continue; @@ -2336,7 +2336,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if (libloading) continue; - /* Skipped already converted constraints. + /* Skipped already converted constraints. * This will happen when a group instance is made from a linked group instance * and both are on the active layer. */ if (bl_isConstraintInList(gameobj, convertedlist)) @@ -2356,7 +2356,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, set::iterator gobit; for (gobit = convertedlist.begin(); gobit != convertedlist.end(); gobit++) (*gobit)->Release(); - + convertedlist.clear(); sumolist->Release(); @@ -2440,7 +2440,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, } logicbrick_conversionlist->Release(); - + // Calculate the scene btree - // too slow - commented out. //kxscene->SetNodeTree(tf.MakeTree()); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.h b/source/gameengine/Converter/BL_BlenderDataConversion.h index 22210cc6035..c120de85d74 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.h +++ b/source/gameengine/Converter/BL_BlenderDataConversion.h @@ -45,8 +45,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, class KX_KetsjiEngine* ketsjiEngine, e_PhysicsEngine physics_engine, class RAS_IRasterizer* rendertools, - class RAS_ICanvas* canvas, - class KX_BlenderSceneConverter* sceneconverter, + class RAS_ICanvas* canvas, + class KX_BlenderSceneConverter* sceneconverter, bool alwaysUseExpandFraming, bool libloading=false ); diff --git a/source/gameengine/Converter/BL_DeformableGameObject.cpp b/source/gameengine/Converter/BL_DeformableGameObject.cpp index 3a4a27a6722..bd29ac4d72e 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.cpp +++ b/source/gameengine/Converter/BL_DeformableGameObject.cpp @@ -73,7 +73,7 @@ bool BL_DeformableGameObject::SetActiveAction(BL_ShapeActionActuator *act, short m_activeAct = act; m_activePriority = priority; m_lastframe = curtime; - + return true; } else { @@ -91,7 +91,7 @@ bool BL_DeformableGameObject::GetShape(vector &shape) // this check is normally superfluous: a shape deformer can only be created if the mesh // has relative keys Key* key = shape_deformer->GetKey(); - if (key && key->type==KEY_RELATIVE) + if (key && key->type==KEY_RELATIVE) { KeyBlock *kb; for (kb = (KeyBlock *)key->block.first; kb; kb = (KeyBlock *)kb->next) diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h index 95e3b7c517d..6a97e57e477 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.h +++ b/source/gameengine/Converter/BL_DeformableGameObject.h @@ -45,7 +45,7 @@ class BL_ShapeActionActuator; struct Key; -class BL_DeformableGameObject : public KX_GameObject +class BL_DeformableGameObject : public KX_GameObject { public: CValue* GetReplica(); @@ -80,7 +80,7 @@ public: bool SetActiveAction(class BL_ShapeActionActuator *act, short priority, double curtime); bool GetShape(vector &shape); - + virtual void SetDeformer(class RAS_Deformer* deformer); virtual class RAS_Deformer* GetDeformer() { @@ -88,9 +88,9 @@ public: } public: - + protected: - + RAS_Deformer *m_pDeformer; class BL_ShapeActionActuator *m_activeAct; diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index 911ff245ab4..3b5f12d7b29 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -89,7 +89,7 @@ BL_MeshDeformer::~BL_MeshDeformer() if (m_transnors) delete [] m_transnors; } - + void BL_MeshDeformer::ProcessReplica() { m_transverts = NULL; @@ -146,7 +146,7 @@ void BL_MeshDeformer::RecalcNormals() const float *co2 = m_transverts[v2.getOrigIndex()]; const float *co3 = m_transverts[v3.getOrigIndex()]; const float *co4 = NULL; - + /* compute face normal */ float fnor[3], n1[3], n2[3]; @@ -230,7 +230,7 @@ void BL_MeshDeformer::VerifyStorage() delete [] m_transverts; if (m_transnors) delete [] m_transnors; - + m_transverts=new float[m_bmesh->totvert][3]; m_transnors=new float[m_bmesh->totvert][3]; m_tvtot = m_bmesh->totvert; diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index 6e84cdf03f8..f2073994a4a 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -77,12 +77,12 @@ public: protected: class RAS_MeshObject* m_pMeshObject; struct Mesh* m_bmesh; - + // this is so m_transverts doesn't need to be converted // before deformation float (*m_transverts)[3]; float (*m_transnors)[3]; - struct Object* m_objMesh; + struct Object* m_objMesh; // -- int m_tvtot; BL_DeformableGameObject* m_gameobj; diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp index b40fb7a9f47..44b24927843 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.cpp +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -136,7 +136,7 @@ struct DerivedMesh* BL_ModifierDeformer::GetPhysicsMesh() /* we need to compute the deformed mesh taking into account the current * shape and skin deformers, we cannot just call mesh_create_derived_physics() * because that would use the m_transvers already deformed previously by BL_ModifierDeformer::Update(), - * so restart from scratch by forcing a full update the shape/skin deformers + * so restart from scratch by forcing a full update the shape/skin deformers * (will do nothing if there is no such deformer) */ BL_ShapeDeformer::ForceUpdate(); BL_ShapeDeformer::Update(); diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h index 4efe4ca5bfc..7de64745534 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.h +++ b/source/gameengine/Converter/BL_ModifierDeformer.h @@ -43,7 +43,7 @@ struct DerivedMesh; struct Object; -class BL_ModifierDeformer : public BL_ShapeDeformer +class BL_ModifierDeformer : public BL_ShapeDeformer { public: static bool HasCompatibleDeformer(Object *ob); diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index f21db419ebc..38eab7d5c30 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -66,9 +66,9 @@ BL_ShapeActionActuator::BL_ShapeActionActuator(SCA_IObject* gameobj, short playtype, short blendin, short priority, - float stride) + float stride) : SCA_IActuator(gameobj, KX_ACT_SHAPEACTION), - + m_lastpos(0, 0, 0), m_blendframe(0), m_flag(0), @@ -110,7 +110,7 @@ void BL_ShapeActionActuator::SetBlendTime(float newtime) m_blendframe = newtime; } -CValue* BL_ShapeActionActuator::GetReplica() +CValue* BL_ShapeActionActuator::GetReplica() { BL_ShapeActionActuator* replica = new BL_ShapeActionActuator(*this);//m_float,GetName()); replica->ProcessReplica(); @@ -124,7 +124,7 @@ bool BL_ShapeActionActuator::ClampLocalTime() { m_localtime = m_startframe; return true; - } + } else if (m_localtime > m_endframe) { m_localtime = m_endframe; @@ -148,7 +148,7 @@ bool BL_ShapeActionActuator::ClampLocalTime() void BL_ShapeActionActuator::SetStartTime(float curtime) { float direction = m_startframe < m_endframe ? 1.0 : -1.0; - + if (!(m_flag & ACT_FLAG_REVERSE)) m_starttime = curtime - direction*(m_localtime - m_startframe)/KX_KetsjiEngine::GetAnimFrameRate(); else @@ -158,7 +158,7 @@ void BL_ShapeActionActuator::SetStartTime(float curtime) void BL_ShapeActionActuator::SetLocalTime(float curtime) { float delta_time = (curtime - m_starttime)*KX_KetsjiEngine::GetAnimFrameRate(); - + if (m_endframe < m_startframe) delta_time = -delta_time; @@ -173,10 +173,10 @@ void BL_ShapeActionActuator::BlendShape(Key* key, float srcweight) vector::const_iterator it; float dstweight; KeyBlock *kb; - + dstweight = 1.0F - srcweight; - for (it=m_blendshape.begin(), kb = (KeyBlock *)key->block.first; + for (it=m_blendshape.begin(), kb = (KeyBlock *)key->block.first; kb && it != m_blendshape.end(); kb = (KeyBlock *)kb->next, it++) { @@ -195,7 +195,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) float newweight; curtime -= KX_KetsjiEngine::GetSuspendedDelta(); - + // result = true if animation has to be continued, false if animation stops // maybe there are events for us in the queue ! if (frame) @@ -203,10 +203,10 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) bNegativeEvent = m_negevent; bPositiveEvent = m_posevent; RemoveAllEvents(); - + if (bPositiveEvent) m_flag |= ACT_FLAG_ACTIVE; - + if (bNegativeEvent) { if (!(m_flag & ACT_FLAG_ACTIVE)) @@ -214,13 +214,13 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) m_flag &= ~ACT_FLAG_ACTIVE; } } - + /* This action can only be attached to a deform object */ BL_DeformableGameObject *obj = (BL_DeformableGameObject*)GetParent(); float length = m_endframe - m_startframe; - + priority = m_priority; - + /* Determine pre-incrementation behavior and set appropriate flags */ switch (m_playtype) { case ACT_ACTION_MOTION: @@ -302,15 +302,15 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) default: break; } - + /* Perform increment */ if (keepgoing) { if (m_playtype == ACT_ACTION_MOTION) { MT_Point3 newpos; MT_Point3 deltapos; - + newpos = obj->NodeGetWorldPosition(); - + /* Find displacement */ deltapos = newpos-m_lastpos; m_localtime += (length/m_stridelength) * deltapos.length(); @@ -320,7 +320,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) SetLocalTime(curtime); } } - + /* Check if a wrapping response is needed */ if (length) { if (m_localtime < m_startframe || m_localtime > m_endframe) @@ -331,7 +331,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } else m_localtime = m_startframe; - + /* Perform post-increment tasks */ switch (m_playtype) { case ACT_ACTION_FROM_PROP: @@ -339,7 +339,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) CValue* propval = GetParent()->GetProperty(m_propname); if (propval) m_localtime = propval->GetNumber(); - + if (bNegativeEvent) { keepgoing=false; } @@ -353,7 +353,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) if (wrap) { if (!(m_flag & ACT_FLAG_REVERSE)) m_localtime = m_endframe; - else + else m_localtime = m_startframe; m_flag &= ~ACT_FLAG_LOCKINPUT; @@ -394,7 +394,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) keepgoing = false; break; } - + /* Set the property if its defined */ if (m_framepropname[0] != '\0') { CValue* propowner = GetParent(); @@ -407,10 +407,10 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } newval->Release(); } - + if (bNegativeEvent) m_blendframe=0.0f; - + /* Apply the pose if necessary*/ if (apply) { @@ -429,7 +429,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) } else { ListBase tchanbase= {NULL, NULL}; - + if (m_blendin && m_blendframe==0.0f) { // this is the start of the blending, remember the startup shape obj->GetShape(m_blendshape); @@ -448,7 +448,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) if (0) { // XXX !execute_ipochannels(&tchanbase)) { // no update, this is possible if action does not match the keys, stop the action keepgoing = false; - } + } else { // the key have changed, apply blending if needed if (m_blendin && (m_blendframeGetLogicManager()->GetActionByName(val); @@ -554,7 +554,7 @@ int BL_ShapeActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE return PY_SET_ATTR_FAIL; } } - + self->SetAction(action); return PY_SET_ATTR_SUCCESS; diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h index e96d0e0ebb4..899bbbc616d 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.h +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -39,7 +39,7 @@ #include struct Key; -class BL_ShapeActionActuator : public SCA_IActuator +class BL_ShapeActionActuator : public SCA_IActuator { public: Py_Header @@ -57,10 +57,10 @@ public: virtual bool Update(double curtime, bool frame); virtual CValue* GetReplica(); virtual void ProcessReplica(); - + void SetBlendTime (float newtime); void BlendShape(struct Key* key, float weight); - + bAction* GetAction() { return m_action; } void SetAction(bAction* act) { m_action= act; } @@ -127,7 +127,7 @@ protected: float m_starttime; /** The current time of the action */ float m_localtime; - + float m_lastUpdate; float m_blendin; float m_blendstart; diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index 94256a64d75..7653bb3f99b 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -181,7 +181,7 @@ bool BL_ShapeDeformer::Update(void) if (m_lastShapeUpdate != m_gameobj->GetLastFrame()) { /* the key coefficient have been set already, we just need to blend the keys */ Object* blendobj = m_gameobj->GetBlendObject(); - + /* we will blend the key directly in m_transverts array: it is used by armature as the start position */ /* m_key can be NULL in case of Modifier deformer */ if (m_key) { @@ -199,9 +199,9 @@ bool BL_ShapeDeformer::Update(void) m_bDynamic = true; } - // Don't release the weight array as in Blender, it will most likely be reusable on next frame + // Don't release the weight array as in Blender, it will most likely be reusable on next frame // The weight array are ultimately deleted when the skin mesh is destroyed - + /* Update the current frame */ m_lastShapeUpdate=m_gameobj->GetLastFrame(); @@ -215,7 +215,7 @@ bool BL_ShapeDeformer::Update(void) // non dynamic deformer = Modifer without armature and shape keys, no need to create storage if (!bSkinUpdate && bShapeUpdate && m_bDynamic) { - // this means that there is no armature, we still need to + // this means that there is no armature, we still need to // update the normal (was not done after shape key calculation) #ifdef __NLA_DEFNORMALS diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h index f6746dd2302..80a6f908db5 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.h +++ b/source/gameengine/Converter/BL_ShapeDeformer.h @@ -40,7 +40,7 @@ #include "BL_DeformableGameObject.h" #include -class BL_ShapeDeformer : public BL_SkinDeformer +class BL_ShapeDeformer : public BL_SkinDeformer { public: BL_ShapeDeformer(BL_DeformableGameObject *gameobj, diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index 68da99f9fa5..16700859ebe 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -58,7 +58,7 @@ extern "C"{ #include "BKE_lattice.h" #include "BKE_deform.h" } - + #include "BLI_blenlib.h" #include "BLI_math.h" @@ -188,8 +188,8 @@ void BL_SkinDeformer::BlenderDeformVerts() copy_m4_m4(m_objMesh->obmat, m_obmat); armature_deform_verts( par_arma, m_objMesh, NULL, m_transverts, NULL, m_bmesh->totvert, m_deformflags, NULL, NULL ); - - // restore matrix + + // restore matrix copy_m4_m4(m_objMesh->obmat, obmat); #ifdef __NLA_DEFNORMALS @@ -276,7 +276,7 @@ void BL_SkinDeformer::BGEDeformVerts() } } } - + // Update Vertex Normal norm = norm_chan_mat.topLeftCorner<3, 3>()*norm; diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index 79043f60db8..1feed3c3d16 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -48,7 +48,7 @@ #include "RAS_Deformer.h" -class BL_SkinDeformer : public BL_MeshDeformer +class BL_SkinDeformer : public BL_MeshDeformer { public: // void SetArmatureController (BL_ArmatureController *cont); @@ -76,13 +76,13 @@ public: bool Update (void); bool UpdateInternal (bool shape_applied); bool Apply (class RAS_IPolyMaterial *polymat); - bool UpdateBuckets(void) + bool UpdateBuckets(void) { // update the deformer and all the mesh slots; Apply() does it well, so just call it. return Apply(NULL); } bool PoseUpdated(void) - { + { if (m_armobj && m_lastArmaUpdate!=m_armobj->GetLastFrame()) { return true; } diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp index 4d344cdf16a..434f5753396 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp @@ -50,10 +50,10 @@ BL_InterpolatorList::BL_InterpolatorList(bAction *action) { if (action==NULL) return; - + for (FCurve *fcu = (FCurve *)action->curves.first; fcu; fcu = fcu->next) { if (fcu->rna_path) { - BL_ScalarInterpolator *new_ipo = new BL_ScalarInterpolator(fcu); + BL_ScalarInterpolator *new_ipo = new BL_ScalarInterpolator(fcu); //assert(new_ipo); push_back(new_ipo); } diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h index d828910233f..a82688cea20 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h @@ -46,7 +46,7 @@ public: {} virtual ~BL_ScalarInterpolator() {} - + virtual float GetValue(float currentTime) const; struct FCurve *GetFCurve() { return m_fcu; } diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 34e363b8fc2..5d9f32a0969 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -307,7 +307,7 @@ void KX_BlenderSceneConverter::RemoveScene(KX_Scene *scene) *worldit = m_worldinfos.back(); m_worldinfos.pop_back(); size--; - } + } else { i++; worldit++; @@ -323,7 +323,7 @@ void KX_BlenderSceneConverter::RemoveScene(KX_Scene *scene) *polymit = m_polymaterials.back(); m_polymaterials.pop_back(); size--; - } + } else { i++; polymit++; @@ -341,7 +341,7 @@ void KX_BlenderSceneConverter::RemoveScene(KX_Scene *scene) *matit = m_materials.back(); m_materials.pop_back(); size--; - } + } else { i++; matit++; @@ -358,7 +358,7 @@ void KX_BlenderSceneConverter::RemoveScene(KX_Scene *scene) *meshit = m_meshobjects.back(); m_meshobjects.pop_back(); size--; - } + } else { i++; meshit++; @@ -415,7 +415,7 @@ void KX_BlenderSceneConverter::SetAlwaysUseExpandFraming(bool to_what) m_alwaysUseExpandFraming= to_what; } -void KX_BlenderSceneConverter::RegisterGameObject(KX_GameObject *gameobject, Object *for_blenderobject) +void KX_BlenderSceneConverter::RegisterGameObject(KX_GameObject *gameobject, Object *for_blenderobject) { /* only maintained while converting, freed during game runtime */ m_map_blender_to_gameobject.insert(CHashedPtr(for_blenderobject), gameobject); @@ -423,7 +423,7 @@ void KX_BlenderSceneConverter::RegisterGameObject(KX_GameObject *gameobject, Obj /* only need to run this during conversion since * m_map_blender_to_gameobject is freed after conversion */ -void KX_BlenderSceneConverter::UnregisterGameObject(KX_GameObject *gameobject) +void KX_BlenderSceneConverter::UnregisterGameObject(KX_GameObject *gameobject) { Object *bobp = gameobject->GetBlenderObject(); if (bobp) { @@ -437,7 +437,7 @@ void KX_BlenderSceneConverter::UnregisterGameObject(KX_GameObject *gameobject) } } -KX_GameObject *KX_BlenderSceneConverter::FindGameObject(Object *for_blenderobject) +KX_GameObject *KX_BlenderSceneConverter::FindGameObject(Object *for_blenderobject) { KX_GameObject **obp = m_map_blender_to_gameobject[CHashedPtr(for_blenderobject)]; @@ -458,7 +458,7 @@ RAS_MeshObject *KX_BlenderSceneConverter::FindGameMesh(Mesh *for_blendermesh) if (meshp) { return *meshp; - } + } else { return NULL; } @@ -580,7 +580,7 @@ void KX_BlenderSceneConverter::ResetPhysicsObjectsAnimationIpo(bool clearIpo) localDel_ipoCurve( tmpicu ); } } - } + } else { ipo = NULL; // XXX add_ipo(blenderObject->id.name+2, ID_OB); blenderObject->ipo = ipo; @@ -637,11 +637,11 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber) const MT_Point3& position = gameObj->NodeGetWorldPosition(); //const MT_Vector3& scale = gameObj->NodeGetWorldScaling(); const MT_Matrix3x3& orn = gameObj->NodeGetWorldOrientation(); - + float eulerAngles[3]; float eulerAnglesOld[3] = {0.0f, 0.0f, 0.0f}; float tmat[3][3]; - + // XXX animato Ipo* ipo = blenderObject->ipo; @@ -677,23 +677,23 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber) icu_rz = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Z, 1); if (icu_rz) icu_rz->ipo = IPO_LIN; } - + if (icu_rx) eulerAnglesOld[0] = eval_icu( icu_rx, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); if (icu_ry) eulerAnglesOld[1] = eval_icu( icu_ry, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); if (icu_rz) eulerAnglesOld[2] = eval_icu( icu_rz, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); - + // orn.getValue((float *)tmat); // uses the wrong ordering, cant use this for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) tmat[r][c] = orn[c][r]; - + // mat3_to_eul( eulerAngles,tmat); // better to use Mat3ToCompatibleEul mat3_to_compatible_eul( eulerAngles, eulerAnglesOld,tmat); - + //eval_icu for (int x = 0; x < 3; x++) eulerAngles[x] *= (float) ((180 / 3.14159265f) / 10.0); - + //fill the curves with data if (icu_lx) insert_vert_icu(icu_lx, frameNumber, position.x(), 1); if (icu_ly) insert_vert_icu(icu_ly, frameNumber, position.y(), 1); @@ -701,7 +701,7 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber) if (icu_rx) insert_vert_icu(icu_rx, frameNumber, eulerAngles[0], 1); if (icu_ry) insert_vert_icu(icu_ry, frameNumber, eulerAngles[1], 1); if (icu_rz) insert_vert_icu(icu_rz, frameNumber, eulerAngles[2], 1); - + // Handles are corrected at the end, testhandles_ipocurve isn't needed yet #endif } @@ -775,7 +775,7 @@ Main *KX_BlenderSceneConverter::GetMainDynamicPath(const char *path) for (vector
::iterator it = m_DynamicMaggie.begin(); !(it == m_DynamicMaggie.end()); it++) if (BLI_path_cmp((*it)->name, path) == 0) return *it; - + return NULL; } @@ -868,7 +868,7 @@ static void load_datablocks(Main *main_tmp, BlendHandle *bpy_openlib, const char int totnames_dummy; names = BLO_blendhandle_get_datablock_names(bpy_openlib, idcode, &totnames_dummy); - + int i = 0; LinkNode *n = names; while (n) { @@ -897,7 +897,7 @@ KX_LibLoadStatus *KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openl BLO_blendhandle_close(bpy_openlib); return NULL; } - + if (GetMainDynamicPath(path)) { snprintf(err_local, sizeof(err_local), "blend file already open \"%s\"\n", path); *err_str = err_local; @@ -935,18 +935,18 @@ KX_LibLoadStatus *KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openl BKE_reports_clear(&reports); /* done linking */ - + /* needed for lookups*/ GetMainDynamic().push_back(main_newlib); BLI_strncpy(main_newlib->name, path, sizeof(main_newlib->name)); - - + + status = new KX_LibLoadStatus(this, m_ketsjiEngine, scene_merge, path); if (idcode == ID_ME) { /* Convert all new meshes into BGE meshes */ ID *mesh; - + for (mesh = (ID *)main_newlib->mesh.first; mesh; mesh = (ID *)mesh->next ) { if (options & LIB_LOAD_VERBOSE) printf("MeshName: %s\n", mesh->name + 2); @@ -973,15 +973,15 @@ KX_LibLoadStatus *KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openl for (scene = (ID *)main_newlib->scene.first; scene; scene = (ID *)scene->next ) { if (options & LIB_LOAD_VERBOSE) printf("SceneName: %s\n", scene->name + 2); - + if (options & LIB_LOAD_ASYNC) { scenes->push_back((Scene *)scene); - } + } else { /* merge into the base scene */ KX_Scene* other = m_ketsjiEngine->CreateScene((Scene *)scene, true); scene_merge->MergeScene(other); - + // RemoveScene(other); // Don't run this, it frees the entire scene converter data, just delete the scene delete other; } @@ -1077,7 +1077,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(Main *maggie) /* in case the mesh might be refered to later */ { CTR_Map &mapStringToMeshes = scene->GetLogicManager()->GetMeshMap(); - + for (int i = 0; i < mapStringToMeshes.size(); i++) { RAS_MeshObject *meshobj = (RAS_MeshObject *) *mapStringToMeshes.at(i); if (meshobj && IS_TAGGED(meshobj->GetMesh())) { @@ -1104,7 +1104,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(Main *maggie) } } } - + //scene->FreeTagged(); /* removed tagged objects and meshes*/ CListValue *obj_lists[] = {scene->GetObjectList(), scene->GetInactiveList(), NULL}; @@ -1201,7 +1201,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(Main *maggie) *worldit = m_worldinfos.back(); m_worldinfos.pop_back(); size--; - } + } else { i++; worldit++; @@ -1260,7 +1260,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(Main *maggie) *matit = m_materials.back(); m_materials.pop_back(); size--; - } + } else { i++; matit++; @@ -1308,7 +1308,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(Main *maggie) *meshit = m_meshobjects.back(); m_meshobjects.pop_back(); size--; - } + } else { i++; meshit++; diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h index 40c71a4d74b..3379f00c38a 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.h +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h @@ -76,16 +76,16 @@ class KX_BlenderSceneConverter : public KX_ISceneConverter // Saved KX_LibLoadStatus objects map m_status_map; - // Should also have a list of collision shapes. + // Should also have a list of collision shapes. // For the time being this is held in KX_Scene::m_shapes CTR_Map m_map_blender_to_gameobject; /* cleared after conversion */ CTR_Map m_map_mesh_to_gamemesh; /* cleared after conversion */ CTR_Map m_map_blender_to_gameactuator; /* cleared after conversion */ CTR_Mapm_map_blender_to_gamecontroller; /* cleared after conversion */ - + CTR_Map m_map_blender_to_gameAdtList; - + Main* m_maggie; vector m_DynamicMaggie; @@ -121,7 +121,7 @@ public: bool TryAndLoadNewFile(); void SetAlwaysUseExpandFraming(bool to_what); - + void RegisterGameObject(KX_GameObject *gameobject, struct Object *for_blenderobject); void UnregisterGameObject(KX_GameObject *gameobject); KX_GameObject *FindGameObject(struct Object *for_blenderobject); @@ -136,7 +136,7 @@ public: void RegisterBlenderMaterial(BL_Material *mat); void CacheBlenderMaterial(KX_Scene *scene, Material *mat, BL_Material *blmat); BL_Material *FindCachedBlenderMaterial(KX_Scene *scene, Material *mat); - + void RegisterInterpolatorList(BL_InterpolatorList *actList, struct bAction *for_act); BL_InterpolatorList *FindInterpolatorList(struct bAction *for_act); @@ -152,7 +152,7 @@ public: ///this is for reseting the position,rotation and scale of the gameobjet that is not dynamic virtual void resetNoneDynamicObjectToIpo(); - + ///this generates ipo curves for position, rotation, allowing to use game physics in animation virtual void WritePhysicsObjectToAnimationIpo(int frameNumber); virtual void TestHandlesPhysicsObjectToAnimationIpo(); @@ -174,7 +174,7 @@ public: // struct Main* GetMain() { return m_maggie; } struct Main* GetMainDynamicPath(const char *path); vector &GetMainDynamic(); - + class KX_LibLoadStatus *LinkBlendFileMemory(void *data, int length, const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options); class KX_LibLoadStatus *LinkBlendFilePath(const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options); class KX_LibLoadStatus *LinkBlendFile(struct BlendHandle *bpy_openlib, const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options); @@ -186,7 +186,7 @@ public: virtual void MergeAsyncLoads(); virtual void FinalizeAsyncLoads(); void AddScenesToMergeQueue(class KX_LibLoadStatus *status); - + void PrintStats() { printf("BGE STATS!\n"); @@ -208,9 +208,9 @@ public: #endif // /printf("\t m_ketsjiEngine->m_scenes: %d\n", m_ketsjiEngine->CurrentScenes()->size()); } - + /* LibLoad Options */ - enum + enum { LIB_LOAD_LOAD_ACTIONS = 1, LIB_LOAD_VERBOSE = 2, @@ -223,7 +223,7 @@ public: #ifdef WITH_PYTHON PyObject *GetPyNamespace(); #endif - + #ifdef WITH_CXX_GUARDEDALLOC MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_BlenderSceneConverter") #endif diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 974dcbca95b..d4582425b36 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -102,7 +102,7 @@ #include "BL_BlenderDataConversion.h" -/** +/** * KX_flt_trunc needed to round 'almost' zero values to zero, else velocities etc. are incorrectly set */ @@ -122,7 +122,7 @@ void BL_ConvertActuators(const char* maggiename, KX_BlenderSceneConverter* converter ) { - + int uniqueint = 0; int actcount = 0; int executePriority = 0; @@ -138,7 +138,7 @@ void BL_ConvertActuators(const char* maggiename, { STR_String uniquename = bact->name; STR_String& objectname = gameobj->GetName(); - + SCA_IActuator* baseact = NULL; switch (bact->type) { @@ -168,9 +168,9 @@ void BL_ConvertActuators(const char* maggiename, /* Blender uses a bit vector internally for the local-flags. In */ /* KX, we have four bools. The compiler should be smart enough */ /* to do the right thing. We need to explicitly convert here! */ - + KX_LocalFlags bitLocalFlag; - + bitLocalFlag.Force = bool((obact->flag & ACT_FORCE_LOCAL)!=0); bitLocalFlag.Torque = bool((obact->flag & ACT_TORQUE_LOCAL) !=0);//rlocal; bitLocalFlag.DLoc = bool((obact->flag & ACT_DLOC_LOCAL)!=0); @@ -186,7 +186,7 @@ void BL_ConvertActuators(const char* maggiename, { obref = converter->FindGameObject(obact->reference); } - + KX_ObjectActuator* tmpbaseact = new KX_ObjectActuator( gameobj, obref, @@ -214,7 +214,7 @@ void BL_ConvertActuators(const char* maggiename, if (actact->flag & ACT_IPOLOCAL) ipo_flags |= BL_Action::ACT_IPOFLAG_LOCAL; if (actact->flag & ACT_IPOADD) ipo_flags |= BL_Action::ACT_IPOFLAG_ADD; if (actact->flag & ACT_IPOCHILD) ipo_flags |= BL_Action::ACT_IPOFLAG_CHILD; - + BL_ActionActuator* tmpbaseact = new BL_ActionActuator( gameobj, propname, @@ -242,7 +242,7 @@ void BL_ConvertActuators(const char* maggiename, bActionActuator* actact = (bActionActuator*) bact->data; STR_String propname = actact->name; STR_String propframe = actact->frameProp; - + BL_ShapeActionActuator* tmpbaseact = new BL_ShapeActionActuator( gameobj, propname, @@ -270,8 +270,8 @@ void BL_ConvertActuators(const char* maggiename, bCameraActuator *camact = (bCameraActuator *) bact->data; if (camact->ob) { KX_GameObject *tmpgob = converter->FindGameObject(camact->ob); - - /* visifac, fac and axis are not copied from the struct... */ + + /* visifac, fac and axis are not copied from the struct... */ /* that's some internal state... */ KX_CameraActuator *tmpcamact = new KX_CameraActuator( gameobj, @@ -288,16 +288,16 @@ void BL_ConvertActuators(const char* maggiename, case ACT_MESSAGE: { bMessageActuator *msgAct = (bMessageActuator *) bact->data; - + /* Get the name of the properties that objects must own that * we're sending to, if present */ STR_String toPropName = msgAct->toPropName; - + /* Get the Message Subject to send. */ STR_String subject = msgAct->subject; - + /* Get the bodyType */ int bodyType = msgAct->bodyType; @@ -306,7 +306,7 @@ void BL_ConvertActuators(const char* maggiename, * we'll be sending, might be empty */ const STR_String body = msgAct->body; - + KX_NetworkMessageActuator *tmpmsgact = new KX_NetworkMessageActuator( gameobj, // actuator controlling object scene->GetNetworkScene(), // needed for replication @@ -327,7 +327,7 @@ void BL_ConvertActuators(const char* maggiename, /* get type, and possibly a start and end frame */ KX_SoundActuator::KX_SOUNDACT_TYPE soundActuatorType = KX_SoundActuator::KX_SOUNDACT_NODEF; - + switch (soundact->type) { case ACT_SND_PLAY_STOP_SOUND: soundActuatorType = KX_SoundActuator::KX_SOUNDACT_PLAYSTOP; @@ -347,13 +347,13 @@ void BL_ConvertActuators(const char* maggiename, case ACT_SND_LOOP_BIDIRECTIONAL_STOP_SOUND: soundActuatorType = KX_SoundActuator::KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP; break; - + default: /* This is an error!!! */ soundActuatorType = KX_SoundActuator::KX_SOUNDACT_NODEF; } - - if (soundActuatorType != KX_SoundActuator::KX_SOUNDACT_NODEF) + + if (soundActuatorType != KX_SoundActuator::KX_SOUNDACT_NODEF) { bSound* sound = soundact->sound; bool is3d = soundact->flag & ACT_SND_3D_SOUND ? true : false; @@ -407,7 +407,7 @@ void BL_ConvertActuators(const char* maggiename, { bPropertyActuator* propact = (bPropertyActuator*) bact->data; SCA_IObject* destinationObj = NULL; - + /* * here the destinationobject is searched. problem with multiple scenes: other scenes * have not been converted yet, so the destobj will not be found, so the prop will @@ -418,7 +418,7 @@ void BL_ConvertActuators(const char* maggiename, */ if (propact->ob) destinationObj = converter->FindGameObject(propact->ob); - + SCA_PropertyActuator* tmppropact = new SCA_PropertyActuator( gameobj, destinationObj, @@ -431,16 +431,16 @@ void BL_ConvertActuators(const char* maggiename, } case ACT_EDIT_OBJECT: { - bEditObjectActuator *editobact + bEditObjectActuator *editobact = (bEditObjectActuator *) bact->data; /* There are four different kinds of 'edit object' thingies */ /* The alternative to this lengthy conversion is packing */ /* several actuators in one, which is not very nice design.. */ switch (editobact->type) { - case ACT_EDOB_ADD_OBJECT: + case ACT_EDOB_ADD_OBJECT: { - - // does the 'original' for replication exists, and + + // does the 'original' for replication exists, and // is it in a non-active layer ? SCA_IObject* originalval = NULL; if (editobact->ob) @@ -453,7 +453,7 @@ void BL_ConvertActuators(const char* maggiename, originalval = converter->FindGameObject(editobact->ob); } } - + KX_SCA_AddObjectActuator* tmpaddact = new KX_SCA_AddObjectActuator( gameobj, originalval, @@ -470,7 +470,7 @@ void BL_ConvertActuators(const char* maggiename, break; case ACT_EDOB_END_OBJECT: { - KX_SCA_EndObjectActuator* tmpendact + KX_SCA_EndObjectActuator* tmpendact = new KX_SCA_EndObjectActuator(gameobj,scene); baseact = tmpendact; } @@ -501,7 +501,7 @@ void BL_ConvertActuators(const char* maggiename, SCA_IObject* originalval = NULL; if (editobact->ob) originalval = converter->FindGameObject(editobact->ob); - + KX_TrackToActuator* tmptrackact = new KX_TrackToActuator( gameobj, originalval, @@ -528,10 +528,10 @@ void BL_ConvertActuators(const char* maggiename, float min = 0.0, max = 0.0; char *prop = NULL; KX_ConstraintActuator::KX_CONSTRAINTTYPE locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_NODEF; - bConstraintActuator *conact + bConstraintActuator *conact = (bConstraintActuator*) bact->data; - /* convert settings... degrees in the ui become radians */ - /* internally */ + /* convert settings... degrees in the ui become radians */ + /* internally */ if (conact->type == ACT_CONST_TYPE_ORI) { min = conact->minloc[0]; max = conact->maxloc[0]; @@ -617,12 +617,12 @@ void BL_ConvertActuators(const char* maggiename, } else { switch (conact->flag) { case ACT_CONST_LOCX: - locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCX; + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCX; min = conact->minloc[0]; max = conact->maxloc[0]; break; case ACT_CONST_LOCY: - locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCY; + locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCY; min = conact->minloc[1]; max = conact->maxloc[1]; break; @@ -647,7 +647,7 @@ void BL_ConvertActuators(const char* maggiename, max = conact->maxrot[2] * (float)MT_RADS_PER_DEG; break; default: - ; /* error */ + ; /* error */ } } KX_ConstraintActuator *tmpconact = new KX_ConstraintActuator( @@ -673,7 +673,7 @@ void BL_ConvertActuators(const char* maggiename, { bSceneActuator *sceneact = (bSceneActuator *) bact->data; STR_String nextSceneName(""); - + KX_SceneActuator* tmpsceneact; int mode = KX_SceneActuator::KX_SCENE_NODEF; KX_Camera *cam = NULL; @@ -709,11 +709,11 @@ void BL_ConvertActuators(const char* maggiename, mode = KX_SceneActuator::KX_SCENE_SET_SCENE; break; }; - + if (sceneact->scene) { nextSceneName = sceneact->scene->id.name + 2; } - + break; } case ACT_SCENE_CAMERA: @@ -727,7 +727,7 @@ void BL_ConvertActuators(const char* maggiename, break; case ACT_SCENE_RESTART: { - + mode = KX_SceneActuator::KX_SCENE_RESTART; break; } @@ -809,21 +809,21 @@ void BL_ConvertActuators(const char* maggiename, } case ACT_RANDOM: { - bRandomActuator *randAct + bRandomActuator *randAct = (bRandomActuator *) bact->data; - + unsigned long seedArg = randAct->seed; if (seedArg == 0) { seedArg = (int)(ketsjiEngine->GetRealTime()*100000.0); seedArg ^= (intptr_t)randAct; } - SCA_RandomActuator::KX_RANDOMACT_MODE modeArg + SCA_RandomActuator::KX_RANDOMACT_MODE modeArg = SCA_RandomActuator::KX_RANDOMACT_NODEF; SCA_RandomActuator *tmprandomact; float paraArg1 = 0.0; float paraArg2 = 0.0; - + switch (randAct->distribution) { case ACT_RANDOM_BOOL_CONST: modeArg = SCA_RandomActuator::KX_RANDOMACT_BOOL_CONST; @@ -890,7 +890,7 @@ void BL_ConvertActuators(const char* maggiename, bool recursive = ((vis_act->flag & ACT_VISIBILITY_RECURSIVE) != 0); tmp_vis_act = new KX_VisibilityActuator(gameobj, !v, o, recursive); - + baseact = tmp_vis_act; } break; @@ -900,9 +900,9 @@ void BL_ConvertActuators(const char* maggiename, bStateActuator *sta_act = (bStateActuator *) bact->data; KX_StateActuator * tmp_sta_act = NULL; - tmp_sta_act = + tmp_sta_act = new KX_StateActuator(gameobj, sta_act->type, sta_act->mask); - + baseact = tmp_sta_act; } break; @@ -1004,7 +1004,7 @@ void BL_ConvertActuators(const char* maggiename, tmpgob = NULL; break; } - + KX_ParentActuator *tmpparact = new KX_ParentActuator(gameobj, mode, @@ -1014,7 +1014,7 @@ void BL_ConvertActuators(const char* maggiename, baseact = tmpparact; break; } - + case ACT_ARMATURE: { bArmatureActuator* armAct = (bArmatureActuator*) bact->data; @@ -1064,8 +1064,8 @@ void BL_ConvertActuators(const char* maggiename, bool normalup = (stAct->flag & ACT_STEERING_NORMALUP) !=0; bool lockzvel = (stAct->flag & ACT_STEERING_LOCKZVEL) !=0; KX_SteeringActuator *tmpstact - = new KX_SteeringActuator(gameobj, mode, targetob, navmeshob,stAct->dist, - stAct->velocity, stAct->acceleration, stAct->turnspeed, + = new KX_SteeringActuator(gameobj, mode, targetob, navmeshob,stAct->dist, + stAct->velocity, stAct->acceleration, stAct->turnspeed, selfTerminated, stAct->updateTime, scene->GetObstacleSimulation(), facingMode, normalup, enableVisualization, lockzvel); baseact = tmpstact; @@ -1118,7 +1118,7 @@ void BL_ConvertActuators(const char* maggiename, default: ; /* generate some error */ } - + if (baseact && !(bact->flag & ACT_DEACTIVATE)) { baseact->SetExecutePriority(executePriority++); @@ -1131,14 +1131,14 @@ void BL_ConvertActuators(const char* maggiename, baseact->SetLogicManager(logicmgr); //gameobj->SetProperty(uniquename,baseact); gameobj->AddActuator(baseact); - + converter->RegisterGameActuator(baseact, bact); // done with baseact, release it baseact->Release(); } else if (baseact) baseact->Release(); - + bact = bact->next; } } diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp index f55d81adb80..a00a90428da 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.cpp +++ b/source/gameengine/Converter/KX_ConvertControllers.cpp @@ -161,7 +161,7 @@ void BL_ConvertControllers( // When libloading, this is delayed to KX_Scene::MergeScene_LogicBrick to avoid GIL issues if (!libloading) pyctrl->SetNamespace(converter->GetPyNamespace()); - + if (pycont->mode==SCA_PythonController::SCA_PYEXEC_SCRIPT) { if (pycont->text) { @@ -174,12 +174,12 @@ void BL_ConvertControllers( pyctrl->SetScriptName(pycont->text->id.name+2); MEM_freeN(buf); } - + } } else { /* let the controller print any warnings here when importing */ - pyctrl->SetScriptText(STR_String(pycont->module)); + pyctrl->SetScriptText(STR_String(pycont->module)); pyctrl->SetScriptName(pycont->module); /* will be something like module.func so using it as the name is OK */ if (pycont->flag & CONT_PY_DEBUG) { @@ -193,7 +193,7 @@ void BL_ConvertControllers( } default: { - + } } @@ -216,7 +216,7 @@ void BL_ConvertControllers( gamecontroller->SetName(bcontr->name); gamecontroller->SetLogicManager(logicmgr); gameobj->AddController(gamecontroller); - + converter->RegisterGameController(gamecontroller, bcontr); #ifdef WITH_PYTHON @@ -231,7 +231,7 @@ void BL_ConvertControllers( /* We cant do this because importing runs the script which could end up accessing * internal BGE functions, this is unstable while we're converting the scene. * This is a pity because its useful to see errors at startup but cant help it */ - + // pyctrl->Import(); } } @@ -243,7 +243,7 @@ void BL_ConvertControllers( } else if (gamecontroller) gamecontroller->Release(); - + bcontr = bcontr->next; } diff --git a/source/gameengine/Converter/KX_ConvertControllers.h b/source/gameengine/Converter/KX_ConvertControllers.h index 2f93d70a6f9..b5bc4148e1a 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.h +++ b/source/gameengine/Converter/KX_ConvertControllers.h @@ -39,7 +39,7 @@ void BL_ConvertControllers( class KX_GameObject* gameobj, class SCA_LogicManager* logicmgr, int activeLayerBitInfo, - bool isInActiveLayer, + bool isInActiveLayer, class KX_BlenderSceneConverter* converter, bool libloading ); diff --git a/source/gameengine/Converter/KX_ConvertProperties.cpp b/source/gameengine/Converter/KX_ConvertProperties.cpp index 2cb61207fb5..5dd7d0e4066 100644 --- a/source/gameengine/Converter/KX_ConvertProperties.cpp +++ b/source/gameengine/Converter/KX_ConvertProperties.cpp @@ -65,7 +65,7 @@ void BL_ConvertTextProperty(Object* object, KX_FontObject* fontobj,SCA_TimeEvent void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventManager* timemgr,SCA_IScene* scene, bool isInActiveLayer) { - + bProperty* prop = (bProperty*)object->prop.first; CValue* propval; bool show_debug_info; @@ -108,8 +108,8 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan float floatprop = *((float*)&prop->data); CValue* timeval = new CFloatValue(floatprop); - // set a subproperty called 'timer' so that - // we can register the replica of this property + // set a subproperty called 'timer' so that + // we can register the replica of this property // at the time a game object is replicated (AddObjectActuator triggers this) CValue *bval = new CBoolValue(true); timeval->SetProperty("timer",bval); @@ -118,7 +118,7 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan { timemgr->AddTimeProperty(timeval); } - + propval = timeval; gameobj->SetProperty(prop->name,timeval); @@ -128,7 +128,7 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan // todo make an assert etc. } } - + if (propval) { if (show_debug_info && isInActiveLayer) @@ -138,7 +138,7 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan // done with propval, release it propval->Release(); } - + #ifdef WITH_PYTHON /* Warn if we double up on attributes, this isn't quite right since it wont find inherited attributes however there arnt many */ for (PyAttributeDef *attrdef = KX_GameObject::Attributes; attrdef->m_name; attrdef++) { diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index 5e897bb4a62..618be1e1c9b 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -109,7 +109,7 @@ void BL_ConvertSensors(struct Object* blenderobject, bool invert = false; bool level = false; bool tap = false; - + while (sens) { sens = sens->next; diff --git a/source/gameengine/Converter/KX_ConvertSensors.h b/source/gameengine/Converter/KX_ConvertSensors.h index 56248721a37..2ed2c9b3226 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.h +++ b/source/gameengine/Converter/KX_ConvertSensors.h @@ -39,7 +39,7 @@ void BL_ConvertSensors(struct Object* blenderobject, class KX_KetsjiEngine* kxengine, int activeLayerBitInfo, bool isInActiveLayer, - class RAS_ICanvas* canvas, + class RAS_ICanvas* canvas, class KX_BlenderSceneConverter* converter); #endif /* __KX_CONVERTSENSORS_H__ */ diff --git a/source/gameengine/Converter/KX_LibLoadStatus.cpp b/source/gameengine/Converter/KX_LibLoadStatus.cpp index 66fcd998269..c43958ebc85 100644 --- a/source/gameengine/Converter/KX_LibLoadStatus.cpp +++ b/source/gameengine/Converter/KX_LibLoadStatus.cpp @@ -148,7 +148,7 @@ void KX_LibLoadStatus::AddProgress(float progress) #ifdef WITH_PYTHON -PyMethodDef KX_LibLoadStatus::Methods[] = +PyMethodDef KX_LibLoadStatus::Methods[] = { {NULL} //Sentinel }; @@ -189,7 +189,7 @@ PyTypeObject KX_LibLoadStatus::Type = { PyObject* KX_LibLoadStatus::pyattr_get_onfinish(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_LibLoadStatus* self = static_cast(self_v); - + if (self->m_finish_cb) { Py_INCREF(self->m_finish_cb); return self->m_finish_cb; @@ -219,7 +219,7 @@ int KX_LibLoadStatus::pyattr_set_onfinish(void *self_v, const KX_PYATTRIBUTE_DEF PyObject* KX_LibLoadStatus::pyattr_get_onprogress(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_LibLoadStatus* self = static_cast(self_v); - + if (self->m_progress_cb) { Py_INCREF(self->m_progress_cb); return self->m_progress_cb; diff --git a/source/gameengine/Converter/KX_SoftBodyDeformer.cpp b/source/gameengine/Converter/KX_SoftBodyDeformer.cpp index 877aebff556..6c8b7fc3e29 100644 --- a/source/gameengine/Converter/KX_SoftBodyDeformer.cpp +++ b/source/gameengine/Converter/KX_SoftBodyDeformer.cpp @@ -92,7 +92,7 @@ bool KX_SoftBodyDeformer::Apply(class RAS_IPolyMaterial *polymat) slot = *mmat->m_slots[(void*)m_gameobj]; // for each array - for (slot->begin(it); !slot->end(it); slot->next(it)) + for (slot->begin(it); !slot->end(it); slot->next(it)) { btSoftBody::tNodeArray& nodes(softBody->m_nodes); diff --git a/source/gameengine/Converter/KX_SoftBodyDeformer.h b/source/gameengine/Converter/KX_SoftBodyDeformer.h index d7bc088e1c0..cc7f81ce0c7 100644 --- a/source/gameengine/Converter/KX_SoftBodyDeformer.h +++ b/source/gameengine/Converter/KX_SoftBodyDeformer.h @@ -68,7 +68,7 @@ public: } virtual bool UpdateBuckets(void) { - // this is to update the mesh slots outside the rasterizer, + // this is to update the mesh slots outside the rasterizer, // no need to do it for this deformer, it's done in any case in Apply() return false; } -- cgit v1.2.3