Skip to content

Commit

Permalink
UPBGE: Use CListValue instead of SG_DList in BL_ArmatureObject.
Browse files Browse the repository at this point in the history
  • Loading branch information
panzergame committed Jan 11, 2017
1 parent 07066a3 commit 3cd6c7c
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 146 deletions.
2 changes: 1 addition & 1 deletion source/gameengine/Converter/BL_ArmatureChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ PyObject *BL_ArmatureChannel::NewProxy(bool py_owns)
BL_ArmatureChannel::BL_ArmatureChannel(
BL_ArmatureObject *armature,
bPoseChannel *posechannel)
: PyObjectPlus(), m_posechannel(posechannel), m_armature(armature)
:m_posechannel(posechannel), m_armature(armature)
{
}

Expand Down
8 changes: 3 additions & 5 deletions source/gameengine/Converter/BL_ArmatureChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
#define __BL_ARMATURECHANNEL_H__

#include "DNA_action_types.h"
#include "EXP_PyObjectPlus.h"

#include "SG_QList.h"
#include "EXP_Value.h"

class SCA_IObject;
class KX_GameObject;
Expand All @@ -45,7 +43,7 @@ struct bPoseChannel;
struct Object;
struct bPose;

class BL_ArmatureChannel : public PyObjectPlus, public SG_QList
class BL_ArmatureChannel : public CValue
{
// use Py_HeaderPtr since we use generic pointer in proxy
Py_HeaderPtr;
Expand All @@ -60,7 +58,7 @@ class BL_ArmatureChannel : public PyObjectPlus, public SG_QList
struct bPoseChannel *posechannel);
virtual ~BL_ArmatureChannel();

inline const char *GetName()
virtual std::string GetName()
{
return m_posechannel->name;
}
Expand Down
7 changes: 4 additions & 3 deletions source/gameengine/Converter/BL_ArmatureConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ BL_ArmatureConstraint::BL_ArmatureConstraint(
bConstraint *constraint,
KX_GameObject* target,
KX_GameObject* subtarget)
: PyObjectPlus(), m_constraint(constraint), m_posechannel(posechannel), m_armature(armature)
:m_constraint(constraint), m_posechannel(posechannel), m_armature(armature)
{
m_target = target;
m_blendtarget = (target) ? target->GetBlenderObject() : NULL;
Expand Down Expand Up @@ -107,10 +107,11 @@ BL_ArmatureConstraint::~BL_ArmatureConstraint()
m_subtarget->UnregisterObject(m_armature);
}

BL_ArmatureConstraint* BL_ArmatureConstraint::GetReplica() const
CValue *BL_ArmatureConstraint::GetReplica()
{
BL_ArmatureConstraint* replica = new BL_ArmatureConstraint(*this);
BL_ArmatureConstraint *replica = new BL_ArmatureConstraint(*this);
replica->ProcessReplica();

return replica;
}

Expand Down
14 changes: 4 additions & 10 deletions source/gameengine/Converter/BL_ArmatureConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
#define __BL_ARMATURECONSTRAINT_H__

#include "DNA_constraint_types.h"
#include "EXP_PyObjectPlus.h"
#include "EXP_Value.h"

#include "SG_QList.h"
#include <map>

class SCA_IObject;
Expand All @@ -46,12 +45,7 @@ struct bPoseChannel;
struct Object;
struct bPose;

/**
* SG_DList : element of controlled constraint list
* head = BL_ArmatureObject::m_controlledConstraints
* SG_QList : not used
*/
class BL_ArmatureConstraint : public PyObjectPlus, public SG_QList
class BL_ArmatureConstraint : public CValue
{
Py_Header

Expand All @@ -77,7 +71,7 @@ class BL_ArmatureConstraint : public PyObjectPlus, public SG_QList
KX_GameObject* subtarget);
virtual ~BL_ArmatureConstraint();

BL_ArmatureConstraint* GetReplica() const;
virtual CValue *GetReplica();
void ReParent(BL_ArmatureObject* armature);
void Relink(std::map<void *, void *>& map);
bool UnlinkObject(SCA_IObject* clientobj);
Expand All @@ -86,7 +80,7 @@ class BL_ArmatureConstraint : public PyObjectPlus, public SG_QList
void RestoreTarget();

bool Match(const std::string& posechannel, const std::string& constraint);
const std::string& GetName() { return m_name; }
virtual std::string GetName() { return m_name; }

void SetConstraintFlag(int flag)
{
Expand Down
Loading

0 comments on commit 3cd6c7c

Please sign in to comment.