Skip to content

Commit

Permalink
UPBGE: Cleanup SCA_IObject.[h/cpp].
Browse files Browse the repository at this point in the history
This cleanup contains:
- uncrustify pass
- use range loop
- remove friend class
  • Loading branch information
panzergame committed Oct 19, 2017
1 parent 3ca1d2d commit 32dd421
Show file tree
Hide file tree
Showing 5 changed files with 251 additions and 254 deletions.
10 changes: 6 additions & 4 deletions source/gameengine/GameLogic/SCA_IActuator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,20 @@ bool SCA_IActuator::IsPositiveEvent() const
void SCA_IActuator::Activate(SG_DList& head)
{
if (QEmpty()) {
InsertActiveQList(m_gameobj->m_activeActuators);
head.AddBack(&m_gameobj->m_activeActuators);
SG_QList& list = m_gameobj->GetActiveActuators();
InsertActiveQList(list);
head.AddBack(&list);
}
}

void SCA_IActuator::Deactivate()
{
if (QDelink()) {
SG_QList& list = m_gameobj->GetActiveActuators();
// the actuator was in the active list
if (m_gameobj->m_activeActuators.QEmpty()) {
if (list.QEmpty()) {
// the owner object has no more active actuators, remove it from the global list
m_gameobj->m_activeActuators.Delink();
list.Delink();
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions source/gameengine/GameLogic/SCA_IController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,14 @@ void SCA_IController::Activate(SG_DList& head)
{
if (QEmpty()) {
if (m_bookmark) {
m_gameobj->m_activeBookmarkedControllers.QAddBack(this);
head.AddFront(&m_gameobj->m_activeBookmarkedControllers);
SG_QList& list = SCA_IObject::GetActiveBookmarkedControllers();
list.QAddBack(this);
head.AddFront(&list);
}
else {
InsertActiveQList(m_gameobj->m_activeControllers);
head.AddBack(&m_gameobj->m_activeControllers);
SG_QList& list = m_gameobj->GetActiveActuators();
InsertActiveQList(list);
head.AddBack(&list);
}
}
}
Expand Down
Loading

0 comments on commit 32dd421

Please sign in to comment.