Skip to content

Commit

Permalink
UPBGE: Remove Hungarian notation.
Browse files Browse the repository at this point in the history
  • Loading branch information
panzergame committed Dec 10, 2017
1 parent 1973f22 commit 555e650
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 251 deletions.
60 changes: 30 additions & 30 deletions source/gameengine/Converter/BL_DeformableGameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@

BL_DeformableGameObject::BL_DeformableGameObject(void *sgReplicationInfo, SG_Callbacks callbacks)
:KX_GameObject(sgReplicationInfo, callbacks),
m_pDeformer(nullptr),
m_deformer(nullptr),
m_lastframe(0.0)
{
}

BL_DeformableGameObject::~BL_DeformableGameObject()
{
if (m_pDeformer) {
delete m_pDeformer;
if (m_deformer) {
delete m_deformer;
}
}

Expand All @@ -66,15 +66,15 @@ void BL_DeformableGameObject::ProcessReplica()
{
KX_GameObject::ProcessReplica();

if (m_pDeformer) {
m_pDeformer = m_pDeformer->GetReplica();
if (m_deformer) {
m_deformer = m_deformer->GetReplica();
}
}

void BL_DeformableGameObject::Relink(std::map<SCA_IObject *, SCA_IObject *>& map)
{
if (m_pDeformer) {
m_pDeformer->Relink(map);
if (m_deformer) {
m_deformer->Relink(map);
}
KX_GameObject::Relink(map);
}
Expand All @@ -92,7 +92,7 @@ void BL_DeformableGameObject::SetLastFrame(double curtime)
bool BL_DeformableGameObject::GetShape(std::vector<float> &shape)
{
shape.clear();
BL_ShapeDeformer *shape_deformer = dynamic_cast<BL_ShapeDeformer *>(m_pDeformer);
BL_ShapeDeformer *shape_deformer = dynamic_cast<BL_ShapeDeformer *>(m_deformer);
if (shape_deformer) {
// this check is normally superfluous: a shape deformer can only be created if the mesh
// has relative keys
Expand All @@ -111,12 +111,12 @@ void BL_DeformableGameObject::SetDeformer(RAS_Deformer *deformer)
{
// Make sure that the object doesn't already have a mesh user.
BLI_assert(m_meshUser == nullptr);
m_pDeformer = deformer;
m_deformer = deformer;
}

RAS_Deformer *BL_DeformableGameObject::GetDeformer()
{
return m_pDeformer;
return m_deformer;
}

bool BL_DeformableGameObject::IsDeformable() const
Expand All @@ -126,9 +126,9 @@ bool BL_DeformableGameObject::IsDeformable() const

void BL_DeformableGameObject::LoadDeformer()
{
if (m_pDeformer) {
delete m_pDeformer;
m_pDeformer = nullptr;
if (m_deformer) {
delete m_deformer;
m_deformer = nullptr;
}

if (m_meshes.empty()) {
Expand All @@ -149,21 +149,21 @@ void BL_DeformableGameObject::LoadDeformer()
/* Object that owns the mesh. If this is not the current blender object, look at one of the object registered
* along the blender mesh. */
Object *meshblendobj;
if (m_pBlenderObject->data != mesh) {
if (m_blenderObject->data != mesh) {
meshblendobj = static_cast<Object *>(scene->GetLogicManager()->FindBlendObjByGameMeshName(meshobj->GetName()));
}
else {
meshblendobj = m_pBlenderObject;
meshblendobj = m_blenderObject;
}

const bool isParentArmature = parentobj && parentobj->GetGameObjectType() == SCA_IObject::OBJ_ARMATURE;
const bool bHasModifier = BL_ModifierDeformer::HasCompatibleDeformer(m_pBlenderObject);
const bool bHasModifier = BL_ModifierDeformer::HasCompatibleDeformer(m_blenderObject);
const bool bHasShapeKey = mesh->key && mesh->key->type == KEY_RELATIVE;
const bool bHasDvert = mesh->dvert && m_pBlenderObject->defbase.first;
const bool bHasArmature = BL_ModifierDeformer::HasArmatureDeformer(m_pBlenderObject) &&
const bool bHasDvert = mesh->dvert && m_blenderObject->defbase.first;
const bool bHasArmature = BL_ModifierDeformer::HasArmatureDeformer(m_blenderObject) &&
isParentArmature && meshblendobj && bHasDvert;
#ifdef WITH_BULLET
const bool bHasSoftBody = (!parentobj && (m_pBlenderObject->gameflag & OB_SOFT_BODY));
const bool bHasSoftBody = (!parentobj && (m_blenderObject->gameflag & OB_SOFT_BODY));
#endif

if (!meshblendobj) {
Expand All @@ -175,40 +175,40 @@ void BL_DeformableGameObject::LoadDeformer()

if (bHasModifier) {
if (isParentArmature) {
BL_ModifierDeformer *modifierDeformer = new BL_ModifierDeformer(this, blenderScene, meshblendobj, m_pBlenderObject,
BL_ModifierDeformer *modifierDeformer = new BL_ModifierDeformer(this, blenderScene, meshblendobj, m_blenderObject,
meshobj, static_cast<BL_ArmatureObject *>(parentobj));
modifierDeformer->LoadShapeDrivers(parentobj);
m_pDeformer = modifierDeformer;
m_deformer = modifierDeformer;
}
else {
m_pDeformer = new BL_ModifierDeformer(this, blenderScene, meshblendobj, m_pBlenderObject, meshobj, nullptr);
m_deformer = new BL_ModifierDeformer(this, blenderScene, meshblendobj, m_blenderObject, meshobj, nullptr);
}
}
else if (bHasShapeKey) {
if (isParentArmature) {
BL_ShapeDeformer *shapeDeformer = new BL_ShapeDeformer(this, meshblendobj, m_pBlenderObject, meshobj,
BL_ShapeDeformer *shapeDeformer = new BL_ShapeDeformer(this, meshblendobj, m_blenderObject, meshobj,
static_cast<BL_ArmatureObject *>(parentobj));
shapeDeformer->LoadShapeDrivers(parentobj);
m_pDeformer = shapeDeformer;
m_deformer = shapeDeformer;
}
else {
m_pDeformer = new BL_ShapeDeformer(this, meshblendobj, m_pBlenderObject, meshobj, nullptr);
m_deformer = new BL_ShapeDeformer(this, meshblendobj, m_blenderObject, meshobj, nullptr);
}
}
else if (bHasArmature) {
m_pDeformer = new BL_SkinDeformer(this, meshblendobj, m_pBlenderObject, meshobj,
m_deformer = new BL_SkinDeformer(this, meshblendobj, m_blenderObject, meshobj,
static_cast<BL_ArmatureObject *>(parentobj));
}
else if (bHasDvert) {
m_pDeformer = new BL_MeshDeformer(this, meshblendobj, meshobj);
m_deformer = new BL_MeshDeformer(this, meshblendobj, meshobj);
}
#ifdef WITH_BULLET
else if (bHasSoftBody) {
m_pDeformer = new KX_SoftBodyDeformer(meshobj, this);
m_deformer = new KX_SoftBodyDeformer(meshobj, this);
}
#endif

if (m_pDeformer) {
m_pDeformer->InitializeDisplayArrays();
if (m_deformer) {
m_deformer->InitializeDisplayArrays();
}
}
2 changes: 1 addition & 1 deletion source/gameengine/Converter/BL_DeformableGameObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct Key;
class BL_DeformableGameObject : public KX_GameObject
{
private:
RAS_Deformer *m_pDeformer;
RAS_Deformer *m_deformer;

double m_lastframe;

Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/Expressions/EXP_BaseListValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class EXP_BaseListValue : public EXP_PropValue
typedef VectorType::const_iterator VectorTypeConstIterator;

protected:
VectorType m_pValueArray;
VectorType m_valueArray;
bool m_bReleaseContents;

void SetValue(int i, EXP_Value *val);
Expand Down
20 changes: 10 additions & 10 deletions source/gameengine/Expressions/EXP_ListValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class EXP_ListValue : public EXP_BaseListValue
EXP_ListValue(const std::vector<ItemType *>& rawList)
{
const unsigned int size = rawList.size();
m_pValueArray.resize(size);
m_valueArray.resize(size);
for (unsigned int i = 0; i < size; ++i) {
m_pValueArray[i] = rawList[i];
m_valueArray[i] = rawList[i];
}
}

Expand All @@ -76,10 +76,10 @@ class EXP_ListValue : public EXP_BaseListValue

replica->m_bReleaseContents = true; // For copy, complete array is copied for now...
// Copy all values.
const int numelements = m_pValueArray.size();
replica->m_pValueArray.resize(numelements);
const int numelements = m_valueArray.size();
replica->m_valueArray.resize(numelements);
for (unsigned int i = 0; i < numelements; i++) {
replica->m_pValueArray[i] = m_pValueArray[i]->GetReplica();
replica->m_valueArray[i] = m_valueArray[i]->GetReplica();
}

return replica;
Expand All @@ -97,7 +97,7 @@ class EXP_ListValue : public EXP_BaseListValue

ItemType *FindIf(std::function<bool (ItemType *)> function)
{
for (EXP_Value *val : m_pValueArray) {
for (EXP_Value *val : m_valueArray) {
ItemType *item = static_cast<ItemType *>(val);
if (function(item)) {
return item;
Expand Down Expand Up @@ -151,20 +151,20 @@ class EXP_ListValue : public EXP_BaseListValue

ItemType *GetFront()
{
return static_cast<ItemType *>(m_pValueArray.front());
return static_cast<ItemType *>(m_valueArray.front());
}
ItemType *GetBack()
{
return static_cast<ItemType *>(m_pValueArray.back());
return static_cast<ItemType *>(m_valueArray.back());
}

const_iterator begin()
{
return const_iterator(m_pValueArray.begin());
return const_iterator(m_valueArray.begin());
}
const_iterator end()
{
return const_iterator(m_pValueArray.end());
return const_iterator(m_valueArray.end());
}
};

Expand Down
38 changes: 19 additions & 19 deletions source/gameengine/Expressions/intern/BaseListValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,54 +35,54 @@ EXP_BaseListValue::EXP_BaseListValue()
EXP_BaseListValue::~EXP_BaseListValue()
{
if (m_bReleaseContents) {
for (EXP_Value *item : m_pValueArray) {
for (EXP_Value *item : m_valueArray) {
item->Release();
}
}
}

void EXP_BaseListValue::SetValue(int i, EXP_Value *val)
{
m_pValueArray[i] = val;
m_valueArray[i] = val;
}

EXP_Value *EXP_BaseListValue::GetValue(int i)
{
return m_pValueArray[i];
return m_valueArray[i];
}

EXP_Value *EXP_BaseListValue::FindValue(const std::string& name) const
{
const VectorTypeConstIterator it = std::find_if(m_pValueArray.begin(), m_pValueArray.end(),
const VectorTypeConstIterator it = std::find_if(m_valueArray.begin(), m_valueArray.end(),
[&name](EXP_Value *item) { return item->GetName() == name; });

if (it != m_pValueArray.end()) {
if (it != m_valueArray.end()) {
return *it;
}
return nullptr;
}

bool EXP_BaseListValue::SearchValue(EXP_Value *val) const
{
return (std::find(m_pValueArray.begin(), m_pValueArray.end(), val) != m_pValueArray.end());
return (std::find(m_valueArray.begin(), m_valueArray.end(), val) != m_valueArray.end());
}

void EXP_BaseListValue::Add(EXP_Value *value)
{
m_pValueArray.push_back(value);
m_valueArray.push_back(value);
}

void EXP_BaseListValue::Insert(unsigned int i, EXP_Value *value)
{
m_pValueArray.insert(m_pValueArray.begin() + i, value);
m_valueArray.insert(m_valueArray.begin() + i, value);
}

bool EXP_BaseListValue::RemoveValue(EXP_Value *val)
{
bool result = false;
for (VectorTypeIterator it = m_pValueArray.begin(); it != m_pValueArray.end();) {
for (VectorTypeIterator it = m_valueArray.begin(); it != m_valueArray.end();) {
if (*it == val) {
it = m_pValueArray.erase(it);
it = m_valueArray.erase(it);
result = true;
}
else {
Expand Down Expand Up @@ -112,7 +112,7 @@ std::string EXP_BaseListValue::GetText()
std::string strListRep = "[";
std::string commastr = "";

for (EXP_Value *item : m_pValueArray) {
for (EXP_Value *item : m_valueArray) {
strListRep += commastr;
strListRep += item->GetText();
commastr = ", ";
Expand All @@ -134,25 +134,25 @@ void EXP_BaseListValue::SetReleaseOnDestruct(bool bReleaseContents)

void EXP_BaseListValue::Remove(int i)
{
m_pValueArray.erase(m_pValueArray.begin() + i);
m_valueArray.erase(m_valueArray.begin() + i);
}

void EXP_BaseListValue::Resize(int num)
{
m_pValueArray.resize(num);
m_valueArray.resize(num);
}

void EXP_BaseListValue::ReleaseAndRemoveAll()
{
for (EXP_Value *item : m_pValueArray) {
for (EXP_Value *item : m_valueArray) {
item->Release();
}
m_pValueArray.clear();
m_valueArray.clear();
}

int EXP_BaseListValue::GetCount() const
{
return m_pValueArray.size();
return m_valueArray.size();
}

#ifdef WITH_PYTHON
Expand Down Expand Up @@ -462,7 +462,7 @@ PyObject *EXP_BaseListValue::Pyreverse()
return nullptr;
}

std::reverse(m_pValueArray.begin(), m_pValueArray.end());
std::reverse(m_valueArray.begin(), m_valueArray.end());
Py_RETURN_NONE;
}

Expand Down Expand Up @@ -568,7 +568,7 @@ PyObject *EXP_BaseListValue::Pyfilter(PyObject *args)
EXP_ListValue<EXP_Value> *result = new EXP_ListValue<EXP_Value>();
result->SetReleaseOnDestruct(false);

for (EXP_Value *item : m_pValueArray) {
for (EXP_Value *item : m_valueArray) {
if (strlen(namestr) == 0 || std::regex_match(item->GetName(), namereg)) {
if (strlen(propstr) == 0) {
result->Add(item);
Expand Down Expand Up @@ -598,7 +598,7 @@ PyObject *EXP_BaseListValue::Pyfrom_id(PyObject *value)

int numelem = GetCount();
for (int i = 0; i < numelem; i++) {
if (reinterpret_cast<uintptr_t>(m_pValueArray[i]->m_proxy) == id) {
if (reinterpret_cast<uintptr_t>(m_valueArray[i]->m_proxy) == id) {
return GetValue(i)->GetProxy();
}
}
Expand Down
6 changes: 3 additions & 3 deletions source/gameengine/Ketsji/KX_Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ KX_Camera::KX_Camera(void* sgReplicationInfo,

KX_Camera::~KX_Camera()
{
if (m_delete_node && m_pSGNode)
if (m_delete_node && m_sgNode)
{
// for shadow camera, avoids memleak
delete m_pSGNode;
m_pSGNode = nullptr;
delete m_sgNode;
m_sgNode = nullptr;
}
}

Expand Down
Loading

0 comments on commit 555e650

Please sign in to comment.