diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-30 06:51:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-30 06:56:20 +0300 |
commit | 28316493bd82f5e5d2be40effdad4431f9c49c6e (patch) | |
tree | 6e3ce9b8b799344ec168a3fb423a4ad0cdafe8a6 /source/blender/blenloader/intern/versioning_legacy.c | |
parent | 1119f1eb3b5f5e509238eb376102079a9fd150c4 (diff) |
Cleanup: style
Diffstat (limited to 'source/blender/blenloader/intern/versioning_legacy.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_legacy.c | 182 |
1 files changed, 91 insertions, 91 deletions
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 61966ec49b7..e0fb31b223b 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -103,14 +103,14 @@ static void vcol_to_fcol(Mesh *me) { MFace *mface; - unsigned int *mcol, *mcoln, *mcolmain; + uint *mcol, *mcoln, *mcolmain; int a; if (me->totface == 0 || me->mcol == NULL) return; mcoln = mcolmain = MEM_malloc_arrayN(me->totface, 4 * sizeof(int), "mcoln"); - mcol = (unsigned int *)me->mcol; + mcol = (uint *)me->mcol; mface = me->mface; for (a = me->totface; a > 0; a--, mface++) { mcoln[0] = mcol[mface->v1]; @@ -147,11 +147,11 @@ static void bone_version_238(ListBase *lb) for (bone = lb->first; bone; bone = bone->next) { if (bone->rad_tail == 0.0f && bone->rad_head == 0.0f) { - bone->rad_head = 0.25f*bone->length; - bone->rad_tail = 0.1f*bone->length; + bone->rad_head = 0.25f * bone->length; + bone->rad_tail = 0.1f * bone->length; - bone->dist-= bone->rad_head; - if (bone->dist<=0.0f) + bone->dist -= bone->rad_head; + if (bone->dist <= 0.0f) bone->dist = 0.0f; } bone_version_238(&bone->childbase); @@ -236,7 +236,7 @@ static void ntree_version_245(FileData *fd, Library *lib, bNodeTree *ntree) /* fix for temporary flag changes during 245 cycle */ nodeid = blo_do_versions_newlibadr(fd, lib, node->id); if (node->storage && nodeid && GS(nodeid->name) == ID_IM) { - image = (Image*)nodeid; + image = (Image *)nodeid; iuser = node->storage; if (iuser->flag & IMA_OLD_PREMUL) { iuser->flag &= ~IMA_OLD_PREMUL; @@ -378,7 +378,7 @@ static void do_version_ntree_242_2(bNodeTree *ntree) iuser->frames = nia->frames; iuser->sfra = nia->sfra; - iuser->offset = nia->nr-1; + iuser->offset = nia->nr - 1; iuser->cycl = nia->cyclic; iuser->ok = 1; @@ -526,7 +526,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (ob->totcol) { for (a = 0; a < ob->totcol; a++) { if (ob->mat[a]) - ob->colbits |= (1<<a); + ob->colbits |= (1 << a); } } ob = ob->id.next; @@ -586,7 +586,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) SpaceLink *sl = sa->spacedata.first; while (sl) { if (sl->spacetype == SPACE_VIEW3D) { - View3D *v3d = (View3D*) sl; + View3D *v3d = (View3D *)sl; if (v3d->gridlines == 0) v3d->gridlines = 20; @@ -603,8 +603,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Tex *tex = bmain->tex.first; while (tex) { if ((tex->rfac == 0.0f) && - (tex->gfac == 0.0f) && - (tex->bfac == 0.0f)) + (tex->gfac == 0.0f) && + (tex->bfac == 0.0f)) { tex->rfac = 1.0f; tex->gfac = 1.0f; @@ -620,8 +620,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Tex *tex = bmain->tex.first; while (tex) { if ((tex->rfac == 0.0f) && - (tex->gfac == 0.0f) && - (tex->bfac == 0.0f)) + (tex->gfac == 0.0f) && + (tex->bfac == 0.0f)) { tex->rfac = 1.0f; tex->gfac = 1.0f; @@ -702,7 +702,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) SpaceLink *sl = sa->spacedata.first; while (sl) { if (sl->spacetype == SPACE_IPO) { - SpaceIpo *sipo = (SpaceIpo*) sl; + SpaceIpo *sipo = (SpaceIpo *)sl; sipo->v2d.max[0] = 15000.0; } sl = sl->next; @@ -735,7 +735,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) SpaceLink *sl = sa->spacedata.first; while (sl) { if (sl->spacetype == SPACE_TEXT) { - SpaceText *st = (SpaceText*) sl; + SpaceText *st = (SpaceText *)sl; st->lheight = 12; } sl = sl->next; @@ -834,10 +834,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) int i, j; for (i = 0; i < me->totface; i++) { - TFace *tf = &((TFace*) me->tface)[i]; + TFace *tf = &((TFace *)me->tface)[i]; for (j = 0; j < 4; j++) { - char *col = (char *) &tf->col[j]; + char *col = (char *)&tf->col[j]; col[0] = 255; } @@ -888,7 +888,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_IPO) { - SpaceSeq *sseq = (SpaceSeq*) sl; + SpaceSeq *sseq = (SpaceSeq *)sl; sseq->v2d.keeptot = 0; } } @@ -961,11 +961,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_ACTION) { - SpaceAction *sac = (SpaceAction *) sl; + SpaceAction *sac = (SpaceAction *)sl; sac->v2d.max[0] = 32000; } else if (sl->spacetype == SPACE_NLA) { - SpaceNla *sla = (SpaceNla *) sl; + SpaceNla *sla = (SpaceNla *)sl; sla->v2d.max[0] = 32000; } } @@ -1028,7 +1028,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_BUTS) { - SpaceButs *sbuts = (SpaceButs *) sl; + SpaceButs *sbuts = (SpaceButs *)sl; sbuts->v2d.maxzoom = 1.2f; @@ -1118,7 +1118,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) SpaceLink *sl = sa->spacedata.first; while (sl) { if (sl->spacetype == SPACE_VIEW3D) { - View3D *v3d = (View3D*) sl; + View3D *v3d = (View3D *)sl; if (v3d->gridflag == 0) { v3d->gridflag |= V3D_SHOW_X; @@ -1141,7 +1141,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) bScreen *sc; while (tex) { - if ((tex->flag & (TEX_CHECKER_ODD+TEX_CHECKER_EVEN))==0) { + if ((tex->flag & (TEX_CHECKER_ODD + TEX_CHECKER_EVEN)) == 0) { tex->flag |= TEX_CHECKER_ODD; } /* copied from kernel texture.c */ @@ -1181,7 +1181,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (sl = sa->spacedata.first; sl; sl = sl->next) { /* added: 5x better zoom in for nla */ if (sl->spacetype == SPACE_NLA) { - SpaceNla *snla = (SpaceNla *) sl; + SpaceNla *snla = (SpaceNla *)sl; snla->v2d.maxzoom = 50; } } @@ -1206,7 +1206,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) SpaceLink *sl; for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { - View3D *v3d = (View3D *) sl; + View3D *v3d = (View3D *)sl; v3d->flag |= V3D_SELECT_OUTLINE; } } @@ -1223,7 +1223,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) SpaceLink *sl; for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { - View3D *v3d = (View3D *) sl; + View3D *v3d = (View3D *)sl; v3d->flag |= V3D_ZBUF_SELECT; } else if (sl->spacetype == SPACE_TEXT) { @@ -1250,7 +1250,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) while (sce) { ed = sce->ed; if (ed) { - SEQ_BEGIN (sce->ed, seq) + SEQ_BEGIN(sce->ed, seq) { if (seq->type == SEQ_TYPE_IMAGE || seq->type == SEQ_TYPE_MOVIE) seq->alpha_mode = SEQ_ALPHA_STRAIGHT; @@ -1338,8 +1338,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) else if (ob->type == OB_MESH) { Mesh *me = blo_do_versions_newlibadr(fd, lib, ob->data); - if ((me->flag&ME_SUBSURF)) { - SubsurfModifierData *smd = (SubsurfModifierData*) modifier_new(eModifierType_Subsurf); + if ((me->flag & ME_SUBSURF)) { + SubsurfModifierData *smd = (SubsurfModifierData *)modifier_new(eModifierType_Subsurf); smd->levels = MAX2(1, me->subdiv); smd->renderLevels = MAX2(1, me->subdivr); @@ -1355,7 +1355,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) BLI_addtail(&ob->modifiers, smd); - modifier_unique_name(&ob->modifiers, (ModifierData*)smd); + modifier_unique_name(&ob->modifiers, (ModifierData *)smd); } } @@ -1405,9 +1405,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Subsurf) { - SubsurfModifierData *smd = (SubsurfModifierData*) md; + SubsurfModifierData *smd = (SubsurfModifierData *)md; - smd->flags &= ~(eSubsurfModifierFlag_Incremental|eSubsurfModifierFlag_DebugIncr); + smd->flags &= ~(eSubsurfModifierFlag_Incremental | eSubsurfModifierFlag_DebugIncr); } } @@ -1439,7 +1439,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (con = pchan->constraints.first; con; con = con->next) { if (con->type == CONSTRAINT_TYPE_KINEMATIC) { - bKinematicConstraint *data = (bKinematicConstraint*)con->data; + bKinematicConstraint *data = (bKinematicConstraint *)con->data; data->weight = 1.0f; data->orientweight = 1.0f; data->flag &= ~CONSTRAINT_IK_ROT; @@ -1512,7 +1512,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Armature) { - ArmatureModifierData *amd = (ArmatureModifierData*) md; + ArmatureModifierData *amd = (ArmatureModifierData *)md; if (amd->object && amd->deformflag == 0) { Object *oba = blo_do_versions_newlibadr(fd, lib, amd->object); arm = blo_do_versions_newlibadr(fd, lib, oba->data); @@ -1578,7 +1578,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (srl = sce->r.layers.first; srl; srl = srl->next) { if (srl->layflag & SCE_LAY_SOLID) srl->layflag |= SCE_LAY_SKY; - srl->passflag &= (SCE_PASS_COMBINED|SCE_PASS_Z|SCE_PASS_NORMAL|SCE_PASS_VECTOR); + srl->passflag &= (SCE_PASS_COMBINED | SCE_PASS_Z | SCE_PASS_NORMAL | SCE_PASS_VECTOR); } /* node version changes */ @@ -1641,7 +1641,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { - View3D *v3d = (View3D*) sl; + View3D *v3d = (View3D *)sl; if (v3d->gridsubdiv == 0) v3d->gridsubdiv = 10; } @@ -1715,7 +1715,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* version patch from buttons_object.c */ if (data->flag == 0) - data->flag = ROTLIKE_X|ROTLIKE_Y|ROTLIKE_Z; + data->flag = ROTLIKE_X | ROTLIKE_Y | ROTLIKE_Z; break; } @@ -1731,32 +1731,32 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (curcon = pchan->constraints.first; curcon; curcon = curcon->next) { switch (curcon->type) { case CONSTRAINT_TYPE_MINMAX: - { - bMinMaxConstraint *data = curcon->data; - if (data->sticky == 1) - data->flag |= MINMAX_STICKY; - else - data->flag &= ~MINMAX_STICKY; - } + { + bMinMaxConstraint *data = curcon->data; + if (data->sticky == 1) + data->flag |= MINMAX_STICKY; + else + data->flag &= ~MINMAX_STICKY; break; + } case CONSTRAINT_TYPE_KINEMATIC: - { - bKinematicConstraint *data = curcon->data; - if (!(data->flag & CONSTRAINT_IK_POS)) { - data->flag |= CONSTRAINT_IK_POS; - data->flag |= CONSTRAINT_IK_STRETCH; - } + { + bKinematicConstraint *data = curcon->data; + if (!(data->flag & CONSTRAINT_IK_POS)) { + data->flag |= CONSTRAINT_IK_POS; + data->flag |= CONSTRAINT_IK_STRETCH; } break; + } case CONSTRAINT_TYPE_ROTLIKE: - { - bRotateLikeConstraint *data = curcon->data; + { + bRotateLikeConstraint *data = curcon->data; - /* version patch from buttons_object.c */ - if (data->flag == 0) - data->flag = ROTLIKE_X|ROTLIKE_Y|ROTLIKE_Z; - } + /* version patch from buttons_object.c */ + if (data->flag == 0) + data->flag = ROTLIKE_X | ROTLIKE_Y | ROTLIKE_Z; break; + } } } } @@ -1766,10 +1766,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* copy old object level track settings to curve modifers */ for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Curve) { - CurveModifierData *cmd = (CurveModifierData*) md; + CurveModifierData *cmd = (CurveModifierData *)md; if (cmd->defaxis == 0) - cmd->defaxis = ob->trackflag+1; + cmd->defaxis = ob->trackflag + 1; } } @@ -1819,7 +1819,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) tex->iuser.frames = tex->frames; tex->iuser.offset = tex->offset; tex->iuser.sfra = tex->sfra; - tex->iuser.cycl = (tex->imaflag & TEX_ANIMCYCLIC_)!=0; + tex->iuser.cycl = (tex->imaflag & TEX_ANIMCYCLIC_) != 0; } for (sce = bmain->scene.first; sce; sce = sce->id.next) { if (sce->nodetree) @@ -1834,7 +1834,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->subversionfile < 4) { for (sce = bmain->scene.first; sce; sce = sce->id.next) { - sce->r.bake_mode = 1; /* prevent to include render stuff here */ + sce->r.bake_mode = 1; /* prevent to include render stuff here */ sce->r.bake_filter = 16; sce->r.bake_flag = R_BAKE_CLEAR; } @@ -1860,7 +1860,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* translate old mirror modifier axis values to new flags */ for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Mirror) { - MirrorModifierData *mmd = (MirrorModifierData*) md; + MirrorModifierData *mmd = (MirrorModifierData *)md; switch (mmd->axis) { case 0: @@ -1902,7 +1902,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_ACTION) { - SpaceAction *saction = (SpaceAction*) sl; + SpaceAction *saction = (SpaceAction *)sl; saction->v2d.tot.ymin = -1000.0; saction->v2d.tot.ymax = 0.0; @@ -1932,7 +1932,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* unless the file was created 2.44.3 but not 2.45, update the constraints */ if (!(bmain->versionfile == 244 && bmain->subversionfile == 3) && - ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile == 0)) ) + ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile == 0)) ) { for (ob = bmain->object.first; ob; ob = ob->id.next) { ListBase *list; @@ -1951,13 +1951,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) switch (curcon->type) { case CONSTRAINT_TYPE_LOCLIMIT: { - bLocLimitConstraint *data = (bLocLimitConstraint *) curcon->data; + bLocLimitConstraint *data = (bLocLimitConstraint *)curcon->data; /* old limit without parent option for objects */ if (data->flag2) curcon->ownspace = CONSTRAINT_SPACE_LOCAL; + break; } - break; } } } @@ -1982,13 +1982,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) switch (curcon->type) { case CONSTRAINT_TYPE_ACTION: { - bActionConstraint *data = (bActionConstraint *) curcon->data; + bActionConstraint *data = (bActionConstraint *)curcon->data; /* 'data->local' used to mean that target was in local-space */ if (data->local) curcon->tarspace = CONSTRAINT_SPACE_LOCAL; + break; } - break; } } @@ -2027,7 +2027,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Cloth) { - ClothModifierData *clmd = (ClothModifierData*) md; + ClothModifierData *clmd = (ClothModifierData *)md; if (!clmd->point_cache) { clmd->point_cache = BKE_ptcache_add(&clmd->ptcaches); clmd->point_cache->step = 1; @@ -2129,7 +2129,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (ob = bmain->object.first; ob; ob = ob->id.next) { for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Armature) - ((ArmatureModifierData*) md)->deformflag |= ARM_DEF_B_BONE_REST; + ((ArmatureModifierData *)md)->deformflag |= ARM_DEF_B_BONE_REST; } } } @@ -2232,7 +2232,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) md = modifier_new(eModifierType_ParticleSystem); BLI_snprintf(md->name, sizeof(md->name), "ParticleSystem %i", BLI_listbase_count(&ob->particlesystem)); - psmd = (ParticleSystemModifierData*) md; + psmd = (ParticleSystemModifierData *)md; psmd->psys = psys; BLI_addtail(&ob->modifiers, md); @@ -2329,7 +2329,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) int a; if (pset->brush[0].size == 0) { - pset->flag = PE_KEEP_LENGTHS|PE_LOCK_FIRST|PE_DEFLECT_EMITTER; + pset->flag = PE_KEEP_LENGTHS | PE_LOCK_FIRST | PE_DEFLECT_EMITTER; pset->emitterdist = 0.25f; pset->totrekey = 5; pset->totaddkey = 5; @@ -2368,10 +2368,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) else repeat = strip->repeat; - length = strip->end-strip->start; + length = strip->end - strip->start; if (length == 0.0f) length = 1.0f; - actlength = strip->actend-strip->actstart; + actlength = strip->actend - strip->actstart; strip->scale = length / (repeat * actlength); if (strip->scale == 0.0f) @@ -2471,8 +2471,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) * use it for the number of divisions per segment */ if (nu->pntsv > 1) { - nu->resolu = MAX2( 1, (int)(((float)nu->resolu / (float)nu->pntsu)+0.5f) ); - nu->resolv = MAX2( 1, (int)(((float)nu->resolv / (float)nu->pntsv)+0.5f) ); + nu->resolu = MAX2(1, (int)(((float)nu->resolu / (float)nu->pntsu) + 0.5f) ); + nu->resolv = MAX2(1, (int)(((float)nu->resolv / (float)nu->pntsv) + 0.5f) ); } } } @@ -2502,25 +2502,25 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) for (sl = sa->spacedata.first; sl; sl = sl->next) { switch (sl->spacetype) { case SPACE_ACTION: - { - SpaceAction *sact = (SpaceAction *)sl; + { + SpaceAction *sact = (SpaceAction *)sl; - sact->mode = SACTCONT_DOPESHEET; - sact->autosnap = SACTSNAP_FRAME; - } + sact->mode = SACTCONT_DOPESHEET; + sact->autosnap = SACTSNAP_FRAME; break; + } case SPACE_IPO: - { - SpaceIpo *sipo = (SpaceIpo *)sl; - sipo->autosnap = SACTSNAP_FRAME; - } + { + SpaceIpo *sipo = (SpaceIpo *)sl; + sipo->autosnap = SACTSNAP_FRAME; break; + } case SPACE_NLA: - { - SpaceNla *snla = (SpaceNla *)sl; - snla->autosnap = SACTSNAP_FRAME; - } + { + SpaceNla *snla = (SpaceNla *)sl; + snla->autosnap = SACTSNAP_FRAME; break; + } } } } @@ -2532,7 +2532,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Object *ob; for (ob = bmain->object.first; ob; ob = ob->id.next) { if (ob->pd) - ob->pd->seed = ((unsigned int)(ceil(PIL_check_seconds_timer())) + 1) % 128; + ob->pd->seed = ((uint)(ceil(PIL_check_seconds_timer())) + 1) % 128; } } @@ -2548,7 +2548,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) SEQP_BEGIN (ed, seq) { if (seq->strip && seq->strip->proxy) { - seq->strip->proxy->quality =90; + seq->strip->proxy->quality = 90; } } SEQ_END |