diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-27 14:11:07 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-27 14:11:07 +0400 |
commit | fd134927dd23047237c6e490c09454487ba19a4a (patch) | |
tree | bd0d63f66af304da5d8b62aca4c5f6a0c0cfe2d4 /source/blender/blenkernel/intern | |
parent | 0c8cde2bb6bf5f38b4f567342ca371ec164f211c (diff) | |
parent | a0e62e77d75f0732ef877401f4ed9b1861ff9126 (diff) |
Merging r42800 through r42895 from trunk into soc-2011-tomato
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 14 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 15 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/idprop.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/ipo.c | 9 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 26 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_validate.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/movieclip.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/unit.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeavi.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 10 |
14 files changed, 60 insertions, 51 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 5305372402b..289faaa0095 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -943,7 +943,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest, number++; if(lastflag & CD_FLAG_NOCOPY) continue; - else if(!((int)mask & (int)(1 << (int)type))) continue; + else if(!(mask & CD_TYPE_AS_MASK(type))) continue; else if(number < CustomData_number_of_layers(dest, type)) continue; if((alloctype == CD_ASSIGN) && (lastflag & CD_FLAG_NOFREE)) @@ -1500,7 +1500,7 @@ void CustomData_set_only_copy(const struct CustomData *data, int i; for(i = 0; i < data->totlayer; ++i) - if(!((int)mask & (int)(1 << (int)data->layers[i].type))) + if(!(mask & CD_TYPE_AS_MASK(data->layers[i].type))) data->layers[i].flag |= CD_FLAG_NOCOPY; } @@ -2441,7 +2441,7 @@ void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask layer = &data->layers[i]; typeInfo = layerType_getInfo(layer->type); - if(!(mask & (1<<layer->type))); + if(!(mask & CD_TYPE_AS_MASK(layer->type))); else if((layer->flag & CD_FLAG_EXTERNAL) && (layer->flag & CD_FLAG_IN_MEMORY)) { if(typeInfo->free) typeInfo->free(layer->data, totelem, typeInfo->size); @@ -2467,7 +2467,7 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int layer = &data->layers[i]; typeInfo = layerType_getInfo(layer->type); - if(!(mask & (1<<layer->type))); + if(!(mask & CD_TYPE_AS_MASK(layer->type))); else if(layer->flag & CD_FLAG_IN_MEMORY); else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read) update= 1; @@ -2488,7 +2488,7 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int layer = &data->layers[i]; typeInfo = layerType_getInfo(layer->type); - if(!(mask & (1<<layer->type))); + if(!(mask & CD_TYPE_AS_MASK(layer->type))); else if(layer->flag & CD_FLAG_IN_MEMORY); else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read) { blay= cdf_layer_find(cdf, layer->type, layer->name); @@ -2527,7 +2527,7 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in layer = &data->layers[i]; typeInfo = layerType_getInfo(layer->type); - if(!(mask & (1<<layer->type))); + if(!(mask & CD_TYPE_AS_MASK(layer->type))); else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write) update= 1; } @@ -2641,7 +2641,7 @@ void CustomData_external_remove(CustomData *data, ID *id, int type, int totelem) if(layer->flag & CD_FLAG_EXTERNAL) { if(!(layer->flag & CD_FLAG_IN_MEMORY)) - CustomData_external_read(data, id, (1<<layer->type), totelem); + CustomData_external_read(data, id, CD_TYPE_AS_MASK(layer->type), totelem); layer->flag &= ~CD_FLAG_EXTERNAL; diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index b0776a0b51b..ebeb45e9cd5 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -1709,7 +1709,7 @@ static void scene_sort_groups(Main *bmain, Scene *sce) /* sort the base list on dependency order */ void DAG_scene_sort(Main *bmain, Scene *sce) { - DagNode *node; + DagNode *node, *rootnode; DagNodeQueue *nqueue; DagAdjList *itA; int time; @@ -1731,11 +1731,10 @@ void DAG_scene_sort(Main *bmain, Scene *sce) time = 1; - node = sce->theDag->DagNode.first; - - node->color = DAG_GRAY; + rootnode = sce->theDag->DagNode.first; + rootnode->color = DAG_GRAY; time++; - push_stack(nqueue,node); + push_stack(nqueue,rootnode); while(nqueue->count) { @@ -2853,10 +2852,8 @@ void DAG_pose_sort(Object *ob) for(node = dag->DagNode.first; node; node= node->next) node->color = DAG_WHITE; - node = dag->DagNode.first; - - node->color = DAG_GRAY; - push_stack(nqueue, node); + rootnode->color = DAG_GRAY; + push_stack(nqueue, rootnode); while(nqueue->count) { diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index b9947c506d1..318165af804 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1414,10 +1414,7 @@ void driver_free_variable (ChannelDriver *driver, DriverVar *dvar) DRIVER_TARGETS_LOOPER_END /* remove the variable from the driver */ - if (driver) - BLI_freelinkN(&driver->variables, dvar); - else - MEM_freeN(dvar); + BLI_freelinkN(&driver->variables, dvar); #ifdef WITH_PYTHON /* since driver variables are cached, the expression needs re-compiling too */ 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/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 25ff7b5fa04..354a5265f90 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1544,7 +1544,7 @@ int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf) ibuf->ftype= OPENEXR; if(imf->depth == R_IMF_CHAN_DEPTH_16) ibuf->ftype |= OPENEXR_HALF; - ibuf->ftype |= (quality & OPENEXR_COMPRESS); + ibuf->ftype |= (imf->exr_codec & OPENEXR_COMPRESS); if(!(imf->flag & R_IMF_FLAG_ZBUF)) ibuf->zbuf_float = NULL; /* signal for exr saving */ diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 622ec093a3f..9890a2629fc 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -909,8 +909,10 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co if (array_index) *array_index= dummy_index; } - + + /* 'buf' _must_ be initialized in this block */ /* append preceding bits to path */ + /* note, strings are not escapted and they should be! */ if ((actname && actname[0]) && (constname && constname[0])) { /* Constraint in Pose-Channel */ sprintf(buf, "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname); @@ -918,6 +920,7 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co else if (actname && actname[0]) { if ((blocktype == ID_OB) && strcmp(actname, "Object")==0) { /* Actionified "Object" IPO's... no extra path stuff needed */ + buf[0]= '\0'; /* empty string */ } else if ((blocktype == ID_KE) && strcmp(actname, "Shape")==0) { /* Actionified "Shape" IPO's - these are forced onto object level via the action container there... */ @@ -936,8 +939,10 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co /* Sequence names in Scene */ sprintf(buf, "sequence_editor.sequences_all[\"%s\"]", seq->name+2); } - else + else { buf[0]= '\0'; /* empty string */ + } + BLI_dynstr_append(path, buf); /* need to add dot before property if there was anything precceding this */ diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 43958457edb..4b4875213b1 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -466,8 +466,8 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr) if(mface->v3==0) { static int corner_indices[4] = {1, 2, 0, 3}; - SWAP(int, mface->v1, mface->v2); - SWAP(int, mface->v2, mface->v3); + SWAP(unsigned int, mface->v1, mface->v2); + SWAP(unsigned int, mface->v2, mface->v3); if(fdata) CustomData_swap(fdata, mfindex, corner_indices); @@ -477,8 +477,8 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr) if(mface->v3==0 || mface->v4==0) { static int corner_indices[4] = {2, 3, 0, 1}; - SWAP(int, mface->v1, mface->v3); - SWAP(int, mface->v2, mface->v4); + SWAP(unsigned int, mface->v1, mface->v3); + SWAP(unsigned int, mface->v2, mface->v4); if(fdata) CustomData_swap(fdata, mfindex, corner_indices); @@ -520,12 +520,14 @@ void set_mesh(Object *ob, Mesh *me) /* ************** make edges in a Mesh, for outside of editmode */ struct edgesort { - int v1, v2; + unsigned int v1, v2; short is_loose, is_draw; }; /* edges have to be added with lowest index first for sorting */ -static void to_edgesort(struct edgesort *ed, int v1, int v2, short is_loose, short is_draw) +static void to_edgesort(struct edgesort *ed, + unsigned int v1, unsigned int v2, + short is_loose, short is_draw) { if(v1<v2) { ed->v1= v1; ed->v2= v2; @@ -627,7 +629,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, int UNUSED( /* order is swapped so extruding this edge as a surface wont flip face normals * with cyclic curves */ if(ed->v1+1 != ed->v2) { - SWAP(int, medge->v1, medge->v2); + SWAP(unsigned int, medge->v1, medge->v2); } medge++; } @@ -1029,17 +1031,17 @@ typedef struct EdgeLink { typedef struct VertLink { Link *next, *prev; - int index; + unsigned int index; } VertLink; -static void prependPolyLineVert(ListBase *lb, int index) +static void prependPolyLineVert(ListBase *lb, unsigned int index) { VertLink *vl= MEM_callocN(sizeof(VertLink), "VertLink"); vl->index = index; BLI_addhead(lb, vl); } -static void appendPolyLineVert(ListBase *lb, int index) +static void appendPolyLineVert(ListBase *lb, unsigned int index) { VertLink *vl= MEM_callocN(sizeof(VertLink), "VertLink"); vl->index = index; @@ -1111,8 +1113,8 @@ void mesh_to_curve(Scene *scene, Object *ob) int closed = FALSE; int totpoly= 0; MEdge *med_current= ((EdgeLink *)edges.last)->edge; - int startVert= med_current->v1; - int endVert= med_current->v2; + unsigned int startVert= med_current->v1; + unsigned int endVert= med_current->v2; int ok= TRUE; appendPolyLineVert(&polyline, startVert); totpoly++; diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index 5a53d953f1b..a1bf9cb9481 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -395,7 +395,7 @@ static int mesh_validate_customdata(CustomData *data, short do_verbose, const sh while(i<data->totlayer) { CustomDataLayer *layer= &data->layers[i]; - int mask= 1 << layer->type; + CustomDataMask mask= CD_TYPE_AS_MASK(layer->type); int ok= 1; if((mask&CD_MASK_MESH)==0) { diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 5c9c59e5392..224ce003ea3 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -991,9 +991,9 @@ void unlink_movieclip(Main *bmain, MovieClip *clip) } for(ob= bmain->object.first; ob; ob= ob->id.next) { - bConstraint *con= ob->constraints.first; + bConstraint *con; - for (con= ob->constraints.first; con; con= con->next) { + for(con= ob->constraints.first; con; con= con->next) { bConstraintTypeInfo *cti= constraint_get_typeinfo(con); if(cti->type==CONSTRAINT_TYPE_FOLLOWTRACK) { diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 28c1aacdec5..8251c4796ea 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2563,7 +2563,7 @@ void object_handle_update(Scene *scene, Object *ob) #else /* ensure CD_MASK_BAREMESH for now */ EditMesh *em = (ob == scene->obedit)? BKE_mesh_get_editmesh(ob->data): NULL; - unsigned int data_mask= scene->customdata_mask | ob->customdata_mask | CD_MASK_BAREMESH; + uint64_t data_mask= scene->customdata_mask | ob->customdata_mask | CD_MASK_BAREMESH; if(em) { makeDerivedMesh(scene, ob, em, data_mask); /* was CD_MASK_BAREMESH */ BKE_mesh_end_editmesh(ob->data, em); diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 374ef3512e8..e773eb6dd35 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -2292,6 +2292,9 @@ static int ccgdm_adjacent_grid(CCGSubSurf *ss, int *gridOffset, CCGFace *f, int break; } } + + if(numEdges == 0) + return -1; fIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, adjf)); diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index aa914998a72..81c526e45a6 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -299,7 +299,8 @@ static bUnitDef *unit_best_fit(double value, bUnitCollection *usys, bUnitDef *un if(suppress && (unit->flag & B_UNIT_DEF_SUPPRESS)) continue; - if (value_abs >= unit->scalar*(1.0-EPS)) /* scale down scalar so 1cm doesnt convert to 10mm because of float error */ + /* scale down scalar so 1cm doesnt convert to 10mm because of float error */ + if (value_abs >= unit->scalar*(1.0-EPS)) return unit; } @@ -481,11 +482,14 @@ static int ch_is_op(char op) } } -static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit, const char *replace_str) +static int unit_scale_str(char *str, int len_max, char *str_tmp, + double scale_pref, bUnitDef *unit, const char *replace_str) { char *str_found; - if((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) { /* XXX - investigate, does not respect len_max properly */ + if((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) { + /* XXX - investigate, does not respect len_max properly */ + int len, len_num, len_name, len_move, found_ofs; found_ofs = (int)(str_found-str); diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 8cd30912840..da64c464dce 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -159,9 +159,6 @@ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportL avi = MEM_mallocN (sizeof(AviMovie), "avimovie"); - /* RPW 11-21-2002 - if (rd->imtype != AVI_FORMAT_MJPEG) format = AVI_FORMAT_AVI_RGB; - */ if (rd->im_format.imtype != R_IMF_IMTYPE_AVIJPEG ) format = AVI_FORMAT_AVI_RGB; else format = AVI_FORMAT_MJPEG; diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index aa7d71b1577..bf547584b9e 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1333,11 +1333,11 @@ void ffmpeg_set_preset(RenderData *rd, int preset) } } -void ffmpeg_verify_image_type(RenderData *rd) +void ffmpeg_verify_image_type(RenderData *rd, ImageFormatData *imf) { int audio= 0; - if(rd->imtype == R_IMF_IMTYPE_FFMPEG) { + if(imf->imtype == R_IMF_IMTYPE_FFMPEG) { if(rd->ffcodecdata.type <= 0 || rd->ffcodecdata.codec <= 0 || rd->ffcodecdata.audio_codec <= 0 || @@ -1353,19 +1353,19 @@ void ffmpeg_verify_image_type(RenderData *rd) audio= 1; } - else if(rd->imtype == R_IMF_IMTYPE_H264) { + else if(imf->imtype == R_IMF_IMTYPE_H264) { if(rd->ffcodecdata.codec != CODEC_ID_H264) { ffmpeg_set_preset(rd, FFMPEG_PRESET_H264); audio= 1; } } - else if(rd->imtype == R_IMF_IMTYPE_XVID) { + else if(imf->imtype == R_IMF_IMTYPE_XVID) { if(rd->ffcodecdata.codec != CODEC_ID_MPEG4) { ffmpeg_set_preset(rd, FFMPEG_PRESET_XVID); audio= 1; } } - else if(rd->imtype == R_IMF_IMTYPE_THEORA) { + else if(imf->imtype == R_IMF_IMTYPE_THEORA) { if(rd->ffcodecdata.codec != CODEC_ID_THEORA) { ffmpeg_set_preset(rd, FFMPEG_PRESET_THEORA); audio= 1; |