diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-22 04:03:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-22 04:03:20 +0400 |
commit | 51016c4dea9904cbaea8b06d692d6f2dd747a6e8 (patch) | |
tree | 02554c55c8f3de7314b967245ea15fb000a75e7c /source | |
parent | 5272d76faa969bc379ca1d1c28601c67fce98b24 (diff) |
split >120 length lines (mostly if statements)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/idprop.c | 6 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 17 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 15 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh.c | 5 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 15 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_edit.c | 13 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_select.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_header.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 6 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 10 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 7 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_IPO_SGController.cpp | 11 |
13 files changed, 91 insertions, 29 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index a44957ddc01..d9fe0138784 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -692,7 +692,11 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n case IDP_ARRAY: { /*for now, we only support float and int and double arrays*/ - if (val->array.type == IDP_FLOAT || val->array.type == IDP_INT || val->array.type == IDP_DOUBLE || val->array.type == IDP_GROUP) { + if ( (val->array.type == IDP_FLOAT) || + (val->array.type == IDP_INT) || + (val->array.type == IDP_DOUBLE) || + (val->array.type == IDP_GROUP) ) + { prop = MEM_callocN(sizeof(IDProperty), "IDProperty array"); prop->subtype = val->array.type; if (val->array.len) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index bf40a3e73b3..2f3d14da4c2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10691,8 +10691,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main) void *olddata = ob->data; ob->data = me; - if(me && me->id.lib==NULL && me->mr && me->mr->level_count > 1) /* XXX - library meshes crash on loading most yoFrankie levels, the multires pointer gets invalid - Campbell */ + /* XXX - library meshes crash on loading most yoFrankie levels, + * the multires pointer gets invalid - Campbell */ + if(me && me->id.lib==NULL && me->mr && me->mr->level_count > 1) { multires_load_old(ob, me); + } ob->data = olddata; } @@ -14271,7 +14274,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) expand_main(fd, mainptr); - /* dang FileData... now new libraries need to be appended to original filedata, it is not a good replacement for the old global (ton) */ + /* dang FileData... now new libraries need to be appended to original filedata, + * it is not a good replacement for the old global (ton) */ while( fd->mainlist.first ) { Main *mp= fd->mainlist.first; BLI_remlink(&fd->mainlist, mp); @@ -14293,8 +14297,13 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) ID *idn= id->next; if(id->flag & LIB_READ) { BLI_remlink(lbarray[a], id); - BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); - if(!G.background && basefd->reports)printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); + BKE_reportf(basefd->reports, RPT_ERROR, + "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", + BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); + if (!G.background && basefd->reports) { + printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", + BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath); + } change_idid_adr(mainlist, basefd, id, NULL); MEM_freeN(id); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 63e41082449..4948073f9c6 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -904,7 +904,9 @@ void uiEndBlock(const bContext *C, uiBlock *block) /* handle pending stuff */ if(block->layouts.first) uiBlockLayoutResolve(block, NULL, NULL); ui_block_do_align(block); - if((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) ui_menu_block_set_keyaccels(block); /* could use a different flag to check */ + if((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) { + ui_menu_block_set_keyaccels(block); /* could use a different flag to check */ + } if(block->flag & UI_BLOCK_LOOP) ui_menu_block_set_keymaps(C, block); /* after keymaps! */ diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 49e3ff10f06..a55c4f2aa0a 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -681,7 +681,7 @@ static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v) static int modifier_can_delete(ModifierData *md) { - // fluid particle modifier can't be deleted here + /* fluid particle modifier can't be deleted here */ if(md->type == eModifierType_ParticleSystem) if(((ParticleSystemModifierData *)md)->psys->part->type == PART_FLUID) return 0; @@ -689,14 +689,16 @@ static int modifier_can_delete(ModifierData *md) return 1; } -// Check wheter Modifier is a simulation or not, this is used for switching to the physics/particles context tab +/* Check wheter Modifier is a simulation or not, this is used for switching to the physics/particles context tab */ static int modifier_is_simulation(ModifierData *md) { - // Physic Tab - if(ELEM7(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke, eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint)) { + /* Physic Tab */ + if (ELEM7(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke, + eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint)) + { return 1; } - // Particle Tab + /* Particle Tab */ else if (md->type == eModifierType_ParticleSystem) { return 2; } @@ -705,7 +707,8 @@ static int modifier_is_simulation(ModifierData *md) } } -static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, ModifierData *md, int index, int cageIndex, int lastCageIndex) +static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, + ModifierData *md, int index, int cageIndex, int lastCageIndex) { ModifierTypeInfo *mti = modifierType_getInfo(md->type); PointerRNA ptr; diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 1477469ca85..f617971967c 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -922,7 +922,10 @@ void make_editMesh(Scene *scene, Object *ob) for(a=0; a<me->totselect; a++, mselect++){ /*check if recorded selection is still valid, if so copy into editmesh*/ - if( (mselect->type == EDITVERT && me->mvert[mselect->index].flag & SELECT) || (mselect->type == EDITEDGE && me->medge[mselect->index].flag & SELECT) || (mselect->type == EDITFACE && me->mface[mselect->index].flag & ME_FACE_SEL) ){ + if ( (mselect->type == EDITVERT && me->mvert[mselect->index].flag & SELECT) || + (mselect->type == EDITEDGE && me->medge[mselect->index].flag & SELECT) || + (mselect->type == EDITFACE && me->mface[mselect->index].flag & ME_FACE_SEL) ) + { ese = MEM_callocN(sizeof(EditSelection), "Edit Selection"); ese->type = mselect->type; if(ese->type == EDITVERT) ese->data = EM_get_vert_for_index(mselect->index); else diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 3aefe5f9ea3..8a4cb8aa78b 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -1816,7 +1816,9 @@ static int project_bucket_isect_circle(const float cent[2], const float radius_s return 1; */ - if((bucket_bounds->xmin <= cent[0] && bucket_bounds->xmax >= cent[0]) || (bucket_bounds->ymin <= cent[1] && bucket_bounds->ymax >= cent[1]) ) { + if ( (bucket_bounds->xmin <= cent[0] && bucket_bounds->xmax >= cent[0]) || + (bucket_bounds->ymin <= cent[1] && bucket_bounds->ymax >= cent[1]) ) + { return 1; } @@ -2816,7 +2818,11 @@ static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucke p4[0] = bucket_bounds.xmax; p4[1] = bucket_bounds.ymin; if (mf->v4) { - if( isect_point_quad_v2(p1, v1, v2, v3, v4) || isect_point_quad_v2(p2, v1, v2, v3, v4) || isect_point_quad_v2(p3, v1, v2, v3, v4) || isect_point_quad_v2(p4, v1, v2, v3, v4) || + if ( isect_point_quad_v2(p1, v1, v2, v3, v4) || + isect_point_quad_v2(p2, v1, v2, v3, v4) || + isect_point_quad_v2(p3, v1, v2, v3, v4) || + isect_point_quad_v2(p4, v1, v2, v3, v4) || + /* we can avoid testing v3,v1 because another intersection MUST exist if this intersects */ (isect_line_line_v2(p1, p2, v1, v2) || isect_line_line_v2(p1, p2, v2, v3) || isect_line_line_v2(p1, p2, v3, v4)) || (isect_line_line_v2(p2, p3, v1, v2) || isect_line_line_v2(p2, p3, v2, v3) || isect_line_line_v2(p2, p3, v3, v4)) || @@ -2827,7 +2833,10 @@ static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucke } } else { - if( isect_point_tri_v2(p1, v1, v2, v3) || isect_point_tri_v2(p2, v1, v2, v3) || isect_point_tri_v2(p3, v1, v2, v3) || isect_point_tri_v2(p4, v1, v2, v3) || + if ( isect_point_tri_v2(p1, v1, v2, v3) || + isect_point_tri_v2(p2, v1, v2, v3) || + isect_point_tri_v2(p3, v1, v2, v3) || + isect_point_tri_v2(p4, v1, v2, v3) || /* we can avoid testing v3,v1 because another intersection MUST exist if this intersects */ (isect_line_line_v2(p1, p2, v1, v2) || isect_line_line_v2(p1, p2, v2, v3)) || (isect_line_line_v2(p2, p3, v1, v2) || isect_line_line_v2(p2, p3, v2, v3)) || diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 30a7abd3c0b..9b1bd1d7b31 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -221,12 +221,17 @@ void OUTLINER_OT_item_openclose(wmOperatorType *ot) static void do_item_rename(ARegion *ar, TreeElement *te, TreeStoreElem *tselem, ReportList *reports) { /* can't rename rna datablocks entries */ - if(ELEM3(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) - ; - else if(ELEM10(tselem->type, TSE_ANIM_DATA, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE, TSE_SCRIPT_BASE, TSE_POSE_BASE, TSE_POSEGRP_BASE, TSE_R_LAYER_BASE, TSE_R_PASS)) + if(ELEM3(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) { + /* do nothing */; + } + else if(ELEM10(tselem->type, TSE_ANIM_DATA, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE, + TSE_SCRIPT_BASE, TSE_POSE_BASE, TSE_POSEGRP_BASE, TSE_R_LAYER_BASE, TSE_R_PASS)) + { BKE_report(reports, RPT_WARNING, "Cannot edit builtin name"); - else if(ELEM3(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) + } + else if(ELEM3(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) { BKE_report(reports, RPT_WARNING, "Cannot edit sequence name"); + } else if(tselem->id->lib) { // XXX error_libdata(); } diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index e728267f45f..bf570c929cc 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -823,8 +823,12 @@ static int outliner_item_activate(bContext *C, wmOperator *op, wmEvent *event) UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], fmval, fmval+1); - if(!ELEM3(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF, SO_KEYMAP) && !(soops->flag & SO_HIDE_RESTRICTCOLS) && fmval[0] > ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX) + if ( !ELEM3(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF, SO_KEYMAP) && + !(soops->flag & SO_HIDE_RESTRICTCOLS) && + (fmval[0] > ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX)) + { return OPERATOR_CANCELLED; + } for(te= soops->tree.first; te; te= te->next) { if(do_outliner_item_activate(C, scene, ar, soops, te, extend, fmval)) break; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 0c9ea3c6a2a..762fc51a34e 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -316,7 +316,10 @@ static char *view3d_modeselect_pup(Scene *scene) str += modeselect_addmode(str, N_("Pose Mode"), OB_MODE_POSE, ICON_POSE_HLT); } - if (ob->particlesystem.first || modifiers_findByType(ob, eModifierType_Cloth) || modifiers_findByType(ob, eModifierType_Softbody)) { + if ( ob->particlesystem.first || + modifiers_findByType(ob, eModifierType_Cloth) || + modifiers_findByType(ob, eModifierType_Softbody)) + { str += modeselect_addmode(str, N_("Particle Mode"), OB_MODE_PARTICLE_EDIT, ICON_PARTICLEMODE); } (void)str; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 4d98afc4c10..65ad45495db 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1727,7 +1727,11 @@ static int game_engine_exec(bContext *C, wmOperator *op) game_set_commmandline_options(&startscene->gm); - if(rv3d->persp==RV3D_CAMOB && startscene->gm.framing.type == SCE_GAMEFRAMING_BARS && startscene->gm.stereoflag != STEREO_DOME) { /* Letterbox */ + if((rv3d->persp == RV3D_CAMOB) && + (startscene->gm.framing.type == SCE_GAMEFRAMING_BARS) && + (startscene->gm.stereoflag != STEREO_DOME)) + { + /* Letterbox */ rctf cam_framef; ED_view3d_calc_camera_border(startscene, ar, CTX_wm_view3d(C), rv3d, &cam_framef, FALSE); cam_frame.xmin = cam_framef.xmin + ar->winrct.xmin; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 53d26f0a655..0f93ff12f95 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -3450,7 +3450,10 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) * then check if we're using auto-handles. * - If so, change them auto-handles to aligned handles so that handles get affected too */ - if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) && ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM) && ELEM(t->mode, TFM_ROTATION, TFM_RESIZE)) { + if ( ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) && + ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM) && + ELEM(t->mode, TFM_ROTATION, TFM_RESIZE)) + { if (hdata && (sel1) && (sel3)) { bezt->h1= HD_ALIGN; bezt->h2= HD_ALIGN; @@ -4146,7 +4149,10 @@ static void createTransSeqData(bContext *C, TransInfo *t) int i; for(i=0; i<3; i++) { seq_user= *((&seq->seq1) + i); - if (seq_user && (seq_user->flag & SELECT) && !(seq_user->flag & SEQ_LOCK) && !(seq_user->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL))) { + if ( seq_user && (seq_user->flag & SELECT) && + !(seq_user->flag & SEQ_LOCK) && + !(seq_user->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL))) + { seq->flag |= SELECT; } } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 4635411dcdf..46792457f63 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1622,7 +1622,12 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, c } for ( base = FIRSTBASE; base != NULL; base = base->next ) { - if ( BASE_VISIBLE(v3d, base) && (base->flag & (BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA)) == 0 && ((mode == SNAP_NOT_SELECTED && (base->flag & (SELECT|BA_WAS_SEL)) == 0) || (ELEM(mode, SNAP_ALL, SNAP_NOT_OBEDIT) && base != BASACT)) ) { + if ( (BASE_VISIBLE(v3d, base)) && + (base->flag & (BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA)) == 0 && + + ( (mode == SNAP_NOT_SELECTED && (base->flag & (SELECT|BA_WAS_SEL)) == 0) || + (ELEM(mode, SNAP_ALL, SNAP_NOT_OBEDIT) && base != BASACT)) ) + { Object *ob = base->object; if (ob->transflag & OB_DUPLI) diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.cpp b/source/gameengine/Ketsji/KX_IPO_SGController.cpp index 70bb2dbb5a2..728d0fb8561 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.cpp +++ b/source/gameengine/Ketsji/KX_IPO_SGController.cpp @@ -145,7 +145,8 @@ bool KX_IpoSGController::Update(double currentTime) } //modifies position? - if (m_ipo_channels_active[OB_LOC_X] || m_ipo_channels_active[OB_LOC_Y] || m_ipo_channels_active[OB_LOC_Z] || m_ipo_channels_active[OB_DLOC_X] || m_ipo_channels_active[OB_DLOC_Y] || m_ipo_channels_active[OB_DLOC_Z]) + if (m_ipo_channels_active[OB_LOC_X] || m_ipo_channels_active[OB_LOC_Y] || m_ipo_channels_active[OB_LOC_Z] || + m_ipo_channels_active[OB_DLOC_X] || m_ipo_channels_active[OB_DLOC_Y] || m_ipo_channels_active[OB_DLOC_Z]) { if (m_ipo_as_force == true) { @@ -198,7 +199,9 @@ bool KX_IpoSGController::Update(double currentTime) } } //modifies orientation? - if (m_ipo_channels_active[OB_ROT_X] || m_ipo_channels_active[OB_ROT_Y] || m_ipo_channels_active[OB_ROT_Z] || m_ipo_channels_active[OB_DROT_X] || m_ipo_channels_active[OB_DROT_Y] || m_ipo_channels_active[OB_DROT_Z]) { + if (m_ipo_channels_active[OB_ROT_X] || m_ipo_channels_active[OB_ROT_Y] || m_ipo_channels_active[OB_ROT_Z] || + m_ipo_channels_active[OB_DROT_X] || m_ipo_channels_active[OB_DROT_Y] || m_ipo_channels_active[OB_DROT_Z]) + { if (m_ipo_as_force) { if (m_game_object && ob) { @@ -293,7 +296,9 @@ bool KX_IpoSGController::Update(double currentTime) } } //modifies scale? - if (m_ipo_channels_active[OB_SIZE_X] || m_ipo_channels_active[OB_SIZE_Y] || m_ipo_channels_active[OB_SIZE_Z] || m_ipo_channels_active[OB_DSIZE_X] || m_ipo_channels_active[OB_DSIZE_Y] || m_ipo_channels_active[OB_DSIZE_Z]) { + if (m_ipo_channels_active[OB_SIZE_X] || m_ipo_channels_active[OB_SIZE_Y] || m_ipo_channels_active[OB_SIZE_Z] || + m_ipo_channels_active[OB_DSIZE_X] || m_ipo_channels_active[OB_DSIZE_Y] || m_ipo_channels_active[OB_DSIZE_Z]) + { //default is no scale change MT_Vector3 newScale(1.0,1.0,1.0); if (!m_ipo_add) |