diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-22 02:58:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-22 02:58:08 +0400 |
commit | 9b515033071b40e982ef647ee225e8afc377e0c9 (patch) | |
tree | b8906cf9d21d2441c6dd0db1b518561def3f8f1a /source | |
parent | 049dd8a0ffa94b0d02033877ec99172659b89d8c (diff) |
style cleanup
Diffstat (limited to 'source')
33 files changed, 147 insertions, 132 deletions
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 516de35fab3..af9bb971d05 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -414,8 +414,9 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2, collpair->bp2 = face2->v2; collpair->bp3 = face2->v3; } - else + else { i++; + } } if ( i == 2 ) { if ( face2->v4 ) { @@ -429,8 +430,9 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2, collpair->bp2 = face2->v4; collpair->bp3 = face2->v3; } - else + else { break; + } } else if ( i == 3 ) { if ( face1->v4 && face2->v4 ) { @@ -444,8 +446,9 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2, collpair->bp2 = face2->v3; collpair->bp3 = face2->v4; } - else + else { break; + } } #ifdef USE_BULLET @@ -464,8 +467,7 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2, collpair->flag = 0; collpair++; }/* - else - { + else { float w1, w2, w3, u1, u2, u3; float v1[3], v2[3], relativeVelocity[3]; diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index f13c27cb436..6fe838666c5 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -110,7 +110,7 @@ static BezTriple *mask_spline_point_prev_bezt(MaskSpline *spline, MaskSplinePoin if (spline->flag & MASK_SPLINE_CYCLIC) { return &(points_array[0].bezt); } - else { + else { return NULL; } } @@ -2610,7 +2610,7 @@ void BKE_mask_rasterize_layers(ListBase *masklayers, int width, int height, floa } } - if(do_mask_aa){ + if (do_mask_aa) { //PLX_antialias_buffer(buffer,width,height); } /* clamp at the end */ @@ -2620,7 +2620,8 @@ void BKE_mask_rasterize_layers(ListBase *masklayers, int width, int height, floa } #ifdef __PLX_RASKTER_MT__ -void BKE_mask_init_layers(Mask *mask, struct layer_init_data *mlayer_data, int width, int height, const short do_aspect_correct){ +void BKE_mask_init_layers(Mask *mask, struct layer_init_data *mlayer_data, int width, int height, const short do_aspect_correct) +{ MaskLayer *masklay; int numLayers=0; int currLayer=0; diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index 4182a9c4c93..9c11358ce7f 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -916,7 +916,7 @@ void AnimationImporter::translate_Animations(COLLADAFW::Node *node, } } - if ( (animType->camera) != 0) { + if (animType->camera != 0) { Camera *camera = (Camera *) ob->data; if (!camera->adt || !camera->adt->action) act = verify_adt_action((ID *)&camera->id, 1); diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp index c3d1106b288..d30f9b86a5a 100644 --- a/source/blender/collada/GeometryExporter.cpp +++ b/source/blender/collada/GeometryExporter.cpp @@ -135,7 +135,7 @@ void GeometryExporter::operator()(Object *ob) // XXX slow if (ob->totcol) { - for (int a = 0; a < ob->totcol; a++) { + for (int a = 0; a < ob->totcol; a++) { createPolylist(a, has_uvs, has_color, ob, me, geom_id, norind); } } diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index 5077a9e3228..9abbfb163e2 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -122,11 +122,13 @@ public: /** * @brief after execution the state will be set to available by calling this method */ - void setCreatedState() { + void setCreatedState() + { this->m_state = COM_MB_AVAILABLE; } - inline void read(float result[4], int x, int y) { + inline void read(float result[4], int x, int y) + { if (x >= this->m_rect.xmin && x < this->m_rect.xmax && y >= this->m_rect.ymin && y < this->m_rect.ymax) { @@ -140,7 +142,8 @@ public: } } - inline void readNoCheck(float result[4], int x, int y) { + inline void readNoCheck(float result[4], int x, int y) + { const int dx = x - this->m_rect.xmin; const int dy = y - this->m_rect.ymin; const int offset = (this->m_chunkWidth * dy + dx) * COM_NUMBER_OF_CHANNELS; @@ -150,42 +153,42 @@ public: void writePixel(int x, int y, const float color[4]); void addPixel(int x, int y, const float color[4]); inline void readCubic(float result[4], float x, float y) - { - int x1 = floor(x); - int x2 = x1 + 1; - int y1 = floor(y); - int y2 = y1 + 1; - - float valuex = x - x1; - float valuey = y - y1; - float mvaluex = 1.0f - valuex; - float mvaluey = 1.0f - valuey; - - float color1[4]; - float color2[4]; - float color3[4]; - float color4[4]; - - read(color1, x1, y1); - read(color2, x1, y2); - read(color3, x2, y1); - read(color4, x2, y2); - - color1[0] = color1[0] * mvaluey + color2[0] * valuey; - color1[1] = color1[1] * mvaluey + color2[1] * valuey; - color1[2] = color1[2] * mvaluey + color2[2] * valuey; - color1[3] = color1[3] * mvaluey + color2[3] * valuey; - - color3[0] = color3[0] * mvaluey + color4[0] * valuey; - color3[1] = color3[1] * mvaluey + color4[1] * valuey; - color3[2] = color3[2] * mvaluey + color4[2] * valuey; - color3[3] = color3[3] * mvaluey + color4[3] * valuey; - - result[0] = color1[0] * mvaluex + color3[0] * valuex; - result[1] = color1[1] * mvaluex + color3[1] * valuex; - result[2] = color1[2] * mvaluex + color3[2] * valuex; - result[3] = color1[3] * mvaluex + color3[3] * valuex; - } + { + int x1 = floor(x); + int x2 = x1 + 1; + int y1 = floor(y); + int y2 = y1 + 1; + + float valuex = x - x1; + float valuey = y - y1; + float mvaluex = 1.0f - valuex; + float mvaluey = 1.0f - valuey; + + float color1[4]; + float color2[4]; + float color3[4]; + float color4[4]; + + read(color1, x1, y1); + read(color2, x1, y2); + read(color3, x2, y1); + read(color4, x2, y2); + + color1[0] = color1[0] * mvaluey + color2[0] * valuey; + color1[1] = color1[1] * mvaluey + color2[1] * valuey; + color1[2] = color1[2] * mvaluey + color2[2] * valuey; + color1[3] = color1[3] * mvaluey + color2[3] * valuey; + + color3[0] = color3[0] * mvaluey + color4[0] * valuey; + color3[1] = color3[1] * mvaluey + color4[1] * valuey; + color3[2] = color3[2] * mvaluey + color4[2] * valuey; + color3[3] = color3[3] * mvaluey + color4[3] * valuey; + + result[0] = color1[0] * mvaluex + color3[0] * valuex; + result[1] = color1[1] * mvaluex + color3[1] * valuex; + result[2] = color1[2] * mvaluex + color3[2] * valuex; + result[3] = color1[3] * mvaluex + color3[3] * valuex; + } diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.h b/source/blender/compositor/intern/COM_OpenCLDevice.h index 577df5caf77..f1a1e31c930 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.h +++ b/source/blender/compositor/intern/COM_OpenCLDevice.h @@ -92,9 +92,9 @@ public: */ void execute(WorkPackage *work); - cl_context getContext(){ return this->m_context; } + cl_context getContext() { return this->m_context; } - cl_command_queue getQueue(){ return this->m_queue; } + cl_command_queue getQueue() { return this->m_queue; } cl_mem COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, int offsetIndex, list<cl_mem> *cleanup, MemoryBuffer **inputMemoryBuffers, SocketReader *reader); cl_mem COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, int offsetIndex, list<cl_mem> *cleanup, MemoryBuffer **inputMemoryBuffers, ReadBufferOperation *reader); diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp index ff9bfb73396..ef28d55dbc8 100644 --- a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp @@ -94,7 +94,7 @@ void BokehBlurOperation::executePixel(float *color, int x, int y, void *data) int bufferstartx = inputBuffer->getRect()->xmin; int bufferstarty = inputBuffer->getRect()->ymin; int pixelSize = this->m_size * this->getWidth() / 100.0f; - if (pixelSize==0){ + if (pixelSize==0) { this->m_inputProgram->read(color, x, y, COM_PS_NEAREST); return; } diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 8e2ff06a55c..cef068ccbaa 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -520,7 +520,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c PyObject *gameLogic_keys_new = PyDict_Keys(PyModule_GetDict(gameLogic)); const Py_ssize_t numitems= PyList_GET_SIZE(gameLogic_keys_new); Py_ssize_t listIndex; - for (listIndex=0; listIndex < numitems; listIndex++) { + for (listIndex=0; listIndex < numitems; listIndex++) { PyObject* item = PyList_GET_ITEM(gameLogic_keys_new, listIndex); if (!PySequence_Contains(gameLogic_keys, item)) { PyDict_DelItem( PyModule_GetDict(gameLogic), item); diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index c73e4efd245..c84d31c72cd 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -63,16 +63,16 @@ public: m_lastDeformUpdate(-1) {}; virtual ~BL_MeshDeformer(); - virtual void SetSimulatedTime(double time){} + virtual void SetSimulatedTime(double time) {} virtual bool Apply(class RAS_IPolyMaterial *mat); - virtual bool Update(void){ return false; } - virtual bool UpdateBuckets(void){ return false; } - virtual RAS_Deformer* GetReplica(){return NULL;} + virtual bool Update(void) { return false; } + virtual bool UpdateBuckets(void) { return false; } + virtual RAS_Deformer* GetReplica() {return NULL;} virtual void ProcessReplica(); struct Mesh* GetMesh() { return m_bmesh; } virtual class RAS_MeshObject* GetRasMesh() { return (RAS_MeshObject*)m_pMeshObject; } virtual float (* GetTransVerts(int *tot))[3] { *tot= m_tvtot; return m_transverts; } - // virtual void InitDeform(double time){} + // virtual void InitDeform(double time) {} protected: class RAS_MeshObject* m_pMeshObject; diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 83f8232ca5e..4d104a4bd3a 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -57,7 +57,7 @@ public: void Remove(int i); void Resize(int num); void SetValue(int i,CValue* val); - CValue* GetValue(int i){ assertd(i < m_pValueArray.size()); return m_pValueArray[i];} + CValue* GetValue(int i) { assertd(i < m_pValueArray.size()); return m_pValueArray[i]; } int GetCount() { return m_pValueArray.size(); } virtual const STR_String & GetText(); diff --git a/source/gameengine/Expressions/VoidValue.h b/source/gameengine/Expressions/VoidValue.h index 5599b226a60..a1a82f8aa65 100644 --- a/source/gameengine/Expressions/VoidValue.h +++ b/source/gameengine/Expressions/VoidValue.h @@ -45,12 +45,19 @@ class CVoidValue : public CPropValue public: /// Construction/destruction - CVoidValue() : m_bDeleteOnDestruct(false), m_pAnything(NULL) { } - CVoidValue(void * voidptr, bool bDeleteOnDestruct, AllocationTYPE alloctype) : m_bDeleteOnDestruct(bDeleteOnDestruct), m_pAnything(voidptr) { if (alloctype == STACKVALUE) CValue::DisableRefCount(); } - virtual ~CVoidValue(); // Destruct void value, delete memory if we're owning it + CVoidValue() : m_bDeleteOnDestruct(false), m_pAnything(NULL) { } + CVoidValue(void * voidptr, bool bDeleteOnDestruct, AllocationTYPE alloctype) : + m_bDeleteOnDestruct(bDeleteOnDestruct), + m_pAnything(voidptr) + { + if (alloctype == STACKVALUE) { + CValue::DisableRefCount(); + } + } + virtual ~CVoidValue(); /* Destruct void value, delete memory if we're owning it */ /// Value -> String or number - virtual const STR_String & GetText(); // Get string description of void value (unimplemented) + virtual const STR_String & GetText(); /* Get string description of void value (unimplemented) */ virtual double GetNumber() { return -1; } /// Value calculation @@ -70,5 +77,5 @@ public: #endif }; -#endif // !defined _VOIDVALUE_H +#endif /* __VOIDVALUE_H__ */ diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 5077ecaf816..b90952b2092 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -251,7 +251,7 @@ SCA_IActuator* SCA_IObject::FindActuator(const STR_String& actuatorname) void SCA_IObject::Suspend() { if ((!m_ignore_activity_culling) - && (!m_suspended)) { + && (!m_suspended)) { m_suspended = true; /* flag suspend for all sensors */ SCA_SensorList::iterator i = m_sensors.begin(); diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.h b/source/gameengine/GamePlayer/common/GPC_Canvas.h index 0e26c5ad729..25a50fbcac3 100644 --- a/source/gameengine/GamePlayer/common/GPC_Canvas.h +++ b/source/gameengine/GamePlayer/common/GPC_Canvas.h @@ -103,7 +103,7 @@ public: void Resize(int width, int height); - virtual void ResizeWindow(int width, int height){}; + virtual void ResizeWindow(int width, int height) {} /** * \section Methods inherited from abstract base class RAS_ICanvas. diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 014c68e8bee..b28b8c86d33 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -884,7 +884,7 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()") Py_RETURN_NONE; } - if (!GLEW_ARB_shader_objects) { + if (!GLEW_ARB_shader_objects) { if (!mModified) spit("GLSL not supported"); mModified = true; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index b005684a6db..496b3925456 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1291,8 +1291,7 @@ void KX_GameObject::Resume(void) void KX_GameObject::Suspend() { - if ((!m_ignore_activity_culling) - && (!m_suspended)) { + if ((!m_ignore_activity_culling) && (!m_suspended)) { SCA_IObject::Suspend(); if (GetPhysicsController()) GetPhysicsController()->SuspendDynamics(); diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index 8924567acde..aec871d7700 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -138,9 +138,9 @@ bool PyVecTo(PyObject* pyval, T& vec) #ifdef USE_MATHUTILS /* no need for BaseMath_ReadCallback() here, reading the sequences will do this */ - if(VectorObject_Check(pyval)) { + if (VectorObject_Check(pyval)) { VectorObject *pyvec= (VectorObject *)pyval; - if(BaseMath_ReadCallback(pyvec) == -1) { + if (BaseMath_ReadCallback(pyvec) == -1) { return false; /* exception raised */ } if (pyvec->size != Size(vec)) { @@ -150,9 +150,9 @@ bool PyVecTo(PyObject* pyval, T& vec) vec.setValue((float *) pyvec->vec); return true; } - else if(QuaternionObject_Check(pyval)) { + else if (QuaternionObject_Check(pyval)) { QuaternionObject *pyquat= (QuaternionObject *)pyval; - if(BaseMath_ReadCallback(pyquat) == -1) { + if (BaseMath_ReadCallback(pyquat) == -1) { return false; /* exception raised */ } if (4 != Size(vec)) { @@ -163,9 +163,9 @@ bool PyVecTo(PyObject* pyval, T& vec) vec.setValue((float *) pyquat->quat); return true; } - else if(EulerObject_Check(pyval)) { + else if (EulerObject_Check(pyval)) { EulerObject *pyeul= (EulerObject *)pyval; - if(BaseMath_ReadCallback(pyeul) == -1) { + if (BaseMath_ReadCallback(pyeul) == -1) { return false; /* exception raised */ } if (3 != Size(vec)) { @@ -174,10 +174,10 @@ bool PyVecTo(PyObject* pyval, T& vec) } vec.setValue((float *) pyeul->eul); return true; - } else + } + else #endif - if(PyTuple_Check(pyval)) - { + if (PyTuple_Check(pyval)) { unsigned int numitems = PyTuple_GET_SIZE(pyval); if (numitems != Size(vec)) { PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", numitems, Size(vec)); @@ -194,8 +194,8 @@ bool PyVecTo(PyObject* pyval, T& vec) return true; } - else if (PyObject_TypeCheck(pyval, (PyTypeObject *)&PyObjectPlus::Type)) - { /* note, include this check because PySequence_Check does too much introspection + else if (PyObject_TypeCheck(pyval, (PyTypeObject *)&PyObjectPlus::Type)) { + /* note, include this check because PySequence_Check does too much introspection * on the PyObject (like getting its __class__, on a BGE type this means searching up * the parent list each time only to discover its not a sequence. * GameObjects are often used as an alternative to vectors so this is a common case @@ -207,16 +207,14 @@ bool PyVecTo(PyObject* pyval, T& vec) PyErr_Format(PyExc_AttributeError, "expected a sequence type"); return false; } - else if (PySequence_Check(pyval)) - { + else if (PySequence_Check(pyval)) { unsigned int numitems = PySequence_Size(pyval); if (numitems != Size(vec)) { PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", numitems, Size(vec)); return false; } - for (unsigned int x = 0; x < numitems; x++) - { + for (unsigned int x = 0; x < numitems; x++) { PyObject *item = PySequence_GetItem(pyval, x); /* new ref */ vec[x] = PyFloat_AsDouble(item); Py_DECREF(item); @@ -228,8 +226,8 @@ bool PyVecTo(PyObject* pyval, T& vec) } return true; - } else - { + } + else { PyErr_Format(PyExc_AttributeError, "not a sequence type, expected a sequence of numbers size %d", Size(vec)); } diff --git a/source/gameengine/Ketsji/KX_WorldInfo.h b/source/gameengine/Ketsji/KX_WorldInfo.h index e4a73873fa1..5b35ca2ec54 100644 --- a/source/gameengine/Ketsji/KX_WorldInfo.h +++ b/source/gameengine/Ketsji/KX_WorldInfo.h @@ -43,7 +43,7 @@ class MT_CmMatrix4x4; class KX_WorldInfo { public: - KX_WorldInfo(){} + KX_WorldInfo() {} virtual ~KX_WorldInfo(); virtual bool hasWorld()=0; diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h index 8fde9e289dc..30d63e6695d 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h @@ -107,7 +107,7 @@ class PHY_IPhysicsEnvironment /// Perform an integration step of duration 'timeStep'. virtual bool proceedDeltaTime(double curTime,float timeStep,float interval)=0; ///draw debug lines (make sure to call this during the render phase, otherwise lines are not drawn properly) - virtual void debugDrawWorld(){} + virtual void debugDrawWorld() {} virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep)=0; //returns 0.f if no fixed timestep is used virtual float getFixedTimeStep()=0; @@ -117,7 +117,7 @@ class PHY_IPhysicsEnvironment ///setNumIterations set the number of iterations for iterative solvers virtual void setNumIterations(int numIter) {} ///setNumTimeSubSteps set the number of divisions of the timestep. Tradeoff quality versus performance. - virtual void setNumTimeSubSteps(int numTimeSubSteps){} + virtual void setNumTimeSubSteps(int numTimeSubSteps) {} ///setDeactivationTime sets the minimum time that an objects has to stay within the velocity tresholds until it gets fully deactivated virtual void setDeactivationTime(float dTime) {} ///setDeactivationLinearTreshold sets the linear velocity treshold, see setDeactivationTime @@ -150,7 +150,7 @@ class PHY_IPhysicsEnvironment float axis2X=0,float axis2Y=0,float axis2Z=0,int flag=0 )=0; virtual void removeConstraint(int constraintid)=0; - virtual float getAppliedImpulse(int constraintid){ return 0.f;} + virtual float getAppliedImpulse(int constraintid) { return 0.0f; } //complex constraint for vehicles diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index 627db2b63fb..51c4da3c49d 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -49,8 +49,8 @@ class RAS_MeshObject; class RAS_Deformer { public: - RAS_Deformer() : m_pMesh(NULL), m_bDynamic(false) {}; - virtual ~RAS_Deformer(){}; + RAS_Deformer() : m_pMesh(NULL), m_bDynamic(false) {} + virtual ~RAS_Deformer() {} virtual void Relink(CTR_Map<class CTR_HashedPtr, void*>*map)=0; virtual bool Apply(class RAS_IPolyMaterial *polymat)=0; virtual bool Update(void)=0; diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index 0f89af490d8..169bc6e4ee6 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -174,7 +174,7 @@ public: virtual bool UsesObjectColor() const; virtual bool CastsShadows() const; - virtual void Replace_IScene(SCA_IScene *val) {}; /* overridden by KX_BlenderMaterial */ + virtual void Replace_IScene(SCA_IScene *val) {} /* overridden by KX_BlenderMaterial */ /** * \return the equivalent drawing mode for the material settings (equivalent to old TexFace tface->mode). @@ -184,7 +184,7 @@ public: /* * PreCalculate texture gen */ - virtual void OnConstruction(int layer){} + virtual void OnConstruction(int layer) {} #ifdef WITH_CXX_GUARDEDALLOC diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index d4c19410eb1..7749c4af9d6 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -64,8 +64,8 @@ typedef vector< KX_IndexArray* > vecIndexArrays; class RAS_IRasterizer { public: - RAS_IRasterizer(RAS_ICanvas* canv){}; - virtual ~RAS_IRasterizer(){}; + RAS_IRasterizer(RAS_ICanvas* canv) {}; + virtual ~RAS_IRasterizer() {}; /** * Drawing types @@ -401,8 +401,8 @@ public: virtual const MT_Matrix4x4& GetViewMatrix() const = 0; virtual const MT_Matrix4x4& GetViewInvMatrix() const = 0; - virtual bool QueryLists(){return false;} - virtual bool QueryArrays(){return false;} + virtual bool QueryLists() { return false; } + virtual bool QueryArrays() { return false; } virtual void EnableMotionBlur(float motionblurvalue)=0; virtual void DisableMotionBlur()=0; diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index 7cf7fee7845..295f2510313 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -54,7 +54,7 @@ class KX_ListSlot protected: int m_refcount; public: - KX_ListSlot(){ m_refcount=1; } + KX_ListSlot() { m_refcount = 1; } virtual ~KX_ListSlot() {} virtual int Release() { if (--m_refcount > 0) diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index 326110bea57..eb8655c8b1f 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -106,7 +106,7 @@ public: /* modification state */ bool MeshModified(); - void SetMeshModified(bool v){m_bMeshModified = v;} + void SetMeshModified(bool v) { m_bMeshModified = v; } /* original blender mesh */ Mesh* GetMesh() { return m_mesh; } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h index 808c4f11dd8..a8eb2d5ffdf 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h @@ -72,7 +72,7 @@ public: virtual void SetDrawingMode(int drawingmode); - virtual bool QueryLists(){return true;} + virtual bool QueryLists() {return true;} #ifdef WITH_CXX_GUARDEDALLOC diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 7db433b5b4f..76d1a64a4c0 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -533,10 +533,10 @@ void RAS_OpenGLRasterizer::SetEye(const StereoEye eye) glDrawBuffer(m_curreye == RAS_STEREO_LEFTEYE ? GL_BACK_LEFT : GL_BACK_RIGHT); break; case RAS_STEREO_ANAGLYPH: - if (m_curreye == RAS_STEREO_LEFTEYE) - { + if (m_curreye == RAS_STEREO_LEFTEYE) { glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_FALSE); - } else { + } + else { //glAccum(GL_LOAD, 1.0); glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); ClearDepthBuffer(); @@ -892,7 +892,8 @@ void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi) int current_blend_mode = GPU_get_material_alpha_blend(); ms.m_pDerivedMesh->drawFacesGLSL(ms.m_pDerivedMesh, CheckMaterialDM); GPU_set_material_alpha_blend(current_blend_mode); - } else { + } + else { //ms.m_pDerivedMesh->drawMappedFacesTex(ms.m_pDerivedMesh, CheckTexfaceDM, mcol); current_blmat_nr = current_polymat->GetMaterialIndex(); current_image = current_polymat->GetBlenderImage(); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index 36f768f6474..e5eba249175 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -302,9 +302,9 @@ public: virtual int GetMotionBlurState() { return m_motionblur; } virtual void SetMotionBlurState(int newstate) { - if(newstate<0) + if (newstate < 0) m_motionblur = 0; - else if(newstate>2) + else if (newstate > 2) m_motionblur = 2; else m_motionblur = newstate; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h index deda1c4603a..e881192171f 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h @@ -58,8 +58,8 @@ public: private: virtual void EnableTextures(bool enable); - //virtual bool QueryArrays(){return true;} - //virtual bool QueryLists(){return m_Lock;} + //virtual bool QueryArrays() {return true;} + //virtual bool QueryLists() {return m_Lock;} #ifdef WITH_CXX_GUARDEDALLOC diff --git a/source/gameengine/SceneGraph/SG_BBox.cpp b/source/gameengine/SceneGraph/SG_BBox.cpp index 4b2fc5410fa..3911babd2b5 100644 --- a/source/gameengine/SceneGraph/SG_BBox.cpp +++ b/source/gameengine/SceneGraph/SG_BBox.cpp @@ -217,7 +217,8 @@ void SG_BBox::split(SG_BBox &left, SG_BBox &right) const right.m_min[2] = m_min[2]; right.m_max = m_max; std::cout << "splity" << std::endl; - } else { + } + else { left.m_min = m_min; left.m_max[0] = m_max[0]; left.m_max[1] = m_max[1]; @@ -229,9 +230,9 @@ void SG_BBox::split(SG_BBox &left, SG_BBox &right) const right.m_max = m_max; std::cout << "splitz" << std::endl; } - } else { - if (sizex > sizez) - { + } + else { + if (sizex > sizez) { left.m_min = m_min; left.m_max[0] = m_min[0] + sizex/2.0; left.m_max[1] = m_max[1]; @@ -242,7 +243,8 @@ void SG_BBox::split(SG_BBox &left, SG_BBox &right) const right.m_min[2] = m_min[2]; right.m_max = m_max; std::cout << "splitx" << std::endl; - } else { + } + else { left.m_min = m_min; left.m_max[0] = m_max[0]; left.m_max[1] = m_max[1]; diff --git a/source/gameengine/SceneGraph/SG_Spatial.cpp b/source/gameengine/SceneGraph/SG_Spatial.cpp index e026419ca67..f8c4b5165ee 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.cpp +++ b/source/gameengine/SceneGraph/SG_Spatial.cpp @@ -151,10 +151,12 @@ RelativeTranslate( ) { if (local) { m_localPosition += m_localRotation * trans; - } else { + } + else { if (parent) { m_localPosition += trans * parent->GetWorldOrientation(); - } else { + } + else { m_localPosition += trans; } } diff --git a/source/gameengine/SceneGraph/SG_Tree.cpp b/source/gameengine/SceneGraph/SG_Tree.cpp index 738c0fdef22..0f8264985de 100644 --- a/source/gameengine/SceneGraph/SG_Tree.cpp +++ b/source/gameengine/SceneGraph/SG_Tree.cpp @@ -296,7 +296,8 @@ SG_Tree* SG_TreeFactory::MakeTreeDown(SG_BBox &bbox) { lefttree.Add(*it); hasleft++; - } else { + } + else { righttree.Add(*it); hasright++; } diff --git a/source/gameengine/VideoTexture/ImageBase.cpp b/source/gameengine/VideoTexture/ImageBase.cpp index 090b4f6ff4a..54c1939ce6b 100644 --- a/source/gameengine/VideoTexture/ImageBase.cpp +++ b/source/gameengine/VideoTexture/ImageBase.cpp @@ -246,7 +246,8 @@ bool ImageBase::checkSourceSizes (void) // set current size as reference refSize = curSize; // otherwise check with current size - } else if (curSize[0] != refSize[0] || curSize[1] != refSize[1]) { + } + else if (curSize[0] != refSize[0] || curSize[1] != refSize[1]) { // if they don't match, report it return false; } diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index 2cc2c6efa1e..9fdd0cd393b 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -208,11 +208,11 @@ void ImageRender::Render() frustrum.x1, frustrum.x2, frustrum.y1, frustrum.y2, frustrum.camnear, frustrum.camfar); m_camera->SetProjectionMatrix(projmat); - } else if (m_camera->hasValidProjectionMatrix()) - { + } + else if (m_camera->hasValidProjectionMatrix()) { m_rasterizer->SetProjectionMatrix(m_camera->GetProjectionMatrix()); - } else - { + } + else { float lens = m_camera->GetLens(); float sensor_x = m_camera->GetSensorWidth(); float sensor_y = m_camera->GetSensorHeight(); @@ -241,8 +241,8 @@ void ImageRender::Render() projmat = m_rasterizer->GetOrthoMatrix( frustrum.x1, frustrum.x2, frustrum.y1, frustrum.y2, frustrum.camnear, frustrum.camfar); - } else - { + } + else { RAS_FramingManager::ComputeDefaultFrustum( nearfrust, farfrust, @@ -604,13 +604,12 @@ ImageRender::ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObj mirrorVerts.push_back(v1); mirrorVerts.push_back(v2); mirrorVerts.push_back(v3); - if (polygon->VertexCount() == 4) - { + if (polygon->VertexCount() == 4) { v4 = polygon->GetVertex(3); mirrorVerts.push_back(v4); area = normal_quad_v3(normal,(float*)v1->getXYZ(), (float*)v2->getXYZ(), (float*)v3->getXYZ(), (float*)v4->getXYZ()); - } else - { + } + else { area = normal_tri_v3(normal,(float*)v1->getXYZ(), (float*)v2->getXYZ(), (float*)v3->getXYZ()); } area = fabs(area); diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp index f08a5a4a0b3..a21300018eb 100644 --- a/source/gameengine/VideoTexture/Texture.cpp +++ b/source/gameengine/VideoTexture/Texture.cpp @@ -130,13 +130,12 @@ short getMaterialID(PyObject * obj, const char *name) if (mat == NULL) break; // name is a material name if it starts with MA and a UV texture name if it starts with IM - if (name[0] == 'I' && name[1] == 'M') - { + if (name[0] == 'I' && name[1] == 'M') { // if texture name matches if (strcmp(mat->GetTextureName().ReadPtr(), name) == 0) return matID; - } else - { + } + else { // if material name matches if (strcmp(mat->GetMaterialName().ReadPtr(), name) == 0) return matID; |