diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2011-08-29 10:19:55 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2011-08-29 10:19:55 +0400 |
commit | 296cc41b03b18fbe65357aa0cfdf43f43c881922 (patch) | |
tree | 0a39b8e7c93ca1b96b0c720205a146bcfe1c0bfb /source/gameengine/Ketsji | |
parent | ca79dee61f11227be0ed4cc5b1241fa748124da0 (diff) |
BGE Animations: Various changes to make code reviewers happy:
* Naming/style changes
* Taking advantage of switch statements
* Removing unneeded NULL checks
* etc
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/BL_ActionManager.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/source/gameengine/Ketsji/BL_ActionManager.cpp b/source/gameengine/Ketsji/BL_ActionManager.cpp index af0d4bff8f0..4e4d3bc539e 100644 --- a/source/gameengine/Ketsji/BL_ActionManager.cpp +++ b/source/gameengine/Ketsji/BL_ActionManager.cpp @@ -37,42 +37,36 @@ BL_ActionManager::BL_ActionManager(class KX_GameObject *obj) BL_ActionManager::~BL_ActionManager() { for (int i=0; i<MAX_ACTION_LAYERS; ++i) - if (m_layers[i]) - delete m_layers[i]; + delete m_layers[i]; } float BL_ActionManager::GetActionFrame(short layer) { - if (m_layers[layer]) - return m_layers[layer]->GetFrame(); + return m_layers[layer]->GetFrame(); return 0.f; } void BL_ActionManager::SetActionFrame(short layer, float frame) { - if (m_layers[layer]) - m_layers[layer]->SetFrame(frame); + m_layers[layer]->SetFrame(frame); } struct bAction *BL_ActionManager::GetCurrentAction(short layer) { - if (m_layers[layer]) - return m_layers[layer]->GetAction(); + return m_layers[layer]->GetAction(); return 0; } void BL_ActionManager::SetPlayMode(short layer, short mode) { - if (m_layers[layer]) - m_layers[layer]->SetPlayMode(mode); + m_layers[layer]->SetPlayMode(mode); } void BL_ActionManager::SetTimes(short layer, float start, float end) { - if (m_layers[layer]) - m_layers[layer]->SetTimes(start, end); + m_layers[layer]->SetTimes(start, end); } bool BL_ActionManager::PlayAction(const char* name, @@ -99,8 +93,7 @@ void BL_ActionManager::StopAction(short layer) bool BL_ActionManager::IsActionDone(short layer) { - if (m_layers[layer]) - return m_layers[layer]->IsDone(); + return m_layers[layer]->IsDone(); return true; } |