[Bf-blender-cvs] [c2e37e9] temp-bge-cleanup: Special cleanup for BL_BlenderScalarInterpolator.h/cpp.
Porteries Tristan
noreply at git.blender.org
Mon May 4 19:33:29 CEST 2015
Commit: c2e37e977b551486196445354cfe3f6bf2e6e36a
Author: Porteries Tristan
Date: Mon May 4 19:30:12 2015 +0200
Branches: temp-bge-cleanup
https://developer.blender.org/rBc2e37e977b551486196445354cfe3f6bf2e6e36a
Special cleanup for BL_BlenderScalarInterpolator.h/cpp.
===================================================================
M source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp
M source/gameengine/Converter/KX_BlenderScalarInterpolator.h
===================================================================
diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp
index acc3bf2..3daca84 100644
--- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp
+++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp
@@ -49,7 +49,7 @@ float BL_ScalarInterpolator::GetValue(float currentTime) const
BL_InterpolatorList::BL_InterpolatorList(bAction *action)
{
- if (action == NULL)
+ if (action)
return;
for (FCurve *fcu = (FCurve *)action->curves.first; fcu; fcu = fcu->next) {
@@ -63,20 +63,17 @@ BL_InterpolatorList::BL_InterpolatorList(bAction *action)
BL_InterpolatorList::~BL_InterpolatorList()
{
- BL_InterpolatorList::iterator i;
- for (i = begin(); !(i == end()); ++i) {
+ for (BL_InterpolatorList::iterator i = begin(); i != end(); ++i) {
delete *i;
}
}
KX_IScalarInterpolator *BL_InterpolatorList::GetScalarInterpolator(const char *rna_path, int array_index)
{
- for (BL_InterpolatorList::iterator i = begin(); (i != end()); i++)
- {
+ for (BL_InterpolatorList::iterator i = begin(); i != end(); i++) {
FCurve *fcu = (static_cast<BL_ScalarInterpolator *>(*i))->GetFCurve();
if (array_index == fcu->array_index && strcmp(rna_path, fcu->rna_path) == 0)
return *i;
}
return NULL;
}
-
diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
index de84c52..66423f1 100644
--- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
+++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h
@@ -36,28 +36,31 @@
#include "KX_IScalarInterpolator.h"
-typedef unsigned short BL_IpoChannel;
+struct FCurve;
+struct bAction;
-class BL_ScalarInterpolator : public KX_IScalarInterpolator {
+class BL_ScalarInterpolator : public KX_IScalarInterpolator
+{
public:
BL_ScalarInterpolator() {
} // required for use in STL list
- BL_ScalarInterpolator(struct FCurve *fcu) :
+ BL_ScalarInterpolator(FCurve *fcu) :
m_fcu(fcu)
{
}
- virtual ~BL_ScalarInterpolator() {
+ virtual ~BL_ScalarInterpolator()
+ {
}
virtual float GetValue(float currentTime) const;
- struct FCurve *GetFCurve() {
+ FCurve *GetFCurve()
+ {
return m_fcu;
}
private:
- struct FCurve *m_fcu;
-
+ FCurve *m_fcu;
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("GE:BL_ScalarInterpolator")
@@ -65,9 +68,10 @@ private:
};
-class BL_InterpolatorList : public std::vector<KX_IScalarInterpolator *> {
+class BL_InterpolatorList : public std::vector<KX_IScalarInterpolator *>
+{
public:
- BL_InterpolatorList(struct bAction *action);
+ BL_InterpolatorList(bAction *action);
~BL_InterpolatorList();
KX_IScalarInterpolator *GetScalarInterpolator(const char *rna_path, int array_index);
More information about the Bf-blender-cvs
mailing list