From 47c373c7a970fa4bd26453a6e35a4b066f2b77e4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 Feb 2012 10:35:39 +0000 Subject: style cleanup (mostly whitespace) --- intern/boolop/intern/BOP_MathUtils.cpp | 6 +- intern/boolop/intern/BOP_Merge2.cpp | 2 +- intern/bsp/intern/BSP_CSGMesh.h | 5 +- intern/container/CTR_List.h | 28 +- intern/decimation/intern/LOD_ExternNormalEditor.h | 2 +- intern/decimation/intern/LOD_FaceNormalEditor.h | 2 +- intern/decimation/intern/LOD_ManMesh2.h | 4 +- intern/decimation/intern/LOD_MeshPrimitives.h | 12 +- intern/ghost/GHOST_C-api.h | 4 +- intern/ghost/intern/GHOST_SystemPathsX11.cpp | 2 +- intern/ghost/intern/GHOST_SystemWin32.cpp | 2 +- intern/ghost/intern/GHOST_SystemX11.h | 4 +- intern/ghost/intern/GHOST_WindowSDL.cpp | 2 +- intern/ghost/intern/GHOST_WindowX11.cpp | 12 +- intern/ghost/intern/GHOST_WindowX11.h | 2 +- intern/guardedalloc/test/simpletest/memtest.c | 2 +- source/blender/avi/intern/avi.c | 6 +- source/blender/blenkernel/BKE_icons.h | 2 +- source/blender/blenkernel/BKE_node.h | 2 +- source/blender/blenkernel/intern/DerivedMesh.c | 2 +- source/blender/blenkernel/intern/action.c | 4 +- source/blender/blenkernel/intern/anim.c | 2 +- source/blender/blenkernel/intern/armature.c | 2 +- source/blender/blenkernel/intern/booleanops_mesh.c | 12 +- source/blender/blenkernel/intern/cdderivedmesh.c | 3 +- source/blender/blenkernel/intern/collision.c | 36 +- source/blender/blenkernel/intern/deform.c | 2 +- source/blender/blenkernel/intern/depsgraph.c | 15 +- source/blender/blenkernel/intern/displist.c | 2 +- source/blender/blenkernel/intern/dynamicpaint.c | 4 +- source/blender/blenkernel/intern/effect.c | 13 +- source/blender/blenkernel/intern/fmodifier.c | 2 +- source/blender/blenkernel/intern/font.c | 6 +- source/blender/blenkernel/intern/group.c | 2 +- source/blender/blenkernel/intern/icons.c | 2 +- source/blender/blenkernel/intern/idprop.c | 6 +- source/blender/blenkernel/intern/image.c | 4 +- source/blender/blenkernel/intern/implicit.c | 2 +- source/blender/blenkernel/intern/library.c | 2 +- source/blender/blenkernel/intern/mesh_validate.c | 10 +- source/blender/blenkernel/intern/nla.c | 2 +- source/blender/blenkernel/intern/ocean.c | 2 +- source/blender/blenkernel/intern/particle.c | 166 ++++----- source/blender/blenkernel/intern/particle_system.c | 186 +++++----- source/blender/blenkernel/intern/pointcache.c | 4 +- source/blender/blenkernel/intern/seqeffects.c | 104 +++--- source/blender/blenkernel/intern/softbody.c | 404 ++++++++++----------- source/blender/blenkernel/intern/subsurf_ccg.c | 4 +- source/blender/blenkernel/intern/tracking.c | 2 +- source/blender/blenkernel/intern/writeffmpeg.c | 7 +- source/blender/blenlib/intern/BLI_kdtree.c | 26 +- source/blender/blenlib/intern/BLI_mempool.c | 2 +- source/blender/blenlib/intern/freetypefont.c | 8 +- source/blender/blenlib/intern/jitter.c | 14 +- source/blender/blenlib/intern/math_geom.c | 38 +- source/blender/blenlib/intern/math_matrix.c | 42 +-- source/blender/blenlib/intern/math_rotation.c | 6 +- source/blender/blenlib/intern/noise.c | 16 +- source/blender/blenlib/intern/path_util.c | 4 +- source/blender/blenlib/intern/storage.c | 28 +- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/blenloader/intern/writefile.c | 2 +- source/blender/collada/AnimationExporter.cpp | 6 +- source/blender/collada/AnimationImporter.cpp | 27 +- source/blender/collada/AnimationImporter.h | 2 +- source/blender/collada/TransformWriter.cpp | 4 +- source/blender/editors/animation/anim_filter.c | 4 +- source/blender/editors/armature/editarmature.c | 4 +- .../blender/editors/armature/editarmature_sketch.c | 2 +- source/blender/editors/armature/poselib.c | 2 +- source/blender/editors/armature/poseobject.c | 2 +- source/blender/editors/armature/reeb.c | 4 +- source/blender/editors/curve/editcurve.c | 8 +- source/blender/editors/include/ED_numinput.h | 2 +- .../blender/editors/interface/interface_handlers.c | 2 +- source/blender/editors/interface/resources.c | 2 +- source/blender/editors/mesh/bmesh_tools.c | 2 +- source/blender/editors/mesh/knifetool.c | 2 +- source/blender/editors/mesh/mesh_navmesh.c | 2 +- source/blender/editors/object/object_bake.c | 2 +- source/blender/editors/object/object_edit.c | 12 +- source/blender/editors/object/object_shapekey.c | 2 +- source/blender/editors/physics/physics_fluid.c | 2 +- source/blender/editors/render/render_shading.c | 2 +- source/blender/editors/sculpt_paint/paint_image.c | 3 +- source/blender/editors/sculpt_paint/sculpt.c | 4 +- source/blender/editors/space_file/file_draw.c | 2 +- source/blender/editors/space_file/file_ops.c | 2 +- source/blender/editors/space_file/filesel.c | 4 +- source/blender/editors/space_file/fsmenu.c | 5 +- source/blender/editors/space_logic/logic_window.c | 4 +- source/blender/editors/space_node/node_edit.c | 2 +- .../blender/editors/space_outliner/outliner_draw.c | 6 +- .../blender/editors/space_outliner/outliner_edit.c | 4 +- .../blender/editors/space_outliner/outliner_tree.c | 6 +- .../editors/space_sequencer/sequencer_edit.c | 2 +- source/blender/editors/space_view3d/drawobject.c | 6 +- source/blender/editors/space_view3d/view3d_draw.c | 2 +- source/blender/editors/space_view3d/view3d_edit.c | 2 +- source/blender/editors/space_view3d/view3d_snap.c | 2 +- source/blender/editors/space_view3d/view3d_view.c | 2 +- .../editors/transform/transform_conversions.c | 2 +- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 4 +- source/blender/ikplugin/intern/itasc_plugin.cpp | 4 +- source/blender/imbuf/intern/indexer.c | 2 +- source/blender/imbuf/intern/jp2.c | 4 +- source/blender/imbuf/intern/jpeg.c | 78 ++-- .../blender/imbuf/intern/openexr/openexr_api.cpp | 2 +- source/blender/imbuf/intern/scaling.c | 230 ++++++------ source/blender/imbuf/intern/thumbs_blend.c | 2 +- source/blender/makesdna/DNA_actuator_types.h | 2 +- source/blender/makesdna/DNA_object_force.h | 2 +- source/blender/modifiers/intern/MOD_boolean_util.c | 2 +- source/blender/modifiers/intern/MOD_uvproject.c | 6 +- .../nodes/composite/nodes/node_composite_rotate.c | 2 +- .../composite/nodes/node_composite_transform.c | 2 +- .../nodes/shader/nodes/node_shader_squeeze.c | 2 +- source/blender/python/intern/bpy_rna.c | 2 +- source/blender/quicktime/apple/quicktime_export.c | 2 +- source/blender/quicktime/quicktime_export.h | 2 +- .../render/intern/raytrace/rayobject_octree.cpp | 16 +- source/blender/render/intern/raytrace/reorganize.h | 4 +- .../render/intern/source/gammaCorrectionTables.c | 4 +- source/blender/render/intern/source/shadbuf.c | 3 +- source/blender/render/intern/source/shadeinput.c | 6 +- source/blender/render/intern/source/sunsky.c | 4 +- source/blender/windowmanager/intern/wm_window.c | 2 +- source/blenderplayer/bad_level_call_stubs/stubs.c | 2 +- .../gameengine/BlenderRoutines/KX_BlenderCanvas.h | 4 +- .../BlenderRoutines/KX_BlenderMouseDevice.cpp | 2 +- source/gameengine/Expressions/Operator2Expr.cpp | 12 +- source/gameengine/GamePlayer/common/GPC_Engine.cpp | 2 +- .../GamePlayer/common/GPC_KeyboardDevice.cpp | 2 +- .../GamePlayer/common/GPC_MouseDevice.cpp | 2 +- .../GamePlayer/ghost/GPG_KeyboardDevice.cpp | 192 +++++----- source/gameengine/Ketsji/KX_Camera.h | 2 +- .../gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 2 +- source/gameengine/Ketsji/KX_Dome.cpp | 8 +- source/gameengine/Ketsji/KX_GameObject.h | 2 +- source/gameengine/Ketsji/KX_MeshProxy.h | 2 +- source/gameengine/Ketsji/KX_PolyProxy.h | 2 +- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.h | 4 +- source/gameengine/Ketsji/KX_SteeringActuator.cpp | 2 +- source/gameengine/Ketsji/KX_TouchSensor.h | 2 +- source/gameengine/Ketsji/KX_VertexProxy.h | 2 +- .../Physics/Bullet/CcdPhysicsController.h | 2 +- .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 4 +- .../Physics/Bullet/CcdPhysicsEnvironment.h | 10 +- source/gameengine/Rasterizer/RAS_TexVert.cpp | 2 +- 149 files changed, 1066 insertions(+), 1047 deletions(-) diff --git a/intern/boolop/intern/BOP_MathUtils.cpp b/intern/boolop/intern/BOP_MathUtils.cpp index bcc0cca194e..020de2163a3 100644 --- a/intern/boolop/intern/BOP_MathUtils.cpp +++ b/intern/boolop/intern/BOP_MathUtils.cpp @@ -233,17 +233,17 @@ bool BOP_intersect(const MT_Vector3& vL1, const MT_Point3& pL1, const MT_Vector3 MT_Scalar den = (vL1.y()*vL2.x() - vL1.x() * vL2.y()); if (!BOP_fuzzyZero(den)) { - t = (pL2.y()*vL1.x() - vL1.y()*pL2.x() + pL1.x()*vL1.y() - pL1.y()*vL1.x()) / den ; + t = (pL2.y()*vL1.x() - vL1.y()*pL2.x() + pL1.x()*vL1.y() - pL1.y()*vL1.x()) / den; } else { den = (vL1.y()*vL2.z() - vL1.z() * vL2.y()); if (!BOP_fuzzyZero(den)) { - t = (pL2.y()*vL1.z() - vL1.y()*pL2.z() + pL1.z()*vL1.y() - pL1.y()*vL1.z()) / den ; + t = (pL2.y()*vL1.z() - vL1.y()*pL2.z() + pL1.z()*vL1.y() - pL1.y()*vL1.z()) / den; } else { den = (vL1.x()*vL2.z() - vL1.z() * vL2.x()); if (!BOP_fuzzyZero(den)) { - t = (pL2.x()*vL1.z() - vL1.x()*pL2.z() + pL1.z()*vL1.x() - pL1.x()*vL1.z()) / den ; + t = (pL2.x()*vL1.z() - vL1.x()*pL2.z() + pL1.z()*vL1.x() - pL1.x()*vL1.z()) / den; } else { return false; diff --git a/intern/boolop/intern/BOP_Merge2.cpp b/intern/boolop/intern/BOP_Merge2.cpp index 9028743bee3..6bec9ba8222 100644 --- a/intern/boolop/intern/BOP_Merge2.cpp +++ b/intern/boolop/intern/BOP_Merge2.cpp @@ -289,7 +289,7 @@ void BOP_Merge2::cleanup( void ) BOP_Indexs faces = (*edge)->getFaces(); for (BOP_IT_Indexs face = faces.begin(); face != faces.end(); ++face) { BOP_Face *f = m_mesh->getFace(*face); - if(f->getTAG()== UNCLASSIFIED) ; + if (f->getTAG()== UNCLASSIFIED); else (*edge)->removeFace(*face); } if( (*edge)->getFaces().size() == 0) (*edge)->setUsed(false); diff --git a/intern/bsp/intern/BSP_CSGMesh.h b/intern/bsp/intern/BSP_CSGMesh.h index 3fd1f0cebaf..4754f3bdc71 100644 --- a/intern/bsp/intern/BSP_CSGMesh.h +++ b/intern/bsp/intern/BSP_CSGMesh.h @@ -108,11 +108,10 @@ public : std::vector & VertexSet( - ) const ; - + ) const; std::vector & FaceSet( - ) const ; + ) const; std::vector & EdgeSet( diff --git a/intern/container/CTR_List.h b/intern/container/CTR_List.h index 7eb8dce7241..404a08fddf2 100644 --- a/intern/container/CTR_List.h +++ b/intern/container/CTR_List.h @@ -37,42 +37,42 @@ class CTR_Link { public: CTR_Link( - ) ; + ); CTR_Link( CTR_Link *next, CTR_Link *prev - ) ; + ); CTR_Link * getNext( - ) const ; + ) const; CTR_Link * getPrev( - ) const ; + ) const; bool isHead( - ) const ; + ) const; bool isTail( - ) const ; + ) const; void insertBefore( CTR_Link *link - ) ; + ); void insertAfter( CTR_Link *link - ) ; + ); void remove( - ) ; + ); private: CTR_Link *m_next; @@ -83,25 +83,25 @@ class CTR_List { public: CTR_List( - ) ; + ); CTR_Link * getHead( - ) const ; + ) const; CTR_Link * getTail( - ) const ; + ) const; void addHead( CTR_Link *link - ) ; + ); void addTail( CTR_Link *link - ) ; + ); private: CTR_Link m_head; diff --git a/intern/decimation/intern/LOD_ExternNormalEditor.h b/intern/decimation/intern/LOD_ExternNormalEditor.h index 1c637453467..52135196dc5 100644 --- a/intern/decimation/intern/LOD_ExternNormalEditor.h +++ b/intern/decimation/intern/LOD_ExternNormalEditor.h @@ -122,7 +122,7 @@ private : MT_Vector3 ComputeNormal( const LOD_TriFace &face - ) const ; + ) const; const MT_Vector3 diff --git a/intern/decimation/intern/LOD_FaceNormalEditor.h b/intern/decimation/intern/LOD_FaceNormalEditor.h index b2f941f990f..a221ab0bd7a 100644 --- a/intern/decimation/intern/LOD_FaceNormalEditor.h +++ b/intern/decimation/intern/LOD_FaceNormalEditor.h @@ -128,7 +128,7 @@ private : MT_Vector3 ComputeNormal( const LOD_TriFace &face - ) const ; + ) const; const MT_Vector3 diff --git a/intern/decimation/intern/LOD_ManMesh2.h b/intern/decimation/intern/LOD_ManMesh2.h index 63ea7912c2d..5d4e1aff4e6 100644 --- a/intern/decimation/intern/LOD_ManMesh2.h +++ b/intern/decimation/intern/LOD_ManMesh2.h @@ -76,11 +76,11 @@ public: std::vector & VertexSet( - ) const ; + ) const; std::vector & FaceSet( - ) const ; + ) const; std::vector & EdgeSet( diff --git a/intern/decimation/intern/LOD_MeshPrimitives.h b/intern/decimation/intern/LOD_MeshPrimitives.h index a43e29f3fe7..ea2d157308b 100644 --- a/intern/decimation/intern/LOD_MeshPrimitives.h +++ b/intern/decimation/intern/LOD_MeshPrimitives.h @@ -50,7 +50,7 @@ public : bool m_select_tag; LOD_Vertex( - ) ; + ); bool RemoveEdge( @@ -109,13 +109,13 @@ public : LOD_FaceInd OpFace( LOD_FaceInd f - ) const ; + ) const; void SwapFace( LOD_FaceInd old_f, LOD_FaceInd new_f - ) ; + ); // return the half edge face - the half edge is defined @@ -139,11 +139,11 @@ public : SwapVertex( LOD_VertexInd v_old, LOD_VertexInd v_new - ) ; + ); bool SelectTag( - ) const ; + ) const; void SetSelectTag( @@ -157,7 +157,7 @@ public : void SetOpenTag( int tag - ) ; + ); bool Degenerate( diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h index b47c4444081..a22b6bc371c 100644 --- a/intern/ghost/GHOST_C-api.h +++ b/intern/ghost/GHOST_C-api.h @@ -494,7 +494,7 @@ extern void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle, * @param windowhandle The handle to the window * @return The validity of the window. */ -extern int GHOST_GetValid(GHOST_WindowHandle windowhandle) ; +extern int GHOST_GetValid(GHOST_WindowHandle windowhandle); /** * Returns the type of drawing context used in this window. @@ -592,7 +592,7 @@ extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle, GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32* outX, - GHOST_TInt32* outY) ; + GHOST_TInt32* outY); /** * Converts a point in screen coordinates to client rectangle coordinates diff --git a/intern/ghost/intern/GHOST_SystemPathsX11.cpp b/intern/ghost/intern/GHOST_SystemPathsX11.cpp index 726149138ed..6dad3661a57 100644 --- a/intern/ghost/intern/GHOST_SystemPathsX11.cpp +++ b/intern/ghost/intern/GHOST_SystemPathsX11.cpp @@ -47,7 +47,7 @@ #endif #ifdef PREFIX -static const char *static_path= PREFIX "/share" ; +static const char *static_path= PREFIX "/share"; #else static const char *static_path= NULL; #endif diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 98c4785797d..f4b39d01d9e 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -716,7 +716,7 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP GHOST_EventKey* event; if (key != GHOST_kKeyUnknown) { - char utf8_char[6] = {0} ; + char utf8_char[6] = {0}; char ascii = 0; wchar_t utf16[2]={0}; diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h index 62f5ba341d4..d236c73dabd 100644 --- a/intern/ghost/intern/GHOST_SystemX11.h +++ b/intern/ghost/intern/GHOST_SystemX11.h @@ -174,7 +174,7 @@ public: GHOST_TSuccess getModifierKeys( GHOST_ModifierKeys& keys - ) const ; + ) const; /** * Returns the state of the mouse buttons (ouside the message queue). @@ -310,7 +310,7 @@ private : GHOST_WindowX11 * findGhostWindow( Window xwind - ) const ; + ) const; void processEvent( diff --git a/intern/ghost/intern/GHOST_WindowSDL.cpp b/intern/ghost/intern/GHOST_WindowSDL.cpp index dce844949ad..b8cbf9b474d 100644 --- a/intern/ghost/intern/GHOST_WindowSDL.cpp +++ b/intern/ghost/intern/GHOST_WindowSDL.cpp @@ -67,7 +67,7 @@ GHOST_WindowSDL::GHOST_WindowSDL(GHOST_SystemSDL *system, m_sdl_glcontext= SDL_GL_CreateContext(m_sdl_win); //fprintf(stderr, "Ignoring Xlib error: error code %d request code %d\n", - // theEvent->error_code, theEvent->request_code) ; + // theEvent->error_code, theEvent->request_code); setTitle(title); } diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index 3ceafcab3ce..85a9163ec91 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -373,7 +373,7 @@ GHOST_WindowX11( XFree(xsizehints); XClassHint * xclasshint = XAllocClassHint(); - int len = title.Length() +1 ; + const int len = title.Length() + 1; char *wmclass = (char *)malloc(sizeof(char) * len); strncpy(wmclass, (const char*)title, sizeof(char) * len); xclasshint->res_name = wmclass; @@ -485,10 +485,10 @@ GHOST_WindowX11( static int ApplicationErrorHandler(Display *display, XErrorEvent *theEvent) { fprintf(stderr, "Ignoring Xlib error: error code %d request code %d\n", - theEvent->error_code, theEvent->request_code) ; + theEvent->error_code, theEvent->request_code); /* No exit! - but keep lint happy */ - return 0 ; + return 0; } /* These C functions are copied from Wine 1.1.13's wintab.c */ @@ -588,7 +588,7 @@ static BOOL is_eraser(const char *name, const char *type) void GHOST_WindowX11::initXInputDevices() { - static XErrorHandler old_handler = (XErrorHandler) 0 ; + static XErrorHandler old_handler = (XErrorHandler) 0; XExtensionVersion *version = XGetExtensionVersion(m_display, INAME); if(version && (version != (XExtensionVersion*)NoSuchExtension)) { @@ -600,7 +600,7 @@ void GHOST_WindowX11::initXInputDevices() m_xtablet.CommonData.Active= GHOST_kTabletModeNone; /* Install our error handler to override Xlib's termination behavior */ - old_handler = XSetErrorHandler(ApplicationErrorHandler) ; + old_handler = XSetErrorHandler(ApplicationErrorHandler); for(int i=0; if = 2; tmp->g = 1; } - } else if (movie->streams[i].sh.Type == FCC("auds")) { - ; + } + else if (movie->streams[i].sh.Type == FCC("auds")) { + // pass + } */ } } diff --git a/source/blender/blenkernel/BKE_icons.h b/source/blender/blenkernel/BKE_icons.h index 85f259c3d94..3be11913f9e 100644 --- a/source/blender/blenkernel/BKE_icons.h +++ b/source/blender/blenkernel/BKE_icons.h @@ -82,7 +82,7 @@ void BKE_previewimg_free(struct PreviewImage **prv); void BKE_previewimg_free_id(struct ID *id); /* create a new preview image */ -struct PreviewImage* BKE_previewimg_create(void) ; +struct PreviewImage* BKE_previewimg_create(void); /* create a copy of the preview image */ struct PreviewImage* BKE_previewimg_copy(struct PreviewImage *prv); diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 926a0e2cc6c..e625545e6dd 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -343,7 +343,7 @@ struct bNode *nodeAddNode(struct bNodeTree *ntree, struct bNodeTemplate *ntemp); void nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node); void nodeUniqueName(struct bNodeTree *ntree, struct bNode *node); -void nodeRegisterType(struct bNodeTreeType *ttype, struct bNodeType *ntype) ; +void nodeRegisterType(struct bNodeTreeType *ttype, struct bNodeType *ntype); void nodeMakeDynamicType(struct bNode *node); int nodeDynamicUnlinkText(struct ID *txtid); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 0a6d8b7c041..61a8ea19621 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2541,7 +2541,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) } } } - nr_tris_to_pile = nr_verts-2 ; + nr_tris_to_pile = nr_verts - 2; if ( nr_tris_to_pile==1 || nr_tris_to_pile==2 ) { const int indices[] = {offs+0, offs+1, offs+2, offs+0, offs+2, (offs+3)&0x3 }; diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 000d74f110a..c181548eb19 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1497,8 +1497,8 @@ static void do_nla(Scene *scene, Object *ob, int blocktype) /* Determine if the current frame is within the strip's range */ length = strip->end-strip->start; actlength = strip->actend-strip->actstart; - striptime = (scene_cfra-(strip->start)) / length; - stripframe = (scene_cfra-(strip->start)) ; + striptime = (scene_cfra - strip->start) / length; + stripframe = (scene_cfra - strip->start); if (striptime>=0.0) { diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index bfafd96b95e..77523980a64 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1649,7 +1649,7 @@ int count_duplilist(Object *ob) for(; psys; psys=psys->next) pdup += psys->totpart; - if(pdup==0){ + if(pdup==0) { Mesh *me= ob->data; return me->totvert; } diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 36646c85dc1..c9eb19c0f32 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -194,7 +194,7 @@ static void copy_bonechildren(Bone* newBone, Bone* oldBone, Bone* actBone, Bone /* For each child in the list, update it's children */ newChildBone = newBone->childbase.first; - for (curBone = oldBone->childbase.first; curBone; curBone = curBone->next){ + for (curBone = oldBone->childbase.first; curBone; curBone = curBone->next) { newChildBone->parent = newBone; copy_bonechildren(newChildBone, curBone, actBone, newActBone); newChildBone = newChildBone->next; diff --git a/source/blender/blenkernel/intern/booleanops_mesh.c b/source/blender/blenkernel/intern/booleanops_mesh.c index 8dbf2c1c828..ea626df5018 100644 --- a/source/blender/blenkernel/intern/booleanops_mesh.c +++ b/source/blender/blenkernel/intern/booleanops_mesh.c @@ -45,7 +45,7 @@ void CSG_DestroyMeshDescriptor( CSG_MeshDescriptor *mesh -){ +) { // Call mesh descriptors destroy function.... mesh->m_destroy_func(mesh); } @@ -66,7 +66,7 @@ static void CSG_DestroyCSGMeshInternals( CSG_MeshDescriptor *mesh -){ +) { CSG_FreeVertexDescriptor(&(mesh->m_vertex_iterator)); CSG_FreeFaceDescriptor(&(mesh->m_face_iterator)); } @@ -102,7 +102,7 @@ MakeCSGMeshFromBlenderBase( CSG_LoadBlenderMesh( Object * obj, CSG_MeshDescriptor *output -){ +) { Mesh *me; if (output == NULL || obj == NULL) return 0; @@ -132,7 +132,7 @@ CSG_LoadBlenderMesh( int CSG_AddMeshToBlender( CSG_MeshDescriptor *mesh -){ +) { Mesh *me_new = NULL; Object *ob_new = NULL; float inv_mat[4][4]; @@ -172,7 +172,7 @@ CSG_PerformOp( CSG_MeshDescriptor *mesh2, int int_op_type, CSG_MeshDescriptor *output -){ +) { CSG_OperationType op_type; CSG_BooleanOperation * bool_op = CSG_NewBooleanFunction(); @@ -241,7 +241,7 @@ NewBooleanMeshTest( struct Base * base, struct Base * base_select, int op_type -){ +) { CSG_MeshDescriptor m1,m2,output; CSG_MeshDescriptor output2,output3; diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 9ad59574fa3..43621b3550e 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -118,7 +118,6 @@ static int cdDM_getNumTessFaces(DerivedMesh *dm) printf("%s: has no faces!, call DM_ensure_tessface() if you need them\n"); } #endif - return dm->numTessFaceData; } @@ -807,7 +806,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm, GPU_normal_setup( dm ); GPU_uv_setup( dm ); if( col != NULL ) { - /*if( realcol && dm->drawObject->colType == CD_TEXTURE_MCOL ) { + /*if( realcol && dm->drawObject->colType == CD_TEXTURE_MCOL ) { col = 0; } else if( mcol && dm->drawObject->colType == CD_MCOL ) { col = 0; diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 10a955760f0..ecb1ae4bed3 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -194,10 +194,10 @@ gsl_poly_solve_cubic (double a, double b, double c, if (R == 0 && Q == 0) { - *x0 = - a / 3 ; - *x1 = - a / 3 ; - *x2 = - a / 3 ; - return 3 ; + *x0 = - a / 3; + *x1 = - a / 3; + *x2 = - a / 3; + return 3; } else if (CR2 == CQ3) { @@ -222,7 +222,7 @@ gsl_poly_solve_cubic (double a, double b, double c, *x1 = - sqrtQ - a / 3; *x2 = 2 * sqrtQ - a / 3; } - return 3 ; + return 3; } else if (CR2 < CQ3) /* equivalent to R2 < Q3 */ { @@ -237,14 +237,14 @@ gsl_poly_solve_cubic (double a, double b, double c, /* Sort *x0, *x1, *x2 into increasing order */ if (*x0 > *x1) - mySWAP(*x0, *x1) ; + mySWAP(*x0, *x1); if (*x1 > *x2) { - mySWAP(*x1, *x2) ; + mySWAP(*x1, *x2); if (*x0 > *x1) - mySWAP(*x0, *x1) ; + mySWAP(*x0, *x1); } return 3; @@ -253,7 +253,7 @@ gsl_poly_solve_cubic (double a, double b, double c, { double sgnR = (R >= 0 ? 1 : -1); double A = -sgnR * pow (fabs (R) + sqrt (R2 - Q3), 1.0/3.0); - double B = Q / A ; + double B = Q / A; *x0 = A + B - a / 3; return 1; } @@ -297,27 +297,27 @@ gsl_poly_solve_quadratic (double a, double b, double c, { double sgnb = (b > 0 ? 1 : -1); double temp = -0.5 * (b + sgnb * sqrt (disc)); - double r1 = temp / a ; - double r2 = c / temp ; + double r1 = temp / a; + double r2 = c / temp; if (r1 < r2) { - *x0 = r1 ; - *x1 = r2 ; + *x0 = r1; + *x1 = r2; } else { - *x0 = r2 ; - *x1 = r1 ; + *x0 = r2; + *x1 = r1; } } return 2; } else if (disc == 0) { - *x0 = -0.5 * b / a ; - *x1 = -0.5 * b / a ; - return 2 ; + *x0 = -0.5 * b / a; + *x1 = -0.5 * b / a; + return 2; } else { diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index a95cd8d00d8..822293c35e1 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -51,7 +51,7 @@ void defgroup_copy_list(ListBase *outbase, ListBase *inbase) outbase->first= outbase->last= NULL; - for (defgroup = inbase->first; defgroup; defgroup=defgroup->next){ + for (defgroup = inbase->first; defgroup; defgroup=defgroup->next) { defgroupn= defgroup_duplicate(defgroup); BLI_addtail(outbase, defgroupn); } diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 217eb0d68c6..a5097054de2 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -349,7 +349,7 @@ static void dag_add_collision_field_relation(DagForest *dag, Scene *scene, Objec for(base = scene->base.first; base; base= base->next) { if((base->lay & ob->lay) && base->object->pd) { Object *ob1= base->object; - if((ob1->pd->deflect || ob1->pd->forcefield) && (ob1 != ob)) { + if((ob1->pd->deflect || ob1->pd->forcefield) && (ob1 != ob)) { node2 = dag_get_node(dag, ob1); dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Field Collision"); } @@ -380,7 +380,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O node->customdata_mask= 0; if (ob->type == OB_ARMATURE) { - if (ob->pose){ + if (ob->pose) { bPoseChannel *pchan; bConstraint *con; @@ -1421,7 +1421,8 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a retval = 1; } // else if (itA->node->color == DAG_BLACK) { // cross or forward -// ; +// +// } } itA = itA->next; } @@ -1770,7 +1771,7 @@ void DAG_scene_sort(Main *bmain, Scene *sce) if (node) { node = pop_queue(nqueue); if (node->ob == sce) // we are done - break ; + break; node->color = DAG_BLACK; time++; @@ -2068,7 +2069,7 @@ void DAG_scene_flush_update(Main *bmain, Scene *sce, unsigned int lay, const sho sce->theDag->time++; // so we know which nodes were accessed lasttime= sce->theDag->time; for(itA = firstnode->child; itA; itA= itA->next) { - if(itA->node->lasttime!=lasttime && itA->node->type==ID_OB) { + if(itA->node->lasttime!=lasttime && itA->node->type==ID_OB) { ob= (Object*)(itA->node->ob); if(ob->recalc & OB_RECALC_ALL) { @@ -2565,7 +2566,7 @@ static void dag_id_flush_update(Scene *sce, ID *id) } if(idtype == ID_MC) { - for(obt=bmain->object.first; obt; obt= obt->id.next){ + for(obt=bmain->object.first; obt; obt= obt->id.next) { bConstraint *con; for (con = obt->constraints.first; con; con=con->next) { bConstraintTypeInfo *cti= constraint_get_typeinfo(con); @@ -2890,7 +2891,7 @@ void DAG_pose_sort(Object *ob) if (node) { node = pop_queue(nqueue); if (node->ob == NULL) // we are done - break ; + break; node->color = DAG_BLACK; /* put node in new list */ diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 3a67c66165a..ea84f73b27f 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1110,7 +1110,7 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase, if(forRender || nu->hide==0) { int resolu= nu->resolu, resolv= nu->resolv; - if(forRender){ + if(forRender) { if(cu->resolu_ren) resolu= cu->resolu_ren; if(cu->resolv_ren) resolv= cu->resolv_ren; } diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 9a8946ae61e..edd1bc6d679 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -4161,7 +4161,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force /* * Spread Effect */ - if (surface->effect & MOD_DPAINT_EFFECT_DO_SPREAD) { + if (surface->effect & MOD_DPAINT_EFFECT_DO_SPREAD) { float eff_scale = distance_scale*EFF_MOVEMENT_PER_FRAME*surface->spread_speed*timescale; /* Copy current surface to the previous points array to read unmodified values */ @@ -4204,7 +4204,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force /* * Shrink Effect */ - if (surface->effect & MOD_DPAINT_EFFECT_DO_SHRINK) { + if (surface->effect & MOD_DPAINT_EFFECT_DO_SHRINK) { float eff_scale = distance_scale*EFF_MOVEMENT_PER_FRAME*surface->shrink_speed*timescale; /* Copy current surface to the previous points array to read unmodified values */ diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 69d860bfb08..82a5d9aba3a 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -508,7 +508,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNU falloff=0.0f; else if(eff->pd->zdir == PFIELD_Z_NEG && fac > 0.0f) falloff=0.0f; - else switch(eff->pd->falloff){ + else switch(eff->pd->falloff) { case PFIELD_FALL_SPHERE: falloff*= falloff_func_dist(eff->pd, efd->distance); break; @@ -610,8 +610,9 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin ParticleKey state; /* exclude the particle itself for self effecting particles */ - if(eff->psys == point->psys && *efd->index == point->index) - ; + if(eff->psys == point->psys && *efd->index == point->index) { + /* pass */ + } else { ParticleSimulationData sim= {NULL}; sim.scene= eff->scene; @@ -809,7 +810,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP } } - if(eff->pd->flag & PFIELD_TEX_2D){ + if(eff->pd->flag & PFIELD_TEX_2D) { float fac = -dot_v3v3(force, efd->nor); madd_v3_v3fl(force, efd->nor, fac); } @@ -836,7 +837,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected copy_v3_v3(force, efd->vec_to_point); - switch(pd->forcefield){ + switch(pd->forcefield) { case PFIELD_WIND: copy_v3_v3(force, efd->nor); mul_v3_fl(force, strength * efd->falloff); @@ -1000,7 +1001,7 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we do_physical_effector(eff, &efd, point, force); // for softbody backward compatibility - if(point->flag & PE_WIND_AS_SPEED && impulse){ + if(point->flag & PE_WIND_AS_SPEED && impulse) { sub_v3_v3v3(temp2, force, temp1); sub_v3_v3v3(impulse, impulse, temp2); } diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 95c0aa60991..8098706e370 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -571,7 +571,7 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue), * 2) if before first frame or after last frame, make sure some cycling is in use */ if (evaltime < prevkey[0]) { - if (data->before_mode) { + if (data->before_mode) { side= -1; mode= data->before_mode; cycles= data->before_cycles; diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index f45899ff365..5a37a65ddbf 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -333,7 +333,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i nu2->flagu = CU_NURB_CYCLIC; bp = (BPoint*)MEM_callocN(4 * sizeof(BPoint),"underline_bp"); - if (bp == NULL){ + if (bp == NULL) { MEM_freeN(nu2); return; } @@ -399,7 +399,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo while(nu1) { bezt1 = nu1->bezt; - if (bezt1){ + if (bezt1) { nu2 =(Nurb*) MEM_mallocN(sizeof(Nurb),"duplichar_nurb"); if (nu2 == NULL) break; memcpy(nu2, nu1, sizeof(struct Nurb)); @@ -419,7 +419,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo i = nu2->pntsu; bezt2 = (BezTriple*)MEM_mallocN(i * sizeof(BezTriple),"duplichar_bezt2"); - if (bezt2 == NULL){ + if (bezt2 == NULL) { MEM_freeN(nu2); break; } diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 7ac395212ab..183483ef7a8 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -123,7 +123,7 @@ void unlink_group(Group *group) #endif } - for(psys=ob->particlesystem.first; psys; psys=psys->next){ + for(psys=ob->particlesystem.first; psys; psys=psys->next) { if(psys->part->dup_group==group) psys->part->dup_group= NULL; #if 0 /* not used anymore, only keps for readfile.c, no need to account for this */ diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index bcbce2bc1c2..58c88682d3f 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -263,7 +263,7 @@ int BKE_icon_getid(struct ID* id) id->icon_id = get_next_free_id(); - if (!id->icon_id){ + if (!id->icon_id) { printf("BKE_icon_getid: Internal error - not enough IDs\n"); return 0; } diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 3bcb262fac8..093399832a1 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -489,7 +489,7 @@ void IDP_ReplaceGroupInGroup(IDProperty *dest, IDProperty *src) void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop) { IDProperty *loop; - if((loop= IDP_GetPropertyFromGroup(group, prop->name))) { + if ((loop= IDP_GetPropertyFromGroup(group, prop->name))) { BLI_insertlink(&group->data.group, loop, prop); BLI_remlink(&group->data.group, loop); @@ -506,7 +506,7 @@ void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop) or 1 if it succeeded in adding to the group.*/ int IDP_AddToGroup(IDProperty *group, IDProperty *prop) { - if(IDP_GetPropertyFromGroup(group, prop->name) == NULL) { + if (IDP_GetPropertyFromGroup(group, prop->name) == NULL) { group->len++; BLI_addtail(&group->data.group, prop); return 1; @@ -517,7 +517,7 @@ int IDP_AddToGroup(IDProperty *group, IDProperty *prop) int IDP_InsertToGroup(IDProperty *group, IDProperty *previous, IDProperty *pnew) { - if(IDP_GetPropertyFromGroup(group, pnew->name) == NULL) { + if (IDP_GetPropertyFromGroup(group, pnew->name) == NULL) { group->len++; BLI_insertlink(&group->data.group, previous, pnew); return 1; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index f848ee3a676..3cc73d7f7f1 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1122,11 +1122,11 @@ int BKE_add_image_extension(char *string, const char imtype) } #endif #ifdef WITH_CINEON - else if(imtype==R_IMF_IMTYPE_CINEON){ + else if(imtype==R_IMF_IMTYPE_CINEON) { if (!BLI_testextensie(string, ".cin")) extension= ".cin"; } - else if(imtype==R_IMF_IMTYPE_DPX){ + else if(imtype==R_IMF_IMTYPE_DPX) { if (!BLI_testextensie(string, ".dpx")) extension= ".dpx"; } diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 757d3ddf9ac..f54a885c55e 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -1697,7 +1697,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec while(search) { // only handle active springs - // if(((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)){} + // if(((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)) {} cloth_calc_spring_force(clmd, search->link, lF, lX, lV, dFdV, dFdX, time); search = search->next; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 8a615b379e8..63c9d799f04 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1329,7 +1329,7 @@ static void lib_indirect_test_id(ID *id, Library *lib) // XXX old animation system! -------------------------------------- { bActionStrip *strip; - for (strip=ob->nlastrips.first; strip; strip=strip->next){ + for (strip=ob->nlastrips.first; strip; strip=strip->next) { LIBTAG(strip->object); LIBTAG(strip->act); LIBTAG(strip->ipo); diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index 0f6fedb0b08..4a988f0b278 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -233,13 +233,13 @@ int BKE_mesh_validate_arrays( Mesh *me, if(remove == FALSE) { if(mf->v4) { if(mf->v1 == mf->v2) { PRINT(" face %u: verts invalid, v1/v2 both %u\n", i, mf->v1); remove= do_fixes; } - if(mf->v1 == mf->v3) { PRINT(" face %u: verts invalid, v1/v3 both %u\n", i, mf->v1); remove= do_fixes; } - if(mf->v1 == mf->v4) { PRINT(" face %u: verts invalid, v1/v4 both %u\n", i, mf->v1); remove= do_fixes; } + if(mf->v1 == mf->v3) { PRINT(" face %u: verts invalid, v1/v3 both %u\n", i, mf->v1); remove= do_fixes; } + if(mf->v1 == mf->v4) { PRINT(" face %u: verts invalid, v1/v4 both %u\n", i, mf->v1); remove= do_fixes; } - if(mf->v2 == mf->v3) { PRINT(" face %u: verts invalid, v2/v3 both %u\n", i, mf->v2); remove= do_fixes; } - if(mf->v2 == mf->v4) { PRINT(" face %u: verts invalid, v2/v4 both %u\n", i, mf->v2); remove= do_fixes; } + if(mf->v2 == mf->v3) { PRINT(" face %u: verts invalid, v2/v3 both %u\n", i, mf->v2); remove= do_fixes; } + if(mf->v2 == mf->v4) { PRINT(" face %u: verts invalid, v2/v4 both %u\n", i, mf->v2); remove= do_fixes; } - if(mf->v3 == mf->v4) { PRINT(" face %u: verts invalid, v3/v4 both %u\n", i, mf->v3); remove= do_fixes; } + if(mf->v3 == mf->v4) { PRINT(" face %u: verts invalid, v3/v4 both %u\n", i, mf->v3); remove= do_fixes; } } else { if(mf->v1 == mf->v2) { PRINT(" faceT %u: verts invalid, v1/v2 both %u\n", i, mf->v1); remove= do_fixes; } diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 12f403d028f..a6795ed3a7d 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1073,7 +1073,7 @@ void BKE_nlastrip_set_active (AnimData *adt, NlaStrip *strip) /* loop over tracks, deactivating*/ for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { - for (nls= nlt->strips.first; nls; nls= nls->next) { + for (nls= nlt->strips.first; nls; nls= nls->next) { if (nls != strip) nls->flag &= ~NLASTRIP_FLAG_ACTIVE; else diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index f1412981935..00a66edc2b4 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -422,7 +422,7 @@ void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u { if (oc->_do_disp_y) { - ocr->disp[1] = INTERP(oc->_disp_y) ; + ocr->disp[1] = INTERP(oc->_disp_y); } if (oc->_do_normals) { diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 38a73daab2a..fc20ae8d636 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -167,7 +167,7 @@ ParticleSystem *psys_get_current(Object *ob) ParticleSystem *psys; if(ob==NULL) return NULL; - for(psys=ob->particlesystem.first; psys; psys=psys->next){ + for(psys=ob->particlesystem.first; psys; psys=psys->next) { if(psys->flag & PSYS_CURRENT) return psys; } @@ -219,12 +219,12 @@ Object *psys_get_lattice(ParticleSimulationData *sim) { Object *lattice=NULL; - if(psys_in_edit_mode(sim->scene, sim->psys)==0){ + if(psys_in_edit_mode(sim->scene, sim->psys)==0) { ModifierData *md = (ModifierData*)psys_get_modifier(sim->ob, sim->psys); - for(; md; md=md->next){ - if(md->type==eModifierType_Lattice){ + for(; md; md=md->next) { + if(md->type==eModifierType_Lattice) { LatticeModifierData *lmd = (LatticeModifierData *)md; lattice=lmd->object; break; @@ -523,7 +523,7 @@ void psys_free_pdd(ParticleSystem *psys) /* free everything */ void psys_free(Object *ob, ParticleSystem * psys) { - if(psys){ + if(psys) { int nr = 0; ParticleSystem * tpsys; @@ -536,14 +536,14 @@ void psys_free(Object *ob, ParticleSystem * psys) if(psys->edit && psys->free_edit) psys->free_edit(psys->edit); - if(psys->child){ + if(psys->child) { MEM_freeN(psys->child); psys->child = NULL; psys->totchild = 0; } // check if we are last non-visible particle system - for(tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next){ + for(tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next) { if(tpsys->part) { if(ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR)) @@ -557,7 +557,7 @@ void psys_free(Object *ob, ParticleSystem * psys) if(!nr) ob->transflag &= ~OB_DUPLIPARTS; - if(psys->part){ + if(psys->part) { psys->part->id.us--; psys->part=NULL; } @@ -744,7 +744,7 @@ void psys_render_restore(Object *ob, ParticleSystem *psys) psys_free_path_cache(psys, NULL); - if(psys->child){ + if(psys->child) { MEM_freeN(psys->child); psys->child= 0; psys->totchild= 0; @@ -1029,10 +1029,10 @@ void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, Partic interp_v3_v3v3v3v3(result->co, keys[0].co, keys[1].co, keys[2].co, keys[3].co, t); - if(velocity){ + if(velocity) { float temp[3]; - if(dt>0.999f){ + if(dt>0.999f) { key_curve_position_weights(dt-0.001f, t, type); interp_v3_v3v3v3v3(temp, keys[0].co, keys[1].co, keys[2].co, keys[3].co, t); sub_v3_v3v3(result->vel, result->co, temp); @@ -1351,7 +1351,7 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData keytime = (real_t - keys[1].time) / dfra; /* convert velocity to timestep size */ - if(pind->keyed || pind->cache || point_vel){ + if(pind->keyed || pind->cache || point_vel) { invdt = dfra * 0.04f * (psys ? psys->part->timetweak : 1.f); mul_v3_fl(keys[1].vel, invdt); mul_v3_fl(keys[2].vel, invdt); @@ -1424,7 +1424,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or interp_v3_v3v3v3v3(vec, v1, v2, v3, v4, w); - if(nor){ + if(nor) { if(mface->flag & ME_SMOOTH) interp_v3_v3v3v3v3(nor, n1, n2, n3, n4, w); else @@ -1434,7 +1434,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or else { interp_v3_v3v3v3(vec, v1, v2, v3, w); - if(nor){ + if(nor) { if(mface->flag & ME_SMOOTH) interp_v3_v3v3v3(nor, n1, n2, n3, w); else @@ -1443,8 +1443,8 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or } /* calculate tangent vectors */ - if(utan && vtan){ - if(tface){ + if(utan && vtan) { + if(tface) { uv1= tface->uv[0]; uv2= tface->uv[1]; uv3= tface->uv[2]; @@ -1459,7 +1459,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or map_to_sphere( uv4, uv4+1,v4[0], v4[1], v4[2]); } - if(v4){ + if(v4) { s1= uv3[0] - uv1[0]; s2= uv4[0] - uv1[0]; @@ -1570,7 +1570,7 @@ static float psys_interpolate_value_from_verts(DerivedMesh *dm, short from, int if(values==0 || index==-1) return 0.0; - switch(from){ + switch(from) { case PART_FROM_VERT: return values[index]; case PART_FROM_FACE: @@ -1824,10 +1824,10 @@ ParticleSystemModifierData *psys_get_modifier(Object *ob, ParticleSystem *psys) ModifierData *md; ParticleSystemModifierData *psmd; - for(md=ob->modifiers.first; md; md=md->next){ - if(md->type==eModifierType_ParticleSystem){ + for(md=ob->modifiers.first; md; md=md->next) { + if(md->type==eModifierType_ParticleSystem) { psmd= (ParticleSystemModifierData*) md; - if(psmd->psys==psys){ + if(psmd->psys==psys) { return psmd; } } @@ -1842,22 +1842,22 @@ static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float * { /* TODO */ float zerovec[3]={0.0f,0.0f,0.0f}; - if(vec){ + if(vec) { copy_v3_v3(vec,zerovec); } - if(nor){ + if(nor) { copy_v3_v3(nor,zerovec); } - if(utan){ + if(utan) { copy_v3_v3(utan,zerovec); } - if(vtan){ + if(vtan) { copy_v3_v3(vtan,zerovec); } - if(orco){ + if(orco) { copy_v3_v3(orco,zerovec); } - if(ornor){ + if(ornor) { copy_v3_v3(ornor,zerovec); } } @@ -1866,8 +1866,8 @@ static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float * /************************************************/ void psys_particle_on_emitter(ParticleSystemModifierData *psmd, int from, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor) { - if(psmd){ - if(psmd->psys->part->distr==PART_DISTR_GRID && psmd->psys->part->from != PART_FROM_VERT){ + if(psmd) { + if(psmd->psys->part->distr==PART_DISTR_GRID && psmd->psys->part->from != PART_FROM_VERT) { if(vec) copy_v3_v3(vec,fuv); @@ -2007,13 +2007,13 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float inp_y=dot_v3v3(y_vec, vec_one); inp_z=dot_v3v3(z_vec, vec_one); - if(inp_y > 0.5f){ + if(inp_y > 0.5f) { copy_v3_v3(state_co, y_vec); mul_v3_fl(y_vec, amplitude*(float)cos(t)); mul_v3_fl(z_vec, amplitude/2.f*(float)sin(2.f*t)); } - else if(inp_z > 0.0f){ + else if(inp_z > 0.0f) { mul_v3_v3fl(state_co, z_vec, (float)sin((float)M_PI/3.f)); madd_v3_v3fl(state_co, y_vec, -0.5f); @@ -2041,7 +2041,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float shape = 2.f*(float)M_PI * (1.f+shape); - if(t 1.0f) mul_v3_fl(effect, 1.0f / totstrength); CLAMP(totstrength, 0.0f, 1.0f); @@ -2287,7 +2287,7 @@ static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheK } static int check_path_length(int k, ParticleCacheKey *keys, ParticleCacheKey *state, float max_length, float *cur_length, float length, float *dvec) { - if(*cur_length + length > max_length){ + if(*cur_length + length > max_length) { mul_v3_fl(dvec, (max_length - *cur_length) / length); add_v3_v3v3(state->co, (state - 1)->co, dvec); keys->steps = k; @@ -2325,12 +2325,12 @@ float *psys_cache_vgroup(DerivedMesh *dm, ParticleSystem *psys, int vgroup) /* hair dynamics pinning vgroup */ } - else if(psys->vgroup[vgroup]){ + else if(psys->vgroup[vgroup]) { MDeformVert *dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT); - if(dvert){ + if(dvert) { int totvert=dm->getNumVerts(dm), i; vg=MEM_callocN(sizeof(float)*totvert, "vg_cache"); - if(psys->vg_neg&(1<vg_neg&(1<vgroup[vgroup] - 1); } @@ -2357,14 +2357,14 @@ void psys_find_parents(ParticleSimulationData *sim) tree=BLI_kdtree_new(totparent); - for(p=0,cpa=sim->psys->child; ppsys->child; ppsmd,from,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co,0,0,0,orco,0); BLI_kdtree_insert(tree, p, orco, NULL); } BLI_kdtree_balance(tree); - for(; ppsmd,from,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co,0,0,0,orco,0); cpa->parent=BLI_kdtree_find_nearest(tree, orco, NULL, NULL); } @@ -2426,7 +2426,7 @@ static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float c steps = (int)pow(2.0, (double)pset->draw_step); } - if(totchild && part->childtype==PART_CHILD_FACES){ + if(totchild && part->childtype==PART_CHILD_FACES) { totparent=(int)(totchild*part->parents*0.3f); if(G.rendering && part->child_nbr && part->ren_child_nbr) @@ -2479,7 +2479,7 @@ static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float c /* set correct ipo timing */ #if 0 // XXX old animation system - if(part->flag&PART_ABS_TIME && part->ipo){ + if(part->flag&PART_ABS_TIME && part->ipo) { calc_ipo(part->ipo, cfra); execute_ipo((ID *)part, part->ipo); } @@ -2509,7 +2509,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle if(!pcache) return; - if(ctx->between){ + if(ctx->between) { ParticleData *pa = psys->particles + cpa->pa[0]; int w, needupdate; float foffset, wsum=0.f; @@ -2638,8 +2638,8 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle } /* create the child path */ - for(k=0,child=child_keys; k<=ctx->steps; k++,child++){ - if(ctx->between){ + for(k=0,child=child_keys; k<=ctx->steps; k++,child++) { + if(ctx->between) { int w=0; zero_v3(child->co); @@ -2696,7 +2696,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle } } - for(k=0,child=child_keys; k<=ctx->steps; k++,child++){ + for(k=0,child=child_keys; k<=ctx->steps; k++,child++) { t = (float)k/(float)ctx->steps; if(ctx->totparent) @@ -2720,7 +2720,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle do_child_modifiers(&ctx->sim, &ptex, (ParticleKey *)par, par_rot, cpa, orco, hairmat, (ParticleKey *)child, t); /* we have to correct velocity because of kink & clump */ - if(k>1){ + if(k>1) { sub_v3_v3v3((child-1)->vel, child->co, (child-2)->co); mul_v3_fl((child-1)->vel, 0.5); @@ -2732,7 +2732,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle sub_v3_v3v3(child->vel, child->co, (child-1)->co); /* check if path needs to be cut before actual end of data points */ - if(k){ + if(k) { sub_v3_v3v3(dvec, child->co, (child-1)->co); length = 1.0f/(float)ctx->steps; k = check_path_length(k, child_keys, child, max_length, &cur_length, length, dvec); @@ -2763,7 +2763,7 @@ static void *exec_child_path_cache(void *data) ChildParticle *cpa; int i, totchild= ctx->totchild, first= 0; - if(thread->tot > 1){ + if(thread->tot > 1) { first= ctx->parent_pass? 0 : ctx->totparent; totchild= ctx->parent_pass? ctx->totparent : ctx->totchild; } @@ -2988,7 +2988,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra) dietime = birthtime + pa_length * (dietime - birthtime); /*--interpolate actual path from data points--*/ - for(k=0, ca=cache[p]; k<=steps; k++, ca++){ + for(k=0, ca=cache[p]; k<=steps; k++, ca++) { time = (float)k / (float)steps; t = birthtime + time * (dietime - birthtime); result.time = -t; @@ -3062,7 +3062,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra) psys->totcached = totpart; - if(psys->lattice){ + if(psys->lattice) { end_latt_deform(psys->lattice); psys->lattice= NULL; } @@ -3125,7 +3125,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf } /*---first main loop: create all actual particles' paths---*/ - for(i=0, point=edit->points; ipoints; itotcached && !(point->flag & PEP_EDIT_RECALC)) continue; @@ -3142,7 +3142,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf /* should init_particle_interpolation set this ? */ - if(pset->brushtype==PE_BRUSH_WEIGHT){ + if(pset->brushtype==PE_BRUSH_WEIGHT) { pind.hkey[0] = NULL; /* pa != NULL since the weight brush is only available for hair */ pind.hkey[1] = pa->hair; @@ -3172,7 +3172,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf } /*--interpolate actual path from data points--*/ - for(k=0, ca=cache[i]; k<=steps; k++, ca++){ + for(k=0, ca=cache[i]; k<=steps; k++, ca++) { time = (float)k / (float)steps; t = birthtime + time * (dietime - birthtime); result.time = -t; @@ -3202,7 +3202,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf } /* selection coloring in edit mode */ - if(pset->brushtype==PE_BRUSH_WEIGHT){ + if(pset->brushtype==PE_BRUSH_WEIGHT) { float t2; if(k==0) { @@ -3225,8 +3225,8 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf pind.hkey[0] = pind.hkey[1] - 1; } else { - if((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT){ - if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT){ + if((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT) { + if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) { copy_v3_v3(ca->col, sel_col); } else{ @@ -3235,7 +3235,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf } } else{ - if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT){ + if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) { keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time)); interp_v3_v3v3(ca->col, nosel_col, sel_col, keytime); } @@ -3282,7 +3282,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf /************************************************/ void copy_particle_key(ParticleKey *to, ParticleKey *from, int time) { - if(time){ + if(time) { memcpy(to,from,sizeof(ParticleKey)); } else{ @@ -3669,7 +3669,7 @@ void make_local_particlesettings(ParticleSettings *part) /* test objects */ for(ob= bmain->object.first; ob && ELEM(FALSE, is_lib, is_local); ob= ob->id.next) { ParticleSystem *psys=ob->particlesystem.first; - for(; psys; psys=psys->next){ + for(; psys; psys=psys->next) { if(psys->part==part) { if(ob->id.lib) is_lib= TRUE; else is_local= TRUE; @@ -3691,7 +3691,7 @@ void make_local_particlesettings(ParticleSettings *part) /* do objects */ for(ob= bmain->object.first; ob; ob= ob->id.next) { ParticleSystem *psys; - for(psys= ob->particlesystem.first; psys; psys=psys->next){ + for(psys= ob->particlesystem.first; psys; psys=psys->next) { if(psys->part==part && ob->id.lib==0) { psys->part= part_new; part_new->id.us++; @@ -3763,9 +3763,9 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti ptex->length= 1.0f - part->randlength * PSYS_FRAND(child_index + 26); ptex->length*= part->clength_thres < PSYS_FRAND(child_index + 27) ? part->clength : 1.0f; - for(m=0; mmapto){ + if(mtex && mtex->mapto) { float def=mtex->def_var; short blend=mtex->blendtype; short texco = mtex->texco; @@ -3831,9 +3831,9 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex ptex->time = (float)(pa - sim->psys->particles)/(float)sim->psys->totpart; - for(m=0; mmapto){ + if(mtex && mtex->mapto) { float def=mtex->def_var; short blend=mtex->blendtype; short texco = mtex->texco; @@ -3869,7 +3869,7 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex if((event & mtex->mapto) & PAMAP_TIME) { /* the first time has to set the base value for time regardless of blend mode */ - if((setvars&MAP_PA_TIME)==0){ + if((setvars&MAP_PA_TIME)==0) { int flip= (mtex->timefac < 0.0f); float timefac= fabsf(mtex->timefac); ptex->time *= 1.0f - timefac; @@ -3912,10 +3912,10 @@ float psys_get_child_time(ParticleSystem *psys, ChildParticle *cpa, float cfra, ParticleSettings *part = psys->part; float time, life; - if(part->childtype==PART_CHILD_FACES){ + if(part->childtype==PART_CHILD_FACES) { int w=0; time=0.0; - while(w<4 && cpa->pa[w]>=0){ + while(w<4 && cpa->pa[w]>=0) { time+=cpa->w[w]*(psys->particles+cpa->pa[w])->time; w++; } @@ -4001,7 +4001,7 @@ static void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *pte /* state is safe to cast, since only co and vel are used */ guided = do_guides(sim->psys->effectors, (ParticleKey*)state, cpa->parent, t); - if(guided==0){ + if(guided==0) { float clump = do_clump(state, par, t, part->clumpfac, part->clumppow, ptex ? ptex->clump : 1.f); if(kink_freq != 0.f) { @@ -4054,7 +4054,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * t=state->time; CLAMP(t, 0.0f, 1.0f); - if(ppathcache) { ParticleCacheKey result; @@ -4098,7 +4098,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * } } } - else if(totchild){ + else if(totchild) { //invert_m4_m4(imat,ob->obmat); /* interpolate childcache directly if it exists */ @@ -4115,16 +4115,16 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * if(state->time < 0.0f) t = psys_get_child_time(psys, cpa, -state->time, NULL, NULL); - if(totchild && part->childtype==PART_CHILD_FACES){ + if(totchild && part->childtype==PART_CHILD_FACES) { /* part->parents could still be 0 so we can't test with totparent */ between=1; } - if(between){ + if(between) { int w = 0; float foffset; /* get parent states */ - while(w<4 && cpa->pa[w]>=0){ + while(w<4 && cpa->pa[w]>=0) { keys[w].time = state->time; psys_get_particle_on_path(sim, cpa->pa[w], keys+w, 1); w++; @@ -4179,7 +4179,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * /* correct child ipo timing */ #if 0 // XXX old animation system - if((part->flag&PART_ABS_TIME)==0 && part->ipo){ + if((part->flag&PART_ABS_TIME)==0 && part->ipo) { calc_ipo(part->ipo, 100.0f*t); execute_ipo((ID *)part, part->ipo); } @@ -4193,14 +4193,14 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * /* TODO: assign vertex groups */ get_child_modifier_parameters(part, &ctx, cpa, cpa_from, cpa_num, cpa_fuv, orco, &ptex); - if(between){ + if(between) { int w=0; state->co[0] = state->co[1] = state->co[2] = 0.0f; state->vel[0] = state->vel[1] = state->vel[2] = 0.0f; /* child position is the weighted sum of parent positions */ - while(w<4 && cpa->pa[w]>=0){ + while(w<4 && cpa->pa[w]>=0) { state->co[0] += cpa->w[w] * keys[w].co[0]; state->co[1] += cpa->w[w] * keys[w].co[1]; state->co[2] += cpa->w[w] * keys[w].co[2]; @@ -4227,11 +4227,11 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * do_child_modifiers(sim, &ptex, par, par->rot, cpa, orco, hairmat, state, t); /* try to estimate correct velocity */ - if(vel){ + if(vel) { ParticleKey tstate; float length = len_v3(state->vel); - if(t>=0.001f){ + if(t>=0.001f) { tstate.time=t-0.001f; psys_get_particle_on_path(sim,p,&tstate,0); sub_v3_v3v3(state->vel,state->co,tstate.co); @@ -4263,11 +4263,11 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta /* negative time means "use current time" */ cfra = state->time > 0 ? state->time : BKE_curframe(sim->scene); - if(p>=totpart){ + if(p>=totpart) { if(!psys->totchild) return 0; - if(part->childtype == PART_CHILD_FACES){ + if(part->childtype == PART_CHILD_FACES) { if(!(psys->flag & PSYS_KEYED)) return 0; @@ -4303,13 +4303,13 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta cfra = MIN2(cfra, pa->dietime); } - if(sim->psys->flag & PSYS_KEYED){ + if(sim->psys->flag & PSYS_KEYED) { state->time= -cfra; psys_get_particle_on_path(sim, p, state,1); return 1; } else{ - if(cpa){ + if(cpa) { float mat[4][4]; ParticleKey *key1; float t = (cfra - pa->time) / pa->lifetime; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 8d12460b71b..206d9036ba7 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -306,7 +306,7 @@ static int get_psys_tot_child(struct Scene *scene, ParticleSystem *psys) static void alloc_child_particles(ParticleSystem *psys, int tot) { - if(psys->child){ + if(psys->child) { /* only re-allocate if we have to */ if(psys->part->childtype && psys->totchild == tot) { memset(psys->child, 0, tot*sizeof(ChildParticle)); @@ -415,13 +415,13 @@ static void distribute_simple_children(Scene *scene, Object *ob, DerivedMesh *fi alloc_child_particles(psys, totpart); cpa = psys->child; - for(i=0; itotpart; p++,cpa++){ + for(i=0; itotpart; p++,cpa++) { float length=2.0; cpa->parent=p; /* create even spherical distribution inside unit sphere */ - while(length>=1.0f){ + while(length>=1.0f) { cpa->fuv[0]=2.0f*BLI_frand()-1.0f; cpa->fuv[1]=2.0f*BLI_frand()-1.0f; cpa->fuv[2]=2.0f*BLI_frand()-1.0f; @@ -449,7 +449,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) copy_v3_v3(max, mv->co); mv++; - for(i=1; ico[0]); min[1]=MIN2(min[1],mv->co[1]); min[2]=MIN2(min[2],mv->co[2]); @@ -483,9 +483,9 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) min[1]+= d < delta[1] ? d/2.f : delta[1]/2.f; min[2]+= d < delta[2] ? d/2.f : delta[2]/2.f; - for(i=0,p=0,pa=psys->particles; iparticles; ifuv[0] = min[0] + (float)i*d; pa->fuv[1] = min[1] + (float)j*d; pa->fuv[2] = min[2] + (float)k*d; @@ -496,7 +496,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) } /* enable particles near verts/edges/faces/inside surface */ - if(from==PART_FROM_VERT){ + if(from==PART_FROM_VERT) { float vec[3]; pa=psys->particles; @@ -505,7 +505,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) min[1] -= d/2.0f; min[2] -= d/2.0f; - for(i=0,mv=mvert; ico,min); vec[0]/=delta[0]; vec[1]/=delta[1]; @@ -515,7 +515,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) +(int)(vec[2]*(size[2]-1)))->flag &= ~PARS_UNEXIST; } } - else if(ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)){ + else if(ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) { float co1[3], co2[3]; MFace *mface= NULL, *mface_array; @@ -526,13 +526,13 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) totface=dm->getNumTessFaces(dm); mface=mface_array=dm->getTessFaceDataArray(dm,CD_MFACE); - for(a=0; aparticles + a1*a1mul + a2*a2mul; @@ -543,22 +543,22 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) co1[a] -= 0.001f*d; /* lets intersect the faces */ - for(i=0; iv1].co); copy_v3_v3(v2, mvert[mface->v2].co); copy_v3_v3(v3, mvert[mface->v3].co); - if(isect_axial_line_tri_v3(a, co1, co2, v2, v3, v1, &lambda)){ + if(isect_axial_line_tri_v3(a, co1, co2, v2, v3, v1, &lambda)) { if(from==PART_FROM_FACE) (pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST; else /* store number of intersections */ (pa+(int)(lambda*size[a])*a0mul)->hair_index++; } - if(mface->v4){ + if(mface->v4) { copy_v3_v3(v4, mvert[mface->v4].co); - if(isect_axial_line_tri_v3(a, co1, co2, v4, v1, v3, &lambda)){ + if(isect_axial_line_tri_v3(a, co1, co2, v4, v1, v3, &lambda)) { if(from==PART_FROM_FACE) (pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST; else @@ -567,10 +567,10 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) } } - if(from==PART_FROM_VOLUME){ + if(from==PART_FROM_VOLUME) { int in=pa->hair_index%2; if(in) pa->hair_index++; - for(i=0; ihair_index%2) (pa+i*a0mul)->flag &= ~PARS_UNEXIST; /* odd intersections == in->out / out->in */ @@ -584,9 +584,9 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) } if(psys->part->flag & PART_GRID_HEXAGONAL) { - for(i=0,p=0,pa=psys->particles; iparticles; ifuv[0] += d/2.f; @@ -599,11 +599,11 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) } } - if(psys->part->flag & PART_GRID_INVERT){ - for(i=0; ipart->flag & PART_GRID_INVERT) { + for(i=0; iparticles + res*(i*res + j); - for(k=0; kflag ^= PARS_UNEXIST; } } @@ -612,7 +612,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys) if(psys->part->grid_rand > 0.f) { float rfac = d * psys->part->grid_rand; - for(p=0,pa=psys->particles; ptotpart; p++,pa++){ + for(p=0,pa=psys->particles; ptotpart; p++,pa++) { if(pa->flag & PARS_UNEXIST) continue; @@ -765,7 +765,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch pa->fuv[1] = pa->fuv[2] = pa->fuv[3] = 0.0; #if ONLY_WORKING_WITH_PA_VERTS - if(ctx->tree){ + if(ctx->tree) { KDTreeNearest ptn[3]; int w, maxw; @@ -773,7 +773,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch transform_mesh_orco_verts((Mesh*)ob->data, &orco1, 1, 1); maxw = BLI_kdtree_find_n_nearest(ctx->tree,3,orco1,NULL,ptn); - for(w=0; wverts[w]=ptn->num; } } @@ -785,7 +785,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch pa->num = i = ctx->index[p]; mface = dm->getTessFaceData(dm,i,CD_MFACE); - switch(distr){ + switch(distr) { case PART_DISTR_JIT: if(ctx->jitlevel == 1) { if(mface->v4) @@ -810,7 +810,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch pa->foffset= 0.0f; /* experimental */ - if(from==PART_FROM_VOLUME){ + if(from==PART_FROM_VOLUME) { MVert *mvert=dm->getVertDataArray(dm,CD_MVERT); tot=dm->getNumTessFaces(dm); @@ -825,25 +825,25 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch min_d=2.0; intersect=0; - for(i=0,mface=dm->getTessFaceDataArray(dm,CD_MFACE); igetTessFaceDataArray(dm,CD_MFACE); inum) continue; v1=mvert[mface->v1].co; v2=mvert[mface->v2].co; v3=mvert[mface->v3].co; - if(isect_line_tri_v3(co1, co2, v2, v3, v1, &cur_d, 0)){ - if(cur_dfoffset=cur_d*50.0f; /* to the middle of volume */ intersect=1; } } - if(mface->v4){ + if(mface->v4) { v4=mvert[mface->v4].co; - if(isect_line_tri_v3(co1, co2, v4, v1, v3, &cur_d, 0)){ - if(cur_dfoffset=cur_d*50.0f; /* to the middle of volume */ intersect=1; @@ -853,7 +853,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch } if(intersect==0) pa->foffset=0.0; - else switch(distr){ + else switch(distr) { case PART_DISTR_JIT: pa->foffset*= ctx->jit[p%(2*ctx->jitlevel)]; break; @@ -883,7 +883,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch cpa->num = ctx->index[p]; - if(ctx->tree){ + if(ctx->tree) { KDTreeNearest ptn[10]; int w,maxw;//, do_seams; float maxd /*, mind,dd */, totw= 0.0f; @@ -898,24 +898,24 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch /* mind=ptn[0].dist; */ /* UNUSED */ /* the weights here could be done better */ - for(w=0; w=0){ + for(w=0,i=0; w=0) { cpa->pa[i]=parent[w]; cpa->w[i]=pweight[w]; totw+=pweight[w]; i++; } } - for(;i<4; i++){ + for(;i<4; i++) { cpa->pa[i]=-1; cpa->w[i]=0.0f; } @@ -993,7 +993,7 @@ static void distribute_invalid(Scene *scene, ParticleSystem *psys, int from) int p, totchild = get_psys_tot_child(scene, psys); if(psys->child && totchild) { - for(p=0,cpa=psys->child; pchild; pfuv[0]=cpa->fuv[1]=cpa->fuv[2]=cpa->fuv[3]= 0.0; cpa->foffset= 0.0f; cpa->parent=0; @@ -1057,7 +1057,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D } else { /* Grid distribution */ - if(part->distr==PART_DISTR_GRID && from != PART_FROM_VERT){ + if(part->distr==PART_DISTR_GRID && from != PART_FROM_VERT) { BLI_srandom(31415926 + psys->seed); dm= CDDM_from_mesh((Mesh*)ob->data, ob); distribute_grid(dm,psys); @@ -1079,7 +1079,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D tree=BLI_kdtree_new(totpart); - for(p=0,pa=psys->particles; pparticles; pfrom,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,nor,0,0,orco,ornor); transform_mesh_orco_verts((Mesh*)ob->data, &orco, 1, 1); BLI_kdtree_insert(tree, p, orco, ornor); @@ -1128,7 +1128,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D /* Get total number of emission elements and allocate needed arrays */ totelem = (from == PART_FROM_VERT) ? dm->getNumVerts(dm) : dm->getNumTessFaces(dm); - if(totelem == 0){ + if(totelem == 0) { distribute_invalid(scene, psys, children ? PART_FROM_CHILD : 0); if(G.f & G_DEBUG) @@ -1147,14 +1147,14 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D jitter_offset = MEM_callocN(sizeof(float)*totelem, "particle_distribution_jitoff"); /* Calculate weights from face areas */ - if((part->flag&PART_EDISTR || children) && from != PART_FROM_VERT){ + if((part->flag&PART_EDISTR || children) && from != PART_FROM_VERT) { MVert *v1, *v2, *v3, *v4; float totarea=0.f, co1[3], co2[3], co3[3], co4[3]; float (*orcodata)[3]; orcodata= dm->getVertDataArray(dm, CD_ORCO); - for(i=0; igetTessFaceData(dm,i,CD_MFACE); if(orcodata) { @@ -1206,13 +1206,13 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D /* Calculate weights from vgroup */ vweight = psys_cache_vgroup(dm,psys,PSYS_VG_DENSITY); - if(vweight){ + if(vweight) { if(from==PART_FROM_VERT) { for(i=0;igetTessFaceData(dm,i,CD_MFACE); tweight = vweight[mf->v1] + vweight[mf->v2] + vweight[mf->v3]; @@ -1402,7 +1402,7 @@ static void distribute_particles(ParticleSimulationData *sim, int from) PARTICLE_PSMD; int distr_error=0; - if(psmd){ + if(psmd) { if(psmd->dm) distribute_particles_on_dm(sim, from); else @@ -1411,7 +1411,7 @@ static void distribute_particles(ParticleSimulationData *sim, int from) else distribute_particles_on_shape(sim, from); - if(distr_error){ + if(distr_error) { distribute_invalid(sim->scene, sim->psys, from); fprintf(stderr,"Particle distribution error!\n"); @@ -1467,7 +1467,7 @@ void psys_threads_free(ParticleThread *threads) if(ctx->vg_roughe) MEM_freeN(ctx->vg_roughe); - if(ctx->sim.psys->lattice){ + if(ctx->sim.psys->lattice) { end_latt_deform(ctx->sim.psys->lattice); ctx->sim.psys->lattice= NULL; } @@ -1602,7 +1602,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P normalize_v3(nor); /* -tangent */ - if(part->tanfac!=0.0f){ + if(part->tanfac!=0.0f) { //float phase=vg_rot?2.0f*(psys_particle_value_from_verts(sim->psmd->dm,part->from,pa,vg_rot)-0.5f):0.0f; float phase=0.0f; mul_v3_fl(vtan,-cosf((float)M_PI*(part->tanphase+phase))); @@ -1620,7 +1620,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P /* -velocity (boids need this even if there's no random velocity) */ - if(part->randfac != 0.0f || (part->phystype==PART_PHYS_BOIDS && pa->boid)){ + if(part->randfac != 0.0f || (part->phystype==PART_PHYS_BOIDS && pa->boid)) { r_vel[0] = 2.0f * (PSYS_FRAND(p + 10) - 0.5f); r_vel[1] = 2.0f * (PSYS_FRAND(p + 11) - 0.5f); r_vel[2] = 2.0f * (PSYS_FRAND(p + 12) - 0.5f); @@ -1630,7 +1630,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P } /* -angular velocity */ - if(part->avemode==PART_AVE_RAND){ + if(part->avemode==PART_AVE_RAND) { r_ave[0] = 2.0f * (PSYS_FRAND(p + 13) - 0.5f); r_ave[1] = 2.0f * (PSYS_FRAND(p + 14) - 0.5f); r_ave[2] = 2.0f * (PSYS_FRAND(p + 15) - 0.5f); @@ -1640,7 +1640,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P } /* -rotation */ - if(part->randrotfac != 0.0f){ + if(part->randrotfac != 0.0f) { r_rot[0] = 2.0f * (PSYS_FRAND(p + 16) - 0.5f); r_rot[1] = 2.0f * (PSYS_FRAND(p + 17) - 0.5f); r_rot[2] = 2.0f * (PSYS_FRAND(p + 18) - 0.5f); @@ -1685,12 +1685,12 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P /* -velocity from: */ /* *reactions */ - if(dtime > 0.f){ + if(dtime > 0.f) { sub_v3_v3v3(vel, pa->state.vel, pa->prev_state.vel); } /* *emitter velocity */ - if(dtime != 0.f && part->obfac != 0.f){ + if(dtime != 0.f && part->obfac != 0.f) { sub_v3_v3v3(vel, loc, state->co); mul_v3_fl(vel, part->obfac/dtime); } @@ -1736,9 +1736,9 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P /* -rotation */ unit_qt(state->rot); - if(part->rotmode){ + if(part->rotmode) { /* create vector into which rotation is aligned */ - switch(part->rotmode){ + switch(part->rotmode) { case PART_ROT_NOR: copy_v3_v3(rot_vec, nor); break; @@ -1781,8 +1781,8 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P zero_v3(state->ave); - if(part->avemode){ - switch(part->avemode){ + if(part->avemode) { + switch(part->avemode) { case PART_AVE_SPIN: copy_v3_v3(state->ave, vel); break; @@ -1835,7 +1835,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, } - if(part->type == PART_HAIR){ + if(part->type == PART_HAIR) { pa->lifetime = 100.0f; } else{ @@ -1966,7 +1966,7 @@ static void set_keyed_keys(ParticleSimulationData *sim) psys_get_particle_state(&ksim, p%ksim.psys->totpart, key, 1); - if(psys->flag & PSYS_KEYED_TIMING){ + if(psys->flag & PSYS_KEYED_TIMING) { key->time = pa->time + pt->time; if(pt->duration != 0.0f && k+1 < totkeys) { copy_particle_key(key+1, key, 1); @@ -2099,7 +2099,7 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d if(pa->prev_state.time < 0.f && integrator == PART_INT_VERLET) integrator = PART_INT_EULER; - switch(integrator){ + switch(integrator) { case PART_INT_EULER: steps=1; break; @@ -2118,7 +2118,7 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d states->time = 0.f; - for(i=0; istate.co, states->co, states->vel, dtime); madd_v3_v3v3fl(pa->state.vel, states->vel, acceleration, dtime); break; case PART_INT_MIDPOINT: - if(i==0){ + if(i==0) { madd_v3_v3v3fl(states[1].co, states->co, states->vel, dtime*0.5f); madd_v3_v3v3fl(states[1].vel, states->vel, acceleration, dtime*0.5f); states[1].time = dtime*0.5f; @@ -2151,7 +2151,7 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d } break; case PART_INT_RK4: - switch(i){ + switch(i) { case 0: copy_v3_v3(dx[0], states->vel); mul_v3_fl(dx[0], dtime); @@ -2252,7 +2252,7 @@ static void sph_spring_delete(ParticleSystem *psys, int j) psys->tot_fluidsprings--; - if (psys->tot_fluidsprings < psys->alloc_fluidsprings/2 && psys->alloc_fluidsprings > PSYS_FLUID_SPRINGS_INITIAL_SIZE){ + if (psys->tot_fluidsprings < psys->alloc_fluidsprings/2 && psys->alloc_fluidsprings > PSYS_FLUID_SPRINGS_INITIAL_SIZE) { psys->alloc_fluidsprings /= 2; psys->fluid_springs = (ParticleSpring*)MEM_reallocN(psys->fluid_springs, psys->alloc_fluidsprings * sizeof(ParticleSpring)); } @@ -2508,7 +2508,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa madd_v3_v3fl(force, vec, -10.f * spring_constant * (1.f - rij/h) * (spring->rest_length - rij)); } - else if(fluid->spring_frames == 0 || (pa->prev_state.time-pa->time) <= fluid->spring_frames){ + else if(fluid->spring_frames == 0 || (pa->prev_state.time-pa->time) <= fluid->spring_frames) { ParticleSpring temp_spring; temp_spring.particle_index[0] = index; temp_spring.particle_index[1] = pfn->index; @@ -2621,7 +2621,7 @@ static void basic_force_cb(void *efdata_v, ParticleKey *state, float *force, flo madd_v3_v3fl(force, state->vel, -part->dragfac * pa->size * pa->size * len_v3(state->vel)); /* brownian force */ - if(part->brownfac != 0.0f){ + if(part->brownfac != 0.0f) { force[0] += (BLI_frand()-0.5f) * part->brownfac; force[1] += (BLI_frand()-0.5f) * part->brownfac; force[2] += (BLI_frand()-0.5f) * part->brownfac; @@ -2684,8 +2684,8 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f { float rotfac, rot1[4], rot2[4]={1.0,0.0,0.0,0.0}, dtime=dfra*timestep; - if((part->flag & PART_ROT_DYN)==0){ - if(part->avemode==PART_AVE_SPIN){ + if((part->flag & PART_ROT_DYN)==0) { + if(part->avemode==PART_AVE_SPIN) { float angle; float len1 = len_v3(pa->prev_state.vel); float len2 = len_v3(pa->state.vel); @@ -2704,7 +2704,7 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f } rotfac=len_v3(pa->state.ave); - if(rotfac == 0.0f){ /* unit_qt(in VecRotToQuat) doesn't give unit quat [1,0,0,0]?? */ + if(rotfac == 0.0f) { /* unit_qt(in VecRotToQuat) doesn't give unit quat [1,0,0,0]?? */ rot1[0]=1.0f; rot1[1]=rot1[2]=rot1[3]=0; } @@ -3145,7 +3145,7 @@ static int collision_detect(ParticleData *pa, ParticleCollision *col, BVHTreeRay if(hit->dist == 0.0f) hit->dist = col->original_ray_length = 0.000001f; - for(coll = colliders->first; coll; coll=coll->next){ + for(coll = colliders->first; coll; coll=coll->next) { /* for boids: don't check with current ground object */ if(coll->ob == col->skip) continue; @@ -3400,7 +3400,7 @@ static void collision_check(ParticleSimulationData *sim, int p, float dfra, floa } /* 10 iterations to catch multiple collisions */ - while(collision_count < COLLISION_MAX_COLLISIONS){ + while(collision_count < COLLISION_MAX_COLLISIONS) { if(collision_detect(pa, &col, &hit, sim->colliders)) { collision_count++; @@ -3432,7 +3432,7 @@ static void psys_update_path_cache(ParticleSimulationData *sim, float cfra) if(alloc || psys->recalc&PSYS_RECALC_CHILD || (psys->vgroup[PSYS_VG_DENSITY] && (sim->ob && sim->ob->mode & OB_MODE_WEIGHT_PAINT))) distr=1; - if(distr){ + if(distr) { if(alloc) realloc_particles(sim, sim->psys->totpart); @@ -3830,18 +3830,18 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) /* store this, so we can do multiple loops over particles */ pa->state.time = dfra; - if(dietime <= cfra && psys->cfra < dietime){ + if(dietime <= cfra && psys->cfra < dietime) { /* particle dies some time between this and last step */ pa->state.time = dietime - ((birthtime > psys->cfra) ? birthtime : psys->cfra); pa->alive = PARS_DYING; } - else if(birthtime <= cfra && birthtime >= psys->cfra){ + else if(birthtime <= cfra && birthtime >= psys->cfra) { /* particle is born some time between this and last step*/ reset_particle(sim, pa, dfra*timestep, cfra); pa->alive = PARS_ALIVE; pa->state.time = cfra - birthtime; } - else if(dietime < cfra){ + else if(dietime < cfra) { /* nothing to be done when particle is dead */ } @@ -3923,7 +3923,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) /* finalize particle state and time after dynamics */ LOOP_DYNAMIC_PARTICLES { - if(pa->alive == PARS_DYING){ + if(pa->alive == PARS_DYING) { pa->alive=PARS_DEAD; pa->state.time=pa->dietime; } @@ -3982,7 +3982,7 @@ static void cached_step(ParticleSimulationData *sim, float cfra) else pa->alive = PARS_ALIVE; - if(psys->lattice){ + if(psys->lattice) { end_latt_deform(psys->lattice); psys->lattice= NULL; } @@ -3997,7 +3997,7 @@ static void cached_step(ParticleSimulationData *sim, float cfra) static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra)) { ParticleSystem *psys = sim->psys; - if(psys->particles){ + if(psys->particles) { MEM_freeN(psys->particles); psys->particles = 0; psys->totpart = 0; @@ -4263,7 +4263,7 @@ static void system_step(ParticleSimulationData *sim, float cfra) update_children(sim); /* cleanup */ - if(psys->lattice){ + if(psys->lattice) { end_latt_deform(psys->lattice); psys->lattice= NULL; } @@ -4322,7 +4322,7 @@ void psys_check_boid_data(ParticleSystem *psys) pa->boid = bpa++; } } - else if(pa->boid){ + else if(pa->boid) { MEM_freeN(pa->boid); LOOP_PARTICLES pa->boid = NULL; @@ -4466,7 +4466,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys) /* first step is negative so particles get killed and reset */ psys->cfra= 1.0f; - for(i=0; i<=part->hair_step; i++){ + for(i=0; i<=part->hair_step; i++) { hcfra=100.0f*(float)i/(float)psys->part->hair_step; if((part->flag & PART_HAIR_REGROW)==0) BKE_animsys_evaluate_animdata(scene, &part->id, part->adt, hcfra, ADT_RECALC_ANIM); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index bf9ed8b17e3..705f198865a 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -275,7 +275,7 @@ static void ptcache_particle_read(int index, void *psys_v, void **data, float cf if(cfra > pa->state.time) memcpy(&pa->prev_state, &pa->state, sizeof(ParticleKey)); - if(old_data){ + if(old_data) { /* old format cache */ memcpy(&pa->state, old_data, sizeof(ParticleKey)); return; @@ -3015,7 +3015,7 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) PointCache *cache = pid->cache; int last_exact = cache->last_exact; - if (!G.relbase_valid){ + if (!G.relbase_valid) { cache->flag &= ~PTCACHE_DISK_CACHE; if (G.f & G_DEBUG) printf("File must be saved before using disk cache!\n"); diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index d88a5c26c2c..aebdf3cef65 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -495,7 +495,7 @@ static void do_alphaover_effect_float(float facf0, float facf1, int x, int y, /* rt = rt1 over rt2 (alpha from rt1) */ fac= fac2; - mfac= 1.0f - (fac2*rt1[3]) ; + mfac= 1.0f - (fac2 * rt1[3]); if(fac <= 0.0f) { memcpy(rt, rt2, 4 * sizeof(float)); @@ -906,9 +906,9 @@ static void makeGammaTables(float gamma) /* multiplication factors used in scaling the interpolation. */ for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++ ) { gamfactor_table[i] = inv_color_step - * (gamma_range_table[i + 1] - gamma_range_table[i]) ; + * (gamma_range_table[i + 1] - gamma_range_table[i]); inv_gamfactor_table[i] = inv_color_step - * (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]) ; + * (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]); } } /* end of void makeGammaTables(float gamma) */ @@ -971,7 +971,7 @@ static void gamtabs(float gamma) else if(gamma==1.0f) igamtab1[a-1]= 256*a-1; else { val= a/256.0f; - igamtab1[a-1]= (65535.0*pow(val, gamma)) -1 ; + igamtab1[a - 1]= (65535.0 * pow(val, gamma)) - 1; } } @@ -1631,7 +1631,7 @@ float hyp3,hyp4,b4,b5 if(wipezone->flip) x = xo - x; angle = wipezone->angle; - if(wipe->forward){ + if(wipe->forward) { posx = facf0 * xo; posy = facf0 * yo; } else{ @@ -1699,9 +1699,9 @@ float hyp3,hyp4,b4,b5 hwidth = minf(hwidth, fabsf(b3-b1)/2.0f); - if(b2 < b1 && b2 < b3 ){ + if(b2 < b1 && b2 < b3 ) { output = in_band(hwidth,hyp,0,1); - } else if(b2 > b1 && b2 > b3 ){ + } else if(b2 > b1 && b2 > b3 ) { output = in_band(hwidth,hyp2,0,1); } else { if( hyp < hwidth && hyp2 > hwidth ) @@ -1724,7 +1724,7 @@ float hyp3,hyp4,b4,b5 widthf = wipe->edgeWidth*2.0f*(float)M_PI; temp1 = 2.0f * (float)M_PI * facf0; - if(wipe->forward){ + if(wipe->forward) { temp1 = 2.0f*(float)M_PI - temp1; } @@ -1736,7 +1736,7 @@ float hyp3,hyp4,b4,b5 else if(x<=0 && y <= 0) temp2 += (float)M_PI; else if(x >= 0 && y <= 0) temp2 = 2.0f*(float)M_PI - temp2; - if(wipe->forward){ + if(wipe->forward) { temp3 = temp1-(widthf*0.5f)*facf0; temp4 = temp1+(widthf*0.5f)*(1-facf0); } else{ @@ -1775,10 +1775,10 @@ float hyp3,hyp4,b4,b5 temp2 = yo*(1-facf0/2)-yo*facf0/2; pointdist = sqrt(temp1*temp1 + temp2*temp2); - if(b2 < b1 && b2 < b3 ){ + if(b2 < b1 && b2 < b3 ) { if(hwidth < pointdist) output = in_band(wipezone,hwidth,hyp,facf0,0,1); - } else if(b2 > b1 && b2 > b3 ){ + } else if(b2 > b1 && b2 > b3 ) { if(hwidth < pointdist) output = in_band(wipezone,hwidth,hyp2,facf0,0,1); } else { @@ -1799,10 +1799,10 @@ float hyp3,hyp4,b4,b5 hyp = abs(angle*x+y+(-posy/2-angle*posx/2))*wipezone->pythangle; hyp2 = abs(angle*x+y+(-(yo-posy/2)-angle*(xo-posx/2)))*wipezone->pythangle; - if(b2 < b1 && b2 < b3 ){ + if(b2 < b1 && b2 < b3 ) { if(hwidth < pointdist) output *= in_band(wipezone,hwidth,hyp,facf0,0,1); - } else if(b2 > b1 && b2 > b3 ){ + } else if(b2 > b1 && b2 > b3 ) { if(hwidth < pointdist) output *= in_band(wipezone,hwidth,hyp2,facf0,0,1); } else { @@ -1911,10 +1911,10 @@ static void do_wipe_effect_byte(Sequence *seq, float facf0, float UNUSED(facf1), } rt+=4; - if(rt1 !=NULL){ + if(rt1 !=NULL) { rt1+=4; } - if(rt2 !=NULL){ + if(rt2 !=NULL) { rt2+=4; } } @@ -1969,10 +1969,10 @@ static void do_wipe_effect_float(Sequence *seq, float facf0, float UNUSED(facf1) } rt+=4; - if(rt1 !=NULL){ + if(rt1 !=NULL) { rt1+=4; } - if(rt2 !=NULL){ + if(rt2 !=NULL) { rt2+=4; } } @@ -2107,7 +2107,7 @@ static void do_transform(Scene *scene, Sequence *seq, float UNUSED(facf0), int x } // Translate - if(!transform->percent){ + if(!transform->percent) { float rd_s = (scene->r.size/100.0f); translate_x = transform->xIni*rd_s+(x/2.0f); @@ -2173,7 +2173,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height, /* Allocate memory for the filter elements */ halfWidth = ((quality+1)*blur); filter = (float *)MEM_mallocN(sizeof(float)*halfWidth*2, "blurbitmapfilter"); - if (!filter){ + if (!filter) { MEM_freeN (temp); return; } @@ -2185,7 +2185,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height, /* Blancmange (bmange@airdmhor.gen.nz) */ k = -1.0f/(2.0f*(float)M_PI*blur*blur); - for (ix = 0;ix< halfWidth;ix++){ + for (ix = 0;ix< halfWidth;ix++) { weight = (float)exp(k*(ix*ix)); filter[halfWidth - ix] = weight; filter[halfWidth + ix] = weight; @@ -2201,16 +2201,16 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height, filter[ix]/=fval; /* Blur the rows */ - for (y=0;y=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i=0)&&(i0){ + if (intensity>0) { out[index+GlowR]=MIN2(255*clamp, (in[index+GlowR]*boost*intensity)/255); out[index+GlowG]=MIN2(255*clamp, (in[index+GlowG]*boost*intensity)/255); out[index+GlowB]=MIN2(255*clamp, (in[index+GlowB]*boost*intensity)/255); @@ -2563,7 +2563,7 @@ static void RVIsolateHighlights_float (float* in, float* out, /* Isolate the intensity */ intensity=(in[index+GlowR]+in[index+GlowG]+in[index+GlowB]-threshold); - if (intensity>0){ + if (intensity>0) { out[index+GlowR]=MIN2(clamp, (in[index+GlowR]*boost*intensity)); out[index+GlowG]=MIN2(clamp, (in[index+GlowG]*boost*intensity)); out[index+GlowB]=MIN2(clamp, (in[index+GlowB]*boost*intensity)); diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index e48a17ac274..063a274715c 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -113,7 +113,7 @@ typedef struct ReferenceVert { typedef struct ReferenceState { float com[3]; /* center of mass*/ ReferenceVert *ivert; /* list of intial values */ -}ReferenceState ; +}ReferenceState; /*private scratch pad for caching and other data only needed when alive*/ @@ -196,7 +196,7 @@ static float sb_time_scale(Object *ob) /* defining the frames to *real* time relation */ { SoftBody *sb= ob->soft; /* is supposed to be there */ - if (sb){ + if (sb) { return(sb->physics_speed); /*hrms .. this could be IPO as well :) estimated range [0.001 sluggish slug - 100.0 very fast (i hope ODE solver can handle that)] @@ -226,10 +226,10 @@ static float sb_time_scale(Object *ob) static float _final_goal(Object *ob,BodyPoint *bp)/*jow_go_for2_5 */ { float f = -1999.99f; - if (ob){ + if (ob) { SoftBody *sb= ob->soft; /* is supposed to be there */ if (!(ob->softflag & OB_SB_GOAL)) return (0.0f); - if (sb&&bp){ + if (sb&&bp) { if (bp->goal < 0.0f) return (0.0f); f = sb->mingoal + bp->goal*ABS(sb->maxgoal - sb->mingoal); f = pow(f, 4.0f); @@ -242,9 +242,9 @@ static float _final_goal(Object *ob,BodyPoint *bp)/*jow_go_for2_5 */ static float _final_mass(Object *ob,BodyPoint *bp) { - if (ob){ + if (ob) { SoftBody *sb= ob->soft; /* is supposed to be there */ - if (sb&&bp){ + if (sb&&bp) { return(bp->mass*sb->nodemass); } } @@ -319,7 +319,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob) pccd_M->mvert = MEM_dupallocN(cmd->xnew); /* note that xnew coords are already in global space, */ /* determine the ortho BB */ - for (i=0; i < pccd_M->totvert; i++){ + for (i=0; i < pccd_M->totvert; i++) { /* evaluate limits */ copy_v3_v3(v,pccd_M->mvert[i].co); pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull); @@ -341,7 +341,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob) /* anyhoo we need to walk the list of faces and find OBB they live in */ - for (i=0; i < pccd_M->totface; i++){ + for (i=0; i < pccd_M->totface; i++) { mima->minx=mima->miny=mima->minz=1e30f; mima->maxx=mima->maxy=mima->maxz=-1e30f; @@ -369,7 +369,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - if (mface->v4){ + if (mface->v4) { copy_v3_v3(v,pccd_M->mvert[mface->v4].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); @@ -397,8 +397,8 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) cmd =(CollisionModifierData *)modifiers_findByType(ob, eModifierType_Collision); /* first some paranoia checks */ - if (!cmd) return ; - if (!cmd->numverts || !cmd->numfaces) return ; + if (!cmd) return; + if (!cmd->numverts || !cmd->numfaces) return; if ((pccd_M->totvert != cmd->numverts) || (pccd_M->totface != cmd->numfaces)) return; @@ -417,7 +417,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) pccd_M->mvert = MEM_dupallocN(cmd->xnew); /* note that xnew coords are already in global space, */ /* determine the ortho BB */ - for (i=0; i < pccd_M->totvert; i++){ + for (i=0; i < pccd_M->totvert; i++) { /* evaluate limits */ copy_v3_v3(v,pccd_M->mvert[i].co); pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull); @@ -445,7 +445,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) /* anyhoo we need to walk the list of faces and find OBB they live in */ - for (i=0; i < pccd_M->totface; i++){ + for (i=0; i < pccd_M->totface; i++) { mima->minx=mima->miny=mima->minz=1e30f; mima->maxx=mima->maxy=mima->maxz=-1e30f; @@ -473,7 +473,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - if (mface->v4){ + if (mface->v4) { copy_v3_v3(v,pccd_M->mvert[mface->v4].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); @@ -508,7 +508,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) mima->maxy = MAX2(mima->maxy,v[1]+hull); mima->maxz = MAX2(mima->maxz,v[2]+hull); - if (mface->v4){ + if (mface->v4) { copy_v3_v3(v,pccd_M->mprevvert[mface->v4].co); mima->minx = MIN2(mima->minx,v[0]-hull); mima->miny = MIN2(mima->miny,v[1]-hull); @@ -523,12 +523,12 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M) mface++; } - return ; + return; } static void ccd_mesh_free(ccd_Mesh *ccdm) { - if (ccdm && (ccdm->savety == CCD_SAVETY )){ /*make sure we're not nuking objects we don't know*/ + if (ccdm && (ccdm->savety == CCD_SAVETY )) { /*make sure we're not nuking objects we don't know*/ MEM_freeN(ccdm->mface); MEM_freeN(ccdm->mvert); if (ccdm->mprevvert) MEM_freeN(ccdm->mprevvert); @@ -575,7 +575,7 @@ static void ccd_update_deflector_hash(Scene *scene, Object *vertexowner, GHash * /*Only proceed for mesh object in same layer */ if (base->object->type==OB_MESH && (base->lay & vertexowner->lay)) { ob= base->object; - if (ob == vertexowner){ + if (ob == vertexowner) { /* if vertexowner is given we don't want to check collision with owner object */ base = base->next; continue; @@ -618,9 +618,9 @@ static void add_mesh_quad_diag_springs(Object *ob) MFace *mface= me->mface; /*BodyPoint *bp;*/ /*UNUSED*/ BodySpring *bs, *bs_new; - int a ; + int a; - if (ob->soft){ + if (ob->soft) { int nofquads; //float s_shear = ob->soft->shearstiff*ob->soft->shearstiff; @@ -667,7 +667,7 @@ static void add_2nd_order_roller(Object *ob,float UNUSED(stiffness), int *counte BodyPoint *bp,*bpo; BodySpring *bs,*bs2,*bs3= NULL; int a,b,c,notthis= 0,v0; - if (!sb->bspring){return;} /* we are 2nd order here so 1rst should have been build :) */ + if (!sb->bspring) {return;} /* we are 2nd order here so 1rst should have been build :) */ /* first run counting second run adding */ *counter = 0; if (addsprings) bs3 = ob->soft->bspring+ob->soft->totspring; @@ -675,36 +675,36 @@ static void add_2nd_order_roller(Object *ob,float UNUSED(stiffness), int *counte /*scan for neighborhood*/ bpo = NULL; v0 = (sb->totpoint-a); - for (b=bp->nofsprings;b>0;b--){ + for (b=bp->nofsprings;b>0;b--) { bs = sb->bspring + bp->springs[b-1]; /*nasty thing here that springs have two ends so here we have to make sure we examine the other */ - if (v0 == bs->v1){ + if (v0 == bs->v1) { bpo = sb->bpoint+bs->v2; notthis = bs->v2; } else { - if (v0 == bs->v2){ + if (v0 == bs->v2) { bpo = sb->bpoint+bs->v1; notthis = bs->v1; } else {printf("oops we should not get here - add_2nd_order_springs");} } - if (bpo){/* so now we have a 2nd order humpdidump */ - for (c=bpo->nofsprings;c>0;c--){ + if (bpo) {/* so now we have a 2nd order humpdidump */ + for (c=bpo->nofsprings;c>0;c--) { bs2 = sb->bspring + bpo->springs[c-1]; - if ((bs2->v1 != notthis) && (bs2->v1 > v0)){ + if ((bs2->v1 != notthis) && (bs2->v1 > v0)) { (*counter)++;/*hit */ - if (addsprings){ + if (addsprings) { bs3->v1= v0; bs3->v2= bs2->v1; bs3->springtype = SB_BEND; bs3++; } } - if ((bs2->v2 !=notthis)&&(bs2->v2 > v0)){ + if ((bs2->v2 !=notthis)&&(bs2->v2 > v0)) { (*counter)++;/*hit */ - if (addsprings){ + if (addsprings) { bs3->v1= v0; bs3->v2= bs2->v2; bs3->springtype = SB_BEND; @@ -739,7 +739,7 @@ static void add_2nd_order_springs(Object *ob,float stiffness) ob->soft->bspring = bs_new; add_2nd_order_roller(ob,stiffness,&counter,1); /* adding */ - ob->soft->totspring +=counter ; + ob->soft->totspring += counter; } } @@ -782,10 +782,10 @@ static void build_bps_springlist(Object *ob) } /* scan for attached inner springs */ for (b=sb->totspring, bs= sb->bspring; b>0; b--, bs++) { - if (( (sb->totpoint-a) == bs->v1) ){ + if (( (sb->totpoint-a) == bs->v1) ) { add_bp_springlist(bp,sb->totspring -b); } - if (( (sb->totpoint-a) == bs->v2) ){ + if (( (sb->totpoint-a) == bs->v2) ) { add_bp_springlist(bp,sb->totspring -b); } }/*for springs*/ @@ -809,9 +809,9 @@ static void calculate_collision_balls(Object *ob) min = 1e22f; max = -1e22f; /* first estimation based on attached */ - for (b=bp->nofsprings;b>0;b--){ + for (b=bp->nofsprings;b>0;b--) { bs = sb->bspring + bp->springs[b-1]; - if (bs->springtype == SB_EDGE){ + if (bs->springtype == SB_EDGE) { akku += bs->len; akku_count++, min = MIN2(bs->len,min); @@ -820,19 +820,19 @@ static void calculate_collision_balls(Object *ob) } if (akku_count > 0) { - if (sb->sbc_mode == SBC_MODE_MANUAL){ + if (sb->sbc_mode == SBC_MODE_MANUAL) { bp->colball=sb->colball; } - if (sb->sbc_mode == SBC_MODE_AVG){ + if (sb->sbc_mode == SBC_MODE_AVG) { bp->colball = akku/(float)akku_count*sb->colball; } - if (sb->sbc_mode == SBC_MODE_MIN){ + if (sb->sbc_mode == SBC_MODE_MIN) { bp->colball=min*sb->colball; } - if (sb->sbc_mode == SBC_MODE_MAX){ + if (sb->sbc_mode == SBC_MODE_MAX) { bp->colball=max*sb->colball; } - if (sb->sbc_mode == SBC_MODE_AVGMINMAX){ + if (sb->sbc_mode == SBC_MODE_AVGMINMAX) { bp->colball = (min + max)/2.0f*sb->colball; } } @@ -905,17 +905,17 @@ static void free_softbody_baked(SoftBody *sb) } static void free_scratch(SoftBody *sb) { - if (sb->scratch){ + if (sb->scratch) { /* todo make sure everything is cleaned up nicly */ - if (sb->scratch->colliderhash){ + if (sb->scratch->colliderhash) { BLI_ghash_free(sb->scratch->colliderhash, NULL, (GHashValFreeFP) ccd_mesh_free); /*this hoepfully will free all caches*/ sb->scratch->colliderhash = NULL; } - if (sb->scratch->bodyface){ + if (sb->scratch->bodyface) { MEM_freeN(sb->scratch->bodyface); } - if (sb->scratch->Ref.ivert){ + if (sb->scratch->Ref.ivert) { MEM_freeN(sb->scratch->Ref.ivert); } MEM_freeN(sb->scratch); @@ -931,7 +931,7 @@ static void free_softbody_intern(SoftBody *sb) int a; BodyPoint *bp; - if (sb->bpoint){ + if (sb->bpoint) { for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { /* free spring list */ if (bp->springs != NULL) { @@ -1041,7 +1041,7 @@ static int sb_detect_aabb_collisionCached( float UNUSED(force[3]), unsigned int MVert *mprevvert= NULL; ccdf_minmax *mima= NULL; #endif - if (ccdm){ + if (ccdm) { #if 0 /* UNUSED */ mface= ccdm->mface; mvert= ccdm->mvert; @@ -1115,7 +1115,7 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa if (ob->pd && ob->pd->deflect) { MVert *mvert= NULL; MVert *mprevvert= NULL; - if (ccdm){ + if (ccdm) { mvert= ccdm->mvert; a = ccdm->totvert; mprevvert= ccdm->mprevvert; @@ -1142,19 +1142,19 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa /* use mesh*/ if (mvert) { - while(a){ + while(a) { copy_v3_v3(nv1,mvert[a-1].co); - if (mprevvert){ + if (mprevvert) { mul_v3_fl(nv1,time); Vec3PlusStVec(nv1,(1.0f-time),mprevvert[a-1].co); } /* origin to face_v2*/ sub_v3_v3(nv1, face_v2); facedist = dot_v3v3(nv1,d_nvect); - if (ABS(facedist) 0){ + if (facedist > 0) { df = (outerfacethickness-facedist)/outerfacethickness; } else { @@ -1208,7 +1208,7 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa MVert *mvert= NULL; MVert *mprevvert= NULL; ccdf_minmax *mima= NULL; - if (ccdm){ + if (ccdm) { mface= ccdm->mface; mvert= ccdm->mvert; mprevvert= ccdm->mprevvert; @@ -1251,15 +1251,15 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa } - if (mvert){ + if (mvert) { copy_v3_v3(nv1,mvert[mface->v1].co); copy_v3_v3(nv2,mvert[mface->v2].co); copy_v3_v3(nv3,mvert[mface->v3].co); - if (mface->v4){ + if (mface->v4) { copy_v3_v3(nv4,mvert[mface->v4].co); } - if (mprevvert){ + if (mprevvert) { mul_v3_fl(nv1,time); Vec3PlusStVec(nv1,(1.0f-time),mprevvert[mface->v1].co); @@ -1269,7 +1269,7 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa mul_v3_fl(nv3,time); Vec3PlusStVec(nv3,(1.0f-time),mprevvert[mface->v3].co); - if (mface->v4){ + if (mface->v4) { mul_v3_fl(nv4,time); Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co); } @@ -1284,12 +1284,12 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa if ( isect_line_tri_v3(nv1, nv2, face_v1, face_v2, face_v3, &t, NULL) || isect_line_tri_v3(nv2, nv3, face_v1, face_v2, face_v3, &t, NULL) || - isect_line_tri_v3(nv3, nv1, face_v1, face_v2, face_v3, &t, NULL) ){ + isect_line_tri_v3(nv3, nv1, face_v1, face_v2, face_v3, &t, NULL) ) { Vec3PlusStVec(force,-0.5f,d_nvect); *damp=tune*ob->pd->pdef_sbdamp; deflected = 2; } - if (mface->v4){ /* quad */ + if (mface->v4) { /* quad */ /* switch origin to be nv4 */ sub_v3_v3v3(edge1, nv3, nv4); sub_v3_v3v3(edge2, nv1, nv4); @@ -1299,7 +1299,7 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa /* isect_line_tri_v3(nv1, nv3, face_v1, face_v2, face_v3, &t, NULL) || we did that edge already */ isect_line_tri_v3(nv3, nv4, face_v1, face_v2, face_v3, &t, NULL) || - isect_line_tri_v3(nv4, nv1, face_v1, face_v2, face_v3, &t, NULL) ){ + isect_line_tri_v3(nv4, nv1, face_v1, face_v2, face_v3, &t, NULL) ) { Vec3PlusStVec(force,-0.5f,d_nvect); *damp=tune*ob->pd->pdef_sbdamp; deflected = 2; @@ -1326,7 +1326,7 @@ static void scan_for_ext_face_forces(Object *ob,float timenow) float tune = -10.0f; float feedback[3]; - if (sb && sb->scratch->totface){ + if (sb && sb->scratch->totface) { bf = sb->scratch->bodyface; @@ -1336,7 +1336,7 @@ static void scan_for_ext_face_forces(Object *ob,float timenow) bf->flag &= ~BFF_INTERSECT; feedback[0]=feedback[1]=feedback[2]=0.0f; if (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v2].pos, sb->bpoint[bf->v3].pos, - &damp, feedback, ob->lay ,ob , timenow)){ + &damp, feedback, ob->lay ,ob , timenow)) { Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback); Vec3PlusStVec(sb->bpoint[bf->v2].force,tune,feedback); Vec3PlusStVec(sb->bpoint[bf->v3].force,tune,feedback); @@ -1347,7 +1347,7 @@ static void scan_for_ext_face_forces(Object *ob,float timenow) feedback[0]=feedback[1]=feedback[2]=0.0f; if ((bf->v4) && (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v3].pos, sb->bpoint[bf->v4].pos, - &damp, feedback, ob->lay ,ob , timenow))){ + &damp, feedback, ob->lay ,ob , timenow))) { Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback); Vec3PlusStVec(sb->bpoint[bf->v3].force,tune,feedback); Vec3PlusStVec(sb->bpoint[bf->v4].force,tune,feedback); @@ -1358,12 +1358,12 @@ static void scan_for_ext_face_forces(Object *ob,float timenow) /*---edges intruding*/ /*+++ close vertices*/ - if (( bf->flag & BFF_INTERSECT)==0){ + if (( bf->flag & BFF_INTERSECT)==0) { bf->flag &= ~BFF_CLOSEVERT; tune = -1.0f; feedback[0]=feedback[1]=feedback[2]=0.0f; if (sb_detect_face_pointCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v2].pos, sb->bpoint[bf->v3].pos, - &damp, feedback, ob->lay ,ob , timenow)){ + &damp, feedback, ob->lay ,ob , timenow)) { Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback); Vec3PlusStVec(sb->bpoint[bf->v2].force,tune,feedback); Vec3PlusStVec(sb->bpoint[bf->v3].force,tune,feedback); @@ -1374,7 +1374,7 @@ static void scan_for_ext_face_forces(Object *ob,float timenow) feedback[0]=feedback[1]=feedback[2]=0.0f; if ((bf->v4) && (sb_detect_face_pointCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v3].pos, sb->bpoint[bf->v4].pos, - &damp, feedback, ob->lay ,ob , timenow))){ + &damp, feedback, ob->lay ,ob , timenow))) { Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback); Vec3PlusStVec(sb->bpoint[bf->v3].force,tune,feedback); Vec3PlusStVec(sb->bpoint[bf->v4].force,tune,feedback); @@ -1392,7 +1392,7 @@ static void scan_for_ext_face_forces(Object *ob,float timenow) sb->bpoint[bf->v1].choke2=MAX2(sb->bpoint[bf->v1].choke2,choke); sb->bpoint[bf->v2].choke2=MAX2(sb->bpoint[bf->v2].choke2,choke); sb->bpoint[bf->v3].choke2=MAX2(sb->bpoint[bf->v3].choke2,choke); - if (bf->v4){ + if (bf->v4) { sb->bpoint[bf->v2].choke2=MAX2(sb->bpoint[bf->v2].choke2,choke); } } @@ -1436,7 +1436,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa MVert *mvert= NULL; MVert *mprevvert= NULL; ccdf_minmax *mima= NULL; - if (ccdm){ + if (ccdm) { mface= ccdm->mface; mvert= ccdm->mvert; mprevvert= ccdm->mprevvert; @@ -1479,15 +1479,15 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa } - if (mvert){ + if (mvert) { copy_v3_v3(nv1,mvert[mface->v1].co); copy_v3_v3(nv2,mvert[mface->v2].co); copy_v3_v3(nv3,mvert[mface->v3].co); - if (mface->v4){ + if (mface->v4) { copy_v3_v3(nv4,mvert[mface->v4].co); } - if (mprevvert){ + if (mprevvert) { mul_v3_fl(nv1,time); Vec3PlusStVec(nv1,(1.0f-time),mprevvert[mface->v1].co); @@ -1497,7 +1497,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa mul_v3_fl(nv3,time); Vec3PlusStVec(nv3,(1.0f-time),mprevvert[mface->v3].co); - if (mface->v4){ + if (mface->v4) { mul_v3_fl(nv4,time); Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co); } @@ -1510,7 +1510,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa cross_v3_v3v3(d_nvect, edge2, edge1); normalize_v3(d_nvect); - if ( isect_line_tri_v3(edge_v1, edge_v2, nv1, nv2, nv3, &t, NULL)){ + if ( isect_line_tri_v3(edge_v1, edge_v2, nv1, nv2, nv3, &t, NULL)) { float v1[3],v2[3]; float intrusiondepth,i1,i2; sub_v3_v3v3(v1, edge_v1, nv2); @@ -1522,14 +1522,14 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa *damp=ob->pd->pdef_sbdamp; deflected = 2; } - if (mface->v4){ /* quad */ + if (mface->v4) { /* quad */ /* switch origin to be nv4 */ sub_v3_v3v3(edge1, nv3, nv4); sub_v3_v3v3(edge2, nv1, nv4); cross_v3_v3v3(d_nvect, edge2, edge1); normalize_v3(d_nvect); - if (isect_line_tri_v3( edge_v1, edge_v2,nv1, nv3, nv4, &t, NULL)){ + if (isect_line_tri_v3( edge_v1, edge_v2,nv1, nv3, nv4, &t, NULL)) { float v1[3],v2[3]; float intrusiondepth,i1,i2; sub_v3_v3v3(v1, edge_v1, nv4); @@ -1561,18 +1561,18 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow, float damp; float feedback[3]; - if (sb && sb->totspring){ + if (sb && sb->totspring) { for (a=ifirst; abspring[a]; bs->ext_force[0]=bs->ext_force[1]=bs->ext_force[2]=0.0f; feedback[0]=feedback[1]=feedback[2]=0.0f; bs->flag &= ~BSF_INTERSECT; - if (bs->springtype == SB_EDGE){ + if (bs->springtype == SB_EDGE) { /* +++ springs colliding */ - if (ob->softflag & OB_SB_EDGECOLL){ + if (ob->softflag & OB_SB_EDGECOLL) { if ( sb_detect_edge_collisionCached (sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos, - &damp,feedback,ob->lay,ob,timenow)){ + &damp,feedback,ob->lay,ob,timenow)) { add_v3_v3(bs->ext_force, feedback); bs->flag |= BSF_INTERSECT; //bs->cf=damp; @@ -1584,7 +1584,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow, /* +++ springs seeing wind ... n stuff depending on their orientation*/ /* note we don't use sb->mediafrict but use sb->aeroedge for magnitude of effect*/ - if (sb->aeroedge){ + if (sb->aeroedge) { float vel[3],sp[3],pr[3],force[3]; float f,windfactor = 0.25f; /*see if we have wind*/ @@ -1613,7 +1613,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow, project_v3_v3v3(pr,vel,sp); sub_v3_v3(vel, pr); normalize_v3(vel); - if (ob->softflag & OB_SB_AERO_ANGLE){ + if (ob->softflag & OB_SB_AERO_ANGLE) { normalize_v3(sp); Vec3PlusStVec(bs->ext_force,f*(1.0f-ABS(dot_v3v3(vel,sp))),vel); } @@ -1676,7 +1676,7 @@ static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow, sb_threads[i].timenow = timenow; sb_threads[i].ilast = left; left = left - dec; - if (left >0){ + if (left >0) { sb_threads[i].ifirst = left; } else @@ -1714,17 +1714,17 @@ static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,fl mindist = ABS(dot_v3v3(pos,a)); cp = ABS(dot_v3v3(pos,b)); - if ( mindist < cp ){ + if ( mindist < cp ) { mindist = cp; winner =2; } cp = ABS(dot_v3v3(pos,c)); - if (mindist < cp ){ + if (mindist < cp ) { mindist = cp; winner =3; } - switch (winner){ + switch (winner) { case 1: copy_v3_v3(w,ca); break; case 2: copy_v3_v3(w,cb); break; case 3: copy_v3_v3(w,cc); @@ -1766,7 +1766,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], MVert *mprevvert= NULL; ccdf_minmax *mima= NULL; - if (ccdm){ + if (ccdm) { mface= ccdm->mface; mvert= ccdm->mvert; mprevvert= ccdm->mprevvert; @@ -1822,16 +1822,16 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], continue; } - if (mvert){ + if (mvert) { copy_v3_v3(nv1,mvert[mface->v1].co); copy_v3_v3(nv2,mvert[mface->v2].co); copy_v3_v3(nv3,mvert[mface->v3].co); - if (mface->v4){ + if (mface->v4) { copy_v3_v3(nv4,mvert[mface->v4].co); } - if (mprevvert){ + if (mprevvert) { /* grab the average speed of the collider vertices before we spoil nvX humm could be done once a SB steps but then we' need to store that too @@ -1841,7 +1841,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], sub_v3_v3v3(vv1,nv1,mprevvert[mface->v1].co); sub_v3_v3v3(vv2,nv2,mprevvert[mface->v2].co); sub_v3_v3v3(vv3,nv3,mprevvert[mface->v3].co); - if (mface->v4){ + if (mface->v4) { sub_v3_v3v3(vv4,nv4,mprevvert[mface->v4].co); } @@ -1854,7 +1854,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], mul_v3_fl(nv3,time); Vec3PlusStVec(nv3,(1.0f-time),mprevvert[mface->v3].co); - if (mface->v4){ + if (mface->v4) { mul_v3_fl(nv4,time); Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co); } @@ -1872,13 +1872,13 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], // so rules are // - if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){ - if (isect_point_tri_prism_v3(opco, nv1, nv2, nv3) ){ + if ((facedist > innerfacethickness) && (facedist < outerfacethickness)) { + if (isect_point_tri_prism_v3(opco, nv1, nv2, nv3) ) { force_mag_norm =(float)exp(-ee*facedist); if (facedist > outerfacethickness*ff) force_mag_norm =(float)force_mag_norm*fa*(facedist - outerfacethickness)*(facedist - outerfacethickness); *damp=ob->pd->pdef_sbdamp; - if (facedist > 0.0f){ + if (facedist > 0.0f) { *damp *= (1.0f - facedist/outerfacethickness); Vec3PlusStVec(outerforceaccu,force_mag_norm,d_nvect); deflected = 3; @@ -1888,7 +1888,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], Vec3PlusStVec(innerforceaccu,force_mag_norm,d_nvect); if (deflected < 2) deflected = 2; } - if ((mprevvert) && (*damp > 0.0f)){ + if ((mprevvert) && (*damp > 0.0f)) { choose_winner(ve,opco,nv1,nv2,nv3,vv1,vv2,vv3); add_v3_v3(avel, ve); cavel ++; @@ -1897,7 +1897,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], ci++; } } - if (mface->v4){ /* quad */ + if (mface->v4) { /* quad */ /* switch origin to be nv4 */ sub_v3_v3v3(edge1, nv3, nv4); sub_v3_v3v3(edge2, nv1, nv4); @@ -1907,13 +1907,13 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], /* n_mag = */ /* UNUSED */ normalize_v3(d_nvect); facedist = dot_v3v3(dv1,d_nvect); - if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){ - if (isect_point_tri_prism_v3(opco, nv1, nv3, nv4) ){ + if ((facedist > innerfacethickness) && (facedist < outerfacethickness)) { + if (isect_point_tri_prism_v3(opco, nv1, nv3, nv4) ) { force_mag_norm =(float)exp(-ee*facedist); if (facedist > outerfacethickness*ff) force_mag_norm =(float)force_mag_norm*fa*(facedist - outerfacethickness)*(facedist - outerfacethickness); *damp=ob->pd->pdef_sbdamp; - if (facedist > 0.0f){ + if (facedist > 0.0f) { *damp *= (1.0f - facedist/outerfacethickness); Vec3PlusStVec(outerforceaccu,force_mag_norm,d_nvect); deflected = 3; @@ -1924,7 +1924,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], if (deflected < 2) deflected = 2; } - if ((mprevvert) && (*damp > 0.0f)){ + if ((mprevvert) && (*damp > 0.0f)) { choose_winner(ve,opco,nv1,nv3,nv4,vv1,vv3,vv4); add_v3_v3(avel, ve); cavel ++; @@ -1941,7 +1941,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], closest_to_line_segment_v3(ve, opco, nv1, nv2); sub_v3_v3v3(ve,opco,ve); dist = normalize_v3(ve); - if ((dist < outerfacethickness)&&(dist < mindistedge )){ + if ((dist < outerfacethickness)&&(dist < mindistedge )) { copy_v3_v3(coledge,ve); mindistedge = dist, deflected=1; @@ -1950,7 +1950,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], closest_to_line_segment_v3(ve, opco, nv2, nv3); sub_v3_v3v3(ve,opco,ve); dist = normalize_v3(ve); - if ((dist < outerfacethickness)&&(dist < mindistedge )){ + if ((dist < outerfacethickness)&&(dist < mindistedge )) { copy_v3_v3(coledge,ve); mindistedge = dist, deflected=1; @@ -1959,16 +1959,16 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], closest_to_line_segment_v3(ve, opco, nv3, nv1); sub_v3_v3v3(ve,opco,ve); dist = normalize_v3(ve); - if ((dist < outerfacethickness)&&(dist < mindistedge )){ + if ((dist < outerfacethickness)&&(dist < mindistedge )) { copy_v3_v3(coledge,ve); mindistedge = dist, deflected=1; } - if (mface->v4){ /* quad */ + if (mface->v4) { /* quad */ closest_to_line_segment_v3(ve, opco, nv3, nv4); sub_v3_v3v3(ve,opco,ve); dist = normalize_v3(ve); - if ((dist < outerfacethickness)&&(dist < mindistedge )){ + if ((dist < outerfacethickness)&&(dist < mindistedge )) { copy_v3_v3(coledge,ve); mindistedge = dist, deflected=1; @@ -1977,7 +1977,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], closest_to_line_segment_v3(ve, opco, nv1, nv4); sub_v3_v3v3(ve,opco,ve); dist = normalize_v3(ve); - if ((dist < outerfacethickness)&&(dist < mindistedge )){ + if ((dist < outerfacethickness)&&(dist < mindistedge )) { copy_v3_v3(coledge,ve); mindistedge = dist, deflected=1; @@ -1995,21 +1995,21 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], BLI_ghashIterator_step(ihash); } /* while () */ - if (deflected == 1){ // no face but 'outer' edge cylinder sees vert + if (deflected == 1) { // no face but 'outer' edge cylinder sees vert force_mag_norm =(float)exp(-ee*mindistedge); if (mindistedge > outerfacethickness*ff) force_mag_norm =(float)force_mag_norm*fa*(mindistedge - outerfacethickness)*(mindistedge - outerfacethickness); Vec3PlusStVec(force,force_mag_norm,coledge); *damp=ob->pd->pdef_sbdamp; - if (mindistedge > 0.0f){ + if (mindistedge > 0.0f) { *damp *= (1.0f - mindistedge/outerfacethickness); } } - if (deflected == 2){ // face inner detected + if (deflected == 2) { // face inner detected add_v3_v3(force, innerforceaccu); } - if (deflected == 3){ // face outer detected + if (deflected == 3) { // face outer detected add_v3_v3(force, outerforceaccu); } @@ -2017,7 +2017,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], if (cavel) mul_v3_fl(avel,1.0f/(float)cavel); copy_v3_v3(vel,avel); if (ci) *intrusion /= ci; - if (deflected){ + if (deflected) { normalize_v3_v3(facenormal, force); } return deflected; @@ -2040,9 +2040,9 @@ static void dfdx_spring(int ia, int ic, int op, float dir[3],float L,float len,f { float m,delta_ij; int i ,j; - if (L < len){ + if (L < len) { for (i=0;i<3;i++) - for (j=0;j<3;j++){ + for (j=0;j<3;j++) { delta_ij = (i==j ? (1.0f): (0.0f)); m=factor*(dir[i]*dir[j] + (1-L/len)*(delta_ij - dir[i]*dir[j])); nlMatrixAdd(ia+i,op+ic+j,m); @@ -2050,7 +2050,7 @@ static void dfdx_spring(int ia, int ic, int op, float dir[3],float L,float len,f } else{ for (i=0;i<3;i++) - for (j=0;j<3;j++){ + for (j=0;j<3;j++) { m=factor*dir[i]*dir[j]; nlMatrixAdd(ia+i,op+ic+j,m); } @@ -2081,7 +2081,7 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UN int ia,ic; #endif /* prepare depending on which side of the spring we are on */ - if (bpi == bs->v1){ + if (bpi == bs->v1) { bp1 = &sb->bpoint[bs->v1]; bp2 = &sb->bpoint[bs->v2]; #if 0 /* UNUSED */ @@ -2089,7 +2089,7 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UN ic =3*bs->v2; #endif } - else if (bpi == bs->v2){ + else if (bpi == bs->v2) { bp1 = &sb->bpoint[bs->v2]; bp2 = &sb->bpoint[bs->v1]; #if 0 /* UNUSED */ @@ -2119,7 +2119,7 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UN kw = (bp1->springweight+bp2->springweight)/2.0f; kw = kw * kw; kw = kw * kw; - switch (bs->springtype){ + switch (bs->springtype) { case SB_EDGE: case SB_HANDLE: forcefactor *= kw; @@ -2146,7 +2146,7 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UN Vec3PlusStVec(bp1->force,-kd,dir); /* do jacobian stuff if needed */ - if (nl_flags & NLF_BUILD){ + if (nl_flags & NLF_BUILD) { //int op =3*sb->totpoint; //float mvel = -forcetime*kd; //float mpos = -forcetime*forcefactor; @@ -2154,7 +2154,7 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UN // dfdx_spring(ia,ia,op,dir,bs->len,distance,-mpos); /* depending on my vel */ // dfdv_goal(ia,ia,mvel); // well that ignores geometie - if (bp2->goal < SOFTGOALSNAP){ /* ommit this bp when it snaps */ + if (bp2->goal < SOFTGOALSNAP) { /* ommit this bp when it snaps */ /* depending on other pos */ // dfdx_spring(ia,ic,op,dir,bs->len,distance,mpos); /* depending on other vel */ @@ -2203,7 +2203,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo bp->force[0]= bp->force[1]= bp->force[2]= 0.0; /* naive ball self collision */ /* needs to be done if goal snaps or not */ - if (do_selfcollision){ + if (do_selfcollision) { int attached; BodyPoint *obp; BodySpring *bs; @@ -2220,17 +2220,17 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo /* mathematically it is completly nuts, but performace is pretty much (3) times faster */ if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue; distance = normalize_v3(def); - if (distance < compare ){ + if (distance < compare ) { /* exclude body points attached with a spring */ attached = 0; - for (b=obp->nofsprings;b>0;b--){ + for (b=obp->nofsprings;b>0;b--) { bs = sb->bspring + obp->springs[b-1]; - if (( ilast-bb == bs->v2) || ( ilast-bb == bs->v1)){ + if (( ilast-bb == bs->v2) || ( ilast-bb == bs->v1)) { attached=1; continue;} } - if (!attached){ - float f = bstune/(distance) + bstune/(compare*compare)*distance - 2.0f*bstune/compare ; + if (!attached) { + float f = bstune / (distance) + bstune / (compare * compare) * distance - 2.0f * bstune / compare; mid_v3_v3v3(velcenter, bp->vec, obp->vec); sub_v3_v3v3(dvel,velcenter,bp->vec); @@ -2251,7 +2251,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo } /* naive ball self collision done */ - if (_final_goal(ob,bp) < SOFTGOALSNAP){ /* ommit this bp when it snaps */ + if (_final_goal(ob,bp) < SOFTGOALSNAP) { /* ommit this bp when it snaps */ float auxvect[3]; float velgoal[3]; @@ -2260,14 +2260,14 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo /* true elastic goal */ float ks,kd; sub_v3_v3v3(auxvect,bp->pos,bp->origT); - ks = 1.0f/(1.0f- _final_goal(ob,bp)*sb->goalspring)-1.0f ; + ks = 1.0f / (1.0f - _final_goal(ob, bp) * sb->goalspring) - 1.0f; bp->force[0]+= -ks*(auxvect[0]); bp->force[1]+= -ks*(auxvect[1]); bp->force[2]+= -ks*(auxvect[2]); /* calulate damping forces generated by goals*/ sub_v3_v3v3(velgoal,bp->origS, bp->origE); - kd = sb->goalfrict * sb_fric_force_scale(ob) ; + kd = sb->goalfrict * sb_fric_force_scale(ob); add_v3_v3v3(auxvect,velgoal,bp->vec); if (forcetime > 0.0f) { /* make sure friction does not become rocket motor on time reversal */ @@ -2284,7 +2284,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo /* done goal stuff */ /* gravitation */ - if (sb && scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){ + if (sb && scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) { float gravity[3]; copy_v3_v3(gravity, scene->physics_settings.gravity); mul_v3_fl(gravity, sb_grav_force_scale(ob)*_final_mass(ob,bp)*sb->effector_weights->global_gravity); /* individual mass of node here */ @@ -2330,8 +2330,8 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo float cfforce[3],defforce[3] ={0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}, facenormal[3], cf = 1.0f,intrusion; float kd = 1.0f; - if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)){ - if (intrusion < 0.0f){ + if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)) { + if (intrusion < 0.0f) { sb->scratch->flag |= SBF_DOFUZZY; bp->loc_flag |= SBF_DOFUZZY; bp->choke = sb->choke*0.01f; @@ -2349,12 +2349,12 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo /* +++springs */ iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */ if (ob->softflag & OB_SB_EDGES) { - if (sb->bspring){ /* spring list exists at all ? */ + if (sb->bspring) { /* spring list exists at all ? */ int b; BodySpring *bs; - for (b=bp->nofsprings;b>0;b--){ + for (b=bp->nofsprings;b>0;b--) { bs = sb->bspring + bp->springs[b-1]; - if (do_springcollision || do_aero){ + if (do_springcollision || do_aero) { add_v3_v3(bp->force, bs->ext_force); if (bs->flag & BSF_INTERSECT) bp->choke = bs->cf; @@ -2408,7 +2408,7 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t sb_threads[i].timenow = timenow; sb_threads[i].ilast = left; left = left - dec; - if (left >0){ + if (left >0) { sb_threads[i].ifirst = left; } else @@ -2486,7 +2486,7 @@ static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, fl static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, float timenow, int nl_flags) { /* redirection to the new threaded Version */ - if (!(G.rt & 0x10)){ // 16 + if (!(G.rt & 0x10)) { // 16 softbody_calc_forcesEx(scene, ob, forcetime, timenow, nl_flags); return; } @@ -2516,14 +2516,14 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa /* jacobian NLboolean success; - if (nl_flags){ + if (nl_flags) { nlBegin(NL_SYSTEM); nlBegin(NL_MATRIX); } */ - if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){ + if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) { copy_v3_v3(gravity, scene->physics_settings.gravity); mul_v3_fl(gravity, sb_grav_force_scale(ob)*sb->effector_weights->global_gravity); } @@ -2549,7 +2549,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { /* clear forces accumulator */ bp->force[0]= bp->force[1]= bp->force[2]= 0.0; - if (nl_flags & NLF_BUILD){ + if (nl_flags & NLF_BUILD) { //int ia =3*(sb->totpoint-a); //int op =3*sb->totpoint; /* dF/dV = v */ @@ -2572,7 +2572,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa /* naive ball self collision */ /* needs to be done if goal snaps or not */ - if (do_selfcollision){ + if (do_selfcollision) { int attached; BodyPoint *obp; int c,b; @@ -2592,17 +2592,17 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue; distance = normalize_v3(def); - if (distance < compare ){ + if (distance < compare ) { /* exclude body points attached with a spring */ attached = 0; - for (b=obp->nofsprings;b>0;b--){ + for (b=obp->nofsprings;b>0;b--) { bs = sb->bspring + obp->springs[b-1]; - if (( sb->totpoint-a == bs->v2) || ( sb->totpoint-a == bs->v1)){ + if (( sb->totpoint-a == bs->v2) || ( sb->totpoint-a == bs->v1)) { attached=1; continue;} } - if (!attached){ - float f = tune/(distance) + tune/(compare*compare)*distance - 2.0f*tune/compare ; + if (!attached) { + float f = tune / (distance) + tune / (compare * compare) * distance - 2.0f * tune/compare; mid_v3_v3v3(velcenter, bp->vec, obp->vec); sub_v3_v3v3(dvel,velcenter,bp->vec); @@ -2611,7 +2611,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def); Vec3PlusStVec(bp->force,sb->balldamp,dvel); - if (nl_flags & NLF_BUILD){ + if (nl_flags & NLF_BUILD) { //int ia =3*(sb->totpoint-a); //int ic =3*(sb->totpoint-c); //int op =3*sb->totpoint; @@ -2649,7 +2649,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa } /* naive ball self collision done */ - if (_final_goal(ob,bp) < SOFTGOALSNAP){ /* ommit this bp when it snaps */ + if (_final_goal(ob,bp) < SOFTGOALSNAP) { /* ommit this bp when it snaps */ float auxvect[3]; float velgoal[3]; @@ -2657,12 +2657,12 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa if (ob->softflag & OB_SB_GOAL) { /* true elastic goal */ sub_v3_v3v3(auxvect,bp->pos,bp->origT); - ks = 1.0f/(1.0f- _final_goal(ob,bp)*sb->goalspring)-1.0f ; + ks = 1.0f / (1.0f- _final_goal(ob, bp) * sb->goalspring) - 1.0f; bp->force[0]+= -ks*(auxvect[0]); bp->force[1]+= -ks*(auxvect[1]); bp->force[2]+= -ks*(auxvect[2]); - if (nl_flags & NLF_BUILD){ + if (nl_flags & NLF_BUILD) { //int ia =3*(sb->totpoint-a); //int op =3*(sb->totpoint); /* depending on my pos */ @@ -2672,14 +2672,14 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa /* calulate damping forces generated by goals*/ sub_v3_v3v3(velgoal,bp->origS, bp->origE); - kd = sb->goalfrict * sb_fric_force_scale(ob) ; + kd = sb->goalfrict * sb_fric_force_scale(ob); add_v3_v3v3(auxvect,velgoal,bp->vec); if (forcetime > 0.0f) { /* make sure friction does not become rocket motor on time reversal */ bp->force[0]-= kd * (auxvect[0]); bp->force[1]-= kd * (auxvect[1]); bp->force[2]-= kd * (auxvect[2]); - if (nl_flags & NLF_BUILD){ + if (nl_flags & NLF_BUILD) { //int ia =3*(sb->totpoint-a); normalize_v3(auxvect); /* depending on my vel */ @@ -2729,7 +2729,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa bp->force[1]-= bp->vec[1]*kd; bp->force[2]-= bp->vec[2]*kd; /* friction in media done */ - if (nl_flags & NLF_BUILD){ + if (nl_flags & NLF_BUILD) { //int ia =3*(sb->totpoint-a); /* da/dv = */ @@ -2747,9 +2747,9 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa float cfforce[3],defforce[3] ={0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}, facenormal[3], cf = 1.0f,intrusion; kd = 1.0f; - if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)){ - if ((!nl_flags)&&(intrusion < 0.0f)){ - if (G.rt & 0x01){ // 17 we did check for bit 0x10 before + if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)) { + if ((!nl_flags)&&(intrusion < 0.0f)) { + if (G.rt & 0x01) { // 17 we did check for bit 0x10 before /*fixing bug [17428] this forces adaptive step size to tiny steps in some situations .. keeping G.rt==17 option for old files 'needing' the bug */ @@ -2778,7 +2778,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa Vec3PlusStVec(bp->force,-cf*50.0f,cfforce); } Vec3PlusStVec(bp->force,kd,defforce); - if (nl_flags & NLF_BUILD){ + if (nl_flags & NLF_BUILD) { // int ia =3*(sb->totpoint-a); // int op =3*sb->totpoint; //dfdx_goal(ia,ia,op,mpos); // don't do unless you know @@ -2793,10 +2793,10 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa /* +++springs */ if (ob->softflag & OB_SB_EDGES) { - if (sb->bspring){ /* spring list exists at all ? */ - for (b=bp->nofsprings;b>0;b--){ + if (sb->bspring) { /* spring list exists at all ? */ + for (b=bp->nofsprings;b>0;b--) { bs = sb->bspring + bp->springs[b-1]; - if (do_springcollision || do_aero){ + if (do_springcollision || do_aero) { add_v3_v3(bp->force, bs->ext_force); if (bs->flag & BSF_INTERSECT) bp->choke = bs->cf; @@ -2818,7 +2818,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa /* finish matrix and solve */ #if (0) // remove onl linking for now .. still i am not sure .. the jacobian can be useful .. so keep that BM - if (nl_flags & NLF_SOLVE){ + if (nl_flags & NLF_SOLVE) { //double sct,sst=PIL_check_seconds_timer(); for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { int iv =3*(sb->totpoint-a); @@ -2839,7 +2839,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa success= nlSolveAdvanced(NULL, 1); // nlPrintMatrix(); /* for debug purpose .. anyhow cropping B vector looks like working */ - if (success){ + if (success) { float f; int index =0; /* for debug purpose .. anyhow cropping B vector looks like working */ @@ -2921,7 +2921,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * else timeovermass = forcetime/0.009999f; - if (_final_goal(ob,bp) < SOFTGOALSNAP){ + if (_final_goal(ob,bp) < SOFTGOALSNAP) { /* this makes t~ = t */ if (mid_flags & MID_PRESERVE) copy_v3_v3(dx,bp->vec); @@ -2933,12 +2933,12 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * /* some nasty if's to have heun in here too */ copy_v3_v3(dv,bp->force); - if (mode == 1){ + if (mode == 1) { copy_v3_v3(bp->prevvec, bp->vec); copy_v3_v3(bp->prevdv, dv); } - if (mode ==2){ + if (mode ==2) { /* be optimistic and execute step */ bp->vec[0] = bp->prevvec[0] + 0.5f * (dv[0] + bp->prevdv[0]); bp->vec[1] = bp->prevvec[1] + 0.5f * (dv[1] + bp->prevdv[1]); @@ -2960,7 +2960,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * /* the freezer coming sooner or later */ /* - if ((dot_v3v3(dx,dx)force,bp->force)force,bp->force)frozen /=2; } else{ @@ -2969,12 +2969,12 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * mul_v3_fl(dx,bp->frozen); */ /* again some nasty if's to have heun in here too */ - if (mode ==1){ + if (mode ==1) { copy_v3_v3(bp->prevpos,bp->pos); copy_v3_v3(bp->prevdx ,dx); } - if (mode ==2){ + if (mode ==2) { bp->pos[0] = bp->prevpos[0] + 0.5f * ( dx[0] + bp->prevdx[0]); bp->pos[1] = bp->prevpos[1] + 0.5f * ( dx[1] + bp->prevdx[1]); bp->pos[2] = bp->prevpos[2] + 0.5f * ( dx[2] + bp->prevdx[2]); @@ -2986,10 +2986,10 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * the collider object signals to get out by pushing hard. on the other hand we don't want to end up in deep space so we add some to balance that out */ - if (bp->choke2 > 0.0f){ + if (bp->choke2 > 0.0f) { mul_v3_fl(bp->vec,(1.0f - bp->choke2)); } - if (bp->choke > 0.0f){ + if (bp->choke > 0.0f) { mul_v3_fl(bp->vec,(1.0f - bp->choke)); } @@ -3007,18 +3007,18 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * } /*for*/ if (sb->totpoint) mul_v3_fl(cm,1.0f/sb->totpoint); - if (sb->scratch){ + if (sb->scratch) { copy_v3_v3(sb->scratch->aabbmin,aabbmin); copy_v3_v3(sb->scratch->aabbmax,aabbmax); } - if (err){ /* so step size will be controlled by biggest difference in slope */ + if (err) { /* so step size will be controlled by biggest difference in slope */ if (sb->solverflags & SBSO_OLDERR) *err = MAX2(maxerrpos,maxerrvel); else *err = maxerrpos; //printf("EP %f EV %f \n",maxerrpos,maxerrvel); - if (fuzzy){ + if (fuzzy) { *err /= sb->fuzzyness; } } @@ -3125,7 +3125,7 @@ static void softbody_apply_goalsnap(Object *ob) int a; for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - if (_final_goal(ob,bp) >= SOFTGOALSNAP){ + if (_final_goal(ob,bp) >= SOFTGOALSNAP) { copy_v3_v3(bp->prevpos,bp->pos); copy_v3_v3(bp->pos,bp->origT); } @@ -3141,7 +3141,7 @@ static void apply_spring_memory(Object *ob) int a; float b,l,r; - if (sb && sb->totspring){ + if (sb && sb->totspring) { b = sb->plastic; for (a=0; atotspring; a++) { bs = &sb->bspring[a]; @@ -3149,7 +3149,7 @@ static void apply_spring_memory(Object *ob) bp2 =&sb->bpoint[bs->v2]; l = len_v3v3(bp1->pos,bp2->pos); r = bs->len/l; - if (( r > 1.05f) || (r < 0.95f)){ + if (( r > 1.05f) || (r < 0.95f)) { bs->len = ((100.0f - b) * bs->len + b*l)/100.0f; } } @@ -3170,7 +3170,7 @@ static void interpolate_exciter(Object *ob, int timescale, int time) bp->origT[0] = bp->origS[0] + f*(bp->origE[0] - bp->origS[0]); bp->origT[1] = bp->origS[1] + f*(bp->origE[1] - bp->origS[1]); bp->origT[2] = bp->origS[2] + f*(bp->origE[2] - bp->origS[2]); - if (_final_goal(ob,bp) >= SOFTGOALSNAP){ + if (_final_goal(ob,bp) >= SOFTGOALSNAP) { bp->vec[0] = bp->origE[0] - bp->origS[0]; bp->vec[1] = bp->origE[1] - bp->origS[1]; bp->vec[2] = bp->origE[2] - bp->origS[2]; @@ -3209,8 +3209,8 @@ static void get_scalar_from_vertexgroup(Object *ob, int vertID, short groupindex } if (dv) { /* Lets see if this vert is in the weight group */ - for (i=0; itotweight; i++){ - if (dv->dw[i].def_nr == groupindex){ + for (i=0; itotweight; i++) { + if (dv->dw[i].def_nr == groupindex) { *target= dv->dw[i].weight; /* got it ! */ break; } @@ -3245,7 +3245,7 @@ static void springs_from_mesh(Object *ob) } /* recalculate spring length for meshes here */ /* public version shrink to fit */ - if (sb->springpreload != 0 ){ + if (sb->springpreload != 0 ) { scale = sb->springpreload / 100.0f; } for (a=0; atotspring; a++) { @@ -3298,7 +3298,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob) else{ /* in consequence if no group was set .. but we want to animate it laters */ /* logically attach to goal with default first */ - if (ob->softflag & OB_SB_GOAL){bp->goal = sb->defgoal;} + if (ob->softflag & OB_SB_GOAL) {bp->goal = sb->defgoal;} } /* to proove the concept @@ -3309,7 +3309,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob) { int grp= defgroup_name_index (ob,sb->namedVG_Mass); /* printf("VGN %s %d \n",sb->namedVG_Mass,grp); */ - if (grp > -1){ + if (grp > -1) { get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->mass); /* 2.5 bp->mass = bp->mass * sb->nodemass; */ /* printf("bp->mass %f \n",bp->mass); */ @@ -3323,7 +3323,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob) { int grp= defgroup_name_index (ob,sb->namedVG_Spring_K); //printf("VGN %s %d \n",sb->namedVG_Spring_K,grp); - if (grp > -1){ + if (grp > -1) { get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->springweight); //printf("bp->springweight %f \n",bp->springweight); @@ -3460,7 +3460,7 @@ static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff,Object * if (dostiff) { - if (w){ + if (w) { if ( v && u ) { bs->v1 = bpc; bs->v2 = bpc-dw-dv-1; @@ -3477,7 +3477,7 @@ static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff,Object * } } - if (w < lt->pntsw -1){ + if (w < lt->pntsw -1) { if ( v && u ) { bs->v1 = bpc; bs->v2 = bpc+dw-dv-1; @@ -3511,11 +3511,11 @@ static void lattice_to_softbody(Scene *scene, Object *ob) totvert= lt->pntsu*lt->pntsv*lt->pntsw; - if (ob->softflag & OB_SB_EDGES){ + if (ob->softflag & OB_SB_EDGES) { totspring = ((lt->pntsu -1) * lt->pntsv + (lt->pntsv -1) * lt->pntsu) * lt->pntsw +lt->pntsu*lt->pntsv*(lt->pntsw -1); - if (ob->softflag & OB_SB_QUADS){ + if (ob->softflag & OB_SB_QUADS) { totspring += 4*(lt->pntsu -1) * (lt->pntsv -1) * (lt->pntsw-1); } } @@ -3528,7 +3528,7 @@ static void lattice_to_softbody(Scene *scene, Object *ob) /* weights from bpoints, same code used as for mesh vertices */ /* if ((ob->softflag & OB_SB_GOAL) && sb->vertgroup) { 2.4x one*/ /* new! take the weights from lattice vertex anyhow */ - if (ob->softflag & OB_SB_GOAL){ + if (ob->softflag & OB_SB_GOAL) { BodyPoint *bp= sb->bpoint; BPoint *bpnt= lt->def; /* jow_go_for2_5 */ @@ -3540,7 +3540,7 @@ static void lattice_to_softbody(Scene *scene, Object *ob) } /* create some helper edges to enable SB lattice to be useful at all */ - if (ob->softflag & OB_SB_EDGES){ + if (ob->softflag & OB_SB_EDGES) { makelatticesprings(lt,ob->soft->bspring,ob->softflag & OB_SB_QUADS,ob); build_bps_springlist(ob); /* link bps to springs */ } @@ -3561,7 +3561,7 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob) totvert= count_curveverts(&cu->nurb); - if (ob->softflag & OB_SB_EDGES){ + if (ob->softflag & OB_SB_EDGES) { if (ob->type==OB_CURVE) { totspring= totvert - BLI_countlist(&cu->nurb); } @@ -3648,10 +3648,10 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob) static void softbody_to_object(Object *ob, float (*vertexCos)[3], int numVerts, int local) { SoftBody *sb= ob->soft; - if (sb){ + if (sb) { BodyPoint *bp= sb->bpoint; int a; - if (sb->solverflags & SBSO_ESTIMATEIPO){SB_estimate_transform(ob,sb->lcom,sb->lrot,sb->lscale);} + if (sb->solverflags & SBSO_ESTIMATEIPO) {SB_estimate_transform(ob,sb->lcom,sb->lrot,sb->lscale);} /* inverse matrix is not uptodate... */ invert_m4_m4(ob->imat, ob->obmat); @@ -3924,8 +3924,8 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime) ccd_update_deflector_hash(scene, ob, sb->scratch->colliderhash); - if (sb->scratch->needstobuildcollider){ - if (query_external_colliders(scene, ob)){ + if (sb->scratch->needstobuildcollider) { + if (query_external_colliders(scene, ob)) { ccd_build_deflector_hash(scene, ob, sb->scratch->colliderhash); } sb->scratch->needstobuildcollider=0; @@ -3941,7 +3941,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime) /* loops = counter for emergency brake * we don't want to lock up the system if physics fail */ - int loops =0 ; + int loops = 0; SoftHeunTol = sb->rklimit; /* humm .. this should be calculated from sb parameters and sizes */ /* adjust loop limits */ @@ -3970,7 +3970,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime) if (err > SoftHeunTol) { /* error needs to be scaled to some quantity */ - if (forcetime > forcetimemin){ + if (forcetime > forcetimemin) { forcetime = MAX2(forcetime / 2.0f,forcetimemin); softbody_restore_prev_step(ob); //printf("down,"); @@ -3982,7 +3982,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime) else { float newtime = forcetime * 1.1f; /* hope for 1.1 times better conditions in next step */ - if (sb->scratch->flag & SBF_DOFUZZY){ + if (sb->scratch->flag & SBF_DOFUZZY) { //if (err > SoftHeunTol/(2.0f*sb->fuzzyness)) { /* stay with this stepsize unless err really small */ newtime = forcetime; //} @@ -4001,7 +4001,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime) forcetime = MAX2(dtime - timedone,newtime); } loops++; - if (sb->solverflags & SBSO_MONITOR ){ + if (sb->solverflags & SBSO_MONITOR ) { sct=PIL_check_seconds_timer(); if (sct-sst > 0.5f) printf("%3.0f%% \r",100.0f*timedone/dtime); } @@ -4013,8 +4013,8 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime) interpolate_exciter(ob, 2, 2); softbody_apply_goalsnap(ob); - // if (G.f & G_DEBUG){ - if (sb->solverflags & SBSO_MONITOR ){ + // if (G.f & G_DEBUG) { + if (sb->solverflags & SBSO_MONITOR ) { if (loops > HEUNWARNLIMIT) /* monitor high loop counts */ printf("\r needed %d steps/frame",loops); } @@ -4028,7 +4028,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime) { /* do semi "fake" implicit euler */ }/*SOLVER SELECT*/ - else if (sb->solver_ID == 3){ + else if (sb->solver_ID == 3) { /* do "stupid" semi "fake" implicit euler */ //removed @@ -4036,9 +4036,9 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime) else{ printf("softbody no valid solver ID!"); }/*SOLVER SELECT*/ - if (sb->plastic){ apply_spring_memory(ob);} + if (sb->plastic) { apply_spring_memory(ob);} - if (sb->solverflags & SBSO_MONITOR ){ + if (sb->solverflags & SBSO_MONITOR ) { sct=PIL_check_seconds_timer(); if ((sct-sst > 0.5f) || (G.f & G_DEBUG)) printf(" solver time %f sec %s \n",sct-sst,ob->id.name); } diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 1a181edf914..f06f2cdb760 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -2444,7 +2444,7 @@ static void ccg_loops_to_corners(CustomData *fdata, CustomData *ldata, MLoopUV *mloopuv; int i, j; - for(i=0; i < numTex; i++){ + for(i=0; i < numTex; i++) { texface = CustomData_get_n(fdata, CD_MTFACE, findex, i); texpoly = CustomData_get_n(pdata, CD_MTEXPOLY, polyindex, i); @@ -2456,7 +2456,7 @@ static void ccg_loops_to_corners(CustomData *fdata, CustomData *ldata, } } - for(i=0; i < numCol; i++){ + for(i=0; i < numCol; i++) { mloopcol = CustomData_get_n(ldata, CD_MLOOPCOL, loopstart, i); mcol = CustomData_get_n(fdata, CD_MCOL, findex, i); diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 138abb73b49..ede2eb7f461 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -173,7 +173,7 @@ void BKE_tracking_clamp_track(MovieTrackingTrack *track, int event) } } } - else if(event==CLAMP_PYRAMID_LEVELS || (event==CLAMP_SEARCH_DIM && track->tracker == TRACKER_KLT)) { + else if(event==CLAMP_PYRAMID_LEVELS || (event==CLAMP_SEARCH_DIM && track->tracker == TRACKER_KLT)) { float dim[2]; sub_v2_v2v2(dim, track->pat_max, track->pat_min); { diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index d47ba1274b1..9d68e1d899c 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1154,12 +1154,13 @@ IDProperty *ffmpeg_property_add(RenderData *rd, const char *type, int opt_index, /* not all versions of ffmpeg include that, so here we go ... */ -static const AVOption *my_av_find_opt(void *v, const char *name, - const char *unit, int mask, int flags){ +static const AVOption *my_av_find_opt(void *v, const char *name, + const char *unit, int mask, int flags) +{ AVClass *c= *(AVClass**)v; const AVOption *o= c->option; - for(;o && o->name; o++){ + for(;o && o->name; o++) { if(!strcmp(o->name, name) && (!unit || (o->unit && !strcmp(o->unit, unit))) && (o->flags & mask) == flags ) diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c index d5f66c0e75f..47c44629d65 100644 --- a/source/blender/blenlib/intern/BLI_kdtree.c +++ b/source/blender/blenlib/intern/BLI_kdtree.c @@ -179,17 +179,17 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest * stack[cur++]=root->right; } - while(cur--){ + while(cur--) { node=stack[cur]; cur_dist = node->co[node->d] - co[node->d]; - if(cur_dist<0.0f){ + if(cur_dist<0.0f) { cur_dist= -cur_dist*cur_dist; - if(-cur_distco,co,node->nor,nor); - if(cur_distco,co,node->nor,nor); - if(cur_distleft) stack[cur++]=node->left; } - if(cur+3 > totstack){ + if(cur+3 > totstack) { KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack"); memcpy(temp,stack,totstack*sizeof(KDTreeNode*)); if(stack != defaultstack) @@ -286,15 +286,15 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree stack[cur++]=root->right; } - while(cur--){ + while(cur--) { node=stack[cur]; cur_dist = node->co[node->d] - co[node->d]; - if(cur_dist<0.0f){ + if(cur_dist<0.0f) { cur_dist= -cur_dist*cur_dist; - if(foundco,co,node->nor,nor); if(foundco,co,node->nor,nor); if(foundindex,cur_dist,node->co); @@ -320,7 +320,7 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree if(node->left) stack[cur++]=node->left; } - if(cur+3 > totstack){ + if(cur+3 > totstack) { KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack"); memcpy(temp,stack,totstack*sizeof(KDTreeNode*)); if(stack != defaultstack) @@ -427,7 +427,7 @@ int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KD stack[cur++]=node->right; } - if(cur+3 > totstack){ + if(cur+3 > totstack) { KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack"); memcpy(temp,stack,totstack*sizeof(KDTreeNode*)); if(stack != defaultstack) diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index 5e64ed2e3e6..6abe6c7c8be 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -166,7 +166,7 @@ void *BLI_mempool_alloc(BLI_mempool *pool) pool->free = mpchunk->data; /*start of the list*/ if (pool->allow_iter) pool->free->freeword = FREEWORD; - for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){ + for(addr = mpchunk->data, j=0; j < pool->pchunk; j++) { curnode = ((BLI_freenode*)addr); addr += pool->esize; curnode->next = (BLI_freenode*)addr; diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index 8f6100f1122..3a0d44db12e 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -117,8 +117,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf che->width= glyph->advance.x * scale; // Start converting the FT data - npoints = (int *)MEM_callocN((ftoutline.n_contours)* sizeof(int),"endpoints") ; - onpoints = (int *)MEM_callocN((ftoutline.n_contours)* sizeof(int),"onpoints") ; + npoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int),"endpoints"); + onpoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int),"onpoints"); // calculate total points of each contour for(j = 0; j < ftoutline.n_contours; j++) { @@ -145,8 +145,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf //contour loop, bezier & conic styles merged for(j = 0; j < ftoutline.n_contours; j++) { // add new curve - nu = (Nurb*)MEM_callocN(sizeof(struct Nurb),"objfnt_nurb"); - bezt = (BezTriple*)MEM_callocN((onpoints[j])* sizeof(BezTriple),"objfnt_bezt") ; + nu = (Nurb *)MEM_callocN(sizeof(struct Nurb), "objfnt_nurb"); + bezt = (BezTriple *)MEM_callocN((onpoints[j]) * sizeof(BezTriple), "objfnt_bezt"); BLI_addtail(&che->nurbsbase, nu); nu->type= CU_BEZIER; diff --git a/source/blender/blenlib/intern/jitter.c b/source/blender/blenlib/intern/jitter.c index ab33187ec4d..52733b092d3 100644 --- a/source/blender/blenlib/intern/jitter.c +++ b/source/blender/blenlib/intern/jitter.c @@ -51,10 +51,10 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1) x = jit1[i]; y = jit1[i+1]; for (j = 2*num-2; j>=0 ; j-=2) { - if (i != j){ + if (i != j) { vecx = jit1[j] - x - 1.0f; vecy = jit1[j+1] - y - 1.0f; - for (k = 3; k>0 ; k--){ + for (k = 3; k>0 ; k--) { if( fabsf(vecx)0 && len= 0 ; i-=2){ + for (i=2*num -2; i>= 0 ; i-=2) { dvecx = dvecy = 0.0; x = jit1[i]; y = jit1[i+1]; - for (j =2*num -2; j>= 0 ; j-=2){ - if (i != j){ + for (j =2*num -2; j>= 0 ; j-=2) { + if (i != j) { vecx = jit1[j] - x - 1.0f; vecy = jit1[j+1] - y - 1.0f; @@ -130,7 +130,7 @@ void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2) x -= dvecx/2.0f; y -= dvecy/2.0f; - x -= floorf(x) ; + x -= floorf(x); y -= floorf(y); jit2[i] = x; jit2[i+1] = y; diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 461f53ac434..f418b87f37e 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -381,7 +381,7 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[ if(u>u2) SWAP(float, u, u2); if(u>1.0f+eps || u2<-eps) return -1; /* non-ovlerlapping segments */ - else if(maxf(0.0f, u) == minf(1.0f, u2)){ /* one common point: can return result */ + else if(maxf(0.0f, u) == minf(1.0f, u2)) { /* one common point: can return result */ interp_v2_v2v2(vi, v1, v2, maxf(0, u)); return 1; } @@ -995,7 +995,7 @@ int isect_sweeping_sphere_tri_v3( if(z <= 0.0f && (x >= 0.0f && y >= 0.0f)) { - //(((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y))) & 0x80000000){ + //(((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y))) & 0x80000000) { *r_lambda=t0; copy_v3_v3(ipoint,point); return 1; @@ -1154,7 +1154,7 @@ int isect_axial_line_tri_v3(const int axis, const float p1[3], const float p2[3] if ((v < 0.0f)||(v > 1.0f)) return 0; f= e1[a1]; - if((f > -0.000001f) && (f < 0.000001f)){ + if((f > -0.000001f) && (f < 0.000001f)) { f= e1[a2]; if((f > -0.000001f) && (f < 0.000001f)) return 0; u= (-p[a2]-v*e2[a2])/f; @@ -1680,8 +1680,8 @@ void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int, x1 += ix; error += delta_y; - if(callback(x1, y1, userData) == 0) { - return ; + if (callback(x1, y1, userData) == 0) { + return; } } } @@ -2523,7 +2523,7 @@ pointers may be NULL if not needed static float _det_m3(float m2[3][3]) { float det = 0.f; - if (m2){ + if (m2) { det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1]) -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1]) +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]); @@ -2548,8 +2548,8 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo if (pos && rpos && (list_size > 0)) /* paranoya check */ { /* do com for both clouds */ - for(a=0; aPolardecompose*/ /* build 'projection' matrix */ float m[3][3],mr[3][3],q[3][3],qi[3][3]; @@ -2587,7 +2587,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo zero_m3(mr); /* build 'projection' matrix */ - for(a=0; amass); mass needs renormalzation here ?? */ sub_v3_v3v3(vb,pos[a],accu_com); @@ -2628,7 +2628,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo /* without the far case ... but seems to work here pretty neat */ odet = 0.f; ndet = _det_m3(q); - while((odet-ndet)*(odet-ndet) > eps && i eps && i 0.0001f) { @@ -548,8 +548,8 @@ void interp_qt_qtqt(float result[4], const float quat1[4], const float quat2[4], { float quat[4], omega, cosom, sinom, sc1, sc2; - cosom = quat1[0]*quat2[0] + quat1[1]*quat2[1] + quat1[2]*quat2[2] + quat1[3]*quat2[3] ; - + cosom = quat1[0] * quat2[0] + quat1[1] * quat2[1] + quat1[2] * quat2[2] + quat1[3] * quat2[3]; + /* rotate around shortest angle */ if (cosom < 0.0f) { cosom = -cosom; diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index b3cb2856383..f77ea3895c3 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -957,29 +957,29 @@ static float noise3_perlin(float vec[3]) sz = surve(rz0); - q = g[ b00 + bz0 ] ; + q = g[ b00 + bz0 ]; u = at(rx0,ry0,rz0); - q = g[ b10 + bz0 ] ; + q = g[ b10 + bz0 ]; v = at(rx1,ry0,rz0); a = lerp(sx, u, v); - q = g[ b01 + bz0 ] ; + q = g[ b01 + bz0 ]; u = at(rx0,ry1,rz0); - q = g[ b11 + bz0 ] ; + q = g[ b11 + bz0 ]; v = at(rx1,ry1,rz0); b = lerp(sx, u, v); c = lerp(sy, a, b); /* interpolate in y at lo x */ - q = g[ b00 + bz1 ] ; + q = g[ b00 + bz1 ]; u = at(rx0,ry0,rz1); - q = g[ b10 + bz1 ] ; + q = g[ b10 + bz1 ]; v = at(rx1,ry0,rz1); a = lerp(sx, u, v); - q = g[ b01 + bz1 ] ; + q = g[ b01 + bz1 ]; u = at(rx0,ry1,rz1); - q = g[ b11 + bz1 ] ; + q = g[ b11 + bz1 ]; v = at(rx1,ry1,rz1); b = lerp(sx, u, v); diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index f2d88c0587b..e79490b29fd 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1935,12 +1935,12 @@ void BLI_string_to_utf8(char *original, char *utf_8, const char *code) if (cd == (iconv_t)(-1)) { printf("iconv_open Error"); *utf_8='\0'; - return ; + return; } rv=iconv(cd, &original, &inbytesleft, &utf_8, &outbytesleft); if (rv == (size_t) -1) { printf("iconv Error\n"); - return ; + return; } *utf_8 = '\0'; iconv_close(cd); diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index df0634e4fcf..7c48d000d39 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -104,7 +104,7 @@ static struct ListBase *dirbase = &dirbase_; char *BLI_current_working_dir(char *dir, const int maxncpy) { const char *pwd= getenv("PWD"); - if (pwd){ + if (pwd) { BLI_strncpy(dir, pwd, maxncpy); return dir; } @@ -117,12 +117,12 @@ static int bli_compare(struct direntry *entry1, struct direntry *entry2) { /* type is equal to stat.st_mode */ - if (S_ISDIR(entry1->type)){ + if (S_ISDIR(entry1->type)) { if (S_ISDIR(entry2->type)==0) return (-1); } else{ if (S_ISDIR(entry2->type)) return (1); } - if (S_ISREG(entry1->type)){ + if (S_ISREG(entry1->type)) { if (S_ISREG(entry2->type)==0) return (-1); } else{ if (S_ISREG(entry2->type)) return (1); @@ -175,7 +175,7 @@ double BLI_dir_free_space(const char *dir) strcpy(name,dir); - if(len){ + if(len) { slash = strrchr(name,'/'); if (slash) slash[1] = 0; } else strcpy(name,"/"); @@ -206,20 +206,20 @@ static void bli_builddir(const char *dirname, const char *relname) BLI_strncpy(buf, relname, sizeof(buf)); rellen=strlen(relname); - if (rellen){ + if (rellen) { buf[rellen]='/'; rellen++; } - if (chdir(dirname) == -1){ + if (chdir(dirname) == -1) { perror(dirname); return; } - if ( (dir = (DIR *)opendir(".")) ){ + if ( (dir = (DIR *)opendir(".")) ) { while ((fname = (struct dirent*) readdir(dir)) != NULL) { dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); - if (dlink){ + if (dlink) { BLI_strncpy(buf + rellen ,fname->d_name, sizeof(buf) - rellen); dlink->name = BLI_strdup(buf); BLI_addhead(dirbase,dlink); @@ -227,7 +227,7 @@ static void bli_builddir(const char *dirname, const char *relname) } } - if (newnum){ + if (newnum) { if(files) { void *tmp= realloc(files, (totnum+newnum) * sizeof(struct direntry)); @@ -243,9 +243,9 @@ static void bli_builddir(const char *dirname, const char *relname) if(files==NULL) files=(struct direntry *)malloc(newnum * sizeof(struct direntry)); - if (files){ + if (files) { dlink = (struct dirlink *) dirbase->first; - while(dlink){ + while(dlink) { memset(&files[actnum], 0 , sizeof(struct direntry)); files[actnum].relname = dlink->name; files[actnum].path = BLI_strdupcat(dirname, dlink->name); @@ -298,7 +298,7 @@ static void bli_adddirstrings(void) struct tm *tm; time_t zero= 0; - for(num=0, file= files; nummode1, types[0], sizeof(file->mode1)); @@ -313,14 +313,14 @@ static void bli_adddirstrings(void) if (((mode & S_ISGID) == S_ISGID) && (file->mode2[2]=='-'))file->mode2[2]='l'; - if (mode & (S_ISUID | S_ISGID)){ + if (mode & (S_ISUID | S_ISGID)) { if (file->mode1[2]=='x') file->mode1[2]='s'; else file->mode1[2]='S'; if (file->mode2[2]=='x')file->mode2[2]='s'; } - if (mode & S_ISVTX){ + if (mode & S_ISVTX) { if (file->mode3[2] == 'x') file->mode3[2] = 't'; else file->mode3[2] = 'T'; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6366b46dfa7..180ccaddb0a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -12590,7 +12590,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) act->type= act->otype= ACT_ACTION; } - else if (act->type == ACT_SHAPEACTION) { + else if (act->type == ACT_SHAPEACTION) { act->type = act->otype = ACT_ACTION; } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 8ea5427b1ed..d6beab4de21 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -721,7 +721,7 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree) else if(ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) ) write_curvemapping(wd, node->storage); else if(ntree->type==NTREE_COMPOSIT && node->type==CMP_NODE_MOVIEDISTORTION) - /* pass */ ; + /* pass */; else writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage); } diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index c2d8c356aae..b8bd3ab9fd6 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -55,7 +55,7 @@ void AnimationExporter::exportAnimations(Scene *sce) void AnimationExporter::operator() (Object *ob) { FCurve *fcu; - char * transformName ; + char *transformName; /* bool isMatAnim = false; */ /* UNUSED */ //Export transform animations @@ -254,7 +254,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa std::string input_id = create_source_from_fcurve(COLLADASW::InputSemantic::INPUT, fcu, anim_id, axis_name); // create output source - std::string output_id ; + std::string output_id; //quat rotations are skipped for now, because of complications with determining axis. if(quatRotation) @@ -302,7 +302,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa addSampler(sampler); - std::string target ; + std::string target; if ( !is_param ) target = translate_id(ob_name) diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index b889dd21177..097e9902de5 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -610,9 +610,10 @@ void AnimationImporter:: Assign_color_animations(const COLLADAFW::UniqueId& list void AnimationImporter:: Assign_float_animations(const COLLADAFW::UniqueId& listid, ListBase *AnimCurves, const char * anim_type) { char rna_path[100]; - if (animlist_map.find(listid) == animlist_map.end()) return ; - else - { + if (animlist_map.find(listid) == animlist_map.end()) { + return; + } + else { //anim_type has animations const COLLADAFW::AnimationList *animlist = animlist_map[listid]; const COLLADAFW::AnimationList::AnimationBindings& bindings = animlist->getAnimationBindings(); @@ -665,7 +666,7 @@ void AnimationImporter::apply_matrix_curves( Object * ob, std::vector& } // new curves to assign matrix transform animation FCurve *newcu[10]; // if tm_type is matrix, then create 10 curves: 4 rot, 3 loc, 3 scale - unsigned int totcu = 10 ; + unsigned int totcu = 10; const char *tm_str = NULL; char rna_path[200]; for (int i = 0; i < totcu; i++) { @@ -824,9 +825,10 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node , const COLLADAFW::UniqueId& listid = transform->getAnimationList(); //check if transformation has animations - if (animlist_map.find(listid) == animlist_map.end()) continue ; - else - { + if (animlist_map.find(listid) == animlist_map.end()) { + continue; + } + else { //transformation has animations const COLLADAFW::AnimationList *animlist = animlist_map[listid]; const COLLADAFW::AnimationList::AnimationBindings& bindings = animlist->getAnimationBindings(); @@ -1030,7 +1032,7 @@ void AnimationImporter::add_bone_animation_sampled(Object * ob, std::vectorgetAnimationList(); //check if transformation has animations - if (animlist_map.find(listid) == animlist_map.end()) continue ; - else - { + if (animlist_map.find(listid) == animlist_map.end()) { + continue; + } + else { types->transform = types->transform|NODE_TRANSFORM; break; } @@ -1868,7 +1871,7 @@ void AnimationImporter::add_bezt(FCurve *fcu, float fra, float value) //float fps = (float)FPS; BezTriple bez; memset(&bez, 0, sizeof(BezTriple)); - bez.vec[1][0] = fra ; + bez.vec[1][0] = fra; bez.vec[1][1] = value; bez.ipo = BEZT_IPO_LIN ;/* use default interpolation mode here... */ bez.f1 = bez.f2 = bez.f3 = SELECT; diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h index 5fb96017dee..e42a1cc7a55 100644 --- a/source/blender/collada/AnimationImporter.h +++ b/source/blender/collada/AnimationImporter.h @@ -148,7 +148,7 @@ public: std::map& object_map , std::map FW_object_map); - AnimMix* get_animation_type( const COLLADAFW::Node * node , std::map FW_object_map ) ; + AnimMix* get_animation_type( const COLLADAFW::Node * node , std::map FW_object_map ); void apply_matrix_curves( Object * ob, std::vector& animcurves, COLLADAFW::Node* root ,COLLADAFW::Node* node, COLLADAFW::Transformation * tm ); diff --git a/source/blender/collada/TransformWriter.cpp b/source/blender/collada/TransformWriter.cpp index 0cf26a03107..10a965308b1 100644 --- a/source/blender/collada/TransformWriter.cpp +++ b/source/blender/collada/TransformWriter.cpp @@ -102,8 +102,8 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob) for(int i = 0; i < 16; ++i) { - float f = (i%4 == i/4) ? 1.0f : 0.0f ; - add_parinv |= (ob->parentinv[i%4][i/4] != f); + float f = (i % 4 == i / 4) ? 1.0f : 0.0f; + add_parinv |= (ob->parentinv[i % 4][i / 4] != f); } if(add_parinv) diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index b84ec5427c5..62d4ea25c3d 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1101,7 +1101,7 @@ static size_t animfilter_action (bAnimContext *ac, ListBase *anim_data, bDopeShe } /* un-grouped F-Curves (only if we're not only considering those channels in the active group) */ - if (!(filter_mode & ANIMFILTER_ACTGROUPED)) { + if (!(filter_mode & ANIMFILTER_ACTGROUPED)) { FCurve *firstfcu = (lastchan)? (lastchan->next) : (act->curves.first); items += animfilter_fcurves(anim_data, ads, firstfcu, NULL, filter_mode, owner_id); } @@ -2043,7 +2043,7 @@ static size_t animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data, } /* check selection and object type filters */ - if ( (ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & SELECT) /*|| (base == sce->basact)*/) ) { + if ( (ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & SELECT) /*|| (base == sce->basact)*/) ) { /* only selected should be shown */ continue; } diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 28d3fa6e170..59645f10677 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1079,7 +1079,7 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm) * - the target isn't origArm/newArm itself * - the target is one that can be found in newArm/origArm */ - if(ct->subtarget[0] != '\0') { + if(ct->subtarget[0] != '\0') { if (ct->tar == origArm) { if(BLI_findstring(npchans, ct->subtarget, offsetof(bPoseChannel, name))) { ct->tar= newArm; @@ -3089,7 +3089,7 @@ static int armature_merge_exec (bContext *C, wmOperator *op) (ebo->flag & BONE_SELECTED) ) { /* set either end or start (end gets priority, unless it is already set) */ - if (bend == NULL) { + if (bend == NULL) { bend= ebo; bchild= child; } diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index f16771b624c..42ec06ee1c7 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -1008,7 +1008,7 @@ static void sk_interpolateDepth(bContext *C, SK_Stroke *stk, int start, int end, mul_v3_fl(ray_normal, distance * progress / length); add_v3_v3(stk->points[i].p, ray_normal); - progress += delta ; + progress += delta; } } diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index eb49f16584b..5ce44cb7a58 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -297,7 +297,7 @@ static int poselib_sanitise_exec (bContext *C, wmOperator *op) TimeMarker *marker, *markern; /* validate action */ - if (act == NULL) { + if (act == NULL) { BKE_report(op->reports, RPT_WARNING, "No Action to validate"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index b14ce7e4690..dc4af18be11 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -776,7 +776,7 @@ static void pose_copy_menu(Scene *scene) if (nr <= 0) return; - if (nr != 5) { + if (nr != 5) { for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { if ( (arm->layer & pchan->bone->layer) && (pchan->bone->flag & BONE_SELECTED) && diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index bf7cde54ccb..3c84ee65ac7 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -3599,13 +3599,13 @@ void REEB_draw() if (GLOBAL_RG->link_up && G.scene->toolsettings->skgen_options & SKGEN_DISP_ORIG) { - for (rg = GLOBAL_RG; rg->link_up; rg = rg->link_up) ; + for (rg = GLOBAL_RG; rg->link_up; rg = rg->link_up); } else { i = G.scene->toolsettings->skgen_multi_level; - for (rg = GLOBAL_RG; rg->multi_level != i && rg->link_up; rg = rg->link_up) ; + for (rg = GLOBAL_RG; rg->multi_level != i && rg->link_up; rg = rg->link_up); } glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE)); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 495c8a8f842..cf59e9fcd35 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -5714,7 +5714,9 @@ static int delete_exec(bContext *C, wmOperator *op) if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) { bezt1= bezt; bezt2= bezt+1; - if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) ; + if ((bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT)) { + /* pass */ + } else { /* maybe do not make cyclic */ if(a==0 && (nu->flagu & CU_NURB_CYCLIC) ) { bezt2= bezt+(nu->pntsu-1); @@ -5741,7 +5743,9 @@ static int delete_exec(bContext *C, wmOperator *op) if( bp->f1 & SELECT ) { bp1= bp; bp2= bp+1; - if( bp2->f1 & 1 ) ; + if (bp2->f1 & 1) { + /* pass */ + } else { /* maybe do not make cyclic */ if(a==0 && (nu->flagu & CU_NURB_CYCLIC) ) { bp2= bp+(nu->pntsu-1); diff --git a/source/blender/editors/include/ED_numinput.h b/source/blender/editors/include/ED_numinput.h index f103b07d09c..2b99e52057d 100644 --- a/source/blender/editors/include/ED_numinput.h +++ b/source/blender/editors/include/ED_numinput.h @@ -36,7 +36,7 @@ typedef struct NumInput { float val[3]; /* Direct value of the input */ int ctrl[3]; /* Control to indicate what to do with the numbers that are typed */ float increment; -} NumInput ; +} NumInput; /* NUMINPUT FLAGS */ #define NUM_NULL_ONE 2 diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 7e413cf75f7..b52280cd331 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2564,7 +2564,7 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i data->dragf+= (((float)(mx-data->draglastx))/deler) * (fabsf(data->dragstartx-mx)*0.004f); } else { /*no scaling */ - data->dragf+= ((float)(mx-data->draglastx))/deler ; + data->dragf += ((float)(mx - data->draglastx)) / deler; } CLAMP(data->dragf, 0.0f, 1.0f); diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 5eacef1478a..3dadd69c9f4 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1751,7 +1751,7 @@ void init_userdef_do_versions(void) U.dbl_click_time = 350; } if (U.anim_player_preset == 0) { - U.anim_player_preset = 1 ; + U.anim_player_preset = 1; } if (U.scrcastfps == 0) { U.scrcastfps = 10; diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c index 4b89c282945..a2cd394f86f 100644 --- a/source/blender/editors/mesh/bmesh_tools.c +++ b/source/blender/editors/mesh/bmesh_tools.c @@ -2510,7 +2510,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) } } - if (i == 1) { + if (i == 1) { if (singlesel) BM_elem_select_set(bm, v, FALSE); else diff --git a/source/blender/editors/mesh/knifetool.c b/source/blender/editors/mesh/knifetool.c index 62e82aaee47..3214ed9ec4b 100755 --- a/source/blender/editors/mesh/knifetool.c +++ b/source/blender/editors/mesh/knifetool.c @@ -1672,7 +1672,7 @@ static void remerge_faces(knifetool_opdata *kcd) idx = BM_elem_index_get(faces[0]); f2 = BM_faces_join(bm, faces, BLI_array_count(faces)); - if (f2) { + if (f2) { BMO_elem_flag_enable(bm, f2, FACE_NEW); BM_elem_index_set(f2, idx); /* set_dirty! */ /* BMESH_TODO, check if this is valid or not */ } diff --git a/source/blender/editors/mesh/mesh_navmesh.c b/source/blender/editors/mesh/mesh_navmesh.c index 436c924a7d7..374fbca0659 100644 --- a/source/blender/editors/mesh/mesh_navmesh.c +++ b/source/blender/editors/mesh/mesh_navmesh.c @@ -499,7 +499,7 @@ static int navmesh_face_copy_exec(bContext *C, wmOperator *op) if(targetPolyIdx > 0) { /* set target poly idx to other selected faces */ BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { - if(BM_elem_flag_test(efa, BM_ELEM_SELECT) && efa != efa_act) { + if(BM_elem_flag_test(efa, BM_ELEM_SELECT) && efa != efa_act) { int* recastDataBlock= (int*)CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_RECAST); *recastDataBlock= targetPolyIdx; } diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 5473552eedd..340a6df8bf6 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -166,7 +166,7 @@ static void multiresbake_get_normal(const MResolvePixelData *data, float norm[], data->mface[face_num].v3, data->mface[face_num].v4}; const int smoothnormal= (data->mface[face_num].flag & ME_SMOOTH); - if(!smoothnormal) { /* flat */ + if(!smoothnormal) { /* flat */ if(data->precomputed_normals) { copy_v3_v3(norm, &data->precomputed_normals[3*face_num]); } else { diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 1626a074c42..11ceda8a61f 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -729,9 +729,15 @@ static void copy_texture_space(Object *to, Object *ob) memcpy(poin1, poin2, 9*sizeof(float)); /* this was noted in DNA_mesh, curve, mball */ - if(to->type==OB_MESH) ; - else if(to->type==OB_MBALL) tex_space_mball(to); - else tex_space_curve(to->data); + if(to->type==OB_MESH) { + /* pass */ + } + else if (to->type == OB_MBALL) { + tex_space_mball(to); + } + else { + tex_space_curve(to->data); + } } diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 956ec868104..b186f788bbf 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -222,7 +222,7 @@ static int object_shape_key_mirror(bContext *C, Object *ob) float *fp1, *fp2; int u, v, w; /* half but found up odd value */ - const int pntsu_half = (((lt->pntsu / 2) + (lt->pntsu % 2))) ; + const int pntsu_half = (lt->pntsu / 2) + (lt->pntsu % 2); /* currently editmode isnt supported by mesh so * ignore here for now too */ diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index c528d8cd078..e8ada1e0655 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -804,7 +804,7 @@ int runSimulationCallback(void *data, int status, int frame) //printf("elbeem blender cb s%d, f%d, domainid:%d noOfFrames: %d \n", status,frame, settings->domainId, settings->noOfFrames ); // DEBUG } - if (fluidbake_breakjob(fb)) { + if (fluidbake_breakjob(fb)) { return FLUIDSIM_CBRET_ABORT; } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index dd7038716c4..3a65d701b58 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -686,7 +686,7 @@ static int envmap_save_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", path); - if(scene->r.scemode & R_EXTENSION) { + if(scene->r.scemode & R_EXTENSION) { BKE_add_image_extension(path, imtype); } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 980a6b44e4e..84e3f317fdb 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -1516,7 +1516,8 @@ static ProjPixel *project_paint_uvpixel_init( projPixel->mask_max = 0; /* which bounding box cell are we in?, needed for undo */ - projPixel->bb_cell_index = ((int)(((float)x_px/(float)ibuf->x) * PROJ_BOUNDBOX_DIV)) + ((int)(((float)y_px/(float)ibuf->y) * PROJ_BOUNDBOX_DIV)) * PROJ_BOUNDBOX_DIV ; + projPixel->bb_cell_index = ((int)(((float)x_px / (float)ibuf->x) * PROJ_BOUNDBOX_DIV)) + + ((int)(((float)y_px / (float)ibuf->y) * PROJ_BOUNDBOX_DIV)) * PROJ_BOUNDBOX_DIV; /* done with view3d_project_float inline */ if (ps->tool==PAINT_TOOL_CLONE) { diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 8c8c2da1712..dcd8820f749 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1045,8 +1045,8 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no } /* blend with existing coordinates */ - for(y = 0; y < gridsize; ++y) { - for(x = 0; x < gridsize; ++x) { + for(y = 0; y < gridsize; ++y) { + for(x = 0; x < gridsize; ++x) { float *co; float *fno; int index; diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index c84a9d10ab4..33d14ec38ae 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -533,7 +533,7 @@ void file_draw_list(const bContext *C, ARegion *ar) } } - if (!(file->selflag & EDITING_FILE)) { + if (!(file->selflag & EDITING_FILE)) { int tpos = (FILE_IMGDISPLAY == params->display) ? sy - layout->tile_h + layout->textheight : sy; file_draw_string(sx+1, tpos, file->relname, (float)textwidth, textheight, align); } diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 8a5f5c1427e..548a51d9ee2 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -172,7 +172,7 @@ static FileSelect file_select_do(bContext* C, int selected_idx) if(S_ISDIR(file->type)) { /* the path is too long and we are not going up! */ - if (strcmp(file->relname, "..") && strlen(params->dir) + strlen(file->relname) >= FILE_MAX ) { + if (strcmp(file->relname, "..") && strlen(params->dir) + strlen(file->relname) >= FILE_MAX ) { // XXX error("Path too long, cannot enter this directory"); } else { diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 5b4e133e283..44eadc9dee8 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -341,8 +341,8 @@ int ED_fileselect_layout_offset(FileLayout* layout, int x, int y) offsetx = (x)/(layout->tile_w + 2*layout->tile_border_x); offsety = (y)/(layout->tile_h + 2*layout->tile_border_y); - if (offsetx > layout->columns-1) return -1 ; - if (offsety > layout->rows-1) return -1 ; + if (offsetx > layout->columns - 1) return -1; + if (offsety > layout->rows - 1) return -1; if (layout->flag & FILE_LAYOUT_HOR) active_file = layout->rows*offsetx + offsety; diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 9a952d22274..ea894750605 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -245,8 +245,9 @@ void fsmenu_write_file(struct FSMenu* fsmenu, const char *filename) fprintf(fp, "[Recent]\n"); nskip = fsmenu_get_nentries(fsmenu, FS_CATEGORY_RECENT) - FSMENU_RECENT_MAX; // skip first entries if list too long - for (fsme= fsmenu_get_category(fsmenu, FS_CATEGORY_RECENT); fsme && (nskip>0); fsme= fsme->next, --nskip) - ; + for (fsme= fsmenu_get_category(fsmenu, FS_CATEGORY_RECENT); fsme && (nskip>0); fsme= fsme->next, --nskip) { + /* pass */ + } for (; fsme; fsme= fsme->next) { if (fsme->path && fsme->save) { fprintf(fp, "%s\n", fsme->path); diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 2c1e7a0c546..878543e6a36 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -5017,7 +5017,7 @@ void logic_buttons(bContext *C, ARegion *ar) (is_sensor_linked(block, sens)) ) { /* should we draw the pin? - for now always draw when there is a state */ - pin = (slogic->scaflag & BUTS_SENS_STATE && (sens->flag & SENS_SHOW || sens->flag & SENS_PIN)) ? 1:0 ; + pin = (slogic->scaflag & BUTS_SENS_STATE && (sens->flag & SENS_SHOW || sens->flag & SENS_PIN)) ? 1 : 0; sens->flag |= SENS_VISIBLE; uiDefIconButBitS(block, TOG, SENS_DEL, B_DEL_SENS, ICON_X, xco, yco, 22, UI_UNIT_Y, &sens->flag, 0, 0, 0, 0, "Delete Sensor"); @@ -5097,7 +5097,7 @@ void logic_buttons(bContext *C, ARegion *ar) (act->flag & ACT_VISIBLE) || /* this actuator has visible connection, display it */ (act->flag & ACT_PIN && slogic->scaflag & BUTS_ACT_STATE)) { - pin = (slogic->scaflag & BUTS_ACT_STATE && (act->flag & SENS_SHOW || act->flag & SENS_PIN)) ? 1:0 ; + pin = (slogic->scaflag & BUTS_ACT_STATE && (act->flag & SENS_SHOW || act->flag & SENS_PIN)) ? 1 : 0; act->flag |= ACT_VISIBLE; /* mark the actuator as visible to help implementing the up/down action */ uiDefIconButBitS(block, TOG, ACT_DEL, B_DEL_ACT, ICON_X, xco, yco, 22, UI_UNIT_Y, &act->flag, 0, 0, 0, 0, "Delete Actuator"); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index d92bdc42958..201c8be7426 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -3277,7 +3277,7 @@ static void node_delete_reconnect(bNodeTree* tree, bNode* node) the first link evaluated will be used to determine the possible connection. */ for(link= tree->links.first; link; link=link->next) { - if (link->tonode == node) { numberOfConnectedInputSockets++; } + if (link->tonode == node) { numberOfConnectedInputSockets++; } type = is_connected_to_input_socket(node, link); switch (type) { case SOCK_RGBA: diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index e40732804f7..bb694ae5705 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -483,7 +483,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar uiBlockSetEmboss(block, UI_EMBOSS); } - else if(tselem->type==TSE_MODIFIER) { + else if(tselem->type==TSE_MODIFIER) { ModifierData *md= (ModifierData *)te->directdata; ob = (Object *)tselem->id; @@ -496,7 +496,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow renderability"); uiButSetFunc(bt, restrictbutton_modifier_cb, scene, ob); } - else if(tselem->type==TSE_POSE_CHANNEL) { + else if(tselem->type==TSE_POSE_CHANNEL) { bPoseChannel *pchan= (bPoseChannel *)te->directdata; Bone *bone = pchan->bone; @@ -509,7 +509,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, &(bone->flag), 0, 0, 0, 0, "Restrict/Allow selection in the 3D View"); uiButSetFunc(bt, restrictbutton_bone_cb, NULL, NULL); } - else if(tselem->type==TSE_EBONE) { + else if(tselem->type==TSE_EBONE) { EditBone *ebone= (EditBone *)te->directdata; uiBlockSetEmboss(block, UI_EMBOSSN); diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 32c5683607d..de798e5c23b 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -248,7 +248,7 @@ void item_rename_cb(bContext *C, Scene *UNUSED(scene), TreeElement *te, TreeStor { ARegion *ar= CTX_wm_region(C); ReportList *reports= CTX_wm_reports(C); // XXX - do_item_rename(ar, te, tselem, reports) ; + do_item_rename(ar, te, tselem, reports); } static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, TreeElement *te, const float mval[2]) @@ -261,7 +261,7 @@ static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, T /* name and first icon */ if(mval[0]>te->xs+UI_UNIT_X && mval[0]xend) { - do_item_rename(ar, te, tselem, reports) ; + do_item_rename(ar, te, tselem, reports); } return 1; } diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 33e0136b6bb..7f3a8694d68 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -859,7 +859,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i ted->name= "Drivers"; for (fcu= adt->drivers.first; fcu; fcu= fcu->next) { - if (fcu->driver && fcu->driver->variables.first) { + if (fcu->driver && fcu->driver->variables.first) { ChannelDriver *driver= fcu->driver; DriverVar *dvar; @@ -1561,7 +1561,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops) ten= outliner_add_element(soops, &soops->tree, (void*)&mainptr, NULL, TSE_RNA_STRUCT, -1); - if(show_opened) { + if(show_opened) { tselem= TREESTORE(ten); tselem->flag &= ~TSE_CLOSED; } @@ -1573,7 +1573,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops) ten= outliner_add_element(soops, &soops->tree, (void*)&userdefptr, NULL, TSE_RNA_STRUCT, -1); - if(show_opened) { + if(show_opened) { tselem= TREESTORE(ten); tselem->flag &= ~TSE_CLOSED; } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index b2bf64899a4..222be03b2fe 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -538,7 +538,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen *selseq1 = *selseq2 = *selseq3 = NULL; return 1; /* succsess */ case 1: - if(seq2==NULL) { + if(seq2==NULL) { *error_str= "Need at least one selected sequence strip"; return 0; } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 2d716d522f2..de73acce7b4 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1061,9 +1061,9 @@ static void spotvolume(float lvec[3], float vvec[3], const float inp) /* translating this comment to english didnt really help me understanding the math! :-) (ton) */ - q[1] = plane[1] ; - q[2] = -plane[0] ; - q[3] = 0 ; + q[1] = plane[1]; + q[2] = -plane[0]; + q[3] = 0; normalize_v3(&q[1]); angle = saacos(plane[2])/2.0f; diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 63d93108877..e304c6d75af 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -755,7 +755,7 @@ static void draw_view_icon(RegionView3D *rv3d) icon= ICON_AXIS_FRONT; else if ( ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT)) icon= ICON_AXIS_SIDE; - else return ; + else return; glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 807fdddb22f..785543e7ca2 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2161,7 +2161,7 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op)) else { Base *base; for (base= FIRSTBASE; base; base = base->next) { - if (TESTBASE(v3d, base)) { + if (TESTBASE(v3d, base)) { if (skip_camera && base->object == v3d->camera) { continue; diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index c5e0572154a..3f49df88ff8 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -982,7 +982,7 @@ static int snap_curs_to_active(bContext *C, wmOperator *UNUSED(op)) curs = give_cursor(scene, v3d); - if (obedit) { + if (obedit) { if (obedit->type == OB_MESH) { /* check active */ Mesh *me= obedit->data; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 915a1fae412..74343163c39 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1419,7 +1419,7 @@ static void initlocalview(Main *bmain, Scene *scene, ScrArea *sa) } else { for (base= FIRSTBASE; base; base= base->next) { - if (TESTBASE(v3d, base)) { + if (TESTBASE(v3d, base)) { minmax_object(base->object, min, max); base->lay |= locallay; base->object->lay= base->lay; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 56c05fea29f..bb10aa448d6 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5182,7 +5182,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) (ob->mode & OB_MODE_PARTICLE_EDIT) && PE_get_current(t->scene, ob)) { - /* do nothing */ ; + /* do nothing */ } else { /* Objects */ int i, recalcObPaths=0; diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index c2bcb290865..7233efef20f 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -848,12 +848,12 @@ static void uv_map_transform_center(Scene *scene, View3D *v3d, float *result, /* only operates on the edit object - this is all that's needed now */ - switch(around) { + switch (around) { case V3D_CENTER: /* bounding box center */ min[0]= min[1]= min[2]= 1e20f; max[0]= max[1]= max[2]= -1e20f; - BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { + BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { if(BM_elem_flag_test(efa, BM_ELEM_SELECT)) { BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) { DO_MINMAX(l->v->co, min, max); diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp index f605441282b..e427ec6bd5e 100644 --- a/source/blender/ikplugin/intern/itasc_plugin.cpp +++ b/source/blender/ikplugin/intern/itasc_plugin.cpp @@ -477,7 +477,7 @@ static void GetEulerXZY(const KDL::Rotation& R, double& X,double& Z,double& Y) if (fabs(R(0,1)) > 1.0 - KDL::epsilon ) { X = -KDL::sign(R(0,1)) * KDL::atan2(R(1,2), R(1,0)); Z = -KDL::sign(R(0,1)) * KDL::PI / 2; - Y = 0.0 ; + Y = 0.0; } else { X = KDL::atan2(R(2,1), R(1,1)); Z = KDL::atan2(-R(0,1), KDL::sqrt( KDL::sqr(R(0,0)) + KDL::sqr(R(0,2)))); @@ -490,7 +490,7 @@ static void GetEulerXYZ(const KDL::Rotation& R, double& X,double& Y,double& Z) if (fabs(R(0,2)) > 1.0 - KDL::epsilon ) { X = KDL::sign(R(0,2)) * KDL::atan2(-R(1,0), R(1,1)); Y = KDL::sign(R(0,2)) * KDL::PI / 2; - Z = 0.0 ; + Z = 0.0; } else { X = KDL::atan2(-R(1,2), R(2,2)); Y = KDL::atan2(R(0,2), KDL::sqrt( KDL::sqr(R(0,0)) + KDL::sqr(R(0,1)))); diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index f36db61f27a..ca2c4719917 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -649,7 +649,7 @@ static void free_proxy_output_ffmpeg(struct proxy_output_ctx * ctx, } if (!rollback) { - while (add_to_proxy_output_ffmpeg(ctx, NULL)) ; + while (add_to_proxy_output_ffmpeg(ctx, NULL)) {} } avcodec_flush_buffers(ctx->c); diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index f8082c95f84..3d88a24ba37 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -403,7 +403,7 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag case CINEMA2K_24: case CINEMA4K_24: for(i=0 ; itcp_numlayers ; i++){ - temp_rate = 0 ; + temp_rate = 0; if (img_fol->rates[i]== 0){ parameters->tcp_rates[0]= ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))/ (CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy); @@ -423,7 +423,7 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag case CINEMA2K_48: for(i=0 ; itcp_numlayers ; i++){ - temp_rate = 0 ; + temp_rate = 0; if (img_fol->rates[i]== 0){ parameters->tcp_rates[0]= ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))/ (CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy); diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index a43a8672651..6c3b7594264 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -66,7 +66,7 @@ static ImBuf * ibJpegImageFromCinfo(struct jpeg_decompress_struct * cinfo, int f /* * In principle there are 4 jpeg formats. - * + * * 1. jpeg - standard printing, u & v at quarter of resulution * 2. jvid - standaard video, u & v half resolution, frame not interlaced @@ -187,7 +187,7 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t src->pub.init_source = init_source; src->pub.fill_input_buffer = fill_input_buffer; src->pub.skip_input_data = skip_input_data; - src->pub.resync_to_restart = jpeg_resync_to_restart; + src->pub.resync_to_restart = jpeg_resync_to_restart; src->pub.term_source = term_source; src->pub.bytes_in_buffer = size; @@ -329,7 +329,7 @@ static ImBuf * ibJpegImageFromCinfo(struct jpeg_decompress_struct * cinfo, int f rect[0] = rect[1] = rect[2] = *buffer++; rect += 4; } - break; + break; case 3: for (x=ibuf->x; x >0; x--) { rect[3] = 255; @@ -338,7 +338,7 @@ static ImBuf * ibJpegImageFromCinfo(struct jpeg_decompress_struct * cinfo, int f rect[2] = *buffer++; rect += 4; } - break; + break; case 4: for (x=ibuf->x; x >0; x--) { r = *buffer++; @@ -361,7 +361,7 @@ static ImBuf * ibJpegImageFromCinfo(struct jpeg_decompress_struct * cinfo, int f if (b & 0xffffff00) { if (b < 0) b = 0; else b = 255; - } + } rect[3] = 255 - k; rect[2] = b; @@ -526,26 +526,26 @@ next_stamp_info: buffer = row_pointer[0]; switch(cinfo->in_color_space){ - case JCS_RGB: - for (x = 0; x < ibuf->x; x++) { - *buffer++ = rect[0]; - *buffer++ = rect[1]; - *buffer++ = rect[2]; - rect += 4; - } - break; - case JCS_GRAYSCALE: - for (x = 0; x < ibuf->x; x++) { - *buffer++ = rect[0]; - rect += 4; - } - break; - case JCS_UNKNOWN: - memcpy(buffer, rect, 4 * ibuf->x); - break; - /* default was missing... intentional ? */ - default: - ; /* do nothing */ + case JCS_RGB: + for (x = 0; x < ibuf->x; x++) { + *buffer++ = rect[0]; + *buffer++ = rect[1]; + *buffer++ = rect[2]; + rect += 4; + } + break; + case JCS_GRAYSCALE: + for (x = 0; x < ibuf->x; x++) { + *buffer++ = rect[0]; + rect += 4; + } + break; + case JCS_UNKNOWN: + memcpy(buffer, rect, 4 * ibuf->x); + break; + /* default was missing... intentional ? */ + default: + ; /* do nothing */ } jpeg_write_scanlines(cinfo, row_pointer, 1); @@ -579,18 +579,18 @@ static int init_jpeg(FILE * outfile, struct jpeg_compress_struct * cinfo, struct if (ibuf->planes == 32) cinfo->in_color_space = JCS_UNKNOWN; #endif switch(cinfo->in_color_space){ - case JCS_RGB: - cinfo->input_components = 3; - break; - case JCS_GRAYSCALE: - cinfo->input_components = 1; - break; - case JCS_UNKNOWN: - cinfo->input_components = 4; - break; - /* default was missing... intentional ? */ - default: - ; /* do nothing */ + case JCS_RGB: + cinfo->input_components = 3; + break; + case JCS_GRAYSCALE: + cinfo->input_components = 1; + break; + case JCS_UNKNOWN: + cinfo->input_components = 4; + break; + /* default was missing... intentional ? */ + default: + ; /* do nothing */ } jpeg_set_defaults(cinfo); @@ -693,8 +693,8 @@ static int save_jstjpeg(const char *name, struct ImBuf *ibuf) IMB_rectcpy(tbuf, ibuf, 0, 0, 0, 0, ibuf->x, ibuf->y); sprintf(fieldname, "%s.jf0", name); - returnval = save_vidjpeg(fieldname, tbuf) ; - if (returnval == 1) { + returnval = save_vidjpeg(fieldname, tbuf); + if (returnval == 1) { IMB_rectcpy(tbuf, ibuf, 0, 0, tbuf->x, 0, ibuf->x, ibuf->y); sprintf(fieldname, "%s.jf1", name); returnval = save_vidjpeg(fieldname, tbuf); diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index a5a9427ea89..ad729b34d31 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -98,7 +98,7 @@ class Mem_IStream: public IStream public: Mem_IStream (unsigned char *exrbuf, size_t exrsize): - IStream("dummy"), _exrpos (0), _exrsize(exrsize) { _exrbuf = exrbuf; } + IStream("dummy"), _exrpos (0), _exrsize(exrsize) { _exrbuf = exrbuf; } virtual bool read (char c[], int n); virtual Int64 tellg (); diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index a7188248d58..c131d385874 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -76,18 +76,18 @@ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1) _p1f = ibuf1->rect_float; destf= ibuf2->rect_float; - for(y=ibuf2->y;y>0;y--){ + for(y=ibuf2->y;y>0;y--) { p1 = _p1; p1f = _p1f; - for(x = ibuf2->x ; x>0 ; x--){ + for(x = ibuf2->x; x>0; x--) { if (do_rect) { - a = *(p1++) ; - b = *(p1++) ; - g = *(p1++) ; + a = *(p1++); + b = *(p1++); + g = *(p1++); r = *(p1++); - a += *(p1++) ; - b += *(p1++) ; - g += *(p1++) ; + a += *(p1++); + b += *(p1++); + g += *(p1++); r += *(p1++); *(dest++) = a >> 1; *(dest++) = b >> 1; @@ -136,7 +136,7 @@ struct ImBuf *IMB_double_fast_x(struct ImBuf *ibuf1) p1f = (float *)ibuf1->rect_float; destf = (float *)ibuf2->rect_float; - for(i = ibuf1->y * ibuf1->x ; i>0 ; i--) { + for(i = ibuf1->y * ibuf1->x; i > 0; i--) { if (do_rect) { col = *p1++; *dest++ = col; @@ -195,7 +195,7 @@ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1) _p1f = (float *) ibuf1->rect_float; destf= (float *) ibuf2->rect_float; - for(y=ibuf2->y ; y>0 ; y--){ + for(y=ibuf2->y; y>0; y--) { if (do_rect) { p1 = _p1; p2 = _p1 + (ibuf1->x << 2); @@ -204,15 +204,15 @@ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1) p1f = _p1f; p2f = _p1f + (ibuf1->x << 2); } - for(x = ibuf2->x ; x>0 ; x--){ + for(x = ibuf2->x; x > 0; x--) { if (do_rect) { - a = *(p1++) ; - b = *(p1++) ; - g = *(p1++) ; + a = *(p1++); + b = *(p1++); + g = *(p1++); r = *(p1++); - a += *(p2++) ; - b += *(p2++) ; - g += *(p2++) ; + a += *(p2++); + b += *(p2++); + g += *(p2++); r += *(p2++); *(dest++) = a >> 1; *(dest++) = b >> 1; @@ -220,13 +220,13 @@ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1) *(dest++) = r >> 1; } if (do_float) { - af = *(p1f++) ; - bf = *(p1f++) ; - gf = *(p1f++) ; + af = *(p1f++); + bf = *(p1f++); + gf = *(p1f++); rf = *(p1f++); - af += *(p2f++) ; - bf += *(p2f++) ; - gf += *(p2f++) ; + af += *(p2f++); + bf += *(p2f++); + gf += *(p2f++); rf += *(p2f++); *(destf++) = 0.5f*af; *(destf++) = 0.5f*bf; @@ -263,15 +263,15 @@ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1) p1f = (float *) ibuf1->rect_float; dest1f= (float *) ibuf2->rect_float; - for(y = ibuf1->y ; y>0 ; y--){ + for(y = ibuf1->y; y > 0; y--) { if (do_rect) { dest2 = dest1 + ibuf2->x; - for(x = ibuf2->x ; x>0 ; x--) *dest1++ = *dest2++ = *p1++; + for(x = ibuf2->x; x > 0; x--) *dest1++ = *dest2++ = *p1++; dest1 = dest2; } if (do_float) { dest2f = dest1f + (4*ibuf2->x); - for(x = ibuf2->x*4 ; x>0 ; x--) *dest1f++ = *dest2f++ = *p1f++; + for(x = ibuf2->x * 4; x > 0; x--) *dest1f++ = *dest2f++ = *p1f++; dest1f = dest2f; } } @@ -310,10 +310,10 @@ void imb_onehalf_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1) p1 = (uchar *) ibuf1->rect; dest=(uchar *) ibuf2->rect; - for(y=ibuf2->y;y>0;y--){ + for(y=ibuf2->y;y>0;y--) { if (do_rect) p2 = p1 + (ibuf1->x << 2); if (do_float) p2f = p1f + (ibuf1->x << 2); - for(x=ibuf2->x;x>0;x--){ + for(x=ibuf2->x;x>0;x--) { if (do_rect) { dest[0] = (p1[0] + p2[0] + p1[4] + p2[4]) >> 2; dest[1] = (p1[1] + p2[1] + p1[5] + p2[5]) >> 2; @@ -323,7 +323,7 @@ void imb_onehalf_no_alloc(struct ImBuf *ibuf2, struct ImBuf *ibuf1) p2 += 8; dest += 4; } - if (do_float){ + if (do_float) { destf[0] = 0.25f*(p1f[0] + p2f[0] + p1f[4] + p2f[4]); destf[1] = 0.25f*(p1f[1] + p2f[1] + p1f[5] + p2f[5]); destf[2] = 0.25f*(p1f[2] + p2f[2] + p1f[6] + p2f[6]); @@ -869,12 +869,12 @@ static struct ImBuf *scaledownx(struct ImBuf *ibuf, int newx) newrectf = _newrectf; } - for (y = ibuf->y; y>0 ; y--) { + for (y = ibuf->y; y > 0; y--) { sample = 0.0f; val[0]= val[1]= val[2]= val[3]= 0.0f; valf[0]=valf[1]=valf[2]=valf[3]= 0.0f; - for (x = newx ; x>0 ; x--) { + for (x = newx; x > 0; x--) { if (do_rect) { nval[0] = - val[0] * sample; nval[1] = - val[1] * sample; @@ -890,7 +890,7 @@ static struct ImBuf *scaledownx(struct ImBuf *ibuf, int newx) sample += add; - while (sample >= 1.0f){ + while (sample >= 1.0f) { sample -= 1.0f; if (do_rect) { @@ -991,7 +991,7 @@ static struct ImBuf *scaledowny(struct ImBuf *ibuf, int newy) add = (ibuf->y - 0.01) / newy; skipx = 4 * ibuf->x; - for (x = skipx - 4; x>=0 ; x-= 4) { + for (x = skipx - 4; x >= 0; x -= 4) { if (do_rect) { rect = ((uchar *) ibuf->rect) + x; newrect = _newrect + x; @@ -1005,7 +1005,7 @@ static struct ImBuf *scaledowny(struct ImBuf *ibuf, int newy) val[0]= val[1]= val[2]= val[3]= 0.0f; valf[0]=valf[1]=valf[2]=valf[3]= 0.0f; - for (y = newy ; y>0 ; y--) { + for (y = newy; y > 0; y--) { if (do_rect) { nval[0] = - val[0] * sample; nval[1] = - val[1] * sample; @@ -1132,93 +1132,93 @@ static struct ImBuf *scaleupx(struct ImBuf *ibuf, int newx) newrect = _newrect; newrectf = _newrectf; - for (y = ibuf->y; y>0 ; y--){ + for (y = ibuf->y; y > 0; y--) { sample = 0; if (do_rect) { - val_a = rect[0] ; + val_a = rect[0]; nval_a = rect[4]; - diff_a = nval_a - val_a ; + diff_a = nval_a - val_a; val_a += 0.5f; - val_b = rect[1] ; + val_b = rect[1]; nval_b = rect[5]; - diff_b = nval_b - val_b ; + diff_b = nval_b - val_b; val_b += 0.5f; - val_g = rect[2] ; + val_g = rect[2]; nval_g = rect[6]; - diff_g = nval_g - val_g ; + diff_g = nval_g - val_g; val_g += 0.5f; - val_r = rect[3] ; + val_r = rect[3]; nval_r = rect[7]; - diff_r = nval_r - val_r ; + diff_r = nval_r - val_r; val_r += 0.5f; rect += 8; } if (do_float) { - val_af = rectf[0] ; + val_af = rectf[0]; nval_af = rectf[4]; diff_af = nval_af - val_af; - val_bf = rectf[1] ; + val_bf = rectf[1]; nval_bf = rectf[5]; diff_bf = nval_bf - val_bf; - val_gf = rectf[2] ; + val_gf = rectf[2]; nval_gf = rectf[6]; diff_gf = nval_gf - val_gf; - val_rf = rectf[3] ; + val_rf = rectf[3]; nval_rf = rectf[7]; diff_rf = nval_rf - val_rf; rectf += 8; } - for (x = newx ; x>0 ; x--){ - if (sample >= 1.0f){ + for (x = newx; x > 0; x--) { + if (sample >= 1.0f) { sample -= 1.0f; if (do_rect) { - val_a = nval_a ; - nval_a = rect[0] ; - diff_a = nval_a - val_a ; + val_a = nval_a; + nval_a = rect[0]; + diff_a = nval_a - val_a; val_a += 0.5f; - val_b = nval_b ; - nval_b = rect[1] ; - diff_b = nval_b - val_b ; + val_b = nval_b; + nval_b = rect[1]; + diff_b = nval_b - val_b; val_b += 0.5f; - val_g = nval_g ; - nval_g = rect[2] ; - diff_g = nval_g - val_g ; + val_g = nval_g; + nval_g = rect[2]; + diff_g = nval_g - val_g; val_g += 0.5f; - val_r = nval_r ; - nval_r = rect[3] ; - diff_r = nval_r - val_r ; + val_r = nval_r; + nval_r = rect[3]; + diff_r = nval_r - val_r; val_r += 0.5f; rect += 4; } if (do_float) { - val_af = nval_af ; - nval_af = rectf[0] ; - diff_af = nval_af - val_af ; + val_af = nval_af; + nval_af = rectf[0]; + diff_af = nval_af - val_af; - val_bf = nval_bf ; - nval_bf = rectf[1] ; - diff_bf = nval_bf - val_bf ; + val_bf = nval_bf; + nval_bf = rectf[1]; + diff_bf = nval_bf - val_bf; - val_gf = nval_gf ; - nval_gf = rectf[2] ; - diff_gf = nval_gf - val_gf ; + val_gf = nval_gf; + nval_gf = rectf[2]; + diff_gf = nval_gf - val_gf; - val_rf = nval_rf ; - nval_rf = rectf[3] ; + val_rf = nval_rf; + nval_rf = rectf[3]; diff_rf = nval_rf - val_rf; rectf += 4; } @@ -1300,31 +1300,31 @@ static struct ImBuf *scaleupy(struct ImBuf *ibuf, int newy) newrect = _newrect; newrectf = _newrectf; - for (x = ibuf->x; x>0 ; x--){ + for (x = ibuf->x; x > 0; x--) { sample = 0; if (do_rect) { rect = ((uchar *)ibuf->rect) + 4*(x-1); newrect = _newrect + 4*(x-1); - val_a = rect[0] ; + val_a = rect[0]; nval_a = rect[skipx]; - diff_a = nval_a - val_a ; + diff_a = nval_a - val_a; val_a += 0.5f; - val_b = rect[1] ; + val_b = rect[1]; nval_b = rect[skipx+1]; - diff_b = nval_b - val_b ; + diff_b = nval_b - val_b; val_b += 0.5f; - val_g = rect[2] ; + val_g = rect[2]; nval_g = rect[skipx+2]; - diff_g = nval_g - val_g ; + diff_g = nval_g - val_g; val_g += 0.5f; - val_r = rect[3] ; + val_r = rect[3]; nval_r = rect[skipx+4]; - diff_r = nval_r - val_r ; + diff_r = nval_r - val_r; val_r += 0.5f; rect += 2*skipx; @@ -1333,66 +1333,66 @@ static struct ImBuf *scaleupy(struct ImBuf *ibuf, int newy) rectf = ((float *)ibuf->rect_float) + 4*(x-1); newrectf = _newrectf + 4*(x-1); - val_af = rectf[0] ; + val_af = rectf[0]; nval_af = rectf[skipx]; diff_af = nval_af - val_af; - val_bf = rectf[1] ; + val_bf = rectf[1]; nval_bf = rectf[skipx+1]; diff_bf = nval_bf - val_bf; - val_gf = rectf[2] ; + val_gf = rectf[2]; nval_gf = rectf[skipx+2]; diff_gf = nval_gf - val_gf; - val_rf = rectf[3] ; + val_rf = rectf[3]; nval_rf = rectf[skipx+3]; diff_rf = nval_rf - val_rf; rectf += 2*skipx; } - for (y = newy ; y>0 ; y--){ - if (sample >= 1.0f){ + for (y = newy; y > 0; y--) { + if (sample >= 1.0f) { sample -= 1.0f; if (do_rect) { - val_a = nval_a ; - nval_a = rect[0] ; - diff_a = nval_a - val_a ; + val_a = nval_a; + nval_a = rect[0]; + diff_a = nval_a - val_a; val_a += 0.5f; - val_b = nval_b ; - nval_b = rect[1] ; - diff_b = nval_b - val_b ; + val_b = nval_b; + nval_b = rect[1]; + diff_b = nval_b - val_b; val_b += 0.5f; - val_g = nval_g ; - nval_g = rect[2] ; - diff_g = nval_g - val_g ; + val_g = nval_g; + nval_g = rect[2]; + diff_g = nval_g - val_g; val_g += 0.5f; - val_r = nval_r ; - nval_r = rect[3] ; - diff_r = nval_r - val_r ; + val_r = nval_r; + nval_r = rect[3]; + diff_r = nval_r - val_r; val_r += 0.5f; rect += skipx; } if (do_float) { - val_af = nval_af ; - nval_af = rectf[0] ; - diff_af = nval_af - val_af ; + val_af = nval_af; + nval_af = rectf[0]; + diff_af = nval_af - val_af; - val_bf = nval_bf ; - nval_bf = rectf[1] ; - diff_bf = nval_bf - val_bf ; + val_bf = nval_bf; + nval_bf = rectf[1]; + diff_bf = nval_bf - val_bf; - val_gf = nval_gf ; - nval_gf = rectf[2] ; - diff_gf = nval_gf - val_gf ; + val_gf = nval_gf; + nval_gf = rectf[2]; + diff_gf = nval_gf - val_gf; - val_rf = nval_rf ; - nval_rf = rectf[3] ; + val_rf = nval_rf; + nval_rf = rectf[3]; diff_rf = nval_rf - val_rf; rectf += skipx; } @@ -1448,12 +1448,12 @@ static void scalefast_Z_ImBuf(ImBuf *ibuf, int newx, int newy) newrect = _newrect; - for (y = newy; y > 0 ; y--){ + for (y = newy; y > 0; y--) { rect = (unsigned int*) ibuf->zbuf; rect += (ofsy >> 16) * ibuf->x; ofsy += stepy; ofsx = 32768; - for (x = newx ; x > 0 ; x--){ + for (x = newx; x > 0; x--) { *newrect++ = rect[ofsx >> 16]; ofsx += stepx; } @@ -1530,7 +1530,7 @@ struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned stepy = (65536.0 * (ibuf->y - 1.0) / (newy - 1.0)) + 0.5; ofsy = 32768; - for (y = newy; y > 0 ; y--){ + for (y = newy; y > 0; y--) { if(do_rect) { rect = ibuf->rect; rect += (ofsy >> 16) * ibuf->x; @@ -1543,7 +1543,7 @@ struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned ofsx = 32768; if (do_rect) { - for (x = newx ; x>0 ; x--){ + for (x = newx; x>0; x--) { *newrect++ = rect[ofsx >> 16]; ofsx += stepx; } @@ -1551,7 +1551,7 @@ struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned if (do_float) { ofsx = 32768; - for (x = newx ; x>0 ; x--){ + for (x = newx; x>0; x--) { *newrectf++ = rectf[ofsx >> 16]; ofsx += stepx; } diff --git a/source/blender/imbuf/intern/thumbs_blend.c b/source/blender/imbuf/intern/thumbs_blend.c index 149b5fb9096..037b4ab63c0 100644 --- a/source/blender/imbuf/intern/thumbs_blend.c +++ b/source/blender/imbuf/intern/thumbs_blend.c @@ -49,7 +49,7 @@ static ImBuf *loadblend_thumb(gzFile gzfile) int bhead[24/sizeof(int)]; /* max size on 64bit */ char endian, pointer_size; char endian_switch; - int sizeof_bhead ; + int sizeof_bhead; /* read the blend file header */ if(gzread(gzfile, buf, 12) != 12) diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index 817da3cd445..41b830847ad 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -138,7 +138,7 @@ typedef struct bCameraActuator { float damping; short pad1, axis; float pad2; -} bCameraActuator ; +} bCameraActuator; typedef struct bConstraintActuator { short type, mode; diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 6603288912b..6b11fd0766f 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -325,7 +325,7 @@ typedef struct SoftBody { choke, solver_ID, plastic,springpreload - ; + ; struct SBScratch *scratch; /* scratch pad/cache on live time not saved in file */ float shearstiff; diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c index 551f501b1d0..fe2a074bf87 100644 --- a/source/blender/modifiers/intern/MOD_boolean_util.c +++ b/source/blender/modifiers/intern/MOD_boolean_util.c @@ -223,7 +223,7 @@ static void FaceIt_Construct( // allocate some memory for blender iterator it = (FaceIt *)(MEM_mallocN(sizeof(FaceIt),"Boolean_FIt")); if (it == 0) { - return ; + return; } // assign blender specific variables it->dm = dm; diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index 6fe319464de..e5fa0a323df 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -244,10 +244,12 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, if (aspx == aspy) { offsetmat[3][0] -= cam->shiftx; offsetmat[3][1] -= cam->shifty; - } else if (aspx < aspy) { + } + else if (aspx < aspy) { offsetmat[3][0] -=(cam->shiftx * aspy/aspx); offsetmat[3][1] -= cam->shifty; - } else { + } + else { offsetmat[3][0] -= cam->shiftx; offsetmat[3][1] -=(cam->shifty * aspx/aspy); } diff --git a/source/blender/nodes/composite/nodes/node_composite_rotate.c b/source/blender/nodes/composite/nodes/node_composite_rotate.c index 826653c6cff..141fcef457f 100644 --- a/source/blender/nodes/composite/nodes/node_composite_rotate.c +++ b/source/blender/nodes/composite/nodes/node_composite_rotate.c @@ -90,7 +90,7 @@ static void node_composit_exec_rotate(void *UNUSED(data), bNode *node, bNodeStac switch(node->custom1) { case 0: neareast_interpolation(ibuf, obuf, u, v, xo, yo); - break ; + break; case 1: bilinear_interpolation(ibuf, obuf, u, v, xo, yo); break; diff --git a/source/blender/nodes/composite/nodes/node_composite_transform.c b/source/blender/nodes/composite/nodes/node_composite_transform.c index 7e096bf0545..a016f3d1d96 100644 --- a/source/blender/nodes/composite/nodes/node_composite_transform.c +++ b/source/blender/nodes/composite/nodes/node_composite_transform.c @@ -92,7 +92,7 @@ CompBuf* node_composit_transform(CompBuf *cbuf, float x, float y, float angle, f switch(filter_type) { case 0: neareast_interpolation(ibuf, obuf, vec[0], vec[1], i, j); - break ; + break; case 1: bilinear_interpolation(ibuf, obuf, vec[0], vec[1], i, j); break; diff --git a/source/blender/nodes/shader/nodes/node_shader_squeeze.c b/source/blender/nodes/shader/nodes/node_shader_squeeze.c index ded930659e5..64838512eab 100644 --- a/source/blender/nodes/shader/nodes/node_shader_squeeze.c +++ b/source/blender/nodes/shader/nodes/node_shader_squeeze.c @@ -54,7 +54,7 @@ bNodeStack **out) nodestack_get_vec(vec+1, SOCK_FLOAT, in[1]); nodestack_get_vec(vec+2, SOCK_FLOAT, in[2]); - out[0]->vec[0] = 1.0f / (1.0f + pow(2.71828183,-((vec[0]-vec[2])*vec[1]))) ; + out[0]->vec[0] = 1.0f / (1.0f + pow(2.71828183, -((vec[0] - vec[2]) * vec[1]))); } static int gpu_shader_squeeze(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index babd4c91165..2072070102a 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -912,7 +912,7 @@ static PyObject *pyrna_prop_str(BPy_PropertyRNA *self) int len = -1; char *c = type_fmt; - while ((*c++= tolower(*type_id++))) {} ; + while ((*c++= tolower(*type_id++))) {} if (type == PROP_COLLECTION) { len = pyrna_prop_collection_length(self); diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index 251d37e920e..6a4413fdc8d 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -675,7 +675,7 @@ static void check_renderbutton_framerate(RenderData *rd, ReportList *reports) else { if (rd->frs_sec_base > 0) qtdata->gTemporalSettings.frameRate = - ((float)(rd->frs_sec << 16) / rd->frs_sec_base) ; + ((float)(rd->frs_sec << 16) / rd->frs_sec_base); } err = SCSetInfo(qtdata->theComponent, scTemporalSettingsType, &qtdata->gTemporalSettings); diff --git a/source/blender/quicktime/quicktime_export.h b/source/blender/quicktime/quicktime_export.h index deaacb0ce39..ed896357c90 100644 --- a/source/blender/quicktime/quicktime_export.h +++ b/source/blender/quicktime/quicktime_export.h @@ -47,7 +47,7 @@ typedef struct QuicktimeCodecTypeDesc { int codecType; int rnatmpvalue; char * codecName; -} QuicktimeCodecTypeDesc ; +} QuicktimeCodecTypeDesc; // quicktime movie output functions struct ImageFormatData; diff --git a/source/blender/render/intern/raytrace/rayobject_octree.cpp b/source/blender/render/intern/raytrace/rayobject_octree.cpp index 20121b0e51e..648cb940af4 100644 --- a/source/blender/render/intern/raytrace/rayobject_octree.cpp +++ b/source/blender/render/intern/raytrace/rayobject_octree.cpp @@ -515,15 +515,15 @@ static void octree_fill_rayface(Octree *oc, RayFace *face) copy_v3_v3(co4, face->v4); for(c=0;c<3;c++) { - rtf[0][c]= (co1[c]-oc->min[c])*ocfac[c] ; - rts[0][c]= (short)rtf[0][c]; - rtf[1][c]= (co2[c]-oc->min[c])*ocfac[c] ; - rts[1][c]= (short)rtf[1][c]; - rtf[2][c]= (co3[c]-oc->min[c])*ocfac[c] ; - rts[2][c]= (short)rtf[2][c]; + rtf[0][c] = (co1[c] - oc->min[c]) * ocfac[c]; + rts[0][c] = (short)rtf[0][c]; + rtf[1][c] = (co2[c] - oc->min[c]) * ocfac[c]; + rts[1][c] = (short)rtf[1][c]; + rtf[2][c] = (co3[c] - oc->min[c]) * ocfac[c]; + rts[2][c] = (short)rtf[2][c]; if(RE_rayface_isQuad(face)) { - rtf[3][c]= (co4[c]-oc->min[c])*ocfac[c] ; - rts[3][c]= (short)rtf[3][c]; + rtf[3][c] = (co4[c] - oc->min[c]) * ocfac[c]; + rts[3][c] = (short)rtf[3][c]; } } diff --git a/source/blender/render/intern/raytrace/reorganize.h b/source/blender/render/intern/raytrace/reorganize.h index 5de88a919ec..6efe37b81a3 100644 --- a/source/blender/render/intern/raytrace/reorganize.h +++ b/source/blender/render/intern/raytrace/reorganize.h @@ -175,8 +175,8 @@ void pushup(Node *parent) Node **prev = &parent->child; for(Node *child = parent->child; RE_rayobject_isAligned(child) && child; ) { - float c_area = bb_area(child->bb, child->bb+3) ; - int nchilds = count_childs(child); + const float c_area = bb_area(child->bb, child->bb + 3); + const int nchilds = count_childs(child); float original_cost = ((p_area != 0.0f)? (c_area / p_area)*nchilds: 1.0f) + 1; float flatten_cost = nchilds; if(flatten_cost < original_cost && nchilds >= 2) diff --git a/source/blender/render/intern/source/gammaCorrectionTables.c b/source/blender/render/intern/source/gammaCorrectionTables.c index 68c4903704a..c0e69323745 100644 --- a/source/blender/render/intern/source/gammaCorrectionTables.c +++ b/source/blender/render/intern/source/gammaCorrectionTables.c @@ -131,9 +131,9 @@ void makeGammaTables(float gamma) /* multiplication factors used in scaling the interpolation. */ for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++ ) { gamfactor_table[i] = inv_color_step - * (gamma_range_table[i + 1] - gamma_range_table[i]) ; + * (gamma_range_table[i + 1] - gamma_range_table[i]); inv_gamfactor_table[i] = inv_color_step - * (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]) ; + * (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]); } } /* end of void makeGammaTables(float gamma) */ diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 88d86d5bd43..0cd5c361499 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -978,8 +978,7 @@ static float readdeepvisibility(DeepSample *dsample, int tot, int z, int bias, f /* tricky stuff here; we use ints which can overflow easily with bias values */ ds= dsample; - for(a=0; a ds->z); a++, ds++) - ; + for (a=0; a ds->z); a++, ds++) {} if(a == tot) { if(biast) diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index e0b5da817cb..052f9769b4e 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -185,7 +185,7 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) } /* MIST */ - if((shi->passflag & SCE_PASS_MIST) || ((R.wrld.mode & WO_MIST) && (shi->mat->mode & MA_NOMIST)==0)) { + if((shi->passflag & SCE_PASS_MIST) || ((R.wrld.mode & WO_MIST) && (shi->mat->mode & MA_NOMIST)==0)) { if(R.r.mode & R_ORTHO) shr->mist= mistfactor(-shi->co[2], shi->co); else @@ -447,7 +447,7 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert } } - if((texco & TEXCO_UV) || (mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE))) { + if((texco & TEXCO_UV) || (mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE))) { MCol *mcol; float *uv; char *name; @@ -1076,7 +1076,7 @@ void shade_input_set_shade_texco(ShadeInput *shi) } } - if((texco & TEXCO_UV) || (mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE))) { + if((texco & TEXCO_UV) || (mode & (MA_VERTEXCOL|MA_VERTEXCOLP|MA_FACETEXTURE))) { VlakRen *vlr= shi->vlr; MTFace *tface; MCol *mcol; diff --git a/source/blender/render/intern/source/sunsky.c b/source/blender/render/intern/source/sunsky.c index e824b81096b..71ca2e056ac 100644 --- a/source/blender/render/intern/source/sunsky.c +++ b/source/blender/render/intern/source/sunsky.c @@ -315,9 +315,9 @@ void GetSkyXYZRadiancef(struct SunSky* sunsky, const float varg[3], float color_ * */ static void ComputeAttenuatedSunlight(float theta, int turbidity, float fTau[3]) { - float fBeta ; + float fBeta; float fTauR, fTauA; - float m ; + float m; float fAlpha; int i; diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 599de5697f1..6842b6be497 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -478,7 +478,7 @@ void WM_window_open_temp(bContext *C, rcti *position, int type) win->sizey= position->ymax - position->ymin; if(win->ghostwin) { - wm_window_set_size(win, win->sizex, win->sizey) ; + wm_window_set_size(win, win->sizex, win->sizey); wm_window_raise(win); } diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 3766c2a12c3..0e13778f02c 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -501,7 +501,7 @@ void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTa float BPY_driver_exec(struct ChannelDriver *driver, const float evaltime) {return 0.0f;} /* might need this one! */ void BPY_DECREF(void *pyob_ptr) {} void BPY_pyconstraint_exec(struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets) {} -void macro_wrapper(struct wmOperatorType *ot, void *userdata) {} ; +void macro_wrapper(struct wmOperatorType *ot, void *userdata) {} /* intern/dualcon */ struct DualConMesh; diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index 184cc45f103..0da5301ed5d 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -106,11 +106,11 @@ public: int GetWidth( - ) const ; + ) const; int GetHeight( - ) const ; + ) const; int GetMouseX(int x diff --git a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp index 718db0bf0e3..5cd2038163c 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp @@ -98,7 +98,7 @@ void KX_BlenderMouseDevice::NextFrame() if (oldevent.m_status == SCA_InputEvent::KX_JUSTRELEASED) { - m_eventStatusTables[m_currentTable][mousemove].m_status = SCA_InputEvent::KX_NO_INPUTSTATUS ; + m_eventStatusTables[m_currentTable][mousemove].m_status = SCA_InputEvent::KX_NO_INPUTSTATUS; } } } diff --git a/source/gameengine/Expressions/Operator2Expr.cpp b/source/gameengine/Expressions/Operator2Expr.cpp index f11d0670d15..e34e40d55eb 100644 --- a/source/gameengine/Expressions/Operator2Expr.cpp +++ b/source/gameengine/Expressions/Operator2Expr.cpp @@ -127,14 +127,14 @@ bool COperator2Expr::IsInside(float x, float y, float z,bool bBorderInclude) bool second;//first ;//,second; - //first = m_lhs->IsInside(x,y,z) ; - second = m_rhs->IsInside(x,y,z,bBorderInclude) ; + //first = m_lhs->IsInside(x,y,z); + second = m_rhs->IsInside(x,y,z,bBorderInclude); if (second) return true; //early out - // second = m_rhs->IsInside(x,y,z) ; + // second = m_rhs->IsInside(x,y,z); - return m_lhs->IsInside(x,y,z,bBorderInclude) ; + return m_lhs->IsInside(x,y,z,bBorderInclude); break; } @@ -144,7 +144,7 @@ bool COperator2Expr::IsInside(float x, float y, float z,bool bBorderInclude) // todo: same as with add_operator: calc smallest leaf first bool second;//first ;//,second; - //first = m_lhs->IsInside(x,y,z) ; + //first = m_lhs->IsInside(x,y,z); second = m_rhs->IsInside(x,y,z,bBorderInclude); if (second) return false; @@ -170,7 +170,7 @@ bool COperator2Expr::IsInside(float x, float y, float z,bool bBorderInclude) bool COperator2Expr::IsRightInside(float x, float y, float z,bool bBorderInclude) { - return m_rhs->IsInside(x,y,z,bBorderInclude) ; + return m_rhs->IsInside(x,y,z,bBorderInclude); } bool COperator2Expr::IsLeftInside(float x, float y, float z,bool bBorderInclude) diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.cpp b/source/gameengine/GamePlayer/common/GPC_Engine.cpp index 6548310b99c..171ea266f49 100644 --- a/source/gameengine/GamePlayer/common/GPC_Engine.cpp +++ b/source/gameengine/GamePlayer/common/GPC_Engine.cpp @@ -239,7 +239,7 @@ float GPC_Engine::DetermineProgress(void) progress = 0.f; } progress *= 100.f; - return (unsigned int) progress ; + return (unsigned int) progress; #endif return m_previousProgress + 0.01; // temporary TODO } diff --git a/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.cpp b/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.cpp index fc436abf6e0..ecb58eda78e 100644 --- a/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.cpp +++ b/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.cpp @@ -53,7 +53,7 @@ void GPC_KeyboardDevice::NextFrame() { m_eventStatusTables[m_currentTable][keyevent] = oldevent; m_eventStatusTables[m_currentTable][keyevent].m_status = SCA_InputEvent::KX_ACTIVE; - //m_eventStatusTables[m_currentTable][keyevent].m_status = SCA_InputEvent::KX_JUSTACTIVATED ; + //m_eventStatusTables[m_currentTable][keyevent].m_status = SCA_InputEvent::KX_JUSTACTIVATED; } } } diff --git a/source/gameengine/GamePlayer/common/GPC_MouseDevice.cpp b/source/gameengine/GamePlayer/common/GPC_MouseDevice.cpp index 6146be1d333..a38bba7788b 100644 --- a/source/gameengine/GamePlayer/common/GPC_MouseDevice.cpp +++ b/source/gameengine/GamePlayer/common/GPC_MouseDevice.cpp @@ -81,7 +81,7 @@ void GPC_MouseDevice::NextFrame() } else { if (oldevent.m_status == SCA_InputEvent::KX_JUSTRELEASED) { - m_eventStatusTables[m_currentTable][mousemove].m_status = SCA_InputEvent::KX_NO_INPUTSTATUS ; + m_eventStatusTables[m_currentTable][mousemove].m_status = SCA_InputEvent::KX_NO_INPUTSTATUS; } } } diff --git a/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp b/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp index 1d67ce080cc..b31803b761e 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp @@ -35,71 +35,71 @@ GPG_KeyboardDevice::GPG_KeyboardDevice(void) { - m_reverseKeyTranslateTable[GHOST_kKeyA ] = KX_AKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyB ] = KX_BKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyC ] = KX_CKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyD ] = KX_DKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyE ] = KX_EKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyF ] = KX_FKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyG ] = KX_GKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyH ] = KX_HKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyI ] = KX_IKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyJ ] = KX_JKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyK ] = KX_KKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyL ] = KX_LKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyM ] = KX_MKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyN ] = KX_NKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyO ] = KX_OKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyP ] = KX_PKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyQ ] = KX_QKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyR ] = KX_RKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyS ] = KX_SKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyT ] = KX_TKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyU ] = KX_UKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyV ] = KX_VKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyW ] = KX_WKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyX ] = KX_XKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyY ] = KX_YKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyZ ] = KX_ZKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyA ] = KX_AKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyB ] = KX_BKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyC ] = KX_CKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyD ] = KX_DKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyE ] = KX_EKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF ] = KX_FKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyG ] = KX_GKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyH ] = KX_HKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyI ] = KX_IKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyJ ] = KX_JKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyK ] = KX_KKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyL ] = KX_LKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyM ] = KX_MKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyN ] = KX_NKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyO ] = KX_OKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyP ] = KX_PKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyQ ] = KX_QKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyR ] = KX_RKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyS ] = KX_SKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyT ] = KX_TKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyU ] = KX_UKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyV ] = KX_VKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyW ] = KX_WKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyX ] = KX_XKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyY ] = KX_YKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyZ ] = KX_ZKEY ; - m_reverseKeyTranslateTable[GHOST_kKey0 ] = KX_ZEROKEY ; - m_reverseKeyTranslateTable[GHOST_kKey1 ] = KX_ONEKEY ; - m_reverseKeyTranslateTable[GHOST_kKey2 ] = KX_TWOKEY ; - m_reverseKeyTranslateTable[GHOST_kKey3 ] = KX_THREEKEY ; - m_reverseKeyTranslateTable[GHOST_kKey4 ] = KX_FOURKEY ; - m_reverseKeyTranslateTable[GHOST_kKey5 ] = KX_FIVEKEY ; - m_reverseKeyTranslateTable[GHOST_kKey6 ] = KX_SIXKEY ; - m_reverseKeyTranslateTable[GHOST_kKey7 ] = KX_SEVENKEY ; - m_reverseKeyTranslateTable[GHOST_kKey8 ] = KX_EIGHTKEY ; + m_reverseKeyTranslateTable[GHOST_kKey0 ] = KX_ZEROKEY ; + m_reverseKeyTranslateTable[GHOST_kKey1 ] = KX_ONEKEY ; + m_reverseKeyTranslateTable[GHOST_kKey2 ] = KX_TWOKEY ; + m_reverseKeyTranslateTable[GHOST_kKey3 ] = KX_THREEKEY ; + m_reverseKeyTranslateTable[GHOST_kKey4 ] = KX_FOURKEY ; + m_reverseKeyTranslateTable[GHOST_kKey5 ] = KX_FIVEKEY ; + m_reverseKeyTranslateTable[GHOST_kKey6 ] = KX_SIXKEY ; + m_reverseKeyTranslateTable[GHOST_kKey7 ] = KX_SEVENKEY ; + m_reverseKeyTranslateTable[GHOST_kKey8 ] = KX_EIGHTKEY ; m_reverseKeyTranslateTable[GHOST_kKey9 ] = KX_NINEKEY ; // Middle keyboard area keys - m_reverseKeyTranslateTable[GHOST_kKeyPause ] = KX_PAUSEKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyInsert ] = KX_INSERTKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyDelete ] = KX_DELKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyHome ] = KX_HOMEKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyEnd ] = KX_ENDKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyUpPage ] = KX_PAGEUPKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyDownPage ] = KX_PAGEDOWNKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyPause ] = KX_PAUSEKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyInsert ] = KX_INSERTKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyDelete ] = KX_DELKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyHome ] = KX_HOMEKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyEnd ] = KX_ENDKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyUpPage ] = KX_PAGEUPKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyDownPage ] = KX_PAGEDOWNKEY ; // Arrow keys - m_reverseKeyTranslateTable[GHOST_kKeyUpArrow ] = KX_UPARROWKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyDownArrow ] = KX_DOWNARROWKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyLeftArrow ] = KX_LEFTARROWKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyRightArrow ] = KX_RIGHTARROWKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyUpArrow ] = KX_UPARROWKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyDownArrow ] = KX_DOWNARROWKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyLeftArrow ] = KX_LEFTARROWKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyRightArrow ] = KX_RIGHTARROWKEY ; // Function keys - m_reverseKeyTranslateTable[GHOST_kKeyF1 ] = KX_F1KEY ; - m_reverseKeyTranslateTable[GHOST_kKeyF2 ] = KX_F2KEY ; - m_reverseKeyTranslateTable[GHOST_kKeyF3 ] = KX_F3KEY ; - m_reverseKeyTranslateTable[GHOST_kKeyF4 ] = KX_F4KEY ; - m_reverseKeyTranslateTable[GHOST_kKeyF5 ] = KX_F5KEY ; - m_reverseKeyTranslateTable[GHOST_kKeyF6 ] = KX_F6KEY ; - m_reverseKeyTranslateTable[GHOST_kKeyF7 ] = KX_F7KEY ; - m_reverseKeyTranslateTable[GHOST_kKeyF8 ] = KX_F8KEY ; - m_reverseKeyTranslateTable[GHOST_kKeyF9 ] = KX_F9KEY ; - m_reverseKeyTranslateTable[GHOST_kKeyF10 ] = KX_F10KEY ; - m_reverseKeyTranslateTable[GHOST_kKeyF11 ] = KX_F11KEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF1 ] = KX_F1KEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF2 ] = KX_F2KEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF3 ] = KX_F3KEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF4 ] = KX_F4KEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF5 ] = KX_F5KEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF6 ] = KX_F6KEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF7 ] = KX_F7KEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF8 ] = KX_F8KEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF9 ] = KX_F9KEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF10 ] = KX_F10KEY ; + m_reverseKeyTranslateTable[GHOST_kKeyF11 ] = KX_F11KEY ; m_reverseKeyTranslateTable[GHOST_kKeyF12 ] = KX_F12KEY ; m_reverseKeyTranslateTable[GHOST_kKeyF13 ] = KX_F13KEY ; m_reverseKeyTranslateTable[GHOST_kKeyF14 ] = KX_F14KEY ; @@ -111,49 +111,49 @@ GPG_KeyboardDevice::GPG_KeyboardDevice(void) // Numpad keys - m_reverseKeyTranslateTable[GHOST_kKeyNumpad0 ] = KX_PAD0 ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpad1 ] = KX_PAD1 ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpad2 ] = KX_PAD2 ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpad3 ] = KX_PAD3 ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpad4 ] = KX_PAD4 ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpad5 ] = KX_PAD5 ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpad6 ] = KX_PAD6 ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpad7 ] = KX_PAD7 ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpad8 ] = KX_PAD8 ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpad9 ] = KX_PAD9 ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpadAsterisk ] = KX_PADASTERKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpadPlus ] = KX_PADPLUSKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpadPeriod ] = KX_PADPERIOD ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpadMinus ] = KX_PADMINUS ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpadSlash ] = KX_PADSLASHKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyNumpadEnter ] = KX_PADENTER ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpad0 ] = KX_PAD0 ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpad1 ] = KX_PAD1 ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpad2 ] = KX_PAD2 ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpad3 ] = KX_PAD3 ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpad4 ] = KX_PAD4 ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpad5 ] = KX_PAD5 ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpad6 ] = KX_PAD6 ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpad7 ] = KX_PAD7 ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpad8 ] = KX_PAD8 ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpad9 ] = KX_PAD9 ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpadAsterisk ] = KX_PADASTERKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpadPlus ] = KX_PADPLUSKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpadPeriod ] = KX_PADPERIOD ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpadMinus ] = KX_PADMINUS ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpadSlash ] = KX_PADSLASHKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyNumpadEnter ] = KX_PADENTER ; // Other keys - m_reverseKeyTranslateTable[GHOST_kKeyCapsLock ] = KX_CAPSLOCKKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyEsc ] = KX_ESCKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyTab ] = KX_TABKEY ; - m_reverseKeyTranslateTable[GHOST_kKeySpace ] = KX_SPACEKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyEnter ] = KX_RETKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyBackSpace ] = KX_BACKSPACEKEY ; - m_reverseKeyTranslateTable[GHOST_kKeySemicolon ] = KX_SEMICOLONKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyPeriod ] = KX_PERIODKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyComma ] = KX_COMMAKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyQuote ] = KX_QUOTEKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyAccentGrave ] = KX_ACCENTGRAVEKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyMinus ] = KX_MINUSKEY ; - m_reverseKeyTranslateTable[GHOST_kKeySlash ] = KX_SLASHKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyBackslash ] = KX_BACKSLASHKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyEqual ] = KX_EQUALKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyLeftBracket ] = KX_LEFTBRACKETKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyRightBracket ] = KX_RIGHTBRACKETKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyCapsLock ] = KX_CAPSLOCKKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyEsc ] = KX_ESCKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyTab ] = KX_TABKEY ; + m_reverseKeyTranslateTable[GHOST_kKeySpace ] = KX_SPACEKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyEnter ] = KX_RETKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyBackSpace ] = KX_BACKSPACEKEY ; + m_reverseKeyTranslateTable[GHOST_kKeySemicolon ] = KX_SEMICOLONKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyPeriod ] = KX_PERIODKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyComma ] = KX_COMMAKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyQuote ] = KX_QUOTEKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyAccentGrave ] = KX_ACCENTGRAVEKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyMinus ] = KX_MINUSKEY ; + m_reverseKeyTranslateTable[GHOST_kKeySlash ] = KX_SLASHKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyBackslash ] = KX_BACKSLASHKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyEqual ] = KX_EQUALKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyLeftBracket ] = KX_LEFTBRACKETKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyRightBracket ] = KX_RIGHTBRACKETKEY ; // Modifier keys. - m_reverseKeyTranslateTable[GHOST_kKeyLeftControl ] = KX_LEFTCTRLKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyRightControl ] = KX_RIGHTCTRLKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyLeftAlt ] = KX_LEFTALTKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyRightAlt ] = KX_RIGHTALTKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyLeftShift ] = KX_LEFTSHIFTKEY ; - m_reverseKeyTranslateTable[GHOST_kKeyRightShift ] = KX_RIGHTSHIFTKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyLeftControl ] = KX_LEFTCTRLKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyRightControl ] = KX_RIGHTCTRLKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyLeftAlt ] = KX_LEFTALTKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyRightAlt ] = KX_RIGHTALTKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyLeftShift ] = KX_LEFTSHIFTKEY ; + m_reverseKeyTranslateTable[GHOST_kKeyRightShift ] = KX_RIGHTSHIFTKEY ; } diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 2f5fe112de6..082d363fed6 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -145,7 +145,7 @@ protected: public: - enum { INSIDE, INTERSECT, OUTSIDE } ; + enum { INSIDE, INTERSECT, OUTSIDE }; KX_Camera(void* sgReplicationInfo,SG_Callbacks callbacks,const RAS_CameraData& camdata, bool frustum_culling = true, bool delete_node = false); virtual ~KX_Camera(); diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index f21a7f815e5..ac83200cb2e 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -353,7 +353,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, ////////// //do Fh, do Rot Fh ci.m_do_fh = shapeprops->m_do_fh; - ci.m_do_rot_fh = shapeprops->m_do_rot_fh ; + ci.m_do_rot_fh = shapeprops->m_do_rot_fh; ci.m_fh_damping = smmaterial->m_fh_damping; ci.m_fh_distance = smmaterial->m_fh_distance; ci.m_fh_normal = smmaterial->m_fh_normal; diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index 4f959d9d2f9..6bd30685696 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -1415,13 +1415,13 @@ void KX_Dome::SplitFace(vector & face, int *nfaces) face[n2+2].v[1] = (face[i].v[1] + face[i].v[2]) /2; face[n2+2].v[2] = (face[i].v[2] + face[i].v[0]) /2; - //face[i].verts[0] = face[i].verts[0] ; + //face[i].verts[0] = face[i].verts[0]; face[i].verts[1] = (face[i].verts[0] + face[i].verts[1]) /2; face[i].verts[2] = (face[i].verts[0] + face[i].verts[2]) /2; //face[i].u[0] = face[i].u[0]; face[i].u[1] = (face[i].u[0] + face[i].u[1]) /2; face[i].u[2] = (face[i].u[0] + face[i].u[2]) /2; - //face[i].v[0] = face[i].v[0] ; + //face[i].v[0] = face[i].v[0]; face[i].v[1] = (face[i].v[0] + face[i].v[1]) /2; face[i].v[2] = (face[i].v[0] + face[i].v[2]) /2; @@ -1812,13 +1812,13 @@ void KX_Dome::DrawDomeFisheye(void) else if(m_mode == DOME_TRUNCATED_FRONT) { ortho_width = 1.0; - ortho_height = 2 * ((float)can_height/can_width) - 1.0 ; + ortho_height = 2 * ((float)can_height / can_width) - 1.0; glOrtho((-ortho_width), ortho_width, (-ortho_height), ortho_width, -20.0, 10.0); } else { //m_mode == DOME_TRUNCATED_REAR ortho_width = 1.0; - ortho_height = 2 * ((float)can_height/can_width) - 1.0 ; + ortho_height = 2 * ((float)can_height / can_width) - 1.0; glOrtho((-ortho_width), ortho_width, (-ortho_width), ortho_height, -20.0, 10.0); } diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 895140528e8..ea721d19179 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -431,7 +431,7 @@ public: * @return a pointer to the physics controller owned by this class. */ - KX_IPhysicsController* GetPhysicsController() ; + KX_IPhysicsController* GetPhysicsController(); void SetPhysicsController(KX_IPhysicsController* physicscontroller,bool isDynamic) { diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h index dfaf1eba009..58b5c87e494 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.h +++ b/source/gameengine/Ketsji/KX_MeshProxy.h @@ -51,7 +51,7 @@ public: void SetMeshModified(bool v); // stuff for cvalue related things - virtual CValue* Calc(VALUE_OPERATOR op, CValue *val) ; + virtual CValue* Calc(VALUE_OPERATOR op, CValue *val); virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); virtual const STR_String & GetText(); virtual double GetNumber(); diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h index 44945e58c2a..83c3bff0ee2 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.h +++ b/source/gameengine/Ketsji/KX_PolyProxy.h @@ -47,7 +47,7 @@ public: virtual ~KX_PolyProxy(); // stuff for cvalue related things - CValue* Calc(VALUE_OPERATOR op, CValue *val) ; + CValue* Calc(VALUE_OPERATOR op, CValue *val); CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); const STR_String & GetText(); double GetNumber(); diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index d9cd1b5ff24..40136f429a2 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -93,7 +93,7 @@ public: CValue* GetReplica( - ) ; + ); virtual void ProcessReplica(); @@ -114,7 +114,7 @@ public: SCA_IObject* GetLastCreatedObject( - ) const ; + ) const; void InstantAddObject(); diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp index 232b907d9a8..bc8c5ec92a8 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp +++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp @@ -338,7 +338,7 @@ static bool barDistSqPointToTri(const float* p, const float* a, const float* b, float ud = u<0.f ? -u : (u>1.f ? u-1.f : 0.f); float vd = v<0.f ? -v : (v>1.f ? v-1.f : 0.f); - return ud*ud+vd*vd ; + return ud * ud + vd * vd; } inline void flipAxes(float* vec) diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index 1ce1742ed46..df96b75084a 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -79,7 +79,7 @@ public: class KX_GameObject* gameobj, bool bFindMaterial, bool bTouchPulse, - const STR_String& touchedpropname) ; + const STR_String& touchedpropname); virtual ~KX_TouchSensor(); virtual CValue* GetReplica(); diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h index baed5330f7e..3084e5fac93 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.h +++ b/source/gameengine/Ketsji/KX_VertexProxy.h @@ -48,7 +48,7 @@ public: virtual ~KX_VertexProxy(); // stuff for cvalue related things - CValue* Calc(VALUE_OPERATOR op, CValue *val) ; + CValue* Calc(VALUE_OPERATOR op, CValue *val); CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); const STR_String & GetText(); double GetNumber(); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 33b30758ff0..b9e78d9ff1f 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -525,7 +525,7 @@ protected: return m_cci.m_collisionFilterMask; } - virtual void calcXform() {} ; + virtual void calcXform() {} virtual void SetMargin(float margin) { if (m_collisionShape) diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 39b2022a1f4..ba9724f34ab 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -122,7 +122,7 @@ public: for (i=0;igetWheelInfo(i); - PHY_IMotionState* motionState = (PHY_IMotionState*)info.m_clientInfo ; + PHY_IMotionState* motionState = (PHY_IMotionState*)info.m_clientInfo; // m_vehicle->updateWheelTransformsWS(info,false); m_vehicle->updateWheelTransform(i,false); btTransform trans = m_vehicle->getWheelInfo(i).m_worldTransform; @@ -873,7 +873,7 @@ void CcdPhysicsEnvironment::setSolverType(int solverType) }; - m_solverType = solverType ; + m_solverType = solverType; } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index 1315bc732a2..dba76c8d5fa 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -106,19 +106,19 @@ protected: m_numTimeSubSteps = numTimeSubSteps; } virtual void setDeactivationTime(float dTime); - virtual void setDeactivationLinearTreshold(float linTresh) ; - virtual void setDeactivationAngularTreshold(float angTresh) ; - virtual void setContactBreakingTreshold(float contactBreakingTreshold) ; + virtual void setDeactivationLinearTreshold(float linTresh); + virtual void setDeactivationAngularTreshold(float angTresh); + virtual void setContactBreakingTreshold(float contactBreakingTreshold); virtual void setCcdMode(int ccdMode); virtual void setSolverType(int solverType); virtual void setSolverSorConstant(float sor); virtual void setSolverTau(float tau); virtual void setSolverDamping(float damping); virtual void setLinearAirDamping(float damping); - virtual void setUseEpa(bool epa) ; + virtual void setUseEpa(bool epa); virtual void beginFrame(); - virtual void endFrame() {}; + virtual void endFrame() {} /// Perform an integration step of duration 'timeStep'. virtual bool proceedDeltaTime(double curTime,float timeStep,float interval); diff --git a/source/gameengine/Rasterizer/RAS_TexVert.cpp b/source/gameengine/Rasterizer/RAS_TexVert.cpp index 1e8630c72d8..454fd8ecc69 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.cpp +++ b/source/gameengine/Rasterizer/RAS_TexVert.cpp @@ -129,7 +129,7 @@ bool RAS_TexVert::closeTo(const RAS_TexVert* other) MT_fuzzyEqual(MT_Vector3(m_tangent), MT_Vector3(other->m_tangent)) && MT_fuzzyEqual(MT_Vector2(m_uv1), MT_Vector2(other->m_uv1)) && MT_fuzzyEqual(MT_Vector2(m_uv2), MT_Vector2(other->m_uv2)) /* && - MT_fuzzyEqual(MT_Vector3(m_localxyz), MT_Vector3(other->m_localxyz))*/) ; + MT_fuzzyEqual(MT_Vector3(m_localxyz), MT_Vector3(other->m_localxyz))*/); /* dont bother comparing m_localxyz since we know there from the same vert */ } -- cgit v1.2.3