Skip to content

Commit

Permalink
UPBGE: Unify SG_COntroller subclasses replication.
Browse files Browse the repository at this point in the history
m_ipo_xform is not a pointer in KX_IpoSGController and using this
instead of its addresse will end in the same result.
  • Loading branch information
panzergame committed Dec 29, 2017
1 parent a8d9f40 commit 0ba4f91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions source/gameengine/Ketsji/KX_IPO_SGController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,10 @@ SG_Controller *KX_IpoSGController::GetReplica(SG_Node *destnode)
iporeplica->AddInterpolator(copyipo);

float *scaal = ((KX_ScalarInterpolator *)*i)->GetTarget();
uint_ptr orgbase = (uint_ptr)&m_ipo_xform;
uint_ptr orgbase = (uint_ptr)this;
uint_ptr orgloc = (uint_ptr)scaal;
uint_ptr offset = orgloc - orgbase;
uint_ptr newaddrbase = (uint_ptr)&iporeplica->m_ipo_xform;
newaddrbase += offset;
uint_ptr newaddrbase = (uint_ptr)iporeplica + offset;
float *blaptr = (float *) newaddrbase;
copyipo->SetNewTarget((float *)blaptr);
}
Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/Ketsji/KX_ObColorIpoSGController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ bool KX_ObColorIpoSGController::Update()

KX_GameObject* kxgameobj= (KX_GameObject *)m_node->GetSGClientObject();

kxgameobj->SetObjectColor(m_rgba); // TODO test
kxgameobj->SetObjectColor(m_rgba);

return true;
}
Expand Down

0 comments on commit 0ba4f91

Please sign in to comment.