mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 19:59:59 +01:00
Confirmed working implementation of Node UpdateCallback. For now example
used in visual effect on selecting a source as current.
This commit is contained in:
16
Scene.cpp
16
Scene.cpp
@@ -57,10 +57,20 @@ void Node::copyTransform(Node *other)
|
||||
void Node::update( float dt)
|
||||
{
|
||||
std::list<UpdateCallback *>::iterator iter;
|
||||
for (iter=update_callbacks_.begin(); iter != update_callbacks_.end(); iter++)
|
||||
for (iter=update_callbacks_.begin(); iter != update_callbacks_.end(); )
|
||||
{
|
||||
if ((*iter)->enabled())
|
||||
(*iter)->update(this, dt);
|
||||
UpdateCallback *callback = *iter;
|
||||
|
||||
if (callback->enabled())
|
||||
callback->update(this, dt);
|
||||
|
||||
if (callback->finished()) {
|
||||
iter = update_callbacks_.erase(iter);
|
||||
delete callback;
|
||||
}
|
||||
else {
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
// update transform matrix from attributes
|
||||
|
||||
Reference in New Issue
Block a user