Skip to content

Commit 462a705

Browse files
committed
UPBGE: Fix duplication of action actuator.
Before the action actuator a member m_lastUpdate was used in the update process of the actuator, when the actuator was duplicated this member was set to -1 as for the constructor of the actuator. The refactor removed this member because it was redundant, but nothing compensated it during the duplication of the actuator. To do so the flag of the actuator is reset to 0 excepted for continue flag, as again the actuator constructor. In the same time unused members of the action actuator were removed and the python attribute blendTime which was inffective since BFBGE was removed.
1 parent f855e5c commit 462a705

File tree

5 files changed

+8
-36
lines changed

5 files changed

+8
-36
lines changed

doc/python_api/rst/bge_types/bge.types.BL_ActionActuator.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ base class --- :class:`SCA_IActuator`
5151

5252
:type: string
5353

54-
.. attribute:: blendTime
55-
56-
Sets the internal frame timer. This property must be in the range from 0.0 to blendIn.
57-
58-
:type: float
59-
6054
.. attribute:: mode
6155

6256
The operation mode of the actuator. Can be one of :ref:`these constants<action-actuator>`.

source/blender/makesdna/DNA_actuator_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ typedef struct bActionActuator {
6060
short end_reset; /* Ending the actuator (negative pulse) wont reset the action to its starting frame */
6161
short strideaxis; /* Displacement axis */
6262
short blend_mode; /* Layer blending mode */
63-
float stridelength; /* Displacement incurred by cycle */ // not in use
6463
float layer_weight; /* How much of the previous layer to use for blending. (<0 = disable, 0 = add mode) */
64+
int pad;
6565
} bActionActuator;
6666

6767
typedef struct Sound3D {

source/gameengine/Converter/BL_ActionActuator.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,13 @@ BL_ActionActuator::BL_ActionActuator(SCA_IObject *gameobj,
7272
short layer,
7373
float layer_weight,
7474
short ipo_flags,
75-
short end_reset,
76-
float stride)
77-
: SCA_IActuator(gameobj, KX_ACT_ACTION),
78-
m_blendframe(0),
75+
short end_reset)
76+
:SCA_IActuator(gameobj, KX_ACT_ACTION),
7977
m_flag(0),
80-
m_startframe (starttime),
78+
m_startframe(starttime),
8179
m_endframe(endtime) ,
8280
m_localtime(starttime),
8381
m_blendin(blendin),
84-
m_blendstart(0),
85-
m_stridelength(stride),
8682
m_layer_weight(layer_weight),
8783
m_playtype(playtype),
8884
m_blendmode(blend_mode),
@@ -105,7 +101,8 @@ void BL_ActionActuator::ProcessReplica()
105101
{
106102
SCA_IActuator::ProcessReplica();
107103

108-
m_localtime = m_startframe;
104+
m_flag = m_flag & ACT_FLAG_CONTINUE;
105+
m_localtime = m_startframe;
109106
}
110107

111108
EXP_Value* BL_ActionActuator::GetReplica()
@@ -332,7 +329,6 @@ PyAttributeDef BL_ActionActuator::Attributes[] = {
332329
EXP_PYATTRIBUTE_STRING_RW("propName", 0, MAX_PROP_NAME, false, BL_ActionActuator, m_propname),
333330
EXP_PYATTRIBUTE_STRING_RW("framePropName", 0, MAX_PROP_NAME, false, BL_ActionActuator, m_framepropname),
334331
EXP_PYATTRIBUTE_RW_FUNCTION("useContinue", BL_ActionActuator, pyattr_get_use_continue, pyattr_set_use_continue),
335-
EXP_PYATTRIBUTE_FLOAT_RW_CHECK("blendTime", 0, MAXFRAMEF, BL_ActionActuator, m_blendframe, CheckBlendTime),
336332
EXP_PYATTRIBUTE_SHORT_RW_CHECK("mode",0,100,false,BL_ActionActuator,m_playtype,CheckType),
337333
EXP_PYATTRIBUTE_NULL //Sentinel
338334
};

source/gameengine/Converter/BL_ActionActuator.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ class BL_ActionActuator : public SCA_IActuator
5353
short layer,
5454
float layer_weight,
5555
short ipo_flags,
56-
short end_reset,
57-
float stride);
56+
short end_reset);
5857

5958
virtual ~BL_ActionActuator();
6059
virtual bool Update(double curtime);
@@ -80,16 +79,6 @@ class BL_ActionActuator : public SCA_IActuator
8079
static PyObject* pyattr_get_frame(EXP_PyObjectPlus *self_v, const EXP_PYATTRIBUTE_DEF *attrdef);
8180
static int pyattr_set_frame(EXP_PyObjectPlus *self_v, const EXP_PYATTRIBUTE_DEF *attrdef, PyObject *value);
8281

83-
static int CheckBlendTime(EXP_PyObjectPlus *self, const PyAttributeDef*)
84-
{
85-
BL_ActionActuator* act = reinterpret_cast<BL_ActionActuator*>(self);
86-
87-
if (act->m_blendframe > act->m_blendin)
88-
act->m_blendframe = act->m_blendin;
89-
90-
return 0;
91-
}
92-
9382
static int CheckType(EXP_PyObjectPlus *self, const PyAttributeDef*)
9483
{
9584
BL_ActionActuator* act = reinterpret_cast<BL_ActionActuator*>(self);
@@ -110,19 +99,15 @@ class BL_ActionActuator : public SCA_IActuator
11099
#endif /* WITH_PYTHON */
111100

112101
protected:
113-
float m_blendframe;
114102
int m_flag;
115103
/** The frame this action starts */
116104
float m_startframe;
117105
/** The frame this action ends */
118106
float m_endframe;
119107
/** The current time of the action */
120108
float m_localtime;
121-
122-
float m_lastUpdate;
123109
float m_blendin;
124110
float m_blendstart;
125-
float m_stridelength;
126111
float m_layer_weight;
127112
short m_playtype;
128113
short m_blendmode;

source/gameengine/Converter/BL_ConvertActuators.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,7 @@ void BL_ConvertActuators(const char* maggiename,
233233
actact->layer,
234234
actact->layer_weight,
235235
ipo_flags,
236-
actact->end_reset,
237-
actact->stridelength
238-
// Ketsji at 1, because zero is reserved for "NoDef"
239-
);
236+
actact->end_reset);
240237
baseact= tmpbaseact;
241238
break;
242239
}

0 commit comments

Comments
 (0)