From f49fc58df63d42ab451380ea92e55b1265d14e4e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 10 Oct 2010 07:01:56 +0000 Subject: enable building the game engine without bullet for scons & cmake --- source/blender/blenkernel/intern/object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 0c437db335b..541e8e2b00e 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1743,7 +1743,7 @@ int enable_cu_speed= 1; static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4]) { Curve *cu; - float q[4], vec[4], dir[3], quat[4], radius, x1, ctime; + float vec[4], dir[3], quat[4], radius, ctime; float timeoffs = 0.0, sf_orig = 0.0; unit_m4(mat); @@ -1795,6 +1795,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4]) if(cu->flag & CU_FOLLOW) { #if 0 + float x1, q[4]; vec_to_quat( quat,dir, ob->trackflag, ob->upflag); /* the tilt */ -- cgit v1.2.3 From 52e6058bb4ee2916f440e7103e4067ec522a144e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 10 Oct 2010 21:39:24 +0000 Subject: [#24204] Packing of image sequence does not work this isnt supported but at least display a warning. --- source/blender/blenkernel/intern/packedFile.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 919a724d1ec..5bbb3506a78 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -214,10 +214,17 @@ void packAll(Main *bmain, ReportList *reports) Image *ima; VFont *vf; bSound *sound; - - for(ima=bmain->image.first; ima; ima=ima->id.next) - if(ima->packedfile == NULL && ima->id.lib==NULL && ELEM3(ima->source, IMA_SRC_FILE, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) - ima->packedfile = newPackedFile(reports, ima->name); + + for(ima=bmain->image.first; ima; ima=ima->id.next) { + if(ima->packedfile == NULL && ima->id.lib==NULL) { + if(ima->source==IMA_SRC_FILE) { + ima->packedfile = newPackedFile(reports, ima->name); + } + else if(ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { + BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported.", ima->id.name+2); + } + } + } for(vf=bmain->vfont.first; vf; vf=vf->id.next) if(vf->packedfile == NULL && vf->id.lib==NULL && strcmp(vf->name, "") != 0) -- cgit v1.2.3 From 1579c1a5c90219777e8291f39564739509c579d7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 10 Oct 2010 22:15:48 +0000 Subject: weight-paint in solid draw mode would draw the wire twice, also change wire drawing to draw all edges and better visibility over yellow areas. --- source/blender/editors/space_view3d/drawobject.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index d28813f7522..2206d744dc6 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2520,24 +2520,25 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D * rather then the shading, this is also forced in wire view */ GPU_enable_material(0, NULL); dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me->mface, 1, GPU_enable_material); - + bglPolygonOffset(rv3d->dist, 1.0); glDepthMask(0); // disable write in zbuffer, selected edge wires show better glEnable(GL_BLEND); - glColor4ub(196, 196, 196, 196); + glColor4ub(255, 255, 255, 96); glEnable(GL_LINE_STIPPLE); - glLineStipple(1, 0x8888); + glLineStipple(1, 0xAAAA); - dm->drawEdges(dm, 1, 0); + dm->drawEdges(dm, 1, 1); bglPolygonOffset(rv3d->dist, 0.0); glDepthMask(1); glDisable(GL_LINE_STIPPLE); GPU_disable_material(); - - + + /* since we already draw wire as wp guide, dont draw over the top */ + draw_wire= 0; } else { Paint *p; -- cgit v1.2.3 From bf4075236fe2aa011d7bab26358e55883ffa0248 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 10 Oct 2010 23:11:34 +0000 Subject: bugfix [#23412] Weightpaint and rotate around bones fixed by allowing an unselected armature to have its pose bones used in weightpaint mode. --- .../blender/editors/transform/transform_conversions.c | 18 +++++++++--------- source/blender/makesdna/DNA_scene_types.h | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 01404603b86..0c0912a4ad6 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5318,19 +5318,19 @@ void createTransData(bContext *C, TransInfo *t) createTransPose(C, t, ob); } else if (ob && (ob->mode & OB_MODE_WEIGHT_PAINT)) { - /* exception, we look for the one selected armature */ - CTX_DATA_BEGIN(C, Object*, ob_armature, selected_objects) - { - if(ob_armature->type==OB_ARMATURE) - { - if((ob_armature->mode & OB_MODE_POSE) && ob_armature == modifiers_isDeformedByArmature(ob)) - { + /* important that ob_armature can be set even when its not selected [#23412] + * lines below just check is also visible */ + Object *ob_armature= modifiers_isDeformedByArmature(ob); + if(ob_armature && ob_armature->mode & OB_MODE_POSE) { + Base *base_arm= object_in_scene(ob_armature, t->scene); + if(base_arm) { + View3D *v3d = t->view; + if(BASE_VISIBLE(v3d, base_arm)) { createTransPose(C, t, ob_armature); - break; } } + } - CTX_DATA_END; } else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT) && PE_start_edit(PE_get_current(scene, ob))) { diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index cc5d256615e..82eecca743c 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1038,6 +1038,7 @@ typedef struct Scene { #define TESTBASELIB_BGMODE(v3d, scene, base) ( ((base)->flag & SELECT) && ((base)->lay & (v3d ? v3d->lay : scene->lay)) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0)) #define BASE_EDITABLE_BGMODE(v3d, scene, base) (((base)->lay & (v3d ? v3d->lay : scene->lay)) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0)) #define BASE_SELECTABLE(v3d, base) ((base->lay & v3d->lay) && (base->object->restrictflag & (OB_RESTRICT_SELECT|OB_RESTRICT_VIEW))==0) +#define BASE_VISIBLE(v3d, base) ((base->lay & v3d->lay) && (base->object->restrictflag & OB_RESTRICT_VIEW)==0) #define FIRSTBASE scene->base.first #define LASTBASE scene->base.last #define BASACT (scene->basact) -- cgit v1.2.3 From 159cf6e5ddf27f37f0e56d172a16b018d9c037ab Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 10 Oct 2010 23:37:25 +0000 Subject: bugfix [#24214] F6 "last operator" panel repeatable segmentation fault --- source/blender/editors/interface/interface_handlers.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 6d8c368db3f..654a089dafe 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -5526,16 +5526,20 @@ int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu, ((ELEM(event->type, UPARROWKEY, WHEELUPMOUSE)) && (block->direction & UI_RIGHT)) || ((ELEM(event->type, DOWNARROWKEY, WHEELDOWNMOUSE)) && (block->direction & UI_TOP)) ) { - if(ui_but_first(block)->type & BUT) + if((bt= ui_but_first(block)) && (bt->type & BUT)) { bt= ui_but_last(block); - else - bt= ui_but_first(block); + } + else { + /* keep ui_but_first() */ + } } else { - if(ui_but_first(block)->type & BUT) - bt= ui_but_first(block); - else + if((bt= ui_but_first(block)) && (bt->type & BUT)) { + /* keep ui_but_first() */ + } + else { bt= ui_but_last(block); + } } if(bt) -- cgit v1.2.3 From 4ad2e4a3830535d62aadd035bd5a714bca20a816 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 11 Oct 2010 00:15:49 +0000 Subject: [#24045] heat weight fails on specific geometry. The error for heat weighting was only being printed in the console, while the problem remains at least a warning is now given that there was a problem calculating the heat weight. also fixed a memory leak from the mesh octree not being freed after assigning vertex groups. (ModNode error) --- source/blender/editors/armature/editarmature.c | 18 +++++++++++++----- source/blender/editors/armature/meshlaplacian.c | 7 ++++--- source/blender/editors/armature/meshlaplacian.h | 2 +- source/blender/editors/include/ED_armature.h | 3 ++- source/blender/editors/object/object_relations.c | 6 +++--- source/blender/editors/sculpt_paint/paint_vertex.c | 2 +- 6 files changed, 24 insertions(+), 14 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 26a89c4de02..49c3ac06b94 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -4723,7 +4723,7 @@ static void envelope_bone_weighting(Object *ob, Mesh *mesh, float (*verts)[3], i } } -void add_verts_to_dgroups(Scene *scene, Object *ob, Object *par, int heat, int mirror) +void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object *par, int heat, int mirror) { /* This functions implements the automatic computation of vertex group * weights, either through envelopes or using a heat equilibrium. @@ -4870,14 +4870,22 @@ void add_verts_to_dgroups(Scene *scene, Object *ob, Object *par, int heat, int m /* compute the weights based on gathered vertices and bones */ if (heat) { + const char *error= NULL; heat_bone_weighting(ob, mesh, verts, numbones, dgrouplist, dgroupflip, - root, tip, selected); + root, tip, selected, &error); + + if(error) { + BKE_report(reports, RPT_WARNING, error); + } } else { envelope_bone_weighting(ob, mesh, verts, numbones, bonelist, dgrouplist, dgroupflip, root, tip, selected, mat4_to_scale(par->obmat)); } - + + /* only generated in some cases but can call anyway */ + mesh_octree_table(ob, NULL, NULL, 'e'); + /* free the memory allocated */ MEM_freeN(bonelist); MEM_freeN(dgrouplist); @@ -4888,7 +4896,7 @@ void add_verts_to_dgroups(Scene *scene, Object *ob, Object *par, int heat, int m MEM_freeN(verts); } -void create_vgroups_from_armature(Scene *scene, Object *ob, Object *par, int mode, int mirror) +void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob, Object *par, int mode, int mirror) { /* Lets try to create some vertex groups * based on the bones of the parent armature. @@ -4909,7 +4917,7 @@ void create_vgroups_from_armature(Scene *scene, Object *ob, Object *par, int mod * that are populated with the vertices for which the * bone is closest. */ - add_verts_to_dgroups(scene, ob, par, (mode == ARM_GROUPS_AUTO), mirror); + add_verts_to_dgroups(reports, scene, ob, par, (mode == ARM_GROUPS_AUTO), mirror); } } /* ************* Clear Pose *****************************/ diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 84b02b4796a..38372850ff8 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -642,13 +642,15 @@ static float heat_limit_weight(float weight) return weight; } -void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3], int *selected) +void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3], int *selected, const char **err_str) { LaplacianSystem *sys; MFace *mface; float solution, weight; int *vertsflipped = NULL, *mask= NULL; int a, totface, j, bbone, firstsegment, lastsegment, thrownerror = 0; + + *err_str= NULL; /* count triangles and create mask */ if(me->editflag & ME_EDIT_PAINT_MASK) @@ -760,8 +762,7 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource, } } else if(!thrownerror) { - error("Bone Heat Weighting:" - " failed to find solution for one or more bones"); + *err_str= "Bone Heat Weighting: failed to find solution for one or more bones"; thrownerror= 1; break; } diff --git a/source/blender/editors/armature/meshlaplacian.h b/source/blender/editors/armature/meshlaplacian.h index 640eb33c945..cba43043e8d 100644 --- a/source/blender/editors/armature/meshlaplacian.h +++ b/source/blender/editors/armature/meshlaplacian.h @@ -66,7 +66,7 @@ float laplacian_system_get_solution(int v); void heat_bone_weighting(struct Object *ob, struct Mesh *me, float (*verts)[3], int numbones, struct bDeformGroup **dgrouplist, struct bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3], - int *selected); + int *selected, const char **error); #ifdef RIGID_DEFORM /* As-Rigid-As-Possible Deformation */ diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 809b86d65f3..e91bafc9056 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -42,6 +42,7 @@ struct ListBase; struct MeshDeformModifierData; struct Object; struct RegionView3D; +struct ReportList; struct Scene; struct SK_Sketch; struct View3D; @@ -132,7 +133,7 @@ void ED_armature_apply_transform(struct Object *ob, float mat[4][4]); #define ARM_GROUPS_ENVELOPE 2 #define ARM_GROUPS_AUTO 3 -void create_vgroups_from_armature(struct Scene *scene, struct Object *ob, struct Object *par, int mode, int mirror); +void create_vgroups_from_armature(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct Object *par, int mode, int mirror); void auto_align_armature(struct Scene *scene, struct View3D *v3d, short mode); void unique_editbone_name(struct ListBase *ebones, char *name, EditBone *bone); /* if bone is already in list, pass it as param to ignore it */ diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 11175958fba..6a107b8e204 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -641,11 +641,11 @@ static int parent_set_exec(bContext *C, wmOperator *op) } else if(pararm && ob->type==OB_MESH && par->type == OB_ARMATURE) { if(partype == PAR_ARMATURE_NAME) - create_vgroups_from_armature(scene, ob, par, ARM_GROUPS_NAME, 0); + create_vgroups_from_armature(op->reports, scene, ob, par, ARM_GROUPS_NAME, 0); else if(partype == PAR_ARMATURE_ENVELOPE) - create_vgroups_from_armature(scene, ob, par, ARM_GROUPS_ENVELOPE, 0); + create_vgroups_from_armature(op->reports, scene, ob, par, ARM_GROUPS_ENVELOPE, 0); else if(partype == PAR_ARMATURE_AUTO) - create_vgroups_from_armature(scene, ob, par, ARM_GROUPS_AUTO, 0); + create_vgroups_from_armature(op->reports, scene, ob, par, ARM_GROUPS_AUTO, 0); /* get corrected inverse */ ob->partype= PAROBJECT; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 399ba535e57..f033c2aac83 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1971,7 +1971,7 @@ static int weight_from_bones_exec(bContext *C, wmOperator *op) Mesh *me= ob->data; int type= RNA_enum_get(op->ptr, "type"); - create_vgroups_from_armature(scene, ob, armob, type, (me->editflag & ME_EDIT_MIRROR_X)); + create_vgroups_from_armature(op->reports, scene, ob, armob, type, (me->editflag & ME_EDIT_MIRROR_X)); DAG_id_flush_update(&me->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM|ND_DATA, me); -- cgit v1.2.3 From fab8deb811d0e3cd36b379fd795d3191282f7825 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 11 Oct 2010 04:00:33 +0000 Subject: bugfix [#20761] Bones/Armature: "Inherit Scale" doesn't work if "Inherit Rotation" is disabled --- source/blender/blenkernel/intern/armature.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 2e760f53155..f1f9fe08717 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -2239,13 +2239,28 @@ void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float cti offs_bone[3][1]+= parbone->length; /* Compose the matrix for this bone */ - if(bone->flag & BONE_HINGE) { // uses restposition rotation, but actual position + if((bone->flag & BONE_HINGE) && (bone->flag & BONE_NO_SCALE)) { // uses restposition rotation, but actual position float tmat[4][4]; - /* the rotation of the parent restposition */ copy_m4_m4(tmat, parbone->arm_mat); mul_serie_m4(pchan->pose_mat, tmat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL); } + else if(bone->flag & BONE_HINGE) { // same as above but apply parent scale + float tmat[4][4]; + + /* apply the parent matrix scale */ + float tsmat[4][4], tscale[3]; + + /* the rotation of the parent restposition */ + copy_m4_m4(tmat, parbone->arm_mat); + + /* extract the scale of the parent matrix */ + mat4_to_size(tscale, parchan->pose_mat); + size_to_mat4(tsmat, tscale); + mul_m4_m4m4(tmat, tmat, tsmat); + + mul_serie_m4(pchan->pose_mat, tmat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL); + } else if(bone->flag & BONE_NO_SCALE) { float orthmat[4][4]; -- cgit v1.2.3 From 67a1a871a9be8b62344efc3ba1c312dce535da09 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 11 Oct 2010 08:03:28 +0000 Subject: Revert r32330 and reopening #24184. The change breaks input where modifier key is used to create a character. --- source/blender/editors/space_console/console_ops.c | 8 ++++++-- source/blender/editors/space_text/text_ops.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 4e50b589bc6..a84a592279e 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -407,9 +407,13 @@ static int insert_invoke(bContext *C, wmOperator *op, wmEvent *event) if(!RNA_string_length(op->ptr, "text")) { char str[2] = {event->ascii, '\0'}; + /* XXX NOTE: Reverting this change from r32330, since it + * breaks input for cases where modifierkey is needed to + * create characters. + */ /* if alt/ctrl/super are pressed pass through */ - if(event->alt || event->ctrl || event->oskey) - return OPERATOR_PASS_THROUGH; + //if(event->alt || event->ctrl || event->oskey) + // return OPERATOR_PASS_THROUGH; RNA_string_set(op->ptr, "text", str); } diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index e3bf390dba8..f6a4488966d 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2323,9 +2323,13 @@ static int insert_invoke(bContext *C, wmOperator *op, wmEvent *event) if(!RNA_string_length(op->ptr, "text")) { char str[2] = {event->ascii, '\0'}; + /* XXX NOTE: Reverting this change from r32330, since it + * breaks input for cases where modifierkey is needed to + * create characters. + */ /* if alt/ctrl/super are pressed pass through */ - if(event->alt || event->ctrl || event->oskey) - return OPERATOR_PASS_THROUGH; + //if(event->alt || event->ctrl || event->oskey) + // return OPERATOR_PASS_THROUGH; RNA_string_set(op->ptr, "text", str); } -- cgit v1.2.3 From 7ab02f1ec17b4a48aedb2ab4ec43d0fe2d62c565 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Mon, 11 Oct 2010 09:02:19 +0000 Subject: Fix for [#24195] Cloth modifier doesn't work after changing subsurf on the object * Cloth has to reset itself properly on vertex count changes as it can be after a constructive modifier (unlike softbody) --- source/blender/blenkernel/intern/cloth.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index be1552a882d..3f47676d7fd 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -446,7 +446,9 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, return dm; } - if(clmd->sim_parms->reset || (framenr == (startframe - clmd->sim_parms->preroll) && clmd->sim_parms->preroll != 0)) + if(clmd->sim_parms->reset + || (framenr == (startframe - clmd->sim_parms->preroll) && clmd->sim_parms->preroll != 0) + || (clmd->clothObject && result->getNumVerts(result) != clmd->clothObject->numverts)) { clmd->sim_parms->reset = 0; cache->flag |= PTCACHE_OUTDATED; @@ -457,17 +459,6 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, return result; } - /* verify we still have the same number of vertices, if not do nothing. - * note that this should only happen if the number of vertices changes - * during an animation due to a preceding modifier, this should not - * happen because of object changes! */ - if(clmd->clothObject) { - if(result->getNumVerts(result) != clmd->clothObject->numverts) { - BKE_ptcache_invalidate(cache); - return result; - } - } - // unused in the moment, calculated separately in implicit.c clmd->sim_parms->dt = clmd->sim_parms->timescale / clmd->sim_parms->stepsPerFrame; -- cgit v1.2.3 From 737bc66f2aee939dc98adb4d6e9610a99c09059a Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 11 Oct 2010 09:52:25 +0000 Subject: Add note about Inv Quad falloff of lamp that there seems to be a hack in use. --- source/blender/render/intern/source/shadeoutput.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender') diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 81de553b209..4142522e003 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1141,6 +1141,11 @@ float lamp_get_visibility(LampRen *lar, float *co, float *lv, float *dist) visifac = lar->dist/(lar->dist + dist[0]); break; case LA_FALLOFF_INVSQUARE: + /* NOTE: This seems to be a hack since commit r12045 says this + * option is similar to old Quad, but with slight changes. + * Correct inv square would be (which would be old Quad): + * visifac = lar->distkw / (lar->distkw + dist[0]*dist[0]); + */ visifac = lar->dist / (lar->dist + dist[0]*dist[0]); break; case LA_FALLOFF_SLIDERS: -- cgit v1.2.3 From e444c777145ccf297bc00f8e4690b78ed4ea85c9 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Mon, 11 Oct 2010 10:40:34 +0000 Subject: Fix for [#20064] Cloth simulation doesn't stop when marker is set back to frame 1 after exiting mesh edit. * First frame was dropped some times when animation was running because clicking "go to start/end frame" changed the current frame directly. * Now only the animtimer changes the frame and clicking the "go to" queues the next frame for animtimer. --- source/blender/editors/include/ED_screen_types.h | 3 ++ source/blender/editors/screen/screen_ops.c | 40 +++++++++++++++++++----- 2 files changed, 35 insertions(+), 8 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h index c5abd5465d7..18d6a1a48cc 100644 --- a/source/blender/editors/include/ED_screen_types.h +++ b/source/blender/editors/include/ED_screen_types.h @@ -38,6 +38,7 @@ typedef struct ScreenAnimData { short refresh; short flag; /* flags for playback */ int sfra; /* frame that playback was started from */ + int nextfra; /* next frame to go to (when ANIMPLAY_FLAG_USE_NEXT_FRAME is set) */ } ScreenAnimData; /* for animplayer */ @@ -50,6 +51,8 @@ enum { ANIMPLAY_FLAG_SYNC = (1<<2), /* don't drop frames (and ignore SCE_FRAME_DROP flag) */ ANIMPLAY_FLAG_NO_SYNC = (1<<3), + /* use nextfra at next timer update */ + ANIMPLAY_FLAG_USE_NEXT_FRAME, }; /* ----------------------------------------------------- */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 613c8bc0178..584112ccacd 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1553,15 +1553,32 @@ static void SCREEN_OT_frame_offset(wmOperatorType *ot) static int frame_jump_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); - - if (RNA_boolean_get(op->ptr, "end")) - CFRA= PEFRA; - else - CFRA= PSFRA; - - sound_seek_scene(C); + wmTimer *animtimer= CTX_wm_screen(C)->animtimer; - WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); + /* Don't change CFRA directly if animtimer is running as this can cause + * first/last frame not to be actually shown (bad since for example physics + * simulations aren't reset properly). + */ + if(animtimer) { + ScreenAnimData *sad = animtimer->customdata; + + sad->flag |= ANIMPLAY_FLAG_USE_NEXT_FRAME; + + if (RNA_boolean_get(op->ptr, "end")) + sad->nextfra= PEFRA; + else + sad->nextfra= PSFRA; + } + else { + if (RNA_boolean_get(op->ptr, "end")) + CFRA= PEFRA; + else + CFRA= PSFRA; + + sound_seek_scene(C); + + WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); + } return OPERATOR_FINISHED; } @@ -2513,6 +2530,13 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event) } } } + + /* next frame overriden by user action (pressed jump to first/last frame) */ + if(sad->flag & ANIMPLAY_FLAG_USE_NEXT_FRAME) { + scene->r.cfra = sad->nextfra; + sad->flag &= ~ANIMPLAY_FLAG_USE_NEXT_FRAME; + sad->flag |= ANIMPLAY_FLAG_JUMPED; + } if (sad->flag & ANIMPLAY_FLAG_JUMPED) sound_seek_scene(C); -- cgit v1.2.3 From 8ec87bb45f39cc4d8b667d8a474bcdc2b997d83b Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 11 Oct 2010 12:38:52 +0000 Subject: COLLADA Export unit system and scale instead of hard-coded 1 decimeter. --- source/blender/collada/DocumentExporter.cpp | 55 +++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp index cbcb3984018..9062bd4ba9f 100644 --- a/source/blender/collada/DocumentExporter.cpp +++ b/source/blender/collada/DocumentExporter.cpp @@ -69,6 +69,8 @@ extern char build_rev[]; #include "BLI_string.h" #include "BLI_listbase.h" +#include "RNA_access.h" + #include "COLLADASWAsset.h" #include "COLLADASWLibraryVisualScenes.h" #include "COLLADASWNode.h" @@ -901,19 +903,66 @@ protected: void DocumentExporter::exportCurrentScene(Scene *sce, const char* filename) { + PointerRNA sceneptr, unit_settings; + PropertyRNA *system, *scale; + clear_global_id_map(); COLLADABU::NativeString native_filename = COLLADABU::NativeString(std::string(filename)); COLLADASW::StreamWriter sw(native_filename); - // open + // open sw.startDocument(); // COLLADASW::Asset asset(&sw); - // XXX ask blender devs about this? - asset.setUnit("decimetre", 0.1); + + RNA_id_pointer_create(&(sce->id), &sceneptr); + unit_settings = RNA_pointer_get(&sceneptr, "unit_settings"); + system = RNA_struct_find_property(&unit_settings, "system"); + //scale = RNA_struct_find_property(&unit_settings, "scale_length"); + + std::string unitname = "meter"; + float linearmeasure = 1.0f; + + linearmeasure = RNA_float_get(&unit_settings, "scale_length"); + + switch(RNA_property_enum_get(&unit_settings, system)) { + case USER_UNIT_NONE: + case USER_UNIT_METRIC: + if(linearmeasure == 0.001f) { + unitname = "millimeter"; + } + else if(linearmeasure == 0.01f) { + unitname = "centimeter"; + } + else if(linearmeasure == 0.1f) { + unitname = "decimeter"; + } + else if(linearmeasure == 1.0f) { + unitname = "meter"; + } + else if(linearmeasure == 1000.0f) { + unitname = "kilometer"; + } + break; + case USER_UNIT_IMPERIAL: + if(linearmeasure == 0.0254f) { + unitname = "inch"; + } + else if(linearmeasure == 0.3048f) { + unitname = "foot"; + } + else if(linearmeasure == 0.9144f) { + unitname = "yard"; + } + break; + default: + break; + } + + asset.setUnit(unitname, linearmeasure); asset.setUpAxisType(COLLADASW::Asset::Z_UP); // TODO: need an Author field in userpref if(strlen(U.author) > 0) { -- cgit v1.2.3 From 9fa74e5c59b2b1660ca1316c4c0e607faa522f18 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 11 Oct 2010 18:53:11 +0000 Subject: Fix #24215: Bad shorcut indication for Bezier curve handles. All existing handle type manipulation hotkeys replaced with unified V-menu where you could directoly set type you need. --- source/blender/editors/curve/curve_ops.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index 4558827c619..80582c7f1b0 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -194,6 +194,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf) keymap->poll= ED_operator_editsurfcurve; WM_keymap_add_menu(keymap, "INFO_MT_edit_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_menu(keymap, "INFO_MT_curve_handle_type_set", VKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "CURVE_OT_vertex_add", LEFTMOUSE, KM_CLICK, KM_CTRL, 0); WM_keymap_add_item(keymap, "CURVE_OT_select_all", AKEY, KM_PRESS, 0, 0); @@ -214,9 +215,6 @@ void ED_keymap_curve(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "CURVE_OT_tilt_clear", TKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TRANSFORM_OT_tilt", TKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_ALT, 0)->ptr, "mode", TFM_CURVE_SHRINKFATTEN); - RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", 1); - RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", HKEY, KM_PRESS, 0, 0)->ptr, "type", 3); - RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", VKEY, KM_PRESS, 0, 0)->ptr, "type", 2); WM_keymap_add_item(keymap, "CURVE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, KM_PRESS, KM_ALT|KM_CTRL, 0); -- cgit v1.2.3 From b0b7354d5ce3d57fac9ff5b263b860cb249b9b44 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 11 Oct 2010 20:53:20 +0000 Subject: [#23709] Blur node on Flat blurs even at 0 by 0 pixel spread skip blur x/y when either is set to zero. --- source/blender/nodes/intern/CMP_nodes/CMP_blur.c | 164 ++++++++++++----------- 1 file changed, 87 insertions(+), 77 deletions(-) (limited to 'source/blender') diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c index eb8b079f341..257b8354ea9 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c @@ -93,105 +93,115 @@ static void blur_single_image(bNode *node, CompBuf *new, CompBuf *img, float sca int x, y, pix= img->type; int i, bigstep; float *src, *dest; - + /* helper image */ work= alloc_compbuf(imgx, imgy, img->type, 1); /* allocs */ - - /* horizontal */ - rad = scale*(float)nbd->sizex; - if(rad>imgx/2) - rad= imgx/2; - else if(rad<1) - rad= 1; - gausstab= make_gausstab(nbd->filtertype, rad); - gausstabcent= gausstab+rad; - - for (y = 0; y < imgy; y++) { - float *srcd= img->rect + pix*(y*img->x); + /* horizontal */ + if(nbd->sizex == 0) { + memcpy(work->rect, img->rect, sizeof(float) * img->type * imgx * imgy); + } + else { + rad = scale*(float)nbd->sizex; + if(rad>imgx/2) + rad= imgx/2; + else if(rad<1) + rad= 1; - dest = work->rect + pix*(y * img->x); + gausstab= make_gausstab(nbd->filtertype, rad); + gausstabcent= gausstab+rad; - for (x = 0; x < imgx ; x++) { - int minr= x-rad<0?-x:-rad; - int maxr= x+rad>imgx?imgx-x:rad; + for (y = 0; y < imgy; y++) { + float *srcd= img->rect + pix*(y*img->x); - src= srcd + pix*(x+minr); + dest = work->rect + pix*(y * img->x); - sum= gval = rval= bval= aval= 0.0f; - for (i= minr; i < maxr; i++) { - val= gausstabcent[i]; - sum+= val; - rval += val * (*src++); + for (x = 0; x < imgx ; x++) { + int minr= x-rad<0?-x:-rad; + int maxr= x+rad>imgx?imgx-x:rad; + + src= srcd + pix*(x+minr); + + sum= gval = rval= bval= aval= 0.0f; + for (i= minr; i < maxr; i++) { + val= gausstabcent[i]; + sum+= val; + rval += val * (*src++); + if(pix==4) { + gval += val * (*src++); + bval += val * (*src++); + aval += val * (*src++); + } + } + sum= 1.0f/sum; + *dest++ = rval*sum; if(pix==4) { - gval += val * (*src++); - bval += val * (*src++); - aval += val * (*src++); + *dest++ = gval*sum; + *dest++ = bval*sum; + *dest++ = aval*sum; } } - sum= 1.0f/sum; - *dest++ = rval*sum; - if(pix==4) { - *dest++ = gval*sum; - *dest++ = bval*sum; - *dest++ = aval*sum; - } + if(node->exec & NODE_BREAK) + break; } - if(node->exec & NODE_BREAK) - break; + + /* vertical */ + MEM_freeN(gausstab); } - /* vertical */ - MEM_freeN(gausstab); - - rad = scale*(float)nbd->sizey; - if(rad>imgy/2) - rad= imgy/2; - else if(rad<1) - rad= 1; - - gausstab= make_gausstab(nbd->filtertype, rad); - gausstabcent= gausstab+rad; - - bigstep = pix*imgx; - for (x = 0; x < imgx; x++) { - float *srcd= work->rect + pix*x; - - dest = new->rect + pix*x; + if(nbd->sizey == 0) { + memcpy(new->rect, work->rect, sizeof(float) * img->type * imgx * imgy); + } + else { + rad = scale*(float)nbd->sizey; + if(rad>imgy/2) + rad= imgy/2; + else if(rad<1) + rad= 1; + + gausstab= make_gausstab(nbd->filtertype, rad); + gausstabcent= gausstab+rad; - for (y = 0; y < imgy ; y++) { - int minr= y-rad<0?-y:-rad; - int maxr= y+rad>imgy?imgy-y:rad; + bigstep = pix*imgx; + for (x = 0; x < imgx; x++) { + float *srcd= work->rect + pix*x; - src= srcd + bigstep*(y+minr); + dest = new->rect + pix*x; - sum= gval = rval= bval= aval= 0.0f; - for (i= minr; i < maxr; i++) { - val= gausstabcent[i]; - sum+= val; - rval += val * src[0]; + for (y = 0; y < imgy ; y++) { + int minr= y-rad<0?-y:-rad; + int maxr= y+rad>imgy?imgy-y:rad; + + src= srcd + bigstep*(y+minr); + + sum= gval = rval= bval= aval= 0.0f; + for (i= minr; i < maxr; i++) { + val= gausstabcent[i]; + sum+= val; + rval += val * src[0]; + if(pix==4) { + gval += val * src[1]; + bval += val * src[2]; + aval += val * src[3]; + } + src += bigstep; + } + sum= 1.0f/sum; + dest[0] = rval*sum; if(pix==4) { - gval += val * src[1]; - bval += val * src[2]; - aval += val * src[3]; + dest[1] = gval*sum; + dest[2] = bval*sum; + dest[3] = aval*sum; } - src += bigstep; - } - sum= 1.0f/sum; - dest[0] = rval*sum; - if(pix==4) { - dest[1] = gval*sum; - dest[2] = bval*sum; - dest[3] = aval*sum; + dest+= bigstep; } - dest+= bigstep; + if(node->exec & NODE_BREAK) + break; } - if(node->exec & NODE_BREAK) - break; + MEM_freeN(gausstab); } - + free_compbuf(work); - MEM_freeN(gausstab); } /* reference has to be mapped 0-1, and equal in size */ -- cgit v1.2.3 From 544b3178f92618f0b5f450cd18ef9195556acd9f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 11 Oct 2010 21:08:26 +0000 Subject: bugfix [#24225] Blur Node ignores gamma option when size has input. --- source/blender/nodes/intern/CMP_nodes/CMP_blur.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c index 257b8354ea9..894cc20e999 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c @@ -582,7 +582,11 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN nbd->sizey= (int)(nbd->percenty*nbd->image_in_height); } - if (((NodeBlurData *)node->storage)->filtertype == R_FILTER_FAST_GAUSS) { + if (nbd->sizex==0 && nbd->sizey==0) { + new= pass_on_compbuf(img); + out[0]->data= new; + } + else if (nbd->filtertype == R_FILTER_FAST_GAUSS) { CompBuf *new, *img = in[0]->data; /*from eeshlo's original patch, removed to fit in with the existing blur node */ /*const float sx = in[1]->vec[0], sy = in[2]->vec[0];*/ @@ -622,6 +626,7 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN /* if fac input, we do it different */ if(in[1]->data) { + CompBuf *gammabuf; /* make output size of input image */ new= alloc_compbuf(img->x, img->y, img->type, 1); /* allocs */ @@ -630,7 +635,18 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN new->xof = img->xof; new->yof = img->yof; - blur_with_reference(node, new, img, in[1]->data); + if(nbd->gamma) { + gammabuf= dupalloc_compbuf(img); + gamma_correct_compbuf(gammabuf, 0); + } + else gammabuf= img; + + blur_with_reference(node, new, gammabuf, in[1]->data); + + if(nbd->gamma) { + gamma_correct_compbuf(new, 1); + free_compbuf(gammabuf); + } if(node->exec & NODE_BREAK) { free_compbuf(new); new= NULL; @@ -643,7 +659,6 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN new= pass_on_compbuf(img); } else { - NodeBlurData *nbd= node->storage; CompBuf *gammabuf; /* make output size of input image */ -- cgit v1.2.3 From 6ebe7b8c5d7060e9ee33b0f30e84f6f62c8e8fef Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 11 Oct 2010 22:05:45 +0000 Subject: [#24226] small inconsistency in user preferences also made setting the temp dir more consistent, slash is always added on the end and if the user-pref dir is invalid its not used. --- source/blender/makesrna/intern/rna_userdef.c | 3 +-- source/blender/windowmanager/intern/wm_files.c | 3 +-- source/blender/windowmanager/intern/wm_operators.c | 12 ++++++------ 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 18620617c87..4196b3585b3 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -221,8 +221,7 @@ static void rna_userdef_addon_remove(bAddon *bext) static void rna_userdef_temp_update(Main *bmain, Scene *scene, PointerRNA *ptr) { extern char btempdir[]; - UserDef *userdef = (UserDef*)ptr->data; - strncpy(btempdir, userdef->tempdir, FILE_MAXDIR+FILE_MAXFILE); + BLI_where_is_temp(btempdir, 1); } #else diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 67decd6292e..0b8a4759bca 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -259,8 +259,7 @@ static void wm_init_userdef(bContext *C) /* set the python auto-execute setting from user prefs */ /* disabled by default, unless explicitly enabled in the command line */ if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC; - - if(U.tempdir[0]) strncpy(btempdir, U.tempdir, FILE_MAXDIR+FILE_MAXFILE); + if(U.tempdir[0]) BLI_where_is_temp(btempdir, 1); } void WM_read_file(bContext *C, char *name, ReportList *reports) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index f0962584801..3b342f440b3 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1998,10 +1998,10 @@ static int wm_exit_blender_op(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static void WM_OT_exit_blender(wmOperatorType *ot) +static void WM_OT_quit_blender(wmOperatorType *ot) { - ot->name= "Exit Blender"; - ot->idname= "WM_OT_exit_blender"; + ot->name= "Quit Blender"; + ot->idname= "WM_OT_quit_blender"; ot->description= "Quit Blender"; ot->invoke= WM_operator_confirm; @@ -3068,7 +3068,7 @@ void wm_operatortype_init(void) WM_operatortype_append(WM_OT_read_factory_settings); WM_operatortype_append(WM_OT_save_homefile); WM_operatortype_append(WM_OT_window_fullscreen_toggle); - WM_operatortype_append(WM_OT_exit_blender); + WM_operatortype_append(WM_OT_quit_blender); WM_operatortype_append(WM_OT_open_mainfile); WM_operatortype_append(WM_OT_link_append); WM_operatortype_append(WM_OT_recover_last_session); @@ -3270,7 +3270,7 @@ void wm_window_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_OSKEY, 0); WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_OSKEY, 0); WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0); - WM_keymap_add_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "WM_OT_quit_blender", QKEY, KM_PRESS, KM_OSKEY, 0); #endif WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0); @@ -3290,7 +3290,7 @@ void wm_window_keymap(wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "copy", 1); WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_ALT, 0); - WM_keymap_add_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "WM_OT_quit_blender", QKEY, KM_PRESS, KM_CTRL, 0); /* debug/testing */ WM_keymap_verify_item(keymap, "WM_OT_redraw_timer", TKEY, KM_PRESS, KM_ALT|KM_CTRL, 0); -- cgit v1.2.3 From 3a0e563feb08233217f937ac7040be66d062a73b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 Oct 2010 03:23:44 +0000 Subject: bugfix [#23191] Ctrl-LMB quick extrude problem with non-perpendicular edges/faces. also remove is_mat4_flipped() from transform_manipulator.c. --- source/blender/editors/mesh/editmesh_add.c | 11 ++++++++++- .../editors/transform/transform_manipulator.c | 22 ++++++---------------- 2 files changed, 16 insertions(+), 17 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 7dac8a465fa..90c5314bf3d 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -141,7 +141,16 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) done= 1; } } - if(done) normalize_v3(nor); + if(done) { + float view_vec[3], cross[3]; + + /* correct the normal to be aligned on the view plane */ + copy_v3_v3(view_vec, vc.rv3d->viewinv[2]); + mul_mat3_m4_v3(vc.obedit->imat, view_vec); + cross_v3_v3v3(cross, nor, view_vec); + cross_v3_v3v3(nor, view_vec, cross); + normalize_v3(nor); + } /* center */ add_v3_v3v3(cent, min, max); diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 51698c27b37..1d32f893b80 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -101,16 +101,6 @@ #define MAN_GHOST 1 #define MAN_MOVECOL 2 - -static int is_mat4_flipped(float mat[][4]) -{ - float vec[3]; - - cross_v3_v3v3(vec, mat[0], mat[1]); - if( dot_v3v3(vec, mat[2]) < 0.0 ) return 1; - return 0; -} - /* transform widget center calc helper for below */ static void calc_tw_center(Scene *scene, float *co) { @@ -753,7 +743,7 @@ static void preOrthoFront(int ortho, float twmat[][4], int axis) orthogonalize_m4(omat, axis); glPushMatrix(); glMultMatrixf(omat); - glFrontFace( is_mat4_flipped(omat)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(omat) ? GL_CW:GL_CCW); } } @@ -850,12 +840,12 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, // XXX mul_m4_m3m4(matt, t->mat, rv3d->twmat); if (ortho) { glMultMatrixf(matt); - glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(matt) ? GL_CW:GL_CCW); } } else { if (ortho) { - glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(rv3d->twmat) ? GL_CW:GL_CCW); glMultMatrixf(rv3d->twmat); } } @@ -1116,11 +1106,11 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, copy_m4_m4(matt, rv3d->twmat); // to copy the parts outside of [3][3] // XXX mul_m4_m3m4(matt, t->mat, rv3d->twmat); glMultMatrixf(matt); - glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(matt) ? GL_CW:GL_CCW); } else { glMultMatrixf(rv3d->twmat); - glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(rv3d->twmat) ? GL_CW:GL_CCW); } /* axis */ @@ -1327,7 +1317,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov glMultMatrixf(rv3d->twmat); } - glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(rv3d->twmat) ? GL_CW:GL_CCW); /* axis */ if( (G.f & G_PICKSEL)==0 ) { -- cgit v1.2.3 From 7ef6836be497a6d1fd24e50f37556f92432fc5fc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 Oct 2010 08:32:53 +0000 Subject: bugfix [#24144] Small problem with texture (r32316) an extra pixel was being drawn on a tiled image texture. --- source/blender/render/intern/source/imagetexture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index f78031c9030..5321d71194f 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -157,8 +157,8 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, TexResult *texre } } - x = (int)(fx*ibuf->x); - y = (int)(fy*ibuf->y); + x = (int)floorf(fx*ibuf->x); + y = (int)floorf(fy*ibuf->y); if(tex->extend == TEX_CLIPCUBE) { if(x<0 || y<0 || x>=ibuf->x || y>=ibuf->y || texvec[2]<-1.0 || texvec[2]>1.0) { -- cgit v1.2.3 From 4754d6a27d28eb0a244a49f147b588721fcecfbb Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Tue, 12 Oct 2010 10:30:29 +0000 Subject: Fix for [#24169] Sequencer segfaults often when scrubbing to frame zero --- source/blender/blenkernel/intern/sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 8c496fea3b0..040ca832a80 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1005,7 +1005,7 @@ static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Se } } - for (;b <= chanshown; b++) { + for (;b <= chanshown && b >= 0; b++) { if (video_seq_is_rendered(seq_arr[b])) { seq_arr_out[cnt++] = seq_arr[b]; } -- cgit v1.2.3 From b64098a85af30a1d5f74fbb876e939905a2cc44f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 Oct 2010 21:47:13 +0000 Subject: bugfix [#22407] Object level proxies ignore transform of original --- source/blender/blenkernel/intern/object.c | 35 ++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 541e8e2b00e..861904335d7 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1264,6 +1264,17 @@ static void copy_object_pose(Object *obn, Object *ob) } } +static void copy_object_transform(Object *ob_tar, Object *ob_src) +{ + copy_v3_v3(ob_tar->loc, ob_src->loc); + copy_v3_v3(ob_tar->rot, ob_src->rot); + copy_v3_v3(ob_tar->quat, ob_src->quat); + copy_v3_v3(ob_tar->rotAxis, ob_src->rotAxis); + ob_tar->rotAngle= ob_src->rotAngle; + ob_tar->rotmode= ob_src->rotmode; + copy_v3_v3(ob_tar->size, ob_src->size); +} + Object *copy_object(Object *ob) { Object *obn; @@ -1530,23 +1541,23 @@ void object_make_proxy(Object *ob, Object *target, Object *gob) ob->recalc= target->recalc= OB_RECALC_ALL; - /* copy transform */ + /* copy transform + * - gob means this proxy comes from a group, just apply the matrix + * so the object wont move from its dupli-transform. + * + * - no gob means this is being made from a linked object, + * this is closer to making a copy of the object - in-place. */ if(gob) { - VECCOPY(ob->loc, gob->loc); - VECCOPY(ob->rot, gob->rot); - VECCOPY(ob->size, gob->size); - - group_tag_recalc(gob->dup_group); + ob->rotmode= target->rotmode; + mul_m4_m4m4(ob->obmat, target->obmat, gob->obmat); + object_apply_mat4(ob, ob->obmat); } else { - VECCOPY(ob->loc, target->loc); - VECCOPY(ob->rot, target->rot); - VECCOPY(ob->size, target->size); + copy_object_transform(ob, target); + ob->parent= target->parent; /* libdata */ + copy_m4_m4(ob->parentinv, target->parentinv); } - ob->parent= target->parent; /* libdata */ - copy_m4_m4(ob->parentinv, target->parentinv); - /* copy animdata stuff - drivers only for now... */ object_copy_proxy_drivers(ob, target); -- cgit v1.2.3 From 5790deb4df1d492f6018d5082280cb0246e3d833 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 Oct 2010 22:20:10 +0000 Subject: bugfix [#23899] renderlayers are not working properly was missing button for single layer rendering. also renamed Object.show_shape_key to Object.show_only_shape_key since this pin's the shape key so others are disabled. --- source/blender/makesrna/intern/rna_object.c | 2 +- source/blender/makesrna/intern/rna_scene.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index e74bec566d5..c29ad0d9adf 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -2152,7 +2152,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures"); /* shape keys */ - prop= RNA_def_property(srna, "show_shape_key", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "show_only_shape_key", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK); RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object"); RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 1bcaf490c8d..2cccf96c518 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2837,6 +2837,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER); RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer"); + RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); /* engine */ -- cgit v1.2.3 From 4a385adbf339f585cc1802a1e5d277ff99438146 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 Oct 2010 23:47:43 +0000 Subject: python api: - bpy.app.debug can now be set, removed bpy.data.debug (since this is not blendfile data) - added bpy.app.tempdir, this is needed because the userpref temp dir isn't always set, $TEMP may be used instead and scripts need temp dir access. --- source/blender/makesrna/intern/rna_define.c | 3 +- source/blender/makesrna/intern/rna_main.c | 18 -------- source/blender/python/intern/bpy_app.c | 70 +++++++++++++++++++++++++---- source/blender/python/intern/bpy_rna.c | 2 +- 4 files changed, 64 insertions(+), 29 deletions(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 1fed1663952..0a8e0bad7f0 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -474,11 +474,12 @@ void RNA_struct_free(BlenderRNA *brna, StructRNA *srna) PropertyRNA *prop, *nextprop; PropertyRNA *parm, *nextparm; + /* if(srna->flag & STRUCT_RUNTIME) { if(RNA_struct_py_type_get(srna)) { fprintf(stderr, "RNA_struct_free '%s' freed while holding a python reference\n", srna->identifier); } - } + } */ for(prop=srna->cont.properties.first; prop; prop=nextprop) { nextprop= prop->next; diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 99758b8f0fe..e626abd85c7 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -36,19 +36,6 @@ #include "BKE_global.h" /* all the list begin functions are added manually here, Main is not in SDNA */ -static int rna_Main_debug_get(PointerRNA *ptr) -{ - return G.f & G_DEBUG; -} - - -static void rna_Main_debug_set(PointerRNA *ptr, const int value) -{ - if (value) - G.f |= G_DEBUG; - else - G.f &= ~G_DEBUG; -} static int rna_Main_is_dirty_get(PointerRNA *ptr) { @@ -317,11 +304,6 @@ void RNA_def_main(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_Main_is_dirty_get", NULL); RNA_def_property_ui_text(prop, "File is Saved", "Has the current session been saved to disk as a .blend file"); - prop= RNA_def_property(srna, "debug", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_Main_debug_get", "rna_Main_debug_set"); - RNA_def_property_ui_text(prop, "Debug", "Print debugging information in console"); - - for(i=0; lists[i].name; i++) { prop= RNA_def_property(srna, lists[i].identifier, PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 78658a611a3..f506f91292f 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -44,7 +44,6 @@ static PyStructSequence_Field app_info_fields[] = { {"version", "The Blender version as a tuple of 3 numbers. eg. (2, 50, 11)"}, {"version_string", "The Blender version formatted as a string"}, {"binary_path", "The location of blenders executable, useful for utilities that spawn new instances"}, - {"debug", "Boolean, set when blender is running in debug mode (started with -d)"}, {"background", "Boolean, True when blender is running without a user interface (started with -b)"}, /* buildinfo */ @@ -85,7 +84,6 @@ static PyObject *make_app_info(void) SetObjItem(Py_BuildValue("(iii)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION)); SetObjItem(PyUnicode_FromFormat("%d.%02d (sub %d)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION)); SetStrItem(bprogname); - SetObjItem(PyBool_FromLong(G.f & G_DEBUG)); SetObjItem(PyBool_FromLong(G.background)); /* build info */ @@ -96,11 +94,11 @@ static PyObject *make_app_info(void) SetStrItem(build_platform); SetStrItem(build_type); #else - SetStrItem("Unknown"); - SetStrItem("Unknown"); - SetStrItem("Unknown"); - SetStrItem("Unknown"); - SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); #endif #undef SetIntItem @@ -114,10 +112,60 @@ static PyObject *make_app_info(void) return app_info; } +/* a few getsets because it makes sense for them to be in bpy.app even though + * they are not static */ +static PyObject *bpy_app_debug_get(PyObject *self, void *closure) +{ + (void)(self); + (void)(closure); + + return PyBool_FromLong(G.f & G_DEBUG); +} + +static int bpy_app_debug_set(PyObject *self, PyObject *value, void *closure) +{ + int param= PyObject_IsTrue(value); + + (void)(self); + (void)(closure); + + if(param < 0) { + PyErr_SetString(PyExc_TypeError, "bpy.app.debug can only be True/False"); + return -1; + } + + if(param) G.f |= G_DEBUG; + else G.f &= ~G_DEBUG; + + return 0; +} + +static PyObject *bpy_app_tempdir_get(PyObject *self, void *closure) +{ + extern char btempdir[]; + (void)(self); + (void)(closure); + + return PyUnicode_FromString(btempdir); +} + +PyGetSetDef bpy_app_debug_getset= {"debug", bpy_app_debug_get, bpy_app_debug_set, "Boolean, set when blender is running in debug mode (started with -d)", NULL}; +PyGetSetDef bpy_app_tempdir_getset= {"tempdir", bpy_app_tempdir_get, NULL, "String, the temp directory used by blender (read-only)", NULL}; + +static void py_struct_seq_getset_init(void) +{ + /* tricky dynamic members, not to py-spec! */ + + PyDict_SetItemString(BlenderAppType.tp_dict, bpy_app_debug_getset.name, PyDescr_NewGetSet(&BlenderAppType, &bpy_app_debug_getset)); + PyDict_SetItemString(BlenderAppType.tp_dict, bpy_app_tempdir_getset.name, PyDescr_NewGetSet(&BlenderAppType, &bpy_app_tempdir_getset)); +} +/* end dynamic bpy.app */ + + PyObject *BPY_app_struct(void) { PyObject *ret; - + PyStructSequence_InitType(&BlenderAppType, &app_info_desc); ret= make_app_info(); @@ -125,6 +173,10 @@ PyObject *BPY_app_struct(void) /* prevent user from creating new instances */ BlenderAppType.tp_init = NULL; BlenderAppType.tp_new = NULL; - + + /* kindof a hack ontop of PyStructSequence */ + py_struct_seq_getset_init(); + return ret; } + diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 166213fa07c..b49a48699fa 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -964,7 +964,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *p else param = PyLong_AsLong( value ); - if( param < 0 || param > 1) { + if(param < 0) { PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected True/False or 0/1", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop)); return -1; } else { -- cgit v1.2.3 From 118e0426f109fb41fa5d9c982ffdce2661b1157a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 00:08:24 +0000 Subject: patch [#24221] Creating graph from armature doesn't work with unsaved .blend files (with fix). from Sergej Reich (sergof) Made some corrections to the patch as well as using bpy.app.tempdir with tempfile python module. --- source/blender/python/intern/bpy_app.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender') diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index f506f91292f..6a6b5277d9f 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -94,11 +94,11 @@ static PyObject *make_app_info(void) SetStrItem(build_platform); SetStrItem(build_type); #else - SetStrItem("Unknown"); - SetStrItem("Unknown"); - SetStrItem("Unknown"); - SetStrItem("Unknown"); - SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); #endif #undef SetIntItem -- cgit v1.2.3 From 9347dd04a30ea091df4cc5d54af5a84e83652afc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 01:10:56 +0000 Subject: bugfix [#24231] outliner not refreshed correctly also made world changes only redraw the 3d view if 'Render Only' option is set. --- .../editors/space_outliner/space_outliner.c | 1 + source/blender/editors/space_view3d/space_view3d.c | 33 ++++++++++++++++++---- source/blender/makesrna/intern/rna_scene.c | 2 +- source/blender/makesrna/intern/rna_world.c | 5 ++-- source/blender/windowmanager/WM_types.h | 1 + 5 files changed, 32 insertions(+), 10 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index f0f9ac945ef..5667ae51ee4 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -104,6 +104,7 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn) case ND_FRAME: case ND_RENDER_OPTIONS: case ND_LAYER: + case ND_WORLD: ED_region_tag_redraw(ar); break; } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 8a215834c38..629e0efe2ce 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -548,22 +548,36 @@ static void view3d_recalc_used_layers(ARegion *ar, wmNotifier *wmn, Scene *scene base= base->next; } - sa= win->screen->areabase.first; - while(sa) { - if(sa->spacetype == SPACE_VIEW3D) - if(BLI_findindex(&sa->regionbase, ar) >= 0) { + for(sa= win->screen->areabase.first; sa; sa= sa->next) { + if(sa->spacetype == SPACE_VIEW3D) { + if(BLI_findindex(&sa->regionbase, ar) != -1) { View3D *v3d= sa->spacedata.first; v3d->lay_used= lay_used; break; } + } + } +} - sa= sa->next; +static View3D *view3d_from_wmn(ARegion *ar, wmNotifier *wmn) +{ + wmWindow *win= wmn->wm->winactive; + ScrArea *sa; + + for(sa= win->screen->areabase.first; sa; sa= sa->next) { + if(sa->spacetype == SPACE_VIEW3D) + if(BLI_findindex(&sa->regionbase, ar) != -1) { + return (View3D *)sa->spacedata.first; + } } + + return NULL; } static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) { bScreen *sc; + View3D *v3d; /* context changes */ switch(wmn->category) { @@ -600,6 +614,11 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) case ND_MODE: ED_region_tag_redraw(ar); break; + case ND_WORLD: + v3d= view3d_from_wmn(ar, wmn); + if(v3d->flag2 & V3D_RENDER_OVERRIDE) + ED_region_tag_redraw(ar); + break; } if (wmn->action == NA_EDITED) ED_region_tag_redraw(ar); @@ -650,7 +669,9 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) case NC_WORLD: switch(wmn->data) { case ND_WORLD_DRAW: - ED_region_tag_redraw(ar); + v3d= view3d_from_wmn(ar, wmn); + if(v3d->flag2 & V3D_RENDER_OVERRIDE) + ED_region_tag_redraw(ar); break; } break; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 2cccf96c518..bc778ff3256 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -3094,7 +3094,7 @@ void RNA_def_scene(BlenderRNA *brna) prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "World", "World used for rendering the scene"); - RNA_def_property_update(prop, NC_SCENE|NC_WORLD, NULL); + RNA_def_property_update(prop, NC_SCENE|ND_WORLD, NULL); prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH); RNA_def_property_float_sdna(prop, NULL, "cursor"); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index ecf253acbce..726d64f26f4 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -478,9 +478,8 @@ void RNA_def_world(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon"); /* RNA_def_property_update(prop, 0, "rna_World_update"); */ - /* render-only uses this, the notifier could be made to be more spesific */ - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_World_update"); - + /* render-only uses this */ + RNA_def_property_update(prop, NC_WORLD|ND_WORLD_DRAW, "rna_World_update"); prop= RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 0447524255f..7af6de6c86c 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -191,6 +191,7 @@ typedef struct wmNotifier { #define ND_TOOLSETTINGS (15<<16) #define ND_LAYER (16<<16) #define ND_FRAME_RANGE (17<<16) +#define ND_WORLD (92<<16) #define ND_LAYER_CONTENT (101<<16) /* NC_OBJECT Object */ -- cgit v1.2.3 From 74dd22a228db0312049f0b23f1ce63a766202272 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 01:30:42 +0000 Subject: re-enable fix from r32330 but without the alt key check because this can be used for input. --- source/blender/editors/space_console/console_ops.c | 9 ++------- source/blender/editors/space_text/text_ops.c | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index a84a592279e..c36cbc38640 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -406,14 +406,9 @@ static int insert_invoke(bContext *C, wmOperator *op, wmEvent *event) // if(!RNA_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ if(!RNA_string_length(op->ptr, "text")) { char str[2] = {event->ascii, '\0'}; - - /* XXX NOTE: Reverting this change from r32330, since it - * breaks input for cases where modifierkey is needed to - * create characters. - */ /* if alt/ctrl/super are pressed pass through */ - //if(event->alt || event->ctrl || event->oskey) - // return OPERATOR_PASS_THROUGH; + if(event->ctrl || event->oskey) + return OPERATOR_PASS_THROUGH; RNA_string_set(op->ptr, "text", str); } diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index f6a4488966d..f8abe0f1900 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2322,14 +2322,9 @@ static int insert_invoke(bContext *C, wmOperator *op, wmEvent *event) // if(!RNA_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ if(!RNA_string_length(op->ptr, "text")) { char str[2] = {event->ascii, '\0'}; - - /* XXX NOTE: Reverting this change from r32330, since it - * breaks input for cases where modifierkey is needed to - * create characters. - */ /* if alt/ctrl/super are pressed pass through */ - //if(event->alt || event->ctrl || event->oskey) - // return OPERATOR_PASS_THROUGH; + if(event->ctrl || event->oskey) + return OPERATOR_PASS_THROUGH; RNA_string_set(op->ptr, "text", str); } -- cgit v1.2.3 From 3a0bb75bacde30b08599a6a754fc6c9763352b84 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 01:43:03 +0000 Subject: [#24128] Rigid Body Joint Constraint min/max limits [patch] from Dan Eicher (dna) --- source/blender/makesrna/intern/rna_constraint.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index e4726f5e92c..dee12d43144 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1242,10 +1242,16 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Axis Z", "Rotate pivot on Z axis in degrees"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - /* XXX not sure how to wrap the two 6 element arrays for the generic joint */ - //float minLimit[6]; - //float maxLimit[6]; - + prop= RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "minLimit"); + RNA_def_property_array(prop, 6); + RNA_def_property_ui_text(prop, "Minimum Limit", ""); + + prop= RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "maxLimit"); + RNA_def_property_array(prop, 6); + RNA_def_property_ui_text(prop, "Maximum Limit", ""); + prop= RNA_def_property(srna, "use_linked_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE_LINKED_COLLISION); RNA_def_property_ui_text(prop, "Disable Linked Collision", "Disable collision between linked bodies"); -- cgit v1.2.3 From cbbb636813071c4c4d856dc0ee93972754e8f0fd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 01:58:09 +0000 Subject: [#24171] Tab key no longer responds from UV / Image Editor --- source/blender/editors/mesh/mesh_ops.c | 2 +- source/blender/editors/space_image/space_image.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index fa055a385f3..51a4c67b19b 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -262,7 +262,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "inside", 1); - WM_keymap_add_item(keymap, "view3d.edit_mesh_extrude_move_normal", EKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_edit_mesh_extrude_move_normal", EKEY, KM_PRESS, 0, 0); /* python operator */ WM_keymap_add_item(keymap, "VIEW3D_OT_edit_mesh_extrude_individual_move", EKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_extrude", EKEY, KM_PRESS, KM_ALT, 0); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 66e27993532..a6deb73f2e7 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -485,6 +485,7 @@ void image_operatortypes(void) void image_keymap(struct wmKeyConfig *keyconf) { wmKeyMap *keymap= WM_keymap_find(keyconf, "Image Generic", SPACE_IMAGE, 0); + wmKeyMapItem *kmi; WM_keymap_add_item(keymap, "IMAGE_OT_new", NKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "IMAGE_OT_open", OKEY, KM_PRESS, KM_ALT, 0); @@ -524,6 +525,11 @@ void image_keymap(struct wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "IMAGE_OT_curves_point_set", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "point", 1); WM_keymap_add_item(keymap, "IMAGE_OT_toolbox", SPACEKEY, KM_PRESS, 0, 0); + + /* toggle editmode is handy to have while UV unwrapping */ + kmi= WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT); + RNA_boolean_set(kmi->ptr, "toggle", 1); } /* dropboxes */ -- cgit v1.2.3 From 7c538107ead563475845d635b1f0f18af246b4d5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 03:17:58 +0000 Subject: bugfix [#24030] Grease Pencil + Driver keys --- source/blender/editors/interface/interface_handlers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 654a089dafe..a64dcecb929 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4266,7 +4266,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) if(but->flag & UI_BUT_DISABLED) return WM_UI_HANDLER_CONTINUE; - if(data->state == BUTTON_STATE_HIGHLIGHT) { + if(data->state == BUTTON_STATE_HIGHLIGHT && event->prevval != KM_PRESS) { /* check prevval because of modal operators [#24016] */ /* handle copy-paste */ if(ELEM(event->type, CKEY, VKEY) && event->val==KM_PRESS && (event->ctrl || event->oskey)) { ui_but_copy_paste(C, but, data, (event->type == CKEY)? 'c': 'v'); -- cgit v1.2.3 From 554f4df542bd968d6384609a83bd5f6c840aceb3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 04:00:01 +0000 Subject: bugfix [#24210] Tiled textures can cause corruption of entire UI --- source/blender/editors/space_view3d/view3d_view.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender') diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 860f9f461c4..b49933cbb35 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1667,6 +1667,7 @@ static void RestoreState(bContext *C) win->queue= queue_back; GPU_state_init(); + GPU_set_tpage(NULL, 0); glPopAttrib(); } -- cgit v1.2.3 From 54ffc23cd59164180ea874b96ff9cd97753d6218 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 13 Oct 2010 06:06:39 +0000 Subject: Text space ========== Main changes: - lines could be partially shown when they starts somewhere behind the upper boundary of area but because of word-wrapping some part of line will be show - fixed caret navigatiog in area when tabs aren't replaced by spaces - highlight the whole current line not only it's wrapped segment with caret - when you're in replace mode cursor would be as long as the tab's width if it's under tab symbol This fixes: #22399: Text Editor: word-wrapped lines prevent navigating through text with up-arrow. #21163: Text editor scrollbar problem with word wrap --- source/blender/blenloader/intern/readfile.c | 3 + source/blender/editors/space_text/space_text.c | 12 +- source/blender/editors/space_text/text_draw.c | 629 ++++++++++++++++++++---- source/blender/editors/space_text/text_intern.h | 8 + source/blender/editors/space_text/text_ops.c | 536 +++++++++++++++----- source/blender/makesdna/DNA_space_types.h | 2 + 6 files changed, 960 insertions(+), 230 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0eb25a6b894..22641d51ed9 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4646,6 +4646,7 @@ static void lib_link_screen(FileData *fd, Main *main) SpaceText *st= (SpaceText *)sl; st->text= newlibadr(fd, sc->id.lib, st->text); + st->drawcache= NULL; } else if(sl->spacetype==SPACE_SCRIPT) { @@ -4877,6 +4878,8 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) st->text= restore_pointer_by_name(newmain, (ID *)st->text, 1); if(st->text==NULL) st->text= newmain->text.first; + + st->drawcache= NULL; } else if(sl->spacetype==SPACE_SCRIPT) { SpaceScript *scpt= (SpaceScript *)sl; diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 7f7a07f8cf7..5ee7ca3c3ef 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -92,6 +92,7 @@ static void text_free(SpaceLink *sl) SpaceText *stext= (SpaceText*) sl; stext->text= NULL; + text_free_caches(stext); } @@ -104,9 +105,11 @@ static void text_init(struct wmWindowManager *wm, ScrArea *sa) static SpaceLink *text_duplicate(SpaceLink *sl) { SpaceText *stextn= MEM_dupallocN(sl); - + /* clear or remove stuff from old */ - + + stextn->drawcache= NULL; /* space need it's own cache */ + return (SpaceLink *)stextn; } @@ -132,8 +135,11 @@ static void text_listener(ScrArea *sa, wmNotifier *wmn) switch(wmn->action) { case NA_EDITED: - if(st->text) + if(st->text) { + text_drawcache_tag_update(st, 1); text_update_edited(st->text); + } + ED_area_tag_redraw(sa); /* no break -- fall down to tag redraw */ case NA_ADDED: diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index be2d993dab5..c6036eb354b 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -10,7 +10,6 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -521,9 +520,22 @@ void wrap_offset(SpaceText *st, ARegion *ar, TextLine *linein, int cursin, int * linep= text->lines.first; i= st->top; while(i>0 && linep) { - if(linep == linein) return; /* Line before top */ - linep= linep->next; - i--; + int lines= text_get_visible_lines(st, ar, linep->line); + + /* Line before top */ + if(linep == linein) { + if(lines <= i) + /* no visible part of line */ + return; + } + + if (i-lines<0) { + break; + } else { + linep= linep->next; + (*offl)+= lines-1; + i-= lines; + } } max= wrap_width(st, ar); @@ -548,10 +560,18 @@ void wrap_offset(SpaceText *st, ARegion *ar, TextLine *linein, int cursin, int * while(chars--) { if(i-start>=max) { - if(chop && linep==linein && i >= cursin) + if(chop && linep==linein && i >= cursin) { + if (i==cursin) { + (*offl)++; + *offc -= end-start; + } + return; + } + (*offl)++; *offc -= end-start; + start= end; end += max; chop= 1; @@ -570,7 +590,66 @@ void wrap_offset(SpaceText *st, ARegion *ar, TextLine *linein, int cursin, int * } } -static int get_char_pos(SpaceText *st, char *line, int cur) +void wrap_offset_in_line(SpaceText *st, ARegion *ar, TextLine *linein, int cursin, int *offl, int *offc) +{ + int i, j, start, end, chars, max, chop; + char ch; + + *offl= *offc= 0; + + if(!st->text) return; + if(!st->wordwrap) return; + + max= wrap_width(st, ar); + + start= 0; + end= max; + chop= 1; + chars= 0; + *offc= 0; + + for(i=0, j=0; linein->line[j]!='\0'; j++) { + + /* Mimic replacement of tabs */ + ch= linein->line[j]; + if(ch=='\t') { + chars= st->tabnumber-i%st->tabnumber; + if(i=max) { + if(chop && i >= cursin) { + if (i==cursin) { + (*offl)++; + *offc -= end-start; + } + + return; + } + + (*offl)++; + *offc -= end-start; + + start= end; + end += max; + chop= 1; + } + else if(ch==' ' || ch=='-') { + end = i+1; + chop= 0; + if(i >= cursin) + return; + } + i++; + } + } +} + +int text_get_char_pos(SpaceText *st, char *line, int cur) { int a=0, i; @@ -583,7 +662,7 @@ static int get_char_pos(SpaceText *st, char *line, int cur) return a; } -static int text_draw_wrapped(SpaceText *st, char *str, int x, int y, int w, char *format) +static int text_draw_wrapped(SpaceText *st, char *str, int x, int y, int w, char *format, int skip) { FlattenString fs; int basex, i, a, len, start, end, max, lines; @@ -599,6 +678,14 @@ static int text_draw_wrapped(SpaceText *st, char *str, int x, int y, int w, char end= max; for(i=0; i= max) { + /* skip hidden part of line */ + if(skip) { + skip--; + start= end; + end += max; + continue; + } + /* Draw the visible portion of text on the overshot line */ for(a=start; ashowsyntax && format) format_draw_color(format[a]); @@ -609,6 +696,8 @@ static int text_draw_wrapped(SpaceText *st, char *str, int x, int y, int w, char lines++; start= end; end += max; + + if(y<=0) break; } else if(str[i]==' ' || str[i]=='-') { end = i+1; @@ -616,7 +705,7 @@ static int text_draw_wrapped(SpaceText *st, char *str, int x, int y, int w, char } /* Draw the remaining text */ - for(a=start; a 0; a++) { if(st->showsyntax && format) format_draw_color(format[a]); @@ -631,7 +720,7 @@ static int text_draw_wrapped(SpaceText *st, char *str, int x, int y, int w, char static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int draw, int x, int y, char *format) { FlattenString fs; - int r=0, w= 0; + int r=0, w= 0, amount; int *acc; char *in; @@ -647,18 +736,26 @@ static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int dra if(draw) { if(st->showsyntax && format) { - int amount, a; + int a; format = format+cshift; amount = strlen(in); + if(maxwidth) + amount= MIN2(amount, maxwidth); for(a = 0; a < amount; a++) { format_draw_color(format[a]); x += text_font_draw_character(st, x, y, in[a]); } } - else + else { + amount = strlen(in); + if(maxwidth) + amount= MIN2(amount, maxwidth); + + in[amount]= 0; text_font_draw(st, x, y, in); + } } else { while(w-- && *acc++ < maxwidth) @@ -675,18 +772,307 @@ static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int dra return r+TXT_OFFSET; } +/************************ cache utilities *****************************/ + +typedef struct DrawCache { + int *line_height; + int total_lines, nlines; + + /* this is needed to check cache relevance */ + int winx, wordwrap, showlinenrs, tabnumber; + short lheight; + char cwidth; + char text_id[MAX_ID_NAME]; + + /* for partial lines recalculation */ + short update_flag; + int valid_head, valid_tail; /* amount of unchanged lines */ +} DrawCache; + +static void text_drawcache_init(SpaceText *st) +{ + DrawCache *drawcache= MEM_callocN(sizeof (DrawCache), "text draw cache"); + + drawcache->winx= -1; + drawcache->nlines= BLI_countlist(&st->text->lines); + drawcache->text_id[0]= '\0'; + + st->drawcache= drawcache; +} + +static void text_update_drawcache(SpaceText *st, ARegion *ar) +{ + DrawCache *drawcache; + int full_update= 0, nlines= 0; + Text *txt= st->text; + + if(!st->drawcache) text_drawcache_init(st); + + text_update_character_width(st); + + drawcache= (DrawCache *)st->drawcache; + nlines= drawcache->nlines; + + /* check if full cache update is needed */ + full_update|= drawcache->winx != ar->winx; /* area was resized */ + full_update|= drawcache->wordwrap != st->wordwrap; /* word-wrapping option was toggled */ + full_update|= drawcache->showlinenrs != st->showlinenrs; /* word-wrapping option was toggled */ + full_update|= drawcache->tabnumber != st->tabnumber; /* word-wrapping option was toggled */ + full_update|= drawcache->lheight != st->lheight; /* word-wrapping option was toggled */ + full_update|= drawcache->cwidth != st->cwidth; /* word-wrapping option was toggled */ + full_update|= strncmp(drawcache->text_id, txt->id.name, MAX_ID_NAME); /* text datablock was changed */ + + if(st->wordwrap) { + /* update line heights */ + if(full_update || !drawcache->line_height) { + drawcache->valid_head = 0; + drawcache->valid_tail = 0; + drawcache->update_flag = 1; + } + + if(drawcache->update_flag) { + TextLine *line= st->text->lines.first; + int lineno= 0, size, lines_count; + int *fp= drawcache->line_height, *new_tail, *old_tail; + + nlines= BLI_countlist(&txt->lines); + size= sizeof(int)*nlines; + + if(fp) fp= MEM_reallocN(fp, size); + else fp= MEM_callocN(size, "text drawcache line_height"); + + drawcache->valid_tail= drawcache->valid_head= 0; + old_tail= fp + drawcache->nlines - drawcache->valid_tail; + new_tail= fp + nlines - drawcache->valid_tail; + memmove(new_tail, old_tail, drawcache->valid_tail); + + drawcache->total_lines= 0; + + if(st->showlinenrs) + st->linenrs_tot= (int)floor(log10((float)nlines)) + 1; + + while(line) { + if(drawcache->valid_head) { /* we're inside valid head lines */ + lines_count= fp[lineno]; + drawcache->valid_head--; + } else if (lineno > new_tail - fp) { /* we-re inside valid tail lines */ + lines_count= fp[lineno]; + } else { + lines_count= text_get_visible_lines(st, ar, line->line); + } + + fp[lineno]= lines_count; + + line= line->next; + lineno++; + drawcache->total_lines+= lines_count; + } + + drawcache->line_height= fp; + } + } else { + if(drawcache->line_height) { + MEM_freeN(drawcache->line_height); + drawcache->line_height= NULL; + } + + if(full_update || drawcache->update_flag) { + nlines= BLI_countlist(&txt->lines); + + if(st->showlinenrs) + st->linenrs_tot= (int)floor(log10((float)nlines)) + 1; + } + + drawcache->total_lines= nlines; + } + + drawcache->nlines= nlines; + + /* store settings */ + drawcache->winx = ar->winx; + drawcache->wordwrap = st->wordwrap; + drawcache->lheight = st->lheight; + drawcache->cwidth = st->cwidth; + drawcache->showlinenrs = st->showlinenrs; + drawcache->tabnumber = st->tabnumber; + + strncpy(drawcache->text_id, txt->id.name, MAX_ID_NAME); + + /* clear update flag */ + drawcache->update_flag = 0; + drawcache->valid_head = 0; + drawcache->valid_tail = 0; +} + +void text_drawcache_tag_update(SpaceText *st, int full) +{ + DrawCache *drawcache= (DrawCache *)st->drawcache; + + if(drawcache) { + Text *txt= st->text; + + if(drawcache->update_flag) { + /* happens when tagging update from space listener */ + /* should do nothing to prevent locally tagged cache be fully recalculated */ + return; + } + + if(!full) { + int sellno= BLI_findindex(&txt->lines, txt->sell); + int curlno= BLI_findindex(&txt->lines, txt->curl); + + if(curlno < sellno) { + drawcache->valid_head= curlno; + drawcache->valid_tail= drawcache->nlines - sellno - 1; + } else { + drawcache->valid_head= sellno; + drawcache->valid_tail= drawcache->nlines - curlno - 1; + } + + /* quick cache recalculation is also used in delete operator, + which could merge lines which are adjusent to current selection lines + expand recalculate area to this lines */ + if(drawcache->valid_head>0) drawcache->valid_head--; + if(drawcache->valid_tail>0) drawcache->valid_tail--; + } else { + drawcache->valid_head= 0; + drawcache->valid_tail= 0; + } + + drawcache->update_flag= 1; + } +} + +void text_free_caches(SpaceText *st) +{ + DrawCache *drawcache= (DrawCache *)st->drawcache; + + if(drawcache) { + if(drawcache->line_height) + MEM_freeN(drawcache->line_height); + + MEM_freeN(drawcache); + } +} + +/************************ word-wrap utilities *****************************/ + +/* cache should be updated in caller */ +int text_get_visible_lines_no(SpaceText *st, int lineno) +{ + DrawCache *drawcache= (DrawCache *)st->drawcache; + + return drawcache->line_height[lineno]; +} + +int text_get_visible_lines(SpaceText *st, ARegion *ar, char *str) +{ + int i, j, start, end, max, lines, chars; + char ch; + + max= wrap_width(st, ar); + lines= 1; + start= 0; + end= max; + for(i= 0, j= 0; str[j] != '\0'; j++) { + /* Mimic replacement of tabs */ + ch= str[j]; + if(ch=='\t') { + chars= st->tabnumber-i%st->tabnumber; + ch= ' '; + } + else chars= 1; + + while(chars--) { + if(i-start >= max) { + lines++; + start= end; + end += max; + } + else if(ch==' ' || ch=='-') { + end= i+1; + } + + i++; + } + } + + return lines; +} + +int text_get_span_wrap(SpaceText *st, ARegion *ar, TextLine *from, TextLine *to) +{ + if(st->wordwrap) { + int ret=0; + TextLine *tmp= from; + + /* Look forwards */ + while (tmp) { + if (tmp == to) return ret; + ret+= text_get_visible_lines(st, ar, tmp->line); + tmp= tmp->next; + } + + return ret; + } else return txt_get_span(from, to); +} + +int text_get_total_lines(SpaceText *st, ARegion *ar) +{ + DrawCache *drawcache; + + text_update_drawcache(st, ar); + drawcache= (DrawCache *)st->drawcache; + + return drawcache->total_lines; +} + +/* Move pointer to first visible line (top) */ +static TextLine *first_visible_line(SpaceText *st, ARegion *ar, int *wrap_top) +{ + Text *text= st->text; + TextLine* pline= text->lines.first; + int i= st->top, lineno= 0; + DrawCache *drawcache; + + text_update_drawcache(st, ar); + drawcache= (DrawCache *)st->drawcache; + + if(wrap_top) *wrap_top= 0; + + if(st->wordwrap) { + while(i>0 && pline) { + int lines= text_get_visible_lines_no(st, lineno); + + if (i-lines<0) { + if(wrap_top) *wrap_top= i; + break; + } else { + pline= pline->next; + i-= lines; + lineno++; + } + } + } else { + for(i=st->top, pline= text->lines.first; pline->next && i>0; i--) + pline= pline->next; + } + + return pline; +} + /************************ draw scrollbar *****************************/ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll) { - int lhlstart, lhlend, ltexth; + int lhlstart, lhlend, ltexth, sell_off, curl_off; short barheight, barstart, hlstart, hlend, blank_lines; short pix_available, pix_top_margin, pix_bottom_margin, pix_bardiff; pix_top_margin = 8; pix_bottom_margin = 4; pix_available = ar->winy - pix_top_margin - pix_bottom_margin; - ltexth= txt_get_span(st->text->lines.first, st->text->lines.last); + ltexth= text_get_total_lines(st, ar); blank_lines = st->viewlines / 2; /* nicer code: use scroll rect for entire bar */ @@ -722,10 +1108,10 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll) st->pix_per_line= (pix_available > 0)? (float) ltexth/pix_available: 0; if(st->pix_per_line<.1) st->pix_per_line=.1f; - lhlstart = MIN2(txt_get_span(st->text->lines.first, st->text->curl), - txt_get_span(st->text->lines.first, st->text->sell)); - lhlend = MAX2(txt_get_span(st->text->lines.first, st->text->curl), - txt_get_span(st->text->lines.first, st->text->sell)); + curl_off= text_get_span_wrap(st, ar, st->text->lines.first, st->text->curl); + sell_off= text_get_span_wrap(st, ar, st->text->lines.first, st->text->sell); + lhlstart = MIN2(curl_off, sell_off); + lhlend = MAX2(curl_off, sell_off); if(ltexth > 0) { hlstart = (lhlstart * pix_available)/ltexth; @@ -811,78 +1197,80 @@ static void draw_markers(SpaceText *st, ARegion *ar) { Text *text= st->text; TextMarker *marker, *next; - TextLine *top, *bottom, *line; - int offl, offc, i, cy, x1, x2, y1, y2, x, y; + TextLine *top, *line; + int offl, offc, i, x1, x2, y1, y2, x, y; + int topi, topy; + + /* Move pointer to first visible line (top) */ + top= first_visible_line(st, ar, NULL); + topi= BLI_findindex(&text->lines, top); - for(i=st->top, top= text->lines.first; top->next && i>0; i--) - top= top->next; + topy= txt_get_span(text->lines.first, top); - for(i=st->viewlines-1, bottom=top; bottom->next && i>0; i--) - bottom= bottom->next; - for(marker= text->markers.first; marker; marker= next) { next= marker->next; - for(cy= 0, line= top; line; cy++, line= line->next) { - if(cy+st->top==marker->lineno) { - /* Remove broken markers */ - if(marker->end>line->len || marker->start>marker->end) { - BLI_freelinkN(&text->markers, marker); - break; - } + /* invisible line (before top) */ + if(marker->linenostart, &offl, &offc); - x1= get_char_pos(st, line->line, marker->start) - st->left + offc; - y1= cy + offl; - wrap_offset(st, ar, line, marker->end, &offl, &offc); - x2= get_char_pos(st, line->line, marker->end) - st->left + offc; - y2= cy + offl; - - glColor3ub(marker->color[0], marker->color[1], marker->color[2]); - x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET; - y= ar->winy-3; - - if(y1==y2) { - y -= y1*st->lheight; - glBegin(GL_LINE_LOOP); - glVertex2i(x+x2*st->cwidth+1, y); - glVertex2i(x+x1*st->cwidth-2, y); - glVertex2i(x+x1*st->cwidth-2, y-st->lheight); - glVertex2i(x+x2*st->cwidth+1, y-st->lheight); - glEnd(); - } - else { - y -= y1*st->lheight; - glBegin(GL_LINE_STRIP); - glVertex2i(ar->winx, y); - glVertex2i(x+x1*st->cwidth-2, y); - glVertex2i(x+x1*st->cwidth-2, y-st->lheight); - glVertex2i(ar->winx, y-st->lheight); - glEnd(); - y-=st->lheight; - - for(i=y1+1; iwinx, y); - glVertex2i(x, y-st->lheight); - glVertex2i(ar->winx, y-st->lheight); - glEnd(); - y-=st->lheight; - } + line= BLI_findlink(&text->lines, marker->lineno); - glBegin(GL_LINE_STRIP); - glVertex2i(x, y); - glVertex2i(x+x2*st->cwidth+1, y); - glVertex2i(x+x2*st->cwidth+1, y-st->lheight); - glVertex2i(x, y-st->lheight); - glEnd(); - } + /* Remove broken markers */ + if(marker->end>line->len || marker->start>marker->end) { + BLI_freelinkN(&text->markers, marker); + continue; + } - break; + wrap_offset(st, ar, line, marker->start, &offl, &offc); + y1 = txt_get_span(top, line) - st->top + offl + topy; + x1 = text_get_char_pos(st, line->line, marker->start) - st->left + offc; + + wrap_offset(st, ar, line, marker->end, &offl, &offc); + y2 = txt_get_span(top, line) - st->top + offl + topy; + x2 = text_get_char_pos(st, line->line, marker->end) - st->left + offc; + + /* invisible part of line (before top, after last visible line) */ + if(y2 < 0 || y1 > st->top+st->viewlines) continue; + + glColor3ub(marker->color[0], marker->color[1], marker->color[2]); + x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET; + y= ar->winy-3; + + if(y1==y2) { + y -= y1*st->lheight; + glBegin(GL_LINE_LOOP); + glVertex2i(x+x2*st->cwidth+1, y); + glVertex2i(x+x1*st->cwidth-2, y); + glVertex2i(x+x1*st->cwidth-2, y-st->lheight); + glVertex2i(x+x2*st->cwidth+1, y-st->lheight); + glEnd(); + } + else { + y -= y1*st->lheight; + glBegin(GL_LINE_STRIP); + glVertex2i(ar->winx, y); + glVertex2i(x+x1*st->cwidth-2, y); + glVertex2i(x+x1*st->cwidth-2, y-st->lheight); + glVertex2i(ar->winx, y-st->lheight); + glEnd(); + y-=st->lheight; + + for(i=y1+1; iwinx, y); + glVertex2i(x, y-st->lheight); + glVertex2i(ar->winx, y-st->lheight); + glEnd(); + y-=st->lheight; } - if(line==bottom) break; + glBegin(GL_LINE_STRIP); + glVertex2i(x, y); + glVertex2i(x+x2*st->cwidth+1, y); + glVertex2i(x+x2*st->cwidth+1, y-st->lheight); + glVertex2i(x, y-st->lheight); + glEnd(); } } } @@ -1058,16 +1446,16 @@ static void draw_cursor(SpaceText *st, ARegion *ar) Text *text= st->text; int vcurl, vcurc, vsell, vselc, hidden=0; int offl, offc, x, y, w, i; - + /* Draw the selection */ if(text->curl!=text->sell || text->curc!=text->selc) { /* Convert all to view space character coordinates */ wrap_offset(st, ar, text->curl, text->curc, &offl, &offc); vcurl = txt_get_span(text->lines.first, text->curl) - st->top + offl; - vcurc = get_char_pos(st, text->curl->line, text->curc) - st->left + offc; + vcurc = text_get_char_pos(st, text->curl->line, text->curc) - st->left + offc; wrap_offset(st, ar, text->sell, text->selc, &offl, &offc); vsell = txt_get_span(text->lines.first, text->sell) - st->top + offl; - vselc = get_char_pos(st, text->sell->line, text->selc) - st->left + offc; + vselc = text_get_char_pos(st, text->sell->line, text->selc) - st->left + offc; if(vcurc<0) vcurc=0; if(vselc<0) vselc=0, hidden=1; @@ -1106,7 +1494,7 @@ static void draw_cursor(SpaceText *st, ARegion *ar) else { wrap_offset(st, ar, text->sell, text->selc, &offl, &offc); vsell = txt_get_span(text->lines.first, text->sell) - st->top + offl; - vselc = get_char_pos(st, text->sell->line, text->selc) - st->left + offc; + vselc = text_get_char_pos(st, text->sell->line, text->selc) - st->left + offc; if(vselc<0) { vselc= 0; @@ -1115,17 +1503,30 @@ static void draw_cursor(SpaceText *st, ARegion *ar) } if(st->line_hlight) { - y= ar->winy-2 - vsell*st->lheight; - if(!(y<0 || y > ar->winy)) { /* check we need to draw */ - int x1= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET; - int x2= x1 + ar->winx; - y= ar->winy-2 - vsell*st->lheight; - + int x1, x2, y1, y2; + + if(st->wordwrap) { + int visible_lines = text_get_visible_lines(st, ar, text->sell->line); + int offl, offc; + + wrap_offset_in_line(st, ar, text->sell, text->selc, &offl, &offc); + + y1= ar->winy-2 - (vsell-offl)*st->lheight; + y2= y1-st->lheight*visible_lines+1; + } else { + y1= ar->winy-2 - vsell*st->lheight; + y2= y1-st->lheight+1; + } + + if(!(y1<0 || y2 > ar->winy)) { /* check we need to draw */ + x1= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET; + x2= x1 + ar->winx; + glColor4ub(255, 255, 255, 32); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); - glRecti(x1-4, y, x2, y-st->lheight+1); + glRecti(x1-4, y1, x2, y2); glDisable(GL_BLEND); } } @@ -1138,8 +1539,10 @@ static void draw_cursor(SpaceText *st, ARegion *ar) if(st->overwrite) { char ch= text->sell->line[text->selc]; - if(!ch) ch= ' '; + w= st->cwidth; + if(ch=='\t') w*= st->tabnumber-(vselc+st->left)%st->tabnumber; + UI_ThemeColor(TH_HILITE); glRecti(x, y-st->lheight-1, x+w, y-st->lheight+1); } @@ -1243,7 +1646,7 @@ static void draw_brackets(SpaceText *st, ARegion *ar) /* draw opening bracket */ ch= startl->line[startc]; wrap_offset(st, ar, startl, startc, &offl, &offc); - viewc= get_char_pos(st, startl->line, startc) - st->left + offc; + viewc= text_get_char_pos(st, startl->line, startc) - st->left + offc; if(viewc >= 0){ viewl= txt_get_span(text->lines.first, startl) - st->top + offl; @@ -1255,7 +1658,7 @@ static void draw_brackets(SpaceText *st, ARegion *ar) /* draw closing bracket */ ch= endl->line[endc]; wrap_offset(st, ar, endl, endc, &offl, &offc); - viewc= get_char_pos(st, endl->line, endc) - st->left + offc; + viewc= text_get_char_pos(st, endl->line, endc) - st->left + offc; if(viewc >= 0) { viewl= txt_get_span(text->lines.first, endl) - st->top + offl; @@ -1273,12 +1676,15 @@ void draw_text_main(SpaceText *st, ARegion *ar) TextLine *tmp; rcti scroll; char linenr[12]; - int i, x, y, winx, linecount= 0; + int i, x, y, winx, linecount= 0, lineno= 0; + int wraplinecount= 0, wrap_skip= 0; /* if no text, nothing to do */ if(!text) return; + text_update_drawcache(st, ar); + /* make sure all the positional pointers exist */ if(!text->curl || !text->sell || !text->lines.first || !text->lines.last) txt_clean_text(text); @@ -1291,12 +1697,28 @@ void draw_text_main(SpaceText *st, ARegion *ar) /* update syntax formatting if needed */ tmp= text->lines.first; + lineno= 0; for(i= 0; itop && tmp; i++) { if(st->showsyntax && !tmp->format) txt_format_line(st, tmp, 0); - tmp= tmp->next; - linecount++; + if(st->wordwrap) { + int lines= text_get_visible_lines_no(st, lineno); + + if (wraplinecount+lines>st->top) { + wrap_skip= st->top-wraplinecount; + break; + } else { + wraplinecount+= lines; + tmp= tmp->next; + linecount++; + } + } else { + tmp= tmp->next; + linecount++; + } + + lineno++; } text_font_begin(st); @@ -1305,7 +1727,6 @@ void draw_text_main(SpaceText *st, ARegion *ar) /* draw line numbers background */ if(st->showlinenrs) { - st->linenrs_tot = (int)floor(log10((float)(linecount + st->viewlines))) + 1; x= TXT_OFFSET + TEXTXLOC; UI_ThemeColor(TH_GRID); @@ -1328,7 +1749,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) if(st->showsyntax && !tmp->format) txt_format_line(st, tmp, 0); - if(st->showlinenrs) { + if(st->showlinenrs && !wrap_skip) { /* draw line number */ if(tmp == text->curl) UI_ThemeColor(TH_HILITE); @@ -1344,14 +1765,16 @@ void draw_text_main(SpaceText *st, ARegion *ar) if(st->wordwrap) { /* draw word wrapped text */ - int lines = text_draw_wrapped(st, tmp->line, x, y, winx-x, tmp->format); + int lines = text_draw_wrapped(st, tmp->line, x, y, winx-x, tmp->format, wrap_skip); y -= lines*st->lheight; } else { /* draw unwrapped text */ - text_draw(st, tmp->line, st->left, 0, 1, x, y, tmp->format); + text_draw(st, tmp->line, st->left, ar->winx/st->cwidth, 1, x, y, tmp->format); y -= st->lheight; } + + wrap_skip= 0; } /* draw other stuff */ @@ -1398,6 +1821,12 @@ void text_update_cursor_moved(bContext *C) text_update_character_width(st); i= txt_get_span(text->lines.first, text->sell); + if(st->wordwrap) { + int offl, offc; + wrap_offset(st, CTX_wm_region(C), text->sell, text->selc, &offl, &offc); + i+= offl; + } + if(st->top+st->viewlines <= i || st->top > i) st->top= i - st->viewlines/2; diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index a93f30ac62a..81968221765 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -90,12 +90,20 @@ void flatten_string_free(FlattenString *fs); int wrap_width(struct SpaceText *st, struct ARegion *ar); void wrap_offset(struct SpaceText *st, struct ARegion *ar, struct TextLine *linein, int cursin, int *offl, int *offc); +void wrap_offset_in_line(struct SpaceText *st, struct ARegion *ar, struct TextLine *linep, int cursin, int *offl, int *offc); +int text_get_char_pos(struct SpaceText *st, char *line, int cur); + +void text_drawcache_tag_update(struct SpaceText *st, int full); +void text_free_caches(struct SpaceText *st); int text_file_modified(struct Text *text); int text_do_suggest_select(struct SpaceText *st, struct ARegion *ar); void text_pop_suggest_list(); +int text_get_visible_lines(struct SpaceText *st, struct ARegion *ar, char *str); +int text_get_span_wrap(struct SpaceText *st, struct ARegion *ar, struct TextLine *from, struct TextLine *to); +int text_get_total_lines(struct SpaceText *st, struct ARegion *ar); /* text_ops.c */ enum { LINE_BEGIN, LINE_END, FILE_TOP, FILE_BOTTOM, PREV_CHAR, NEXT_CHAR, diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index f8abe0f1900..8ff82ce8be0 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -173,6 +173,7 @@ static int new_exec(bContext *C, wmOperator *op) st->top= 0; } + text_drawcache_tag_update(st, 1); WM_event_add_notifier(C, NC_TEXT|NA_ADDED, text); return OPERATOR_FINISHED; @@ -254,6 +255,7 @@ static int open_exec(bContext *C, wmOperator *op) text->name = NULL; } + text_drawcache_tag_update(st, 1); WM_event_add_notifier(C, NC_TEXT|NA_ADDED, text); MEM_freeN(op->customdata); @@ -315,6 +317,7 @@ static int reload_exec(bContext *C, wmOperator *op) text_update_edited(text); text_update_cursor_moved(C); + text_drawcache_tag_update(CTX_wm_space_text(C), 1); WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); return OPERATOR_FINISHED; @@ -357,6 +360,8 @@ static int unlink_exec(bContext *C, wmOperator *op) unlink_text(bmain, text); free_libblock(&bmain->text, text); + + text_drawcache_tag_update(st, 1); WM_event_add_notifier(C, NC_TEXT|NA_REMOVED, NULL); return OPERATOR_FINISHED; @@ -738,6 +743,8 @@ static int paste_exec(bContext *C, wmOperator *op) if(!buf) return OPERATOR_CANCELLED; + text_drawcache_tag_update(CTX_wm_space_text(C), 0); + txt_insert_buf(text, buf); text_update_edited(text); @@ -809,6 +816,8 @@ static int cut_exec(bContext *C, wmOperator *op) { Text *text= CTX_data_edit_text(C); + text_drawcache_tag_update(CTX_wm_space_text(C), 0); + txt_copy_clipboard(text); txt_delete_selected(text); @@ -840,6 +849,8 @@ static int indent_exec(bContext *C, wmOperator *op) { Text *text= CTX_data_edit_text(C); + text_drawcache_tag_update(CTX_wm_space_text(C), 0); + if(txt_has_sel(text)) { txt_order_cursors(text); indent(text); @@ -874,6 +885,8 @@ static int unindent_exec(bContext *C, wmOperator *op) Text *text= CTX_data_edit_text(C); if(txt_has_sel(text)) { + text_drawcache_tag_update(CTX_wm_space_text(C), 0); + txt_order_cursors(text); unindent(text); @@ -909,6 +922,8 @@ static int line_break_exec(bContext *C, wmOperator *op) int a, curts; int space = (text->flags & TXT_TABSTOSPACES) ? st->tabnumber : 1; + text_drawcache_tag_update(st, 0); + // double check tabs/spaces before splitting the line curts= setcurr_tab_spaces(text, space); txt_split_curline(text); @@ -952,6 +967,8 @@ static int comment_exec(bContext *C, wmOperator *op) Text *text= CTX_data_edit_text(C); if(txt_has_sel(text)) { + text_drawcache_tag_update(CTX_wm_space_text(C), 0); + txt_order_cursors(text); comment(text); text_update_edited(text); @@ -983,6 +1000,8 @@ static int uncomment_exec(bContext *C, wmOperator *op) Text *text= CTX_data_edit_text(C); if(txt_has_sel(text)) { + text_drawcache_tag_update(CTX_wm_space_text(C), 0); + txt_order_cursors(text); uncomment(text); text_update_edited(text); @@ -1130,6 +1149,7 @@ static int convert_whitespace_exec(bContext *C, wmOperator *op) text_update_edited(text); text_update_cursor_moved(C); + text_drawcache_tag_update(st, 1); WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); return OPERATOR_FINISHED; @@ -1317,146 +1337,360 @@ static EnumPropertyItem move_type_items[]= { {NEXT_PAGE, "NEXT_PAGE", 0, "Next Page", ""}, {0, NULL, 0, NULL, NULL}}; +/* get cursor position in line by relative wrapped line and column positions */ +static int text_get_cursor_rel(SpaceText* st, ARegion *ar, TextLine *linein, int rell, int relc) +{ + int i, j, start, end, chars, max, chop, curs, loop, endj, found, selc; + char ch; + + max= wrap_width(st, ar); + + selc= start= chars= endj= curs= found= 0; + end= max; + chop= loop= 1; + + for(i=0, j=0; loop; j++) { + /* Mimic replacement of tabs */ + ch= linein->line[j]; + if(ch=='\t') { + chars= st->tabnumber-i%st->tabnumber; + ch= ' '; + } + else chars= 1; + + while(chars--) { + if(rell==0 && i-start==relc) { + /* current position could be wrapped to next line */ + /* this should be checked when end of current line would be reached */ + selc= j; + found= 1; + } + else if(i-end==relc) { + curs= j; + } + if(i-start>=max) { + if(found) { + /* exact cursor position was found, check if it's */ + /* still on needed line (hasn't been wrapped) */ + if(selc>endj && !chop) selc= endj; + loop= 0; + break; + } + + if(chop) endj= j; + + start= end; + end += max; + chop= 1; + rell--; + + if(rell==0 && i-start>=relc) { + selc= curs; + loop= 0; + break; + } + } + else if (ch=='\0') { + if(!found) selc= linein->len; + loop= 0; + break; + } + else if(ch==' ' || ch=='-') { + if(found) { + loop= 0; + break; + } + + if(rell==0 && i-start>=relc) { + selc= curs; + loop= 0; + break; + } + end= i+1; + endj= j; + chop= 0; + } + i++; + } + } + + return selc; +} + +static int cursor_skip_find_line(SpaceText* st, ARegion *ar, Text *text, + int lines, TextLine **linep, int *charp, int *rell, int *relc) +{ + int offl, offc, visible_lines; + + wrap_offset_in_line(st, ar, *linep, *charp, &offl, &offc); + *relc= text_get_char_pos(st, (*linep)->line, *charp) + offc; + *rell= lines; + + /* handle current line */ + if(lines>0) { + visible_lines= text_get_visible_lines(st, ar, (*linep)->line); + + if(*rell-visible_lines+offl>=0) { + if(!(*linep)->next) { + if(offl < visible_lines-1) { + *rell= visible_lines-1; + return 1; + } + + *charp= (*linep)->len; + return 0; + } + + *rell-= visible_lines-offl; + *linep=(*linep)->next; + } else { + *rell+= offl; + return 1; + } + } else { + if(*rell+offl<=0) { + if(!(*linep)->prev) { + if(offl) { + *rell= 0; + return 1; + } + + *charp= 0; + return 0; + } + + *rell+= offl; + *linep=(*linep)->prev; + } else { + *rell+= offl; + return 1; + } + } + + /* skip lines and find destination line and offsets */ + while(*linep) { + visible_lines= text_get_visible_lines(st, ar, (*linep)->line); + + if(lines<0) { /* moving top */ + if(*rell+visible_lines >= 0) { + *rell+= visible_lines; + break; + } + + if(!(*linep)->prev) { + *rell= 0; + break; + } + + *rell+= visible_lines; + *linep=(*linep)->prev; + } else { /* moving bottom */ + if(*rell-visible_lines < 0) break; + + if(!(*linep)->next) { + *rell= visible_lines-1; + break; + } + + *rell-= visible_lines; + *linep=(*linep)->next; + } + } + + return 1; +} + static void wrap_move_bol(SpaceText *st, ARegion *ar, short sel) { Text *text= st->text; - int offl, offc, lin; + TextLine **linep; + int *charp; + int oldl, oldc, i, j, max, start, end, chars, endj, chop, loop; + char ch; text_update_character_width(st); - lin= txt_get_span(text->lines.first, text->sell); - wrap_offset(st, ar, text->sell, text->selc, &offl, &offc); + if (sel) linep= &text->sell, charp= &text->selc; + else linep= &text->curl, charp= &text->curc; - if (sel) { - txt_undo_add_toop(text, UNDO_STO, lin, text->selc, lin, -offc); - text->selc= -offc; - } else { - txt_undo_add_toop(text, UNDO_CTO, lin, text->curc, lin, -offc); - text->curc= -offc; - txt_pop_sel(text); + oldc= *charp; + oldl= txt_get_span(text->lines.first, *linep); + + max= wrap_width(st, ar); + + start= chars= endj= 0; + end= max; + chop= loop= 1; + *charp= 0; + + for(i=0, j=0; loop; j++) { + /* Mimic replacement of tabs */ + ch= (*linep)->line[j]; + if(ch=='\t') { + chars= st->tabnumber-i%st->tabnumber; + ch= ' '; + } + else chars= 1; + + while(chars--) { + if(i-start>=max) { + *charp= endj; + + if(j>=oldc) { + loop= 0; + break; + } + + if(chop) endj= j; + + start= end; + end += max; + chop= 0; + } + else if(ch==' ' || ch=='-' || ch=='\0') { + if(j>=oldc) { + loop= 0; + break; + } + + end= i+1; + endj= j+1; + chop= 0; + } + i++; + } } + + if (!sel) txt_pop_sel(text); + txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, oldl, *charp); } static void wrap_move_eol(SpaceText *st, ARegion *ar, short sel) { Text *text= st->text; - int offl, offc, lin, startl, c; + TextLine **linep; + int *charp; + int oldl, oldc, i, j, max, start, end, chars, endj, chop, loop; + char ch; text_update_character_width(st); - lin= txt_get_span(text->lines.first, text->sell); - wrap_offset(st, ar, text->sell, text->selc, &offl, &offc); - startl= offl; - c= text->selc; - while (offl==startl && text->sell->line[c]!='\0') { - c++; - wrap_offset(st, ar, text->sell, c, &offl, &offc); - } if (offl!=startl) c--; - - if (sel) { - txt_undo_add_toop(text, UNDO_STO, lin, text->selc, lin, c); - text->selc= c; - } else { - txt_undo_add_toop(text, UNDO_CTO, lin, text->curc, lin, c); - text->curc= c; - txt_pop_sel(text); + if (sel) linep= &text->sell, charp= &text->selc; + else linep= &text->curl, charp= &text->curc; + + oldc= *charp; + oldl= txt_get_span(text->lines.first, *linep); + + max= wrap_width(st, ar); + + start= chars= endj= 0; + end= max; + chop= loop= 1; + *charp= 0; + + for(i=0, j=0; loop; j++) { + /* Mimic replacement of tabs */ + ch= (*linep)->line[j]; + if(ch=='\t') { + chars= st->tabnumber-i%st->tabnumber; + ch= ' '; + } + else chars= 1; + + while(chars--) { + if(i-start>=max) { + if(endj>=oldc) { + *charp= endj; + loop= 0; + break; + } + + if(chop) endj= j; + + start= end; + end += max; + chop= 0; + } else if(ch=='\0') { + *charp= (*linep)->len; + loop= 0; + break; + } else if(ch==' ' || ch=='-') { + end= i+1; + endj= j; + chop= 0; + } + i++; + } } + + if (!sel) txt_pop_sel(text); + txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, oldl, *charp); } static void wrap_move_up(SpaceText *st, ARegion *ar, short sel) { Text *text= st->text; - int offl, offl_1, offc, fromline, toline, c, target; + TextLine **linep; + int *charp; + int oldl, oldc, offl, offc, col, newl; text_update_character_width(st); - wrap_offset(st, ar, text->sell, 0, &offl_1, &offc); - wrap_offset(st, ar, text->sell, text->selc, &offl, &offc); - fromline= toline= txt_get_span(text->lines.first, text->sell); - target= text->selc + offc; + if (sel) linep= &text->sell, charp= &text->selc; + else linep= &text->curl, charp= &text->curc; - if (offl==offl_1) { - if (!text->sell->prev) { - txt_move_bol(text, sel); - return; - } - toline--; - c= text->sell->prev->len; /* End of prev. line */ - wrap_offset(st, ar, text->sell->prev, c, &offl, &offc); - c= -offc+target; + /* store previous position */ + oldc= *charp; + newl= oldl= txt_get_span(text->lines.first, *linep); + + wrap_offset_in_line(st, ar, *linep, *charp, &offl, &offc); + col= text_get_char_pos(st, (*linep)->line, *charp) + offc; + if(offl) { + *charp= text_get_cursor_rel(st, ar, *linep, offl-1, col); } else { - c= -offc-1; /* End of prev. line */ - wrap_offset(st, ar, text->sell, c, &offl, &offc); - c= -offc+target; - } - if (c<0) c=0; - - if (sel) { - txt_undo_add_toop(text, UNDO_STO, fromline, text->selc, toline, c); - if (tolinesell= text->sell->prev; - if(text->sell) { - if (c>text->sell->len) c= text->sell->len; - text->selc= c; - } - } - else if(text->curl) { - txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c); - if (tolinecurl= text->curl->prev; - if(text->curl) { - if (c>text->curl->len) c= text->curl->len; - text->curc= c; - txt_pop_sel(text); - } + if((*linep)->prev) { + int visible_lines; + + *linep= (*linep)->prev; + visible_lines= text_get_visible_lines(st, ar, (*linep)->line); + *charp= text_get_cursor_rel(st, ar, *linep, visible_lines-1, col); + } else *charp= 0; } + + if (!sel) txt_pop_sel(text); + txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, newl, *charp); } static void wrap_move_down(SpaceText *st, ARegion *ar, short sel) { Text *text= st->text; - int offl, startoff, offc, fromline, toline, c, target; + TextLine **linep; + int *charp; + int oldl, oldc, offl, offc, col, newl, visible_lines; text_update_character_width(st); - wrap_offset(st, ar, text->sell, text->selc, &offl, &offc); - fromline= toline= txt_get_span(text->lines.first, text->sell); - target= text->selc + offc; - startoff= offl; - c= text->selc; - while (offl==startoff && text->sell->line[c]!='\0') { - c++; - wrap_offset(st, ar, text->sell, c, &offl, &offc); - } + if (sel) linep= &text->sell, charp= &text->selc; + else linep= &text->curl, charp= &text->curc; - if (text->sell->line[c]=='\0') { - if (!text->sell->next) { - txt_move_eol(text, sel); - return; - } - toline++; - c= target; + /* store previous position */ + oldc= *charp; + newl= oldl= txt_get_span(text->lines.first, *linep); + + wrap_offset_in_line(st, ar, *linep, *charp, &offl, &offc); + col= text_get_char_pos(st, (*linep)->line, *charp) + offc; + visible_lines= text_get_visible_lines(st, ar, (*linep)->line); + if(offl text->sell->len) c= text->sell->len; - } - if (c<0) c=0; - - if (sel) { - txt_undo_add_toop(text, UNDO_STO, fromline, text->selc, toline, c); - if (toline>fromline) text->sell= text->sell->next; - if(text->sell) { - if (c>text->sell->len) c= text->sell->len; - text->selc= c; - } - } - else if(text->curl) { - txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c); - if (toline>fromline) text->curl= text->curl->next; - if(text->curl) { - if (c > text->curl->len) c= text->curl->len; - text->curc= c; - txt_pop_sel(text); - } + if((*linep)->next) { + *linep= (*linep)->next; + *charp= text_get_cursor_rel(st, ar, *linep, 0, col); + } else *charp= (*linep)->len; } + + if (!sel) txt_pop_sel(text); + txt_undo_add_toop(text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, newl, *charp); } /* Moves the cursor vertically by the specified number of lines. @@ -1465,7 +1699,7 @@ static void wrap_move_down(SpaceText *st, ARegion *ar, short sel) This is to replace screen_skip for PageUp/Down operations. */ -static void cursor_skip(Text *text, int lines, int sel) +static void cursor_skip(SpaceText* st, ARegion *ar, Text *text, int lines, int sel) { TextLine **linep; int oldl, oldc, *charp; @@ -1475,13 +1709,21 @@ static void cursor_skip(Text *text, int lines, int sel) oldl= txt_get_span(text->lines.first, *linep); oldc= *charp; - while (lines>0 && (*linep)->next) { - *linep= (*linep)->next; - lines--; - } - while (lines<0 && (*linep)->prev) { - *linep= (*linep)->prev; - lines++; + if(st && ar && st->wordwrap) { + int rell, relc; + + /* find line and offsets inside it needed to set cursor position */ + if(cursor_skip_find_line(st, ar, text, lines, linep, charp, &rell, &relc)) + *charp= text_get_cursor_rel (st, ar, *linep, rell, relc); + } else { + while (lines>0 && (*linep)->next) { + *linep= (*linep)->next; + lines--; + } + while (lines<0 && (*linep)->prev) { + *linep= (*linep)->prev; + lines++; + } } if (*charp > (*linep)->len) *charp= (*linep)->len; @@ -1546,18 +1788,18 @@ static int move_cursor(bContext *C, int type, int select) break; case PREV_PAGE: - if(st) cursor_skip(text, -st->viewlines, select); - else cursor_skip(text, -10, select); + if(st) cursor_skip(st, ar, st->text, -st->viewlines, select); + else cursor_skip(NULL, NULL, text, -10, select); break; case NEXT_PAGE: - if(st) cursor_skip(text, st->viewlines, select); - else cursor_skip(text, 10, select); + if(st) cursor_skip(st, ar, st->text, st->viewlines, select); + else cursor_skip(NULL, NULL, text, 10, select); break; } text_update_cursor_moved(C); - WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); + WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text); return OPERATOR_FINISHED; } @@ -1665,6 +1907,8 @@ static int delete_exec(bContext *C, wmOperator *op) Text *text= CTX_data_edit_text(C); int type= RNA_enum_get(op->ptr, "type"); + text_drawcache_tag_update(CTX_wm_space_text(C), 0); + if(type == DEL_PREV_WORD) txt_backspace_word(text); else if(type == DEL_PREV_CHAR) @@ -1729,13 +1973,13 @@ void TEXT_OT_overwrite_toggle(wmOperatorType *ot) /******************* scroll operator **********************/ /* Moves the view vertically by the specified number of lines */ -static void screen_skip(SpaceText *st, int lines) +static void screen_skip(SpaceText *st, ARegion *ar, int lines) { int last; - st->top += lines; + st->top += lines; - last= txt_get_span(st->text->lines.first, st->text->lines.last); + last= text_get_total_lines(st, ar); last= last - (st->viewlines/2); if(st->top>last) st->top= last; @@ -1756,12 +2000,14 @@ typedef struct TextScroll { static int scroll_exec(bContext *C, wmOperator *op) { SpaceText *st= CTX_wm_space_text(C); + ARegion *ar= CTX_wm_region(C); + int lines= RNA_int_get(op->ptr, "lines"); if(lines == 0) return OPERATOR_CANCELLED; - screen_skip(st, lines*U.wheellinescroll); + screen_skip(st, ar, lines*U.wheellinescroll); ED_area_tag_redraw(CTX_wm_area(C)); @@ -1771,6 +2017,7 @@ static int scroll_exec(bContext *C, wmOperator *op) static void scroll_apply(bContext *C, wmOperator *op, wmEvent *event) { SpaceText *st= CTX_wm_space_text(C); + ARegion *ar= CTX_wm_region(C); TextScroll *tsc= op->customdata; short *mval= event->mval; @@ -1792,7 +2039,7 @@ static void scroll_apply(bContext *C, wmOperator *op, wmEvent *event) tsc->delta[1]= (tsc->hold[1]-mval[1])*st->pix_per_line; if(tsc->delta[0] || tsc->delta[1]) { - screen_skip(st, tsc->delta[1]); + screen_skip(st, ar, tsc->delta[1]); tsc->lines += tsc->delta[1]; @@ -1969,7 +2216,7 @@ static void set_cursor_to_pos(SpaceText *st, ARegion *ar, int x, int y, int sel) Text *text= st->text; TextLine **linep; int *charp; - int w; + int w, tabs; text_update_character_width(st); @@ -1987,16 +2234,28 @@ static void set_cursor_to_pos(SpaceText *st, ARegion *ar, int x, int y, int sel) x = (x/st->cwidth) + st->left; if(st->wordwrap) { - int i, j, endj, curs, max, chop, start, end, chars, loop; + int i, j, endj, curs, max, chop, start, end, chars, loop, found; char ch; /* Point to first visible line */ *linep= text->lines.first; - for(i=0; itop && (*linep)->next; i++) *linep= (*linep)->next; + i= st->top; + while(i>0 && *linep) { + int lines= text_get_visible_lines(st, ar, (*linep)->line); + + if (i-lines<0) { + y+= i; + break; + } else { + *linep= (*linep)->next; + i-= lines; + } + } max= wrap_width(st, ar); loop= 1; + found= 0; while(loop && *linep) { start= 0; end= max; @@ -2004,12 +2263,14 @@ static void set_cursor_to_pos(SpaceText *st, ARegion *ar, int x, int y, int sel) chars= 0; curs= 0; endj= 0; + tabs= 0; for(i=0, j=0; loop; j++) { /* Mimic replacement of tabs */ ch= (*linep)->line[j]; if(ch=='\t') { chars= st->tabnumber-i%st->tabnumber; + tabs+= chars-1; ch= ' '; } else @@ -2021,22 +2282,34 @@ static void set_cursor_to_pos(SpaceText *st, ARegion *ar, int x, int y, int sel) *charp= endj; loop= 0; break; - /* Exactly at the cursor, done */ + /* Exactly at the cursor */ } else if(y==0 && i-start==x) { + /* current position could be wrapped to next line */ + /* this should be checked when end of current line would be reached */ *charp= curs= j; - loop= 0; - break; + found= 1; /* Prepare curs for next wrap */ } else if(i-end==x) { curs= j; } if(i-start>=max) { + if(found) { + /* exact cursor position was found, check if it's */ + /* still on needed line (hasn't been wrapped) */ + if(*charp>endj && !chop) (*charp)= endj; + loop= 0; + break; + } + if(chop) endj= j; - y--; start= end; end += max; + + if(start-tabs<(*linep)->len) + y--; + chop= 1; if(y==0 && i-start>=x) { *charp= curs; @@ -2045,6 +2318,11 @@ static void set_cursor_to_pos(SpaceText *st, ARegion *ar, int x, int y, int sel) } } else if(ch==' ' || ch=='-' || ch=='\0') { + if(found) { + loop= 0; + break; + } + if(y==0 && i-start>=x) { *charp= curs; loop= 0; @@ -2102,7 +2380,7 @@ static void set_cursor_apply(bContext *C, wmOperator *op, wmEvent *event) if(event->mval[1]<0 || event->mval[1]>ar->winy) { int d= (scu->old[1]-event->mval[1])*st->pix_per_line; - if(d) screen_skip(st, d); + if(d) screen_skip(st, ar, d); set_cursor_to_pos(st, ar, event->mval[0], event->mval[1]<0?0:ar->winy, 1); @@ -2290,6 +2568,8 @@ static int insert_exec(bContext *C, wmOperator *op) char *str; int done = 0, i; + text_drawcache_tag_update(st, 0); + str= RNA_string_get_alloc(op->ptr, "text", NULL, 0); if(st && st->overwrite) { @@ -2396,6 +2676,7 @@ static int find_and_replace(bContext *C, wmOperator *op, short mode) } text_update_cursor_moved(C); WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); + text_drawcache_tag_update(CTX_wm_space_text(C), 1); } else if(mode==TEXT_MARK_ALL) { char color[4]; @@ -2741,6 +3022,7 @@ void ED_text_undo_step(bContext *C, int step) text_update_edited(text); text_update_cursor_moved(C); + text_drawcache_tag_update(CTX_wm_space_text(C), 1); WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); } diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index ce038ee4a95..0e2eea0b942 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -318,6 +318,8 @@ typedef struct SpaceText { char findstr[256]; /* ST_MAX_FIND_STR */ char replacestr[256]; /* ST_MAX_FIND_STR */ + + void *drawcache; /* cache for faster drawing */ } SpaceText; typedef struct Script { -- cgit v1.2.3 From d058a9c8c3d5481fa0c82c8118d207fda6b56830 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 07:43:39 +0000 Subject: bugfix [#23150] Creating Vertex with CTRL-LMB not snapping - Added EM_project_snap_verts so other functions can re-use this, similar to old retopo_do_all(). - Changed how the normal for selected geometry is calculated, was accumulating half selected edge's into normals which was OK with even surrounding geometry but could skew too easily if the surroundings were not so even. Now use the 2D screen space selected edge vector to calculate the normals in relation to the target mouse position. - Option to rotate initial selection, gives better results in some cases. (Ctrl+Shift+Click to disable) http://wiki.blender.org/index.php/File:ClickExtrudeFix.png --- source/blender/editors/include/ED_mesh.h | 2 + source/blender/editors/mesh/editmesh_add.c | 76 ++++++++++++++++++++++++------ source/blender/editors/mesh/editmesh_lib.c | 16 +++++++ source/blender/editors/mesh/mesh_ops.c | 3 +- 4 files changed, 81 insertions(+), 16 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index c4477ee5a8e..313df32fd6f 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -159,6 +159,8 @@ void EM_solidify(struct EditMesh *em, float dist); int EM_deselect_nth(struct EditMesh *em, int nth); +void EM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct Object *obedit, struct EditMesh *em); + /* editmesh_mods.c */ extern unsigned int em_vertoffs, em_solidoffs, em_wireoffs; diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 90c5314bf3d..5850dc706b0 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -110,17 +110,20 @@ static short icoface[20][3] = { static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) { ViewContext vc; - EditVert *eve, *v1; + EditVert *eve; float min[3], max[3]; int done= 0; + int rot_src= RNA_boolean_get(op->ptr, "rotate_source"); em_setup_viewcontext(C, &vc); + invert_m4_m4(vc.obedit->imat, vc.obedit->obmat); + INIT_MINMAX(min, max); - for(v1= vc.em->verts.first;v1; v1=v1->next) { - if(v1->f & SELECT) { - DO_MINMAX(v1->co, min, max); + for(eve= vc.em->verts.first; eve; eve= eve->next) { + if(eve->f & SELECT) { + DO_MINMAX(eve->co, min, max); done= 1; } } @@ -131,25 +134,56 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) float vec[3], cent[3], mat[3][3]; float nor[3]= {0.0, 0.0, 0.0}; - /* check for edges that are half selected, use for rotation */ + /* 2D normal calc */ + float mval_f[2]= {(float)event->mval[0], (float)event->mval[1]}; + +#define SIDE_OF_LINE(pa,pb,pp) ((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1])) + done= 0; + + /* calculate the normal for selected edges */ for(eed= vc.em->edges.first; eed; eed= eed->next) { - if( (eed->v1->f & SELECT)+(eed->v2->f & SELECT) == SELECT ) { - if(eed->v1->f & SELECT) sub_v3_v3v3(vec, eed->v1->co, eed->v2->co); - else sub_v3_v3v3(vec, eed->v2->co, eed->v1->co); - add_v3_v3(nor, vec); + if(eed->f & SELECT) { + float co1[3], co2[3]; + mul_v3_m4v3(co1, vc.obedit->obmat, eed->v1->co); + mul_v3_m4v3(co2, vc.obedit->obmat, eed->v2->co); + project_float_noclip(vc.ar, co1, co1); + project_float_noclip(vc.ar, co2, co2); + + /* 2D rotate by 90d while subtracting + * (x, y) = (y, -x) + * + * accumulate the screenspace normal in 2D, + * with screenspace edge length weighting the result. */ + if(SIDE_OF_LINE(co1, co2, mval_f) >= 0.0f) { + nor[0] += (co1[1] - co2[1]); + nor[1] += -(co1[0] - co2[0]); + } + else { + nor[0] += (co2[1] - co1[1]); + nor[1] += -(co2[0] - co1[0]); + } done= 1; } } + +#undef SIDE_OF_LINE + if(done) { float view_vec[3], cross[3]; + /* convert the 2D nomal into 3D */ + mul_mat3_m4_v3(vc.rv3d->viewinv, nor); /* worldspace */ + mul_mat3_m4_v3(vc.obedit->imat, nor); /* local space */ + /* correct the normal to be aligned on the view plane */ copy_v3_v3(view_vec, vc.rv3d->viewinv[2]); mul_mat3_m4_v3(vc.obedit->imat, view_vec); cross_v3_v3v3(cross, nor, view_vec); cross_v3_v3v3(nor, view_vec, cross); normalize_v3(nor); + + /* correct for flipping */ } /* center */ @@ -159,10 +193,9 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) mul_m4_v3(vc.obedit->obmat, min); // view space view3d_get_view_aligned_coordinate(&vc, min, event->mval); - invert_m4_m4(vc.obedit->imat, vc.obedit->obmat); mul_m4_v3(vc.obedit->imat, min); // back in object space - sub_v3_v3v3(min, min, cent); + sub_v3_v3(min, cent); /* calculate rotation */ unit_m3(mat); @@ -179,16 +212,22 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) cross_v3_v3v3(cross, nor, vec); normalize_v3(cross); dot= 0.5f*saacos(dot); + + /* halve the rotation if its applied twice */ + if(rot_src) dot *= 0.5f; + si= (float)sin(dot); q1[0]= (float)cos(dot); q1[1]= cross[0]*si; q1[2]= cross[1]*si; - q1[3]= cross[2]*si; - + q1[3]= cross[2]*si; quat_to_mat3( mat,q1); } } + if(rot_src) + rotateflag(vc.em, SELECT, cent, mat); + extrudeflag(vc.obedit, vc.em, SELECT, nor, 0); rotateflag(vc.em, SELECT, cent, mat); translateflag(vc.em, SELECT, min); @@ -213,8 +252,13 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) eve->f= SELECT; } - - //retopo_do_all(); + + if( ((vc.scene->toolsettings->snap_flag & (SCE_SNAP|SCE_SNAP_PROJECT))==(SCE_SNAP|SCE_SNAP_PROJECT)) && + (vc.scene->toolsettings->snap_mode==SCE_SNAP_MODE_FACE) + ) { + EM_project_snap_verts(C, vc.ar, vc.obedit, vc.em); + } + WM_event_add_notifier(C, NC_GEOM|ND_DATA, vc.obedit->data); DAG_id_flush_update(vc.obedit->data, OB_RECALC_DATA); @@ -234,6 +278,8 @@ void MESH_OT_dupli_extrude_cursor(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "rotate_source", 1, "Rotate Source", "Rotate initial selection giving better shape"); } diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c index d34cca0d358..209a7975357 100644 --- a/source/blender/editors/mesh/editmesh_lib.c +++ b/source/blender/editors/mesh/editmesh_lib.c @@ -58,6 +58,7 @@ editmesh_lib: generic (no UI, no menus) operations/evaluators for editmesh data #include "ED_mesh.h" #include "ED_screen.h" #include "ED_view3d.h" +#include "ED_transform.h" #include "mesh_intern.h" @@ -2765,3 +2766,18 @@ int EM_deselect_nth(EditMesh *em, int nth) return 0; } +void EM_project_snap_verts(bContext *C, ARegion *ar, Object *obedit, EditMesh *em) +{ + EditVert *eve; + for(eve= em->verts.first;eve; eve=eve->next) { + if(eve->f & SELECT) { + float mval[2], vec[3], no_dummy[3]; + int dist_dummy; + mul_v3_m4v3(vec, obedit->obmat, eve->co); + project_float_noclip(ar, vec, mval); + if(snapObjectsContext(C, mval, &dist_dummy, vec, no_dummy, SNAP_NOT_OBEDIT)) { + mul_v3_m4v3(eve->co, obedit->imat, vec); + } + } + } +} diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 51a4c67b19b..2ff7095cfea 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -292,7 +292,8 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) /* use KM_CLICK because same key is used for tweaks */ WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_CTRL, 0); - + RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_SHIFT|KM_CTRL, 0)->ptr, "rotate_source", 0); + WM_keymap_add_item(keymap, "MESH_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "MESH_OT_delete", DELKEY, KM_PRESS, 0, 0); -- cgit v1.2.3 From 996efebbe36a06ba45b9a79328a0dadc87ea2ff9 Mon Sep 17 00:00:00 2001 From: Luca Bonavita Date: Wed, 13 Oct 2010 10:42:33 +0000 Subject: == python api doc == First commit to make some structure in doc/ directory. - moved source/blender/python/doc -> doc/python_api - moved source/gameengine/PyDoc/*.rst -> doc/python_api/rst - modified accordingly sphinx_doc_gen.py and sphinx_doc_gen.sh (later on I'll try alternative/ scripts by neXyon as promised :) - source/gameengine/PyDoc/ is still there because contains epydoc stuff for the bge, will ask more and look into it later --- source/blender/python/doc/epy/BGL.py | 1807 -------------------- source/blender/python/doc/epy/Geometry.py | 189 -- source/blender/python/doc/epy/IDProp.py | 132 -- source/blender/python/doc/epy/Mathutils.py | 156 -- source/blender/python/doc/epy/testbgl.py | 45 - source/blender/python/doc/examples/bpy.data.py | 29 - .../blender/python/doc/examples/mathutils.Euler.py | 3 - .../python/doc/examples/mathutils.Matrix.py | 3 - .../python/doc/examples/mathutils.Quaternion.py | 3 - .../python/doc/examples/mathutils.Vector.py | 55 - source/blender/python/doc/examples/mathutils.py | 18 - source/blender/python/doc/sphinx_doc_gen.py | 862 ---------- source/blender/python/doc/sphinx_doc_gen.sh | 35 - 13 files changed, 3337 deletions(-) delete mode 100644 source/blender/python/doc/epy/BGL.py delete mode 100644 source/blender/python/doc/epy/Geometry.py delete mode 100644 source/blender/python/doc/epy/IDProp.py delete mode 100644 source/blender/python/doc/epy/Mathutils.py delete mode 100644 source/blender/python/doc/epy/testbgl.py delete mode 100644 source/blender/python/doc/examples/bpy.data.py delete mode 100644 source/blender/python/doc/examples/mathutils.Euler.py delete mode 100644 source/blender/python/doc/examples/mathutils.Matrix.py delete mode 100644 source/blender/python/doc/examples/mathutils.Quaternion.py delete mode 100644 source/blender/python/doc/examples/mathutils.Vector.py delete mode 100644 source/blender/python/doc/examples/mathutils.py delete mode 100644 source/blender/python/doc/sphinx_doc_gen.py delete mode 100755 source/blender/python/doc/sphinx_doc_gen.sh (limited to 'source/blender') diff --git a/source/blender/python/doc/epy/BGL.py b/source/blender/python/doc/epy/BGL.py deleted file mode 100644 index ce148dc72ba..00000000000 --- a/source/blender/python/doc/epy/BGL.py +++ /dev/null @@ -1,1807 +0,0 @@ -# Blender.BGL module (OpenGL wrapper) - -""" -The Blender.BGL submodule (the OpenGL wrapper). - -B{New}: some GLU functions: L{gluLookAt}, etc. - -The Blender.BGL submodule -========================= -(when accessing it from the Game Engine use BGL instead of Blender.BGL) - -This module wraps OpenGL constants and functions, making them available from -within Blender Python. - -The complete list can be retrieved from the module itself, by listing its -contents: dir(Blender.BGL). A simple search on the net can point to more -than enough material to teach OpenGL programming, from books to many -collections of tutorials. - -The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning -OpenGL}" and the online NeHe tutorials are two of the best resources. - -Example:: - import Blender - from Blender.BGL import * - from Blender import Draw - R = G = B = 0 - A = 1 - title = "Testing BGL + Draw" - instructions = "Use mouse buttons or wheel to change the background color." - quitting = " Press ESC or q to quit." - len1 = Draw.GetStringWidth(title) - len2 = Draw.GetStringWidth(instructions + quitting) - # - def show_win(): - glClearColor(R,G,B,A) # define color used to clear buffers - glClear(GL_COLOR_BUFFER_BIT) # use it to clear the color buffer - glColor3f(0.35,0.18,0.92) # define default color - glBegin(GL_POLYGON) # begin a vertex data list - glVertex2i(165, 158) - glVertex2i(252, 55) - glVertex2i(104, 128) - glEnd() - glColor3f(0.4,0.4,0.4) # change default color - glRecti(40, 96, 60+len1, 113) - glColor3f(1,1,1) - glRasterPos2i(50,100) # move cursor to x = 50, y = 100 - Draw.Text(title) # draw this text there - glRasterPos2i(350,40) # move cursor again - Draw.Text(instructions + quitting) # draw another msg - glBegin(GL_LINE_LOOP) # begin a vertex-data list - glVertex2i(46,92) - glVertex2i(120,92) - glVertex2i(120,115) - glVertex2i(46,115) - glEnd() # close this list - # - def ev(evt, val): # event callback for Draw.Register() - global R,G,B,A # ... it handles input events - if evt == Draw.ESCKEY or evt == Draw.QKEY: - Draw.Exit() # this quits the script - elif not val: return - elif evt == Draw.LEFTMOUSE: R = 1 - R - elif evt == Draw.MIDDLEMOUSE: G = 1 - G - elif evt == Draw.RIGHTMOUSE: B = 1 - B - elif evt == Draw.WHEELUPMOUSE: - R += 0.1 - if R > 1: R = 1 - elif evt == Draw.WHEELDOWNMOUSE: - R -= 0.1 - if R < 0: R = 0 - else: - return # don't redraw if nothing changed - Draw.Redraw(1) # make changes visible. - # - Draw.Register(show_win, ev, None) # start the main loop - -@note: you can use the L{Image} module and L{Image.Image} BPy object to load - and set textures. See L{Image.Image.glLoad} and L{Image.Image.glFree}, - for example. -@see: U{www.opengl.org} -@see: U{nehe.gamedev.net} -""" - -def glAccum(op, value): - """ - Operate on the accumulation buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/accum.html} - - @type op: Enumerated constant - @param op: The accumulation buffer operation. - @type value: float - @param value: a value used in the accumulation buffer operation. - """ - -def glAlphaFunc(func, ref): - """ - Specify the alpha test function - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/alphafunc.html} - - @type func: Enumerated constant - @param func: Specifies the alpha comparison function. - @type ref: float - @param ref: The reference value that incoming alpha values are compared to. - Clamped between 0 and 1. - """ - -def glAreTexturesResident(n, textures, residences): - """ - Determine if textures are loaded in texture memory - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/aretexturesresident.html} - - @type n: int - @param n: Specifies the number of textures to be queried. - @type textures: Buffer object I{type GL_INT} - @param textures: Specifies an array containing the names of the textures to be queried - @type residences: Buffer object I{type GL_INT}(boolean) - @param residences: An array in which the texture residence status in returned.The residence status of a - texture named by an element of textures is returned in the corresponding element of residences. - """ - -def glBegin(mode): - """ - Delimit the vertices of a primitive or a group of like primatives - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html} - - @type mode: Enumerated constant - @param mode: Specifies the primitive that will be create from vertices between glBegin and - glEnd. - """ - -def glBindTexture(target, texture): - """ - Bind a named texture to a texturing target - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bindtexture.html} - - @type target: Enumerated constant - @param target: Specifies the target to which the texture is bound. - @type texture: unsigned int - @param texture: Specifies the name of a texture. - """ - -def glBitmap(width, height, xorig, yorig, xmove, ymove, bitmap): - """ - Draw a bitmap - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bitmap.html} - - @type width, height: int - @param width, height: Specify the pixel width and height of the bitmap image. - @type xorig, yorig: float - @param xorig, yorig: Specify the location of the origin in the bitmap image. The origin is measured - from the lower left corner of the bitmap, with right and up being the positive axes. - @type xmove, ymove: float - @param xmove, ymove: Specify the x and y offsets to be added to the current raster position after - the bitmap is drawn. - @type bitmap: Buffer object I{type GL_BYTE} - @param bitmap: Specifies the address of the bitmap image. - """ - -def glBlendFunc(sfactor, dfactor): - """ - Specify pixel arithmetic - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/blendfunc.html} - - @type sfactor: Enumerated constant - @param sfactor: Specifies how the red, green, blue, and alpha source blending factors are - computed. - @type dfactor: Enumerated constant - @param dfactor: Specifies how the red, green, blue, and alpha destination blending factors are - computed. - """ - -def glCallList(list): - """ - Execute a display list - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllist.html} - - @type list: unsigned int - @param list: Specifies the integer name of the display list to be executed. - """ - -def glCallLists(n, type, lists): - """ - Execute a list of display lists - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllists.html} - - @type n: int - @param n: Specifies the number of display lists to be executed. - @type type: Enumerated constant - @param type: Specifies the type of values in lists. - @type lists: Buffer object - @param lists: Specifies the address of an array of name offsets in the display list. - The pointer type is void because the offsets can be bytes, shorts, ints, or floats, - depending on the value of type. - """ - -def glClear(mask): - """ - Clear buffers to preset values - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clear.html} - - @type mask: Enumerated constant(s) - @param mask: Bitwise OR of masks that indicate the buffers to be cleared. - """ - -def glClearAccum(red, green, blue, alpha): - """ - Specify clear values for the accumulation buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearaccum.html} - - @type red, green, blue, alpha: float - @param red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the - accumulation buffer is cleared. The initial values are all 0. - """ - -def glClearColor(red, green, blue, alpha): - """ - Specify clear values for the color buffers - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearcolor.html} - - @type red, green, blue, alpha: float - @param red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the - color buffers are cleared. The initial values are all 0. - """ - -def glClearDepth(depth): - """ - Specify the clear value for the depth buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cleardepth.html} - - @type depth: int - @param depth: Specifies the depth value used when the depth buffer is cleared. - The initial value is 1. - """ - -def glClearIndex(c): - """ - Specify the clear value for the color index buffers - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearindex.html} - - @type c: float - @param c: Specifies the index used when the color index buffers are cleared. - The initial value is 0. - """ - -def glClearStencil(s): - """ - Specify the clear value for the stencil buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearstencil.html} - - @type s: int - @param s: Specifies the index used when the stencil buffer is cleared. The initial value is 0. - """ - -def glClipPlane (plane, equation): - """ - Specify a plane against which all geometry is clipped - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clipplane.html} - - @type plane: Enumerated constant - @param plane: Specifies which clipping plane is being positioned. - @type equation: Buffer object I{type GL_FLOAT}(double) - @param equation: Specifies the address of an array of four double- precision floating-point - values. These values are interpreted as a plane equation. - """ - -def glColor (red, green, blue, alpha): - """ - B{glColor3b, glColor3d, glColor3f, glColor3i, glColor3s, glColor3ub, glColor3ui, glColor3us, - glColor4b, glColor4d, glColor4f, glColor4i, glColor4s, glColor4ub, glColor4ui, glColor4us, - glColor3bv, glColor3dv, glColor3fv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv, - glColor3usv, glColor4bv, glColor4dv, glColor4fv, glColor4iv, glColor4sv, glColor4ubv, - glColor4uiv, glColor4usv} - - Set a new color. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/color.html} - - @type red, green, blue, alpha: Depends on function prototype. - @param red, green, blue: Specify new red, green, and blue values for the current color. - @param alpha: Specifies a new alpha value for the current color. Included only in the - four-argument glColor4 commands. (With '4' colors only) - """ - -def glColorMask(red, green, blue, alpha): - """ - Enable and disable writing of frame buffer color components - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormask.html} - - @type red, green, blue, alpha: int (boolean) - @param red, green, blue, alpha: Specify whether red, green, blue, and alpha can or cannot be - written into the frame buffer. The initial values are all GL_TRUE, indicating that the - color components can be written. - """ - -def glColorMaterial(face, mode): - """ - Cause a material color to track the current color - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormaterial.html} - - @type face: Enumerated constant - @param face: Specifies whether front, back, or both front and back material parameters should - track the current color. - @type mode: Enumerated constant - @param mode: Specifies which of several material parameters track the current color. - """ - -def glCopyPixels(x, y, width, height, type): - """ - Copy pixels in the frame buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/copypixels.html} - - @type x, y: int - @param x, y: Specify the window coordinates of the lower left corner of the rectangular - region of pixels to be copied. - @type width, height: int - @param width,height: Specify the dimensions of the rectangular region of pixels to be copied. - Both must be non-negative. - @type type: Enumerated constant - @param type: Specifies whether color values, depth values, or stencil values are to be copied. - """ - - def glCopyTexImage2D(target, level, internalformat, x, y, width, height, border): - """ - Copy pixels into a 2D texture image - @see: U{www.opengl.org/sdk/docs/man/xhtml/glCopyTexImage2D.xml} - - @type target: Enumerated constant - @param target: Specifies the target texture. - @type level: int - @param level: Specifies the level-of-detail number. Level 0 is the base image level. - Level n is the nth mipmap reduction image. - @type internalformat: int - @param internalformat: Specifies the number of color components in the texture. - @type width: int - @type x, y: int - @param x, y:Specify the window coordinates of the first pixel that is copied - from the frame buffer. This location is the lower left corner of a rectangular - block of pixels. - @param width: Specifies the width of the texture image. Must be 2n+2(border) for - some integer n. All implementations support texture images that are at least 64 - texels wide. - @type height: int - @param height: Specifies the height of the texture image. Must be 2m+2(border) for - some integer m. All implementations support texture images that are at least 64 - texels high. - @type border: int - @param border: Specifies the width of the border. Must be either 0 or 1. - """ - -def glCullFace(mode): - """ - Specify whether front- or back-facing facets can be culled - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cullface.html} - - @type mode: Enumerated constant - @param mode: Specifies whether front- or back-facing facets are candidates for culling. - """ - -def glDeleteLists(list, range): - """ - Delete a contiguous group of display lists - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletelists.html} - - @type list: unsigned int - @param list: Specifies the integer name of the first display list to delete - @type range: int - @param range: Specifies the number of display lists to delete - """ - -def glDeleteTextures(n, textures): - """ - Delete named textures - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletetextures.html} - - @type n: int - @param n: Specifies the number of textures to be deleted - @type textures: Buffer I{GL_INT} - @param textures: Specifies an array of textures to be deleted - """ - -def glDepthFunc(func): - """ - Specify the value used for depth buffer comparisons - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthfunc.html} - - @type func: Enumerated constant - @param func: Specifies the depth comparison function. - """ - -def glDepthMask(flag): - """ - Enable or disable writing into the depth buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthmask.html} - - @type flag: int (boolean) - @param flag: Specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE, - depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer - writing is enabled. - """ - -def glDepthRange(zNear, zFar): - """ - Specify mapping of depth values from normalized device coordinates to window coordinates - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthrange.html} - - @type zNear: int - @param zNear: Specifies the mapping of the near clipping plane to window coordinates. - The initial value is 0. - @type zFar: int - @param zFar: Specifies the mapping of the far clipping plane to window coordinates. - The initial value is 1. - """ - -def glDisable(cap): - """ - Disable server-side GL capabilities - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html} - - @type cap: Enumerated constant - @param cap: Specifies a symbolic constant indicating a GL capability. - """ - -def glDrawBuffer(mode): - """ - Specify which color buffers are to be drawn into - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawbuffer.html} - - @type mode: Enumerated constant - @param mode: Specifies up to four color buffers to be drawn into. - """ - -def glDrawPixels(width, height, format, type, pixels): - """ - Write a block of pixels to the frame buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawpixels.html} - - @type width, height: int - @param width, height: Specify the dimensions of the pixel rectangle to be - written into the frame buffer. - @type format: Enumerated constant - @param format: Specifies the format of the pixel data. - @type type: Enumerated constant - @param type: Specifies the data type for pixels. - @type pixels: Buffer object - @param pixels: Specifies a pointer to the pixel data. - """ - -def glEdgeFlag (flag): - """ - B{glEdgeFlag, glEdgeFlagv} - - Flag edges as either boundary or non-boundary - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/edgeflag.html} - - @type flag: Depends of function prototype - @param flag: Specifies the current edge flag value.The initial value is GL_TRUE. - """ - -def glEnable(cap): - """ - Enable server-side GL capabilities - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html} - - @type cap: Enumerated constant - @param cap: Specifies a symbolic constant indicating a GL capability. - """ - -def glEnd(): - """ - Delimit the vertices of a primitive or group of like primitives - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html} - """ - -def glEndList(): - """ - Create or replace a display list - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html} - """ - -def glEvalCoord (u,v): - """ - B{glEvalCoord1d, glEvalCoord1f, glEvalCoord2d, glEvalCoord2f, glEvalCoord1dv, glEvalCoord1fv, - glEvalCoord2dv, glEvalCoord2fv} - - Evaluate enabled one- and two-dimensional maps - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalcoord.html} - - @type u: Depends on function prototype. - @param u: Specifies a value that is the domain coordinate u to the basis function defined - in a previous glMap1 or glMap2 command. If the function prototype ends in 'v' then - u specifies a pointer to an array containing either one or two domain coordinates. The first - coordinate is u. The second coordinate is v, which is present only in glEvalCoord2 versions. - @type v: Depends on function prototype. (only with '2' prototypes) - @param v: Specifies a value that is the domain coordinate v to the basis function defined - in a previous glMap2 command. This argument is not present in a glEvalCoord1 command. - """ - -def glEvalMesh (mode, i1, i2): - """ - B{glEvalMesh1 or glEvalMesh2} - - Compute a one- or two-dimensional grid of points or lines - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalmesh.html} - - @type mode: Enumerated constant - @param mode: In glEvalMesh1, specifies whether to compute a one-dimensional - mesh of points or lines. - @type i1, i2: int - @param i1, i2: Specify the first and last integer values for the grid domain variable i. - """ - -def glEvalPoint (i, j): - """ - B{glEvalPoint1 and glEvalPoint2} - - Generate and evaluate a single point in a mesh - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalpoint.html} - - @type i: int - @param i: Specifies the integer value for grid domain variable i. - @type j: int (only with '2' prototypes) - @param j: Specifies the integer value for grid domain variable j (glEvalPoint2 only). - """ - -def glFeedbackBuffer (size, type, buffer): - """ - Controls feedback mode - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/feedbackbuffer.html} - - @type size: int - @param size:Specifies the maximum number of values that can be written into buffer. - @type type: Enumerated constant - @param type:Specifies a symbolic constant that describes the information that - will be returned for each vertex. - @type buffer: Buffer object I{GL_FLOAT} - @param buffer: Returns the feedback data. - """ - -def glFinish(): - """ - Block until all GL execution is complete - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/finish.html} - """ - -def glFlush(): - """ - Force Execution of GL commands in finite time - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/flush.html} - """ - -def glFog (pname, param): - """ - B{glFogf, glFogi, glFogfv, glFogiv} - - Specify fog parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/fog.html} - - @type pname: Enumerated constant - @param pname: Specifies a single-valued fog parameter. If the function prototype - ends in 'v' specifies a fog parameter. - @type param: Depends on function prototype. - @param param: Specifies the value or values to be assigned to pname. GL_FOG_COLOR - requires an array of four values. All other parameters accept an array containing - only a single value. - """ - -def glFrontFace(mode): - """ - Define front- and back-facing polygons - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frontface.html} - - @type mode: Enumerated constant - @param mode: Specifies the orientation of front-facing polygons. - """ - -def glFrustum(left, right, bottom, top, zNear, zFar): - """ - Multiply the current matrix by a perspective matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frustum.html} - - @type left, right: double (float) - @param left, right: Specify the coordinates for the left and right vertical - clipping planes. - @type top, bottom: double (float) - @param top, bottom: Specify the coordinates for the bottom and top horizontal - clipping planes. - @type zNear, zFar: double (float) - @param zNear, zFar: Specify the distances to the near and far depth clipping planes. - Both distances must be positive. - """ - -def glGenLists(range): - """ - Generate a contiguous set of empty display lists - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/genlists.html} - - @type range: int - @param range: Specifies the number of contiguous empty display lists to be generated. - """ - -def glGenTextures(n, textures): - """ - Generate texture names - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gentextures.html} - - @type n: int - @param n: Specifies the number of textures name to be generated. - @type textures: Buffer object I{type GL_INT} - @param textures: Specifies an array in which the generated textures names are stored. - """ - -def glGet (pname, param): - """ - B{glGetBooleanv, glGetfloatv, glGetFloatv, glGetIntegerv} - - Return the value or values of a selected parameter - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/get.html} - - @type pname: Enumerated constant - @param pname: Specifies the parameter value to be returned. - @type param: Depends on function prototype. - @param param: Returns the value or values of the specified parameter. - """ - -def glGetClipPlane(plane, equation): - """ - Return the coefficients of the specified clipping plane - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getclipplane.html} - - @type plane: Enumerated constant - @param plane: Specifies a clipping plane. The number of clipping planes depends on the - implementation, but at least six clipping planes are supported. They are identified by - symbolic names of the form GL_CLIP_PLANEi where 0 < i < GL_MAX_CLIP_PLANES. - @type equation: Buffer object I{type GL_FLOAT} - @param equation: Returns four float (double)-precision values that are the coefficients of the - plane equation of plane in eye coordinates. The initial value is (0, 0, 0, 0). - """ - -def glGetError(): - """ - Return error information - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html} - """ - -def glGetLight (light, pname, params): - """ - B{glGetLightfv and glGetLightiv} - - Return light source parameter values - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getlight.html} - - @type light: Enumerated constant - @param light: Specifies a light source. The number of possible lights depends on the - implementation, but at least eight lights are supported. They are identified by symbolic - names of the form GL_LIGHTi where 0 < i < GL_MAX_LIGHTS. - @type pname: Enumerated constant - @param pname: Specifies a light source parameter for light. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the requested data. - """ - -def glGetMap (target, query, v): - """ - B{glGetMapdv, glGetMapfv, glGetMapiv} - - Return evaluator parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmap.html} - - @type target: Enumerated constant - @param target: Specifies the symbolic name of a map. - @type query: Enumerated constant - @param query: Specifies which parameter to return. - @type v: Buffer object. Depends on function prototype. - @param v: Returns the requested data. - """ - -def glGetMaterial (face, pname, params): - """ - B{glGetMaterialfv, glGetMaterialiv} - - Return material parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmaterial.html} - - @type face: Enumerated constant - @param face: Specifies which of the two materials is being queried. - representing the front and back materials, respectively. - @type pname: Enumerated constant - @param pname: Specifies the material parameter to return. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the requested data. - """ - -def glGetPixelMap (map, values): - """ - B{glGetPixelMapfv, glGetPixelMapuiv, glGetPixelMapusv} - - Return the specified pixel map - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpixelmap.html} - - @type map: Enumerated constant - @param map: Specifies the name of the pixel map to return. - @type values: Buffer object. Depends on function prototype. - @param values: Returns the pixel map contents. - """ - -def glGetPolygonStipple(mask): - """ - Return the polygon stipple pattern - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpolygonstipple.html} - - @type mask: Buffer object I{type GL_BYTE} - @param mask: Returns the stipple pattern. The initial value is all 1's. - """ - -def glGetString(name): - """ - Return a string describing the current GL connection - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getstring.html} - - @type name: Enumerated constant - @param name: Specifies a symbolic constant. - - """ - -def glGetTexEnv (target, pname, params): - """ - B{glGetTexEnvfv, glGetTexEnviv} - - Return texture environment parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexenv.html} - - @type target: Enumerated constant - @param target: Specifies a texture environment. Must be GL_TEXTURE_ENV. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of a texture environment parameter. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the requested data. - """ - -def glGetTexGen (coord, pname, params): - """ - B{glGetTexGendv, glGetTexGenfv, glGetTexGeniv} - - Return texture coordinate generation parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexgen.html} - - @type coord: Enumerated constant - @param coord: Specifies a texture coordinate. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of the value(s) to be returned. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the requested data. - """ - -def glGetTexImage(target, level, format, type, pixels): - """ - Return a texture image - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getteximage.html} - - @type target: Enumerated constant - @param target: Specifies which texture is to be obtained. - @type level: int - @param level: Specifies the level-of-detail number of the desired image. - Level 0 is the base image level. Level n is the nth mipmap reduction image. - @type format: Enumerated constant - @param format: Specifies a pixel format for the returned data. - @type type: Enumerated constant - @param type: Specifies a pixel type for the returned data. - @type pixels: Buffer object. - @param pixels: Returns the texture image. Should be a pointer to an array of the - type specified by type - """ - -def glGetTexLevelParameter (target, level, pname, params): - """ - B{glGetTexLevelParameterfv, glGetTexLevelParameteriv} - - return texture parameter values for a specific level of detail - @see: U{opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/gettexlevelparameter.html} - - @type target: Enumerated constant - @param target: Specifies the symbolic name of the target texture. - @type level: int - @param level: Specifies the level-of-detail number of the desired image. - Level 0 is the base image level. Level n is the nth mipmap reduction image. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of a texture parameter. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the requested data. - """ - -def glGetTexParameter (target, pname, params): - """ - B{glGetTexParameterfv, glGetTexParameteriv} - - Return texture parameter values - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexparameter.html} - - @type target: Enumerated constant - @param target: Specifies the symbolic name of the target texture. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name the target texture. - @type params: Buffer object. Depends on function prototype. - @param params: Returns the texture parameters. - """ - -def glHint(target, mode): - """ - Specify implementation-specific hints - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/hint.html} - - @type target: Enumerated constant - @param target: Specifies a symbolic constant indicating the behavior to be - controlled. - @type mode: Enumerated constant - @param mode: Specifies a symbolic constant indicating the desired behavior. - """ - -def glIndex (c): - """ - B{glIndexd, glIndexf, glIndexi, glIndexs, glIndexdv, glIndexfv, glIndexiv, glIndexsv} - - Set the current color index - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/index_.html} - - @type c: Buffer object. Depends on function prototype. - @param c: Specifies a pointer to a one element array that contains the new value for - the current color index. - """ - -def glInitNames(): - """ - Initialize the name stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/initnames.html} - """ - -def glIsEnabled(cap): - """ - Test whether a capability is enabled - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/isenabled.html} - - @type cap: Enumerated constant - @param cap: Specifies a constant representing a GL capability. - """ - -def glIsList(list): - """ - Determine if a name corresponds to a display-list - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/islist.html} - - @type list: unsigned int - @param list: Specifies a potential display-list name. - """ - -def glIsTexture(texture): - """ - Determine if a name corresponds to a texture - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/istexture.html} - - @type texture: unsigned int - @param texture: Specifies a value that may be the name of a texture. - """ - -def glLight (light, pname, param): - """ - B{glLightf,glLighti, glLightfv, glLightiv} - - Set the light source parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/light.html} - - @type light: Enumerated constant - @param light: Specifies a light. The number of lights depends on the implementation, - but at least eight lights are supported. They are identified by symbolic names of the - form GL_LIGHTi where 0 < i < GL_MAX_LIGHTS. - @type pname: Enumerated constant - @param pname: Specifies a single-valued light source parameter for light. - @type param: Depends on function prototype. - @param param: Specifies the value that parameter pname of light source light will be set to. - If function prototype ends in 'v' specifies a pointer to the value or values that - parameter pname of light source light will be set to. - """ - -def glLightModel (pname, param): - """ - B{glLightModelf, glLightModeli, glLightModelfv, glLightModeliv} - - Set the lighting model parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/lightmodel.html} - - @type pname: Enumerated constant - @param pname: Specifies a single-value light model parameter. - @type param: Depends on function prototype. - @param param: Specifies the value that param will be set to. If function prototype ends in 'v' - specifies a pointer to the value or values that param will be set to. - """ - -def glLineStipple(factor, pattern): - """ - Specify the line stipple pattern - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linestipple.html} - - @type factor: int - @param factor: Specifies a multiplier for each bit in the line stipple pattern. - If factor is 3, for example, each bit in the pattern is used three times before - the next bit in the pattern is used. factor is clamped to the range [1, 256] and - defaults to 1. - @type pattern: unsigned short int - @param pattern: Specifies a 16-bit integer whose bit pattern determines which fragments - of a line will be drawn when the line is rasterized. Bit zero is used first; the default - pattern is all 1's. - """ - -def glLineWidth(width): - """ - Specify the width of rasterized lines. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linewidth.html} - - @type width: float - @param width: Specifies the width of rasterized lines. The initial value is 1. - """ - -def glListBase(base): - """ - Set the display-list base for glCallLists - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/listbase.html} - - @type base: unsigned int - @param base: Specifies an integer offset that will be added to glCallLists - offsets to generate display-list names. The initial value is 0. - """ - -def glLoadIdentity(): - """ - Replace the current matrix with the identity matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadidentity.html} - """ - -def glLoadMatrix (m): - """ - B{glLoadMatrixd, glLoadMatixf} - - Replace the current matrix with the specified matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadmatrix.html} - - @type m: Buffer object. Depends on function prototype. - @param m: Specifies a pointer to 16 consecutive values, which are used as the elements - of a 4x4 column-major matrix. - """ - -def glLoadName(name): - """ - Load a name onto the name stack. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadname.html} - - @type name: unsigned int - @param name: Specifies a name that will replace the top value on the name stack. - """ - -def glLogicOp(opcode): - """ - Specify a logical pixel operation for color index rendering - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/logicop.html} - - @type opcode: Enumerated constant - @param opcode: Specifies a symbolic constant that selects a logical operation. - """ - -def glMap1 (target, u1, u2, stride, order, points): - """ - B{glMap1d, glMap1f} - - Define a one-dimensional evaluator - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map1.html} - - @type target: Enumerated constant - @param target: Specifies the kind of values that are generated by the evaluator. - @type u1, u2: Depends on function prototype. - @param u1,u2: Specify a linear mapping of u, as presented to glEvalCoord1, to ^, t - he variable that is evaluated by the equations specified by this command. - @type stride: int - @param stride: Specifies the number of floats or float (double)s between the beginning - of one control point and the beginning of the next one in the data structure - referenced in points. This allows control points to be embedded in arbitrary data - structures. The only constraint is that the values for a particular control point must - occupy contiguous memory locations. - @type order: int - @param order: Specifies the number of control points. Must be positive. - @type points: Buffer object. Depends on function prototype. - @param points: Specifies a pointer to the array of control points. - """ - -def glMap2 (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points): - """ - B{glMap2d, glMap2f} - - Define a two-dimensional evaluator - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map2.html} - - @type target: Enumerated constant - @param target: Specifies the kind of values that are generated by the evaluator. - @type u1, u2: Depends on function prototype. - @param u1,u2: Specify a linear mapping of u, as presented to glEvalCoord2, to ^, t - he variable that is evaluated by the equations specified by this command. Initially - u1 is 0 and u2 is 1. - @type ustride: int - @param ustride: Specifies the number of floats or float (double)s between the beginning - of control point R and the beginning of control point R ij, where i and j are the u - and v control point indices, respectively. This allows control points to be embedded - in arbitrary data structures. The only constraint is that the values for a particular - control point must occupy contiguous memory locations. The initial value of ustride is 0. - @type uorder: int - @param uorder: Specifies the dimension of the control point array in the u axis. - Must be positive. The initial value is 1. - @type v1, v2: Depends on function prototype. - @param v1, v2: Specify a linear mapping of v, as presented to glEvalCoord2, to ^, - one of the two variables that are evaluated by the equations specified by this command. - Initially, v1 is 0 and v2 is 1. - @type vstride: int - @param vstride: Specifies the number of floats or float (double)s between the beginning of control - point R and the beginning of control point R ij, where i and j are the u and v control - point(indices, respectively. This allows control points to be embedded in arbitrary data - structures. The only constraint is that the values for a particular control point must - occupy contiguous memory locations. The initial value of vstride is 0. - @type vorder: int - @param vorder: Specifies the dimension of the control point array in the v axis. - Must be positive. The initial value is 1. - @type points: Buffer object. Depends on function prototype. - @param points: Specifies a pointer to the array of control points. - """ - -def glMapGrid (un, u1,u2 ,vn, v1, v2): - """ - B{glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f} - - Define a one- or two-dimensional mesh - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/mapgrid.html} - - @type un: int - @param un: Specifies the number of partitions in the grid range interval - [u1, u2]. Must be positive. - @type u1, u2: Depends on function prototype. - @param u1, u2: Specify the mappings for integer grid domain values i=0 and i=un. - @type vn: int - @param vn: Specifies the number of partitions in the grid range interval [v1, v2] - (glMapGrid2 only). - @type v1, v2: Depends on function prototype. - @param v1, v2: Specify the mappings for integer grid domain values j=0 and j=vn - (glMapGrid2 only). - """ - -def glMaterial (face, pname, params): - """ - Specify material parameters for the lighting model. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/material.html} - - @type face: Enumerated constant - @param face: Specifies which face or faces are being updated. Must be one of: - @type pname: Enumerated constant - @param pname: Specifies the single-valued material parameter of the face - or faces that is being updated. Must be GL_SHININESS. - @type params: int - @param params: Specifies the value that parameter GL_SHININESS will be set to. - If function prototype ends in 'v' specifies a pointer to the value or values that - pname will be set to. - """ - -def glMatrixMode(mode): - """ - Specify which matrix is the current matrix. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/matrixmode.html} - - @type mode: Enumerated constant - @param mode: Specifies which matrix stack is the target for subsequent matrix operations. - """ - -def glMultMatrix (m): - """ - B{glMultMatrixd, glMultMatrixf} - - Multiply the current matrix with the specified matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/multmatrix.html} - - @type m: Buffer object. Depends on function prototype. - @param m: Points to 16 consecutive values that are used as the elements of a 4x4 column - major matrix. - """ - -def glNewList(list, mode): - """ - Create or replace a display list - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html} - - @type list: unsigned int - @param list: Specifies the display list name - @type mode: Enumerated constant - @param mode: Specifies the compilation mode. - """ - -def glNormal3 (nx, ny, nz, v): - """ - B{Normal3b, Normal3bv, Normal3d, Normal3dv, Normal3f, Normal3fv, Normal3i, Normal3iv, - Normal3s, Normal3sv} - - Set the current normal vector - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/normal.html} - - @type nx, ny, nz: Depends on function prototype. (non - 'v' prototypes only) - @param nx, ny, nz: Specify the x, y, and z coordinates of the new current normal. - The initial value of the current normal is the unit vector, (0, 0, 1). - @type v: Buffer object. Depends on function prototype. ('v' prototypes) - @param v: Specifies a pointer to an array of three elements: the x, y, and z coordinates - of the new current normal. - """ - -def glOrtho(left, right, bottom, top, zNear, zFar): - """ - Multiply the current matrix with an orthographic matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/ortho.html} - - @type left, right: double (float) - @param left, right: Specify the coordinates for the left and - right vertical clipping planes. - @type bottom, top: double (float) - @param bottom, top: Specify the coordinates for the bottom and top - horizontal clipping planes. - @type zNear, zFar: double (float) - @param zNear, zFar: Specify the distances to the nearer and farther - depth clipping planes. These values are negative if the plane is to be behind the viewer. - """ - -def glPassThrough(token): - """ - Place a marker in the feedback buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/passthrough.html} - - @type token: float - @param token: Specifies a marker value to be placed in the feedback - buffer following a GL_PASS_THROUGH_TOKEN. - """ - -def glPixelMap (map, mapsize, values): - """ - B{glPixelMapfv, glPixelMapuiv, glPixelMapusv} - - Set up pixel transfer maps - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelmap.html} - - @type map: Enumerated constant - @param map: Specifies a symbolic map name. - @type mapsize: int - @param mapsize: Specifies the size of the map being defined. - @type values: Buffer object. Depends on function prototype. - @param values: Specifies an array of mapsize values. - """ - -def glPixelStore (pname, param): - """ - B{glPixelStoref, glPixelStorei} - - Set pixel storage modes - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelstore.html} - - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of the parameter to be set. - Six values affect the packing of pixel data into memory. - Six more affect the unpacking of pixel data from memory. - @type param: Depends on function prototype. - @param param: Specifies the value that pname is set to. - """ - -def glPixelTransfer (pname, param): - """ - B{glPixelTransferf, glPixelTransferi} - - Set pixel transfer modes - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixeltransfer.html} - - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of the pixel transfer parameter to be set. - @type param: Depends on function prototype. - @param param: Specifies the value that pname is set to. - """ - -def glPixelZoom(xfactor, yfactor): - """ - Specify the pixel zoom factors - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelzoom.html} - - @type xfactor, yfactor: float - @param xfactor, yfactor: Specify the x and y zoom factors for pixel write operations. - """ - -def glPointSize(size): - """ - Specify the diameter of rasterized points - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pointsize.html} - - @type size: float - @param size: Specifies the diameter of rasterized points. The initial value is 1. - """ - -def glPolygonMode(face, mode): - """ - Select a polygon rasterization mode - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonmode.html} - - @type face: Enumerated constant - @param face: Specifies the polygons that mode applies to. - Must be GL_FRONT for front-facing polygons, GL_BACK for back- facing polygons, - or GL_FRONT_AND_BACK for front- and back-facing polygons. - @type mode: Enumerated constant - @param mode: Specifies how polygons will be rasterized. - The initial value is GL_FILL for both front- and back- facing polygons. - """ - -def glPolygonOffset(factor, units): - """ - Set the scale and units used to calculate depth values - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonoffset.html} - - @type factor: float - @param factor: Specifies a scale factor that is used to create a variable depth - offset for each polygon. The initial value is 0. - @type units: float - @param units: Is multiplied by an implementation-specific value to create a constant - depth offset. The initial value is 0. - """ - -def glPolygonStipple(mask): - """ - Set the polygon stippling pattern - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonstipple.html} - - @type mask: Buffer object I{type GL_BYTE} - @param mask: Specifies a pointer to a 32x32 stipple pattern that will be unpacked - from memory in the same way that glDrawPixels unpacks pixels. - """ - -def glPopAttrib(): - """ - Pop the server attribute stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html} - """ - -def glPopClientAttrib(): - """ - Pop the client attribute stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushclientattrib.html} - """ - -def glPopMatrix(): - """ - Pop the current matrix stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html} - """ - -def glPopName(): - """ - Pop the name stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html} - """ - -def glPrioritizeTextures(n, textures, priorities): - """ - Set texture residence priority - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/prioritizetextures.html} - - @type n: int - @param n:Specifies the number of textures to be prioritized. - @type textures: Buffer I{type GL_INT} - @param textures: Specifies an array containing the names of the textures to be prioritized. - @type priorities: Buffer I{type GL_FLOAT} - @param priorities: Specifies an array containing the texture priorities. A priority given - in an element of priorities applies to the texture named by the corresponding element of textures. - """ - -def glPushAttrib(mask): - """ - Push the server attribute stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html} - - @type mask: Enumerated constant(s) - @param mask: Specifies a mask that indicates which attributes to save. - """ - -def glPushClientAttrib(mask): - """ - Push the client attribute stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushclientattrib.html} - - @type mask: Enumerated constant(s) - @param mask: Specifies a mask that indicates which attributes to save. - """ - -def glPushMatrix(): - """ - Push the current matrix stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html} - """ - -def glPushName(name): - """ - Push the name stack - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html} - - @type name: unsigned int - @param name: Specifies a name that will be pushed onto the name stack. - """ - -def glRasterPos (x,y,z,w): - """ - B{glRasterPos2d, glRasterPos2f, glRasterPos2i, glRasterPos2s, glRasterPos3d, - glRasterPos3f, glRasterPos3i, glRasterPos3s, glRasterPos4d, glRasterPos4f, - glRasterPos4i, glRasterPos4s, glRasterPos2dv, glRasterPos2fv, glRasterPos2iv, - glRasterPos2sv, glRasterPos3dv, glRasterPos3fv, glRasterPos3iv, glRasterPos3sv, - glRasterPos4dv, glRasterPos4fv, glRasterPos4iv, glRasterPos4sv} - - Specify the raster position for pixel operations - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rasterpos.html} - - @type x, y, z, w: Depends on function prototype. (z and w for '3' and '4' prototypes only) - @param x, y, z, w: Specify the x,y,z, and w object coordinates (if present) for the - raster position. If function prototype ends in 'v' specifies a pointer to an array of two, - three, or four elements, specifying x, y, z, and w coordinates, respectively. - @note: - If you are drawing to the 3d view with a Scriptlink of a space handler - the zoom level of the panels will scale the glRasterPos by the view matrix. - so a X of 10 will not always offset 10 pixels as you would expect. - - To work around this get the scale value of the view matrix and use it to scale your pixel values. - - Workaround:: - - import Blender - from Blender.BGL import * - xval, yval= 100, 40 - # Get the scale of the view matrix - viewMatrix = Buffer(GL_FLOAT, 16) - glGetFloatv(GL_MODELVIEW_MATRIX, viewMatrix) - f = 1/viewMatrix[0] - glRasterPos2f(xval*f, yval*f) # Instead of the usual glRasterPos2i(xval, yval) - """ - -def glReadBuffer(mode): - """ - Select a color buffer source for pixels. - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readbuffer.html} - - @type mode: Enumerated constant - @param mode: Specifies a color buffer. - """ - -def glReadPixels(x, y, width, height, format, type, pixels): - """ - Read a block of pixels from the frame buffer - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readpixels.html} - - @type x, y: int - @param x, y:Specify the window coordinates of the first pixel that is read - from the frame buffer. This location is the lower left corner of a rectangular - block of pixels. - @type width, height: int - @param width, height: Specify the dimensions of the pixel rectangle. width and - height of one correspond to a single pixel. - @type format: Enumerated constant - @param format: Specifies the format of the pixel data. - @type type: Enumerated constant - @param type: Specifies the data type of the pixel data. - @type pixels: Buffer object - @param pixels: Returns the pixel data. - """ - -def glRect (x1,y1,x2,y2,v1,v2): - """ - B{glRectd, glRectf, glRecti, glRects, glRectdv, glRectfv, glRectiv, glRectsv} - - Draw a rectangle - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rect.html} - - @type x1, y1: Depends on function prototype. (for non 'v' prototypes only) - @param x1, y1: Specify one vertex of a rectangle - @type x2, y2: Depends on function prototype. (for non 'v' prototypes only) - @param x2, y2: Specify the opposite vertex of the rectangle - @type v1, v2: Depends on function prototype. (for 'v' prototypes only) - @param v1, v2: Specifies a pointer to one vertex of a rectangle and the pointer - to the opposite vertex of the rectangle - """ - -def glRenderMode(mode): - """ - Set rasterization mode - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rendermode.html} - - @type mode: Enumerated constant - @param mode: Specifies the rasterization mode. - """ - -def glRotate (angle, x, y, z): - """ - B{glRotated, glRotatef} - - Multiply the current matrix by a rotation matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rotate.html} - - @type angle: Depends on function prototype. - @param angle: Specifies the angle of rotation in degrees. - @type x, y, z: Depends on function prototype. - @param x, y, z: Specify the x, y, and z coordinates of a vector respectively. - """ - -def glScale (x,y,z): - """ - B{glScaled, glScalef} - - Multiply the current matrix by a general scaling matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scale.html} - - @type x, y, z: Depends on function prototype. - @param x, y, z: Specify scale factors along the x, y, and z axes, respectively. - """ - -def glScissor(x,y,width,height): - """ - Define the scissor box - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scissor.html} - - @type x, y: int - @param x, y: Specify the lower left corner of the scissor box. Initially (0, 0). - @type width, height: int - @param width height: Specify the width and height of the scissor box. When a - GL context is first attached to a window, width and height are set to the - dimensions of that window. - """ - -def glSelectBuffer(size, buffer): - """ - Establish a buffer for selection mode values - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/selectbuffer.html} - - @type size: int - @param size: Specifies the size of buffer - @type buffer: Buffer I{type GL_INT} - @param buffer: Returns the selection data - """ - -def glShadeModel(mode): - """ - Select flat or smooth shading - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/shademodel.html} - - @type mode: Enumerated constant - @param mode: Specifies a symbolic value representing a shading technique. - """ - -def glStencilFuc(func, ref, mask): - """ - Set function and reference value for stencil testing - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilfunc.html} - - @type func: Enumerated constant - @param func:Specifies the test function. - @type ref: int - @param ref:Specifies the reference value for the stencil test. ref is clamped to - the range [0,2n-1], where n is the number of bitplanes in the stencil buffer. - The initial value is 0. - @type mask: unsigned int - @param mask:Specifies a mask that is ANDed with both the reference value and - the stored stencil value when the test is done. The initial value is all 1's. - """ - -def glStencilMask(mask): - """ - Control the writing of individual bits in the stencil planes - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilmask.html} - - @type mask: unsigned int - @param mask: Specifies a bit mask to enable and disable writing of individual bits - in the stencil planes. Initially, the mask is all 1's. - """ - -def glStencilOp(fail, zfail, zpass): - """ - Set stencil test actions - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilop.html} - - @type fail: Enumerated constant - @param fail: Specifies the action to take when the stencil test fails. - The initial value is GL_KEEP. - @type zfail: Enumerated constant - @param zfail: Specifies the stencil action when the stencil test passes, but the - depth test fails. zfail accepts the same symbolic constants as fail. - The initial value is GL_KEEP. - @type zpass: Enumerated constant - @param zpass: Specifies the stencil action when both the stencil test and the - depth test pass, or when the stencil test passes and either there is no depth - buffer or depth testing is not enabled. zpass accepts the same symbolic constants - as fail. The initial value is GL_KEEP. - """ - -def glTexCoord (s,t,r,q,v): - """ - B{glTexCoord1d, glTexCoord1f, glTexCoord1i, glTexCoord1s, glTexCoord2d, glTexCoord2f, - glTexCoord2i, glTexCoord2s, glTexCoord3d, glTexCoord3f, glTexCoord3i, glTexCoord3s, - glTexCoord4d, glTexCoord4f, glTexCoord4i, glTexCoord4s, glTexCoord1dv, glTexCoord1fv, - glTexCoord1iv, glTexCoord1sv, glTexCoord2dv, glTexCoord2fv, glTexCoord2iv, - glTexCoord2sv, glTexCoord3dv, glTexCoord3fv, glTexCoord3iv, glTexCoord3sv, - glTexCoord4dv, glTexCoord4fv, glTexCoord4iv, glTexCoord4sv} - - Set the current texture coordinates - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texcoord.html} - - @type s, t, r, q: Depends on function prototype. (r and q for '3' and '4' prototypes only) - @param s, t, r, q: Specify s, t, r, and q texture coordinates. Not all parameters are - present in all forms of the command. - @type v: Buffer object. Depends on function prototype. (for 'v' prototypes only) - @param v: Specifies a pointer to an array of one, two, three, or four elements, - which in turn specify the s, t, r, and q texture coordinates. - """ - -def glTexEnv (target, pname, param): - """ - B{glTextEnvf, glTextEnvi, glTextEnvfv, glTextEnviv} - - Set texture environment parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texenv.html} - - @type target: Enumerated constant - @param target: Specifies a texture environment. Must be GL_TEXTURE_ENV. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of a single-valued texture environment - parameter. Must be GL_TEXTURE_ENV_MODE. - @type param: Depends on function prototype. - @param param: Specifies a single symbolic constant. If function prototype ends in 'v' - specifies a pointer to a parameter array that contains either a single symbolic - constant or an RGBA color - """ - -def glTexGen (coord, pname, param): - """ - B{glTexGend, glTexGenf, glTexGeni, glTexGendv, glTexGenfv, glTexGeniv} - - Control the generation of texture coordinates - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texgen.html} - - @type coord: Enumerated constant - @param coord: Specifies a texture coordinate. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of the texture- coordinate generation function. - @type param: Depends on function prototype. - @param param: Specifies a single-valued texture generation parameter. - If function prototype ends in 'v' specifies a pointer to an array of texture - generation parameters. If pname is GL_TEXTURE_GEN_MODE, then the array must - contain a single symbolic constant. Otherwise, params holds the coefficients - for the texture-coordinate generation function specified by pname. - """ - -def glTexImage1D(target, level, internalformat, width, border, format, type, pixels): - """ - Specify a one-dimensional texture image - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage1d.html} - - @type target: Enumerated constant - @param target: Specifies the target texture. - @type level: int - @param level: Specifies the level-of-detail number. Level 0 is the base image level. - Level n is the nth mipmap reduction image. - @type internalformat: int - @param internalformat: Specifies the number of color components in the texture. - @type width: int - @param width: Specifies the width of the texture image. Must be 2n+2(border) for - some integer n. All implementations support texture images that are at least 64 - texels wide. The height of the 1D texture image is 1. - @type border: int - @param border: Specifies the width of the border. Must be either 0 or 1. - @type format: Enumerated constant - @param format: Specifies the format of the pixel data. - @type type: Enumerated constant - @param type: Specifies the data type of the pixel data. - @type pixels: Buffer object. - @param pixels: Specifies a pointer to the image data in memory. - """ - -def glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels): - """ - Specify a two-dimensional texture image - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage2d.html} - - @type target: Enumerated constant - @param target: Specifies the target texture. - @type level: int - @param level: Specifies the level-of-detail number. Level 0 is the base image level. - Level n is the nth mipmap reduction image. - @type internalformat: int - @param internalformat: Specifies the number of color components in the texture. - @type width: int - @param width: Specifies the width of the texture image. Must be 2n+2(border) for - some integer n. All implementations support texture images that are at least 64 - texels wide. - @type height: int - @param height: Specifies the height of the texture image. Must be 2m+2(border) for - some integer m. All implementations support texture images that are at least 64 - texels high. - @type border: int - @param border: Specifies the width of the border. Must be either 0 or 1. - @type format: Enumerated constant - @param format: Specifies the format of the pixel data. - @type type: Enumerated constant - @param type: Specifies the data type of the pixel data. - @type pixels: Buffer object. - @param pixels: Specifies a pointer to the image data in memory. - """ - -def glTexParameter (target, pname, param): - """ - B{glTexParameterf, glTexParameteri, glTexParameterfv, glTexParameteriv} - - Set texture parameters - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texparameter.html} - - @type target: Enumerated constant - @param target: Specifies the target texture. - @type pname: Enumerated constant - @param pname: Specifies the symbolic name of a single-valued texture parameter. - @type param: Depends on function prototype. - @param param: Specifies the value of pname. If function prototype ends in 'v' specifies - a pointer to an array where the value or values of pname are stored. - """ - -def glTranslate (x, y, z): - """ - B{glTranslatef, glTranslated} - - Multiply the current matrix by a translation matrix - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/translate.html} - - @type x, y, z: Depends on function prototype. - @param x, y, z: Specify the x, y, and z coordinates of a translation vector. - """ - -def glVertex (x,y,z,w,v): - """ - B{glVertex2d, glVertex2f, glVertex2i, glVertex2s, glVertex3d, glVertex3f, glVertex3i, - glVertex3s, glVertex4d, glVertex4f, glVertex4i, glVertex4s, glVertex2dv, glVertex2fv, - glVertex2iv, glVertex2sv, glVertex3dv, glVertex3fv, glVertex3iv, glVertex3sv, glVertex4dv, - glVertex4fv, glVertex4iv, glVertex4sv} - - Specify a vertex - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/vertex.html} - - @type x, y, z, w: Depends on function prototype (z and w for '3' and '4' prototypes only) - @param x, y, z, w: Specify x, y, z, and w coordinates of a vertex. Not all parameters - are present in all forms of the command. - @type v: Buffer object. Depends of function prototype (for 'v' prototypes only) - @param v: Specifies a pointer to an array of two, three, or four elements. The - elements of a two-element array are x and y; of a three-element array, x, y, and z; - and of a four-element array, x, y, z, and w. - """ - -def glViewport(x,y,width,height): - """ - Set the viewport - @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/viewport.html} - - @type x, y: int - @param x, y: Specify the lower left corner of the viewport rectangle, - in pixels. The initial value is (0,0). - @type width, height: int - @param width, height: Specify the width and height of the viewport. When a GL context - is first attached to a window, width and height are set to the dimensions of that window. - """ - -def gluPerspective(fovY, aspect, zNear, zFar): - """ - Set up a perspective projection matrix. - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5577288} - - @type fovY: double - @param fovY: Specifies the field of view angle, in degrees, in the y direction. - @type aspect: double - @param aspect: Specifies the aspect ratio that determines the field of view in the x direction. - The aspect ratio is the ratio of x (width) to y (height). - @type zNear: double - @param zNear: Specifies the distance from the viewer to the near clipping plane (always positive). - @type zFar: double - @param zFar: Specifies the distance from the viewer to the far clipping plane (always positive). - """ - -def gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz): - """ - Define a viewing transformation - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5573042} - - @type eyex, eyey, eyez: double - @param eyex, eyey, eyez: Specifies the position of the eye point. - @type centerx, centery, centerz: double - @param centerx, centery, centerz: Specifies the position of the reference point. - @type upx, upy, upz: double - @param upx, upy, upz: Specifies the direction of the up vector. - """ - -def gluOrtho2D(left, right, bottom, top): - """ - Define a 2-D orthographic projection matrix - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074} - - @type left, right: double - @param left, right: Specify the coordinates for the left and right vertical clipping planes. - @type bottom, top: double - @param bottom, top: Specify the coordinates for the bottom and top horizontal clipping planes. - """ - -def gluPickMatrix(x, y, width, height, viewport): - """ - Define a picking region - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074} - - @type x, y: double - @param x, y: Specify the center of a picking region in window coordinates. - @type width, height: double - @param width, height: Specify the width and height, respectively, of the picking region in window coordinates. - @type viewport: Buffer object. [int] - @param viewport: Specifies the current viewport. - """ - -def gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, winx, winy, winz): - """ - Map object coordinates to window coordinates. - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074} - - @type objx, objy, objz: double - @param objx, objy, objz: Specify the object coordinates. - @type modelMatrix: Buffer object. [double] - @param modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call). - @type projMatrix: Buffer object. [double] - @param projMatrix: Specifies the current projection matrix (as from a glGetDoublev call). - @type viewport: Buffer object. [int] - @param viewport: Specifies the current viewport (as from a glGetIntegerv call). - @type winx, winy, winz: Buffer object. [double] - @param winx, winy, winz: Return the computed window coordinates. - """ - -def gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz): - """ - Map object coordinates to window - coordinates. - @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5582204} - - @type winx, winy, winz: double - @param winx, winy, winz: Specify the window coordinates to be mapped. - @type modelMatrix: Buffer object. [double] - @param modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call). - @type projMatrix: Buffer object. [double] - @param projMatrix: Specifies the current projection matrix (as from a glGetDoublev call). - @type viewport: Buffer object. [int] - @param viewport: Specifies the current viewport (as from a glGetIntegerv call). - @type objx, objy, objz: Buffer object. [double] - @param objx, objy, objz: Return the computed object coordinates. - """ - -class Buffer: - """ - The Buffer object is simply a block of memory that is delineated and initialized by the - user. Many OpenGL functions return data to a C-style pointer, however, because this - is not possible in python the Buffer object can be used to this end. Wherever pointer - notation is used in the OpenGL functions the Buffer object can be used in it's BGL - wrapper. In some instances the Buffer object will need to be initialized with the template - parameter, while in other instances the user will want to create just a blank buffer - which will be zeroed by default. - - Example with Buffer:: - import Blender - from Blender import BGL - myByteBuffer = BGL.Buffer(BGL.GL_BYTE, [32,32]) - BGL.glGetPolygonStipple(myByteBuffer) - print myByteBuffer.dimensions - print myByteBuffer.list - sliceBuffer = myByteBuffer[0:16] - print sliceBuffer - - @ivar list: The contents of the Buffer. - @ivar dimensions: The size of the Buffer. - """ - - def __init__(type, dimensions, template = None): - """ - This will create a new Buffer object for use with other BGL OpenGL commands. - Only the type of argument to store in the buffer and the dimensions of the buffer - are necessary. Buffers are zeroed by default unless a template is supplied, in - which case the buffer is initialized to the template. - - @type type: int - @param type: The format to store data in. The type should be one of - GL_BYTE, GL_SHORT, GL_INT, or GL_FLOAT. - @type dimensions: An int or sequence object specifying the dimensions of the buffer. - @param dimensions: If the dimensions are specified as an int a linear array will - be created for the buffer. If a sequence is passed for the dimensions, the buffer - becomes n-Dimensional, where n is equal to the number of parameters passed in the - sequence. Example: [256,2] is a two- dimensional buffer while [256,256,4] creates - a three- dimensional buffer. You can think of each additional dimension as a sub-item - of the dimension to the left. i.e. [10,2] is a 10 element array each with 2 sub-items. - [(0,0), (0,1), (1,0), (1,1), (2,0), ...] etc. - @type template: A python sequence object (optional) - @param template: A sequence of matching dimensions which will be used to initialize - the Buffer. If a template is not passed in all fields will be initialized to 0. - @rtype: Buffer object - @return: The newly created buffer as a PyObject. - """ diff --git a/source/blender/python/doc/epy/Geometry.py b/source/blender/python/doc/epy/Geometry.py deleted file mode 100644 index d0c4dfdfd8d..00000000000 --- a/source/blender/python/doc/epy/Geometry.py +++ /dev/null @@ -1,189 +0,0 @@ -# Blender.Geometry module and its subtypes - -""" -The Blender.Geometry submodule. - -Geometry -======== -(when accessing it from the Game Engine use Geometry instead of Blender.Geometry) - -This new module provides access to a geometry function. -""" - -def Intersect(vec1, vec2, vec3, ray, orig, clip=1): - """ - Return the intersection between a ray and a triangle, if possible, return None otherwise. - @type vec1: Vector object. - @param vec1: A 3d vector, one corner of the triangle. - @type vec2: Vector object. - @param vec2: A 3d vector, one corner of the triangle. - @type vec3: Vector object. - @param vec3: A 3d vector, one corner of the triangle. - @type ray: Vector object. - @param ray: A 3d vector, the orientation of the ray. the length of the ray is not used, only the direction. - @type orig: Vector object. - @param orig: A 3d vector, the origin of the ray. - @type clip: integer - @param clip: if 0, don't restrict the intersection to the area of the triangle, use the infinite plane defined by the triangle. - @rtype: Vector object - @return: The intersection between a ray and a triangle, if possible, None otherwise. - """ - -def TriangleArea(vec1, vec2, vec3): - """ - Return the area size of the 2D or 3D triangle defined. - @type vec1: Vector object. - @param vec1: A 2d or 3d vector, one corner of the triangle. - @type vec2: Vector object. - @param vec2: A 2d or 3d vector, one corner of the triangle. - @type vec3: Vector object. - @param vec3: A 2d or 3d vector, one corner of the triangle. - @rtype: float - @return: The area size of the 2D or 3D triangle defined. - """ - -def TriangleNormal(vec1, vec2, vec3): - """ - Return the normal of the 3D triangle defined. - @type vec1: Vector object. - @param vec1: A 3d vector, one corner of the triangle. - @type vec2: Vector object. - @param vec2: A 3d vector, one corner of the triangle. - @type vec3: Vector object. - @param vec3: A 3d vector, one corner of the triangle. - @rtype: float - @return: The normal of the 3D triangle defined. - """ - -def QuadNormal(vec1, vec2, vec3, vec4): - """ - Return the normal of the 3D quad defined. - @type vec1: Vector object. - @param vec1: A 3d vector, the first vertex of the quad. - @type vec2: Vector object. - @param vec2: A 3d vector, the second vertex of the quad. - @type vec3: Vector object. - @param vec3: A 3d vector, the third vertex of the quad. - @type vec4: Vector object. - @param vec4: A 3d vector, the fourth vertex of the quad. - @rtype: float - @return: The normal of the 3D quad defined. - """ - -def LineIntersect(vec1, vec2, vec3, vec4): - """ - Return a tuple with the points on each line respectively closest to the other - (when both lines intersect, both vector hold the same value). - The lines are evaluated as infinite lines in space, the values returned may not be between the 2 points given for each line. - @type vec1: Vector object. - @param vec1: A 3d vector, one point on the first line. - @type vec2: Vector object. - @param vec2: A 3d vector, another point on the first line. - @type vec3: Vector object. - @param vec3: A 3d vector, one point on the second line. - @type vec4: Vector object. - @param vec4: A 3d vector, another point on the second line. - @rtype: (Vector object, Vector object) - @return: A tuple with the points on each line respectively closest to the other. - """ - -def PolyFill(polylines): - """ - Takes a list of polylines and calculates triangles that would fill in the polylines. - Multiple lines can be used to make holes inside a polyline, or fill in 2 separate lines at once. - @type polylines: List of lists containing vectors, each representing a closed polyline. - @rtype: list - @return: a list if tuples each a tuple of 3 ints representing a triangle indexing the points given. - @note: 2D Vectors will have an assumed Z axis of zero, 4D Vectors W axis is ignored. - @note: The order of points in a polyline effect the direction returned triangles face, reverse the order of a polyline to flip the normal of returned faces. - - I{B{Example:}} - - The example below creates 2 polylines and fills them in with faces, then makes a mesh in the current scene:: - import Blender - Vector= Blender.mathutils.Vector - - # Outline of 5 points - polyline1= [Vector(-2.0, 1.0, 1.0), Vector(-1.0, 2.0, 1.0), Vector(1.0, 2.0, 1.0), Vector(1.0, -1.0, 1.0), Vector(-1.0, -1.0, 1.0)] - polyline2= [Vector(-1, 1, 1.0), Vector(0, 1, 1.0), Vector(0, 0, 1.0), Vector(-1.0, 0.0, 1.0)] - fill= Blender.Geometry.PolyFill([polyline1, polyline2]) - - # Make a new mesh and add the truangles into it - me= Blender.Mesh.New() - me.verts.extend(polyline1) - me.verts.extend(polyline2) - me.faces.extend(fill) # Add the faces, they reference the verts in polyline 1 and 2 - - scn = Blender.Scene.GetCurrent() - ob = scn.objects.new(me) - Blender.Redraw() - """ - -def LineIntersect2D(vec1, vec2, vec3, vec4): - """ - Takes 2 lines vec1, vec2 for the 2 points of the first line and vec2, vec3 for the 2 points of the second line. - @rtype: Vector - @return: a 2D Vector for the intersection or None where there is no intersection. - """ - -def ClosestPointOnLine(pt, vec1, vec2): - """ - Takes 2 lines vec1, vec2 for the 2 points of the first line and vec2, vec3 for the 2 points of the second line. - @rtype: tuple - @return: a tuple containing a vector and a float, the vector is the closest point on the line, the float is the position on the line, between 0 and 1 the point is on the line. - """ - -def PointInTriangle2D(pt, tri_pt1, tri_pt2, tri_pt3): - """ - Takes 4 vectors (one for the test point and 3 for the triangle) - This is a 2d function so only X and Y are used, Z and W will be ignored. - @rtype: int - @return: 1 for a clockwise intersection, -1 for counter clockwise intersection, 0 when there is no intersection. - """ - -def PointInQuad2D(pt, quad_pt1, quad_pt2, quad_pt3): - """ - Takes 5 vectors (one for the test point and 5 for the quad) - This is a 2d function so only X and Y are used, Z and W will be ignored. - @rtype: int - @return: 1 for a clockwise intersection, -1 for counter clockwise intersection, 0 when there is no intersection. - """ - -def BoxPack2D(boxlist): - """ - Takes a list of 2D boxes and packs them into a square. - Each box in boxlist must be a list of at least 4 items - [x,y,w,h], after running this script, - the X and Y values in each box will be moved to packed, non overlapping locations. - - Example:: - - # Make 500 random boxes, pack them and make a mesh from it - from Blender import Geometry, Scene, Mesh - import random - boxes = [] - for i in xrange(500): - boxes.append( [0,0, random.random()+0.1, random.random()+0.1] ) - boxsize = Geometry.BoxPack2D(boxes) - print 'BoxSize', boxsize - me = Mesh.New() - for x in boxes: - me.verts.extend([(x[0],x[1], 0), (x[0],x[1]+x[3], 0), (x[0]+x[2],x[1]+x[3], 0), (x[0]+x[2],x[1], 0) ]) - v1= me.verts[-1] - v2= me.verts[-2] - v3= me.verts[-3] - v4= me.verts[-4] - me.faces.extend([(v1,v2,v3,v4)]) - scn = Scene.GetCurrent() - scn.objects.new(me) - - @note: Each boxlist item can be longer then 4, the extra items are ignored and stay untouched. - @rtype: tuple - @return: a tuple pair - (width, height) of all the packed boxes. - """ -def BezierInterp(vec_knot_1, vec_handle_1, vec_handle_2, vec_knot_2, resolution): - """ - Takes 4 vectors representing a bezier curve and returns a list of vector points. - @note: any vector size is supported, the largest dimension from the input will be used for all returned vectors/ - @rtype: list - @return: a list of vectors the size of resolution including the start and end points (vec_knot_1 and vec_knot_2) - """ diff --git a/source/blender/python/doc/epy/IDProp.py b/source/blender/python/doc/epy/IDProp.py deleted file mode 100644 index 1fc26d7f65b..00000000000 --- a/source/blender/python/doc/epy/IDProp.py +++ /dev/null @@ -1,132 +0,0 @@ -class IDGroup: - """ - The IDGroup Type - ================ - This type supports both iteration and the [] - operator to get child ID properties. - - You can also add new properties using the [] operator. - For example:: - - group['a float!'] = 0.0 - group['an int!'] = 0 - group['a string!'] = "hi!" - group['an array!'] = [0, 0, 1.0, 0] - - group['a subgroup!] = {"float": 0.0, "an int": 1.0, "an array": [1, 2], - "another subgroup": {"a": 0.0, "str": "bleh"}} - - Note that for arrays, the array type defaults to int unless a float is found - while scanning the template list; if any floats are found, then the whole - array is float. Note that double-precision floating point numbers are used for - python-created float ID properties and arrays (though the internal C api does - support single-precision floats, and the python code will read them). - - You can also delete properties with the del operator. For example: - - del group['property'] - - To get the type of a property, use the type() operator, for example:: - - if type(group['bleh']) == str: pass - - To tell if the property is a group or array type, import the Blender.Types module and test - against IDGroupType and IDArrayType, like so:: - - from Blender.Types import IDGroupType, IDArrayType. - - if type(group['bleghr']) == IDGroupType: - (do something) - - @ivar name: The name of the property - @type name: string - """ - - def pop(item): - """ - Pop an item from the group property. - @type item: string - @param item: The item name. - @rtype: can be dict, list, int, float or string. - @return: The removed property. - """ - - def update(updatedict): - """ - Updates items in the dict, similar to normal python - dictionary method .update(). - @type updatedict: dict - @param updatedict: A dict of simple types to derive updated/new IDProperties from. - @rtype: None - @return: None - """ - - def keys(): - """ - Returns a list of the keys in this property group. - @rtype: list of strings. - @return: a list of the keys in this property group. - """ - - def values(): - """ - Returns a list of the values in this property group. - - Note that unless a value is itself a property group or an array, you - cannot change it by changing the values in this list, you must change them - in the parent property group. - - For example, - - group['some_property'] = new_value - - . . .is correct, while, - - values = group.values() - values[0] = new_value - - . . .is wrong. - - @rtype: list of strings. - @return: a list of the values in this property group. - """ - - def iteritems(): - """ - Implements the python dictionary iteritmes method. - - For example:: - - for k, v in group.iteritems(): - print "Property name: " + k - print "Property value: " + str(v) - - @rtype: an iterator that spits out items of the form [key, value] - @return: an iterator. - """ - - def convert_to_pyobject(): - """ - Converts the entire property group to a purely python form. - - @rtype: dict - @return: A python dictionary representing the property group - """ - -class IDArray: - """ - The IDArray Type - ================ - - @ivar type: returns the type of the array, can be either IDP_Int or IDP_Float - """ - - def __getitem__(index): - pass - - def __setitem__(index, value): - pass - - def __len__(): - pass - diff --git a/source/blender/python/doc/epy/Mathutils.py b/source/blender/python/doc/epy/Mathutils.py deleted file mode 100644 index 17a227f729a..00000000000 --- a/source/blender/python/doc/epy/Mathutils.py +++ /dev/null @@ -1,156 +0,0 @@ -# Blender.mathutils module and its subtypes - - - -class Vector: - """ - - @attention: Vector data can be wrapped or non-wrapped. When a object is wrapped it - means that the object will give you direct access to the data inside of blender. Modification - of this object will directly change the data inside of blender. To copy a wrapped object - you need to use the object's constructor. If you copy and object by assignment you will not get - a second copy but a second reference to the same data. Only certain functions will return - wrapped data. This will be indicated in the method description. - """ - - def __init__(list = None): - """ - Create a new 2d, 3d, or 4d Vector object from a list of floating point numbers. - @note: that python uses higher precission floating point numbers, so values assigned to a vector may have some rounding error. - - - Example:: - v = Vector(1,0,0) - v = Vector(myVec) - v = Vector(list) - @type list: PyList of float or int - @param list: The list of values for the Vector object. Can be a sequence or raw numbers. - Must be 2, 3, or 4 values. The list is mapped to the parameters as [x,y,z,w]. - @rtype: Vector object. - @return: It depends wheter a parameter was passed: - - (list): Vector object initialized with the given values; - - (): An empty 3 dimensional vector. - """ - -class Euler: - """ - The Euler object - ================ - This object gives access to Eulers in Blender. - @note: You can access a euler object like a sequence - - x = euler[0] - @note: Comparison operators can be done: - - ==, != test numeric values within epsilon - @attention: Euler data can be wrapped or non-wrapped. When a object is wrapped it - means that the object will give you direct access to the data inside of blender. Modification - of this object will directly change the data inside of blender. To copy a wrapped object - you need to use the object's constructor. If you copy and object by assignment you will not get - a second copy but a second reference to the same data. Only certain functions will return - wrapped data. This will be indicated in the method description. - """ - - def __init__(list = None): - """ - Create a new euler object. - - Example:: - euler = Euler(45,0,0) - euler = Euler(myEuler) - euler = Euler(sequence) - @type list: PyList of float/int - @param list: 3d list to initialize euler - @rtype: Euler object - @return: Euler representing heading, pitch, bank. - @note: Values are in degrees. - """ - -class Quaternion: - """ - The Quaternion object - ===================== - This object gives access to Quaternions in Blender. - @note: Comparison operators can be done: - - ==, != test numeric values within epsilon - @note: Math can be performed on Quaternion classes - - quat + quat - - quat - quat - - quat * float/int - - quat * vec - - quat * quat - @note: You can access a quaternion object like a sequence - - x = quat[0] - @attention: Quaternion data can be wrapped or non-wrapped. When a object is wrapped it - means that the object will give you direct access to the data inside of blender. Modification - of this object will directly change the data inside of blender. To copy a wrapped object - you need to use the object's constructor. If you copy and object by assignment you will not get - a second copy but a second reference to the same data. Only certain functions will return - wrapped data. This will be indicated in the method description. - """ - - def __init__(list, angle = None): - """ - Create a new quaternion object from initialized values. - - Example:: - quat = Quaternion(1,2,3,4) - quat = Quaternion(axis, angle) - quat = Quaternion() - quat = Quaternion(180, list) - - @type list: PyList of int/float - @param list: A 3d or 4d list to initialize quaternion. - 4d if intializing [w,x,y,z], 3d if used as an axis of rotation. - @type angle: float (optional) - @param angle: An arbitrary rotation amount around 'list'. - List is used as an axis of rotation in this case. - @rtype: New quaternion object. - @return: It depends wheter a parameter was passed: - - (list/angle): Quaternion object initialized with the given values; - - (): An identity 4 dimensional quaternion. - """ - -class Matrix: - """ - The Matrix Object - ================= - @note: Math can be performed on Matrix classes - - mat + mat - - mat - mat - - mat * float/int - - mat * vec - - mat * mat - @note: Comparison operators can be done: - - ==, != test numeric values within epsilon - @note: You can access a quaternion object like a 2d sequence - - x = matrix[0][1] - - vector = matrix[2] - @attention: Quaternion data can be wrapped or non-wrapped. When a object is wrapped it - means that the object will give you direct access to the data inside of blender. Modification - of this object will directly change the data inside of blender. To copy a wrapped object - you need to use the object's constructor. If you copy and object by assignment you will not get - a second copy but a second reference to the same data. Only certain functions will return - wrapped data. This will be indicated in the method description. - """ - - def __init__(list1 = None, list2 = None, list3 = None, list4 = None): - """ - Create a new matrix object from initialized values. - - Example:: - matrix = Matrix([1,1,1],[0,1,0],[1,0,0]) - matrix = Matrix(mat) - matrix = Matrix(seq1, seq2, vector) - - @type list1: PyList of int/float - @param list1: A 2d,3d or 4d list. - @type list2: PyList of int/float - @param list2: A 2d,3d or 4d list. - @type list3: PyList of int/float - @param list3: A 2d,3d or 4d list. - @type list4: PyList of int/float - @param list4: A 2d,3d or 4d list. - @rtype: New matrix object. - @return: It depends wheter a parameter was passed: - - (list1, etc.): Matrix object initialized with the given values; - - (): An empty 3 dimensional matrix. - """ diff --git a/source/blender/python/doc/epy/testbgl.py b/source/blender/python/doc/epy/testbgl.py deleted file mode 100644 index e895d01df69..00000000000 --- a/source/blender/python/doc/epy/testbgl.py +++ /dev/null @@ -1,45 +0,0 @@ -# Testing the BGL module - -import Blender -from Blender.BGL import * -from Blender import Draw - -R = G = B = 0 -A = 1 - -instructions = "Hold mouse buttons to change the background color." -quitting = " Press ESC or q to quit." - -def show_win(): - glClearColor(R,G,B,A) # define color used to clear buffers - glClear(GL_COLOR_BUFFER_BIT) # use it to clear the color buffer - glColor3f(1,1,1) # change default color - glRasterPos2i(50,100) # move cursor to x = 50, y = 100 - Draw.Text("Testing BGL + Draw") # draw this text there - glRasterPos2i(350,20) # move cursor again - Draw.Text(instructions + quitting) # draw another msg - glBegin(GL_LINE_LOOP) # begin a vertex-data list - glVertex2i(46,92) - glVertex2i(120,92) - glVertex2i(120,115) - glVertex2i(46,115) - glEnd() # close this list - glColor3f(0.35,0.18,0.92) # change default color again - glBegin(GL_POLYGON) # another list, for a polygon - glVertex2i(315, 292) - glVertex2i(412, 200) - glVertex2i(264, 256) - glEnd() - Draw.Redraw(1) # make changes visible. - -def ev(evt, val): # this is a callback for Draw.Register() - global R,G,B,A # it handles input events - if evt == Draw.ESCKEY or evt == Draw.QKEY: - Draw.Exit() # this quits the script - elif evt == Draw.LEFTMOUSE: R = 1 - R - elif evt == Draw.MIDDLEMOUSE: G = 1 - G - elif evt == Draw.RIGHTMOUSE: B = 1 - B - else: - Draw.Register(show_win, ev, None) - -Draw.Register(show_win, ev, None) # start the main loop diff --git a/source/blender/python/doc/examples/bpy.data.py b/source/blender/python/doc/examples/bpy.data.py deleted file mode 100644 index fc1145a523f..00000000000 --- a/source/blender/python/doc/examples/bpy.data.py +++ /dev/null @@ -1,29 +0,0 @@ -import bpy - - -# print all objects -for obj in bpy.data.objects: - print(obj.name) - - -# print all scene names in a list -print(bpy.data.scenes.keys()) - - -# remove mesh Cube -if "Cube" in bpy.data.meshes: - mesh = bpy.data.meshes["Cube"] - print("removing mesh", mesh) - bpy.data.meshes.unlink(mesh) - - -# write images into a file next to the blend -import os -file = open(os.path.splitext(bpy.data.filepath)[0] + ".txt", 'w') - -for image in bpy.data.images: - file.write("%s %dx%d\n" % (image.filepath, image.size[0], image.size[1])) - -file.close() - - diff --git a/source/blender/python/doc/examples/mathutils.Euler.py b/source/blender/python/doc/examples/mathutils.Euler.py deleted file mode 100644 index bc7702c1d53..00000000000 --- a/source/blender/python/doc/examples/mathutils.Euler.py +++ /dev/null @@ -1,3 +0,0 @@ -import mathutils - -# todo diff --git a/source/blender/python/doc/examples/mathutils.Matrix.py b/source/blender/python/doc/examples/mathutils.Matrix.py deleted file mode 100644 index bc7702c1d53..00000000000 --- a/source/blender/python/doc/examples/mathutils.Matrix.py +++ /dev/null @@ -1,3 +0,0 @@ -import mathutils - -# todo diff --git a/source/blender/python/doc/examples/mathutils.Quaternion.py b/source/blender/python/doc/examples/mathutils.Quaternion.py deleted file mode 100644 index bc7702c1d53..00000000000 --- a/source/blender/python/doc/examples/mathutils.Quaternion.py +++ /dev/null @@ -1,3 +0,0 @@ -import mathutils - -# todo diff --git a/source/blender/python/doc/examples/mathutils.Vector.py b/source/blender/python/doc/examples/mathutils.Vector.py deleted file mode 100644 index fb00e8aead6..00000000000 --- a/source/blender/python/doc/examples/mathutils.Vector.py +++ /dev/null @@ -1,55 +0,0 @@ -import mathutils - -# zero length vector -vec = mathutils.Vector((0, 0, 1)) - -# unit length vector -vec_a = vec.copy().normalize() - -vec_b = mathutils.Vector((0, 1, 2)) - -vec2d = mathutils.Vector((1, 2)) -vec3d = mathutils.Vector((1, 0, 0)) -vec4d = vec_a.copy().resize4D() - -# other mathutuls types -quat = mathutils.Quaternion() -matrix = mathutils.Matrix() - -# Comparison operators can be done on Vector classes: - -# greater and less then test vector length. -vec_a > vec_b -vec_a >= vec_b -vec_a < vec_b -vec_a <= vec_b - -# ==, != test vector values e.g. 1,2,3 != 3,2,1 even if they are the same length -vec_a == vec_b -vec_a != vec_b - - -# Math can be performed on Vector classes -vec_a + vec_b -vec_a - vec_b -vec_a * vec_b -vec_a * 10.0 -vec_a * matrix -vec_a * vec_b -vec_a * quat --vec_a - - -# You can access a vector object like a sequence -x = vec_a[0] -len(vec) -vec_a[:] = vec_b -vec2d[:] = vec3d[:2] - - -# Vectors support 'swizzle' operations -# See http://en.wikipedia.org/wiki/Swizzling_(computer_graphics) -vec.xyz = vec.zyx -vec.xy = vec4d.zw -vec.xyz = vec4d.wzz -vec4d.wxyz = vec.yxyx diff --git a/source/blender/python/doc/examples/mathutils.py b/source/blender/python/doc/examples/mathutils.py deleted file mode 100644 index 02f69515f21..00000000000 --- a/source/blender/python/doc/examples/mathutils.py +++ /dev/null @@ -1,18 +0,0 @@ -import mathutils -from math import radians - -vec = mathutils.Vector((1.0, 2.0, 3.0)) - -mat_rot = mathutils.Matrix.Rotation(radians(90), 4, 'X') -mat_trans = mathutils.Matrix.Translation(vec) - -mat = mat_trans * mat_rot -mat.invert() - -mat3 = mat.rotation_part() -quat1 = mat.to_quat() -quat2 = mat3.to_quat() - -angle = quat1.difference(quat2) - -print(angle) diff --git a/source/blender/python/doc/sphinx_doc_gen.py b/source/blender/python/doc/sphinx_doc_gen.py deleted file mode 100644 index b20cd74f82a..00000000000 --- a/source/blender/python/doc/sphinx_doc_gen.py +++ /dev/null @@ -1,862 +0,0 @@ - # ***** BEGIN GPL LICENSE BLOCK ***** - # - # This program is free software; you can redistribute it and/or - # modify it under the terms of the GNU General Public License - # as published by the Free Software Foundation; either version 2 - # of the License, or (at your option) any later version. - # - # This program is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License - # along with this program; if not, write to the Free Software Foundation, - # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - # - # Contributor(s): Campbell Barton - # - # #**** END GPL LICENSE BLOCK #**** - -script_help_msg = ''' -Usage, -run this script from blenders root path once you have compiled blender - ./blender.bin -b -P /b/source/blender/python/doc/sphinx_doc_gen.py - -This will generate python files in "./source/blender/python/doc/sphinx-in" -Generate html docs by running... - - sphinx-build source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out - - -For PDF generation - - sphinx-build -b latex source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out - cd source/blender/python/doc/sphinx-out - make -''' - -# import rpdb2; rpdb2.start_embedded_debugger('test') - -import os -import inspect -import bpy -import rna_info -reload(rna_info) - -# lame, python wont give some access -ClassMethodDescriptorType = type(dict.__dict__['fromkeys']) -MethodDescriptorType = type(dict.get) -GetSetDescriptorType = type(int.real) - -EXAMPLE_SET = set() -EXAMPLE_SET_USED = set() - -_BPY_STRUCT_FAKE = "bpy_struct" -_BPY_FULL_REBUILD = False - -def undocumented_message(module_name, type_name, identifier): - message = "Undocumented (`contribute " \ - "`_)\n\n" % (module_name, type_name, identifier) - return message - - -def range_str(val): - ''' - Converts values to strings for the range directive. - (unused function it seems) - ''' - if val < -10000000: return '-inf' - if val > 10000000: return 'inf' - if type(val)==float: - return '%g' % val - else: - return str(val) - - -def write_example_ref(ident, fw, example_id, ext="py"): - if example_id in EXAMPLE_SET: - fw("%s.. literalinclude:: ../examples/%s.%s\n\n" % (ident, example_id, ext)) - EXAMPLE_SET_USED.add(example_id) - else: - if bpy.app.debug: - print("\tskipping example:", example_id) - - -def write_indented_lines(ident, fn, text, strip=True): - ''' - Apply same indentation to all lines in a multilines text. - ''' - if text is None: - return - for l in text.split("\n"): - if strip: - fn(ident + l.strip() + "\n") - else: - fn(ident + l + "\n") - - -def pymethod2sphinx(ident, fw, identifier, py_func): - ''' - class method to sphinx - ''' - arg_str = inspect.formatargspec(*inspect.getargspec(py_func)) - if arg_str.startswith("(self, "): - arg_str = "(" + arg_str[7:] - func_type = "method" - elif arg_str.startswith("(cls, "): - arg_str = "(" + arg_str[6:] - func_type = "classmethod" - else: - func_type = "staticmethod" - - fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str)) - if py_func.__doc__: - write_indented_lines(ident + " ", fw, py_func.__doc__) - fw("\n") - - -def pyfunc2sphinx(ident, fw, identifier, py_func, is_class=True): - ''' - function or class method to sphinx - ''' - arg_str = inspect.formatargspec(*inspect.getargspec(py_func)) - - if not is_class: - func_type = "function" - - # ther rest are class methods - elif arg_str.startswith("(self, "): - arg_str = "(" + arg_str[7:] - func_type = "method" - elif arg_str.startswith("(cls, "): - arg_str = "(" + arg_str[6:] - func_type = "classmethod" - else: - func_type = "staticmethod" - - fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str)) - if py_func.__doc__: - write_indented_lines(ident + " ", fw, py_func.__doc__.strip()) - fw("\n") - - -def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier): - if identifier.startswith("_"): - return - - doc = descr.__doc__ - if not doc: - doc = undocumented_message(module_name, type_name, identifier) - - if type(descr) == GetSetDescriptorType: - fw(ident + ".. attribute:: %s\n\n" % identifier) - write_indented_lines(ident + " ", fw, doc, False) - elif type(descr) in (MethodDescriptorType, ClassMethodDescriptorType): - write_indented_lines(ident, fw, doc, False) - else: - raise TypeError("type was not GetSetDescriptorType, MethodDescriptorType or ClassMethodDescriptorType") - - write_example_ref(ident, fw, module_name + "." + type_name + "." + identifier) - fw("\n") - - -def py_c_func2sphinx(ident, fw, module_name, type_name, identifier, py_func, is_class=True): - ''' - c defined function to sphinx. - ''' - - # dump the docstring, assume its formatted correctly - if py_func.__doc__: - write_indented_lines(ident, fw, py_func.__doc__, False) - fw("\n") - else: - fw(ident + ".. function:: %s()\n\n" % identifier) - fw(ident + " " + undocumented_message(module_name, type_name, identifier)) - - -def pyprop2sphinx(ident, fw, identifier, py_prop): - ''' - python property to sphinx - ''' - # readonly properties use "data" directive, variables use "attribute" directive - if py_prop.fset is None: - fw(ident + ".. data:: %s\n\n" % identifier) - else: - fw(ident + ".. attribute:: %s\n\n" % identifier) - write_indented_lines(ident + " ", fw, py_prop.__doc__) - if py_prop.fset is None: - fw(ident + " (readonly)\n\n") - - -def pymodule2sphinx(BASEPATH, module_name, module, title): - import types - attribute_set = set() - filepath = os.path.join(BASEPATH, module_name + ".rst") - - file = open(filepath, "w") - - fw = file.write - - fw(title + "\n") - fw(("=" * len(title)) + "\n\n") - - fw(".. module:: %s\n\n" % module_name) - - if module.__doc__: - # Note, may contain sphinx syntax, dont mangle! - fw(module.__doc__.strip()) - fw("\n\n") - - write_example_ref("", fw, module_name) - - # write members of the module - # only tested with PyStructs which are not exactly modules - for key, descr in sorted(type(module).__dict__.items()): - if type(descr) == types.MemberDescriptorType: - if descr.__doc__: - fw(".. data:: %s\n\n" % key) - write_indented_lines(" ", fw, descr.__doc__, False) - attribute_set.add(key) - fw("\n") - del key, descr - - classes = [] - - for attribute in sorted(dir(module)): - if not attribute.startswith("_"): - - if attribute in attribute_set: - continue - - if attribute.startswith("n_"): # annoying exception, needed for bpy.app - continue - - value = getattr(module, attribute) - - value_type = type(value) - - if value_type == types.FunctionType: - pyfunc2sphinx("", fw, attribute, value, is_class=False) - elif value_type in (types.BuiltinMethodType, types.BuiltinFunctionType): # both the same at the moment but to be future proof - # note: can't get args from these, so dump the string as is - # this means any module used like this must have fully formatted docstrings. - py_c_func2sphinx("", fw, module_name, module, attribute, value, is_class=False) - elif value_type == type: - classes.append((attribute, value)) - elif value_type in (bool, int, float, str, tuple): - # constant, not much fun we can do here except to list it. - # TODO, figure out some way to document these! - fw(".. data:: %s\n\n" % attribute) - write_indented_lines(" ", fw, "constant value %s" % repr(value), False) - fw("\n") - else: - print("\tnot documenting %s.%s" % (module_name, attribute)) - continue - - attribute_set.add(attribute) - # TODO, more types... - - # write collected classes now - for (type_name, value) in classes: - # May need to be its own function - fw(".. class:: %s\n\n" % type_name) - if value.__doc__: - write_indented_lines(" ", fw, value.__doc__, False) - fw("\n") - write_example_ref(" ", fw, module_name + "." + type_name) - - descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("__")] - - for key, descr in descr_items: - if type(descr) == ClassMethodDescriptorType: - py_descr2sphinx(" ", fw, descr, module_name, type_name, key) - - for key, descr in descr_items: - if type(descr) == MethodDescriptorType: - py_descr2sphinx(" ", fw, descr, module_name, type_name, key) - - for key, descr in descr_items: - if type(descr) == GetSetDescriptorType: - py_descr2sphinx(" ", fw, descr, module_name, type_name, key) - - fw("\n\n") - - file.close() - - - -def rna2sphinx(BASEPATH): - - structs, funcs, ops, props = rna_info.BuildRNAInfo() - - try: - os.mkdir(BASEPATH) - except: - pass - - # conf.py - empty for now - filepath = os.path.join(BASEPATH, "conf.py") - file = open(filepath, "w") - fw = file.write - - - version_string = bpy.app.version_string.split("(")[0] - if bpy.app.build_revision != "Unknown": - version_string = version_string + " r" + bpy.app.build_revision - - # for use with files - version_string_fp = "_".join(str(v) for v in bpy.app.version) - - fw("project = 'Blender'\n") - # fw("master_doc = 'index'\n") - fw("copyright = u'Blender Foundation'\n") - fw("version = '%s - UNSTABLE API'\n" % version_string) - fw("release = '%s - UNSTABLE API'\n" % version_string) - fw("html_theme = 'blender-org'\n") - fw("html_theme_path = ['../']\n") - fw("html_favicon = 'favicon.ico'\n") - # not helpful since the source us generated, adds to upload size. - fw("html_copy_source = False\n") - fw("\n") - # needed for latex, pdf gen - fw("latex_documents = [ ('contents', 'contents.tex', 'Blender Index', 'Blender Foundation', 'manual'), ]\n") - fw("latex_paper_size = 'a4paper'\n") - file.close() - - - filepath = os.path.join(BASEPATH, "contents.rst") - file = open(filepath, "w") - fw = file.write - - fw("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n") - fw(" Blender Documentation contents\n") - fw("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n") - fw("\n") - fw("This document is an API reference for Blender %s. built %s.\n" % (version_string, bpy.app.build_date)) - fw("\n") - fw("An introduction to Blender and Python can be found at \n") - fw("\n") - fw("`A PDF version of this document is also available `__\n" % version_string_fp) - fw("\n") - fw(".. warning:: The Python API in Blender is **UNSTABLE**, It should only be used for testing, any script written now may break in future releases.\n") - fw(" \n") - fw(" The following areas are subject to change.\n") - fw(" * operator names and arguments\n") - fw(" * render api\n") - fw(" * function calls with the data api (any function calls with values accessed from bpy.data), including functions for importing and exporting meshes\n") - fw(" * class registration (Operator, Panels, Menus, Headers)\n") - fw(" * modules: bpy.props, blf)\n") - fw(" * members in the bpy.context have to be reviewed\n") - fw(" * python defined modal operators, especially drawing callbacks are highly experemental\n") - fw(" \n") - fw(" These parts of the API are relatively stable and are unlikely to change significantly\n") - fw(" * data API, access to attributes of blender data such as mesh verts, material color, timeline frames and scene objects\n") - fw(" * user interface functions for defining buttons, creation of menus, headers, panels\n") - fw(" * modules: bgl, mathutils and geometry\n") - fw(" * game engine modules\n") - fw("\n") - - fw("===================\n") - fw("Application Modules\n") - fw("===================\n") - fw("\n") - fw(".. toctree::\n") - fw(" :maxdepth: 1\n\n") - fw(" bpy.data.rst\n\n") # note: not actually a module - fw(" bpy.ops.rst\n\n") - fw(" bpy.types.rst\n\n") - - # py modules - fw(" bpy.utils.rst\n\n") - fw(" bpy.path.rst\n\n") - fw(" bpy.app.rst\n\n") - - # C modules - fw(" bpy.props.rst\n\n") - - fw("==================\n") - fw("Standalone Modules\n") - fw("==================\n") - fw("\n") - fw(".. toctree::\n") - fw(" :maxdepth: 1\n\n") - - - fw(" mathutils.rst\n\n") - fw(" blf.rst\n\n") - fw(" aud.rst\n\n") - - # game engine - fw("===================\n") - fw("Game Engine Modules\n") - fw("===================\n") - fw("\n") - fw(".. toctree::\n") - fw(" :maxdepth: 1\n\n") - fw(" bge.types.rst\n\n") - fw(" bge.logic.rst\n\n") - fw(" bge.render.rst\n\n") - fw(" bge.events.rst\n\n") - - file.close() - - - # internal modules - filepath = os.path.join(BASEPATH, "bpy.ops.rst") - file = open(filepath, "w") - fw = file.write - fw("Operators (bpy.ops)\n") - fw("===================\n\n") - fw(".. toctree::\n") - fw(" :glob:\n\n") - fw(" bpy.ops.*\n\n") - file.close() - - filepath = os.path.join(BASEPATH, "bpy.types.rst") - file = open(filepath, "w") - fw = file.write - fw("Types (bpy.types)\n") - fw("=================\n\n") - fw(".. toctree::\n") - fw(" :glob:\n\n") - fw(" bpy.types.*\n\n") - file.close() - - - # not actually a module, only write this file so we - # can reference in the TOC - filepath = os.path.join(BASEPATH, "bpy.data.rst") - file = open(filepath, "w") - fw = file.write - fw("Data Access (bpy.data)\n") - fw("======================\n\n") - fw(".. module:: bpy\n") - fw("\n") - fw("This module is used for all blender/python access.\n") - fw("\n") - fw(".. literalinclude:: ../examples/bpy.data.py\n") - fw("\n") - fw(".. data:: data\n") - fw("\n") - fw(" Access to blenders internal data\n") - fw("\n") - fw(" :type: :class:`bpy.types.BlendData`\n") - file.close() - - EXAMPLE_SET_USED.add("bpy.data") - - - # python modules - from bpy import utils as module - pymodule2sphinx(BASEPATH, "bpy.utils", module, "Utilities (bpy.utils)") - - from bpy import path as module - pymodule2sphinx(BASEPATH, "bpy.path", module, "Path Utilities (bpy.path)") - - # C modules - from bpy import app as module - pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data (bpy.app)") - - from bpy import props as module - pymodule2sphinx(BASEPATH, "bpy.props", module, "Property Definitions (bpy.props)") - - import mathutils as module - pymodule2sphinx(BASEPATH, "mathutils", module, "Math Types & Utilities (mathutils)") - del module - - import blf as module - pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing (blf)") - del module - - import aud as module - pymodule2sphinx(BASEPATH, "aud", module, "Audio System (aud)") - del module - - # game engine - import shutil - # copy2 keeps time/date stamps - shutil.copy2(os.path.join(BASEPATH, "../../../../gameengine/PyDoc/bge.types.rst"), BASEPATH) - shutil.copy2(os.path.join(BASEPATH, "../../../../gameengine/PyDoc/bge.logic.rst"), BASEPATH) - shutil.copy2(os.path.join(BASEPATH, "../../../../gameengine/PyDoc/bge.render.rst"), BASEPATH) - shutil.copy2(os.path.join(BASEPATH, "../../../../gameengine/PyDoc/bge.events.rst"), BASEPATH) - - - if 0: - filepath = os.path.join(BASEPATH, "bpy.rst") - file = open(filepath, "w") - fw = file.write - - fw("\n") - - title = ":mod:`bpy` --- Blender Python Module" - fw("%s\n%s\n\n" % (title, "=" * len(title))) - fw(".. module:: bpy.types\n\n") - file.close() - - def write_param(ident, fw, prop, is_return=False): - if is_return: - id_name = "return" - id_type = "rtype" - kwargs = {"as_ret": True, "class_fmt": ":class:`%s`"} - identifier = "" - else: - id_name = "arg" - id_type = "type" - kwargs = {"as_arg": True, "class_fmt": ":class:`%s`"} - identifier = " %s" % prop.identifier - - type_descr = prop.get_type_description(**kwargs) - if prop.name or prop.description: - fw(ident + ":%s%s: %s\n" % (id_name, identifier, ", ".join(val for val in (prop.name, prop.description) if val))) - fw(ident + ":%s%s: %s\n" % (id_type, identifier, type_descr)) - - def write_struct(struct): - #if not struct.identifier.startswith("Sc") and not struct.identifier.startswith("I"): - # return - - #if not struct.identifier == "Object": - # return - - filepath = os.path.join(BASEPATH, "bpy.types.%s.rst" % struct.identifier) - file = open(filepath, "w") - fw = file.write - - base_id = getattr(struct.base, "identifier", "") - - if _BPY_STRUCT_FAKE: - if not base_id: - base_id = _BPY_STRUCT_FAKE - - if base_id: - title = "%s(%s)" % (struct.identifier, base_id) - else: - title = struct.identifier - - fw("%s\n%s\n\n" % (title, "=" * len(title))) - - fw(".. module:: bpy.types\n\n") - - base_ids = [base.identifier for base in struct.get_bases()] - - if _BPY_STRUCT_FAKE: - base_ids.append(_BPY_STRUCT_FAKE) - - base_ids.reverse() - - if base_ids: - if len(base_ids) > 1: - fw("base classes --- ") - else: - fw("base class --- ") - - fw(", ".join((":class:`%s`" % base_id) for base_id in base_ids)) - fw("\n\n") - - subclass_ids = [s.identifier for s in structs.values() if s.base is struct if not rna_info.rna_id_ignore(s.identifier)] - if subclass_ids: - fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in subclass_ids) + "\n\n") - - base_id = getattr(struct.base, "identifier", "") - - if _BPY_STRUCT_FAKE: - if not base_id: - base_id = _BPY_STRUCT_FAKE - - if base_id: - fw(".. class:: %s(%s)\n\n" % (struct.identifier, base_id)) - else: - fw(".. class:: %s\n\n" % struct.identifier) - - fw(" %s\n\n" % struct.description) - - # properties sorted in alphabetical order - sorted_struct_properties = struct.properties[:] - sorted_struct_properties.sort(key=lambda prop: prop.identifier) - - for prop in sorted_struct_properties: - type_descr = prop.get_type_description(class_fmt=":class:`%s`") - # readonly properties use "data" directive, variables properties use "attribute" directive - if 'readonly' in type_descr: - fw(" .. data:: %s\n\n" % prop.identifier) - else: - fw(" .. attribute:: %s\n\n" % prop.identifier) - if prop.description: - fw(" %s\n\n" % prop.description) - fw(" :type: %s\n\n" % type_descr) - - # python attributes - py_properties = struct.get_py_properties() - py_prop = None - for identifier, py_prop in py_properties: - pyprop2sphinx(" ", fw, identifier, py_prop) - del py_properties, py_prop - - for func in struct.functions: - args_str = ", ".join(prop.get_arg_default(force=False) for prop in func.args) - - fw(" .. %s:: %s(%s)\n\n" % ("classmethod" if func.is_classmethod else "method", func.identifier, args_str)) - fw(" %s\n\n" % func.description) - - for prop in func.args: - write_param(" ", fw, prop) - - if len(func.return_values) == 1: - write_param(" ", fw, func.return_values[0], is_return=True) - elif func.return_values: # multiple return values - fw(" :return (%s):\n" % ", ".join(prop.identifier for prop in func.return_values)) - for prop in func.return_values: - type_descr = prop.get_type_description(as_ret=True, class_fmt=":class:`%s`") - descr = prop.description - if not descr: - descr = prop.name - fw(" `%s`, %s, %s\n\n" % (prop.identifier, descr, type_descr)) - - fw("\n") - - - # python methods - py_funcs = struct.get_py_functions() - py_func = None - - for identifier, py_func in py_funcs: - pyfunc2sphinx(" ", fw, identifier, py_func, is_class=True) - del py_funcs, py_func - - lines = [] - - if struct.base or _BPY_STRUCT_FAKE: - bases = list(reversed(struct.get_bases())) - - # props - lines[:] = [] - - if _BPY_STRUCT_FAKE: - descr_items = [(key, descr) for key, descr in sorted(bpy.types.Struct.__bases__[0].__dict__.items()) if not key.startswith("__")] - - if _BPY_STRUCT_FAKE: - for key, descr in descr_items: - if type(descr) == GetSetDescriptorType: - lines.append(" * :class:`%s.%s`\n" % (_BPY_STRUCT_FAKE, key)) - - for base in bases: - for prop in base.properties: - lines.append(" * :class:`%s.%s`\n" % (base.identifier, prop.identifier)) - - for identifier, py_prop in base.get_py_properties(): - lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier)) - - for identifier, py_prop in base.get_py_properties(): - lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier)) - - if lines: - fw(".. rubric:: Inherited Properties\n\n") - - fw(".. hlist::\n") - fw(" :columns: 2\n\n") - - for line in lines: - fw(line) - fw("\n") - - - # funcs - lines[:] = [] - - if _BPY_STRUCT_FAKE: - for key, descr in descr_items: - if type(descr) == MethodDescriptorType: - lines.append(" * :class:`%s.%s`\n" % (_BPY_STRUCT_FAKE, key)) - - for base in bases: - for func in base.functions: - lines.append(" * :class:`%s.%s`\n" % (base.identifier, func.identifier)) - for identifier, py_func in base.get_py_functions(): - lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier)) - - if lines: - fw(".. rubric:: Inherited Functions\n\n") - - fw(".. hlist::\n") - fw(" :columns: 2\n\n") - - for line in lines: - fw(line) - fw("\n") - - lines[:] = [] - - - if struct.references: - # use this otherwise it gets in the index for a normal heading. - fw(".. rubric:: References\n\n") - - fw(".. hlist::\n") - fw(" :columns: 2\n\n") - - for ref in struct.references: - ref_split = ref.split(".") - if len(ref_split) > 2: - ref = ref_split[-2] + "." + ref_split[-1] - fw(" * :class:`%s`\n" % ref) - fw("\n") - - - for struct in structs.values(): - # TODO, rna_info should filter these out! - if "_OT_" in struct.identifier: - continue - write_struct(struct) - - # special case, bpy_struct - if _BPY_STRUCT_FAKE: - filepath = os.path.join(BASEPATH, "bpy.types.%s.rst" % _BPY_STRUCT_FAKE) - file = open(filepath, "w") - fw = file.write - - fw("%s\n" % _BPY_STRUCT_FAKE) - fw("=" * len(_BPY_STRUCT_FAKE) + "\n") - fw("\n") - fw(".. module:: bpy.types\n") - fw("\n") - - subclass_ids = [s.identifier for s in structs.values() if s.base is None if not rna_info.rna_id_ignore(s.identifier)] - if subclass_ids: - fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in sorted(subclass_ids)) + "\n\n") - - fw(".. class:: %s\n\n" % _BPY_STRUCT_FAKE) - fw(" built-in base class for all classes in bpy.types.\n\n") - fw(" .. note::\n\n") - fw(" Note that bpy.types.%s is not actually available from within blender, it only exists for the purpose of documentation.\n\n" % _BPY_STRUCT_FAKE) - - descr_items = [(key, descr) for key, descr in sorted(bpy.types.Struct.__bases__[0].__dict__.items()) if not key.startswith("__")] - - for key, descr in descr_items: - if type(descr) == MethodDescriptorType: # GetSetDescriptorType, GetSetDescriptorType's are not documented yet - py_descr2sphinx(" ", fw, descr, "bpy.types", _BPY_STRUCT_FAKE, key) - - for key, descr in descr_items: - if type(descr) == GetSetDescriptorType: - py_descr2sphinx(" ", fw, descr, "bpy.types", _BPY_STRUCT_FAKE, key) - - - # operators - def write_ops(): - API_BASEURL='https://svn.blender.org/svnroot/bf-blender/trunk/blender/release/scripts' - fw = None - last_mod = '' - - for op_key in sorted(ops.keys()): - op = ops[op_key] - - if last_mod != op.module_name: - filepath = os.path.join(BASEPATH, "bpy.ops.%s.rst" % op.module_name) - file = open(filepath, "w") - fw = file.write - - title = "%s Operators" % (op.module_name[0].upper() + op.module_name[1:]) - fw("%s\n%s\n\n" % (title, "=" * len(title))) - - fw(".. module:: bpy.ops.%s\n\n" % op.module_name) - last_mod = op.module_name - - args_str = ", ".join(prop.get_arg_default(force=True) for prop in op.args) - fw(".. function:: %s(%s)\n\n" % (op.func_name, args_str)) - - # if the description isn't valid, we output the standard warning - # with a link to the wiki so that people can help - if not op.description or op.description == "(undocumented operator)": - operator_description = undocumented_message('bpy.ops',op.module_name,op.func_name) - else: - operator_description = op.description - - fw(" %s\n\n" % operator_description) - for prop in op.args: - write_param(" ", fw, prop) - if op.args: - fw("\n") - - location = op.get_location() - if location != (None, None): - fw(" :file: `%s <%s/%s>`_:%d\n\n" % (location[0],API_BASEURL,location[0],location[1])) - - write_ops() - - file.close() - -def main(): - import bpy - if 'bpy' not in dir(): - print("\nError, this script must run from inside blender2.5") - print(script_help_msg) - else: - import shutil - - path_in = 'source/blender/python/doc/sphinx-in' - path_out = 'source/blender/python/doc/sphinx-out' - path_examples = 'source/blender/python/doc/examples' - # only for partial updates - path_in_tmp = path_in + "-tmp" - - if not os.path.exists(path_in): - os.mkdir(path_in) - - for f in os.listdir(path_examples): - if f.endswith(".py"): - EXAMPLE_SET.add(os.path.splitext(f)[0]) - - - # only for full updates - if _BPY_FULL_REBUILD: - shutil.rmtree(path_in, True) - shutil.rmtree(path_out, True) - else: - # write here, then move - shutil.rmtree(path_in_tmp, True) - - rna2sphinx(path_in_tmp) - - if not _BPY_FULL_REBUILD: - import filecmp - - # now move changed files from 'path_in_tmp' --> 'path_in' - file_list_path_in = set(os.listdir(path_in)) - file_list_path_in_tmp = set(os.listdir(path_in_tmp)) - - # remove deprecated files that have been removed. - for f in sorted(file_list_path_in): - if f not in file_list_path_in_tmp: - print("\tdeprecated: %s" % f) - os.remove(os.path.join(path_in, f)) - - # freshen with new files. - for f in sorted(file_list_path_in_tmp): - f_from = os.path.join(path_in_tmp, f) - f_to = os.path.join(path_in, f) - - do_copy = True - if f in file_list_path_in: - if filecmp.cmp(f_from, f_to): - do_copy = False - - if do_copy: - print("\tupdating: %s" % f) - shutil.copy(f_from, f_to) - '''else: - print("\tkeeping: %s" % f) # eh, not that useful''' - - - EXAMPLE_SET_UNUSED = EXAMPLE_SET - EXAMPLE_SET_USED - if EXAMPLE_SET_UNUSED: - print("\nUnused examples found in '%s'..." % path_examples) - for f in EXAMPLE_SET_UNUSED: - print(" %s.py" % f) - print(" %d total\n" % len(EXAMPLE_SET_UNUSED)) - - import sys - sys.exit() - -if __name__ == '__main__': - main() diff --git a/source/blender/python/doc/sphinx_doc_gen.sh b/source/blender/python/doc/sphinx_doc_gen.sh deleted file mode 100755 index 607803d16d5..00000000000 --- a/source/blender/python/doc/sphinx_doc_gen.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# run from the blender source dir -# bash source/blender/python/doc/sphinx_doc_gen.sh -# ssh upload means you need an account on the server - -BLENDER="./blender.bin" -SSH_HOST="ideasman42@emo.blender.org" -SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation" # blender_python_api_VERSION, added after - -# sed string from hell, 'Blender 2.53 (sub 1) Build' --> '2_53_1' -# "_".join(str(v) for v in bpy.app.version) -# custom blender vars -blender_srcdir=$(dirname $0)/../../../../ -blender_version=$(grep BLENDER_VERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | tr -dc 0-9) -blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | tr -dc 0-9) -BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion - -BLENDER_VERSION=`$BLENDER --version | cut -f2-4 -d" " | sed 's/(//g' | sed 's/)//g' | sed 's/ sub /./g' | sed 's/\./_/g'` -SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION - -# dont delete existing docs, now partial updates are used for quick builds. -$BLENDER --background --python ./source/blender/python/doc/sphinx_doc_gen.py - -# html -sphinx-build source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out -cp source/blender/python/doc/sphinx-out/contents.html source/blender/python/doc/sphinx-out/index.html -ssh ideasman42@emo.blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*' -rsync --progress -avze "ssh -p 22" /b/source/blender/python/doc/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/ - -# pdf -sphinx-build -b latex source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out -cd source/blender/python/doc/sphinx-out -make -cd ../../../../../ -rsync --progress -avze "ssh -p 22" source/blender/python/doc/sphinx-out/contents.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf -- cgit v1.2.3 From 1eda2c85949ed0fa67d3026e078588d0820826ad Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Wed, 13 Oct 2010 11:40:59 +0000 Subject: Fix for [#24205] Multilayer EXR files used as input sequence are displayed incorrectly * Image buffer profile wasn't set to linear rgb for multilayer image sequences --- source/blender/blenkernel/intern/image.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 6dd1d4280ec..e356e40c6fd 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1685,6 +1685,7 @@ static ImBuf *image_load_sequence_multilayer(Image *ima, ImageUser *iuser, int f ibuf->flags |= IB_rectfloat; ibuf->mall= IB_rectfloat; ibuf->channels= rpass->channels; + ibuf->profile = IB_PROFILE_LINEAR_RGB; image_initialize_after_load(ima, ibuf); image_assign_ibuf(ima, ibuf, iuser?iuser->multi_index:0, frame); -- cgit v1.2.3 From 62f4d613d06fad1bad95b4ec5e5199425a23d684 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Wed, 13 Oct 2010 13:10:35 +0000 Subject: Fix for [#24208] ObjectId information is wrong when read from multilayer exr * non-rgba passes shouldn't use color correction --- source/blender/nodes/intern/CMP_nodes/CMP_image.c | 34 +++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'source/blender') diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c index 9309d2939db..c99496d9664 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c @@ -77,25 +77,31 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i /* now we need a float buffer from the image * with matching color management */ - if(rd->color_mgt_flag & R_COLOR_MANAGEMENT) { - if(ibuf->profile != IB_PROFILE_NONE) { - rect= ibuf->rect_float; + if(ibuf->channels == 4) { + if(rd->color_mgt_flag & R_COLOR_MANAGEMENT) { + if(ibuf->profile != IB_PROFILE_NONE) { + rect= ibuf->rect_float; + } + else { + rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); + srgb_to_linearrgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); + alloc= TRUE; + } } else { - rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); - srgb_to_linearrgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); - alloc= TRUE; + if(ibuf->profile == IB_PROFILE_NONE) { + rect= ibuf->rect_float; + } + else { + rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); + linearrgb_to_srgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); + alloc= TRUE; + } } } else { - if(ibuf->profile == IB_PROFILE_NONE) { - rect= ibuf->rect_float; - } - else { - rect= MEM_mapallocN(sizeof(float) * 4 * ibuf->x * ibuf->y, "node_composit_get_image"); - linearrgb_to_srgb_rgba_rgba_buf(rect, ibuf->rect_float, ibuf->x * ibuf->y); - alloc= TRUE; - } + /* non-rgba passes can't use color profiles */ + rect= ibuf->rect_float; } /* done coercing into the correct color management */ -- cgit v1.2.3 From 843d8859a718c1f9a8c0f7109b2cdf9bbeb46fa3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 13:53:49 +0000 Subject: bugfix [#23355] Square Color picker moving by itself and locking up --- source/blender/blenlib/BLI_math_color.h | 1 + source/blender/blenlib/intern/math_color.c | 20 ++++++++ source/blender/editors/interface/interface.c | 5 -- .../blender/editors/interface/interface_handlers.c | 45 +++++++++------- .../blender/editors/interface/interface_intern.h | 7 ++- .../blender/editors/interface/interface_regions.c | 60 ++++++++++++---------- .../editors/interface/interface_templates.c | 16 +++--- .../blender/editors/interface/interface_widgets.c | 22 ++++---- 8 files changed, 107 insertions(+), 69 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h index 2f40520e59a..2095c40b5aa 100644 --- a/source/blender/blenlib/BLI_math_color.h +++ b/source/blender/blenlib/BLI_math_color.h @@ -61,6 +61,7 @@ void cpack_to_rgb(unsigned int col, float *r, float *g, float *b); void rgb_to_yuv(float r, float g, float b, float *ly, float *lu, float *lv); void rgb_to_ycc(float r, float g, float b, float *ly, float *lcb, float *lcr, int colorspace); void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv); +void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *lv); unsigned int rgb_to_cpack(float r, float g, float b); unsigned int hsv_to_cpack(float h, float s, float v); diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index f0ef8b2c93d..09a6b5992db 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -232,6 +232,26 @@ void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv) *lv = v; } +void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *lv) +{ + float orig_h= *lh; + float orig_s= *ls; + + rgb_to_hsv(r, g, b, lh, ls, lv); + + if(*lv <= 0.0f) { + *lh= orig_h; + *ls= orig_s; + } + else if (*ls <= 0.0f) { + *lh= orig_h; + } + + if(*lh==0.0f && orig_h >= 1.0f) { + *lh= 1.0f; + } +} + /*http://brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html */ void xyz_to_rgb(float xc, float yc, float zc, float *r, float *g, float *b, int colorspace) diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index f4866237f46..97a3225f5c6 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2136,11 +2136,6 @@ void ui_check_but(uiBut *but) case HSVCUBE: case HSVCIRCLE: - { - float rgb[3]; - ui_get_but_vectorf(but, rgb); - rgb_to_hsv(rgb[0], rgb[1], rgb[2], but->hsv, but->hsv+1, but->hsv+2); - } break; default: strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index a64dcecb929..7487ed904e4 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2830,17 +2830,18 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm } else if(but->type==COL) { if( ELEM(event->type, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->alt) { + float *hsv= ui_block_hsv_get(but->block); float col[3]; ui_get_but_vectorf(but, col); - rgb_to_hsv(col[0], col[1], col[2], but->hsv, but->hsv+1, but->hsv+2); + rgb_to_hsv_compat(col[0], col[1], col[2], hsv, hsv+1, hsv+2); if(event->type==WHEELDOWNMOUSE) - but->hsv[2]= CLAMPIS(but->hsv[2]-0.05f, 0.0f, 1.0f); + hsv[2]= CLAMPIS(hsv[2]-0.05f, 0.0f, 1.0f); else - but->hsv[2]= CLAMPIS(but->hsv[2]+0.05f, 0.0f, 1.0f); + hsv[2]= CLAMPIS(hsv[2]+0.05f, 0.0f, 1.0f); - hsv_to_rgb(but->hsv[0], but->hsv[1], but->hsv[2], data->vec, data->vec+1, data->vec+2); + hsv_to_rgb(hsv[0], hsv[1], hsv[2], data->vec, data->vec+1, data->vec+2); ui_set_but_vectorf(but, data->vec); button_activate_state(C, but, BUTTON_STATE_EXIT); @@ -2970,7 +2971,8 @@ static int ui_do_but_NORMAL(bContext *C, uiBlock *block, uiBut *but, uiHandleBut static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx, int my) { - float rgb[3], hsv[3]; + float rgb[3]; + float *hsv= ui_block_hsv_get(but->block); float x, y; int changed= 1; int color_profile = but->block->color_profile; @@ -2979,10 +2981,11 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx, if (RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) color_profile = BLI_PR_NONE; } - + ui_get_but_vectorf(but, rgb); - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); - + + rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); + /* relative position within box */ x= ((float)mx-but->x1)/(but->x2-but->x1); y= ((float)my-but->y1)/(but->y2-but->y1); @@ -3059,21 +3062,22 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu } else if (event->type == ZEROKEY && event->val == KM_PRESS) { if (but->a1==9){ - float rgb[3], hsv[3], def_hsv[3]; - float *def; int len; /* reset only value */ len= RNA_property_array_length(&but->rnapoin, but->rnaprop); if (len >= 3) { + float rgb[3], def_hsv[3]; + float *def; + float *hsv= ui_block_hsv_get(but->block); def= MEM_callocN(sizeof(float)*len, "reset_defaults - float"); RNA_property_float_get_default_array(&but->rnapoin, but->rnaprop, def); rgb_to_hsv(def[0], def[1], def[2], def_hsv, def_hsv+1, def_hsv+2); ui_get_but_vectorf(but, rgb); - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); + rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); hsv_to_rgb(hsv[0], hsv[1], def_hsv[2], rgb, rgb+1, rgb+2); ui_set_but_vectorf(but, rgb); @@ -3111,13 +3115,15 @@ static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx { rcti rect; int changed= 1; - float rgb[3], hsv[3]; + float rgb[3]; + float hsv[3]; rect.xmin= but->x1; rect.xmax= but->x2; rect.ymin= but->y1; rect.ymax= but->y2; ui_get_but_vectorf(but, rgb); - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); + copy_v3_v3(hsv, ui_block_hsv_get(but->block)); + rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); /* exception, when using color wheel in 'locked' value state: * allow choosing a hue for black values, by giving a tiny increment */ @@ -3176,21 +3182,22 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle return WM_UI_HANDLER_BREAK; } else if (event->type == ZEROKEY && event->val == KM_PRESS) { - float rgb[3], hsv[3], def_hsv[3]; - float *def; int len; /* reset only saturation */ len= RNA_property_array_length(&but->rnapoin, but->rnaprop); if (len >= 3) { + float rgb[3], def_hsv[3]; + float *def; + float *hsv= ui_block_hsv_get(but->block); def= MEM_callocN(sizeof(float)*len, "reset_defaults - float"); RNA_property_float_get_default_array(&but->rnapoin, but->rnaprop, def); rgb_to_hsv(def[0], def[1], def[2], def_hsv, def_hsv+1, def_hsv+2); ui_get_but_vectorf(but, rgb); - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); + rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); hsv_to_rgb(hsv[0], def_hsv[1], hsv[2], rgb, rgb+1, rgb+2); ui_set_but_vectorf(but, rgb); @@ -3210,12 +3217,14 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle } /* XXX hardcoded keymap check.... */ else if(event->type == WHEELDOWNMOUSE) { - but->hsv[2]= CLAMPIS(but->hsv[2]-0.05f, 0.0f, 1.0f); + float *hsv= ui_block_hsv_get(but->block); + hsv[2]= CLAMPIS(hsv[2]-0.05f, 0.0f, 1.0f); ui_set_but_hsv(but); // converts to rgb ui_numedit_apply(C, block, but, data); } else if(event->type == WHEELUPMOUSE) { - but->hsv[2]= CLAMPIS(but->hsv[2]+0.05f, 0.0f, 1.0f); + float *hsv= ui_block_hsv_get(but->block); + hsv[2]= CLAMPIS(hsv[2]+0.05f, 0.0f, 1.0f); ui_set_but_hsv(but); // converts to rgb ui_numedit_apply(C, block, but, data); } diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index eb28df54b13..8183617a9ba 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -171,8 +171,9 @@ struct uiBut { char *poin; float hardmin, hardmax, softmin, softmax; - float a1, a2, hsv[3]; // hsv is temp memory for hsv buttons + float a1, a2; float aspect; + char col[4]; uiButHandleFunc func; void *func_arg1; @@ -396,7 +397,7 @@ struct uiPopupBlockHandle { int butretval; int menuretval; float retvalue; - float retvec[4]; + float retvec[8]; }; uiBlock *ui_block_func_COL(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but); @@ -408,6 +409,8 @@ void ui_tooltip_free(struct bContext *C, struct ARegion *ar); uiBut *ui_popup_menu_memory(uiBlock *block, uiBut *but); +float *ui_block_hsv_get(uiBlock *block); + /* searchbox for string button */ ARegion *ui_searchbox_create(struct bContext *C, struct ARegion *butregion, uiBut *but); int ui_searchbox_inside(struct ARegion *ar, int x, int y); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index a0f852239c4..c2b09750ee9 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1571,27 +1571,22 @@ static void ui_warp_pointer(short x, short y) void ui_set_but_hsv(uiBut *but) { float col[3]; + float *hsv= ui_block_hsv_get(but->block); - hsv_to_rgb(but->hsv[0], but->hsv[1], but->hsv[2], col, col+1, col+2); + hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); ui_set_but_vectorf(but, col); } /* also used by small picker, be careful with name checks below... */ -void ui_update_block_buts_rgb(uiBlock *block, float *rgb, float *rhsv) +void ui_update_block_buts_rgb(uiBlock *block, float *rgb) { uiBut *bt; - float hsv[3]; + float *hsv= ui_block_hsv_get(block); /* this is to keep the H and S value when V is equal to zero * and we are working in HSV mode, of course! */ - if (rhsv) { - hsv[0]= rhsv[0]; - hsv[1]= rhsv[1]; - hsv[2]= rhsv[2]; - } - else - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); + rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); // this updates button strings, is hackish... but button pointers are on stack of caller function for(bt= block->buttons.first; bt; bt= bt->next) { @@ -1657,23 +1652,23 @@ static void do_picker_rna_cb(bContext *C, void *bt1, void *unused) if (prop) { RNA_property_float_get_array(&ptr, prop, rgb); - ui_update_block_buts_rgb(but->block, rgb, NULL); + ui_update_block_buts_rgb(but->block, rgb); } if(popup) popup->menuretval= UI_RETURN_UPDATE; } -static void do_hsv_rna_cb(bContext *C, void *bt1, void *hsv_arg) +static void do_hsv_rna_cb(bContext *C, void *bt1, void *arg_dummy) { uiBut *but= (uiBut *)bt1; uiPopupBlockHandle *popup= but->block->handle; - float *hsv = (float *)hsv_arg; float rgb[3]; + float *hsv= ui_block_hsv_get(but->block); hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2); - ui_update_block_buts_rgb(but->block, rgb, hsv); + ui_update_block_buts_rgb(but->block, rgb); if(popup) popup->menuretval= UI_RETURN_UPDATE; @@ -1694,7 +1689,7 @@ static void do_hex_rna_cb(bContext *C, void *bt1, void *hexcl) srgb_to_linearrgb_v3_v3(rgb, rgb); } - ui_update_block_buts_rgb(but->block, rgb, NULL); + ui_update_block_buts_rgb(but->block, rgb); if(popup) popup->menuretval= UI_RETURN_UPDATE; @@ -1740,7 +1735,7 @@ static void picker_new_hide_reveal(uiBlock *block, short colormode) } } -static void do_picker_new_mode_cb(bContext *C, void *bt1, void *colv) +static void do_picker_new_mode_cb(bContext *C, void *bt1, void *dummy) { uiBut *bt= bt1; short colormode= ui_get_but_val(bt); @@ -1794,11 +1789,13 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR uiBut *bt; int width, butwidth; static char tip[50]; - static float hsv[3]; static char hexcol[128]; float rgb_gamma[3]; float min, max, step, precision; const char *propname = RNA_property_identifier(prop); + float *hsv= ui_block_hsv_get(block); + + ui_block_hsv_get(block); width= PICKER_TOTAL_W; butwidth = width - UI_UNIT_X - 10; @@ -1818,7 +1815,6 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR RNA_property_float_ui_range(ptr, prop, &min, &max, &step, &precision); RNA_property_float_get_array(ptr, prop, rgb); - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); switch (U.color_picker_type) { case USER_CP_CIRCLE: @@ -1838,11 +1834,11 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR /* mode */ uiBlockBeginAlign(block); bt= uiDefButS(block, ROW, 0, "RGB", 0, -30, width/3, UI_UNIT_Y, &colormode, 0.0, 0.0, 0, 0, ""); - uiButSetFunc(bt, do_picker_new_mode_cb, bt, rgb); + uiButSetFunc(bt, do_picker_new_mode_cb, bt, NULL); bt= uiDefButS(block, ROW, 0, "HSV", width/3, -30, width/3, UI_UNIT_Y, &colormode, 0.0, 1.0, 0, 0, ""); - uiButSetFunc(bt, do_picker_new_mode_cb, bt, hsv); + uiButSetFunc(bt, do_picker_new_mode_cb, bt, NULL); bt= uiDefButS(block, ROW, 0, "Hex", 2*width/3, -30, width/3, UI_UNIT_Y, &colormode, 0.0, 2.0, 0, 0, ""); - uiButSetFunc(bt, do_picker_new_mode_cb, bt, hexcol); + uiButSetFunc(bt, do_picker_new_mode_cb, bt, NULL); uiBlockEndAlign(block); bt= uiDefIconButO(block, BUT, "UI_OT_eyedropper", WM_OP_INVOKE_DEFAULT, ICON_EYEDROPPER, butwidth+10, -60, UI_UNIT_X, UI_UNIT_Y, NULL); @@ -1878,14 +1874,14 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR rgb[3]= 1.0f; } - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); - sprintf(hexcol, "%02X%02X%02X", FTOCHAR(rgb_gamma[0]), FTOCHAR(rgb_gamma[1]), FTOCHAR(rgb_gamma[2])); bt= uiDefBut(block, TEX, 0, "Hex: ", 0, -60, butwidth, UI_UNIT_Y, hexcol, 0, 8, 0, 0, "Hex triplet for color (#RRGGBB)"); uiButSetFunc(bt, do_hex_rna_cb, bt, hexcol); uiDefBut(block, LABEL, 0, "(Gamma Corrected)", 0, -80, butwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); + picker_new_hide_reveal(block, colormode); } @@ -1906,16 +1902,17 @@ static int ui_picker_small_wheel(const bContext *C, uiBlock *block, wmEvent *eve if(but->type==HSVCUBE && but->active==NULL) { uiPopupBlockHandle *popup= block->handle; float col[3]; + float *hsv= ui_block_hsv_get(block); ui_get_but_vectorf(but, col); - rgb_to_hsv(col[0], col[1], col[2], but->hsv, but->hsv+1, but->hsv+2); - but->hsv[2]= CLAMPIS(but->hsv[2]+add, 0.0f, 1.0f); - hsv_to_rgb(but->hsv[0], but->hsv[1], but->hsv[2], col, col+1, col+2); + rgb_to_hsv_compat(col[0], col[1], col[2], hsv, hsv+1, hsv+2); + hsv[2]= CLAMPIS(hsv[2]+add, 0.0f, 1.0f); + hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); ui_set_but_vectorf(but, col); - ui_update_block_buts_rgb(block, col, NULL); + ui_update_block_buts_rgb(block, col); if(popup) popup->menuretval= UI_RETURN_UPDATE; @@ -1942,8 +1939,11 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT); VECCOPY(handle->retvec, but->editvec); - + + block->handle= handle; /* XXX, only for ui_block_hsv_get */ uiBlockPicker(block, handle->retvec, &but->rnapoin, but->rnaprop); + block->handle= NULL; + block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN; uiBoundsBlock(block, 10); @@ -2438,3 +2438,7 @@ void uiPupBlockClose(bContext *C, uiBlock *block) } } +float *ui_block_hsv_get(uiBlock *block) +{ + return block->handle->retvec+4; +} diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index e0f57a259b5..77770452f84 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2327,7 +2327,6 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) uiBut *but; uiStyle *style= U.uistyles.first; int width; - float hsv[3]; /* if the report display has timed out, don't show */ if (!reports->reporttimer) return; @@ -2338,8 +2337,6 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) abs = uiLayoutAbsolute(layout, 0); block= uiLayoutGetBlock(abs); - - rgb_to_hsv(rti->col[0], rti->col[1], rti->col[2], hsv+0, hsv+1, hsv+2); width = BLF_width(style->widget.uifont_id, report->message); width = MIN2(rti->widthfac*width, width); @@ -2348,11 +2345,16 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) /* make a box around the report to make it stand out */ uiBlockBeginAlign(block); but= uiDefBut(block, ROUNDBOX, 0, "", 0, 0, UI_UNIT_X+10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); - copy_v3_v3(but->hsv, hsv); /* set the report's bg colour in but->hsv - ROUNDBOX feature */ - + /* set the report's bg colour in but->col - ROUNDBOX feature */ + but->col[0]= FTOCHAR(rti->col[0]); + but->col[1]= FTOCHAR(rti->col[1]); + but->col[2]= FTOCHAR(rti->col[2]); + but->col[3]= 255; + but= uiDefBut(block, ROUNDBOX, 0, "", UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); - but->hsv[0] = but->hsv[1] = 0.0; /* set a greyscale bg colour in but->hsv - ROUNDBOX feature */ - but->hsv[2] = rti->greyscale; + but->col[0]= but->col[1]= but->col[2]= FTOCHAR(rti->greyscale); + but->col[3]= 255; + uiBlockEndAlign(block); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 134ab70e4ca..6a0e4feb946 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1646,7 +1646,7 @@ void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect) /* gouraud triangle fan */ float radstep, ang= 0.0f; float centx, centy, radius; - float rgb[3], hsv[3], hsvo[3], col[3], colcent[3]; + float rgb[3], hsvo[3], hsv[3], col[3], colcent[3]; int a, tot= 32; int color_profile = but->block->color_profile; @@ -1664,7 +1664,8 @@ void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect) /* color */ ui_get_but_vectorf(but, rgb); - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); + copy_v3_v3(hsv, ui_block_hsv_get(but->block)); + rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); copy_v3_v3(hsvo, hsv); /* exception: if 'lock' is set @@ -1858,9 +1859,14 @@ static void ui_draw_but_HSVCUBE(uiBut *but, rcti *rect) { float rgb[3], h,s,v; float x=0.0f, y=0.0f; + float *hsv= ui_block_hsv_get(but->block); + + h= hsv[0]; + s= hsv[1]; + v= hsv[2]; ui_get_but_vectorf(but, rgb); - rgb_to_hsv(rgb[0], rgb[1], rgb[2], &h, &s, &v); + rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], &h, &s, &v); ui_draw_gradient(rect, rgb, but->a1, 1.f); @@ -2481,12 +2487,10 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, VECCOPY(old_col, wcol->inner); /* abuse but->hsv - if it's non-zero, use this colour as the box's background */ - if ((but->hsv[0] != 0.0) || (but->hsv[1] != 0.0) || (but->hsv[2] != 0.0)) { - float rgb[3]; - hsv_to_rgb(but->hsv[0], but->hsv[1], but->hsv[2], rgb+0, rgb+1, rgb+2); - wcol->inner[0] = rgb[0] * 255; - wcol->inner[1] = rgb[1] * 255; - wcol->inner[2] = rgb[2] * 255; + if (but->col[3]) { + wcol->inner[0] = but->col[0]; + wcol->inner[1] = but->col[1]; + wcol->inner[2] = but->col[2]; } /* half rounded */ -- cgit v1.2.3 From bbc8cf9d247e2dec5f1b2e3d2f3e9e5cbd1ae6e9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 14:10:42 +0000 Subject: fix for remaining glitch in square color picker, the backdrop could change color because rgb_to_hsv() was used rather then rgb_to_hsv_compat() --- source/blender/editors/interface/interface_draw.c | 2 +- source/blender/editors/interface/interface_intern.h | 2 +- source/blender/editors/interface/interface_widgets.c | 15 +++++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index cf6970dc59f..093d175adce 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1404,7 +1404,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect if (but->a1 != -1) { if (but->a1 == UI_GRAD_H) { rcti grid; - float col[3]; + float col[3]= {0.0f, 0.0f, 0.0f}; /* dummy arg */ grid.xmin = rect->xmin + zoomx*(-offsx); grid.xmax = rect->xmax + zoomx*(-offsx); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 8183617a9ba..e58095d9c54 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -444,7 +444,7 @@ extern void ui_draw_aligned_panel(struct ARegion *ar, struct uiStyle *style, uiB /* interface_draw.c */ extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select); -void ui_draw_gradient(rcti *rect, float *rgb, int type, float alpha); +void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha); void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect); void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 6a0e4feb946..44fec4d4e07 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1725,16 +1725,14 @@ void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect) /* ************ custom buttons, old stuff ************** */ /* draws in resolution of 20x4 colors */ -void ui_draw_gradient(rcti *rect, float *rgb, int type, float alpha) +void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha) { int a; - float h, s, v; + float h= hsv[0], s= hsv[1], v= hsv[0]; float dx, dy, sx1, sx2, sy; float col0[4][3]; // left half, rect bottom to top float col1[4][3]; // right half, rect bottom to top - - rgb_to_hsv(rgb[0], rgb[1], rgb[2], &h, &s, &v); - + /* draw series of gouraud rects */ glShadeModel(GL_SMOOTH); @@ -1860,6 +1858,7 @@ static void ui_draw_but_HSVCUBE(uiBut *but, rcti *rect) float rgb[3], h,s,v; float x=0.0f, y=0.0f; float *hsv= ui_block_hsv_get(but->block); + float hsvn[3]; h= hsv[0]; s= hsv[1]; @@ -1867,8 +1866,12 @@ static void ui_draw_but_HSVCUBE(uiBut *but, rcti *rect) ui_get_but_vectorf(but, rgb); rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], &h, &s, &v); + + hsvn[0]= h; + hsvn[1]= s; + hsvn[2]= v; - ui_draw_gradient(rect, rgb, but->a1, 1.f); + ui_draw_gradient(rect, hsvn, but->a1, 1.f); switch((int)but->a1) { case UI_GRAD_SV: -- cgit v1.2.3 From a81be2075f6304c18838fa2d26380342ba2f7894 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 14:14:22 +0000 Subject: use PyC_UnicodeFromByte for bpy.app.tempdir incase of non utf-8 filepath --- source/blender/python/intern/bpy_app.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 6a6b5277d9f..6c4e190673c 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -30,6 +30,8 @@ #include "BKE_global.h" #include "structseq.h" +#include "../generic/py_capi_utils.h" + #ifdef BUILD_DATE extern char build_date[]; extern char build_time[]; @@ -146,7 +148,7 @@ static PyObject *bpy_app_tempdir_get(PyObject *self, void *closure) (void)(self); (void)(closure); - return PyUnicode_FromString(btempdir); + return PyC_UnicodeFromByte(btempdir); } PyGetSetDef bpy_app_debug_getset= {"debug", bpy_app_debug_get, bpy_app_debug_set, "Boolean, set when blender is running in debug mode (started with -d)", NULL}; -- cgit v1.2.3 From 9f05cc59fab2cd3e82be759e46bf4dacd2dbad05 Mon Sep 17 00:00:00 2001 From: Luca Bonavita Date: Wed, 13 Oct 2010 14:44:22 +0000 Subject: == docs == - moved files in proper directories and adapted paths where needed - deleted doc/oldbugs.txt (asked confirmation to jesterking a week ago in irc) - still working on doxygen files, for now I'll leave them in doc/ - NOTE: while checking if other files were referring to these files, I noted that "GPL-license.txt" is also used in the files below: - release/windows/installer/00.sconsblender.nsi - release/windows/specific.sh but these files should't be affected by this commit, but please check :) --- source/blender/editors/interface/interface.c | 2 +- source/blender/editors/interface/interface_panel.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 97a3225f5c6..55428a4a241 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -67,7 +67,7 @@ #define MENU_SEP_HEIGHT 6 /* - * a full doc with API notes can be found in bf-blender/blender/doc/interface_API.txt + * a full doc with API notes can be found in bf-blender/trunk/blender/doc/guides/interface_API.txt * * uiBlahBlah() external function * ui_blah_blah() internal function diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 9d22f3c5212..ca7065ca636 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -25,7 +25,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/* a full doc with API notes can be found in bf-blender/blender/doc/interface_API.txt */ +/* a full doc with API notes can be found in bf-blender/trunk/blender/doc/guides/interface_API.txt */ #include #include -- cgit v1.2.3 From 32ac21ab023ad90d994bac6a76aba0fa2da88176 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 13 Oct 2010 19:56:53 +0000 Subject: Fix #24234: Object deletion doesn't take into account its users (causes segfault) Clear SELECT flag when deleting object -- object could be used in other scenes, and some stuff (like translation) would be confused due to relations --- source/blender/editors/object/object_add.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 3ae1941035d..8661cbc680a 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -817,6 +817,10 @@ static int object_delete_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN(C, Base*, base, selected_bases) { if(base->object->type==OB_LAMP) islamp= 1; + + /* deselect object -- it could be used in other scenes */ + base->object->flag &= ~SELECT; + /* remove from current scene only */ ED_base_object_free_and_unlink(bmain, scene, base); } -- cgit v1.2.3 From be32cf8b3218eb0d52eadc99d31f12ed0bbc2ec7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 23:25:08 +0000 Subject: UNUSED() macro so -Wunused-parameter can be used with GCC without so many warnings. applied to python api and exotic.c, removed some args being passed down which were not needed. keyword args for new mathutils types were being ignored when they should raise an error. --- source/blender/blenkernel/BKE_utildefines.h | 6 ++ source/blender/blenkernel/intern/exotic.c | 14 ++--- source/blender/python/generic/IDProp.c | 9 +-- source/blender/python/generic/bgl.c | 10 ++-- source/blender/python/generic/blf_api.c | 27 ++++----- .../blender/python/generic/bpy_internal_import.c | 5 +- source/blender/python/generic/geometry.c | 26 ++++----- source/blender/python/generic/mathutils.c | 6 +- source/blender/python/generic/mathutils_color.c | 19 ++++--- source/blender/python/generic/mathutils_euler.c | 25 ++++---- source/blender/python/generic/mathutils_matrix.c | 17 ++++-- source/blender/python/generic/mathutils_quat.c | 21 ++++--- source/blender/python/generic/mathutils_vector.c | 4 +- source/blender/python/generic/noise.c | 66 +++++++++++----------- source/blender/python/intern/bpy.c | 10 ++-- source/blender/python/intern/bpy_app.c | 16 ++---- source/blender/python/intern/bpy_array.c | 10 ++-- source/blender/python/intern/bpy_interface.c | 4 +- source/blender/python/intern/bpy_operator.c | 10 ++-- source/blender/python/intern/bpy_operator_wrap.c | 2 +- source/blender/python/intern/bpy_rna.c | 54 +++++++++--------- source/blender/python/intern/bpy_rna.h | 2 +- source/blender/python/intern/bpy_rna_callback.c | 3 +- 23 files changed, 198 insertions(+), 168 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 5a6a151afee..7450e31e263 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -44,6 +44,12 @@ #define STRINGIFY_ARG(x) #x #define STRINGIFY(x) STRINGIFY_ARG(x) +#ifdef __GNUC__ +# define UNUSED(x) x __attribute__((__unused__)) +#else +# define UNUSED(x) x +#endif + /* these values need to be hardcoded in structs, dna does not recognize defines */ /* also defined in DNA_space_types.h */ #ifndef FILE_MAXDIR diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 9dac409226b..c5431005b18 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -557,7 +557,7 @@ static int write_derivedmesh_stl(FILE *fpSTL, Object *ob, DerivedMesh *dm) return numfacets; } -static int write_object_stl(FILE *fpSTL, Scene *scene, Object *ob, Mesh *me) +static int write_object_stl(FILE *fpSTL, Scene *scene, Object *ob) { int numfacets = 0; DerivedMesh *dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH); @@ -572,7 +572,6 @@ static int write_object_stl(FILE *fpSTL, Scene *scene, Object *ob, Mesh *me) void write_stl(Scene *scene, char *str) { Object *ob; - Mesh *me; Base *base; FILE *fpSTL; int numfacets = 0; @@ -605,9 +604,8 @@ void write_stl(Scene *scene, char *str) if (base->flag & SELECT) { ob = base->object; if (ob->type == OB_MESH) { - me = ob->data; - if (me) - numfacets += write_object_stl(fpSTL, scene, ob, me); + if(ob->data) + numfacets += write_object_stl(fpSTL, scene, ob); } } base= base->next; @@ -978,7 +976,7 @@ static int all_digits(char *str) return 1; } -static int dxf_get_layer_col(char *layer) +static int dxf_get_layer_col(char *UNUSED(layer)) { return 1; } @@ -1016,8 +1014,8 @@ static void myfgets(char *str, int len, FILE *fp) /* three types of enters, \n \r and \r\n */ if(c == '\n') break; if(c=='\r') { - c= getc(dxf_fp); // read the linefeed from stream - if(c != 10) ungetc(c, dxf_fp); // put back, if it's not one... + c= getc(fp); // read the linefeed from stream + if(c != 10) ungetc(c, fp); // put back, if it's not one... break; } } diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c index 9d865b1c63e..c64be00093c 100644 --- a/source/blender/python/generic/IDProp.c +++ b/source/blender/python/generic/IDProp.c @@ -24,6 +24,7 @@ */ #include "BKE_idprop.h" +#include "BKE_utildefines.h" #include "IDProp.h" #include "MEM_guardedalloc.h" @@ -177,12 +178,12 @@ int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value) return 0; } -PyObject *BPy_IDGroup_GetName(BPy_IDProperty *self, void *bleh) +PyObject *BPy_IDGroup_GetName(BPy_IDProperty *self, void *UNUSED(closure)) { return PyUnicode_FromString(self->prop->name); } -static int BPy_IDGroup_SetName(BPy_IDProperty *self, PyObject *value, void *bleh) +static int BPy_IDGroup_SetName(BPy_IDProperty *self, PyObject *value, void *UNUSED(closure)) { char *st; if (!PyUnicode_Check(value)) { @@ -860,7 +861,7 @@ PyObject *BPy_Wrap_IDProperty(ID *id, IDProperty *prop, IDProperty *parent) static PyObject *IDArray_repr(BPy_IDArray *self) { - return PyUnicode_FromString("(ID Array)"); + return PyUnicode_FromFormat("(ID Array [%d])", self->prop->len); } @@ -1071,7 +1072,7 @@ static PyObject *IDGroup_Iter_iterself(PyObject *self) static PyObject *IDGroup_Iter_repr(BPy_IDGroup_Iter *self) { - return PyUnicode_FromString("(ID Property Group)"); + return PyUnicode_FromFormat("(ID Property Group Iter \"%s\")", self->group->prop->name); } static PyObject *BPy_Group_Iter_Next(BPy_IDGroup_Iter *self) diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index 8ac2107f8d2..86b7bc522fe 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -35,6 +35,8 @@ #include #include "MEM_guardedalloc.h" +#include "BKE_utildefines.h" + static char Method_Buffer_doc[] = "(type, dimensions, [template]) - Create a new Buffer object\n\n\ (type) - The format to store data in\n\ @@ -51,7 +53,7 @@ For example, passing [100, 100] will create a 2 dimensional\n\ square buffer. Passing [16, 16, 32] will create a 3 dimensional\n\ buffer which is twice as deep as it is wide or high."; -static PyObject *Method_Buffer( PyObject * self, PyObject * args ); +static PyObject *Method_Buffer( PyObject * self, PyObject *args ); /* Buffer sequence methods */ @@ -99,7 +101,7 @@ PyTypeObject BGL_bufferType = { /* #ifndef __APPLE__ */ #define BGL_Wrap(nargs, funcname, ret, arg_list) \ -static PyObject *Method_##funcname (PyObject *self, PyObject *args) {\ +static PyObject *Method_##funcname (PyObject *UNUSED(self), PyObject *args) {\ arg_def##nargs arg_list; \ ret_def_##ret; \ if(!PyArg_ParseTuple(args, arg_str##nargs arg_list, arg_ref##nargs arg_list)) return NULL;\ @@ -108,7 +110,7 @@ static PyObject *Method_##funcname (PyObject *self, PyObject *args) {\ } #define BGLU_Wrap(nargs, funcname, ret, arg_list) \ -static PyObject *Method_##funcname (PyObject *self, PyObject *args) {\ +static PyObject *Method_##funcname (PyObject *UNUSED(self), PyObject *args) {\ arg_def##nargs arg_list; \ ret_def_##ret; \ if(!PyArg_ParseTuple(args, arg_str##nargs arg_list, arg_ref##nargs arg_list)) return NULL;\ @@ -181,7 +183,7 @@ Buffer *BGL_MakeBuffer(int type, int ndimensions, int *dimensions, void *initbuf } #define MAX_DIMENSIONS 256 -static PyObject *Method_Buffer (PyObject *self, PyObject *args) +static PyObject *Method_Buffer (PyObject *UNUSED(self), PyObject *args) { PyObject *length_ob= NULL, *template= NULL; Buffer *buffer; diff --git a/source/blender/python/generic/blf_api.c b/source/blender/python/generic/blf_api.c index a5f5f8815c7..66d8cdd923a 100644 --- a/source/blender/python/generic/blf_api.c +++ b/source/blender/python/generic/blf_api.c @@ -26,6 +26,7 @@ #include "blf_api.h" #include "../../blenfont/BLF_api.h" +#include "BKE_utildefines.h" static char py_blf_position_doc[] = ".. function:: position(fontid, x, y, z)\n" @@ -41,7 +42,7 @@ static char py_blf_position_doc[] = " :arg z: Z axis position to draw the text.\n" " :type z: float\n"; -static PyObject *py_blf_position(PyObject *self, PyObject *args) +static PyObject *py_blf_position(PyObject *UNUSED(self), PyObject *args) { int fontid; float x, y, z; @@ -67,7 +68,7 @@ static char py_blf_size_doc[] = " :arg dpi: dots per inch value to use for drawing.\n" " :type dpi: int\n"; -static PyObject *py_blf_size(PyObject *self, PyObject *args) +static PyObject *py_blf_size(PyObject *UNUSED(self), PyObject *args) { int fontid, size, dpi; @@ -90,7 +91,7 @@ static char py_blf_aspect_doc[] = " :arg aspect: The aspect ratio for text drawing to use.\n" " :type aspect: float\n"; -static PyObject *py_blf_aspect(PyObject *self, PyObject *args) +static PyObject *py_blf_aspect(PyObject *UNUSED(self), PyObject *args) { float aspect; int fontid; @@ -114,7 +115,7 @@ static char py_blf_blur_doc[] = " :arg radius: The radius for blurring text (in pixels).\n" " :type radius: int\n"; -static PyObject *py_blf_blur(PyObject *self, PyObject *args) +static PyObject *py_blf_blur(PyObject *UNUSED(self), PyObject *args) { int blur, fontid; @@ -137,7 +138,7 @@ static char py_blf_draw_doc[] = " :arg text: the text to draw.\n" " :type text: string\n"; -static PyObject *py_blf_draw(PyObject *self, PyObject *args) +static PyObject *py_blf_draw(PyObject *UNUSED(self), PyObject *args) { char *text; int fontid; @@ -162,7 +163,7 @@ static char py_blf_dimensions_doc[] = " :return: the width and height of the text.\n" " :rtype: tuple of 2 floats\n"; -static PyObject *py_blf_dimensions(PyObject *self, PyObject *args) +static PyObject *py_blf_dimensions(PyObject *UNUSED(self), PyObject *args) { char *text; float r_width, r_height; @@ -196,7 +197,7 @@ static char py_blf_clipping_doc[] = " :arg ymax: Clip the drawing area by these bounds.\n" " :type ymax: float\n"; -static PyObject *py_blf_clipping(PyObject *self, PyObject *args) +static PyObject *py_blf_clipping(PyObject *UNUSED(self), PyObject *args) { float xmin, ymin, xmax, ymax; int fontid; @@ -219,7 +220,7 @@ static char py_blf_disable_doc[] = " :arg option: One of ROTATION, CLIPPING, SHADOW or KERNING_DEFAULT.\n" " :type option: int\n"; -static PyObject *py_blf_disable(PyObject *self, PyObject *args) +static PyObject *py_blf_disable(PyObject *UNUSED(self), PyObject *args) { int option, fontid; @@ -241,7 +242,7 @@ static char py_blf_enable_doc[] = " :arg option: One of ROTATION, CLIPPING, SHADOW or KERNING_DEFAULT.\n" " :type option: int\n"; -static PyObject *py_blf_enable(PyObject *self, PyObject *args) +static PyObject *py_blf_enable(PyObject *UNUSED(self), PyObject *args) { int option, fontid; @@ -263,7 +264,7 @@ static char py_blf_rotation_doc[] = " :arg angle: The angle for text drawing to use.\n" " :type angle: float\n"; -static PyObject *py_blf_rotation(PyObject *self, PyObject *args) +static PyObject *py_blf_rotation(PyObject *UNUSED(self), PyObject *args) { float angle; int fontid; @@ -294,7 +295,7 @@ static char py_blf_shadow_doc[] = " :arg a: Shadow color (alpha channel 0.0 - 1.0).\n" " :type a: float\n"; -static PyObject *py_blf_shadow(PyObject *self, PyObject *args) +static PyObject *py_blf_shadow(PyObject *UNUSED(self), PyObject *args) { int level, fontid; float r, g, b, a; @@ -324,7 +325,7 @@ static char py_blf_shadow_offset_doc[] = " :arg y: Horizontal shadow offset value in pixels.\n" " :type y: float\n"; -static PyObject *py_blf_shadow_offset(PyObject *self, PyObject *args) +static PyObject *py_blf_shadow_offset(PyObject *UNUSED(self), PyObject *args) { int x, y, fontid; @@ -346,7 +347,7 @@ static char py_blf_load_doc[] = " :return: the new font's fontid or -1 if there was an error.\n" " :rtype: integer\n"; -static PyObject *py_blf_load(PyObject *self, PyObject *args) +static PyObject *py_blf_load(PyObject *UNUSED(self), PyObject *args) { char* filename; diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index 394c388394a..568cef0f676 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -30,6 +30,7 @@ #include "DNA_text_types.h" #include "MEM_guardedalloc.h" +#include "BKE_utildefines.h" /* UNUSED */ #include "BKE_text.h" /* txt_to_buf */ #include "BKE_main.h" #include "BKE_global.h" /* grr, only for G.sce */ @@ -191,7 +192,7 @@ PyObject *bpy_text_reimport( PyObject *module, int *found ) } -static PyObject *blender_import( PyObject * self, PyObject * args, PyObject * kw) +static PyObject *blender_import(PyObject *UNUSED(self), PyObject *args, PyObject * kw) { PyObject *exception, *err, *tb; char *name; @@ -244,7 +245,7 @@ static PyObject *blender_import( PyObject * self, PyObject * args, PyObject * k * our reload() module, to handle reloading in-memory scripts */ -static PyObject *blender_reload( PyObject * self, PyObject * module ) +static PyObject *blender_reload(PyObject *UNUSED(self), PyObject * module) { PyObject *exception, *err, *tb; PyObject *newmodule = NULL; diff --git a/source/blender/python/generic/geometry.c b/source/blender/python/generic/geometry.c index 0e98760314d..e0583cc0028 100644 --- a/source/blender/python/generic/geometry.c +++ b/source/blender/python/generic/geometry.c @@ -60,7 +60,7 @@ static char M_Geometry_BezierInterp_doc[] = ""; //---------------------------------INTERSECTION FUNCTIONS-------------------- //----------------------------------geometry.Intersect() ------------------- -static PyObject *M_Geometry_Intersect( PyObject * self, PyObject * args ) +static PyObject *M_Geometry_Intersect(PyObject *UNUSED(self), PyObject* args) { VectorObject *ray, *ray_off, *vec1, *vec2, *vec3; float dir[3], orig[3], v1[3], v2[3], v3[3], e1[3], e2[3], pvec[3], tvec[3], qvec[3]; @@ -133,7 +133,7 @@ static PyObject *M_Geometry_Intersect( PyObject * self, PyObject * args ) } //----------------------------------geometry.LineIntersect() ------------------- /* Line-Line intersection using algorithm from mathworld.wolfram.com */ -static PyObject *M_Geometry_LineIntersect( PyObject * self, PyObject * args ) +static PyObject *M_Geometry_LineIntersect(PyObject *UNUSED(self), PyObject* args) { PyObject * tuple; VectorObject *vec1, *vec2, *vec3, *vec4; @@ -201,7 +201,7 @@ static PyObject *M_Geometry_LineIntersect( PyObject * self, PyObject * args ) //---------------------------------NORMALS FUNCTIONS-------------------- //----------------------------------geometry.QuadNormal() ------------------- -static PyObject *M_Geometry_QuadNormal( PyObject * self, PyObject * args ) +static PyObject *M_Geometry_QuadNormal(PyObject *UNUSED(self), PyObject* args) { VectorObject *vec1; VectorObject *vec2; @@ -252,7 +252,7 @@ static PyObject *M_Geometry_QuadNormal( PyObject * self, PyObject * args ) } //----------------------------geometry.TriangleNormal() ------------------- -static PyObject *M_Geometry_TriangleNormal( PyObject * self, PyObject * args ) +static PyObject *M_Geometry_TriangleNormal(PyObject *UNUSED(self), PyObject* args) { VectorObject *vec1, *vec2, *vec3; float v1[3], v2[3], v3[3], e1[3], e2[3], n[3]; @@ -289,7 +289,7 @@ static PyObject *M_Geometry_TriangleNormal( PyObject * self, PyObject * args ) //--------------------------------- AREA FUNCTIONS-------------------- //----------------------------------geometry.TriangleArea() ------------------- -static PyObject *M_Geometry_TriangleArea( PyObject * self, PyObject * args ) +static PyObject *M_Geometry_TriangleArea(PyObject *UNUSED(self), PyObject* args) { VectorObject *vec1, *vec2, *vec3; float v1[3], v2[3], v3[3]; @@ -335,7 +335,7 @@ static PyObject *M_Geometry_TriangleArea( PyObject * self, PyObject * args ) /*----------------------------------geometry.PolyFill() -------------------*/ /* PolyFill function, uses Blenders scanfill to fill multiple poly lines */ -static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) +static PyObject *M_Geometry_PolyFill(PyObject *UNUSED(self), PyObject * polyLineSeq ) { PyObject *tri_list; /*return this list of tri's */ PyObject *polyLine, *polyVec; @@ -450,7 +450,7 @@ static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) } -static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) +static PyObject *M_Geometry_LineIntersect2D(PyObject *UNUSED(self), PyObject* args) { VectorObject *line_a1, *line_a2, *line_b1, *line_b2; float a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y, xi, yi, a1,a2,b1,b2, newvec[2]; @@ -548,7 +548,7 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) Py_RETURN_NONE; } -static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args ) +static PyObject *M_Geometry_ClosestPointOnLine(PyObject *UNUSED(self), PyObject* args) { VectorObject *pt, *line_1, *line_2; float pt_in[3], pt_out[3], l1[3], l2[3]; @@ -586,7 +586,7 @@ static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args return ret; } -static PyObject *M_Geometry_PointInTriangle2D( PyObject * self, PyObject * args ) +static PyObject *M_Geometry_PointInTriangle2D(PyObject *UNUSED(self), PyObject* args) { VectorObject *pt_vec, *tri_p1, *tri_p2, *tri_p3; @@ -606,7 +606,7 @@ static PyObject *M_Geometry_PointInTriangle2D( PyObject * self, PyObject * args return PyLong_FromLong(isect_point_tri_v2(pt_vec->vec, tri_p1->vec, tri_p2->vec, tri_p3->vec)); } -static PyObject *M_Geometry_PointInQuad2D( PyObject * self, PyObject * args ) +static PyObject *M_Geometry_PointInQuad2D(PyObject *UNUSED(self), PyObject* args) { VectorObject *pt_vec, *quad_p1, *quad_p2, *quad_p3, *quad_p4; @@ -690,7 +690,7 @@ static void boxPack_ToPyObject(PyObject * value, boxPack **boxarray) } -static PyObject *M_Geometry_BoxPack2D( PyObject * self, PyObject * boxlist ) +static PyObject *M_Geometry_BoxPack2D(PyObject *UNUSED(self), PyObject * boxlist ) { boxPack *boxarray = NULL; float tot_width, tot_height; @@ -718,7 +718,7 @@ static PyObject *M_Geometry_BoxPack2D( PyObject * self, PyObject * boxlist ) return Py_BuildValue( "ff", tot_width, tot_height); } -static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ) +static PyObject *M_Geometry_BezierInterp(PyObject *UNUSED(self), PyObject* args) { VectorObject *vec_k1, *vec_h1, *vec_k2, *vec_h2; int resolu; @@ -767,7 +767,7 @@ static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ) return list; } -static PyObject *M_Geometry_BarycentricTransform(PyObject * self, PyObject * args) +static PyObject *M_Geometry_BarycentricTransform(PyObject *UNUSED(self), PyObject *args) { VectorObject *vec_pt; VectorObject *vec_t1_tar, *vec_t2_tar, *vec_t3_tar; diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c index e81bc0cf239..540a9831dce 100644 --- a/source/blender/python/generic/mathutils.c +++ b/source/blender/python/generic/mathutils.c @@ -61,6 +61,8 @@ #include "BLI_math.h" +#include "BKE_utildefines.h" + //-------------------------DOC STRINGS --------------------------- static char M_Mathutils_doc[] = "This module provides access to matrices, eulers, quaternions and vectors."; @@ -203,7 +205,7 @@ int _BaseMathObject_WriteIndexCallback(BaseMathObject *self, int index) /* BaseMathObject generic functions for all mathutils types */ char BaseMathObject_Owner_doc[] = "The item this is wrapping or None (readonly)."; -PyObject *BaseMathObject_getOwner( BaseMathObject * self, void *type ) +PyObject *BaseMathObject_getOwner(BaseMathObject *UNUSED(self), void *UNUSED(type)) { PyObject *ret= self->cb_user ? self->cb_user : Py_None; Py_INCREF(ret); @@ -211,7 +213,7 @@ PyObject *BaseMathObject_getOwner( BaseMathObject * self, void *type ) } char BaseMathObject_Wrapped_doc[] = "True when this object wraps external data (readonly).\n\n:type: boolean"; -PyObject *BaseMathObject_getWrapped( BaseMathObject *self, void *type ) +PyObject *BaseMathObject_getWrapped(BaseMathObject *UNUSED(self), void *UNUSED(type)) { return PyBool_FromLong((self->wrapped == Py_WRAP) ? 1:0); } diff --git a/source/blender/python/generic/mathutils_color.c b/source/blender/python/generic/mathutils_color.c index 57d2838238c..8380adef496 100644 --- a/source/blender/python/generic/mathutils_color.c +++ b/source/blender/python/generic/mathutils_color.c @@ -31,10 +31,15 @@ //----------------------------------mathutils.Color() ------------------- //makes a new color for you to play with -static PyObject *Color_new(PyTypeObject * type, PyObject * args, PyObject * kwargs) +static PyObject *Color_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds) { float col[3]= {0.0f, 0.0f, 0.0f}; + if(kwds && PyDict_Size(kwds)) { + PyErr_SetString(PyExc_TypeError, "mathutils.Color(): takes no keyword args"); + return NULL; + } + switch(PyTuple_GET_SIZE(args)) { case 0: break; @@ -83,7 +88,7 @@ static char Color_copy_doc[] = "\n" " .. note:: use this to get a copy of a wrapped color with no reference to the original data.\n"; -static PyObject *Color_copy(ColorObject * self, PyObject *args) +static PyObject *Color_copy(ColorObject *self) { if(!BaseMath_ReadCallback(self)) return NULL; @@ -158,7 +163,7 @@ static PyObject* Color_richcmpr(PyObject *objectA, PyObject *objectB, int compar //---------------------SEQUENCE PROTOCOLS------------------------ //----------------------------len(object)------------------------ //sequence length -static int Color_len(ColorObject * self) +static int Color_len(ColorObject *UNUSED(self)) { return COLOR_SIZE; } @@ -394,7 +399,7 @@ static int Color_setChannelHSV(ColorObject * self, PyObject * value, void * type } /* color channel (HSV), color.h/s/v */ -static PyObject *Color_getHSV(ColorObject * self, void *type) +static PyObject *Color_getHSV(ColorObject * self, void *UNUSED(closure)) { float hsv[3]; PyObject *ret; @@ -411,7 +416,7 @@ static PyObject *Color_getHSV(ColorObject * self, void *type) return ret; } -static int Color_setHSV(ColorObject * self, PyObject * value, void * type) +static int Color_setHSV(ColorObject * self, PyObject * value, void *UNUSED(closure)) { float hsv[3]; @@ -452,8 +457,8 @@ static PyGetSetDef Color_getseters[] = { //-----------------------METHOD DEFINITIONS ---------------------- static struct PyMethodDef Color_methods[] = { - {"__copy__", (PyCFunction) Color_copy, METH_VARARGS, Color_copy_doc}, - {"copy", (PyCFunction) Color_copy, METH_VARARGS, Color_copy_doc}, + {"__copy__", (PyCFunction) Color_copy, METH_NOARGS, Color_copy_doc}, + {"copy", (PyCFunction) Color_copy, METH_NOARGS, Color_copy_doc}, {NULL, NULL, 0, NULL} }; diff --git a/source/blender/python/generic/mathutils_euler.c b/source/blender/python/generic/mathutils_euler.c index f85578dd31d..c7091347493 100644 --- a/source/blender/python/generic/mathutils_euler.c +++ b/source/blender/python/generic/mathutils_euler.c @@ -39,7 +39,7 @@ //----------------------------------mathutils.Euler() ------------------- //makes a new euler for you to play with -static PyObject *Euler_new(PyTypeObject * type, PyObject * args, PyObject * kwargs) +static PyObject *Euler_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds) { PyObject *seq= NULL; char *order_str= NULL; @@ -47,6 +47,11 @@ static PyObject *Euler_new(PyTypeObject * type, PyObject * args, PyObject * kwar float eul[EULER_SIZE]= {0.0f, 0.0f, 0.0f}; short order= EULER_ORDER_XYZ; + if(kwds && PyDict_Size(kwds)) { + PyErr_SetString(PyExc_TypeError, "mathutils.Euler(): takes no keyword args"); + return NULL; + } + if(!PyArg_ParseTuple(args, "|Os:mathutils.Euler", &seq, &order_str)) return NULL; @@ -313,7 +318,7 @@ static char Euler_copy_doc[] = "\n" " .. note:: use this to get a copy of a wrapped euler with no reference to the original data.\n"; -static PyObject *Euler_copy(EulerObject * self, PyObject *args) +static PyObject *Euler_copy(EulerObject *self) { if(!BaseMath_ReadCallback(self)) return NULL; @@ -388,7 +393,7 @@ static PyObject* Euler_richcmpr(PyObject *objectA, PyObject *objectB, int compar //---------------------SEQUENCE PROTOCOLS------------------------ //----------------------------len(object)------------------------ //sequence length -static int Euler_len(EulerObject * self) +static int Euler_len(EulerObject *UNUSED(self)) { return EULER_SIZE; } @@ -411,7 +416,7 @@ static PyObject *Euler_item(EulerObject * self, int i) } //----------------------------object[]------------------------- //sequence accessor (set) -static int Euler_ass_item(EulerObject * self, int i, PyObject * value) +static int Euler_ass_item(EulerObject * self, int i, PyObject *value) { float f = PyFloat_AsDouble(value); @@ -577,18 +582,18 @@ static PyMappingMethods Euler_AsMapping = { /* * euler axis, euler.x/y/z */ -static PyObject *Euler_getAxis( EulerObject * self, void *type ) +static PyObject *Euler_getAxis(EulerObject *self, void *type ) { return Euler_item(self, GET_INT_FROM_POINTER(type)); } -static int Euler_setAxis( EulerObject * self, PyObject * value, void * type ) +static int Euler_setAxis(EulerObject *self, PyObject *value, void *type) { return Euler_ass_item(self, GET_INT_FROM_POINTER(type), value); } /* rotation order */ -static PyObject *Euler_getOrder(EulerObject *self, void *type) +static PyObject *Euler_getOrder(EulerObject *self, void *UNUSED(closure)) { const char order[][4] = {"XYZ", "XZY", "YXZ", "YZX", "ZXY", "ZYX"}; @@ -598,7 +603,7 @@ static PyObject *Euler_getOrder(EulerObject *self, void *type) return PyUnicode_FromString(order[self->order-EULER_ORDER_XYZ]); } -static int Euler_setOrder( EulerObject * self, PyObject * value, void * type ) +static int Euler_setOrder(EulerObject *self, PyObject *value, void *UNUSED(closure)) { char *order_str= _PyUnicode_AsString(value); short order= euler_order_from_string(order_str, "euler.order"); @@ -634,8 +639,8 @@ static struct PyMethodDef Euler_methods[] = { {"to_quat", (PyCFunction) Euler_ToQuat, METH_NOARGS, Euler_ToQuat_doc}, {"rotate_axis", (PyCFunction) Euler_rotate_axis, METH_VARARGS, Euler_rotate_axis_doc}, {"make_compatible", (PyCFunction) Euler_MakeCompatible, METH_O, Euler_MakeCompatible_doc}, - {"__copy__", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, - {"copy", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, + {"__copy__", (PyCFunction) Euler_copy, METH_NOARGS, Euler_copy_doc}, + {"copy", (PyCFunction) Euler_copy, METH_NOARGS, Euler_copy_doc}, {NULL, NULL, 0, NULL} }; diff --git a/source/blender/python/generic/mathutils_matrix.c b/source/blender/python/generic/mathutils_matrix.c index 3b8c7d3122a..9476e8127b6 100644 --- a/source/blender/python/generic/mathutils_matrix.c +++ b/source/blender/python/generic/mathutils_matrix.c @@ -108,7 +108,7 @@ Mathutils_Callback mathutils_matrix_vector_cb = { //----------------------------------mathutils.Matrix() ----------------- //mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. //create a new matrix type -static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +static PyObject *Matrix_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds) { PyObject *argObject, *m, *s; MatrixObject *mat; @@ -117,6 +117,11 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; float scalar; + if(kwds && PyDict_Size(kwds)) { + PyErr_SetString(PyExc_TypeError, "mathutils.Matrix(): takes no keyword args"); + return NULL; + } + argSize = PyTuple_GET_SIZE(args); if(argSize > MATRIX_MAX_DIM) { //bad arg nums PyErr_SetString(PyExc_AttributeError, "mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); @@ -1142,7 +1147,7 @@ static char Matrix_copy_doc[] = " :return: an instance of itself\n" " :rtype: :class:`Matrix`\n"; -PyObject *Matrix_copy(MatrixObject * self) +PyObject *Matrix_copy(MatrixObject *self) { if(!BaseMath_ReadCallback(self)) return NULL; @@ -1680,17 +1685,17 @@ static PyNumberMethods Matrix_NumMethods = { 0, /* nb_index */ }; -static PyObject *Matrix_getRowSize( MatrixObject * self, void *type ) +static PyObject *Matrix_getRowSize(MatrixObject *self, void *UNUSED(closure)) { return PyLong_FromLong((long) self->rowSize); } -static PyObject *Matrix_getColSize( MatrixObject * self, void *type ) +static PyObject *Matrix_getColSize(MatrixObject *self, void *UNUSED(closure)) { return PyLong_FromLong((long) self->colSize); } -static PyObject *Matrix_getMedianScale( MatrixObject * self, void *type ) +static PyObject *Matrix_getMedianScale(MatrixObject *self, void *UNUSED(closure)) { float mat[3][3]; @@ -1710,7 +1715,7 @@ static PyObject *Matrix_getMedianScale( MatrixObject * self, void *type ) return PyFloat_FromDouble(mat3_to_scale(mat)); } -static PyObject *Matrix_getIsNegative( MatrixObject * self, void *type ) +static PyObject *Matrix_getIsNegative(MatrixObject *self, void *UNUSED(closure)) { if(!BaseMath_ReadCallback(self)) return NULL; diff --git a/source/blender/python/generic/mathutils_quat.c b/source/blender/python/generic/mathutils_quat.c index 553844b6ee5..37f20ebbe31 100644 --- a/source/blender/python/generic/mathutils_quat.c +++ b/source/blender/python/generic/mathutils_quat.c @@ -352,7 +352,7 @@ static char Quaternion_copy_doc[] = "\n" " .. note:: use this to get a copy of a wrapped quaternion with no reference to the original data.\n"; -static PyObject *Quaternion_copy(QuaternionObject * self) +static PyObject *Quaternion_copy(QuaternionObject *self) { if(!BaseMath_ReadCallback(self)) return NULL; @@ -429,7 +429,7 @@ static PyObject* Quaternion_richcmpr(PyObject *objectA, PyObject *objectB, int c //---------------------SEQUENCE PROTOCOLS------------------------ //----------------------------len(object)------------------------ //sequence length -static int Quaternion_len(QuaternionObject * self) +static int Quaternion_len(QuaternionObject *UNUSED(self)) { return QUAT_SIZE; } @@ -772,7 +772,7 @@ static int Quaternion_setAxis( QuaternionObject * self, PyObject * value, void * return Quaternion_ass_item(self, GET_INT_FROM_POINTER(type), value); } -static PyObject *Quaternion_getMagnitude( QuaternionObject * self, void *type ) +static PyObject *Quaternion_getMagnitude(QuaternionObject * self, void *UNUSED(closure)) { if(!BaseMath_ReadCallback(self)) return NULL; @@ -780,7 +780,7 @@ static PyObject *Quaternion_getMagnitude( QuaternionObject * self, void *type ) return PyFloat_FromDouble(sqrt(dot_qtqt(self->quat, self->quat))); } -static PyObject *Quaternion_getAngle( QuaternionObject * self, void *type ) +static PyObject *Quaternion_getAngle(QuaternionObject * self, void *UNUSED(closure)) { if(!BaseMath_ReadCallback(self)) return NULL; @@ -788,7 +788,7 @@ static PyObject *Quaternion_getAngle( QuaternionObject * self, void *type ) return PyFloat_FromDouble(2.0 * (saacos(self->quat[0]))); } -static int Quaternion_setAngle(QuaternionObject * self, PyObject * value, void * type) +static int Quaternion_setAngle(QuaternionObject * self, PyObject * value, void *UNUSED(closure)) { float axis[3]; float angle; @@ -821,7 +821,7 @@ static int Quaternion_setAngle(QuaternionObject * self, PyObject * value, void * return 0; } -static PyObject *Quaternion_getAxisVec(QuaternionObject *self, void *type) +static PyObject *Quaternion_getAxisVec(QuaternionObject *self, void *UNUSED(closure)) { float axis[3]; float angle; @@ -842,7 +842,7 @@ static PyObject *Quaternion_getAxisVec(QuaternionObject *self, void *type) return (PyObject *) newVectorObject(axis, 3, Py_NEW, NULL); } -static int Quaternion_setAxisVec(QuaternionObject *self, PyObject *value, void *type) +static int Quaternion_setAxisVec(QuaternionObject *self, PyObject *value, void *UNUSED(closure)) { float axis[3]; float angle; @@ -872,12 +872,17 @@ static int Quaternion_setAxisVec(QuaternionObject *self, PyObject *value, void * } //----------------------------------mathutils.Quaternion() -------------- -static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +static PyObject *Quaternion_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds) { PyObject *seq= NULL; float angle = 0.0f; float quat[QUAT_SIZE]= {0.0f, 0.0f, 0.0f, 0.0f}; + if(kwds && PyDict_Size(kwds)) { + PyErr_SetString(PyExc_TypeError, "mathutils.Quaternion(): takes no keyword args"); + return NULL; + } + if(!PyArg_ParseTuple(args, "|Of:mathutils.Quaternion", &seq, &angle)) return NULL; diff --git a/source/blender/python/generic/mathutils_vector.c b/source/blender/python/generic/mathutils_vector.c index 1fe2518c6ef..84f41b6e66a 100644 --- a/source/blender/python/generic/mathutils_vector.c +++ b/source/blender/python/generic/mathutils_vector.c @@ -45,7 +45,7 @@ static PyObject *Vector_ToTupleExt(VectorObject *self, int ndigits); //----------------------------------mathutils.Vector() ------------------ // Supports 2D, 3D, and 4D vector objects both int and float values // accepted. Mixed float and int values accepted. Ints are parsed to float -static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds)) { float vec[4]= {0.0f, 0.0f, 0.0f, 0.0f}; int size= 3; /* default to a 3D vector */ @@ -1445,7 +1445,7 @@ static int Vector_setAxis(VectorObject *self, PyObject * value, void * type ) } /* vector.length */ -static PyObject *Vector_getLength(VectorObject *self, void *type ) +static PyObject *Vector_getLength(VectorObject *self, void *UNUSED(closure)) { double dot = 0.0f; int i; diff --git a/source/blender/python/generic/noise.c b/source/blender/python/generic/noise.c index 4a09cbb58d8..a9bbc016a54 100644 --- a/source/blender/python/generic/noise.c +++ b/source/blender/python/generic/noise.c @@ -39,6 +39,8 @@ #include "BLI_blenlib.h" #include "DNA_texture_types.h" + +#include "BKE_utildefines.h" /*-----------------------------------------*/ /* 'mersenne twister' random number generator */ @@ -207,12 +209,12 @@ static void randuvec(float v[3]) v[2] = 1.f; } -static PyObject *Noise_random(PyObject * self) +static PyObject *Noise_random(PyObject *UNUSED(self)) { return PyFloat_FromDouble(frand()); } -static PyObject *Noise_random_unit_vector(PyObject * self) +static PyObject *Noise_random_unit_vector(PyObject *UNUSED(self)) { float v[3] = {0.0f, 0.0f, 0.0f}; randuvec(v); @@ -223,7 +225,7 @@ static PyObject *Noise_random_unit_vector(PyObject * self) /* Random seed init. Only used for MT random() & randuvec() */ -static PyObject *Noise_seed_set(PyObject * self, PyObject * args) +static PyObject *Noise_seed_set(PyObject *UNUSED(self), PyObject *args) { int s; if(!PyArg_ParseTuple(args, "i:seed_set", &s)) @@ -236,7 +238,7 @@ static PyObject *Noise_seed_set(PyObject * self, PyObject * args) /* General noise */ -static PyObject *Noise_noise(PyObject * self, PyObject * args) +static PyObject *Noise_noise(PyObject *UNUSED(self), PyObject *args) { float x, y, z; int nb = 1; @@ -260,7 +262,7 @@ static void noise_vector(float x, float y, float z, int nb, float v[3]) nb) - 1.0); } -static PyObject *Noise_vector(PyObject * self, PyObject * args) +static PyObject *Noise_vector(PyObject *UNUSED(self), PyObject *args) { float x, y, z, v[3]; int nb = 1; @@ -296,7 +298,7 @@ static float turb(float x, float y, float z, int oct, int hard, int nb, return out; } -static PyObject *Noise_turbulence(PyObject * self, PyObject * args) +static PyObject *Noise_turbulence(PyObject *UNUSED(self), PyObject *args) { float x, y, z; int oct, hd, nb = 1; @@ -340,7 +342,7 @@ static void vTurb(float x, float y, float z, int oct, int hard, int nb, } } -static PyObject *Noise_turbulence_vector(PyObject * self, PyObject * args) +static PyObject *Noise_turbulence_vector(PyObject *UNUSED(self), PyObject *args) { float x, y, z, v[3]; int oct, hd, nb = 1; @@ -355,7 +357,7 @@ static PyObject *Noise_turbulence_vector(PyObject * self, PyObject * args) /* F. Kenton Musgrave's fractal functions */ -static PyObject *Noise_fractal(PyObject * self, PyObject * args) +static PyObject *Noise_fractal(PyObject *UNUSED(self), PyObject *args) { float x, y, z, H, lac, oct; int nb = 1; @@ -366,7 +368,7 @@ static PyObject *Noise_fractal(PyObject * self, PyObject * args) /*------------------------------------------------------------------------*/ -static PyObject *Noise_multi_fractal(PyObject * self, PyObject * args) +static PyObject *Noise_multi_fractal(PyObject *UNUSED(self), PyObject *args) { float x, y, z, H, lac, oct; int nb = 1; @@ -378,7 +380,7 @@ static PyObject *Noise_multi_fractal(PyObject * self, PyObject * args) /*------------------------------------------------------------------------*/ -static PyObject *Noise_vl_vector(PyObject * self, PyObject * args) +static PyObject *Noise_vl_vector(PyObject *UNUSED(self), PyObject *args) { float x, y, z, d; int nt1 = 1, nt2 = 1; @@ -389,7 +391,7 @@ static PyObject *Noise_vl_vector(PyObject * self, PyObject * args) /*-------------------------------------------------------------------------*/ -static PyObject *Noise_hetero_terrain(PyObject * self, PyObject * args) +static PyObject *Noise_hetero_terrain(PyObject *UNUSED(self), PyObject *args) { float x, y, z, H, lac, oct, ofs; int nb = 1; @@ -401,7 +403,7 @@ static PyObject *Noise_hetero_terrain(PyObject * self, PyObject * args) /*-------------------------------------------------------------------------*/ -static PyObject *Noise_hybrid_multi_fractal(PyObject * self, PyObject * args) +static PyObject *Noise_hybrid_multi_fractal(PyObject *UNUSED(self), PyObject *args) { float x, y, z, H, lac, oct, ofs, gn; int nb = 1; @@ -413,7 +415,7 @@ static PyObject *Noise_hybrid_multi_fractal(PyObject * self, PyObject * args) /*------------------------------------------------------------------------*/ -static PyObject *Noise_ridged_multi_fractal(PyObject * self, PyObject * args) +static PyObject *Noise_ridged_multi_fractal(PyObject *UNUSED(self), PyObject *args) { float x, y, z, H, lac, oct, ofs, gn; int nb = 1; @@ -424,7 +426,7 @@ static PyObject *Noise_ridged_multi_fractal(PyObject * self, PyObject * args) /*-------------------------------------------------------------------------*/ -static PyObject *Noise_voronoi(PyObject * self, PyObject * args) +static PyObject *Noise_voronoi(PyObject *UNUSED(self), PyObject *args) { float x, y, z, da[4], pa[12]; int dtype = 0; @@ -441,7 +443,7 @@ static PyObject *Noise_voronoi(PyObject * self, PyObject * args) /*-------------------------------------------------------------------------*/ -static PyObject *Noise_cell(PyObject * self, PyObject * args) +static PyObject *Noise_cell(PyObject *UNUSED(self), PyObject *args) { float x, y, z; if(!PyArg_ParseTuple(args, "(fff):cell", &x, &y, &z)) @@ -452,7 +454,7 @@ static PyObject *Noise_cell(PyObject * self, PyObject * args) /*--------------------------------------------------------------------------*/ -static PyObject *Noise_cell_vector(PyObject * self, PyObject * args) +static PyObject *Noise_cell_vector(PyObject *UNUSED(self), PyObject *args) { float x, y, z, ca[3]; if(!PyArg_ParseTuple(args, "(fff):cell_vector", &x, &y, &z)) @@ -603,22 +605,22 @@ look like anything from an earthquake to a very nervous or maybe even drunk came /* Just in case, declarations for a header file */ /* -static PyObject *Noise_random(PyObject *self); -static PyObject *Noise_random_unit_vector(PyObject *self); -static PyObject *Noise_seed_set(PyObject *self, PyObject *args); -static PyObject *Noise_noise(PyObject *self, PyObject *args); -static PyObject *Noise_vector(PyObject *self, PyObject *args); -static PyObject *Noise_turbulence(PyObject *self, PyObject *args); -static PyObject *Noise_turbulence_vector(PyObject *self, PyObject *args); -static PyObject *Noise_fractal(PyObject *self, PyObject *args); -static PyObject *Noise_multi_fractal(PyObject *self, PyObject *args); -static PyObject *Noise_vl_vector(PyObject *self, PyObject *args); -static PyObject *Noise_hetero_terrain(PyObject *self, PyObject *args); -static PyObject *Noise_hybrid_multi_fractal(PyObject *self, PyObject *args); -static PyObject *Noise_ridged_multi_fractal(PyObject *self, PyObject *args); -static PyObject *Noise_voronoi(PyObject *self, PyObject *args); -static PyObject *Noise_cell(PyObject *self, PyObject *args); -static PyObject *Noise_cell_vector(PyObject *self, PyObject *args); +static PyObject *Noise_random(PyObject *UNUSED(self)); +static PyObject *Noise_random_unit_vector(PyObject *UNUSED(self)); +static PyObject *Noise_seed_set(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_noise(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_vector(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_turbulence(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_turbulence_vector(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_fractal(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_multi_fractal(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_vl_vector(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_hetero_terrain(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_hybrid_multi_fractal(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_ridged_multi_fractal(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_voronoi(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_cell(PyObject *UNUSED(self), PyObject *args); +static PyObject *Noise_cell_vector(PyObject *UNUSED(self), PyObject *args); */ static PyMethodDef NoiseMethods[] = { diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 69b5faceca0..afcf7e757e6 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -34,7 +34,9 @@ #include "BLI_path_util.h" #include "BLI_bpath.h" - + +#include "BKE_utildefines.h" + /* external util modules */ #include "../generic/geometry.h" #include "../generic/bgl.h" @@ -51,7 +53,7 @@ static char bpy_script_paths_doc[] = " :return: (system, user) strings will be empty when not found.\n" " :rtype: tuple of strigs\n"; -PyObject *bpy_script_paths(PyObject *self) +PyObject *bpy_script_paths(PyObject *UNUSED(self)) { PyObject *ret= PyTuple_New(2); char *path; @@ -73,7 +75,7 @@ static char bpy_blend_paths_doc[] = " :type absolute: boolean\n" " :return: path list.\n" " :rtype: list of strigs\n"; -static PyObject *bpy_blend_paths(PyObject * self, PyObject *args, PyObject *kw) +static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObject *kw) { struct BPathIterator bpi; PyObject *list = PyList_New(0), *st; /* stupidly big string to be safe */ @@ -124,7 +126,7 @@ static char bpy_user_resource_doc[] = " :type subdir: string\n" " :return: a path.\n" " :rtype: string\n"; -static PyObject *bpy_user_resource(PyObject * self, PyObject *args, PyObject *kw) +static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObject *kw) { char *type; char *subdir= NULL; diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 6c4e190673c..46a3c93292b 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -26,6 +26,7 @@ #include "BLI_path_util.h" +#include "BKE_utildefines.h" #include "BKE_blender.h" #include "BKE_global.h" #include "structseq.h" @@ -116,21 +117,15 @@ static PyObject *make_app_info(void) /* a few getsets because it makes sense for them to be in bpy.app even though * they are not static */ -static PyObject *bpy_app_debug_get(PyObject *self, void *closure) +static PyObject *bpy_app_debug_get(PyObject *UNUSED(self), void *UNUSED(closure)) { - (void)(self); - (void)(closure); - return PyBool_FromLong(G.f & G_DEBUG); } -static int bpy_app_debug_set(PyObject *self, PyObject *value, void *closure) +static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *UNUSED(closure)) { int param= PyObject_IsTrue(value); - (void)(self); - (void)(closure); - if(param < 0) { PyErr_SetString(PyExc_TypeError, "bpy.app.debug can only be True/False"); return -1; @@ -142,12 +137,9 @@ static int bpy_app_debug_set(PyObject *self, PyObject *value, void *closure) return 0; } -static PyObject *bpy_app_tempdir_get(PyObject *self, void *closure) +static PyObject *bpy_app_tempdir_get(PyObject *UNUSED(self), void *UNUSED(closure)) { extern char btempdir[]; - (void)(self); - (void)(closure); - return PyC_UnicodeFromByte(btempdir); } diff --git a/source/blender/python/intern/bpy_array.c b/source/blender/python/intern/bpy_array.c index 6d971d8708e..d219757b777 100644 --- a/source/blender/python/intern/bpy_array.c +++ b/source/blender/python/intern/bpy_array.c @@ -237,7 +237,7 @@ static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int return data; } -static int py_to_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix) +static int py_to_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix) { int totdim, dim_size[MAX_ARRAY_DIMENSION]; int totitem; @@ -358,18 +358,18 @@ static void bool_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, void * RNA_property_boolean_set_index(ptr, prop, index, *(int*)value); } -int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, char *param_data, PyObject *py, const char *error_prefix) +int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyObject *py, const char *error_prefix) { int ret; switch (RNA_property_type(prop)) { case PROP_FLOAT: - ret= py_to_array(py, ptr, prop, parms, param_data, py_float_check, "float", sizeof(float), py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array, error_prefix); + ret= py_to_array(py, ptr, prop, param_data, py_float_check, "float", sizeof(float), py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array, error_prefix); break; case PROP_INT: - ret= py_to_array(py, ptr, prop, parms, param_data, py_int_check, "int", sizeof(int), py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array, error_prefix); + ret= py_to_array(py, ptr, prop, param_data, py_int_check, "int", sizeof(int), py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array, error_prefix); break; case PROP_BOOLEAN: - ret= py_to_array(py, ptr, prop, parms, param_data, py_bool_check, "boolean", sizeof(int), py_to_bool, (RNA_SetArrayFunc)RNA_property_boolean_set_array, error_prefix); + ret= py_to_array(py, ptr, prop, param_data, py_bool_check, "boolean", sizeof(int), py_to_bool, (RNA_SetArrayFunc)RNA_property_boolean_set_array, error_prefix); break; default: PyErr_SetString(PyExc_TypeError, "not an array type"); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index bc79ba94756..3ff0d86b433 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -43,6 +43,7 @@ #include "BLI_math_base.h" #include "BLI_string.h" +#include "BKE_utildefines.h" #include "BKE_context.h" #include "BKE_text.h" #include "BKE_font.h" /* only for utf8towchar */ @@ -104,7 +105,8 @@ void bpy_context_set(bContext *C, PyGILState_STATE *gilstate) } } -void bpy_context_clear(bContext *C, PyGILState_STATE *gilstate) +/* context should be used but not now because it causes some bugs */ +void bpy_context_clear(bContext *UNUSED(C), PyGILState_STATE *gilstate) { py_call_level--; diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 2b475a57de6..3ffa78dab70 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -40,7 +40,7 @@ #include "MEM_guardedalloc.h" #include "BKE_report.h" -static PyObject *pyop_poll( PyObject * self, PyObject * args) +static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args) { wmOperatorType *ot; char *opname; @@ -80,7 +80,7 @@ static PyObject *pyop_poll( PyObject * self, PyObject * args) return ret; } -static PyObject *pyop_call( PyObject * self, PyObject * args) +static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) { wmOperatorType *ot; int error_val = 0; @@ -196,7 +196,7 @@ static PyObject *pyop_call( PyObject * self, PyObject * args) } -static PyObject *pyop_as_string( PyObject * self, PyObject * args) +static PyObject *pyop_as_string(PyObject *UNUSED(self), PyObject *args) { wmOperatorType *ot; PointerRNA ptr; @@ -248,7 +248,7 @@ static PyObject *pyop_as_string( PyObject * self, PyObject * args) return pybuf; } -static PyObject *pyop_dir(PyObject *self) +static PyObject *pyop_dir(PyObject *UNUSED(self)) { PyObject *list = PyList_New(0), *name; wmOperatorType *ot; @@ -262,7 +262,7 @@ static PyObject *pyop_dir(PyObject *self) return list; } -static PyObject *pyop_getrna(PyObject *self, PyObject *value) +static PyObject *pyop_getrna(PyObject *UNUSED(self), PyObject *value) { wmOperatorType *ot; PointerRNA ptr; diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 6d16896fb16..fa1aeacbc42 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -84,7 +84,7 @@ void macro_wrapper(wmOperatorType *ot, void *userdata) operator_properties_init(ot); } -PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args) +PyObject *PYOP_wrap_macro_define(PyObject *UNUSED(self), PyObject *args) { wmOperatorType *ot; wmOperatorTypeMacro *otmacro; diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index b49a48699fa..a3b0c4739c4 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -58,7 +58,7 @@ #include "../generic/IDProp.h" /* for IDprop lookups */ #include "../generic/py_capi_utils.h" -static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, void *data, PyObject *value, const char *error_prefix); +static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *value, const char *error_prefix); static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, int start, int stop, int length); static Py_ssize_t pyrna_prop_array_length(BPy_PropertyArrayRNA *self); static Py_ssize_t pyrna_prop_collection_length(BPy_PropertyRNA *self); @@ -135,7 +135,7 @@ static int mathutils_rna_vector_set(BaseMathObject *bmo, int subtype) return 1; } -static int mathutils_rna_vector_get_index(BaseMathObject *bmo, int subtype, int index) +static int mathutils_rna_vector_get_index(BaseMathObject *bmo, int UNUSED(subtype), int index) { BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user; @@ -146,7 +146,7 @@ static int mathutils_rna_vector_get_index(BaseMathObject *bmo, int subtype, int return 1; } -static int mathutils_rna_vector_set_index(BaseMathObject *bmo, int subtype, int index) +static int mathutils_rna_vector_set_index(BaseMathObject *bmo, int UNUSED(subtype), int index) { BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user; @@ -176,7 +176,7 @@ Mathutils_Callback mathutils_rna_array_cb = { /* bpyrna matrix callbacks */ static int mathutils_rna_matrix_cb_index= -1; /* index for our callbacks */ -static int mathutils_rna_matrix_get(BaseMathObject *bmo, int subtype) +static int mathutils_rna_matrix_get(BaseMathObject *bmo, int UNUSED(subtype)) { BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user; @@ -187,7 +187,7 @@ static int mathutils_rna_matrix_get(BaseMathObject *bmo, int subtype) return 1; } -static int mathutils_rna_matrix_set(BaseMathObject *bmo, int subtype) +static int mathutils_rna_matrix_set(BaseMathObject *bmo, int UNUSED(subtype)) { BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user; @@ -864,7 +864,7 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const cha break; } } else { - if (pyrna_py_to_prop(ptr, prop, NULL, NULL, item, error_prefix)) { + if (pyrna_py_to_prop(ptr, prop, NULL, item, error_prefix)) { error_val= -1; break; } @@ -918,7 +918,7 @@ static PyObject *pyrna_func_to_py(BPy_DummyPointerRNA *pyrna, FunctionRNA *func) -static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, void *data, PyObject *value, const char *error_prefix) +static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *value, const char *error_prefix) { /* XXX hard limits should be checked here */ int type = RNA_property_type(prop); @@ -941,7 +941,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *p return -1; } /* done getting the length */ - ok= pyrna_py_to_array(ptr, prop, parms, data, value, error_prefix); + ok= pyrna_py_to_array(ptr, prop, data, value, error_prefix); if (!ok) { /* PyErr_Format(PyExc_AttributeError, "%.200s %s", error_prefix, error_str); */ @@ -1391,7 +1391,7 @@ static PyObject *pyrna_prop_collection_subscript_str(BPy_PropertyRNA *self, cons } /* static PyObject *pyrna_prop_array_subscript_str(BPy_PropertyRNA *self, char *keyname) */ -static PyObject *pyrna_prop_collection_subscript_slice(PointerRNA *ptr, PropertyRNA *prop, int start, int stop, int length) +static PyObject *pyrna_prop_collection_subscript_slice(PointerRNA *ptr, PropertyRNA *prop, int start, int stop) { PointerRNA newptr; PyObject *list = PyList_New(stop - start); @@ -1513,7 +1513,7 @@ static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject return PyList_New(0); } else if (step == 1) { - return pyrna_prop_collection_subscript_slice(&self->ptr, self->prop, start, stop, len); + return pyrna_prop_collection_subscript_slice(&self->ptr, self->prop, start, stop); } else { PyErr_SetString(PyExc_TypeError, "bpy_prop_collection[slice]: slice steps not supported with rna"); @@ -2431,7 +2431,7 @@ static char pyrna_struct_type_recast_doc[] = " :return: a new instance of this object with the type initialized again.\n" " :rtype: subclass of :class:`bpy_struct`"; -static PyObject *pyrna_struct_type_recast(BPy_StructRNA *self, PyObject *args) +static PyObject *pyrna_struct_type_recast(BPy_StructRNA *self) { PointerRNA r_ptr; RNA_pointer_recast(&self->ptr, &r_ptr); @@ -2751,7 +2751,7 @@ static int pyrna_struct_setattro( BPy_StructRNA *self, PyObject *pyname, PyObjec PyErr_SetString(PyExc_AttributeError, "bpy_struct: del not supported"); return -1; } - return pyrna_py_to_prop(&self->ptr, prop, NULL, NULL, value, "bpy_struct: item.attr = val:"); + return pyrna_py_to_prop(&self->ptr, prop, NULL, value, "bpy_struct: item.attr = val:"); } else { return PyObject_GenericSetAttr((PyObject *)self, pyname, value); @@ -2835,7 +2835,7 @@ static int pyrna_prop_collection_setattro( BPy_PropertyRNA *self, PyObject *pyna else if(RNA_property_collection_type_get(&self->ptr, self->prop, &r_ptr)) { if ((prop = RNA_struct_find_property(&r_ptr, name))) { /* pyrna_py_to_prop sets its own exceptions */ - return pyrna_py_to_prop(&r_ptr, prop, NULL, NULL, value, "BPy_PropertyRNA - Attribute (setattr):"); + return pyrna_py_to_prop(&r_ptr, prop, NULL, value, "BPy_PropertyRNA - Attribute (setattr):"); } } @@ -3409,7 +3409,7 @@ static struct PyMethodDef pyrna_prop_collection_idprop_methods[] = { /* only needed for subtyping, so a new class gets a valid BPy_StructRNA * todo - also accept useful args */ -static PyObject * pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { +static PyObject * pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds)) { BPy_StructRNA *base; @@ -3432,7 +3432,7 @@ static PyObject * pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject /* only needed for subtyping, so a new class gets a valid BPy_StructRNA * todo - also accept useful args */ -static PyObject * pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { +static PyObject * pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds)) { BPy_PropertyRNA *base; @@ -3454,7 +3454,7 @@ static PyObject * pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *k } } -PyObject *pyrna_param_to_py(PointerRNA *ptr, ParameterList *parms, PropertyRNA *prop, void *data) +PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) { PyObject *ret; int type = RNA_property_type(prop); @@ -3704,7 +3704,7 @@ static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw) continue; } - err= pyrna_py_to_prop(&funcptr, parm, &parms, iter.data, item, ""); + err= pyrna_py_to_prop(&funcptr, parm, iter.data, item, ""); if(err!=0) { /* the error generated isnt that useful, so generate it again with a useful prefix @@ -3717,7 +3717,7 @@ static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw) else snprintf(error_prefix, sizeof(error_prefix), "%s.%s(): error with argument %d, \"%s\" - ", RNA_struct_identifier(self_ptr->type), RNA_function_identifier(self_func), i, parm_id); - pyrna_py_to_prop(&funcptr, parm, &parms, iter.data, item, error_prefix); + pyrna_py_to_prop(&funcptr, parm, iter.data, item, error_prefix); break; } @@ -3822,13 +3822,13 @@ static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw) flag= RNA_property_flag(parm); if (flag & PROP_OUTPUT) - PyTuple_SET_ITEM(ret, i++, pyrna_param_to_py(&funcptr, &parms, parm, iter.data)); + PyTuple_SET_ITEM(ret, i++, pyrna_param_to_py(&funcptr, parm, iter.data)); } RNA_parameter_list_end(&iter); } else - ret= pyrna_param_to_py(&funcptr, &parms, pret_single, retdata_single); + ret= pyrna_param_to_py(&funcptr, pret_single, retdata_single); /* possible there is an error in conversion */ if(ret==NULL) @@ -5012,7 +5012,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun if(strcmp(identifier, rna_attr) == 0) { \ item= PyObject_GetAttrString(py_class, py_attr); \ if(item && item != Py_None) { \ - if(pyrna_py_to_prop(dummyptr, prop, NULL, NULL, item, "validating class error:") != 0) { \ + if(pyrna_py_to_prop(dummyptr, prop, NULL, item, "validating class error:") != 0) { \ Py_DECREF(item); \ return -1; \ } \ @@ -5036,7 +5036,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun else { Py_DECREF(item); /* no need to keep a ref, the class owns it */ - if(pyrna_py_to_prop(dummyptr, prop, NULL, NULL, item, "validating class error:") != 0) + if(pyrna_py_to_prop(dummyptr, prop, NULL, item, "validating class error:") != 0) return -1; } } @@ -5156,7 +5156,7 @@ static int bpy_class_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *par continue; } - parmitem= pyrna_param_to_py(&funcptr, parms, parm, iter.data); + parmitem= pyrna_param_to_py(&funcptr, parm, iter.data); PyTuple_SET_ITEM(args, i, parmitem); i++; } @@ -5191,7 +5191,7 @@ static int bpy_class_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *par err= -1; } else if(ret_len==1) { - err= pyrna_py_to_prop(&funcptr, pret_single, parms, retdata_single, ret, "calling class function:"); + err= pyrna_py_to_prop(&funcptr, pret_single, retdata_single, ret, "calling class function:"); } else if (ret_len > 1) { @@ -5214,7 +5214,7 @@ static int bpy_class_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *par /* only useful for single argument returns, we'll need another list loop for multiple */ if (flag & PROP_OUTPUT) { - err= pyrna_py_to_prop(&funcptr, parm, parms, iter.data, PyTuple_GET_ITEM(ret, i++), "calling class function:"); + err= pyrna_py_to_prop(&funcptr, parm, iter.data, PyTuple_GET_ITEM(ret, i++), "calling class function:"); if(err) break; } @@ -5328,7 +5328,7 @@ void pyrna_free_types(void) * - Should still be fixed - Campbell * */ -static PyObject *pyrna_basetype_register(PyObject *self, PyObject *py_class) +static PyObject *pyrna_basetype_register(PyObject *UNUSED(self), PyObject *py_class) { bContext *C= NULL; ReportList reports; @@ -5425,7 +5425,7 @@ static int pyrna_srna_contains_pointer_prop_srna(StructRNA *srna_props, StructRN return 0; } -static PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *py_class) +static PyObject *pyrna_basetype_unregister(PyObject *UNUSED(self), PyObject *py_class) { bContext *C= NULL; StructUnregisterFunc unreg; diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index 7f750f94242..77b602b6f83 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -99,7 +99,7 @@ void pyrna_alloc_types(void); void pyrna_free_types(void); /* primitive type conversion */ -int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, char *param_data, PyObject *py, const char *error_prefix); +int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyObject *py, const char *error_prefix); int pyrna_py_to_array_index(PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int index, PyObject *py, const char *error_prefix); PyObject *pyrna_array_index(PointerRNA *ptr, PropertyRNA *prop, int index); diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c index b2a7511f998..81d6e0cd4da 100644 --- a/source/blender/python/intern/bpy_rna_callback.c +++ b/source/blender/python/intern/bpy_rna_callback.c @@ -27,6 +27,7 @@ #include "bpy_util.h" #include "DNA_screen_types.h" +#include "BKE_utildefines.h" #include "BKE_context.h" #include "ED_space_api.h" @@ -34,7 +35,7 @@ #define RNA_CAPSULE_ID "RNA_HANDLE" #define RNA_CAPSULE_ID_INVALID "RNA_HANDLE_REMOVED" -void cb_region_draw(const bContext *C, ARegion *ar, void *customdata) +void cb_region_draw(const bContext *C, ARegion *UNUSED(ar), void *customdata) { PyObject *cb_func, *cb_args, *result; PyGILState_STATE gilstate; -- cgit v1.2.3 From 99711586482f2b23651983ed7dd69e138e616480 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Oct 2010 23:46:42 +0000 Subject: use UNUSED() macro for the console space + minor changes to args. --- .../blender/editors/space_console/console_draw.c | 8 ++++---- .../blender/editors/space_console/console_intern.h | 4 ++-- source/blender/editors/space_console/console_ops.c | 24 +++++++++++----------- .../blender/editors/space_console/console_report.c | 10 ++++----- .../blender/editors/space_console/space_console.c | 10 ++++----- 5 files changed, 28 insertions(+), 28 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index d5ffb34b3a2..edbb539e836 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -133,7 +133,7 @@ typedef struct ConsoleDrawContext { int draw; } ConsoleDrawContext; -static void console_draw_sel(int sel[2], int xy[2], int str_len_draw, int cwidth, int console_width, int lheight) +static void console_draw_sel(int sel[2], int xy[2], int str_len_draw, int cwidth, int lheight) { if(sel[0] <= str_len_draw && sel[1] >= 0) { int sta = MAX2(sel[0], 0); @@ -222,7 +222,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, char *str, int str_len, if(cdc->sel[0] != cdc->sel[1]) { STEP_SEL(-initial_offset); // glColor4ub(255, 0, 0, 96); // debug - console_draw_sel(cdc->sel, cdc->xy, str_len % cdc->console_width, cdc->cwidth, cdc->console_width, cdc->lheight); + console_draw_sel(cdc->sel, cdc->xy, str_len % cdc->console_width, cdc->cwidth, cdc->lheight); STEP_SEL(cdc->console_width); glColor3ubv(fg); } @@ -240,7 +240,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, char *str, int str_len, if(cdc->sel[0] != cdc->sel[1]) { // glColor4ub(0, 255, 0, 96); // debug - console_draw_sel(cdc->sel, cdc->xy, cdc->console_width, cdc->cwidth, cdc->console_width, cdc->lheight); + console_draw_sel(cdc->sel, cdc->xy, cdc->console_width, cdc->cwidth, cdc->lheight); STEP_SEL(cdc->console_width); glColor3ubv(fg); } @@ -272,7 +272,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, char *str, int str_len, if(cdc->sel[0] != cdc->sel[1]) { int isel[2]= {str_len - cdc->sel[1], str_len - cdc->sel[0]}; // glColor4ub(255, 255, 0, 96); // debug - console_draw_sel(isel, cdc->xy, str_len, cdc->cwidth, cdc->console_width, cdc->lheight); + console_draw_sel(isel, cdc->xy, str_len, cdc->cwidth, cdc->lheight); STEP_SEL(-(str_len + 1)); } diff --git a/source/blender/editors/space_console/console_intern.h b/source/blender/editors/space_console/console_intern.h index 0e2c35bcf83..1a48dd408bd 100644 --- a/source/blender/editors/space_console/console_intern.h +++ b/source/blender/editors/space_console/console_intern.h @@ -47,8 +47,8 @@ void console_scrollback_prompt_end(struct SpaceConsole *sc, ConsoleLine *cl_dumm /* console_ops.c */ void console_history_free(SpaceConsole *sc, ConsoleLine *cl); void console_scrollback_free(SpaceConsole *sc, ConsoleLine *cl); -ConsoleLine *console_history_add_str(const struct bContext *C, char *str, int own); -ConsoleLine *console_scrollback_add_str(const struct bContext *C, char *str, int own); +ConsoleLine *console_history_add_str(struct SpaceConsole *sc, char *str, int own); +ConsoleLine *console_scrollback_add_str(struct SpaceConsole *sc, char *str, int own); ConsoleLine *console_history_verify(const struct bContext *C); diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index c36cbc38640..2b419b0a833 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -194,7 +194,7 @@ static ConsoleLine *console_scrollback_add(const bContext *C, ConsoleLine *from) } #endif -static ConsoleLine *console_lb_add_str__internal(ListBase *lb, const bContext *C, char *str, int own) +static ConsoleLine *console_lb_add_str__internal(ListBase *lb, char *str, int own) { ConsoleLine *ci= MEM_callocN(sizeof(ConsoleLine), "ConsoleLine Add"); if(own) ci->line= str; @@ -205,14 +205,13 @@ static ConsoleLine *console_lb_add_str__internal(ListBase *lb, const bContext *C BLI_addtail(lb, ci); return ci; } -ConsoleLine *console_history_add_str(const bContext *C, char *str, int own) +ConsoleLine *console_history_add_str(SpaceConsole *sc, char *str, int own) { - return console_lb_add_str__internal(&CTX_wm_space_console(C)->history, C, str, own); + return console_lb_add_str__internal(&sc->history, str, own); } -ConsoleLine *console_scrollback_add_str(const bContext *C, char *str, int own) +ConsoleLine *console_scrollback_add_str(SpaceConsole *sc, char *str, int own) { - SpaceConsole *sc= CTX_wm_space_console(C); - ConsoleLine *ci= console_lb_add_str__internal(&sc->scrollback, C, str, own); + ConsoleLine *ci= console_lb_add_str__internal(&sc->scrollback, str, own); console_select_offset(sc, ci->len + 1); return ci; } @@ -627,7 +626,7 @@ static int history_append_exec(bContext *C, wmOperator *op) } } - ci= console_history_add_str(C, str, 1); /* own the string */ + ci= console_history_add_str(sc, str, 1); /* own the string */ console_select_offset(sc, ci->len - prev_len); console_line_cursor_set(ci, cursor); @@ -663,7 +662,7 @@ static int scrollback_append_exec(bContext *C, wmOperator *op) char *str= RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, dont free */ int type= RNA_enum_get(op->ptr, "type"); - ci= console_scrollback_add_str(C, str, 1); /* own the string */ + ci= console_scrollback_add_str(sc, str, 1); /* own the string */ ci->type= type; console_scrollback_limit(sc); @@ -698,7 +697,7 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot) } -static int copy_exec(bContext *C, wmOperator *op) +static int copy_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceConsole *sc= CTX_wm_space_console(C); int buf_len; @@ -779,7 +778,7 @@ void CONSOLE_OT_copy(wmOperatorType *ot) /* properties */ } -static int paste_exec(bContext *C, wmOperator *op) +static int paste_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceConsole *sc= CTX_wm_space_console(C); ConsoleLine *ci= console_history_verify(C); @@ -834,7 +833,8 @@ typedef struct SetConsoleCursor { int sel_init; } SetConsoleCursor; -static void set_cursor_to_pos(SpaceConsole *sc, ARegion *ar, SetConsoleCursor *scu, int mval[2], int sel) +// TODO, cursor placement without selection +static void set_cursor_to_pos(SpaceConsole *sc, ARegion *ar, SetConsoleCursor *scu, int mval[2], int UNUSED(sel)) { int pos; pos= console_char_pick(sc, ar, NULL, mval); @@ -869,7 +869,7 @@ static void console_modal_select_apply(bContext *C, wmOperator *op, wmEvent *eve ED_area_tag_redraw(CTX_wm_area(C)); } -static void set_cursor_exit(bContext *C, wmOperator *op) +static void set_cursor_exit(bContext *UNUSED(C), wmOperator *op) { // SpaceConsole *sc= CTX_wm_space_console(C); SetConsoleCursor *scu= op->customdata; diff --git a/source/blender/editors/space_console/console_report.c b/source/blender/editors/space_console/console_report.c index 51bffa5b981..6483177a045 100644 --- a/source/blender/editors/space_console/console_report.c +++ b/source/blender/editors/space_console/console_report.c @@ -72,7 +72,7 @@ static int console_report_poll(bContext *C) return 1; } -static int report_replay_exec(bContext *C, wmOperator *op) +static int report_replay_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceConsole *sc= CTX_wm_space_console(C); ReportList *reports= CTX_wm_reports(C); @@ -83,7 +83,7 @@ static int report_replay_exec(bContext *C, wmOperator *op) for(report=reports->list.last; report; report=report->prev) { if((report->type & report_mask) && (report->type & RPT_OPERATOR_ALL) && (report->flag & SELECT)) { - console_history_add_str(C, report->message, 0); + console_history_add_str(sc, report->message, 0); WM_operator_name_call(C, "CONSOLE_OT_execute", WM_OP_EXEC_DEFAULT, NULL); ED_area_tag_redraw(CTX_wm_area(C)); @@ -165,7 +165,7 @@ void CONSOLE_OT_select_pick(wmOperatorType *ot) -static int report_select_all_toggle_exec(bContext *C, wmOperator *op) +static int report_select_all_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceConsole *sc= CTX_wm_space_console(C); ReportList *reports= CTX_wm_reports(C); @@ -314,7 +314,7 @@ void CONSOLE_OT_select_border(wmOperatorType *ot) -static int report_delete_exec(bContext *C, wmOperator *op) +static int report_delete_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceConsole *sc= CTX_wm_space_console(C); ReportList *reports= CTX_wm_reports(C); @@ -359,7 +359,7 @@ void CONSOLE_OT_report_delete(wmOperatorType *ot) } -static int report_copy_exec(bContext *C, wmOperator *op) +static int report_copy_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceConsole *sc= CTX_wm_space_console(C); ReportList *reports= CTX_wm_reports(C); diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index c30897bbb87..7a913fc28c0 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -67,7 +67,7 @@ static void console_update_rect(const bContext *C, ARegion *ar) /* ******************** default callbacks for console space ***************** */ -static SpaceLink *console_new(const bContext *C) +static SpaceLink *console_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceConsole *sconsole; @@ -121,7 +121,7 @@ static void console_free(SpaceLink *sl) /* spacetype; init callback */ -static void console_init(struct wmWindowManager *wm, ScrArea *sa) +static void console_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { } @@ -162,7 +162,7 @@ static void console_main_area_init(wmWindowManager *wm, ARegion *ar) /* ************* dropboxes ************* */ -static int id_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int id_drop_poll(bContext *C, wmDrag *drag, wmEvent *UNUSED(event)) { SpaceConsole *sc= CTX_wm_space_console(C); if(sc->type==CONSOLE_TYPE_PYTHON) @@ -182,7 +182,7 @@ static void id_drop_copy(wmDrag *drag, wmDropBox *drop) RNA_string_set(drop->ptr, "text", text); } -static int path_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int path_drop_poll(bContext *C, wmDrag *drag, wmEvent *UNUSED(event)) { SpaceConsole *sc= CTX_wm_space_console(C); if(sc->type==CONSOLE_TYPE_PYTHON) @@ -361,7 +361,7 @@ void console_keymap(struct wmKeyConfig *keyconf) /****************** header region ******************/ /* add handlers, stuff you only do once or on area/region changes */ -static void console_header_area_init(wmWindowManager *wm, ARegion *ar) +static void console_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } -- cgit v1.2.3 From f6a7205be50237c769933f070ad439ab283e5f8c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2010 00:33:39 +0000 Subject: bugfix [#22161] Drawing of custom shapes in bones --- source/blender/blenloader/intern/readfile.c | 4 ++-- source/blender/editors/space_view3d/drawarmature.c | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 22641d51ed9..b6c1bd1c7bc 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1384,8 +1384,8 @@ static void test_pointer_array(FileData *fd, void **mat) /* ************ READ ID Properties *************** */ -void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd); -void IDP_LibLinkProperty(IDProperty *prop, int switch_endian, FileData *fd); +static void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd); +static void IDP_LibLinkProperty(IDProperty *prop, int switch_endian, FileData *fd); static void IDP_DirectLinkIDPArray(IDProperty *prop, int switch_endian, FileData *fd) { diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index c6aa4656191..71e52e723c5 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1565,7 +1565,7 @@ static void bone_matrix_translate_y(float mat[][4], float y) } /* assumes object is Armature with pose */ -static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt) +static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, short ghost) { RegionView3D *rv3d= ar->regiondata; Object *ob= base->object; @@ -1706,9 +1706,11 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, } /* prepare colors */ - if (arm->flag & ARM_POSEMODE) + if(ghost) { + /* 13 October 2009, Disabled this to make ghosting show the right colors (Aligorith) */ + } + else if (arm->flag & ARM_POSEMODE) set_pchan_colorset(ob, pchan); -#if 0 // XXX - 13 October 2009, Disabled this to make ghosting show the right colors (Aligorith) else { if ((scene->basact)==base) { if (base->flag & (SELECT+BA_WAS_SEL)) UI_ThemeColor(TH_ACTIVE); @@ -1719,7 +1721,6 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, else UI_ThemeColor(TH_WIRE); } } -#endif /* catch exception for bone with hidden parent */ flag= bone->flag; @@ -2211,7 +2212,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); - draw_pose_bones(scene, v3d, ar, base, OB_WIRE); + draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE); } glDisable(GL_BLEND); if (v3d->zbuf) glEnable(GL_DEPTH_TEST); @@ -2290,7 +2291,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base * BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); - draw_pose_bones(scene, v3d, ar, base, OB_WIRE); + draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE); } glDisable(GL_BLEND); if (v3d->zbuf) glEnable(GL_DEPTH_TEST); @@ -2360,7 +2361,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base) if (CFRA != cfrao) { BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); - draw_pose_bones(scene, v3d, ar, base, OB_WIRE); + draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE); } } @@ -2375,7 +2376,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base) if (CFRA != cfrao) { BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); - draw_pose_bones(scene, v3d, ar, base, OB_WIRE); + draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE); } } } @@ -2409,7 +2410,7 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in /* we use color for solid lighting */ glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR); glEnable(GL_COLOR_MATERIAL); - glColor3ub(0,0,0); // clear spec + glColor3ub(255,0,255); // clear spec glDisable(GL_COLOR_MATERIAL); glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); @@ -2458,7 +2459,7 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in } } } - draw_pose_bones(scene, v3d, ar, base, dt); + draw_pose_bones(scene, v3d, ar, base, dt, FALSE); arm->flag &= ~ARM_POSEMODE; if(ob->mode & OB_MODE_POSE) -- cgit v1.2.3 From a9197c3aa21a5b5368e03feffd5b8d27c156b8fb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2010 01:22:14 +0000 Subject: remove unused args in draw*.c and some in view*.c, tag some as UNUSED(). --- source/blender/editors/animation/anim_draw.c | 2 +- source/blender/editors/gpencil/drawgpencil.c | 4 +- source/blender/editors/include/UI_view2d.h | 10 +- source/blender/editors/interface/view2d.c | 31 +++--- source/blender/editors/screen/area.c | 6 +- source/blender/editors/space_action/space_action.c | 12 +-- .../blender/editors/space_buttons/space_buttons.c | 2 +- .../blender/editors/space_console/space_console.c | 2 +- source/blender/editors/space_file/space_file.c | 4 +- source/blender/editors/space_graph/space_graph.c | 12 +-- source/blender/editors/space_image/space_image.c | 2 +- source/blender/editors/space_logic/space_logic.c | 2 +- source/blender/editors/space_nla/space_nla.c | 14 +-- source/blender/editors/space_node/drawnode.c | 112 ++++++++++----------- source/blender/editors/space_node/node_draw.c | 4 +- source/blender/editors/space_outliner/outliner.c | 2 +- source/blender/editors/space_script/space_script.c | 2 +- .../editors/space_sequencer/sequencer_draw.c | 12 +-- source/blender/editors/space_sound/space_sound.c | 4 +- source/blender/editors/space_text/space_text.c | 2 +- source/blender/editors/space_time/space_time.c | 8 +- source/blender/editors/space_view3d/drawanimviz.c | 6 +- source/blender/editors/space_view3d/drawarmature.c | 54 +++++----- source/blender/editors/space_view3d/drawmesh.c | 4 +- source/blender/editors/space_view3d/drawobject.c | 79 +++++++-------- source/blender/editors/space_view3d/drawvolume.c | 2 +- .../blender/editors/space_view3d/view3d_header.c | 2 +- .../blender/editors/space_view3d/view3d_intern.h | 10 +- 28 files changed, 202 insertions(+), 204 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index b564780f6c0..373ad5472ab 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -256,7 +256,7 @@ void ANIM_draw_cfra (const bContext *C, View2D *v2d, short flag) /* Draw current frame number in a little box */ if (flag & DRAWCFRA_SHOW_NUMBOX) { - UI_view2d_view_orthoSpecial(C, v2d, 1); + UI_view2d_view_orthoSpecial(CTX_wm_region(C), v2d, 1); draw_cfra_number(scene, v2d, vec[0], (flag & DRAWCFRA_UNIT_SECONDS)); } } diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index e6a1f58096a..e19f774412b 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -199,7 +199,7 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short sfl } /* draw a given stroke in 3d (i.e. in 3d-space), using simple ogl lines */ -static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag, short debug, int winx, int winy) +static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thickness, short debug) { bGPDspoint *pt; float oldpressure = 0.0f; @@ -501,7 +501,7 @@ static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int if (gps->totpoints == 1) gp_draw_stroke_point(gps->points, lthick, gps->flag, offsx, offsy, winx, winy); else if (dflag & GP_DRAWDATA_ONLY3D) - gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy); + gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, debug); else if (gps->totpoints > 1) gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, offsx, offsy, winx, winy); } diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index bf4a3de9cc6..9afa7dd012a 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -156,14 +156,14 @@ void UI_view2d_totRect_set_resize(struct View2D *v2d, int width, int height, int int UI_view2d_tab_set(struct View2D *v2d, int tab); /* view matrix operations */ -void UI_view2d_view_ortho(const struct bContext *C, struct View2D *v2d); -void UI_view2d_view_orthoSpecial(const struct bContext *C, struct View2D *v2d, short xaxis); +void UI_view2d_view_ortho(struct View2D *v2d); +void UI_view2d_view_orthoSpecial(struct ARegion *ar, struct View2D *v2d, short xaxis); void UI_view2d_view_restore(const struct bContext *C); /* grid drawing */ -View2DGrid *UI_view2d_grid_calc(const struct bContext *C, struct View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int winx, int winy); -void UI_view2d_grid_draw(const struct bContext *C, struct View2D *v2d, View2DGrid *grid, int flag); -void UI_view2d_constant_grid_draw(const struct bContext *C, struct View2D *v2d); +View2DGrid *UI_view2d_grid_calc(struct Scene *scene, struct View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int winx, int winy); +void UI_view2d_grid_draw(struct View2D *v2d, View2DGrid *grid, int flag); +void UI_view2d_constant_grid_draw(struct View2D *v2d); void UI_view2d_grid_size(View2DGrid *grid, float *r_dx, float *r_dy); void UI_view2d_grid_free(View2DGrid *grid); diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 14ec7c6d0d6..e0dc702bda0 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -967,7 +967,7 @@ static void view2d_map_cur_using_mask(View2D *v2d, rctf *curmasked) } /* Set view matrices to use 'cur' rect as viewing frame for View2D drawing */ -void UI_view2d_view_ortho(const bContext *C, View2D *v2d) +void UI_view2d_view_ortho(View2D *v2d) { rctf curmasked; float xofs, yofs; @@ -997,9 +997,8 @@ void UI_view2d_view_ortho(const bContext *C, View2D *v2d) /* Set view matrices to only use one axis of 'cur' only * - xaxis = if non-zero, only use cur x-axis, otherwise use cur-yaxis (mostly this will be used for x) */ -void UI_view2d_view_orthoSpecial(const bContext *C, View2D *v2d, short xaxis) +void UI_view2d_view_orthoSpecial(ARegion *ar, View2D *v2d, short xaxis) { - ARegion *ar= CTX_wm_region(C); rctf curmasked; float xofs, yofs; @@ -1098,12 +1097,12 @@ static void step_to_grid(float *step, int *power, int unit) * * - xunits,yunits = V2D_UNIT_* grid steps in seconds or frames * - xclamp,yclamp = V2D_CLAMP_* only show whole-number intervals - * - winx = width of region we're drawing to + * - winx = width of region we're drawing to, note: not used but keeping for compleateness. * - winy = height of region we're drawing into */ -View2DGrid *UI_view2d_grid_calc(const bContext *C, View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int winx, int winy) +View2DGrid *UI_view2d_grid_calc(Scene *scene, View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int UNUSED(winx), int winy) { - Scene *scene= CTX_data_scene(C); + View2DGrid *grid; float space, pixels, seconddiv; int secondgrid; @@ -1174,7 +1173,7 @@ View2DGrid *UI_view2d_grid_calc(const bContext *C, View2D *v2d, short xunits, sh } /* Draw gridlines in the given 2d-region */ -void UI_view2d_grid_draw(const bContext *C, View2D *v2d, View2DGrid *grid, int flag) +void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag) { float vec1[2], vec2[2]; int a, step; @@ -1283,7 +1282,7 @@ void UI_view2d_grid_draw(const bContext *C, View2D *v2d, View2DGrid *grid, int f } /* Draw a constant grid in given 2d-region */ -void UI_view2d_constant_grid_draw(const bContext *C, View2D *v2d) +void UI_view2d_constant_grid_draw(View2D *v2d) { float start, step= 25.0f; @@ -1481,7 +1480,7 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short scrollers->yclamp= yclamp; scrollers->yunits= yunits; - scrollers->grid= UI_view2d_grid_calc(C, v2d, xunits, xclamp, yunits, yclamp, (hor.xmax - hor.xmin), (vert.ymax - vert.ymin)); + scrollers->grid= UI_view2d_grid_calc(CTX_data_scene(C), v2d, xunits, xclamp, yunits, yclamp, (hor.xmax - hor.xmin), (vert.ymax - vert.ymin)); } /* return scrollers */ @@ -1489,7 +1488,7 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short } /* Print scale marking along a time scrollbar */ -static void scroll_printstr(View2DScrollers *scrollers, Scene *scene, float x, float y, float val, int power, short unit, char dir) +static void scroll_printstr(Scene *scene, float x, float y, float val, int power, short unit, char dir) { int len; char str[32]; @@ -1614,16 +1613,16 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v switch (vs->xunits) { case V2D_UNIT_FRAMES: /* frames (as whole numbers)*/ - scroll_printstr(vs, scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMES, 'h'); + scroll_printstr(scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMES, 'h'); break; case V2D_UNIT_FRAMESCALE: /* frames (not always as whole numbers) */ - scroll_printstr(vs, scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMESCALE, 'h'); + scroll_printstr(scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMESCALE, 'h'); break; case V2D_UNIT_SECONDS: /* seconds */ fac2= val/(float)FPS; - scroll_printstr(vs, scene, fac, h, fac2, grid->powerx, V2D_UNIT_SECONDS, 'h'); + scroll_printstr(scene, fac, h, fac2, grid->powerx, V2D_UNIT_SECONDS, 'h'); break; case V2D_UNIT_SECONDSSEQ: /* seconds with special calculations (only used for sequencer only) */ @@ -1634,13 +1633,13 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v time= (float)floor(fac2); fac2= fac2-time; - scroll_printstr(vs, scene, fac, h, time+(float)FPS*fac2/100.0f, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h'); + scroll_printstr(scene, fac, h, time+(float)FPS*fac2/100.0f, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h'); } break; case V2D_UNIT_DEGREES: /* Graph Editor for rotation Drivers */ /* HACK: although we're drawing horizontal, we make this draw as 'vertical', just to get degree signs */ - scroll_printstr(vs, scene, fac, h, val, grid->powerx, V2D_UNIT_DEGREES, 'v'); + scroll_printstr(scene, fac, h, val, grid->powerx, V2D_UNIT_DEGREES, 'v'); break; } } @@ -1719,7 +1718,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v if(fac < vert.ymin+10) continue; - scroll_printstr(vs, scene, (float)(vert.xmax)-2.0f, fac, val, grid->powery, vs->yunits, 'v'); + scroll_printstr(scene, (float)(vert.xmax)-2.0f, fac, val, grid->powery, vs->yunits, 'v'); } BLF_disable_default(BLF_ROTATION); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 7f5485ae8b6..e8fd2be324c 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1244,7 +1244,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex uiBeginPanels(C, ar); /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); for(pt= ar->type->paneltypes.first; pt; pt= pt->next) { /* verify context */ @@ -1365,7 +1365,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex UI_view2d_totRect_set(v2d, x+V2D_SCROLL_WIDTH, y+V2D_SCROLL_HEIGHT); /* set the view */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* this does the actual drawing! */ uiEndPanels(C, ar); @@ -1414,7 +1414,7 @@ void ED_region_header(const bContext *C, ARegion *ar) glClear(GL_COLOR_BUFFER_BIT); /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); + UI_view2d_view_ortho(&ar->v2d); xco= maxco= 8; yco= HEADERY-3; diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 7b96618d923..01ae28a20d6 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -169,12 +169,12 @@ static void action_main_area_draw(const bContext *C, ARegion *ar) UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* time grid */ unit= (saction->flag & SACTION_DRAWTIME)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES; - grid= UI_view2d_grid_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy); - UI_view2d_grid_draw(C, v2d, grid, V2D_GRIDLINES_ALL); + grid= UI_view2d_grid_calc(CTX_data_scene(C), v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy); + UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL); UI_view2d_grid_free(grid); /* data */ @@ -188,11 +188,11 @@ static void action_main_area_draw(const bContext *C, ARegion *ar) ANIM_draw_cfra(C, v2d, flag); /* markers */ - UI_view2d_view_orthoSpecial(C, v2d, 1); + UI_view2d_view_orthoSpecial(ar, v2d, 1); draw_markers_time(C, 0); /* preview range */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); ANIM_draw_previewrange(C, v2d); /* reset view matrix */ @@ -228,7 +228,7 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar) UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* data */ if (ANIM_animdata_get_context(C, &ac)) { diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index fcd66c43321..5927a7473e2 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -203,7 +203,7 @@ static void buttons_header_area_draw(const bContext *C, ARegion *ar) glClear(GL_COLOR_BUFFER_BIT); /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); + UI_view2d_view_ortho(&ar->v2d); buttons_header_buttons(C, ar); diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 7a913fc28c0..70263788b13 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -227,7 +227,7 @@ static void console_main_area_draw(const bContext *C, ARegion *ar) console_update_rect(C, ar); /* worlks best with no view2d matrix set */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* data... */ diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 0cd721964bd..52805c39816 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -335,7 +335,7 @@ static void file_main_area_draw(const bContext *C, ARegion *ar) file_calc_previews(C, ar); /* set view */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* on first read, find active file */ if (params->active_file == -1) { @@ -505,7 +505,7 @@ static void file_ui_area_draw(const bContext *C, ARegion *ar) glClear(GL_COLOR_BUFFER_BIT); /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); + UI_view2d_view_ortho(&ar->v2d); file_draw_buttons(C, ar); diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index ca372d74da6..994d9725762 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -229,12 +229,12 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar) glClearColor(col[0], col[1], col[2], 0.0); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* grid */ unitx= (sipo->flag & SIPO_DRAWTIME)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMESCALE; - grid= UI_view2d_grid_calc(C, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP, ar->winx, ar->winy); - UI_view2d_grid_draw(C, v2d, grid, V2D_GRIDLINES_ALL); + grid= UI_view2d_grid_calc(CTX_data_scene(C), v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP, ar->winx, ar->winy); + UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL); /* draw data */ if (ANIM_animdata_get_context(C, &ac)) { @@ -282,11 +282,11 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar) ANIM_draw_cfra(C, v2d, flag); /* markers */ - UI_view2d_view_orthoSpecial(C, v2d, 1); + UI_view2d_view_orthoSpecial(ar, v2d, 1); draw_markers_time(C, 0); /* preview range */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); ANIM_draw_previewrange(C, v2d); /* reset view matrix */ @@ -325,7 +325,7 @@ static void graph_channel_area_draw(const bContext *C, ARegion *ar) glClearColor(col[0], col[1], col[2], 0.0); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* draw channels */ if (ANIM_animdata_get_context(C, &ac)) { diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index a6deb73f2e7..250ece6d92a 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -768,7 +768,7 @@ static void image_main_area_draw(const bContext *C, ARegion *ar) draw_image_main(sima, ar, scene); /* and uvs in 0.0-1.0 space */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); draw_uvedit_main(sima, ar, scene, obedit); ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW); diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c index 01af324334b..5af5b5ee6c0 100644 --- a/source/blender/editors/space_logic/space_logic.c +++ b/source/blender/editors/space_logic/space_logic.c @@ -251,7 +251,7 @@ static void logic_main_area_draw(const bContext *C, ARegion *ar) UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); logic_buttons((bContext *)C, ar); diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 92c5ef6c410..2ae47ddbc7f 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -227,7 +227,7 @@ static void nla_channel_area_draw(const bContext *C, ARegion *ar) UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* data */ if (ANIM_animdata_get_context(C, &ac)) { @@ -272,12 +272,12 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar) UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* time grid */ unit= (snla->flag & SNLA_DRAWTIME)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES; - grid= UI_view2d_grid_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy); - UI_view2d_grid_draw(C, v2d, grid, V2D_GRIDLINES_ALL); + grid= UI_view2d_grid_calc(CTX_data_scene(C), v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy); + UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL); UI_view2d_grid_free(grid); /* data */ @@ -289,7 +289,7 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar) UI_view2d_text_cache_draw(ar); } - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* current frame */ if (snla->flag & SNLA_DRAWTIME) flag |= DRAWCFRA_UNIT_SECONDS; @@ -297,11 +297,11 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar) ANIM_draw_cfra(C, v2d, flag); /* markers */ - UI_view2d_view_orthoSpecial(C, v2d, 1); + UI_view2d_view_orthoSpecial(ar, v2d, 1); draw_markers_time(C, 0); /* preview range */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); ANIM_draw_previewrange(C, v2d); /* reset view matrix */ diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 5e0926da216..16a2ac3c52e 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -72,12 +72,12 @@ /* ****************** BUTTON CALLBACKS FOR ALL TREES ***************** */ -void node_buts_group(uiLayout *layout, bContext *C, PointerRNA *ptr) +void node_buts_group(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiTemplateIDBrowse(layout, C, ptr, "node_tree", NULL, NULL, ""); } -static void node_buts_value(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_buts_value(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { PointerRNA sockptr; PropertyRNA *prop; @@ -89,7 +89,7 @@ static void node_buts_value(uiLayout *layout, bContext *C, PointerRNA *ptr) uiItemR(layout, &sockptr, "default_value", 0, "", 0); } -static void node_buts_rgb(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_buts_rgb(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; PointerRNA sockptr; @@ -104,7 +104,7 @@ static void node_buts_rgb(uiLayout *layout, bContext *C, PointerRNA *ptr) uiItemR(col, &sockptr, "default_value", 0, "", 0); } -static void node_buts_mix_rgb(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_buts_mix_rgb(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *row; @@ -116,7 +116,7 @@ static void node_buts_mix_rgb(uiLayout *layout, bContext *C, PointerRNA *ptr) uiItemR(row, ptr, "use_alpha", 0, "", ICON_IMAGE_RGB_ALPHA); } -static void node_buts_time(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_buts_time(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *row; #if 0 @@ -138,12 +138,12 @@ static void node_buts_time(uiLayout *layout, bContext *C, PointerRNA *ptr) uiItemR(row, ptr, "frame_end", 0, "End", 0); } -static void node_buts_colorramp(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_buts_colorramp(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiTemplateColorRamp(layout, ptr, "color_ramp", 0); } -static void node_buts_curvevec(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_buts_curvevec(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiTemplateCurveMapping(layout, ptr, "mapping", 'v', 0, 0); } @@ -154,7 +154,7 @@ void node_curvemap_sample(float *col) _sample_col= col; } -static void node_buts_curvecol(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_buts_curvecol(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { bNode *node= ptr->data; CurveMapping *cumap= node->storage; @@ -169,7 +169,7 @@ static void node_buts_curvecol(uiLayout *layout, bContext *C, PointerRNA *ptr) uiTemplateCurveMapping(layout, ptr, "mapping", 'c', 0, 0); } -static void node_buts_normal(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_buts_normal(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; @@ -212,7 +212,7 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v) node->menunr= 0; } #endif -static void node_dynamic_update_cb(bContext *C, void *ntree_v, void *node_v) +static void node_dynamic_update_cb(bContext *C, void *UNUSED(ntree_v), void *node_v) { Main *bmain= CTX_data_main(C); Material *ma; @@ -244,7 +244,7 @@ static void node_dynamic_update_cb(bContext *C, void *ntree_v, void *node_v) // XXX BIF_preview_changed(ID_MA); } -static void node_buts_texture(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_buts_texture(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { bNode *node= ptr->data; @@ -263,7 +263,7 @@ static void node_buts_texture(uiLayout *layout, bContext *C, PointerRNA *ptr) } } -static void node_buts_math(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_buts_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "operation", 0, "", 0); } @@ -297,7 +297,7 @@ static void node_browse_text_cb(bContext *C, void *ntree_v, void *node_v) node->menunr= 0; } -static void node_shader_buts_material(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_shader_buts_material(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { bNode *node= ptr->data; uiLayout *col; @@ -312,7 +312,7 @@ static void node_shader_buts_material(uiLayout *layout, bContext *C, PointerRNA uiItemR(col, ptr, "invert_normal", 0, NULL, 0); } -static void node_shader_buts_mapping(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_shader_buts_mapping(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *row; @@ -338,12 +338,12 @@ static void node_shader_buts_mapping(uiLayout *layout, bContext *C, PointerRNA * } -static void node_shader_buts_vect_math(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_shader_buts_vect_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "operation", 0, "", 0); } -static void node_shader_buts_geometry(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_shader_buts_geometry(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { PointerRNA obptr= CTX_data_pointer_get(C, "active_object"); uiLayout *col; @@ -362,7 +362,7 @@ static void node_shader_buts_geometry(uiLayout *layout, bContext *C, PointerRNA } } -static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_shader_buts_dynamic(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { Main *bmain= CTX_data_main(C); uiBlock *block= uiLayoutAbsoluteBlock(layout); @@ -457,7 +457,7 @@ static void node_shader_set_butfunc(bNodeType *ntype) /* ****************** BUTTON CALLBACKS FOR COMPOSITE NODES ***************** */ -static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_image(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; bNode *node= ptr->data; @@ -491,7 +491,7 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA * uiItemR(col, ptr, "layer", 0, NULL, 0); } -static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_renderlayers(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { bNode *node= ptr->data; uiLayout *col, *row; @@ -524,7 +524,7 @@ static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, Point } -static void node_composit_buts_blur(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_blur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -548,7 +548,7 @@ static void node_composit_buts_blur(uiLayout *layout, bContext *C, PointerRNA *p } } -static void node_composit_buts_dblur(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_dblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -572,7 +572,7 @@ static void node_composit_buts_dblur(uiLayout *layout, bContext *C, PointerRNA * uiItemR(layout, ptr, "zoom", 0, NULL, 0); } -static void node_composit_buts_bilateralblur(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_bilateralblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -582,7 +582,7 @@ static void node_composit_buts_bilateralblur(uiLayout *layout, bContext *C, Poin uiItemR(col, ptr, "sigma_space", 0, NULL, 0); } -static void node_composit_buts_defocus(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_defocus(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *sub, *col; @@ -614,7 +614,7 @@ static void node_composit_buts_defocus(uiLayout *layout, bContext *C, PointerRNA } /* qdn: glare node */ -static void node_composit_buts_glare(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_glare(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "glare_type", 0, "", 0); uiItemR(layout, ptr, "quality", 0, "", 0); @@ -644,7 +644,7 @@ static void node_composit_buts_glare(uiLayout *layout, bContext *C, PointerRNA * } } -static void node_composit_buts_tonemap(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_tonemap(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -663,7 +663,7 @@ static void node_composit_buts_tonemap(uiLayout *layout, bContext *C, PointerRNA } } -static void node_composit_buts_lensdist(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_lensdist(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -676,7 +676,7 @@ static void node_composit_buts_lensdist(uiLayout *layout, bContext *C, PointerRN uiItemR(col, ptr, "use_fit", 0, NULL, 0); } -static void node_composit_buts_vecblur(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_vecblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -692,17 +692,17 @@ static void node_composit_buts_vecblur(uiLayout *layout, bContext *C, PointerRNA uiItemR(layout, ptr, "use_curved", 0, NULL, 0); } -static void node_composit_buts_filter(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_filter(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "filter_type", 0, "", 0); } -static void node_composit_buts_flip(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_flip(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "axis", 0, "", 0); } -static void node_composit_buts_crop(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_crop(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -723,7 +723,7 @@ static void node_composit_buts_crop(uiLayout *layout, bContext *C, PointerRNA *p } } -static void node_composit_buts_splitviewer(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_splitviewer(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *row, *col; @@ -733,7 +733,7 @@ static void node_composit_buts_splitviewer(uiLayout *layout, bContext *C, Pointe uiItemR(col, ptr, "factor", 0, NULL, 0); } -static void node_composit_buts_map_value(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_map_value(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *sub, *col; @@ -754,7 +754,7 @@ static void node_composit_buts_map_value(uiLayout *layout, bContext *C, PointerR uiItemR(sub, ptr, "max", 0, "", 0); } -static void node_composit_buts_alphaover(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_alphaover(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -763,7 +763,7 @@ static void node_composit_buts_alphaover(uiLayout *layout, bContext *C, PointerR uiItemR(col, ptr, "premul", 0, NULL, 0); } -static void node_composit_buts_hue_sat(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_hue_sat(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -773,12 +773,12 @@ static void node_composit_buts_hue_sat(uiLayout *layout, bContext *C, PointerRNA uiItemR(col, ptr, "color_value", UI_ITEM_R_SLIDER, NULL, 0); } -static void node_composit_buts_dilateerode(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_dilateerode(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "distance", 0, NULL, 0); } -static void node_composit_buts_diff_matte(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_diff_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -787,7 +787,7 @@ static void node_composit_buts_diff_matte(uiLayout *layout, bContext *C, Pointer uiItemR(col, ptr, "falloff", UI_ITEM_R_SLIDER, NULL, 0); } -static void node_composit_buts_distance_matte(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_distance_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -796,7 +796,7 @@ static void node_composit_buts_distance_matte(uiLayout *layout, bContext *C, Poi uiItemR(col, ptr, "falloff", UI_ITEM_R_SLIDER, NULL, 0); } -static void node_composit_buts_color_spill(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *row, *col; @@ -822,7 +822,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *C, Pointe } } -static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -836,7 +836,7 @@ static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *C, Point /*uiItemR(col, ptr, "shadow_adjust", UI_ITEM_R_SLIDER, NULL, 0); Removed for now*/ } -static void node_composit_buts_color_matte(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_color_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -846,7 +846,7 @@ static void node_composit_buts_color_matte(uiLayout *layout, bContext *C, Pointe uiItemR(col, ptr, "color_value", UI_ITEM_R_SLIDER, NULL, 0); } -static void node_composit_buts_channel_matte(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_channel_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col, *row; @@ -872,7 +872,7 @@ static void node_composit_buts_channel_matte(uiLayout *layout, bContext *C, Poin uiItemR(col, ptr, "limit_min", UI_ITEM_R_SLIDER, NULL, 0); } -static void node_composit_buts_luma_matte(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_luma_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -881,17 +881,17 @@ static void node_composit_buts_luma_matte(uiLayout *layout, bContext *C, Pointer uiItemR(col, ptr, "limit_min", UI_ITEM_R_SLIDER, NULL, 0); } -static void node_composit_buts_map_uv(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_map_uv(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "alpha", 0, NULL, 0); } -static void node_composit_buts_id_mask(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_id_mask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "index", 0, NULL, 0); } -static void node_composit_buts_file_output(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_file_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col, *row; @@ -916,17 +916,17 @@ static void node_composit_buts_file_output(uiLayout *layout, bContext *C, Pointe uiItemR(row, ptr, "frame_end", 0, "End", 0); } -static void node_composit_buts_scale(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_scale(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "space", 0, "", 0); } -static void node_composit_buts_rotate(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_rotate(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "filter_type", 0, "", 0); } -static void node_composit_buts_invert(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_invert(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -935,17 +935,17 @@ static void node_composit_buts_invert(uiLayout *layout, bContext *C, PointerRNA uiItemR(col, ptr, "invert_alpha", 0, NULL, 0); } -static void node_composit_buts_premulkey(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_premulkey(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "mapping", 0, "", 0); } -static void node_composit_buts_view_levels(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_view_levels(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "channel", UI_ITEM_R_EXPAND, NULL, 0); } -static void node_composit_buts_colorbalance(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_colorbalance(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *split, *col, *row; @@ -990,7 +990,7 @@ static void node_composit_buts_colorbalance(uiLayout *layout, bContext *C, Point } -static void node_composit_buts_huecorrect(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_composit_buts_huecorrect(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiTemplateCurveMapping(layout, ptr, "mapping", 'h', 0, 0); } @@ -1143,7 +1143,7 @@ static void node_composit_set_butfunc(bNodeType *ntype) /* ****************** BUTTON CALLBACKS FOR TEXTURE NODES ***************** */ -static void node_texture_buts_bricks(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_texture_buts_bricks(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiLayout *col; @@ -1156,7 +1156,7 @@ static void node_texture_buts_bricks(uiLayout *layout, bContext *C, PointerRNA * uiItemR(col, ptr, "squash_frequency", 0, "Frequency", 0); } -static void node_texture_buts_proc(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_texture_buts_proc(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { PointerRNA tex_ptr; bNode *node= ptr->data; @@ -1210,12 +1210,12 @@ static void node_texture_buts_proc(uiLayout *layout, bContext *C, PointerRNA *pt } } -static void node_texture_buts_image(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_texture_buts_image(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiTemplateID(layout, C, ptr, "image", NULL, "IMAGE_OT_open", NULL); } -static void node_texture_buts_output(uiLayout *layout, bContext *C, PointerRNA *ptr) +static void node_texture_buts_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "filepath", 0, "", 0); } diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index dfc63e032d9..8316d79c9f0 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -1066,7 +1066,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d) UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); //uiFreeBlocksWin(&sa->uiblocks, sa->win); @@ -1078,7 +1078,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d) snode->aspect= (v2d->cur.xmax - v2d->cur.xmin)/((float)ar->winx); // XXX snode->curfont= uiSetCurFont_ext(snode->aspect); - UI_view2d_constant_grid_draw(C, v2d); + UI_view2d_constant_grid_draw(v2d); /* backdrop */ draw_nodespace_back_pix(ar, snode, color_manage); diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 20b5ad7a34f..dc6b9f342b3 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -5659,7 +5659,7 @@ void draw_outliner(const bContext *C) UI_view2d_totRect_set(v2d, sizex, sizey); /* set matrix for 2d-view controls */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* draw outliner stuff (background, hierachy lines and names) */ outliner_back(ar, soops); diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index f93ddc6efbe..ce6edc3a565 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -145,7 +145,7 @@ static void script_main_area_draw(const bContext *C, ARegion *ar) UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* data... */ // BPY_run_python_script(C, "/root/blender-svn/blender25/test.py", NULL); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 7c6fd83c6aa..eb61633d44c 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -772,7 +772,7 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq } /* setting up the view - actual drawing starts here */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); last_texid= glaGetOneInteger(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D); @@ -1016,7 +1016,7 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) glClearColor(col[0], col[1], col[2], 0.0); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* calculate extents of sequencer strips/data @@ -1029,7 +1029,7 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) draw_seq_backdrop(v2d); /* regular grid-pattern over the rest of the view (i.e. frame grid lines) */ - UI_view2d_constant_grid_draw(C, v2d); + UI_view2d_constant_grid_draw(v2d); seq_draw_sfra_efra(C, sseq, ar); @@ -1043,17 +1043,17 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) } /* current frame */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); if ((sseq->flag & SEQ_DRAWFRAMES)==0) flag |= DRAWCFRA_UNIT_SECONDS; if ((sseq->flag & SEQ_NO_DRAW_CFRANUM)==0) flag |= DRAWCFRA_SHOW_NUMBOX; ANIM_draw_cfra(C, v2d, flag); /* markers */ - UI_view2d_view_orthoSpecial(C, v2d, 1); + UI_view2d_view_orthoSpecial(ar, v2d, 1); draw_markers_time(C, DRAW_MARKERS_LINES); /* preview range */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); ANIM_draw_previewrange(C, v2d); /* overlap playhead */ diff --git a/source/blender/editors/space_sound/space_sound.c b/source/blender/editors/space_sound/space_sound.c index 905e1d6cdd9..919395f3bff 100644 --- a/source/blender/editors/space_sound/space_sound.c +++ b/source/blender/editors/space_sound/space_sound.c @@ -153,7 +153,7 @@ static void sound_main_area_draw(const bContext *C, ARegion *ar) UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* data... */ @@ -194,7 +194,7 @@ static void sound_header_area_draw(const bContext *C, ARegion *ar) glClear(GL_COLOR_BUFFER_BIT); /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); + UI_view2d_view_ortho(&ar->v2d); sound_header_buttons(C, ar); diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 5ee7ca3c3ef..4e1bc818ce4 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -384,7 +384,7 @@ static void text_main_area_draw(const bContext *C, ARegion *ar) UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); - // UI_view2d_view_ortho(C, v2d); + // UI_view2d_view_ortho(v2d); /* data... */ draw_text_main(st, ar); diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 0d3b0514122..37867890c15 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -467,15 +467,15 @@ static void time_main_area_draw(const bContext *C, ARegion *ar) UI_ThemeClearColor(TH_BACK); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* start and end frame */ time_draw_sfra_efra(C, stime, ar); /* grid */ unit= (stime->flag & TIME_DRAWFRAMES)? V2D_UNIT_FRAMES: V2D_UNIT_SECONDS; - grid= UI_view2d_grid_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy); - UI_view2d_grid_draw(C, v2d, grid, (V2D_VERTICAL_LINES|V2D_VERTICAL_AXIS)); + grid= UI_view2d_grid_calc(CTX_data_scene(C), v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy); + UI_view2d_grid_draw(v2d, grid, (V2D_VERTICAL_LINES|V2D_VERTICAL_AXIS)); UI_view2d_grid_free(grid); /* keyframes */ @@ -488,7 +488,7 @@ static void time_main_area_draw(const bContext *C, ARegion *ar) ANIM_draw_cfra(C, v2d, flag); /* markers */ - UI_view2d_view_orthoSpecial(C, v2d, 1); + UI_view2d_view_orthoSpecial(ar, v2d, 1); draw_markers_time(C, 0); /* caches */ diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index fb271556a9c..4cce166b36b 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -64,7 +64,7 @@ // - include support for editing the path verts /* Set up drawing environment for drawing motion paths */ -void draw_motion_paths_init(Scene *scene, View3D *v3d, ARegion *ar) +void draw_motion_paths_init(View3D *v3d, ARegion *ar) { RegionView3D *rv3d= ar->regiondata; @@ -79,7 +79,7 @@ void draw_motion_paths_init(Scene *scene, View3D *v3d, ARegion *ar) * i.e. draw_motion_paths_init() has been called */ // FIXME: the text is still drawn in the wrong space - it includes the current transforms of the object still... -void draw_motion_path_instance(Scene *scene, View3D *v3d, ARegion *ar, +void draw_motion_path_instance(Scene *scene, Object *ob, bPoseChannel *pchan, bAnimVizSettings *avs, bMotionPath *mpath) { //RegionView3D *rv3d= ar->regiondata; @@ -283,7 +283,7 @@ void draw_motion_path_instance(Scene *scene, View3D *v3d, ARegion *ar, } /* Clean up drawing environment after drawing motion paths */ -void draw_motion_paths_cleanup(Scene *scene, View3D *v3d, ARegion *ar) +void draw_motion_paths_cleanup(View3D *v3d) { if (v3d->zbuf) glEnable(GL_DEPTH_TEST); glPopMatrix(); diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 71e52e723c5..6cbfc2cffe4 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -140,7 +140,7 @@ static void cp_shade_color3ub (char cp[], int offset) } /* This function sets the gl-color for coloring a certain bone (based on bcolor) */ -static short set_pchan_glColor (short colCode, int armflag, int boneflag, int constflag) +static short set_pchan_glColor (short colCode, int boneflag, int constflag) { switch (colCode) { case PCHAN_COLOR_NORMAL: @@ -551,7 +551,7 @@ static void draw_bone_points(int dt, int armflag, unsigned int boneflag, int id) } else { if (armflag & ARM_POSEMODE) - set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, 0); + set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, 0); else UI_ThemeColor(TH_BONE_SOLID); } @@ -574,7 +574,7 @@ static void draw_bone_points(int dt, int armflag, unsigned int boneflag, int id) } else { if (armflag & ARM_POSEMODE) - set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, 0); + set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, 0); else UI_ThemeColor(TH_BONE_SOLID); } @@ -616,7 +616,7 @@ static float co[16] ={ /* smat, imat = mat & imat to draw screenaligned */ -static void draw_sphere_bone_dist(float smat[][4], float imat[][4], int boneflag, bPoseChannel *pchan, EditBone *ebone) +static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel *pchan, EditBone *ebone) { float head, tail, length, dist; float *headvec, *tailvec, dirvec[3]; @@ -782,7 +782,7 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag, else UI_ThemeColor(TH_VERTEX); } else if (armflag & ARM_POSEMODE) - set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag); /* Draw root point if we are not connected */ if ((boneflag & BONE_CONNECTED)==0) { @@ -903,7 +903,7 @@ static void draw_sphere_bone(int dt, int armflag, int boneflag, int constflag, u else UI_ThemeColorShade(TH_BONE_SOLID, -30); } else if (armflag & ARM_POSEMODE) - set_pchan_glColor(PCHAN_COLOR_SPHEREBONE_END, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_SPHEREBONE_END, boneflag, constflag); else if (dt==OB_SOLID) UI_ThemeColorShade(TH_BONE_SOLID, -30); @@ -933,7 +933,7 @@ static void draw_sphere_bone(int dt, int armflag, int boneflag, int constflag, u else UI_ThemeColor(TH_BONE_SOLID); } else if (armflag & ARM_POSEMODE) - set_pchan_glColor(PCHAN_COLOR_SPHEREBONE_BASE, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_SPHEREBONE_BASE, boneflag, constflag); else if (dt == OB_SOLID) UI_ThemeColor(TH_BONE_SOLID); @@ -1003,7 +1003,7 @@ static void draw_line_bone(int armflag, int boneflag, int constflag, unsigned in if (armflag & (ARM_EDITMODE|ARM_POSEMODE)) { glLineWidth(4.0f); if (armflag & ARM_POSEMODE) - set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag); else if (armflag & ARM_EDITMODE) { UI_ThemeColor(TH_WIRE); } @@ -1048,7 +1048,7 @@ static void draw_line_bone(int armflag, int boneflag, int constflag, unsigned in glLoadName(id & 0xFFFF); /* object tag, for bordersel optim */ if (armflag & ARM_POSEMODE) - set_pchan_glColor(PCHAN_COLOR_LINEBONE, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_LINEBONE, boneflag, constflag); } glLineWidth(2.0); @@ -1147,9 +1147,9 @@ static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsign /* colors for modes */ if (armflag & ARM_POSEMODE) { if (dt <= OB_WIRE) - set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag); else - set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, constflag); } else if (armflag & ARM_EDITMODE) { if (dt==OB_WIRE) { @@ -1171,7 +1171,7 @@ static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsign glEnable(GL_LIGHTING); if (armflag & ARM_POSEMODE) - set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, constflag); else UI_ThemeColor(TH_BONE_SOLID); @@ -1186,7 +1186,7 @@ static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsign if (armflag & ARM_POSEMODE) { if (constflag) { /* set constraint colors */ - if (set_pchan_glColor(PCHAN_COLOR_CONSTS, armflag, boneflag, constflag)) { + if (set_pchan_glColor(PCHAN_COLOR_CONSTS, boneflag, constflag)) { glEnable(GL_BLEND); draw_b_bone_boxes(OB_SOLID, pchan, xwidth, length, zwidth); @@ -1195,7 +1195,7 @@ static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsign } /* restore colors */ - set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag); } } @@ -1221,9 +1221,9 @@ static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned /* colors for posemode */ if (armflag & ARM_POSEMODE) { if (dt <= OB_WIRE) - set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag); else - set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, constflag); } @@ -1245,7 +1245,7 @@ static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned else if (armflag & ARM_POSEMODE) { if (constflag) { /* draw constraint colors */ - if (set_pchan_glColor(PCHAN_COLOR_CONSTS, armflag, boneflag, constflag)) { + if (set_pchan_glColor(PCHAN_COLOR_CONSTS, boneflag, constflag)) { glEnable(GL_BLEND); draw_bone_solid_octahedral(); @@ -1254,7 +1254,7 @@ static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned } /* restore colors */ - set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag); } } draw_bone_octahedral(); @@ -1262,7 +1262,7 @@ static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned else { /* solid */ if (armflag & ARM_POSEMODE) - set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag); + set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, constflag); else UI_ThemeColor(TH_BONE_SOLID); draw_bone_solid_octahedral(); @@ -1283,7 +1283,7 @@ static void draw_custom_bone(Scene *scene, View3D *v3d, RegionView3D *rv3d, Obje /* colors for posemode */ if (armflag & ARM_POSEMODE) { - set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, 0); + set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, 0); } if (id != -1) { @@ -1602,7 +1602,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, if (bone && !(bone->flag & (BONE_HIDDEN_P|BONE_NO_DEFORM|BONE_HIDDEN_PG))) { if (bone->flag & (BONE_SELECTED)) { if (bone->layer & arm->layer) - draw_sphere_bone_dist(smat, imat, bone->flag, pchan, NULL); + draw_sphere_bone_dist(smat, imat, pchan, NULL); } } } @@ -1902,7 +1902,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, bone_matrix_translate_y(bmat, pchan->bone->length); glMultMatrixf(bmat); - drawaxes(pchan->bone->length*0.25f, 0, OB_ARROWS); + drawaxes(pchan->bone->length*0.25f, OB_ARROWS); glPopMatrix(); } @@ -1958,7 +1958,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt) if (eBone->layer & arm->layer) { if ((eBone->flag & (BONE_HIDDEN_A|BONE_NO_DEFORM))==0) { if (eBone->flag & (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL)) - draw_sphere_bone_dist(smat, imat, eBone->flag, NULL, eBone); + draw_sphere_bone_dist(smat, imat, NULL, eBone); } } } @@ -2095,7 +2095,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt) bone_matrix_translate_y(bmat, eBone->length); glMultMatrixf(bmat); - drawaxes(eBone->length*0.25f, 0, OB_ARROWS); + drawaxes(eBone->length*0.25f, OB_ARROWS); glPopMatrix(); } @@ -2123,16 +2123,16 @@ static void draw_pose_paths(Scene *scene, View3D *v3d, ARegion *ar, Object *ob) bPoseChannel *pchan; /* setup drawing environment for paths */ - draw_motion_paths_init(scene, v3d, ar); + draw_motion_paths_init(v3d, ar); /* draw paths where they exist and they releated bone is visible */ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { if ((pchan->bone->layer & arm->layer) && (pchan->mpath)) - draw_motion_path_instance(scene, v3d, ar, ob, pchan, avs, pchan->mpath); + draw_motion_path_instance(scene, ob, pchan, avs, pchan->mpath); } /* cleanup after drawing */ - draw_motion_paths_cleanup(scene, v3d, ar); + draw_motion_paths_cleanup(v3d); } diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index cf511a8ad9b..0df2888f4a0 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -192,7 +192,7 @@ static int draw_tfaces3D__drawFaceOpts(void *userData, int index) return 0; } -static void draw_tfaces3D(RegionView3D *rv3d, Object *ob, Mesh *me, DerivedMesh *dm) +static void draw_tfaces3D(RegionView3D *rv3d, Mesh *me, DerivedMesh *dm) { struct { Mesh *me; EdgeHash *eh; } data; @@ -671,7 +671,7 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *o /* draw edges and selected faces over textured mesh */ if(!(ob == scene->obedit) && faceselect) - draw_tfaces3D(rv3d, ob, me, dm); + draw_tfaces3D(rv3d, me, dm); /* reset from negative scale correction */ glFrontFace(GL_CCW); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 2206d744dc6..c9b8a086d22 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -398,8 +398,7 @@ static void draw_xyz_wire(float *c, float size, int axis) } -/* flag is same as for draw_object */ -void drawaxes(float size, int flag, char drawtype) +void drawaxes(float size, char drawtype) { int axis; float v1[3]= {0.0, 0.0, 0.0}; @@ -1463,7 +1462,7 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob) * if not, ED_view3d_init_mats_rv3d() can be used for selection tools * but would not give correct results with dupli's for eg. which dont * use the object matrix in the useual way */ -static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) +static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) { struct { void (*func)(void *userData, EditVert *eve, int x, int y, int index); void *userData; ViewContext vc; int clipVerts; } *data = userData; EditVert *eve = EM_get_vert_for_index(index); @@ -1547,7 +1546,7 @@ void mesh_foreachScreenEdge(ViewContext *vc, void (*func)(void *userData, EditEd dm->release(dm); } -static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *cent, float *no) +static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *cent, float *UNUSED(no)) { struct { void (*func)(void *userData, EditFace *efa, int x, int y, int index); void *userData; ViewContext vc; } *data = userData; EditFace *efa = EM_get_face_for_index(index); @@ -1658,7 +1657,7 @@ static void draw_dm_face_normals(Scene *scene, DerivedMesh *dm) glEnd(); } -static void draw_dm_face_centers__mapFunc(void *userData, int index, float *cent, float *no) +static void draw_dm_face_centers__mapFunc(void *userData, int index, float *cent, float *UNUSED(no)) { EditFace *efa = EM_get_face_for_index(index); int sel = *((int*) userData); @@ -1702,7 +1701,7 @@ static void draw_dm_vert_normals(Scene *scene, DerivedMesh *dm) } /* Draw verts with color set based on selection */ -static void draw_dm_verts__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) +static void draw_dm_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) { struct { int sel; EditVert *eve_act; } * data = userData; EditVert *eve = EM_get_vert_for_index(index); @@ -1779,7 +1778,7 @@ static void draw_dm_edges_sel(DerivedMesh *dm, unsigned char *baseCol, unsigned } /* Draw edges */ -static int draw_dm_edges__setDrawOptions(void *userData, int index) +static int draw_dm_edges__setDrawOptions(void *UNUSED(userData), int index) { return EM_get_edge_for_index(index)->h==0; } @@ -1789,7 +1788,7 @@ static void draw_dm_edges(DerivedMesh *dm) } /* Draw edges with color interpolated based on selection */ -static int draw_dm_edges_sel_interp__setDrawOptions(void *userData, int index) +static int draw_dm_edges_sel_interp__setDrawOptions(void *UNUSED(userData), int index) { return EM_get_edge_for_index(index)->h==0; } @@ -1814,7 +1813,7 @@ static void draw_dm_edges_sel_interp(DerivedMesh *dm, unsigned char *baseCol, un } /* Draw only seam edges */ -static int draw_dm_edges_seams__setDrawOptions(void *userData, int index) +static int draw_dm_edges_seams__setDrawOptions(void *UNUSED(userData), int index) { EditEdge *eed = EM_get_edge_for_index(index); @@ -1826,7 +1825,7 @@ static void draw_dm_edges_seams(DerivedMesh *dm) } /* Draw only sharp edges */ -static int draw_dm_edges_sharp__setDrawOptions(void *userData, int index) +static int draw_dm_edges_sharp__setDrawOptions(void *UNUSED(userData), int index) { EditEdge *eed = EM_get_edge_for_index(index); @@ -1840,7 +1839,7 @@ static void draw_dm_edges_sharp(DerivedMesh *dm) /* Draw faces with color set based on selection * return 2 for the active face so it renders with stipple enabled */ -static int draw_dm_faces_sel__setDrawOptions(void *userData, int index, int *drawSmooth_r) +static int draw_dm_faces_sel__setDrawOptions(void *userData, int index, int *UNUSED(drawSmooth_r)) { struct { unsigned char *cols[3]; EditFace *efa_act; } * data = userData; EditFace *efa = EM_get_face_for_index(index); @@ -1872,7 +1871,7 @@ static void draw_dm_faces_sel(DerivedMesh *dm, unsigned char *baseCol, unsigned dm->drawMappedFaces(dm, draw_dm_faces_sel__setDrawOptions, &data, 0, GPU_enable_material); } -static int draw_dm_creases__setDrawOptions(void *userData, int index) +static int draw_dm_creases__setDrawOptions(void *UNUSED(userData), int index) { EditEdge *eed = EM_get_edge_for_index(index); @@ -1890,7 +1889,7 @@ static void draw_dm_creases(DerivedMesh *dm) glLineWidth(1.0); } -static int draw_dm_bweights__setDrawOptions(void *userData, int index) +static int draw_dm_bweights__setDrawOptions(void *UNUSED(userData), int index) { EditEdge *eed = EM_get_edge_for_index(index); @@ -1901,7 +1900,7 @@ static int draw_dm_bweights__setDrawOptions(void *userData, int index) return 0; } } -static void draw_dm_bweights__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) +static void draw_dm_bweights__mapFunc(void *UNUSED(userData), int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) { EditVert *eve = EM_get_vert_for_index(index); @@ -1936,7 +1935,7 @@ static void draw_dm_bweights(Scene *scene, DerivedMesh *dm) /* EditMesh drawing routines*/ -static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, EditMesh *em, DerivedMesh *cageDM, EditVert *eve_act) +static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, DerivedMesh *cageDM, EditVert *eve_act) { ToolSettings *ts= scene->toolsettings; int sel; @@ -2227,7 +2226,7 @@ static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d, Object *ob, E } } -static int draw_em_fancy__setFaceOpts(void *userData, int index, int *drawSmooth_r) +static int draw_em_fancy__setFaceOpts(void *UNUSED(userData), int index, int *UNUSED(drawSmooth_r)) { EditFace *efa = EM_get_face_for_index(index); @@ -2239,7 +2238,7 @@ static int draw_em_fancy__setFaceOpts(void *userData, int index, int *drawSmooth return 0; } -static int draw_em_fancy__setGLSLFaceOpts(void *userData, int index) +static int draw_em_fancy__setGLSLFaceOpts(void *UNUSED(userData), int index) { EditFace *efa = EM_get_face_for_index(index); @@ -2385,7 +2384,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object if(em) { // XXX retopo_matrix_update(v3d); - draw_em_fancy_verts(scene, v3d, ob, em, cageDM, eve_act); + draw_em_fancy_verts(scene, v3d, ob, cageDM, eve_act); if(me->drawflag & ME_DRAWNORMALS) { UI_ThemeColor(TH_NORMAL); @@ -2435,7 +2434,7 @@ static void draw_mesh_object_outline(View3D *v3d, Object *ob, DerivedMesh *dm) } } -static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r) +static int wpaint__setSolidDrawOptions(void *UNUSED(userData), int UNUSED(index), int *drawSmooth_r) { *drawSmooth_r = 1; return 1; @@ -4030,7 +4029,7 @@ static void draw_update_ptcache_edit(Scene *scene, Object *ob, PTCacheEdit *edit psys_cache_edit_paths(scene, ob, edit, CFRA); } -static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, PTCacheEdit *edit, int dt) +static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit) { ParticleCacheKey **cache, *path, *pkey; PTCacheEditPoint *point; @@ -4824,9 +4823,9 @@ static void draw_empty_cone (float size) } /* draw points on curve speed handles */ +#if 0 // XXX old animation system stuff static void curve_draw_speed(Scene *scene, Object *ob) { -#if 0 // XXX old animation system stuff Curve *cu= ob->data; IpoCurve *icu; BezTriple *bezt; @@ -4852,8 +4851,8 @@ static void curve_draw_speed(Scene *scene, Object *ob) glPointSize(1.0); bglEnd(); -#endif // XXX old animation system stuff } +#endif // XXX old animation system stuff static void draw_textcurs(float textcurs[][2]) @@ -5649,13 +5648,13 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) bAnimVizSettings *avs= &ob->avs; /* setup drawing environment for paths */ - draw_motion_paths_init(scene, v3d, ar); + draw_motion_paths_init(v3d, ar); /* draw motion path for object */ - draw_motion_path_instance(scene, v3d, ar, ob, NULL, avs, ob->mpath); + draw_motion_path_instance(scene, ob, NULL, avs, ob->mpath); /* cleanup after drawing */ - draw_motion_paths_cleanup(scene, v3d, ar); + draw_motion_paths_cleanup(v3d); } /* multiply view with object matrix. @@ -5879,9 +5878,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } else if(boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) { empty_object= drawDispList(scene, v3d, rv3d, base, dt); - - if(cu->path) - curve_draw_speed(scene, ob); + +//XXX old animsys if(cu->path) +// curve_draw_speed(scene, ob); } break; case OB_MBALL: @@ -5900,7 +5899,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } case OB_EMPTY: if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) - drawaxes(ob->empty_drawsize, flag, ob->empty_drawtype); + drawaxes(ob->empty_drawsize, ob->empty_drawtype); break; case OB_LAMP: if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { @@ -5926,7 +5925,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) break; default: if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { - drawaxes(1.0, flag, OB_ARROWS); + drawaxes(1.0, OB_ARROWS); } } @@ -5998,7 +5997,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) PTCacheEdit *edit = PE_create_current(scene, ob); if(edit) { glLoadMatrixf(rv3d->viewmat); - draw_ptcache_edit(scene, v3d, rv3d, ob, edit, dt); + draw_ptcache_edit(scene, v3d, edit); glMultMatrixf(ob->obmat); } } @@ -6052,7 +6051,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) // #if 0 smd->domain->tex = NULL; GPU_create_smoke(smd, 0); - draw_volume(scene, ar, v3d, base, smd->domain->tex, smd->domain->p0, smd->domain->p1, smd->domain->res, smd->domain->dx, smd->domain->tex_shadow); + draw_volume(ar, smd->domain->tex, smd->domain->p0, smd->domain->p1, smd->domain->res, smd->domain->dx, smd->domain->tex_shadow); GPU_free_smoke(smd); // #endif #if 0 @@ -6103,7 +6102,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) { smd->domain->tex = NULL; GPU_create_smoke(smd, 1); - draw_volume(scene, ar, v3d, base, smd->domain->tex, smd->domain->p0, smd->domain->p1, smd->domain->res_wt, smd->domain->dx_wt, smd->domain->tex_shadow); + draw_volume(ar, smd->domain->tex, smd->domain->p0, smd->domain->p1, smd->domain->res_wt, smd->domain->dx_wt, smd->domain->tex_shadow); GPU_free_smoke(smd); } } @@ -6126,7 +6125,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if(dtx && (G.f & G_RENDER_OGL)==0) { if(dtx & OB_AXIS) { - drawaxes(1.0f, flag, OB_ARROWS); + drawaxes(1.0f, OB_ARROWS); } if(dtx & OB_BOUNDBOX) { if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) @@ -6266,7 +6265,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) /* ***************** BACKBUF SEL (BBS) ********* */ -static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) +static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) { int offset = (intptr_t) userData; EditVert *eve = EM_get_vert_for_index(index); @@ -6302,7 +6301,7 @@ static void bbs_mesh_wire(DerivedMesh *dm, int offset) dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, (void*)(intptr_t) offset); } -static int bbs_mesh_solid__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r) +static int bbs_mesh_solid__setSolidDrawOptions(void *userData, int index, int *UNUSED(drawSmooth_r)) { if (EM_get_face_for_index(index)->h==0) { if (userData) { @@ -6314,7 +6313,7 @@ static int bbs_mesh_solid__setSolidDrawOptions(void *userData, int index, int *d } } -static void bbs_mesh_solid__drawCenter(void *userData, int index, float *cent, float *no) +static void bbs_mesh_solid__drawCenter(void *UNUSED(userData), int index, float *cent, float *UNUSED(no)) { EditFace *efa = EM_get_face_for_index(index); @@ -6346,13 +6345,13 @@ static void bbs_mesh_solid_EM(Scene *scene, View3D *v3d, Object *ob, DerivedMesh } } -static int bbs_mesh_solid__setDrawOpts(void *userData, int index, int *drawSmooth_r) +static int bbs_mesh_solid__setDrawOpts(void *UNUSED(userData), int index, int *UNUSED(drawSmooth_r)) { WM_set_framebuffer_index_color(index+1); return 1; } -static int bbs_mesh_solid_hide__setDrawOpts(void *userData, int index, int *drawSmooth_r) +static int bbs_mesh_solid_hide__setDrawOpts(void *userData, int index, int *UNUSED(drawSmooth_r)) { Mesh *me = userData; @@ -6499,7 +6498,7 @@ void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object draw_object_mesh_instance(scene, v3d, rv3d, ob, dt, outline); break; case OB_EMPTY: - drawaxes(ob->empty_drawsize, 0, ob->empty_drawtype); + drawaxes(ob->empty_drawsize, ob->empty_drawtype); break; } } diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 678920f8173..611cf68d81c 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -175,7 +175,7 @@ static int larger_pow2(int n) return n*2; } -void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture *tex, float *min, float *max, int res[3], float dx, GPUTexture *tex_shadow) +void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3], float dx, GPUTexture *tex_shadow) { RegionView3D *rv3d= ar->regiondata; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index d7ab8034286..5ca8843b658 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -304,7 +304,7 @@ static char *view3d_modeselect_pup(Scene *scene) } -static void do_view3d_header_buttons(bContext *C, void *arg, int event) +static void do_view3d_header_buttons(bContext *C, void *UNUSED(arg), int event) { wmWindow *win= CTX_wm_window(C); ToolSettings *ts= CTX_data_tool_settings(C); diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 4065b159ccf..49ef803b1af 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -93,11 +93,11 @@ void VIEW3D_OT_drawtype(struct wmOperatorType *ot); void view3d_boxview_copy(ScrArea *sa, ARegion *ar); /* drawanim.c */ -void draw_motion_paths_init(Scene *scene, View3D *v3d, struct ARegion *ar); -void draw_motion_path_instance(Scene *scene, View3D *v3d, struct ARegion *ar, +void draw_motion_paths_init(View3D *v3d, struct ARegion *ar); +void draw_motion_path_instance(Scene *scene, struct Object *ob, struct bPoseChannel *pchan, struct bAnimVizSettings *avs, struct bMotionPath *mpath); -void draw_motion_paths_cleanup(Scene *scene, View3D *v3d, struct ARegion *ar); +void draw_motion_paths_cleanup(View3D *v3d); @@ -106,7 +106,7 @@ void draw_object(Scene *scene, struct ARegion *ar, View3D *v3d, Base *base, int int draw_glsl_material(Scene *scene, struct Object *ob, View3D *v3d, int dt); void draw_object_instance(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob, int dt, int outline); void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob); -void drawaxes(float size, int flag, char drawtype); +void drawaxes(float size, char drawtype); void view3d_cached_text_draw_begin(void); void view3d_cached_text_draw_add(float x, float y, float z, char *str, short xoffs, short flag); @@ -189,7 +189,7 @@ ARegion *view3d_has_buttons_region(ScrArea *sa); ARegion *view3d_has_tools_region(ScrArea *sa); /* draw_volume.c */ -void draw_volume(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct Base *base, struct GPUTexture *tex, float *min, float *max, int res[3], float dx, struct GPUTexture *tex_shadow); +void draw_volume(struct ARegion *ar, struct GPUTexture *tex, float *min, float *max, int res[3], float dx, struct GPUTexture *tex_shadow); #endif /* ED_VIEW3D_INTERN_H */ -- cgit v1.2.3 From 266811368b620ee6609be8c07a1d0037b244b9b1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2010 02:05:37 +0000 Subject: bugfix [#21959] 'Apply rotation' to scaled object behaves wrong --- source/blender/editors/object/object_transform.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index d4644847a5c..1551db73e74 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -457,8 +457,18 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo object_to_mat3(ob, rsmat); else if(apply_scale) object_scale_to_mat3(ob, rsmat); - else if(apply_rot) + else if(apply_rot) { + float tmat[3][3], timat[3][3]; + + /* simple rotation matrix */ object_rot_to_mat3(ob, rsmat); + + /* correct for scale, note mul_m3_m3m3 has swapped args! */ + object_scale_to_mat3(ob, tmat); + invert_m3_m3(timat, tmat); + mul_m3_m3m3(rsmat, timat, rsmat); + mul_m3_m3m3(rsmat, rsmat, tmat); + } else unit_m3(rsmat); -- cgit v1.2.3 From b0b8e93f7f3264e690eae68bf15e4239e146485e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2010 03:57:15 +0000 Subject: bugfix [#24238] "M" (move) selects wrong action when with armature --- source/blender/editors/screen/screen_ops.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 584112ccacd..6d4aa3ebe64 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -262,11 +262,16 @@ int ED_operator_editarmature(bContext *C) int ED_operator_posemode(bContext *C) { Object *obact= CTX_data_active_object(C); - Object *obedit= CTX_data_edit_object(C); - - if ((obact != obedit) && ED_object_pose_armature(obact)) - return 1; - + + if ((obact != CTX_data_edit_object(C))) { + Object *obpose; + if(obpose= ED_object_pose_armature(obact)) { + if((obact == obpose) || (obact->mode & OB_MODE_WEIGHT_PAINT)) { + return 1; + } + } + } + return 0; } -- cgit v1.2.3 From fbf208d63fe0ba9770cb225726eb94888aa0994d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2010 06:29:17 +0000 Subject: add UNUSED() to modifiers, also removed some unused args. --- source/blender/blenkernel/BKE_modifier.h | 2 +- source/blender/blenkernel/intern/modifier.c | 4 +-- .../editors/transform/transform_conversions.c | 2 +- source/blender/modifiers/MOD_modifiertypes.h | 2 +- source/blender/modifiers/intern/MOD_armature.c | 21 +++++++----- source/blender/modifiers/intern/MOD_array.c | 8 ++--- source/blender/modifiers/intern/MOD_bevel.c | 15 +++++---- source/blender/modifiers/intern/MOD_boolean.c | 19 ++++++----- source/blender/modifiers/intern/MOD_build.c | 7 ++-- source/blender/modifiers/intern/MOD_cast.c | 25 +++++++++------ source/blender/modifiers/intern/MOD_cloth.c | 5 +-- source/blender/modifiers/intern/MOD_collision.c | 12 ++++--- source/blender/modifiers/intern/MOD_curve.c | 21 +++++++----- source/blender/modifiers/intern/MOD_decimate.c | 8 +++-- source/blender/modifiers/intern/MOD_displace.c | 25 +++++++++------ source/blender/modifiers/intern/MOD_edgesplit.c | 37 ++++++++++------------ source/blender/modifiers/intern/MOD_explode.c | 23 +++++++------- source/blender/modifiers/intern/MOD_fluidsim.c | 3 +- .../blender/modifiers/intern/MOD_fluidsim_util.c | 14 +++++--- source/blender/modifiers/intern/MOD_hook.c | 20 ++++++++---- source/blender/modifiers/intern/MOD_lattice.c | 20 ++++++++---- source/blender/modifiers/intern/MOD_mask.c | 13 +++++--- source/blender/modifiers/intern/MOD_meshdeform.c | 35 ++++++++++++-------- source/blender/modifiers/intern/MOD_mirror.c | 19 ++++++----- source/blender/modifiers/intern/MOD_none.c | 3 +- .../modifiers/intern/MOD_particleinstance.c | 19 ++++++----- .../blender/modifiers/intern/MOD_particlesystem.c | 12 ++++--- source/blender/modifiers/intern/MOD_screw.c | 19 +++++++---- source/blender/modifiers/intern/MOD_shapekey.c | 28 ++++++++++------ source/blender/modifiers/intern/MOD_shrinkwrap.c | 21 ++++++++---- source/blender/modifiers/intern/MOD_simpledeform.c | 24 ++++++++++---- source/blender/modifiers/intern/MOD_smoke.c | 21 +++++++----- source/blender/modifiers/intern/MOD_smooth.c | 11 ++++--- source/blender/modifiers/intern/MOD_softbody.c | 12 ++++--- source/blender/modifiers/intern/MOD_solidify.c | 13 ++++---- source/blender/modifiers/intern/MOD_subsurf.c | 14 ++++---- source/blender/modifiers/intern/MOD_surface.c | 14 +++++--- source/blender/modifiers/intern/MOD_util.c | 12 +++---- source/blender/modifiers/intern/MOD_util.h | 6 ++-- source/blender/modifiers/intern/MOD_uvproject.c | 22 +++++++------ source/blender/modifiers/intern/MOD_wave.c | 29 ++++++++++------- source/blender/render/intern/source/voxeldata.c | 4 +-- 42 files changed, 385 insertions(+), 259 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index 51120a61e69..0225a402fb8 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -315,7 +315,7 @@ int modifiers_isParticleEnabled(struct Object *ob); struct Object *modifiers_isDeformedByArmature(struct Object *ob); struct Object *modifiers_isDeformedByLattice(struct Object *ob); int modifiers_usesArmature(struct Object *ob, struct bArmature *arm); -int modifiers_isCorrectableDeformed(struct Scene *scene, struct Object *ob); +int modifiers_isCorrectableDeformed(struct Object *ob); void modifier_freeTemporaryData(struct ModifierData *md); int modifiers_indexInObject(struct Object *ob, struct ModifierData *md); diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index d7c95a007e5..dc2992662c9 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -59,7 +59,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) static int types_init = 1; if (types_init) { - modifier_type_init(types, type); /* MOD_utils.c */ + modifier_type_init(types); /* MOD_utils.c */ types_init= 0; } @@ -492,7 +492,7 @@ int modifier_isCorrectableDeformed(ModifierData *md) return 0; } -int modifiers_isCorrectableDeformed(struct Scene *scene, Object *ob) +int modifiers_isCorrectableDeformed(Object *ob) { ModifierData *md = modifiers_getVirtualModifierList(ob); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 0c0912a4ad6..fd97406652e 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2145,7 +2145,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) /* detect CrazySpace [tm] */ if(propmode==0) { if(modifiers_getCageIndex(t->scene, t->obedit, NULL, 1)>=0) { - if(modifiers_isCorrectableDeformed(t->scene, t->obedit)) { + if(modifiers_isCorrectableDeformed(t->obedit)) { /* check if we can use deform matrices for modifier from the start up to stack, they are more accurate than quats */ totleft= editmesh_get_first_deform_matrices(t->scene, t->obedit, em, &defmats, &defcos); diff --git a/source/blender/modifiers/MOD_modifiertypes.h b/source/blender/modifiers/MOD_modifiertypes.h index a792b163eea..6063acf47f4 100644 --- a/source/blender/modifiers/MOD_modifiertypes.h +++ b/source/blender/modifiers/MOD_modifiertypes.h @@ -69,6 +69,6 @@ extern ModifierTypeInfo modifierType_Solidify; extern ModifierTypeInfo modifierType_Screw; /* MOD_util.c */ -void modifier_type_init(ModifierTypeInfo *types[], ModifierType type); +void modifier_type_init(ModifierTypeInfo *types[]); #endif //MOD_MODIFIERTYPES_H diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index 6d2a3e7098f..2f802ee67c8 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -35,6 +35,7 @@ #include "DNA_armature_types.h" #include "DNA_object_types.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_lattice.h" #include "BKE_modifier.h" @@ -63,7 +64,7 @@ static void copyData(ModifierData *md, ModifierData *target) strncpy(tamd->defgrp_name, amd->defgrp_name, 32); } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(md)) { CustomDataMask dataMask = 0; @@ -73,7 +74,7 @@ static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) return dataMask; } -static int isDisabled(ModifierData *md, int useRenderParams) +static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) { ArmatureModifierData *amd = (ArmatureModifierData*) md; @@ -90,9 +91,10 @@ static void foreachObjectLink( walk(userData, ob, &amd->object); } -static void updateDepgraph( - ModifierData *md, DagForest *forest, struct Scene *scene, Object *ob, - DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { ArmatureModifierData *amd = (ArmatureModifierData*) md; @@ -104,9 +106,12 @@ static void updateDepgraph( } } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { ArmatureModifierData *amd = (ArmatureModifierData*) md; diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 8331c3474b2..839bfef6226 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -101,8 +101,8 @@ static void foreachObjectLink( walk(userData, ob, &amd->offset_ob); } -static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *scene, - Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), Object *UNUSED(ob), DagNode *obNode) { ArrayModifierData *amd = (ArrayModifierData*) md; @@ -731,7 +731,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, static DerivedMesh *applyModifier( ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) + int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) { DerivedMesh *result; ArrayModifierData *amd = (ArrayModifierData*) md; @@ -745,7 +745,7 @@ static DerivedMesh *applyModifier( } static DerivedMesh *applyModifierEM( - ModifierData *md, Object *ob, struct EditMesh *editData, + ModifierData *md, Object *ob, struct EditMesh *UNUSED(editData), DerivedMesh *derivedData) { return applyModifier(md, ob, derivedData, 0, 1); diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index 68274fbfd78..937c8cd7eac 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -66,7 +66,7 @@ static void copyData(ModifierData *md, ModifierData *target) strncpy(tbmd->defgrp_name, bmd->defgrp_name, 32); } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { BevelModifierData *bmd = (BevelModifierData *)md; CustomDataMask dataMask = 0; @@ -77,9 +77,10 @@ static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) return dataMask; } -static DerivedMesh *applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) +static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), + DerivedMesh *derivedData, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *result; BME_Mesh *bm; @@ -107,9 +108,9 @@ static DerivedMesh *applyModifier( return result; } -static DerivedMesh *applyModifierEM( - ModifierData *md, Object *ob, EditMesh *editData, - DerivedMesh *derivedData) +static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, + EditMesh *UNUSED(editData), + DerivedMesh *derivedData) { return applyModifier(md, ob, derivedData, 0, 1); } diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c index 496523a310b..dfcfd55f3d9 100644 --- a/source/blender/modifiers/intern/MOD_boolean.c +++ b/source/blender/modifiers/intern/MOD_boolean.c @@ -32,6 +32,7 @@ #include "DNA_object_types.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_modifier.h" @@ -49,7 +50,7 @@ static void copyData(ModifierData *md, ModifierData *target) tbmd->operation = bmd->operation; } -static int isDisabled(ModifierData *md, int useRenderParams) +static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) { BooleanModifierData *bmd = (BooleanModifierData*) md; @@ -66,9 +67,10 @@ static void foreachObjectLink( walk(userData, ob, &bmd->object); } -static void updateDepgraph( - ModifierData *md, DagForest *forest, struct Scene *scene, Object *ob, - DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { BooleanModifierData *bmd = (BooleanModifierData*) md; @@ -81,9 +83,10 @@ static void updateDepgraph( } -static DerivedMesh *applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) +static DerivedMesh *applyModifier(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { BooleanModifierData *bmd = (BooleanModifierData*) md; DerivedMesh *dm = bmd->object->derivedFinal; @@ -105,7 +108,7 @@ static DerivedMesh *applyModifier( return derivedData; } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(md)) { CustomDataMask dataMask = (1 << CD_MTFACE) + (1 << CD_MEDGE); diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index de913d79f01..960db7fa925 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -65,14 +65,15 @@ static void copyData(ModifierData *md, ModifierData *target) tbmd->seed = bmd->seed; } -static int dependsOnTime(ModifierData *md) +static int dependsOnTime(ModifierData *UNUSED(md)) { return 1; } static DerivedMesh *applyModifier(ModifierData *md, Object *ob, - DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) + DerivedMesh *derivedData, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *dm = derivedData; DerivedMesh *result; diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index 1872263848b..c39aa288b18 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -35,6 +35,7 @@ #include "BLI_math.h" +#include "BKE_utildefines.h" #include "BKE_deform.h" #include "BKE_DerivedMesh.h" #include "BKE_modifier.h" @@ -73,7 +74,7 @@ static void copyData(ModifierData *md, ModifierData *target) strncpy(tcmd->defgrp_name, cmd->defgrp_name, 32); } -static int isDisabled(ModifierData *md, int useRenderParams) +static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) { CastModifierData *cmd = (CastModifierData*) md; short flag; @@ -85,7 +86,7 @@ static int isDisabled(ModifierData *md, int useRenderParams) return 0; } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { CastModifierData *cmd = (CastModifierData *)md; CustomDataMask dataMask = 0; @@ -106,9 +107,10 @@ static void foreachObjectLink( walk (userData, ob, &cmd->object); } -static void updateDepgraph( - ModifierData *md, DagForest *forest, struct Scene *scene, Object *ob, - DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { CastModifierData *cmd = (CastModifierData*) md; @@ -566,14 +568,17 @@ static void cuboid_do( } } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *dm = NULL; CastModifierData *cmd = (CastModifierData *)md; - dm = get_dm(md->scene, ob, NULL, derivedData, NULL, 0); + dm = get_dm(ob, NULL, derivedData, NULL, 0); if (cmd->type == MOD_CAST_TYPE_CUBOID) { cuboid_do(cmd, ob, dm, vertexCos, numVerts); @@ -589,7 +594,7 @@ static void deformVertsEM( ModifierData *md, Object *ob, struct EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - DerivedMesh *dm = get_dm(md->scene, ob, editData, derivedData, NULL, 0); + DerivedMesh *dm = get_dm(ob, editData, derivedData, NULL, 0); CastModifierData *cmd = (CastModifierData *)md; if (cmd->type == MOD_CAST_TYPE_CUBOID) { diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c index 1c0ab34f15c..0c6c1e87a72 100644 --- a/source/blender/modifiers/intern/MOD_cloth.c +++ b/source/blender/modifiers/intern/MOD_cloth.c @@ -36,6 +36,7 @@ #include "MEM_guardedalloc.h" +#include "BKE_utildefines.h" #include "BKE_cloth.h" #include "BKE_cdderivedmesh.h" #include "BKE_global.h" @@ -111,7 +112,7 @@ static void updateDepgraph( } } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { CustomDataMask dataMask = 0; ClothModifierData *clmd = (ClothModifierData*)md; @@ -150,7 +151,7 @@ static void copyData(ModifierData *md, ModifierData *target) tclmd->clothObject = NULL; } -static int dependsOnTime(ModifierData *md) +static int dependsOnTime(ModifierData *UNUSED(md)) { return 1; } diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c index 2651122231c..20319b8c65f 100644 --- a/source/blender/modifiers/intern/MOD_collision.c +++ b/source/blender/modifiers/intern/MOD_collision.c @@ -38,6 +38,7 @@ #include "BLI_math.h" +#include "BKE_utildefines.h" #include "BKE_collision.h" #include "BKE_cdderivedmesh.h" #include "BKE_global.h" @@ -94,14 +95,17 @@ static void freeData(ModifierData *md) } } -static int dependsOnTime(ModifierData *md) +static int dependsOnTime(ModifierData *UNUSED(md)) { return 1; } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int UNUSED(numVerts), + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { CollisionModifierData *collmd = (CollisionModifierData*) md; DerivedMesh *dm = NULL; diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c index 998bf375e79..8009ad0589c 100644 --- a/source/blender/modifiers/intern/MOD_curve.c +++ b/source/blender/modifiers/intern/MOD_curve.c @@ -35,6 +35,7 @@ #include "DNA_scene_types.h" #include "DNA_object_types.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_lattice.h" #include "BKE_modifier.h" @@ -59,7 +60,7 @@ static void copyData(ModifierData *md, ModifierData *target) strncpy(tcmd->name, cmd->name, 32); } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { CurveModifierData *cmd = (CurveModifierData *)md; CustomDataMask dataMask = 0; @@ -70,7 +71,7 @@ static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) return dataMask; } -static int isDisabled(ModifierData *md, int userRenderParams) +static int isDisabled(ModifierData *md, int UNUSED(userRenderParams)) { CurveModifierData *cmd = (CurveModifierData*) md; @@ -87,9 +88,10 @@ static void foreachObjectLink( walk(userData, ob, &cmd->object); } -static void updateDepgraph( - ModifierData *md, DagForest *forest, Scene *scene, - Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { CurveModifierData *cmd = (CurveModifierData*) md; @@ -101,9 +103,12 @@ static void updateDepgraph( } } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { CurveModifierData *cmd = (CurveModifierData*) md; diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index 03307934e00..8df0c0be3eb 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -34,6 +34,7 @@ #include "BLI_math.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_mesh.h" #include "BKE_modifier.h" @@ -59,9 +60,10 @@ static void copyData(ModifierData *md, ModifierData *target) tdmd->percent = dmd->percent; } -static DerivedMesh *applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) +static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), + DerivedMesh *derivedData, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DecimateModifierData *dmd = (DecimateModifierData*) md; DerivedMesh *dm = derivedData, *result = NULL; diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index 2e811eb742d..95e8a9ce4cc 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -35,6 +35,7 @@ #include "BLI_math.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_modifier.h" #include "BKE_texture.h" @@ -75,7 +76,7 @@ static void copyData(ModifierData *md, ModifierData *target) strncpy(tdmd->uvlayer_name, dmd->uvlayer_name, 32); } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { DisplaceModifierData *dmd = (DisplaceModifierData *)md; CustomDataMask dataMask = 0; @@ -127,16 +128,17 @@ static void foreachIDLink(ModifierData *md, Object *ob, foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData); } -static int isDisabled(ModifierData *md, int useRenderParams) +static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) { DisplaceModifierData *dmd = (DisplaceModifierData*) md; return (!dmd->texture || dmd->strength == 0.0f); } -static void updateDepgraph( - ModifierData *md, DagForest *forest, struct Scene *scene, - Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { DisplaceModifierData *dmd = (DisplaceModifierData*) md; @@ -308,11 +310,14 @@ static void displaceModifier_do( MEM_freeN(tex_co); } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { - DerivedMesh *dm= get_cddm(md->scene, ob, NULL, derivedData, vertexCos); + DerivedMesh *dm= get_cddm(ob, NULL, derivedData, vertexCos); displaceModifier_do((DisplaceModifierData *)md, ob, dm, vertexCos, numVerts); @@ -325,7 +330,7 @@ static void deformVertsEM( ModifierData *md, Object *ob, struct EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - DerivedMesh *dm= get_cddm(md->scene, ob, editData, derivedData, vertexCos); + DerivedMesh *dm= get_cddm(ob, editData, derivedData, vertexCos); displaceModifier_do((DisplaceModifierData *)md, ob, dm, vertexCos, numVerts); diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c index e80b80abdb5..daf9d76cf51 100644 --- a/source/blender/modifiers/intern/MOD_edgesplit.c +++ b/source/blender/modifiers/intern/MOD_edgesplit.c @@ -40,6 +40,7 @@ #include "BLI_edgehash.h" #include "BLI_math.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_modifier.h" #include "BKE_particle.h" @@ -730,8 +731,7 @@ static int edge_is_loose(SmoothEdge *edge) return !(edge->faces && edge->faces->next); } -static int edge_is_sharp(SmoothEdge *edge, int flags, - float threshold) +static int edge_is_sharp(SmoothEdge *edge) { #ifdef EDGESPLIT_DEBUG_1 printf("edge %d: ", edge->newIndex); @@ -761,8 +761,7 @@ static int edge_is_sharp(SmoothEdge *edge, int flags, * - hits a sharp edge (the edge is returned) * - returns to the start edge (NULL is returned) */ -static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge, - LinkNode **visited_faces, float threshold, int flags) +static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge, LinkNode **visited_faces) { SmoothFace *face = NULL; SmoothEdge *edge2 = NULL; @@ -790,7 +789,7 @@ static SmoothEdge *find_other_sharp_edge(SmoothVert *vert, SmoothEdge *edge, /* search until we hit a loose edge or a sharp edge or an edge we've * seen before */ - while(face && !edge_is_sharp(edge2, flags, threshold) + while(face && !edge_is_sharp(edge2) && !linklist_contains(visited_edges, edge2)) { #ifdef EDGESPLIT_DEBUG_3 printf("current face %4d; current edge %4d\n", face->newIndex, @@ -902,8 +901,7 @@ static void propagate_split(SmoothEdge *edge, SmoothVert *vert, edge->newIndex, vert->newIndex); #endif - edge2 = find_other_sharp_edge(vert, edge, &visited_faces, - mesh->threshold, mesh->flags); + edge2 = find_other_sharp_edge(vert, edge, &visited_faces); if(!edge2) { /* didn't find a sharp or loose edge, so we've hit a dead end */ @@ -912,7 +910,7 @@ static void propagate_split(SmoothEdge *edge, SmoothVert *vert, if(edge_is_loose(edge)) { /* edge is loose, so we can split edge2 at this vert */ split_edge(edge2, vert, mesh); - } else if(edge_is_sharp(edge, mesh->flags, mesh->threshold)) { + } else if(edge_is_sharp(edge)) { /* both edges are sharp, so we can split the pair at vert */ split_edge(edge, vert, mesh); } else { @@ -961,8 +959,7 @@ static void split_edge(SmoothEdge *edge, SmoothVert *vert, SmoothMesh *mesh) edge->newIndex, vert->newIndex); #endif - edge2 = find_other_sharp_edge(vert, edge, &visited_faces, - mesh->threshold, mesh->flags); + edge2 = find_other_sharp_edge(vert, edge, &visited_faces); if(!edge2) { /* didn't find a sharp or loose edge, so try the other vert */ @@ -1111,7 +1108,7 @@ static void split_sharp_edges(SmoothMesh *mesh, float split_angle, int flags) for(i = 0; i < mesh->num_edges; i++) { SmoothEdge *edge = &mesh->edges[i]; - if(edge_is_sharp(edge, flags, mesh->threshold)) { + if(edge_is_sharp(edge)) { split_edge(edge, edge->verts[0], mesh); do { @@ -1190,8 +1187,7 @@ static void split_bridge_verts(SmoothMesh *mesh) } } -static DerivedMesh *edgesplitModifier_do(EdgeSplitModifierData *emd, - Object *ob, DerivedMesh *dm) +static DerivedMesh *edgesplitModifier_do(EdgeSplitModifierData *emd, DerivedMesh *dm) { SmoothMesh *mesh; DerivedMesh *result; @@ -1244,14 +1240,15 @@ static DerivedMesh *edgesplitModifier_do(EdgeSplitModifierData *emd, return result; } -static DerivedMesh *applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) +static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), + DerivedMesh *derivedData, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *result; EdgeSplitModifierData *emd = (EdgeSplitModifierData*) md; - result = edgesplitModifier_do(emd, ob, derivedData); + result = edgesplitModifier_do(emd, derivedData); if(result != derivedData) CDDM_calc_normals(result); @@ -1259,9 +1256,9 @@ static DerivedMesh *applyModifier( return result; } -static DerivedMesh *applyModifierEM( - ModifierData *md, Object *ob, struct EditMesh *editData, - DerivedMesh *derivedData) +static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, + struct EditMesh *UNUSED(editData), + DerivedMesh *derivedData) { return applyModifier(md, ob, derivedData, 0, 1); } diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index cbf5f3c3b98..67f1f2a3e59 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -74,11 +74,11 @@ static void copyData(ModifierData *md, ModifierData *target) temd->protect = emd->protect; temd->vgroup = emd->vgroup; } -static int dependsOnTime(ModifierData *md) +static int dependsOnTime(ModifierData *UNUSED(md)) { return 1; } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { ExplodeModifierData *emd= (ExplodeModifierData*) md; CustomDataMask dataMask = 0; @@ -90,8 +90,8 @@ static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) } static void createFacepa(ExplodeModifierData *emd, - ParticleSystemModifierData *psmd, - Object *ob, DerivedMesh *dm) + ParticleSystemModifierData *psmd, + DerivedMesh *dm) { ParticleSystem *psys=psmd->psys; MFace *fa=0, *mface=0; @@ -833,9 +833,10 @@ static ParticleSystemModifierData * findPrecedingParticlesystem(Object *ob, Modi } return psmd; } -static DerivedMesh * applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) +static DerivedMesh * applyModifier(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *dm = derivedData; ExplodeModifierData *emd= (ExplodeModifierData*) md; @@ -852,16 +853,16 @@ static DerivedMesh * applyModifier( if(emd->facepa==0 || psmd->flag&eParticleSystemFlag_Pars || emd->flag&eExplodeFlag_CalcFaces - || MEM_allocN_len(emd->facepa)/sizeof(int) != dm->getNumFaces(dm)){ + || MEM_allocN_len(emd->facepa)/sizeof(int) != dm->getNumFaces(dm)) + { if(psmd->flag & eParticleSystemFlag_Pars) psmd->flag &= ~eParticleSystemFlag_Pars; if(emd->flag & eExplodeFlag_CalcFaces) emd->flag &= ~eExplodeFlag_CalcFaces; - createFacepa(emd,psmd,ob,derivedData); - } - + createFacepa(emd,psmd,derivedData); + } /* 2. create new mesh */ if(emd->flag & eExplodeFlag_EdgeSplit){ int *facepa = emd->facepa; diff --git a/source/blender/modifiers/intern/MOD_fluidsim.c b/source/blender/modifiers/intern/MOD_fluidsim.c index 619891e136f..14fb09f1c1f 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim.c +++ b/source/blender/modifiers/intern/MOD_fluidsim.c @@ -34,6 +34,7 @@ #include "DNA_object_fluidsim.h" #include "DNA_object_types.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_modifier.h" @@ -125,7 +126,7 @@ static void updateDepgraph( } } -static int dependsOnTime(ModifierData *md) +static int dependsOnTime(ModifierData *UNUSED(md)) { return 1; } diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 0c5428cc9d8..42c2fc5bbe4 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -443,7 +443,7 @@ void fluidsim_read_vel_cache(FluidsimModifierData *fluidmd, DerivedMesh *dm, cha gzclose(gzf); } -DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, FluidsimModifierData *fluidmd, int framenr, int useRenderParams) +DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData *fluidmd, int framenr, int useRenderParams) { int displaymode = 0; int curFrame = framenr - 1 /*scene->r.sfra*/; /* start with 0 at start frame */ @@ -537,7 +537,11 @@ DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, FluidsimModifie #endif // DISABLE_ELBEEM -DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) +DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene, + Object *UNUSED(ob), + DerivedMesh *dm, + int useRenderParams, + int UNUSED(isFinalCalc)) { #ifndef DISABLE_ELBEEM DerivedMesh *result = NULL; @@ -567,7 +571,7 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene, Ob } /* try to read from cache */ - if(((fss->lastgoodframe >= framenr) || (fss->lastgoodframe < 0)) && (result = fluidsim_read_cache(ob, dm, fluidmd, framenr, useRenderParams))) + if(((fss->lastgoodframe >= framenr) || (fss->lastgoodframe < 0)) && (result = fluidsim_read_cache(dm, fluidmd, framenr, useRenderParams))) { // fss->lastgoodframe = framenr; // set also in src/fluidsim.c return result; @@ -577,7 +581,7 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene, Ob // display last known good frame if(fss->lastgoodframe >= 0) { - if((result = fluidsim_read_cache(ob, dm, fluidmd, fss->lastgoodframe, useRenderParams))) + if((result = fluidsim_read_cache(dm, fluidmd, fss->lastgoodframe, useRenderParams))) { return result; } @@ -587,7 +591,7 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene, Ob // this could be likely the case when you load an old fluidsim - if((result = fluidsim_read_cache(ob, dm, fluidmd, fss->lastgoodframe, useRenderParams))) + if((result = fluidsim_read_cache(dm, fluidmd, fss->lastgoodframe, useRenderParams))) { return result; } diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index f2ffd486aa5..8ad3c9aaf5b 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -40,6 +40,7 @@ #include "BKE_cdderivedmesh.h" #include "BKE_modifier.h" #include "BKE_deform.h" +#include "BKE_utildefines.h" #include "depsgraph_private.h" #include "MEM_guardedalloc.h" @@ -68,7 +69,7 @@ static void copyData(ModifierData *md, ModifierData *target) strncpy(thmd->subtarget, hmd->subtarget, 32); } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { HookModifierData *hmd = (HookModifierData *)md; CustomDataMask dataMask = 0; @@ -86,7 +87,7 @@ static void freeData(ModifierData *md) if (hmd->indexar) MEM_freeN(hmd->indexar); } -static int isDisabled(ModifierData *md, int useRenderParams) +static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) { HookModifierData *hmd = (HookModifierData*) md; @@ -103,8 +104,10 @@ static void foreachObjectLink( walk(userData, ob, &hmd->object); } -static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *scene, - Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { HookModifierData *hmd = (HookModifierData*) md; @@ -118,9 +121,12 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *sc } } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { HookModifierData *hmd = (HookModifierData*) md; bPoseChannel *pchan= get_pose_channel(hmd->object->pose, hmd->subtarget); diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c index 532475a3466..fdbc3fa0a50 100644 --- a/source/blender/modifiers/intern/MOD_lattice.c +++ b/source/blender/modifiers/intern/MOD_lattice.c @@ -34,6 +34,7 @@ #include "DNA_object_types.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_lattice.h" #include "BKE_modifier.h" @@ -52,7 +53,7 @@ static void copyData(ModifierData *md, ModifierData *target) strncpy(tlmd->name, lmd->name, 32); } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { LatticeModifierData *lmd = (LatticeModifierData *)md; CustomDataMask dataMask = 0; @@ -63,7 +64,7 @@ static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) return dataMask; } -static int isDisabled(ModifierData *md, int userRenderParams) +static int isDisabled(ModifierData *md, int UNUSED(userRenderParams)) { LatticeModifierData *lmd = (LatticeModifierData*) md; @@ -80,8 +81,10 @@ static void foreachObjectLink( walk(userData, ob, &lmd->object); } -static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *scene, - Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { LatticeModifierData *lmd = (LatticeModifierData*) md; @@ -93,9 +96,12 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *sc } } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { LatticeModifierData *lmd = (LatticeModifierData*) md; diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c index c1565352133..eddb21596a6 100644 --- a/source/blender/modifiers/intern/MOD_mask.c +++ b/source/blender/modifiers/intern/MOD_mask.c @@ -55,7 +55,7 @@ static void copyData(ModifierData *md, ModifierData *target) strcpy(tmmd->vgroup, mmd->vgroup); } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(md)) { return (1 << CD_MDEFORMVERT); } @@ -69,8 +69,10 @@ static void foreachObjectLink( walk(userData, ob, &mmd->ob_arm); } -static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *scene, - Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { MaskModifierData *mmd = (MaskModifierData *)md; @@ -84,8 +86,9 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *sc } static DerivedMesh *applyModifier(ModifierData *md, Object *ob, - DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) + DerivedMesh *derivedData, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { MaskModifierData *mmd= (MaskModifierData *)md; DerivedMesh *dm= derivedData, *result= NULL; diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index af87fb6ef74..587b3b8f053 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -35,6 +35,7 @@ #include "BLI_math.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_global.h" #include "BKE_mesh.h" @@ -76,7 +77,7 @@ static void copyData(ModifierData *md, ModifierData *target) tmmd->object = mmd->object; } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { MeshDeformModifierData *mmd = (MeshDeformModifierData *)md; CustomDataMask dataMask = 0; @@ -87,7 +88,7 @@ static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) return dataMask; } -static int isDisabled(ModifierData *md, int useRenderParams) +static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) { MeshDeformModifierData *mmd = (MeshDeformModifierData*) md; @@ -104,9 +105,10 @@ static void foreachObjectLink( walk(userData, ob, &mmd->object); } -static void updateDepgraph( - ModifierData *md, DagForest *forest, struct Scene *scene, Object *ob, - DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { MeshDeformModifierData *mmd = (MeshDeformModifierData*) md; @@ -204,7 +206,7 @@ static void meshdeformModifier_do( /* if we don't have one computed, use derivedmesh from data * without any modifiers */ if(!cagedm) { - cagedm= get_dm(md->scene, mmd->object, NULL, NULL, NULL, 0); + cagedm= get_dm(mmd->object, NULL, NULL, NULL, 0); if(cagedm) cagedm->needsFree= 1; } @@ -338,11 +340,14 @@ static void meshdeformModifier_do( cagedm->release(cagedm); } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { - DerivedMesh *dm= get_dm(md->scene, ob, NULL, derivedData, NULL, 0);; + DerivedMesh *dm= get_dm(ob, NULL, derivedData, NULL, 0);; modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ @@ -352,11 +357,13 @@ static void deformVerts( dm->release(dm); } -static void deformVertsEM( - ModifierData *md, Object *ob, struct EditMesh *editData, - DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) +static void deformVertsEM(ModifierData *md, Object *ob, + struct EditMesh *UNUSED(editData), + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts) { - DerivedMesh *dm= get_dm(md->scene, ob, NULL, derivedData, NULL, 0);; + DerivedMesh *dm= get_dm(ob, NULL, derivedData, NULL, 0);; meshdeformModifier_do(md, ob, dm, vertexCos, numVerts); diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index 9289c44c414..6405f0e9d76 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -74,8 +74,10 @@ static void foreachObjectLink( walk(userData, ob, &mmd->mirror_ob); } -static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *scene, - Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { MirrorModifierData *mmd = (MirrorModifierData*) md; @@ -298,9 +300,10 @@ static DerivedMesh *mirrorModifier__doMirror(MirrorModifierData *mmd, return result; } -static DerivedMesh *applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) +static DerivedMesh *applyModifier(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *result; MirrorModifierData *mmd = (MirrorModifierData*) md; @@ -313,9 +316,9 @@ static DerivedMesh *applyModifier( return result; } -static DerivedMesh *applyModifierEM( - ModifierData *md, Object *ob, struct EditMesh *editData, - DerivedMesh *derivedData) +static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, + struct EditMesh *UNUSED(editData), + DerivedMesh *derivedData) { return applyModifier(md, ob, derivedData, 0, 1); } diff --git a/source/blender/modifiers/intern/MOD_none.c b/source/blender/modifiers/intern/MOD_none.c index 8cfb2a59376..1b6a709e7f4 100644 --- a/source/blender/modifiers/intern/MOD_none.c +++ b/source/blender/modifiers/intern/MOD_none.c @@ -34,13 +34,14 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include "BKE_utildefines.h" #include "MOD_modifiertypes.h" /* We only need to define isDisabled; because it always returns 1, * no other functions will be called */ -static int isDisabled(ModifierData *md, int userRenderParams) +static int isDisabled(ModifierData *UNUSED(md), int UNUSED(userRenderParams)) { return 1; } diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c index bbd0219d3f8..9fcefdba49a 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.c +++ b/source/blender/modifiers/intern/MOD_particleinstance.c @@ -72,12 +72,14 @@ static void copyData(ModifierData *md, ModifierData *target) tpimd->random_position = pimd->random_position; } -static int dependsOnTime(ModifierData *md) +static int dependsOnTime(ModifierData *UNUSED(md)) { return 0; } static void updateDepgraph(ModifierData *md, DagForest *forest, - struct Scene *scene,Object *ob, DagNode *obNode) + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData*) md; @@ -98,9 +100,10 @@ static void foreachObjectLink(ModifierData *md, Object *ob, walk(userData, ob, &pimd->ob); } -static DerivedMesh * applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) +static DerivedMesh * applyModifier(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *dm = derivedData, *result; ParticleInstanceModifierData *pimd= (ParticleInstanceModifierData*) md; @@ -306,9 +309,9 @@ static DerivedMesh * applyModifier( return result; } -static DerivedMesh *applyModifierEM( - ModifierData *md, Object *ob, struct EditMesh *editData, - DerivedMesh *derivedData) +static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, + struct EditMesh *UNUSED(editData), + DerivedMesh *derivedData) { return applyModifier(md, ob, derivedData, 0, 1); } diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c index 602b6dd1d56..0feea3b6bf5 100644 --- a/source/blender/modifiers/intern/MOD_particlesystem.c +++ b/source/blender/modifiers/intern/MOD_particlesystem.c @@ -34,6 +34,7 @@ #include "DNA_material_types.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_material.h" #include "BKE_modifier.h" @@ -119,9 +120,12 @@ static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) } /* saves the current emitter state for a particle system and calculates particles */ -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int UNUSED(numVerts), + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *dm = derivedData; ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md; @@ -137,7 +141,7 @@ static void deformVerts( return; if(dm==0) { - dm= get_dm(md->scene, ob, NULL, NULL, vertexCos, 1); + dm= get_dm(ob, NULL, NULL, vertexCos, 1); if(!dm) return; diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index 0016fd2d266..668f0a086d1 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -37,6 +37,7 @@ #include "BLI_math.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "depsgraph_private.h" @@ -128,8 +129,9 @@ static void copyData(ModifierData *md, ModifierData *target) } static DerivedMesh *applyModifier(ModifierData *md, Object *ob, - DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) + DerivedMesh *derivedData, + int useRenderParams, + int UNUSED(isFinalCalc)) { DerivedMesh *dm= derivedData; DerivedMesh *result; @@ -832,9 +834,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, } -static void updateDepgraph( - ModifierData *md, DagForest *forest, - struct Scene *scene, Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { ScrewModifierData *ltmd= (ScrewModifierData*) md; @@ -859,13 +862,15 @@ static void foreachObjectLink( /* This dosnt work with material*/ static DerivedMesh *applyModifierEM( - ModifierData *md, Object *ob, struct EditMesh *editData, + ModifierData *md, + Object *ob, + struct EditMesh *UNUSED(editData), DerivedMesh *derivedData) { return applyModifier(md, ob, derivedData, 0, 1); } -static int dependsOnTime(ModifierData *md) +static int dependsOnTime(ModifierData *UNUSED(md)) { return 0; } diff --git a/source/blender/modifiers/intern/MOD_shapekey.c b/source/blender/modifiers/intern/MOD_shapekey.c index bf675b874f6..3a3150022d8 100644 --- a/source/blender/modifiers/intern/MOD_shapekey.c +++ b/source/blender/modifiers/intern/MOD_shapekey.c @@ -34,6 +34,7 @@ #include "DNA_key_types.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_key.h" #include "BKE_particle.h" @@ -42,9 +43,12 @@ #include "MEM_guardedalloc.h" -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *UNUSED(derivedData), + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { KeyBlock *kb= ob_get_keyblock(ob); float (*deformedVerts)[3]; @@ -58,9 +62,11 @@ static void deformVerts( } } -static void deformVertsEM( - ModifierData *md, Object *ob, struct EditMesh *editData, - DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) +static void deformVertsEM(ModifierData *md, Object *ob, + struct EditMesh *UNUSED(editData), + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts) { Key *key= ob_get_key(ob); @@ -68,10 +74,12 @@ static void deformVertsEM( deformVerts(md, ob, derivedData, vertexCos, numVerts, 0, 0); } -static void deformMatricesEM( - ModifierData *md, Object *ob, struct EditMesh *editData, - DerivedMesh *derivedData, float (*vertexCos)[3], - float (*defMats)[3][3], int numVerts) +static void deformMatricesEM(ModifierData *UNUSED(md), Object *ob, + struct EditMesh *UNUSED(editData), + DerivedMesh *UNUSED(derivedData), + float UNUSED((*vertexCos)[3]), + float (*defMats)[3][3], + int numVerts) { Key *key= ob_get_key(ob); KeyBlock *kb= ob_get_keyblock(ob); diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c index 6baee9f0d98..6eebe9b5e5e 100644 --- a/source/blender/modifiers/intern/MOD_shrinkwrap.c +++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c @@ -32,6 +32,7 @@ #include +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_modifier.h" #include "BKE_shrinkwrap.h" @@ -71,7 +72,7 @@ static void copyData(ModifierData *md, ModifierData *target) tsmd->subsurfLevels = smd->subsurfLevels; } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md; CustomDataMask dataMask = 0; @@ -87,7 +88,7 @@ static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) return dataMask; } -static int isDisabled(ModifierData *md, int useRenderParams) +static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; return !smd->target; @@ -102,14 +103,19 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, walk(userData, ob, &smd->auxTarget); } -static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *dm = derivedData; CustomDataMask dataMask = requiredDataMask(ob, md); /* ensure we get a CDDM with applied vertex coords */ if(dataMask) - dm= get_cddm(md->scene, ob, NULL, dm, vertexCos); + dm= get_cddm(ob, NULL, dm, vertexCos); shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, md->scene, ob, dm, vertexCos, numVerts); @@ -124,7 +130,7 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct EditMesh *editDat /* ensure we get a CDDM with applied vertex coords */ if(dataMask) - dm= get_cddm(md->scene, ob, editData, dm, vertexCos); + dm= get_cddm(ob, editData, dm, vertexCos); shrinkwrapModifier_deform((ShrinkwrapModifierData*)md, md->scene, ob, dm, vertexCos, numVerts); @@ -132,7 +138,10 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct EditMesh *editDat dm->release(dm); } -static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *scene, Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index ab580781351..7c47ab02157 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -290,7 +290,7 @@ static void copyData(ModifierData *md, ModifierData *target) strcpy(tsmd->vgroup_name, smd->vgroup_name); } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { SimpleDeformModifierData *smd = (SimpleDeformModifierData *)md; CustomDataMask dataMask = 0; @@ -308,7 +308,10 @@ static void foreachObjectLink(ModifierData *md, Object *ob, void (*walk)(void *u walk(userData, ob, &smd->origin); } -static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *scene, Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { SimpleDeformModifierData *smd = (SimpleDeformModifierData*)md; @@ -316,7 +319,12 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *sc dag_add_relation(forest, dag_get_node(forest, smd->origin), obNode, DAG_RL_OB_DATA, "SimpleDeform Modifier"); } -static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *dm = derivedData; CustomDataMask dataMask = requiredDataMask(ob, md); @@ -324,7 +332,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, /* we implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData */ if(dataMask) - dm= get_dm(md->scene, ob, NULL, dm, NULL, 0); + dm= get_dm(ob, NULL, dm, NULL, 0); SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, dm, vertexCos, numVerts); @@ -332,7 +340,11 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, dm->release(dm); } -static void deformVertsEM(ModifierData *md, Object *ob, struct EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) +static void deformVertsEM(ModifierData *md, Object *ob, + struct EditMesh *editData, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts) { DerivedMesh *dm = derivedData; CustomDataMask dataMask = requiredDataMask(ob, md); @@ -340,7 +352,7 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct EditMesh *editDat /* we implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData */ if(dataMask) - dm= get_dm(md->scene, ob, editData, dm, NULL, 0); + dm= get_dm(ob, editData, dm, NULL, 0); SimpleDeformModifier_do((SimpleDeformModifierData*)md, ob, dm, vertexCos, numVerts); diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c index f89ff0bb1b5..aee466802ca 100644 --- a/source/blender/modifiers/intern/MOD_smoke.c +++ b/source/blender/modifiers/intern/MOD_smoke.c @@ -36,6 +36,7 @@ #include "DNA_object_types.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_modifier.h" #include "BKE_smoke.h" @@ -71,12 +72,15 @@ static void freeData(ModifierData *md) smokeModifier_free (smd); } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int UNUSED(numVerts), + int useRenderParams, + int isFinalCalc) { SmokeModifierData *smd = (SmokeModifierData*) md; - DerivedMesh *dm = dm= get_cddm(md->scene, ob, NULL, derivedData, vertexCos); + DerivedMesh *dm = dm= get_cddm(ob, NULL, derivedData, vertexCos); smokeModifier_do(smd, md->scene, ob, dm, useRenderParams, isFinalCalc); @@ -84,14 +88,15 @@ static void deformVerts( dm->release(dm); } -static int dependsOnTime(ModifierData *md) +static int dependsOnTime(ModifierData *UNUSED(md)) { return 1; } -static void updateDepgraph( - ModifierData *md, DagForest *forest, struct Scene *scene, Object *ob, - DagNode *obNode) +static void updateDepgraph(ModifierData *UNUSED(md), DagForest *UNUSED(forest), + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *UNUSED(obNode)) { /*SmokeModifierData *smd = (SmokeModifierData *) md; if(smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c index 96269c092c9..db7013f53ce 100644 --- a/source/blender/modifiers/intern/MOD_smooth.c +++ b/source/blender/modifiers/intern/MOD_smooth.c @@ -37,6 +37,7 @@ #include "BKE_cdderivedmesh.h" #include "BKE_particle.h" #include "BKE_deform.h" +#include "BKE_utildefines.h" #include "MEM_guardedalloc.h" @@ -65,7 +66,7 @@ static void copyData(ModifierData *md, ModifierData *target) strncpy(tsmd->defgrp_name, smd->defgrp_name, 32); } -static int isDisabled(ModifierData *md, int useRenderParams) +static int isDisabled(ModifierData *md, int UNUSED(useRenderParams)) { SmoothModifierData *smd = (SmoothModifierData*) md; short flag; @@ -78,7 +79,7 @@ static int isDisabled(ModifierData *md, int useRenderParams) return 0; } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { SmoothModifierData *smd = (SmoothModifierData *)md; CustomDataMask dataMask = 0; @@ -219,9 +220,9 @@ static void smoothModifier_do( static void deformVerts( ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) + float (*vertexCos)[3], int numVerts, int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) { - DerivedMesh *dm= get_dm(md->scene, ob, NULL, derivedData, NULL, 0); + DerivedMesh *dm= get_dm(ob, NULL, derivedData, NULL, 0); smoothModifier_do((SmoothModifierData *)md, ob, dm, vertexCos, numVerts); @@ -234,7 +235,7 @@ static void deformVertsEM( ModifierData *md, Object *ob, struct EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { - DerivedMesh *dm= get_dm(md->scene, ob, editData, derivedData, NULL, 0); + DerivedMesh *dm= get_dm(ob, editData, derivedData, NULL, 0); smoothModifier_do((SmoothModifierData *)md, ob, dm, vertexCos, numVerts); diff --git a/source/blender/modifiers/intern/MOD_softbody.c b/source/blender/modifiers/intern/MOD_softbody.c index 931cfe2e2d3..8d962395d01 100644 --- a/source/blender/modifiers/intern/MOD_softbody.c +++ b/source/blender/modifiers/intern/MOD_softbody.c @@ -32,20 +32,24 @@ #include "DNA_scene_types.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_particle.h" #include "BKE_softbody.h" #include "MOD_modifiertypes.h" -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *UNUSED(derivedData), + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { sbObjectStep(md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts); } -static int dependsOnTime(ModifierData *md) +static int dependsOnTime(ModifierData *UNUSED(md)) { return 1; } diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index 57155c4e1dc..6abe1262c0b 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -179,7 +179,7 @@ static void copyData(ModifierData *md, ModifierData *target) strcpy(tsmd->defgrp_name, smd->defgrp_name); } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { SolidifyModifierData *smd = (SolidifyModifierData*) md; CustomDataMask dataMask = 0; @@ -191,11 +191,10 @@ static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) } -static DerivedMesh *applyModifier(ModifierData *md, - Object *ob, - DerivedMesh *dm, - int useRenderParams, - int isFinalCalc) +static DerivedMesh *applyModifier(ModifierData *md, Object *ob, + DerivedMesh *dm, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { int i; DerivedMesh *result; @@ -630,7 +629,7 @@ static DerivedMesh *applyModifier(ModifierData *md, static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, - struct EditMesh *editData, + struct EditMesh *UNUSED(editData), DerivedMesh *derivedData) { return applyModifier(md, ob, derivedData, 0, 1); diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index cd3657b9674..3264717c97a 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -35,6 +35,7 @@ #include "DNA_scene_types.h" #include "DNA_object_types.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_scene.h" #include "BKE_subsurf.h" @@ -83,9 +84,10 @@ static int isDisabled(ModifierData *md, int useRenderParams) return get_render_subsurf_level(&md->scene->r, levels) == 0; } -static DerivedMesh *applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) +static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), + DerivedMesh *derivedData, + int useRenderParams, + int isFinalCalc) { SubsurfModifierData *smd = (SubsurfModifierData*) md; DerivedMesh *result; @@ -102,9 +104,9 @@ static DerivedMesh *applyModifier( return result; } -static DerivedMesh *applyModifierEM( - ModifierData *md, Object *ob, struct EditMesh *editData, - DerivedMesh *derivedData) +static DerivedMesh *applyModifierEM(ModifierData *md, Object *UNUSED(ob), + struct EditMesh *UNUSED(editData), + DerivedMesh *derivedData) { SubsurfModifierData *smd = (SubsurfModifierData*) md; DerivedMesh *result; diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index b2f55bde360..a1593df0ffa 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -36,6 +36,7 @@ #include "BLI_math.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "MOD_modifiertypes.h" @@ -76,14 +77,17 @@ static void freeData(ModifierData *md) } } -static int dependsOnTime(ModifierData *md) +static int dependsOnTime(ModifierData *UNUSED(md)) { return 1; } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int UNUSED(numVerts), + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { SurfaceModifierData *surmd = (SurfaceModifierData*) md; unsigned int numverts = 0, i = 0; @@ -93,7 +97,7 @@ static void deformVerts( /* if possible use/create DerivedMesh */ if(derivedData) surmd->dm = CDDM_copy(derivedData); - else surmd->dm = get_dm(md->scene, ob, NULL, NULL, NULL, 0); + else surmd->dm = get_dm(ob, NULL, NULL, NULL, 0); if(!ob->pd) { diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index 754b18bc282..de96684a2dd 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -84,13 +84,13 @@ void validate_layer_name(const CustomData *data, int type, char *name, char *out /* if a layer name was given, try to find that layer */ if(name[0]) - index = CustomData_get_named_layer_index(data, CD_MTFACE, name); + index = CustomData_get_named_layer_index(data, type, name); if(index < 0) { /* either no layer was specified, or the layer we want has been * deleted, so assign the active layer to name */ - index = CustomData_get_active_layer_index(data, CD_MTFACE); + index = CustomData_get_active_layer_index(data, type); strcpy(outname, data->layers[index].name); } else @@ -98,13 +98,13 @@ void validate_layer_name(const CustomData *data, int type, char *name, char *out } /* returns a cdderivedmesh if dm == NULL or is another type of derivedmesh */ -DerivedMesh *get_cddm(struct Scene *scene, Object *ob, struct EditMesh *em, DerivedMesh *dm, float (*vertexCos)[3]) +DerivedMesh *get_cddm(Object *ob, struct EditMesh *em, DerivedMesh *dm, float (*vertexCos)[3]) { if(dm && dm->type == DM_TYPE_CDDM) return dm; if(!dm) { - dm= get_dm(scene, ob, em, dm, vertexCos, 0); + dm= get_dm(ob, em, dm, vertexCos, 0); } else { dm= CDDM_copy(dm); @@ -118,7 +118,7 @@ DerivedMesh *get_cddm(struct Scene *scene, Object *ob, struct EditMesh *em, Deri } /* returns a derived mesh if dm == NULL, for deforming modifiers that need it */ -DerivedMesh *get_dm(struct Scene *scene, Object *ob, struct EditMesh *em, DerivedMesh *dm, float (*vertexCos)[3], int orco) +DerivedMesh *get_dm(Object *ob, struct EditMesh *em, DerivedMesh *dm, float (*vertexCos)[3], int orco) { if(dm) return dm; @@ -143,7 +143,7 @@ DerivedMesh *get_dm(struct Scene *scene, Object *ob, struct EditMesh *em, Derive } /* only called by BKE_modifier.h/modifier.c */ -void modifier_type_init(ModifierTypeInfo *types[], ModifierType type) +void modifier_type_init(ModifierTypeInfo *types[]) { memset(types, 0, sizeof(types)); #define INIT_TYPE(typeName) (types[eModifierType_##typeName] = &modifierType_##typeName) diff --git a/source/blender/modifiers/intern/MOD_util.h b/source/blender/modifiers/intern/MOD_util.h index 5750e042199..6abc29417b5 100644 --- a/source/blender/modifiers/intern/MOD_util.h +++ b/source/blender/modifiers/intern/MOD_util.h @@ -40,9 +40,9 @@ struct ModifierData; void get_texture_value(struct Tex *texture, float *tex_co, struct TexResult *texres); void modifier_vgroup_cache(struct ModifierData *md, float (*vertexCos)[3]); void validate_layer_name(const struct CustomData *data, int type, char *name, char *outname); -struct DerivedMesh *get_cddm(struct Scene *scene, struct Object *ob, struct EditMesh *em, struct DerivedMesh *dm, float (*vertexCos)[3]); -struct DerivedMesh *get_dm(struct Scene *scene, struct Object *ob, struct EditMesh *em, struct DerivedMesh *dm, float (*vertexCos)[3], int orco); +struct DerivedMesh *get_cddm(struct Object *ob, struct EditMesh *em, struct DerivedMesh *dm, float (*vertexCos)[3]); +struct DerivedMesh *get_dm(struct Object *ob, struct EditMesh *em, struct DerivedMesh *dm, float (*vertexCos)[3], int orco); -void modifier_type_init(struct ModifierTypeInfo *types[], ModifierType type); +void modifier_type_init(struct ModifierTypeInfo *types[]); #endif /* MOD_UTIL_H */ diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index 211640ad777..942b4b0b597 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -39,6 +39,7 @@ #include "BLI_math.h" #include "BLI_uvproject.h" +#include "BKE_utildefines.h" #include "BKE_DerivedMesh.h" #include "MOD_modifiertypes.h" @@ -78,7 +79,7 @@ static void copyData(ModifierData *md, ModifierData *target) tumd->scaley = umd->scaley; } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(md)) { CustomDataMask dataMask = 0; @@ -109,8 +110,10 @@ static void foreachIDLink(ModifierData *md, Object *ob, userData); } -static void updateDepgraph(ModifierData *md, - DagForest *forest, struct Scene *scene, Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { UVProjectModifierData *umd = (UVProjectModifierData*) md; int i; @@ -376,9 +379,10 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, return dm; } -static DerivedMesh *applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) +static DerivedMesh *applyModifier(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *result; UVProjectModifierData *umd = (UVProjectModifierData*) md; @@ -388,9 +392,9 @@ static DerivedMesh *applyModifier( return result; } -static DerivedMesh *applyModifierEM( - ModifierData *md, Object *ob, struct EditMesh *editData, - DerivedMesh *derivedData) +static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob, + struct EditMesh *UNUSED(editData), + DerivedMesh *derivedData) { return applyModifier(md, ob, derivedData, 0, 1); } diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index 42cbddce233..acd8c29a6dd 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -36,6 +36,7 @@ #include "DNA_scene_types.h" #include "DNA_object_types.h" +#include "BKE_utildefines.h" #include "BKE_DerivedMesh.h" #include "BKE_object.h" #include "BKE_deform.h" @@ -93,7 +94,7 @@ static void copyData(ModifierData *md, ModifierData *target) strncpy(twmd->defgrp_name, wmd->defgrp_name, 32); } -static int dependsOnTime(ModifierData *md) +static int dependsOnTime(ModifierData *UNUSED(md)) { return 1; } @@ -118,9 +119,10 @@ static void foreachIDLink(ModifierData *md, Object *ob, foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData); } -static void updateDepgraph( - ModifierData *md, DagForest *forest, Scene *scene, Object *ob, - DagNode *obNode) +static void updateDepgraph(ModifierData *md, DagForest *forest, + Scene *UNUSED(scene), + Object *UNUSED(ob), + DagNode *obNode) { WaveModifierData *wmd = (WaveModifierData*) md; @@ -139,7 +141,7 @@ static void updateDepgraph( } } -static CustomDataMask requiredDataMask(Object *ob, ModifierData *md) +static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) { WaveModifierData *wmd = (WaveModifierData *)md; CustomDataMask dataMask = 0; @@ -399,17 +401,20 @@ static void waveModifier_do(WaveModifierData *md, if(wmd->texture) MEM_freeN(tex_co); } -static void deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +static void deformVerts(ModifierData *md, Object *ob, + DerivedMesh *derivedData, + float (*vertexCos)[3], + int numVerts, + int UNUSED(useRenderParams), + int UNUSED(isFinalCalc)) { DerivedMesh *dm= derivedData; WaveModifierData *wmd = (WaveModifierData *)md; if(wmd->flag & MOD_WAVE_NORM) - dm= get_cddm(md->scene, ob, NULL, dm, vertexCos); + dm= get_cddm(ob, NULL, dm, vertexCos); else if(wmd->texture || wmd->defgrp_name[0]) - dm= get_dm(md->scene, ob, NULL, dm, NULL, 0); + dm= get_dm(ob, NULL, dm, NULL, 0); waveModifier_do(wmd, md->scene, ob, dm, vertexCos, numVerts); @@ -425,9 +430,9 @@ static void deformVertsEM( WaveModifierData *wmd = (WaveModifierData *)md; if(wmd->flag & MOD_WAVE_NORM) - dm= get_cddm(md->scene, ob, editData, dm, vertexCos); + dm= get_cddm(ob, editData, dm, vertexCos); else if(wmd->texture || wmd->defgrp_name[0]) - dm= get_dm(md->scene, ob, editData, dm, NULL, 0); + dm= get_dm(ob, editData, dm, NULL, 0); waveModifier_do(wmd, md->scene, ob, dm, vertexCos, numVerts); diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 076d6355585..0a2ea54c5b0 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -178,7 +178,7 @@ static int read_voxeldata_header(FILE *fp, struct VoxelData *vd) return 1; } -static void init_frame_smoke(VoxelData *vd, Tex *tex) +static void init_frame_smoke(VoxelData *vd) { Object *ob; ModifierData *md; @@ -282,7 +282,7 @@ static void cache_voxeldata(struct Render *re,Tex *tex) load_frame_image_sequence(vd, tex); return; case TEX_VD_SMOKE: - init_frame_smoke(vd, tex); + init_frame_smoke(vd); return; case TEX_VD_BLENDERVOXEL: if (!BLI_exists(vd->source_path)) return; -- cgit v1.2.3 From 3d73a37b64774ce246c0151f952b83a6fc78f2ac Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2010 08:15:10 +0000 Subject: hex color input wasnt clamped. --- source/blender/blenlib/intern/math_color.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 09a6b5992db..c481744156a 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -177,13 +177,16 @@ void ycc_to_rgb(float y, float cb, float cr, float *lr, float *lg, float *lb, in void hex_to_rgb(char *hexcol, float *r, float *g, float *b) { unsigned int ri, gi, bi; - + if (hexcol[0] == '#') hexcol++; - - if (sscanf(hexcol, "%02x%02x%02x", &ri, &gi, &bi)) { + + if (sscanf(hexcol, "%02x%02x%02x", &ri, &gi, &bi)==3) { *r = ri / 255.0f; *g = gi / 255.0f; *b = bi / 255.0f; + CLAMP(*r, 0.0f, 1.0f); + CLAMP(*g, 0.0f, 1.0f); + CLAMP(*b, 0.0f, 1.0f); } } -- cgit v1.2.3 From d3bf6b7224d63420232464381203d51125dd3374 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Thu, 14 Oct 2010 09:01:03 +0000 Subject: Fix for [#24237] Hair dynamics with zero particles generates a segmentation fault --- source/blender/blenkernel/intern/particle.c | 1 + source/blender/blenkernel/intern/particle_system.c | 7 ++++++- source/blender/blenkernel/intern/pointcache.c | 14 +++++++++----- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 723ff7faed3..ebbb3ea1020 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -402,6 +402,7 @@ void free_hair(Object *ob, ParticleSystem *psys, int dynamics) modifier_free((ModifierData*)psys->clmd); psys->clmd = NULL; + psys->pointcache = BKE_ptcache_add(&psys->ptcaches); } else { cloth_free_modifier(ob, psys->clmd); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 47a220dcefb..fa82d2c5359 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4016,8 +4016,13 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys) switch(part->type) { case PART_HAIR: { + /* nothing to do so bail out early */ + if(psys->totpart == 0 && part->totpart == 0) { + psys_free_path_cache(psys, NULL); + free_hair(ob, psys, 0); + } /* (re-)create hair */ - if(hair_needs_recalc(psys)) { + else if(hair_needs_recalc(psys)) { float hcfra=0.0f; int i, recalc = psys->recalc; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index a15e66ed843..f9d2c1c3fec 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2993,13 +2993,17 @@ void BKE_ptcache_update_info(PTCacheID *pid) void BKE_ptcache_validate(PointCache *cache, int framenr) { - cache->flag |= PTCACHE_SIMULATION_VALID; - cache->simframe = framenr; + if(cache) { + cache->flag |= PTCACHE_SIMULATION_VALID; + cache->simframe = framenr; + } } void BKE_ptcache_invalidate(PointCache *cache) { - cache->flag &= ~PTCACHE_SIMULATION_VALID; - cache->simframe = 0; - cache->last_exact = MIN2(cache->startframe, 0); + if(cache) { + cache->flag &= ~PTCACHE_SIMULATION_VALID; + cache->simframe = 0; + cache->last_exact = MIN2(cache->startframe, 0); + } } -- cgit v1.2.3 From 3488b5dd6fae79788b916dba2ffb3d3157f7af8e Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 14 Oct 2010 09:24:25 +0000 Subject: Update outliner when vertex group was added/removed --- source/blender/editors/space_outliner/space_outliner.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender') diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 5667ae51ee4..cb51b609a31 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -163,6 +163,14 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn) case NC_TEXTURE: ED_region_tag_redraw(ar); break; + case NC_GEOM: + switch(wmn->data) { + case ND_DATA: + /* needed for vertex groups only, no special notifier atm so use NC_GEOM|ND_DATA */ + ED_region_tag_redraw(ar); + break; + } + break; } } -- cgit v1.2.3 From 380929624ca1d3d48de6e93ba321742bced3ee12 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Thu, 14 Oct 2010 09:31:14 +0000 Subject: Move MAXFLOAT to BLI_math_base.h --- source/blender/blenlib/BLI_math_base.h | 5 +++++ source/blender/editors/include/ED_types.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index 48ad46282c2..77266e2e9d8 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -70,6 +70,11 @@ extern "C" { #define M_LN10 2.30258509299404568402 #endif +/* non-standard defines, used in some places */ +#ifndef MAXFLOAT +#define MAXFLOAT ((float)3.40282347e+38) +#endif + #ifndef sqrtf #define sqrtf(a) ((float)sqrt(a)) #endif diff --git a/source/blender/editors/include/ED_types.h b/source/blender/editors/include/ED_types.h index 96a5d5857fa..1887a97e635 100644 --- a/source/blender/editors/include/ED_types.h +++ b/source/blender/editors/include/ED_types.h @@ -35,11 +35,6 @@ #define SELECT 1 #define ACTIVE 2 -/* nonstandard define, sometimes in math.h */ -#ifndef MAXFLOAT -#define MAXFLOAT ((float)3.40282347e+38) -#endif - /* buttons */ #define XIC 20 #define YIC 20 -- cgit v1.2.3 From 097a926d943c3b482305c295c60eaff7a85600d8 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Thu, 14 Oct 2010 09:40:56 +0000 Subject: Fix [#24201] COLLADA Exporter: Light source energy incorrect lamp->energy and lamp->distance are now taken in account by calculating the constant, linear and quadratic attenuations based on this. The import tries to do the reverse. Note: this will work only properly for lamps that have att1 and att2 set to 1.0 or 0.0, other lamptypes won't import correctly again. --- source/blender/collada/DocumentImporter.cpp | 47 ++++++++++++++++++++++++----- source/blender/collada/LightExporter.cpp | 47 ++++++++++++++++++++++++----- 2 files changed, 79 insertions(+), 15 deletions(-) (limited to 'source/blender') diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index a406845c8a2..25787e18b06 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -29,9 +29,6 @@ #include #include // sort() -#include -#include - #include "COLLADAFWRoot.h" #include "COLLADAFWIWriter.h" #include "COLLADAFWStableHeaders.h" @@ -67,6 +64,7 @@ #include "BKE_image.h" #include "BLI_listbase.h" +#include "BLI_math.h" #include "BLI_string.h" #include "DNA_camera_types.h" @@ -841,6 +839,38 @@ public: lamp->g = col.getGreen(); lamp->b = col.getBlue(); } + float constatt = light->getConstantAttenuation().getValue(); + float linatt = light->getLinearAttenuation().getValue(); + float quadatt = light->getQuadraticAttenuation().getValue(); + float d = 25.0f; + float att1 = 0.0f; + float att2 = 0.0f; + + float e = 1.0f/constatt; + + /* NOTE: We assume for now that inv square is used for quadratic light + * and inv linear for linear light. Exported blender lin/quad weighted + * most likely will result in wrong import. */ + /* quadratic light */ + if(IS_EQ(linatt, 0.0f) && quadatt > 0.0f) { + //quadatt = att2/(d*d*(e*2)); + float invquadatt = 1.0f/quadatt; + float d2 = invquadatt / (2 * e); + d = sqrtf(d2); + } + // linear light + else if(IS_EQ(quadatt, 0.0f) && linatt > 0.0f) { + //linatt = att1/(d*e); + float invlinatt = 1.0f/linatt; + d = invlinatt / e; + } else { + printf("no linear nor quad light, using defaults for attenuation, import will be incorrect: Lamp %s\n", lamp->id.name); + att2 = 1.0f; + } + + lamp->dist = d; + lamp->energy = e; + COLLADAFW::Light::LightType type = light->getLightType(); switch(type) { case COLLADAFW::Light::AMBIENT_LIGHT: @@ -851,9 +881,9 @@ public: case COLLADAFW::Light::SPOT_LIGHT: { lamp->type = LA_SPOT; - lamp->falloff_type = LA_FALLOFF_SLIDERS; - lamp->att1 = light->getLinearAttenuation().getValue(); - lamp->att2 = light->getQuadraticAttenuation().getValue(); + lamp->falloff_type = LA_FALLOFF_INVSQUARE; + lamp->att1 = att1; + lamp->att2 = att2; lamp->spotsize = light->getFallOffAngle().getValue(); lamp->spotblend = light->getFallOffExponent().getValue(); } @@ -866,8 +896,9 @@ public: case COLLADAFW::Light::POINT_LIGHT: { lamp->type = LA_LOCAL; - lamp->att1 = light->getLinearAttenuation().getValue(); - lamp->att2 = light->getQuadraticAttenuation().getValue(); + lamp->falloff_type = LA_FALLOFF_INVSQUARE; + lamp->att1 = att1; + lamp->att2 = att2; } break; case COLLADAFW::Light::UNDEFINED: diff --git a/source/blender/collada/LightExporter.cpp b/source/blender/collada/LightExporter.cpp index 7327b309889..5786c682d6a 100644 --- a/source/blender/collada/LightExporter.cpp +++ b/source/blender/collada/LightExporter.cpp @@ -30,6 +30,8 @@ #include "DNA_lamp_types.h" +#include "BLI_math.h" + #include "LightExporter.h" #include "collada_internal.h" @@ -48,6 +50,7 @@ void forEachLampObjectInScene(Scene *sce, Functor &f) } LightsExporter::LightsExporter(COLLADASW::StreamWriter *sw): COLLADASW::LibraryLights(sw){} + void LightsExporter::exportLights(Scene *sce) { openLibrary(); @@ -62,18 +65,45 @@ void LightsExporter::operator()(Object *ob) std::string la_id(get_light_id(ob)); std::string la_name(id_name(la)); COLLADASW::Color col(la->r, la->g, la->b); - float e = la->energy; + float att1, att2; + float e, d, constatt, linatt, quadatt; + att1 = att2 = 0.0f; + + if(la->falloff_type==LA_FALLOFF_INVLINEAR) { + att1 = 1.0f; + att2 = 0.0f; + } + else if(la->falloff_type==LA_FALLOFF_INVSQUARE) { + att1 = 0.0f; + att2 = 1.0f; + } + else if(la->falloff_type==LA_FALLOFF_SLIDERS) { + att1 = la->att1; + att2 = la->att2; + } + + e = la->energy; + d = la->dist; + + constatt = linatt = quadatt = MAXFLOAT; + if(e > 0.0f) { + constatt = 1.0f/e; + linatt = att1/(d*e); + quadatt = att2/(d*d*(e*2)); + } // sun if (la->type == LA_SUN) { COLLADASW::DirectionalLight cla(mSW, la_id, la_name, e); cla.setColor(col); + cla.setConstantAttenuation(constatt); addLight(cla); } // hemi else if (la->type == LA_HEMI) { COLLADASW::AmbientLight cla(mSW, la_id, la_name, e); cla.setColor(col); + cla.setConstantAttenuation(constatt); addLight(cla); } // spot @@ -82,16 +112,18 @@ void LightsExporter::operator()(Object *ob) cla.setColor(col); cla.setFallOffAngle(la->spotsize); cla.setFallOffExponent(la->spotblend); - cla.setLinearAttenuation(la->att1); - cla.setQuadraticAttenuation(la->att2); + cla.setConstantAttenuation(constatt); + cla.setLinearAttenuation(linatt); + cla.setQuadraticAttenuation(quadatt); addLight(cla); } // lamp else if (la->type == LA_LOCAL) { COLLADASW::PointLight cla(mSW, la_id, la_name, e); cla.setColor(col); - cla.setLinearAttenuation(la->att1); - cla.setQuadraticAttenuation(la->att2); + cla.setConstantAttenuation(constatt); + cla.setLinearAttenuation(linatt); + cla.setQuadraticAttenuation(quadatt); addLight(cla); } // area lamp is not supported @@ -99,8 +131,9 @@ void LightsExporter::operator()(Object *ob) else { COLLADASW::PointLight cla(mSW, la_id, la_name, e); cla.setColor(col); - cla.setLinearAttenuation(la->att1); - cla.setQuadraticAttenuation(la->att2); + cla.setConstantAttenuation(constatt); + cla.setLinearAttenuation(linatt); + cla.setQuadraticAttenuation(quadatt); addLight(cla); } } -- cgit v1.2.3 From 6e2e7c00c1ca2f5053ef989b4d1564c4a1b24e6f Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Thu, 14 Oct 2010 10:34:04 +0000 Subject: fix potential crasher: malloc->calloc --- source/blender/blenkernel/intern/mesh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 6f1cdefbcad..3e9287dd511 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1221,7 +1221,7 @@ void mesh_set_smooth_flag(Object *meshOb, int enableSmooth) void mesh_calc_normals(MVert *mverts, int numVerts, MFace *mfaces, int numFaces, float **faceNors_r) { float (*tnorms)[3]= MEM_callocN(numVerts*sizeof(*tnorms), "tnorms"); - float *fnors= MEM_mallocN(sizeof(*fnors)*3*numFaces, "meshnormals"); + float *fnors= MEM_callocN(sizeof(*fnors)*3*numFaces, "meshnormals"); int i; for (i=0; i Date: Thu, 14 Oct 2010 11:33:51 +0000 Subject: fix for crash in own recent color picker commit, store the hsv color in block->_hsv, which is only accessed via a function so it can be moved to a better place later. also fix cineon define for scons/cmake. --- source/blender/editors/interface/interface_intern.h | 16 +++++++++------- source/blender/editors/interface/interface_regions.c | 4 +--- source/blender/editors/space_image/CMakeLists.txt | 4 ++++ source/blender/editors/space_image/SConscript | 2 ++ 4 files changed, 16 insertions(+), 10 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index e58095d9c54..91776b41817 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -303,15 +303,16 @@ struct uiBlock { short auto_open; double auto_open_last; - char active; // to keep blocks while drawing and free them afterwards - char tooltipdisabled; // to avoid tooltip after click - short lock; char *lockstr; + + char lock; + char active; // to keep blocks while drawing and free them afterwards + char tooltipdisabled; // to avoid tooltip after click + char endblock; // uiEndBlock done? float xofs, yofs; // offset to parent button int dobounds, mx, my; // for doing delayed int bounds, minbounds; // for doing delayed - int endblock; // uiEndBlock done? rctf safety; // pulldowns, to detect outside, can differ per case how it is created ListBase saferct; // uiSafetyRct list @@ -320,9 +321,10 @@ struct uiBlock { int puphash; // popup menu hash for memory - int color_profile; // color profile for correcting linear colors for display - void *evil_C; // XXX hack for dynamic operator enums + + float _hsv[3]; // XXX, only access via ui_block_hsv_get() + char color_profile; // color profile for correcting linear colors for display }; typedef struct uiSafetyRct { @@ -397,7 +399,7 @@ struct uiPopupBlockHandle { int butretval; int menuretval; float retvalue; - float retvec[8]; + float retvec[4]; }; uiBlock *ui_block_func_COL(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index c2b09750ee9..f6a13dae71c 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1940,9 +1940,7 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu VECCOPY(handle->retvec, but->editvec); - block->handle= handle; /* XXX, only for ui_block_hsv_get */ uiBlockPicker(block, handle->retvec, &but->rnapoin, but->rnaprop); - block->handle= NULL; block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN; uiBoundsBlock(block, 10); @@ -2440,5 +2438,5 @@ void uiPupBlockClose(bContext *C, uiBlock *block) float *ui_block_hsv_get(uiBlock *block) { - return block->handle->retvec+4; + return block->_hsv; } diff --git a/source/blender/editors/space_image/CMakeLists.txt b/source/blender/editors/space_image/CMakeLists.txt index d47f5a9820e..750c4b324d6 100644 --- a/source/blender/editors/space_image/CMakeLists.txt +++ b/source/blender/editors/space_image/CMakeLists.txt @@ -41,6 +41,10 @@ IF(WITH_IMAGE_TIFF) ADD_DEFINITIONS(-DWITH_TIFF) ENDIF(WITH_IMAGE_TIFF) +IF(WITH_IMAGE_CINEON) + ADD_DEFINITIONS(-DWITH_CINEON) +ENDIF(WITH_IMAGE_CINEON) + IF(WITH_LCMS) SET(INC ${INC} ${LCMS_INCLUDE_DIR}) ADD_DEFINITIONS(-DWITH_LCMS) diff --git a/source/blender/editors/space_image/SConscript b/source/blender/editors/space_image/SConscript index c7c31352185..15a7aeb828f 100644 --- a/source/blender/editors/space_image/SConscript +++ b/source/blender/editors/space_image/SConscript @@ -16,6 +16,8 @@ if env['WITH_BF_OPENEXR']: defs.append('WITH_OPENEXR') if env['WITH_BF_TIFF']: defs.append('WITH_TIFF') +if env['WITH_BF_CINEON']: + defs.append('WITH_CINEON') if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -- cgit v1.2.3 From f8d7451c737bb4a2c75cd2112934b7339733f67b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2010 12:24:08 +0000 Subject: remove unused args or tag as unused for image and screen editors, uiItemEnumR_string was ignoring name and icon args. --- source/blender/editors/include/ED_screen.h | 2 +- .../blender/editors/interface/interface_layout.c | 12 ++--- source/blender/editors/interface/interface_panel.c | 2 +- source/blender/editors/interface/view2d.c | 2 +- source/blender/editors/screen/area.c | 14 +++--- source/blender/editors/screen/glutil.c | 3 +- source/blender/editors/screen/screen_edit.c | 16 +++---- source/blender/editors/screen/screen_intern.h | 4 +- source/blender/editors/screen/screen_ops.c | 56 +++++++++++----------- source/blender/editors/screen/screendump.c | 4 +- source/blender/editors/space_image/image_buttons.c | 13 ++--- source/blender/editors/space_image/image_draw.c | 12 ++--- source/blender/editors/space_image/image_header.c | 2 +- source/blender/editors/space_image/image_ops.c | 30 ++++++------ source/blender/editors/space_image/space_image.c | 10 ++-- source/blender/windowmanager/intern/wm_draw.c | 8 ++-- source/blender/windowmanager/intern/wm_files.c | 4 +- 17 files changed, 98 insertions(+), 96 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 7059e607218..62243a0e53e 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -69,7 +69,7 @@ void ED_spacetypes_keymap(struct wmKeyConfig *keyconf); int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco); int ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock *block, int yco); void ED_area_overdraw(struct bContext *C); -void ED_area_overdraw_flush(struct bContext *C, struct ScrArea *sa, struct ARegion *ar); +void ED_area_overdraw_flush(struct ScrArea *sa, struct ARegion *ar); /* areas */ diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 45b38a8c9a9..3db68fd89c0 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -472,7 +472,7 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt } /* callback for keymap item change button */ -static void ui_keymap_but_cb(bContext *C, void *but_v, void *key_v) +static void ui_keymap_but_cb(bContext *UNUSED(C), void *but_v, void *UNUSED(key_v)) { uiBut *but= but_v; @@ -1026,7 +1026,7 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, char *propname for(a=0; item[a].identifier; a++) { if(item[a].value == ivalue) { - uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, (char*)item[a].name, item[a].icon); + uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, name ? name : (char*)item[a].name, icon ? icon : item[a].icon); break; } } @@ -1324,7 +1324,7 @@ static void ui_item_menu(uiLayout *layout, char *name, int icon, uiMenuCreateFun } } -void uiItemM(uiLayout *layout, bContext *C, char *menuname, char *name, int icon) +void uiItemM(uiLayout *layout, bContext *UNUSED(C), char *menuname, char *name, int icon) { MenuType *mt; @@ -1434,7 +1434,7 @@ typedef struct MenuItemLevel { PointerRNA rnapoin; } MenuItemLevel; -static void menu_item_enum_opname_menu(bContext *C, uiLayout *layout, void *arg) +static void menu_item_enum_opname_menu(bContext *UNUSED(C), uiLayout *layout, void *arg) { MenuItemLevel *lvl= (MenuItemLevel*)(((uiBut*)arg)->func_argN); @@ -1465,7 +1465,7 @@ void uiItemMenuEnumO(uiLayout *layout, char *opname, char *propname, char *name, ui_item_menu(layout, name, icon, menu_item_enum_opname_menu, NULL, lvl); } -static void menu_item_enum_rna_menu(bContext *C, uiLayout *layout, void *arg) +static void menu_item_enum_rna_menu(bContext *UNUSED(C), uiLayout *layout, void *arg) { MenuItemLevel *lvl= (MenuItemLevel*)(((uiBut*)arg)->func_argN); @@ -1674,7 +1674,7 @@ static void ui_litem_layout_column(uiLayout *litem) } /* root layout */ -static void ui_litem_estimate_root(uiLayout *litem) +static void ui_litem_estimate_root(uiLayout *UNUSED(litem)) { /* nothing to do */ } diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index ca7065ca636..a7b74900a21 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -772,7 +772,7 @@ static void ui_do_animate(const bContext *C, Panel *panel) } } -void uiBeginPanels(const bContext *C, ARegion *ar) +void uiBeginPanels(const bContext *UNUSED(C), ARegion *ar) { Panel *pa; diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index e0dc702bda0..a17d578fc06 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1097,7 +1097,7 @@ static void step_to_grid(float *step, int *power, int unit) * * - xunits,yunits = V2D_UNIT_* grid steps in seconds or frames * - xclamp,yclamp = V2D_CLAMP_* only show whole-number intervals - * - winx = width of region we're drawing to, note: not used but keeping for compleateness. + * - winx = width of region we're drawing to, note: not used but keeping for completeness. * - winy = height of region we're drawing into */ View2DGrid *UI_view2d_grid_calc(Scene *scene, View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int UNUSED(winx), int winy) diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index e8fd2be324c..ae1388fb7f2 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -144,7 +144,7 @@ void ED_area_do_refresh(bContext *C, ScrArea *sa) /* based on screen region draw tags, set draw tags in azones, and future region tabs etc */ /* only exported for WM */ -void ED_area_overdraw_flush(bContext *C, ScrArea *sa, ARegion *ar) +void ED_area_overdraw_flush(ScrArea *sa, ARegion *ar) { AZone *az; @@ -187,7 +187,7 @@ static void area_draw_azone(short x1, short y1, short x2, short y2) } -static void region_draw_azone(ScrArea *sa, AZone *az) +static void region_draw_azone(AZone *az) { GLUquadricObj *qobj = NULL; short midx = az->x1 + (az->x2 - az->x1)/2; @@ -247,7 +247,7 @@ void ED_area_overdraw(bContext *C) if(az->type==AZONE_AREA) { area_draw_azone(az->x1, az->y1, az->x2, az->y2); } else if(az->type==AZONE_REGION) { - region_draw_azone(sa, az); + region_draw_azone(az); } az->do_draw= 0; @@ -817,7 +817,7 @@ static void area_calc_totrct(ScrArea *sa, int sizex, int sizey) /* used for area initialize below */ -static void region_subwindow(wmWindowManager *wm, wmWindow *win, ARegion *ar) +static void region_subwindow(wmWindow *win, ARegion *ar) { if(ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) { if(ar->swinid) @@ -908,7 +908,7 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa) /* region windows, default and own handlers */ for(ar= sa->regionbase.first; ar; ar= ar->next) { - region_subwindow(wm, win, ar); + region_subwindow(win, ar); if(ar->swinid) { /* default region handlers */ @@ -931,7 +931,7 @@ void ED_region_init(bContext *C, ARegion *ar) // ARegionType *at= ar->type; /* refresh can be called before window opened */ - region_subwindow(CTX_wm_manager(C), CTX_wm_window(C), ar); + region_subwindow(CTX_wm_window(C), ar); ar->winx= ar->winrct.xmax - ar->winrct.xmin + 1; ar->winy= ar->winrct.ymax - ar->winrct.ymin + 1; @@ -1156,7 +1156,7 @@ static char *editortype_pup(void) ); } -static void spacefunc(struct bContext *C, void *arg1, void *arg2) +static void spacefunc(struct bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) { ED_area_newspace(C, CTX_wm_area(C), CTX_wm_area(C)->butspacetype); ED_area_tag_redraw(CTX_wm_area(C)); diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 06da91c3e37..a6c4c77e468 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -527,7 +527,8 @@ void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, void * glaDrawPixelsTexScaled(x, y, img_w, img_h, format, rect, 1.0f, 1.0f); } -void glaDrawPixelsSafe_to32(float fx, float fy, int img_w, int img_h, int row_w, float *rectf, int gamma_correct) +/* row_w is unused but kept for completeness */ +void glaDrawPixelsSafe_to32(float fx, float fy, int img_w, int img_h, int UNUSED(row_w), float *rectf, int gamma_correct) { unsigned char *rect32; diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 32e82571609..138ce19951d 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -309,7 +309,7 @@ static void screen_delarea(bContext *C, bScreen *sc, ScrArea *sa) /* return 0: no split possible */ /* else return (integer) screencoordinate split point */ -static short testsplitpoint(wmWindow *win, ScrArea *sa, char dir, float fac) +static short testsplitpoint(ScrArea *sa, char dir, float fac) { short x, y; @@ -345,7 +345,7 @@ static short testsplitpoint(wmWindow *win, ScrArea *sa, char dir, float fac) } } -ScrArea *area_split(wmWindow *win, bScreen *sc, ScrArea *sa, char dir, float fac) +ScrArea *area_split(bScreen *sc, ScrArea *sa, char dir, float fac) { ScrArea *newa=NULL; ScrVert *sv1, *sv2; @@ -353,7 +353,7 @@ ScrArea *area_split(wmWindow *win, bScreen *sc, ScrArea *sa, char dir, float fac if(sa==NULL) return NULL; - split= testsplitpoint(win, sa, dir, fac); + split= testsplitpoint(sa, dir, fac); if(split==0) return NULL; if(dir=='h') { @@ -484,7 +484,7 @@ static void screen_copy(bScreen *to, bScreen *from) /* with sa as center, sb is located at: 0=W, 1=N, 2=E, 3=S */ /* -1 = not valid check */ /* used with join operator */ -int area_getorientation(bScreen *screen, ScrArea *sa, ScrArea *sb) +int area_getorientation(ScrArea *sa, ScrArea *sb) { ScrVert *sav1, *sav2, *sav3, *sav4; ScrVert *sbv1, *sbv2, *sbv3, *sbv4; @@ -523,7 +523,7 @@ int screen_area_join(bContext *C, bScreen* scr, ScrArea *sa1, ScrArea *sa2) { int dir; - dir = area_getorientation(scr, sa1, sa2); + dir = area_getorientation(sa1, sa2); /*printf("dir is : %i \n", dir);*/ if (dir < 0) @@ -861,7 +861,7 @@ static void scrarea_draw_shape_dark(ScrArea *sa, char dir) } /* draw screen area ligher with arrow shape ("eraser" of previous dark shape) */ -static void scrarea_draw_shape_light(ScrArea *sa, char dir) +static void scrarea_draw_shape_light(ScrArea *sa, char UNUSED(dir)) { glBlendFunc(GL_DST_COLOR, GL_SRC_ALPHA); glEnable(GL_BLEND); @@ -993,7 +993,7 @@ void ED_screen_draw(wmWindow *win) /* blended join arrow */ if (sa1 && sa2) { - dir = area_getorientation(win->screen, sa1, sa2); + dir = area_getorientation(sa1, sa2); if (dir >= 0) { switch(dir) { case 0: /* W */ @@ -1613,7 +1613,7 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa) oldscreen->animtimer= NULL; /* returns the top small area */ - newa= area_split(win, sc, (ScrArea *)sc->areabase.first, 'h', 0.99f); + newa= area_split(sc, (ScrArea *)sc->areabase.first, 'h', 0.99f); ED_area_newspace(C, newa, SPACE_INFO); /* use random area when we have no active one, e.g. when the diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h index 79789b1876e..b20daf9a0c8 100644 --- a/source/blender/editors/screen/screen_intern.h +++ b/source/blender/editors/screen/screen_intern.h @@ -37,9 +37,9 @@ void area_copy_data (ScrArea *sa1, ScrArea *sa2, int swap_space); /* screen_edit.c */ ScrEdge *screen_findedge(bScreen *sc, ScrVert *v1, ScrVert *v2); -ScrArea *area_split(wmWindow *win, bScreen *sc, ScrArea *sa, char dir, float fac); +ScrArea *area_split(bScreen *sc, ScrArea *sa, char dir, float fac); int screen_area_join(bContext *C, bScreen* scr, ScrArea *sa1, ScrArea *sa2); -int area_getorientation(bScreen *screen, ScrArea *sa, ScrArea *sb); +int area_getorientation(ScrArea *sa, ScrArea *sb); void select_connected_scredge(bScreen *sc, ScrEdge *edge); void removenotused_scrverts(bScreen *sc); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 6d4aa3ebe64..9ae16b1bfa6 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -265,7 +265,7 @@ int ED_operator_posemode(bContext *C) if ((obact != CTX_data_edit_object(C))) { Object *obpose; - if(obpose= ED_object_pose_armature(obact)) { + if((obpose= ED_object_pose_armature(obact))) { if((obact == obpose) || (obact->mode & OB_MODE_WEIGHT_PAINT)) { return 1; } @@ -443,7 +443,7 @@ AZone *is_in_area_actionzone(ScrArea *sa, int x, int y) } -static void actionzone_exit(bContext *C, wmOperator *op) +static void actionzone_exit(wmOperator *op) { if(op->customdata) MEM_freeN(op->customdata); @@ -489,7 +489,7 @@ static int actionzone_invoke(bContext *C, wmOperator *op, wmEvent *event) /* region azone directly reacts on mouse clicks */ if(sad->az->type==AZONE_REGION) { actionzone_apply(C, op, AZONE_REGION); - actionzone_exit(C, op); + actionzone_exit(op); return OPERATOR_FINISHED; } else { @@ -529,16 +529,16 @@ static int actionzone_modal(bContext *C, wmOperator *op, wmEvent *event) sad->sa2= screen_areahascursor(CTX_wm_screen(C), event->x, event->y); /* apply sends event */ actionzone_apply(C, op, sad->az->type); - actionzone_exit(C, op); + actionzone_exit(op); return OPERATOR_FINISHED; } break; case ESCKEY: - actionzone_exit(C, op); + actionzone_exit(op); return OPERATOR_CANCELLED; case LEFTMOUSE: - actionzone_exit(C, op); + actionzone_exit(op); return OPERATOR_CANCELLED; } @@ -589,7 +589,7 @@ typedef struct sAreaSwapData { ScrArea *sa1, *sa2; } sAreaSwapData; -static int area_swap_init(bContext *C, wmOperator *op, wmEvent *event) +static int area_swap_init(wmOperator *op, wmEvent *event) { sAreaSwapData *sd= NULL; sActionzoneData *sad= event->customdata; @@ -623,7 +623,7 @@ static int area_swap_cancel(bContext *C, wmOperator *op) static int area_swap_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(!area_swap_init(C, op, event)) + if(!area_swap_init(op, event)) return OPERATOR_PASS_THROUGH; /* add modal handler */ @@ -709,7 +709,7 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, wmEvent *event) /* poll() checks area context, but we don't accept full-area windows */ if(sc->full != SCREENNORMAL) { if(event->type==EVT_ACTIONZONE_AREA) - actionzone_exit(C, op); + actionzone_exit(op); return OPERATOR_CANCELLED; } @@ -731,7 +731,7 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, wmEvent *event) WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); if(event->type==EVT_ACTIONZONE_AREA) - actionzone_exit(C, op); + actionzone_exit(op); return OPERATOR_FINISHED; } @@ -1125,7 +1125,7 @@ static int area_split_apply(bContext *C, wmOperator *op) fac= RNA_float_get(op->ptr, "factor"); dir= RNA_enum_get(op->ptr, "direction"); - sd->narea= area_split(CTX_wm_window(C), sc, sd->sarea, dir, fac); + sd->narea= area_split(sc, sd->sarea, dir, fac); if(sd->narea) { ScrVert *sv; @@ -1741,7 +1741,7 @@ static void SCREEN_OT_screen_set(wmOperatorType *ot) /* function to be called outside UI context, or for redo */ -static int screen_full_area_exec(bContext *C, wmOperator *op) +static int screen_full_area_exec(bContext *C, wmOperator *UNUSED(op)) { ED_screen_full_toggle(C, CTX_wm_window(C), CTX_wm_area(C)); return OPERATOR_FINISHED; @@ -1948,7 +1948,7 @@ static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event) if (sa) { if (jd->sa1 != sa) { - dir = area_getorientation(sc, jd->sa1, sa); + dir = area_getorientation(jd->sa1, sa); if (dir >= 0) { if (jd->sa2) jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO; jd->sa2 = sa; @@ -1959,7 +1959,7 @@ static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event) we check if area has common border with the one marked for removal in this case we can swap areas. */ - dir = area_getorientation(sc, sa, jd->sa2); + dir = area_getorientation(sa, jd->sa2); if (dir >= 0) { if (jd->sa1) jd->sa1->flag &= ~AREA_FLAG_DRAWJOINFROM; if (jd->sa2) jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO; @@ -1985,13 +1985,13 @@ static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event) jd->sa2 = sa; if (jd->sa1) jd->sa1->flag |= AREA_FLAG_DRAWJOINFROM; if (jd->sa2) jd->sa2->flag |= AREA_FLAG_DRAWJOINTO; - dir = area_getorientation(sc, jd->sa1, jd->sa2); + dir = area_getorientation(jd->sa1, jd->sa2); if (dir < 0) { printf("oops, didn't expect that!\n"); } } else { - dir = area_getorientation(sc, jd->sa1, sa); + dir = area_getorientation(jd->sa1, sa); if (dir >= 0) { if (jd->sa2) jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO; jd->sa2 = sa; @@ -2048,7 +2048,7 @@ static void SCREEN_OT_area_join(wmOperatorType *ot) /* ************** repeat last operator ***************************** */ -static int repeat_last_exec(bContext *C, wmOperator *op) +static int repeat_last_exec(bContext *C, wmOperator *UNUSED(op)) { wmOperator *lastop= CTX_wm_manager(C)->operators.last; @@ -2072,7 +2072,7 @@ static void SCREEN_OT_repeat_last(wmOperatorType *ot) } -static int repeat_history_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int repeat_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { wmWindowManager *wm= CTX_wm_manager(C); wmOperator *lastop; @@ -2129,7 +2129,7 @@ static void SCREEN_OT_repeat_history(wmOperatorType *ot) /* ********************** redo operator ***************************** */ -static int redo_last_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int redo_last_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { wmWindowManager *wm= CTX_wm_manager(C); wmOperator *lastop; @@ -2257,7 +2257,7 @@ static void SCREEN_OT_region_quadview(wmOperatorType *ot) /* ************** region flip operator ***************************** */ /* flip a region alignment */ -static int region_flip_exec(bContext *C, wmOperator *op) +static int region_flip_exec(bContext *C, wmOperator *UNUSED(op)) { ARegion *ar= CTX_wm_region(C); @@ -2295,7 +2295,7 @@ static void SCREEN_OT_region_flip(wmOperatorType *ot) /* ************** header flip operator ***************************** */ /* flip a header region alignment */ -static int header_flip_exec(bContext *C, wmOperator *op) +static int header_flip_exec(bContext *C, wmOperator *UNUSED(op)) { ARegion *ar= CTX_wm_region(C); @@ -2349,7 +2349,7 @@ static void SCREEN_OT_header_flip(wmOperatorType *ot) /* ************** header tools operator ***************************** */ -static int header_toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int header_toolbox_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= CTX_wm_region(C); @@ -2463,7 +2463,7 @@ static int match_region_with_redraws(int spacetype, int regiontype, int redraws) return 0; } -static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event) +static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { bScreen *screen= CTX_wm_screen(C); @@ -2672,7 +2672,7 @@ static void SCREEN_OT_animation_play(wmOperatorType *ot) RNA_def_boolean(ot->srna, "sync", 0, "Sync", "Drop frames to maintain framerate"); } -static int screen_animation_cancel_exec(bContext *C, wmOperator *op) +static int screen_animation_cancel_exec(bContext *C, wmOperator *UNUSED(op)) { bScreen *screen= CTX_wm_screen(C); @@ -2800,7 +2800,7 @@ static void SCREEN_OT_back_to_previous(struct wmOperatorType *ot) /* *********** show user pref window ****** */ -static int userpref_show_invoke(bContext *C, wmOperator *unused, wmEvent *event) +static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { ScrArea *sa; rcti rect; @@ -2839,7 +2839,7 @@ static void SCREEN_OT_userpref_show(struct wmOperatorType *ot) /********************* new screen operator *********************/ -static int screen_new_exec(bContext *C, wmOperator *op) +static int screen_new_exec(bContext *C, wmOperator *UNUSED(op)) { wmWindow *win= CTX_wm_window(C); bScreen *sc= CTX_wm_screen(C); @@ -2866,7 +2866,7 @@ void SCREEN_OT_new(wmOperatorType *ot) /********************* delete screen operator *********************/ -static int screen_delete_exec(bContext *C, wmOperator *op) +static int screen_delete_exec(bContext *C, wmOperator *UNUSED(op)) { bScreen *sc= CTX_wm_screen(C); @@ -2937,7 +2937,7 @@ void SCENE_OT_new(wmOperatorType *ot) /********************* delete scene operator *********************/ -static int scene_delete_exec(bContext *C, wmOperator *op) +static int scene_delete_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 56efa0a5a83..f1e11430573 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -132,7 +132,7 @@ static unsigned int *screenshot(bContext *C, int *dumpsx, int *dumpsy, int fscre } -static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { unsigned int *dumprect; int dumpsx, dumpsy; @@ -214,7 +214,7 @@ static void screenshot_updatejob(void *sjv) /* only this runs inside thread */ -static void screenshot_startjob(void *sjv, short *stop, short *do_update, float *progress) +static void screenshot_startjob(void *sjv, short *stop, short *do_update, float *UNUSED(progress)) { ScreenshotJob *sj= sjv; RenderData rd= sj->scene->r; diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 840d4943c56..353d741fe27 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -97,7 +97,7 @@ static void image_editvertex_buts(const bContext *C, uiBlock *block); -static void do_image_panel_events(bContext *C, void *arg, int event) +static void do_image_panel_events(bContext *C, void *UNUSED(arg), int event) { SpaceImage *sima= CTX_wm_space_image(C); @@ -300,7 +300,7 @@ static void image_editvertex_buts(const bContext *C, uiBlock *block) /* is used for both read and write... */ -static int image_panel_poll(const bContext *C, PanelType *pt) +static int image_panel_poll(const bContext *C, PanelType *UNUSED(pt)) { SpaceImage *sima= CTX_wm_space_image(C); ImBuf *ibuf; @@ -493,6 +493,7 @@ static char *slot_menu() return str; } +/* TODO, curlay should be removed? */ static char *layer_menu(RenderResult *rr, short *curlay) { RenderLayer *rl; @@ -739,7 +740,7 @@ typedef struct RNAUpdateCb { ImageUser *iuser; } RNAUpdateCb; -static void rna_update_cb(bContext *C, void *arg_cb, void *arg_unused) +static void rna_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg)) { RNAUpdateCb *cb= (RNAUpdateCb*)arg_cb; @@ -951,7 +952,7 @@ void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser } } -static int image_panel_uv_poll(const bContext *C, PanelType *pt) +static int image_panel_uv_poll(const bContext *C, PanelType *UNUSED(pt)) { Object *obedit= CTX_data_edit_object(C); return ED_uvedit_test(obedit); @@ -996,7 +997,7 @@ void image_buttons_register(ARegionType *art) BLI_addtail(&art->paneltypes, pt); } -static int image_properties(bContext *C, wmOperator *op) +static int image_properties(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= image_has_buttons_region(sa); @@ -1019,7 +1020,7 @@ void IMAGE_OT_properties(wmOperatorType *ot) ot->flag= 0; } -static int image_scopes(bContext *C, wmOperator *op) +static int image_scopes(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= image_has_scope_region(sa); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index f29d1bc033f..48524d2728f 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -70,7 +70,7 @@ #define HEADER_HEIGHT 18 -static void image_verify_buffer_float(SpaceImage *sima, Image *ima, ImBuf *ibuf, int color_manage) +static void image_verify_buffer_float(Image *ima, ImBuf *ibuf, int color_manage) { /* detect if we need to redo the curve map. ibuf->rect is zero for compositor and render results after change @@ -367,7 +367,7 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image } #ifdef WITH_LCMS else if(sima->flag & SI_COLOR_CORRECTION) { - image_verify_buffer_float(sima, ima, ibuf, color_manage); + image_verify_buffer_float(ima, ibuf, color_manage); if(sima_draw_colorcorrected_pixels(x, y, ibuf)==0) { unsigned char col1[3]= {100, 0, 100}, col2[3]= {160, 0, 160}; /* pink says 'warning' in blender land */ @@ -387,7 +387,7 @@ static void draw_image_buffer(SpaceImage *sima, ARegion *ar, Scene *scene, Image /* we don't draw floats buffers directly but * convert them, and optionally apply curves */ - image_verify_buffer_float(sima, ima, ibuf, color_manage); + image_verify_buffer_float(ima, ibuf, color_manage); if(ibuf->rect) glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); @@ -440,7 +440,7 @@ static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Scene *scene, sima->curtile = ima->xrep*ima->yrep - 1; /* create char buffer from float if needed */ - image_verify_buffer_float(sima, ima, ibuf, color_manage); + image_verify_buffer_float(ima, ibuf, color_manage); /* retrieve part of image buffer */ dx= ibuf->x/ima->xrep; @@ -579,7 +579,7 @@ static unsigned char *get_alpha_clone_image(Scene *scene, int *width, int *heigh return rect; } -static void draw_image_paint_helpers(SpaceImage *sima, ARegion *ar, Scene *scene, float zoomx, float zoomy) +static void draw_image_paint_helpers(ARegion *ar, Scene *scene, float zoomx, float zoomy) { Brush *brush; int x, y, w, h; @@ -658,7 +658,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) draw_image_buffer(sima, ar, scene, ima, ibuf, 0.0f, 0.0f, zoomx, zoomy); /* paint helpers */ - draw_image_paint_helpers(sima, ar, scene, zoomx, zoomy); + draw_image_paint_helpers(ar, scene, zoomx, zoomy); /* XXX integrate this code */ diff --git a/source/blender/editors/space_image/image_header.c b/source/blender/editors/space_image/image_header.c index 7ecb2565e72..498b3b80bd5 100644 --- a/source/blender/editors/space_image/image_header.c +++ b/source/blender/editors/space_image/image_header.c @@ -53,7 +53,7 @@ /********************** toolbox operator *********************/ -static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int toolbox_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { SpaceImage *sima= CTX_wm_space_image(C); Object *obedit= CTX_data_edit_object(C); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 0bcc2439756..3e33fef6904 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -432,7 +432,7 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot) * Default behavior is to reset the position of the image and set the zoom to 1 * If the image will not fit within the window rectangle, the zoom is adjusted */ -static int view_all_exec(bContext *C, wmOperator *op) +static int view_all_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceImage *sima; ARegion *ar; @@ -486,7 +486,7 @@ void IMAGE_OT_view_all(wmOperatorType *ot) /********************** view selected operator *********************/ -static int view_selected_exec(bContext *C, wmOperator *op) +static int view_selected_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceImage *sima; ARegion *ar; @@ -543,7 +543,7 @@ void IMAGE_OT_view_selected(wmOperatorType *ot) /********************** view zoom in/out operator *********************/ -static int view_zoom_in_exec(bContext *C, wmOperator *op) +static int view_zoom_in_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceImage *sima= CTX_wm_space_image(C); ARegion *ar= CTX_wm_region(C); @@ -566,7 +566,7 @@ void IMAGE_OT_view_zoom_in(wmOperatorType *ot) ot->poll= space_image_main_area_poll; } -static int view_zoom_out_exec(bContext *C, wmOperator *op) +static int view_zoom_out_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceImage *sima= CTX_wm_space_image(C); ARegion *ar= CTX_wm_region(C); @@ -679,7 +679,7 @@ static void open_init(bContext *C, wmOperator *op) uiIDContextProperty(C, &pprop->ptr, &pprop->prop); } -static int open_cancel(bContext *C, wmOperator *op) +static int open_cancel(bContext *UNUSED(C), wmOperator *op) { MEM_freeN(op->customdata); op->customdata= NULL; @@ -736,7 +736,7 @@ static int open_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int open_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { SpaceImage *sima= CTX_wm_space_image(C); char *path=U.textudir; @@ -806,7 +806,7 @@ static int replace_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int replace_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int replace_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { SpaceImage *sima= CTX_wm_space_image(C); @@ -961,7 +961,7 @@ static int save_as_exec(bContext *C, wmOperator *op) } -static int save_as_check(bContext *C, wmOperator *op) +static int save_as_check(bContext *UNUSED(C), wmOperator *op) { char filepath[FILE_MAX]; RNA_string_get(op->ptr, "filepath", filepath); @@ -972,7 +972,7 @@ static int save_as_check(bContext *C, wmOperator *op) return FALSE; } -static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { SpaceImage *sima= CTX_wm_space_image(C); Image *ima = ED_space_image(sima); @@ -1188,7 +1188,7 @@ void IMAGE_OT_save_sequence(wmOperatorType *ot) /******************** reload image operator ********************/ -static int reload_exec(bContext *C, wmOperator *op) +static int reload_exec(bContext *C, wmOperator *UNUSED(op)) { Image *ima= CTX_data_edit_image(C); SpaceImage *sima= CTX_wm_space_image(C); @@ -1347,7 +1347,7 @@ static int pack_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int pack_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int pack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Image *ima= CTX_data_edit_image(C); ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); @@ -1507,7 +1507,7 @@ static int unpack_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int unpack_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Image *ima= CTX_data_edit_image(C); @@ -1570,7 +1570,7 @@ typedef struct ImageSampleInfo { int draw; } ImageSampleInfo; -static void sample_draw(const bContext *C, ARegion *ar, void *arg_info) +static void sample_draw(const bContext *UNUSED(C), ARegion *ar, void *arg_info) { ImageSampleInfo *info= arg_info; @@ -1985,7 +1985,7 @@ static int record_composite_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int record_composite_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int record_composite_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { RecordCompositeData *rcd= op->customdata; @@ -2052,7 +2052,7 @@ static int cycle_render_slot_poll(bContext *C) return (ima && ima->type == IMA_TYPE_R_RESULT); } -static int cycle_render_slot_exec(bContext *C, wmOperator *op) +static int cycle_render_slot_exec(bContext *C, wmOperator *UNUSED(op)) { Image *ima= CTX_data_edit_image(C); int a, slot, cur= ima->render_slot; diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 250ece6d92a..d77d153a324 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -369,7 +369,7 @@ ARegion *image_has_scope_region(ScrArea *sa) /* ******************** default callbacks for image space ***************** */ -static SpaceLink *image_new(const bContext *C) +static SpaceLink *image_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceImage *simage; @@ -429,7 +429,7 @@ static void image_free(SpaceLink *sl) /* spacetype; init callback, add handlers */ -static void image_init(struct wmWindowManager *wm, ScrArea *sa) +static void image_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) { ListBase *lb= WM_dropboxmap_find("Image", SPACE_IMAGE, 0); @@ -533,7 +533,7 @@ void image_keymap(struct wmKeyConfig *keyconf) } /* dropboxes */ -static int image_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int image_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) { if(drag->type==WM_DRAG_PATH) if(ELEM3(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */ @@ -557,7 +557,7 @@ static void image_dropboxes(void) -static void image_refresh(const bContext *C, ScrArea *sa) +static void image_refresh(const bContext *C, ScrArea *UNUSED(sa)) { SpaceImage *sima= CTX_wm_space_image(C); Object *obedit= CTX_data_edit_object(C); @@ -884,7 +884,7 @@ static void image_scope_area_listener(ARegion *ar, wmNotifier *wmn) /************************* header region **************************/ /* add handlers, stuff you only do once or on area/region changes */ -static void image_header_area_init(wmWindowManager *wm, ARegion *ar) +static void image_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 81417e8f8f1..9123cdeef20 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -127,7 +127,7 @@ static void wm_method_draw_full(bContext *C, wmWindow *win) CTX_wm_region_set(C, ar); ED_region_do_draw(C, ar); wm_paintcursor_draw(C, ar); - ED_area_overdraw_flush(C, sa, ar); + ED_area_overdraw_flush(sa, ar); CTX_wm_region_set(C, NULL); } } @@ -242,7 +242,7 @@ static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange) CTX_wm_region_set(C, ar); ED_region_do_draw(C, ar); wm_paintcursor_draw(C, ar); - ED_area_overdraw_flush(C, sa, ar); + ED_area_overdraw_flush(sa, ar); CTX_wm_region_set(C, NULL); if(exchange) @@ -253,7 +253,7 @@ static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange) CTX_wm_region_set(C, ar); ED_region_do_draw(C, ar); wm_paintcursor_draw(C, ar); - ED_area_overdraw_flush(C, sa, ar); + ED_area_overdraw_flush(sa, ar); CTX_wm_region_set(C, NULL); ar->swap= WIN_BOTH_OK; @@ -592,7 +592,7 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win) if(ar->swinid && ar->do_draw) { CTX_wm_region_set(C, ar); ED_region_do_draw(C, ar); - ED_area_overdraw_flush(C, sa, ar); + ED_area_overdraw_flush(sa, ar); CTX_wm_region_set(C, NULL); copytex= 1; } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 0b8a4759bca..74a8310c2b3 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -526,7 +526,7 @@ static void do_history(char *name, ReportList *reports) BKE_report(reports, RPT_ERROR, "Unable to make version backup"); } -static ImBuf *blend_file_thumb(const char *path, Scene *scene, int **thumb_pt) +static ImBuf *blend_file_thumb(Scene *scene, int **thumb_pt) { /* will be scaled down, but gives some nice oversampling */ ImBuf *ibuf; @@ -627,7 +627,7 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re ED_sculpt_force_update(C); /* blend file thumbnail */ - ibuf_thumb= blend_file_thumb(di, CTX_data_scene(C), &thumb); + ibuf_thumb= blend_file_thumb(CTX_data_scene(C), &thumb); /* rename to .blend1, do this as last before write */ do_history(di, reports); -- cgit v1.2.3 From f8e7ad91e99de278beaee3ff42efdf95a89f857e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2010 13:17:34 +0000 Subject: fix unused args warnings and remove some unused args. --- .../blender/editors/interface/interface_handlers.c | 44 +++++++++++----------- 1 file changed, 21 insertions(+), 23 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 7487ed904e4..71695693568 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -429,7 +429,7 @@ static void ui_apply_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data data->applied= 1; } -static void ui_apply_but_TOG(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data) +static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data) { double value; int w, lvalue, push; @@ -896,7 +896,7 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut case BUT_TOGDUAL: case OPTION: case OPTIONN: - ui_apply_but_TOG(C, block, but, data); + ui_apply_but_TOG(C, but, data); break; case ROW: case LISTROW: @@ -3567,7 +3567,7 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt return WM_UI_HANDLER_CONTINUE; } -static int in_scope_resize_zone(uiBut *but, int x, int y) +static int in_scope_resize_zone(uiBut *but, int UNUSED(x), int y) { // bottom corner return (x > but->x2 - SCOPE_RESIZE_PAD) && (y < but->y1 + SCOPE_RESIZE_PAD); return (y < but->y1 + SCOPE_RESIZE_PAD); @@ -3944,13 +3944,13 @@ static int ui_do_but_LINK(bContext *C, uiBut *but, uiHandleButtonData *data, wmE return WM_UI_HANDLER_CONTINUE; } -static void but_shortcut_name_func(bContext *C, void *arg1, int event) +static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event)) { uiBut *but = (uiBut *)arg1; - - char buf[512], *butstr, *cpoin; - + if (but->optype) { + char buf[512], *butstr, *cpoin; + IDProperty *prop= (but->opptr)? but->opptr->data: NULL; /* complex code to change name of button */ @@ -4033,7 +4033,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg) uiBlockSetHandleFunc(block, but_shortcut_name_func, but); uiBlockSetFlag(block, UI_BLOCK_RET_1); uiBlockSetDirection(block, UI_CENTER); - + layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style); uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT|UI_ITEM_R_IMMEDIATE, "", 0); @@ -4044,14 +4044,14 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg) return block; } -static void popup_change_shortcut_func(bContext *C, void *arg1, void *arg2) +static void popup_change_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2)) { uiBut *but = (uiBut *)arg1; button_timers_tooltip_remove(C, but); uiPupBlock(C, menu_change_shortcut, but); } -static void remove_shortcut_func(bContext *C, void *arg1, void *arg2) +static void remove_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2)) { uiBut *but = (uiBut *)arg1; wmKeyMap *km; @@ -4065,7 +4065,7 @@ static void remove_shortcut_func(bContext *C, void *arg1, void *arg2) but_shortcut_name_func(C, but, 0); } -static void popup_add_shortcut_func(bContext *C, void *arg1, void *arg2) +static void popup_add_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2)) { uiBut *but = (uiBut *)arg1; button_timers_tooltip_remove(C, but); @@ -4573,7 +4573,7 @@ static int ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y) return 1; } -static uiBut *ui_but_find_mouse_over(wmWindow *win, ARegion *ar, int x, int y) +static uiBut *ui_but_find_mouse_over(ARegion *ar, int x, int y) { uiBlock *block; uiBut *but, *butover= NULL; @@ -4605,7 +4605,7 @@ static uiBut *ui_but_find_mouse_over(wmWindow *win, ARegion *ar, int x, int y) return butover; } -static uiBut *ui_list_find_mouse_over(wmWindow *win, ARegion *ar, int x, int y) +static uiBut *ui_list_find_mouse_over(ARegion *ar, int x, int y) { uiBlock *block; uiBut *but; @@ -5026,11 +5026,10 @@ static uiBut *uit_but_find_open_event(ARegion *ar, wmEvent *event) static int ui_handle_button_over(bContext *C, wmEvent *event, ARegion *ar) { - wmWindow *win= CTX_wm_window(C); uiBut *but; if(event->type == MOUSEMOVE) { - but= ui_but_find_mouse_over(win, ar, event->x, event->y); + but= ui_but_find_mouse_over(ar, event->x, event->y); if(but) button_activate_init(C, ar, but, BUTTON_ACTIVATE_OVER); } @@ -5108,7 +5107,7 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but) data->cancel= 1; button_activate_state(C, but, BUTTON_STATE_EXIT); } - else if(ui_but_find_mouse_over(data->window, ar, event->x, event->y) != but) { + else if(ui_but_find_mouse_over(ar, event->x, event->y) != but) { data->cancel= 1; button_activate_state(C, but, BUTTON_STATE_EXIT); } @@ -5206,7 +5205,7 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but) else if(data->state == BUTTON_STATE_MENU_OPEN) { switch(event->type) { case MOUSEMOVE: { - uiBut *bt= ui_but_find_mouse_over(data->window, ar, event->x, event->y); + uiBut *bt= ui_but_find_mouse_over(ar, event->x, event->y); if(bt && bt->active != data) { if(but->type != COL) /* exception */ @@ -5241,8 +5240,7 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but) static int ui_handle_list_event(bContext *C, wmEvent *event, ARegion *ar) { - wmWindow *win= CTX_wm_window(C); - uiBut *but= ui_list_find_mouse_over(win, ar, event->x, event->y); + uiBut *but= ui_list_find_mouse_over(ar, event->x, event->y); int retval= WM_UI_HANDLER_CONTINUE; int value, min, max; @@ -5429,7 +5427,7 @@ static int ui_mouse_motion_towards_check(uiBlock *block, uiPopupBlockHandle *men return menu->dotowards; } -int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu, int topmenu) +int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu, int UNUSED(topmenu)) { ARegion *ar; uiBlock *block; @@ -5793,7 +5791,7 @@ static int ui_handle_menus_recursive(bContext *C, wmEvent *event, uiPopupBlockHa /* *************** UI event handlers **************** */ -static int ui_handler_region(bContext *C, wmEvent *event, void *userdata) +static int ui_handler_region(bContext *C, wmEvent *event, void *UNUSED(userdata)) { ARegion *ar; uiBut *but; @@ -5831,7 +5829,7 @@ static int ui_handler_region(bContext *C, wmEvent *event, void *userdata) return retval; } -static void ui_handler_remove_region(bContext *C, void *userdata) +static void ui_handler_remove_region(bContext *C, void *UNUSED(userdata)) { bScreen *sc; ARegion *ar; @@ -5851,7 +5849,7 @@ static void ui_handler_remove_region(bContext *C, void *userdata) ui_apply_but_funcs_after(C); } -static int ui_handler_region_menu(bContext *C, wmEvent *event, void *userdata) +static int ui_handler_region_menu(bContext *C, wmEvent *event, void *UNUSED(userdata)) { ARegion *ar; uiBut *but; -- cgit v1.2.3 From 2a7f585fbaa943a15ac757b466da096eaf163fbe Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2010 13:18:42 +0000 Subject: bugfix [#23070] some shortcuts cannot be saved in a usual way --- source/blender/editors/interface/interface_handlers.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 71695693568..c450b41b183 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3955,7 +3955,8 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event)) /* complex code to change name of button */ if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, buf, sizeof(buf))) { - + wmKeyMap *km= NULL; + butstr= MEM_mallocN(strlen(but->str)+strlen(buf)+2, "menu_block_set_keymaps"); // XXX but->str changed... should not, remove the hotkey from it @@ -3971,6 +3972,11 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event)) MEM_freeN(butstr); ui_check_but(but); + + /* set the keymap editable else the key wont save */ + WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, 1, &km); + WM_keymap_copy_to_user(km); + } else { /* shortcut was removed */ cpoin= strchr(but->str, '|'); -- cgit v1.2.3 From 7eaf56a97bf56905e2613c883694f710c7b9e472 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 14 Oct 2010 20:19:52 +0000 Subject: Fix #24257: Last shape key not applied as Basis shape. --- source/blender/editors/object/object_shapekey.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 7b1ab933e28..0effa01553b 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -53,6 +53,7 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_object.h" +#include "BKE_curve.h" #include "BLO_sys_types.h" // for intptr_t support @@ -100,8 +101,25 @@ static int ED_object_shape_key_remove(bContext *C, Object *ob) BLI_remlink(&key->block, kb); key->totkey--; - if(key->refkey== kb) + if(key->refkey== kb) { key->refkey= key->block.first; + + if(key->refkey) { + /* apply new basis key on original data */ + switch(ob->type) { + case OB_MESH: + key_to_mesh(key->refkey, ob->data); + break; + case OB_CURVE: + case OB_SURF: + key_to_curve(key->refkey, ob->data, BKE_curve_nurbs(ob->data)); + break; + case OB_LATTICE: + key_to_latt(key->refkey, ob->data); + break; + } + } + } if(kb->data) MEM_freeN(kb->data); MEM_freeN(kb); -- cgit v1.2.3 From f81248265d0792029000bb53d23130f88c27a20a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Oct 2010 01:36:14 +0000 Subject: tag UNUSED() for operator exec() and invoke() functions. --- .../blender/editors/animation/anim_channels_edit.c | 6 +-- source/blender/editors/animation/anim_markers.c | 6 +-- source/blender/editors/animation/anim_ops.c | 4 +- source/blender/editors/animation/drivers.c | 4 +- source/blender/editors/animation/keyframing.c | 2 +- source/blender/editors/animation/keyingsets.c | 4 +- source/blender/editors/armature/editarmature.c | 38 +++++++++--------- .../blender/editors/armature/editarmature_sketch.c | 10 ++--- source/blender/editors/armature/poseSlide.c | 6 +-- source/blender/editors/armature/poselib.c | 6 +-- source/blender/editors/armature/poseobject.c | 22 +++++------ source/blender/editors/curve/editcurve.c | 44 ++++++++++----------- source/blender/editors/curve/editfont.c | 18 ++++----- source/blender/editors/interface/interface_ops.c | 6 +-- source/blender/editors/interface/view2d_ops.c | 2 +- source/blender/editors/mesh/editmesh_add.c | 4 +- source/blender/editors/mesh/editmesh_mods.c | 14 +++---- source/blender/editors/mesh/editmesh_tools.c | 26 ++++++------ source/blender/editors/mesh/mesh_data.c | 12 +++--- source/blender/editors/mesh/meshtools.c | 2 +- source/blender/editors/metaball/mball_edit.c | 10 ++--- source/blender/editors/object/object_add.c | 8 ++-- source/blender/editors/object/object_bake.c | 4 +- source/blender/editors/object/object_constraint.c | 24 +++++------ source/blender/editors/object/object_edit.c | 20 +++++----- source/blender/editors/object/object_group.c | 6 +-- source/blender/editors/object/object_hook.c | 2 +- source/blender/editors/object/object_lattice.c | 2 +- source/blender/editors/object/object_modifier.c | 26 ++++++------ source/blender/editors/object/object_relations.c | 6 +-- source/blender/editors/object/object_select.c | 2 +- source/blender/editors/object/object_shapekey.c | 6 +-- source/blender/editors/object/object_transform.c | 10 ++--- source/blender/editors/object/object_vgroup.c | 16 ++++---- source/blender/editors/physics/particle_boids.c | 14 +++---- source/blender/editors/physics/particle_edit.c | 20 +++++----- source/blender/editors/physics/particle_object.c | 22 +++++------ .../blender/editors/physics/physics_pointcache.c | 10 ++--- source/blender/editors/render/render_internal.c | 6 +-- source/blender/editors/render/render_shading.c | 36 ++++++++--------- source/blender/editors/sculpt_paint/paint_image.c | 2 +- source/blender/editors/sculpt_paint/paint_ops.c | 6 +-- source/blender/editors/sculpt_paint/paint_utils.c | 2 +- source/blender/editors/sculpt_paint/paint_vertex.c | 8 ++-- source/blender/editors/sound/sound_ops.c | 2 +- source/blender/editors/space_action/action_edit.c | 16 ++++---- .../blender/editors/space_action/action_select.c | 6 +-- source/blender/editors/space_buttons/buttons_ops.c | 4 +- source/blender/editors/space_file/file_ops.c | 30 +++++++------- source/blender/editors/space_graph/graph_buttons.c | 2 +- source/blender/editors/space_graph/graph_edit.c | 24 +++++------ source/blender/editors/space_graph/graph_ops.c | 2 +- source/blender/editors/space_graph/graph_select.c | 6 +-- source/blender/editors/space_info/info_ops.c | 16 ++++---- source/blender/editors/space_logic/logic_buttons.c | 2 +- source/blender/editors/space_logic/logic_ops.c | 12 +++--- source/blender/editors/space_nla/nla_buttons.c | 2 +- source/blender/editors/space_nla/nla_channels.c | 2 +- source/blender/editors/space_nla/nla_edit.c | 26 ++++++------ source/blender/editors/space_node/node_buttons.c | 2 +- source/blender/editors/space_node/node_edit.c | 24 +++++------ source/blender/editors/space_node/node_select.c | 12 +++--- source/blender/editors/space_node/node_state.c | 2 +- source/blender/editors/space_outliner/outliner.c | 24 +++++------ source/blender/editors/space_script/script_edit.c | 2 +- .../editors/space_sequencer/sequencer_buttons.c | 2 +- .../editors/space_sequencer/sequencer_edit.c | 36 ++++++++--------- .../editors/space_sequencer/sequencer_select.c | 10 ++--- source/blender/editors/space_text/text_header.c | 2 +- source/blender/editors/space_text/text_ops.c | 46 +++++++++++----------- source/blender/editors/space_time/time_ops.c | 6 +-- .../blender/editors/space_view3d/view3d_buttons.c | 2 +- source/blender/editors/space_view3d/view3d_edit.c | 14 +++---- source/blender/editors/space_view3d/view3d_snap.c | 12 +++--- .../blender/editors/space_view3d/view3d_toolbar.c | 2 +- source/blender/editors/space_view3d/view3d_view.c | 10 ++--- source/blender/editors/transform/transform_ops.c | 8 ++-- source/blender/editors/util/undo.c | 4 +- source/blender/editors/uvedit/uvedit_ops.c | 8 ++-- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 8 ++-- 80 files changed, 446 insertions(+), 446 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 4414da222a6..1ac17aee871 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -922,7 +922,7 @@ void ANIM_OT_channels_move_bottom (wmOperatorType *ot) /* ******************** Delete Channel Operator *********************** */ -static int animchannels_delete_exec(bContext *C, wmOperator *op) +static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; ListBase anim_data = {NULL, NULL}; @@ -1023,7 +1023,7 @@ void ANIM_OT_channels_delete (wmOperatorType *ot) /* ******************** Set Channel Visibility Operator *********************** */ /* NOTE: this operator is only valid in the Graph Editor channels region */ -static int animchannels_visibility_set_exec(bContext *C, wmOperator *op) +static int animchannels_visibility_set_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; ListBase anim_data = {NULL, NULL}; @@ -1101,7 +1101,7 @@ void ANIM_OT_channels_visibility_set (wmOperatorType *ot) /* ******************** Toggle Channel Visibility Operator *********************** */ /* NOTE: this operator is only valid in the Graph Editor channels region */ -static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *op) +static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; ListBase anim_data = {NULL, NULL}; diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 5c4d231fd3a..0f9ef45ac94 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -336,7 +336,7 @@ void draw_markers_time(const bContext *C, int flag) /* ************************** add markers *************************** */ /* add TimeMarker at curent frame */ -static int ed_marker_add(bContext *C, wmOperator *op) +static int ed_marker_add(bContext *C, wmOperator *UNUSED(op)) { ListBase *markers= context_get_markers(C); TimeMarker *marker; @@ -1033,7 +1033,7 @@ static void MARKER_OT_select_all(wmOperatorType *ot) /* ******************************* remove marker ***************** */ /* remove selected TimeMarkers */ -static int ed_marker_delete_exec(bContext *C, wmOperator *op) +static int ed_marker_delete_exec(bContext *C, wmOperator *UNUSED(op)) { ListBase *markers= context_get_markers(C); TimeMarker *marker, *nmarker; @@ -1130,7 +1130,7 @@ static void MARKER_OT_make_links_scene(wmOperatorType *ot) /* ******************************* camera bind marker ***************** */ /* remove selected TimeMarkers */ -static int ed_marker_camera_bind_exec(bContext *C, wmOperator *op) +static int ed_marker_camera_bind_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); ListBase *markers= context_get_markers(C); diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 9b9c9435518..a80ea3e12bf 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -233,7 +233,7 @@ void ANIM_OT_previewrange_set(wmOperatorType *ot) /* ****************** clear preview range operator ****************************/ -static int previewrange_clear_exec(bContext *C, wmOperator *op) +static int previewrange_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); ScrArea *curarea= CTX_wm_area(C); @@ -269,7 +269,7 @@ void ANIM_OT_previewrange_clear(wmOperatorType *ot) /* ****************** time display toggle operator ****************************/ -static int toggle_time_exec(bContext *C, wmOperator *op) +static int toggle_time_exec(bContext *C, wmOperator *UNUSED(op)) { ScrArea *curarea= CTX_wm_area(C); diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 898d7db89fc..28b51ad0602 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -472,7 +472,7 @@ void ANIM_OT_driver_button_remove (wmOperatorType *ot) /* Copy Driver Button Operator ------------------------ */ -static int copy_driver_button_exec (bContext *C, wmOperator *op) +static int copy_driver_button_exec (bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr; PropertyRNA *prop= NULL; @@ -518,7 +518,7 @@ void ANIM_OT_copy_driver_button (wmOperatorType *ot) /* Paste Driver Button Operator ------------------------ */ -static int paste_driver_button_exec (bContext *C, wmOperator *op) +static int paste_driver_button_exec (bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr; PropertyRNA *prop= NULL; diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index e92065eea91..160116bb1a3 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1146,7 +1146,7 @@ void ANIM_OT_keyframe_insert (wmOperatorType *ot) * then calls the menu if necessary before */ -static int insert_key_menu_invoke (bContext *C, wmOperator *op, wmEvent *event) +static int insert_key_menu_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Scene *scene= CTX_data_scene(C); diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 77e0c84d2f3..55c14411328 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -107,7 +107,7 @@ static int keyingset_poll_activePath_edit (bContext *C) /* Add a Default (Empty) Keying Set ------------------------- */ -static int add_default_keyingset_exec (bContext *C, wmOperator *op) +static int add_default_keyingset_exec (bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); short flag=0, keyingflag=0; @@ -464,7 +464,7 @@ void ANIM_OT_keyingset_button_remove (wmOperatorType *ot) /* Change Active KeyingSet Operator ------------------------ */ /* This operator checks if a menu should be shown for choosing the KeyingSet to make the active one */ -static int keyingset_active_menu_invoke (bContext *C, wmOperator *op, wmEvent *event) +static int keyingset_active_menu_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { /* call the menu, which will call this operator again, hence the cancelled */ ANIM_keying_sets_menu_setup(C, op->type->name, "ANIM_OT_keying_set_active_set"); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 49c3ac06b94..f786b50fcf9 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -655,7 +655,7 @@ void POSE_OT_armature_apply (wmOperatorType *ot) /* set the current pose as the restpose */ -static int pose_visual_transform_apply_exec (bContext *C, wmOperator *op) +static int pose_visual_transform_apply_exec (bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); // must be active object, not edit-object @@ -817,7 +817,7 @@ static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChann } /* join armature exec is exported for use in object->join objects operator... */ -int join_armature_exec(bContext *C, wmOperator *op) +int join_armature_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -1127,7 +1127,7 @@ static void separate_armature_bones (Scene *scene, Object *ob, short sel) } /* separate selected bones into their armature */ -static int separate_armature_exec (bContext *C, wmOperator *op) +static int separate_armature_exec (bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -1787,7 +1787,7 @@ EditBone *ED_armature_bone_get_mirrored(ListBase *edbo, EditBone *ebo) /* previously delete_armature */ /* only editmode! */ -static int armature_delete_selected_exec(bContext *C, wmOperator *op) +static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op)) { bArmature *arm; EditBone *curBone, *next; @@ -2377,7 +2377,7 @@ void add_primitive_bone(Scene *scene, View3D *v3d, RegionView3D *rv3d) /* previously addvert_armature */ /* the ctrl-click method */ -static int armature_click_extrude_exec(bContext *C, wmOperator *op) +static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op)) { View3D *v3d; bArmature *arm; @@ -2691,7 +2691,7 @@ EditBone *duplicateEditBone(EditBone *curBone, char *name, ListBase *editbones, } /* previously adduplicate_armature */ -static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) +static int armature_duplicate_selected_exec(bContext *C, wmOperator *UNUSED(op)) { bArmature *arm; EditBone *eBone = NULL; @@ -3262,7 +3262,7 @@ void ARMATURE_OT_merge (wmOperatorType *ot) /* ************** END Add/Remove stuff in editmode ************ */ /* *************** Tools in editmode *********** */ -static int armature_hide_exec(bContext *C, wmOperator *op) +static int armature_hide_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); bArmature *arm= obedit->data; @@ -3302,7 +3302,7 @@ void ARMATURE_OT_hide(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int armature_reveal_exec(bContext *C, wmOperator *op) +static int armature_reveal_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); bArmature *arm= obedit->data; @@ -3724,7 +3724,7 @@ void ARMATURE_OT_subdivide_multi(wmOperatorType *ot) -static int armature_subdivs_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int armature_subdivs_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { uiPopupMenu *pup; uiLayout *layout; @@ -3788,7 +3788,7 @@ void ARMATURE_OT_subdivs(wmOperatorType *ot) * this to be done easily. */ -static int armature_switch_direction_exec(bContext *C, wmOperator *op) +static int armature_switch_direction_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_edit_object(C); bArmature *arm= (bArmature *)ob->data; @@ -4009,7 +4009,7 @@ static int armature_parent_set_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int armature_parent_set_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int armature_parent_set_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { EditBone *actbone = CTX_data_active_bone(C); uiPopupMenu *pup= uiPupMenuBegin(C, "Make Parent ", 0); @@ -4106,7 +4106,7 @@ void ARMATURE_OT_parent_clear(wmOperatorType *ot) /* **************** Selections ******************/ -static int armature_select_inverse_exec(bContext *C, wmOperator *op) +static int armature_select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) { /* Set the flags */ CTX_DATA_BEGIN(C, EditBone *, ebone, visible_bones) { @@ -4922,7 +4922,7 @@ void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob, } /* ************* Clear Pose *****************************/ -static int pose_clear_scale_exec(bContext *C, wmOperator *op) +static int pose_clear_scale_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); @@ -4990,7 +4990,7 @@ void POSE_OT_scale_clear(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int pose_clear_loc_exec(bContext *C, wmOperator *op) +static int pose_clear_loc_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); @@ -5059,7 +5059,7 @@ void POSE_OT_loc_clear(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int pose_clear_rot_exec(bContext *C, wmOperator *op) +static int pose_clear_rot_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); @@ -5215,7 +5215,7 @@ void POSE_OT_rot_clear(wmOperatorType *ot) /* ***************** selections ********************** */ -static int pose_select_inverse_exec(bContext *C, wmOperator *op) +static int pose_select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) { /* Set the flags */ @@ -5312,7 +5312,7 @@ void POSE_OT_select_all(wmOperatorType *ot) WM_operator_properties_select_all(ot); } -static int pose_select_parent_exec(bContext *C, wmOperator *op) +static int pose_select_parent_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); bPoseChannel *pchan,*parent; @@ -5437,7 +5437,7 @@ static int show_pose_bone(Object *ob, Bone *bone, void *ptr) } /* active object is armature in posemode, poll checked */ -static int pose_reveal_exec(bContext *C, wmOperator *op) +static int pose_reveal_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); bArmature *arm= ob->data; @@ -5634,7 +5634,7 @@ void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep) } -static int armature_flip_names_exec (bContext *C, wmOperator *op) +static int armature_flip_names_exec (bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_edit_object(C); bArmature *arm; diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 241301b8ee1..84f8513878c 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -2452,7 +2452,7 @@ void BDR_drawSketch(const bContext *C) } } -static int sketch_delete(bContext *C, wmOperator *op, wmEvent *event) +static int sketch_delete(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { SK_Sketch *sketch = contextSketch(C, 0); if (sketch) @@ -2558,7 +2558,7 @@ SK_Sketch* viewcontextSketch(ViewContext *vc, int create) return sketch; } -static int sketch_convert(bContext *C, wmOperator *op, wmEvent *event) +static int sketch_convert(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { SK_Sketch *sketch = contextSketch(C, 0); if (sketch != NULL) @@ -2569,7 +2569,7 @@ static int sketch_convert(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_FINISHED; } -static int sketch_cancel(bContext *C, wmOperator *op, wmEvent *event) +static int sketch_cancel(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { SK_Sketch *sketch = contextSketch(C, 0); if (sketch != NULL) @@ -2581,7 +2581,7 @@ static int sketch_cancel(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_PASS_THROUGH; } -static int sketch_finish(bContext *C, wmOperator *op, wmEvent *event) +static int sketch_finish(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { SK_Sketch *sketch = contextSketch(C, 0); if (sketch != NULL) @@ -2595,7 +2595,7 @@ static int sketch_finish(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_PASS_THROUGH; } -static int sketch_select(bContext *C, wmOperator *op, wmEvent *event) +static int sketch_select(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { SK_Sketch *sketch = contextSketch(C, 0); if (sketch) diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c index 482d97811a3..64426b7dc6b 100644 --- a/source/blender/editors/armature/poseSlide.c +++ b/source/blender/editors/armature/poseSlide.c @@ -612,7 +612,7 @@ static void pose_slide_opdef_properties (wmOperatorType *ot) /* ------------------------------------ */ /* invoke() - for 'push' mode */ -static int pose_slide_push_invoke (bContext *C, wmOperator *op, wmEvent *evt) +static int pose_slide_push_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) { tPoseSlideOp *pso; @@ -669,7 +669,7 @@ void POSE_OT_push (wmOperatorType *ot) /* ........................ */ /* invoke() - for 'relax' mode */ -static int pose_slide_relax_invoke (bContext *C, wmOperator *op, wmEvent *evt) +static int pose_slide_relax_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) { tPoseSlideOp *pso; @@ -726,7 +726,7 @@ void POSE_OT_relax (wmOperatorType *ot) /* ........................ */ /* invoke() - for 'breakdown' mode */ -static int pose_slide_breakdown_invoke (bContext *C, wmOperator *op, wmEvent *evt) +static int pose_slide_breakdown_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) { tPoseSlideOp *pso; diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 9292c92294b..3a90f75d2a1 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -290,7 +290,7 @@ static void poselib_add_menu_invoke__replacemenu (bContext *C, uiLayout *layout, } } -static int poselib_add_menu_invoke (bContext *C, wmOperator *op, wmEvent *evt) +static int poselib_add_menu_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) { Scene *scene= CTX_data_scene(C); Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); @@ -1034,7 +1034,7 @@ static void poselib_preview_handle_search (tPoseLib_PreviewData *pld, unsigned s } /* handle events for poselib_preview_poses */ -static int poselib_preview_handle_event (bContext *C, wmOperator *op, wmEvent *event) +static int poselib_preview_handle_event (bContext *UNUSED(C), wmOperator *op, wmEvent *event) { tPoseLib_PreviewData *pld= op->customdata; int ret = OPERATOR_RUNNING_MODAL; @@ -1411,7 +1411,7 @@ static int poselib_preview_modal (bContext *C, wmOperator *op, wmEvent *event) } /* Modal Operator init */ -static int poselib_preview_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int poselib_preview_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { tPoseLib_PreviewData *pld; diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 4aff2f1e915..fa7f01da7b9 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -242,7 +242,7 @@ void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob) /* For the object with pose/action: create path curves for selected bones * This recalculates the WHOLE path within the pchan->pathsf and pchan->pathef range */ -static int pose_calculate_paths_exec (bContext *C, wmOperator *op) +static int pose_calculate_paths_exec (bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); Scene *scene= CTX_data_scene(C); @@ -319,7 +319,7 @@ void ED_pose_clear_paths(Object *ob) } /* operator callback for this */ -static int pose_clear_paths_exec (bContext *C, wmOperator *op) +static int pose_clear_paths_exec (bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); Object *ob; @@ -360,7 +360,7 @@ void POSE_OT_paths_clear (wmOperatorType *ot) /* ******************* Select Constraint Target Operator ************* */ -static int pose_select_constraint_target_exec(bContext *C, wmOperator *op) +static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); bArmature *arm= ob->data; @@ -1100,7 +1100,7 @@ void POSE_OT_paste (wmOperatorType *ot) /* ********************************************** */ -static int pose_group_add_exec (bContext *C, wmOperator *op) +static int pose_group_add_exec (bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); Object *ob; @@ -1140,7 +1140,7 @@ void POSE_OT_group_add (wmOperatorType *ot) } -static int pose_group_remove_exec (bContext *C, wmOperator *op) +static int pose_group_remove_exec (bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); Object *ob; @@ -1182,7 +1182,7 @@ void POSE_OT_group_remove (wmOperatorType *ot) /* ------------ */ /* invoke callback which presents a list of bone-groups for the user to choose from */ -static int pose_groups_menu_invoke (bContext *C, wmOperator *op, wmEvent *evt) +static int pose_groups_menu_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) { ScrArea *sa= CTX_wm_area(C); Object *ob; @@ -1300,7 +1300,7 @@ void POSE_OT_group_assign (wmOperatorType *ot) } -static int pose_group_unassign_exec (bContext *C, wmOperator *op) +static int pose_group_unassign_exec (bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); Object *ob; @@ -1375,7 +1375,7 @@ static void pose_group_select(bContext *C, Object *ob, int select) CTX_DATA_END; } -static int pose_group_select_exec (bContext *C, wmOperator *op) +static int pose_group_select_exec (bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); Object *ob; @@ -1413,7 +1413,7 @@ void POSE_OT_group_select (wmOperatorType *ot) ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; } -static int pose_group_deselect_exec (bContext *C, wmOperator *op) +static int pose_group_deselect_exec (bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); Object *ob; @@ -1453,7 +1453,7 @@ void POSE_OT_group_deselect (wmOperatorType *ot) /* ********************************************** */ -static int pose_flip_names_exec (bContext *C, wmOperator *op) +static int pose_flip_names_exec (bContext *C, wmOperator *UNUSED(op)) { Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); bArmature *arm; @@ -1827,7 +1827,7 @@ void ARMATURE_OT_bone_layers (wmOperatorType *ot) /* ********************************************** */ -static int pose_flip_quats_exec (bContext *C, wmOperator *op) +static int pose_flip_quats_exec (bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 4c869d25869..9fa7ba44c58 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1343,7 +1343,7 @@ static void weightflagNurb(ListBase *editnurb, short flag, float w) } } -static int deleteflagNurb(bContext *C, wmOperator *op, int flag) +static int deleteflagNurb(bContext *C, wmOperator *UNUSED(op), int flag) { Object *obedit= CTX_data_edit_object(C); Curve *cu= obedit->data; @@ -1765,7 +1765,7 @@ static void adduplicateflagNurb(Object *obedit, short flag) /**************** switch direction operator ***************/ -static int switch_direction_exec(bContext *C, wmOperator *op) +static int switch_direction_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); Curve *cu= (Curve*)obedit->data; @@ -1902,7 +1902,7 @@ void CURVE_OT_radius_set(wmOperatorType *ot) /********************* smooth operator ********************/ -static int smooth_exec(bContext *C, wmOperator *op) +static int smooth_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); @@ -1974,7 +1974,7 @@ void CURVE_OT_smooth(wmOperatorType *ot) /**************** smooth curve radius operator *************/ /* TODO, make smoothing distance based */ -static int smooth_radius_exec(bContext *C, wmOperator *op) +static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); @@ -2265,7 +2265,7 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu } } -static int de_select_first_exec(bContext *C, wmOperator *op) +static int de_select_first_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); @@ -2289,7 +2289,7 @@ void CURVE_OT_de_select_first(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int de_select_last_exec(bContext *C, wmOperator *op) +static int de_select_last_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); @@ -2470,7 +2470,7 @@ void CURVE_OT_hide(wmOperatorType *ot) /********************** reveal operator *********************/ -static int reveal_exec(bContext *C, wmOperator *op) +static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); @@ -2527,7 +2527,7 @@ void CURVE_OT_reveal(wmOperatorType *ot) /********************** select invert operator *********************/ -static int select_inverse_exec(bContext *C, wmOperator *op) +static int select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); Curve *cu= obedit->data; @@ -4071,7 +4071,7 @@ static int spin_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int spin_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int spin_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -4271,7 +4271,7 @@ void CURVE_OT_vertex_add(wmOperatorType *ot) /***************** extrude operator **********************/ -static int extrude_exec(bContext *C, wmOperator *op) +static int extrude_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); Curve *cu= obedit->data; @@ -4296,7 +4296,7 @@ static int extrude_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int extrude_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int extrude_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if(extrude_exec(C, op) == OPERATOR_FINISHED) { RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); @@ -4406,7 +4406,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int toggle_cyclic_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int toggle_cyclic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); @@ -4531,7 +4531,7 @@ void CURVE_OT_select_linked(wmOperatorType *ot) /***************** select row operator **********************/ -static int select_row_exec(bContext *C, wmOperator *op) +static int select_row_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); Curve *cu= obedit->data; @@ -4606,7 +4606,7 @@ void CURVE_OT_select_row(wmOperatorType *ot) /***************** select next operator **********************/ -static int select_next_exec(bContext *C, wmOperator *op) +static int select_next_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); @@ -4633,7 +4633,7 @@ void CURVE_OT_select_next(wmOperatorType *ot) /***************** select previous operator **********************/ -static int select_previous_exec(bContext *C, wmOperator *op) +static int select_previous_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); @@ -4660,7 +4660,7 @@ void CURVE_OT_select_previous(wmOperatorType *ot) /***************** select more operator **********************/ -static int select_more_exec(bContext *C, wmOperator *op) +static int select_more_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); @@ -4748,7 +4748,7 @@ void CURVE_OT_select_more(wmOperatorType *ot) /******************** select less operator *****************/ /* basic method: deselect if control point doesn't have all neighbours selected */ -static int select_less_exec(bContext *C, wmOperator *op) +static int select_less_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); @@ -5099,7 +5099,7 @@ void CURVE_OT_select_nth(wmOperatorType *ot) /********************** add duplicate operator *********************/ -static int duplicate_exec(bContext *C, wmOperator *op) +static int duplicate_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); @@ -5109,7 +5109,7 @@ static int duplicate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { duplicate_exec(C, op); @@ -5432,7 +5432,7 @@ static int delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int delete_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int delete_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Object *obedit= CTX_data_edit_object(C); uiPopupMenu *pup; @@ -5534,7 +5534,7 @@ void CURVE_OT_shade_flat(wmOperatorType *ot) /************** join operator, to be used externally? ****************/ -int join_curve_exec(bContext *C, wmOperator *op) +int join_curve_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -6308,7 +6308,7 @@ void SURFACE_OT_primitive_nurbs_surface_torus_add(wmOperatorType *ot) /***************** clear tilt operator ********************/ -static int clear_tilt_exec(bContext *C, wmOperator *op) +static int clear_tilt_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); Curve *cu= obedit->data; diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index ae79c0b0053..44a664b5f30 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -271,7 +271,7 @@ static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int re /********************** insert lorem operator *********************/ -static int insert_lorem_exec(bContext *C, wmOperator *op) +static int insert_lorem_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); char *p, *p2; @@ -383,7 +383,7 @@ static int paste_file_exec(bContext *C, wmOperator *op) return retval; } -static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if(RNA_property_is_set(op->ptr, "filepath")) return paste_file_exec(C, op); @@ -414,7 +414,7 @@ void FONT_OT_file_paste(wmOperatorType *ot) /******************* paste buffer operator ********************/ -static int paste_buffer_exec(bContext *C, wmOperator *op) +static int paste_buffer_exec(bContext *C, wmOperator *UNUSED(op)) { char *filename; @@ -714,7 +714,7 @@ static void copy_selection(Object *obedit) } } -static int copy_text_exec(bContext *C, wmOperator *op) +static int copy_text_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); @@ -737,7 +737,7 @@ void FONT_OT_text_copy(wmOperatorType *ot) /******************* cut text operator ********************/ -static int cut_text_exec(bContext *C, wmOperator *op) +static int cut_text_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); @@ -1367,7 +1367,7 @@ static int textbox_poll(bContext *C) return 1; } -static int textbox_add_exec(bContext *C, wmOperator *op) +static int textbox_add_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_active_object(C); Curve *cu= obedit->data; @@ -1585,7 +1585,7 @@ void FONT_OT_case_set(wmOperatorType *ot) /********************** toggle case operator *********************/ -static int toggle_case_exec(bContext *C, wmOperator *op) +static int toggle_case_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); Curve *cu= obedit->data; @@ -1633,7 +1633,7 @@ static void open_init(bContext *C, wmOperator *op) uiIDContextProperty(C, &pprop->ptr, &pprop->prop); } -static int open_cancel(bContext *C, wmOperator *op) +static int open_cancel(bContext *UNUSED(C), wmOperator *op) { MEM_freeN(op->customdata); op->customdata= NULL; @@ -1686,7 +1686,7 @@ static int open_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int open_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Object *ob = CTX_data_active_object(C); Curve *cu; diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index bcde54f473a..10458a763e6 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -134,7 +134,7 @@ static int eyedropper_modal(bContext *C, wmOperator *op, wmEvent *event) } /* Modal Operator init */ -static int eyedropper_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int eyedropper_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { /* init */ if (eyedropper_init(C, op)) { @@ -195,7 +195,7 @@ void UI_OT_eyedropper(wmOperatorType *ot) /* Reset Default Theme ------------------------ */ -static int reset_default_theme_exec(bContext *C, wmOperator *op) +static int reset_default_theme_exec(bContext *C, wmOperator *UNUSED(op)) { ui_theme_init_default(); WM_event_add_notifier(C, NC_WINDOW, NULL); @@ -219,7 +219,7 @@ void UI_OT_reset_default_theme(wmOperatorType *ot) /* Copy Data Path Operator ------------------------ */ -static int copy_data_path_button_exec(bContext *C, wmOperator *op) +static int copy_data_path_button_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr; PropertyRNA *prop; diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index e10f0f20938..c155aff8d70 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1512,7 +1512,7 @@ void VIEW2D_OT_scroller_activate(wmOperatorType *ot) /* ********************************************************* */ /* RESET */ -static int reset_exec(bContext *C, wmOperator *op) +static int reset_exec(bContext *C, wmOperator *UNUSED(op)) { uiStyle *style= U.uistyles.first; ARegion *ar= CTX_wm_region(C); diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 5850dc706b0..2501a01d0e6 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1712,7 +1712,7 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot) /****************** add duplicate operator ***************/ -static int mesh_duplicate_exec(bContext *C, wmOperator *op) +static int mesh_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(ob->data); @@ -1727,7 +1727,7 @@ static int mesh_duplicate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int mesh_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int mesh_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { WM_cursor_wait(1); mesh_duplicate_exec(C, op); diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 164e8980b83..c4ca6166f02 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -2207,7 +2207,7 @@ static void mouse_mesh_shortest_path(bContext *C, short mval[2]) } -static int mesh_shortest_path_select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int mesh_shortest_path_select_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { view3d_operator_needs_opengl(C); @@ -2618,7 +2618,7 @@ static int select_linked_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int select_linked_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int select_linked_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { linked_limit_default(C, op); return select_linked_exec(C, op); @@ -2815,7 +2815,7 @@ void EM_reveal_mesh(EditMesh *em) // DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } -static int reveal_mesh_exec(bContext *C, wmOperator *op) +static int reveal_mesh_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); @@ -3360,7 +3360,7 @@ void EM_select_swap(EditMesh *em) /* exported for UV */ } -static int select_inverse_mesh_exec(bContext *C, wmOperator *op) +static int select_inverse_mesh_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); @@ -3493,7 +3493,7 @@ void EM_select_more(EditMesh *em) } } -static int select_more(bContext *C, wmOperator *op) +static int select_more(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)) ; @@ -3584,7 +3584,7 @@ void EM_select_less(EditMesh *em) } } -static int select_less(bContext *C, wmOperator *op) +static int select_less(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); @@ -4490,7 +4490,7 @@ void flipface(EditMesh *em, EditFace *efa) } -static int flip_normals(bContext *C, wmOperator *op) +static int flip_normals(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index eadf0ca120f..fc8a713230f 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -664,7 +664,7 @@ void extrude_mesh(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op, sh } // XXX should be a menu item -static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); @@ -796,7 +796,7 @@ void MESH_OT_extrude(wmOperatorType *ot) ot->prop= prop; } -static int split_mesh(bContext *C, wmOperator *op) +static int split_mesh(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -1000,7 +1000,7 @@ static int spin_mesh_exec(bContext *C, wmOperator *op) } /* get center and axis, in global coords */ -static int spin_mesh_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int spin_mesh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -1108,7 +1108,7 @@ static int screw_mesh_exec(bContext *C, wmOperator *op) } /* get center and axis, in global coords */ -static int screw_mesh_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int screw_mesh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -6144,7 +6144,7 @@ void MESH_OT_select_vertex_path(wmOperatorType *ot) /********************** Region/Loop Operators *************************/ -static int region_to_loop(bContext *C, wmOperator *op) +static int region_to_loop(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6325,7 +6325,7 @@ static int loop_bisect(EditMesh *em, Collection *edgecollection){ else return(2); } -static int loop_to_region(bContext *C, wmOperator *op) +static int loop_to_region(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -7022,7 +7022,7 @@ static void fill_mesh(EditMesh *em) } -static int fill_mesh_exec(bContext *C, wmOperator *op) +static int fill_mesh_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -7053,7 +7053,7 @@ void MESH_OT_fill(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int beautify_fill_exec(bContext *C, wmOperator *op) +static int beautify_fill_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -7263,7 +7263,7 @@ void MESH_OT_sort_faces(wmOperatorType *ot) /********************** Quad/Tri Operators *************************/ -static int quads_convert_to_tris_exec(bContext *C, wmOperator *op) +static int quads_convert_to_tris_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -7292,7 +7292,7 @@ void MESH_OT_quads_convert_to_tris(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int tris_convert_to_quads_exec(bContext *C, wmOperator *op) +static int tris_convert_to_quads_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -7321,7 +7321,7 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int edge_flip_exec(bContext *C, wmOperator *op) +static int edge_flip_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -7366,7 +7366,7 @@ static void mesh_set_smooth_faces(EditMesh *em, short smooth) } } -static int mesh_faces_shade_smooth_exec(bContext *C, wmOperator *op) +static int mesh_faces_shade_smooth_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -7396,7 +7396,7 @@ void MESH_OT_faces_shade_smooth(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int mesh_faces_shade_flat_exec(bContext *C, wmOperator *op) +static int mesh_faces_shade_flat_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index d1c6ff4c4ae..f45786d3abe 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -286,7 +286,7 @@ static int layers_poll(bContext *C) return (ob && !ob->id.lib && ob->type==OB_MESH && data && !data->lib); } -static int uv_texture_add_exec(bContext *C, wmOperator *op) +static int uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -392,7 +392,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot) RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file"); } -static int uv_texture_remove_exec(bContext *C, wmOperator *op) +static int uv_texture_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Mesh *me= ob->data; @@ -420,7 +420,7 @@ void MESH_OT_uv_texture_remove(wmOperatorType *ot) /*********************** vertex color operators ************************/ -static int vertex_color_add_exec(bContext *C, wmOperator *op) +static int vertex_color_add_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -447,7 +447,7 @@ void MESH_OT_vertex_color_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int vertex_color_remove_exec(bContext *C, wmOperator *op) +static int vertex_color_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Mesh *me= ob->data; @@ -475,7 +475,7 @@ void MESH_OT_vertex_color_remove(wmOperatorType *ot) /*********************** sticky operators ************************/ -static int sticky_add_exec(bContext *C, wmOperator *op) +static int sticky_add_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); View3D *v3d= CTX_wm_view3d(C); @@ -508,7 +508,7 @@ void MESH_OT_sticky_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int sticky_remove_exec(bContext *C, wmOperator *op) +static int sticky_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Mesh *me= ob->data; diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index e8c787b168f..0f1efbcf7cf 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -84,7 +84,7 @@ /* join selected meshes into the active mesh, context sensitive return 0 if no join is made (error) and 1 of the join is done */ -int join_mesh_exec(bContext *C, wmOperator *op) +int join_mesh_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index 80cea4eea1c..c110222a109 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -177,7 +177,7 @@ void MBALL_OT_select_all(wmOperatorType *ot) /***************************** Select inverse operator *****************************/ /* Invert metaball selection */ -static int select_inverse_metaelems_exec(bContext *C, wmOperator *op) +static int select_inverse_metaelems_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); MetaBall *mb = (MetaBall*)obedit->data; @@ -266,7 +266,7 @@ void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot) /***************************** Duplicate operator *****************************/ /* Duplicate selected MetaElements */ -static int duplicate_metaelems_exec(bContext *C, wmOperator *op) +static int duplicate_metaelems_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); MetaBall *mb = (MetaBall*)obedit->data; @@ -290,7 +290,7 @@ static int duplicate_metaelems_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int duplicate_metaelems_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int duplicate_metaelems_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { int retv= duplicate_metaelems_exec(C, op); @@ -325,7 +325,7 @@ void MBALL_OT_duplicate_metaelems(wmOperatorType *ot) /***************************** Delete operator *****************************/ /* Delete all selected MetaElems (not MetaBall) */ -static int delete_metaelems_exec(bContext *C, wmOperator *op) +static int delete_metaelems_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); MetaBall *mb= (MetaBall*)obedit->data; @@ -420,7 +420,7 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot) /***************************** Unhide operator *****************************/ /* Unhide all edited MetaElems */ -static int reveal_metaelems_exec(bContext *C, wmOperator *op) +static int reveal_metaelems_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); MetaBall *mb= (MetaBall*)obedit->data; diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 8661cbc680a..9de6d002a43 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -218,7 +218,7 @@ static void object_add_generic_invoke_options(bContext *C, wmOperator *op) } } -int ED_object_add_generic_invoke(bContext *C, wmOperator *op, wmEvent *event) +int ED_object_add_generic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { object_add_generic_invoke_options(C, op); return op->type->exec(C, op); @@ -537,7 +537,7 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int object_metaball_add_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int object_metaball_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Object *obedit= CTX_data_edit_object(C); uiPopupMenu *pup; @@ -805,7 +805,7 @@ void ED_base_object_free_and_unlink(Main *bmain, Scene *scene, Base *base) MEM_freeN(base); } -static int object_delete_exec(bContext *C, wmOperator *op) +static int object_delete_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -1005,7 +1005,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base) base->object->transflag &= ~OB_DUPLI; } -static int object_duplicates_make_real_exec(bContext *C, wmOperator *op) +static int object_duplicates_make_real_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index f81e73faf73..a921620fa71 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -241,7 +241,7 @@ static void bake_freejob(void *bkv) } /* catch esc */ -static int objects_bake_render_modal(bContext *C, wmOperator *op, wmEvent *event) +static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { /* no running blender, remove handler and pass through */ if(0==WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C))) @@ -256,7 +256,7 @@ static int objects_bake_render_modal(bContext *C, wmOperator *op, wmEvent *event return OPERATOR_PASS_THROUGH; } -static int objects_bake_render_invoke(bContext *C, wmOperator *op, wmEvent *_event) +static int objects_bake_render_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(_event)) { Scene *scene= CTX_data_scene(C); diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index fd3c8b165c0..ab3c649299c 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -562,7 +562,7 @@ static int stretchto_reset_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int stretchto_reset_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int stretchto_reset_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return stretchto_reset_exec(C, op); @@ -605,7 +605,7 @@ static int limitdistance_reset_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int limitdistance_reset_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int limitdistance_reset_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return limitdistance_reset_exec(C, op); @@ -692,7 +692,7 @@ static int childof_set_inverse_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int childof_set_inverse_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int childof_set_inverse_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return childof_set_inverse_exec(C, op); @@ -731,7 +731,7 @@ static int childof_clear_inverse_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int childof_clear_inverse_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int childof_clear_inverse_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return childof_clear_inverse_exec(C, op); @@ -794,7 +794,7 @@ static int constraint_poll(bContext *C) return (ptr.id.data && ptr.data); } -static int constraint_delete_exec (bContext *C, wmOperator *op) +static int constraint_delete_exec (bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint); Object *ob= ptr.id.data; @@ -855,7 +855,7 @@ static int constraint_move_down_exec (bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int constraint_move_down_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int constraint_move_down_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return constraint_move_down_exec(C, op); @@ -903,7 +903,7 @@ static int constraint_move_up_exec (bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int constraint_move_up_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int constraint_move_up_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return constraint_move_up_exec(C, op); @@ -932,7 +932,7 @@ void CONSTRAINT_OT_move_up (wmOperatorType *ot) /************************ remove constraint operators *********************/ -static int pose_constraints_clear_exec(bContext *C, wmOperator *op) +static int pose_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -969,7 +969,7 @@ void POSE_OT_constraints_clear(wmOperatorType *ot) } -static int object_constraints_clear_exec(bContext *C, wmOperator *op) +static int object_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -1047,7 +1047,7 @@ void POSE_OT_constraints_copy(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int object_constraint_copy_exec(bContext *C, wmOperator *op) +static int object_constraint_copy_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1466,7 +1466,7 @@ void POSE_OT_constraint_add_with_targets(wmOperatorType *ot) // TODO: should these be here, or back in editors/armature/poseobject.c again? /* present menu with options + validation for targets to use */ -static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) { Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); bPoseChannel *pchan= get_active_posechannel(ob); @@ -1550,7 +1550,7 @@ void POSE_OT_ik_add(wmOperatorType *ot) /* ------------------ */ /* remove IK constraints from selected bones */ -static int pose_ik_clear_exec(bContext *C, wmOperator *op) +static int pose_ik_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index b7f05a2e332..5882478f05e 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -120,7 +120,7 @@ Object *ED_object_active_context(bContext *C) /* ********* clear/set restrict view *********/ -static int object_hide_view_clear_exec(bContext *C, wmOperator *op) +static int object_hide_view_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); ScrArea *sa= CTX_wm_area(C); @@ -219,7 +219,7 @@ void OBJECT_OT_hide_view_set(wmOperatorType *ot) } /* 99% same as above except no need for scene refreshing (TODO, update render preview) */ -static int object_hide_render_clear_exec(bContext *C, wmOperator *op) +static int object_hide_render_clear_exec(bContext *C, wmOperator *UNUSED(op)) { short changed= 0; @@ -506,7 +506,7 @@ void ED_object_enter_editmode(bContext *C, int flag) if(flag & EM_WAITCURSOR) waitcursor(0); } -static int editmode_toggle_exec(bContext *C, wmOperator *op) +static int editmode_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { if(!CTX_data_edit_object(C)) ED_object_enter_editmode(C, EM_WAITCURSOR); @@ -549,7 +549,7 @@ void OBJECT_OT_editmode_toggle(wmOperatorType *ot) /* *************************** */ -static int posemode_exec(bContext *C, wmOperator *op) +static int posemode_exec(bContext *C, wmOperator *UNUSED(op)) { Base *base= CTX_data_active_base(C); @@ -1525,7 +1525,7 @@ void ED_objects_recalculate_paths(bContext *C, Scene *scene) /* For the object with pose/action: create path curves for selected bones * This recalculates the WHOLE path within the pchan->pathsf and pchan->pathef range */ -static int object_calculate_paths_exec (bContext *C, wmOperator *op) +static int object_calculate_paths_exec (bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); @@ -1580,7 +1580,7 @@ void ED_objects_clear_paths(bContext *C, Scene *scene) } /* operator callback for this */ -static int object_clear_paths_exec (bContext *C, wmOperator *op) +static int object_clear_paths_exec (bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); @@ -1890,7 +1890,7 @@ static const char *object_mode_op_string(int mode) /* checks the mode to be set is compatible with the object * should be made into a generic function */ -static int object_mode_set_compat(bContext *C, wmOperator *op, Object *ob) +static int object_mode_set_compat(bContext *UNUSED(C), wmOperator *op, Object *ob) { ObjectMode mode = RNA_enum_get(op->ptr, "mode"); @@ -1999,7 +1999,7 @@ void ED_object_toggle_modes(bContext *C, int mode) /************************ Game Properties ***********************/ -static int game_property_new(bContext *C, wmOperator *op) +static int game_property_new(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_active_object(C); bProperty *prop; @@ -2164,7 +2164,7 @@ void OBJECT_OT_game_property_copy(wmOperatorType *ot) ot->prop=prop; } -static int game_property_clear_exec(bContext *C, wmOperator *op) +static int game_property_clear_exec(bContext *C, wmOperator *UNUSED(op)) { CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) { free_properties(&ob_iter->prop); @@ -2190,7 +2190,7 @@ void OBJECT_OT_game_property_clear(wmOperatorType *ot) /************************ Copy Logic Bricks ***********************/ -static int logicbricks_copy_exec(bContext *C, wmOperator *op) +static int logicbricks_copy_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob=ED_object_active_context(C); diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c index f000485466f..99e27d8a286 100644 --- a/source/blender/editors/object/object_group.c +++ b/source/blender/editors/object/object_group.c @@ -149,7 +149,7 @@ void GROUP_OT_objects_remove_active(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int group_objects_remove_exec(bContext *C, wmOperator *op) +static int group_objects_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -224,7 +224,7 @@ void GROUP_OT_create(wmOperatorType *ot) /****************** properties window operators *********************/ -static int group_add_exec(bContext *C, wmOperator *op) +static int group_add_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -293,7 +293,7 @@ void OBJECT_OT_group_link(wmOperatorType *ot) ot->prop= prop; } -static int group_remove_exec(bContext *C, wmOperator *op) +static int group_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 75e22d5356f..e6511b82eeb 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -504,7 +504,7 @@ void OBJECT_OT_hook_add_selobj(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int object_add_hook_newob_exec(bContext *C, wmOperator *op) +static int object_add_hook_newob_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c index 9f82a1209cf..708aa38d3ea 100644 --- a/source/blender/editors/object/object_lattice.c +++ b/source/blender/editors/object/object_lattice.c @@ -259,7 +259,7 @@ int make_regular_poll(bContext *C) return (ob && ob->type==OB_LATTICE); } -int make_regular_exec(bContext *C, wmOperator *op) +int make_regular_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_edit_object(C); Lattice *lt; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index aac5129c6a9..1c22c1820ce 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -667,7 +667,7 @@ static int modifier_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_remove_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int modifier_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_remove_exec(C, op); @@ -706,7 +706,7 @@ static int modifier_move_up_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_move_up_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int modifier_move_up_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_move_up_exec(C, op); @@ -745,7 +745,7 @@ static int modifier_move_down_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_move_down_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int modifier_move_down_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_move_down_exec(C, op); @@ -787,7 +787,7 @@ static int modifier_apply_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_apply_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int modifier_apply_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_apply_exec(C, op); @@ -835,7 +835,7 @@ static int modifier_convert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_convert_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int modifier_convert_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_convert_exec(C, op); @@ -874,7 +874,7 @@ static int modifier_copy_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_copy_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int modifier_copy_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_copy_exec(C, op); @@ -919,7 +919,7 @@ static int multires_higher_levels_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_higher_levels_delete_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int multires_higher_levels_delete_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return multires_higher_levels_delete_exec(C, op); @@ -959,7 +959,7 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_subdivide_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int multires_subdivide_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return multires_subdivide_exec(C, op); @@ -1017,7 +1017,7 @@ static int multires_reshape_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_reshape_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int multires_reshape_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return multires_reshape_exec(C, op); @@ -1066,7 +1066,7 @@ static int multires_external_save_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Object *ob = ED_object_active_context(C); MultiresModifierData *mmd; @@ -1120,7 +1120,7 @@ void OBJECT_OT_multires_external_save(wmOperatorType *ot) /****************** multires pack operator *********************/ -static int multires_external_pack_exec(bContext *C, wmOperator *op) +static int multires_external_pack_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_active_context(C); Mesh *me= ob->data; @@ -1210,7 +1210,7 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int meshdeform_bind_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int meshdeform_bind_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return meshdeform_bind_exec(C, op); @@ -1258,7 +1258,7 @@ static int explode_refresh_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int explode_refresh_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int explode_refresh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return explode_refresh_exec(C, op); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 6a107b8e204..2a01c870ad6 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -672,7 +672,7 @@ static int parent_set_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int parent_set_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { Object *ob= CTX_data_active_object(C); uiPopupMenu *pup= uiPupMenuBegin(C, "Set Parent To", 0); @@ -779,7 +779,7 @@ void OBJECT_OT_parent_no_inverse_set(wmOperatorType *ot) /************************ Clear Slow Parent Operator *********************/ -static int object_slow_parent_clear_exec(bContext *C, wmOperator *op) +static int object_slow_parent_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -821,7 +821,7 @@ void OBJECT_OT_slow_parent_clear(wmOperatorType *ot) /********************** Make Slow Parent Operator *********************/ -static int object_slow_parent_set_exec(bContext *C, wmOperator *op) +static int object_slow_parent_set_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 20346ab080e..a3c65851d3a 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -679,7 +679,7 @@ void OBJECT_OT_select_by_layer(wmOperatorType *ot) /************************** Select Inverse *************************/ -static int object_select_inverse_exec(bContext *C, wmOperator *op) +static int object_select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) { CTX_DATA_BEGIN(C, Base*, base, visible_bases) { if (base->flag & SELECT) diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 0effa01553b..33f3534bb3b 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -267,7 +267,7 @@ void OBJECT_OT_shape_key_add(wmOperatorType *ot) RNA_def_boolean(ot->srna, "from_mix", 1, "From Mix", "Create the new shape key from the existing mix of keys."); } -static int shape_key_remove_exec(bContext *C, wmOperator *op) +static int shape_key_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -292,7 +292,7 @@ void OBJECT_OT_shape_key_remove(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int shape_key_clear_exec(bContext *C, wmOperator *op) +static int shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Key *key= ob_get_key(ob); @@ -325,7 +325,7 @@ void OBJECT_OT_shape_key_clear(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int shape_key_mirror_exec(bContext *C, wmOperator *op) +static int shape_key_mirror_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 1551db73e74..66c5ab4ec4b 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -64,7 +64,7 @@ /*************************** Clear Transformation ****************************/ -static int object_location_clear_exec(bContext *C, wmOperator *op) +static int object_location_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -125,7 +125,7 @@ void OBJECT_OT_location_clear(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int object_rotation_clear_exec(bContext *C, wmOperator *op) +static int object_rotation_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -270,7 +270,7 @@ void OBJECT_OT_rotation_clear(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int object_scale_clear_exec(bContext *C, wmOperator *op) +static int object_scale_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -336,7 +336,7 @@ void OBJECT_OT_scale_clear(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int object_origin_clear_exec(bContext *C, wmOperator *op) +static int object_origin_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); float *v1, *v3, mat[3][3]; @@ -567,7 +567,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo return OPERATOR_FINISHED; } -static int visual_transform_apply_exec(bContext *C, wmOperator *op) +static int visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); int change = 0; diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 76af8feda82..c8c5492c966 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1438,7 +1438,7 @@ static int vertex_group_poll_edit(bContext *C) return vgroup_object_in_edit_mode(ob); } -static int vertex_group_add_exec(bContext *C, wmOperator *op) +static int vertex_group_add_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -1561,7 +1561,7 @@ void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot) RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups."); } -static int vertex_group_select_exec(bContext *C, wmOperator *op) +static int vertex_group_select_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_edit_object(C); @@ -1588,7 +1588,7 @@ void OBJECT_OT_vertex_group_select(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int vertex_group_deselect_exec(bContext *C, wmOperator *op) +static int vertex_group_deselect_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_edit_object(C); @@ -1612,7 +1612,7 @@ void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int vertex_group_copy_exec(bContext *C, wmOperator *op) +static int vertex_group_copy_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -1671,7 +1671,7 @@ void OBJECT_OT_vertex_group_levels(wmOperatorType *ot) RNA_def_float(ot->srna, "gain", 1.f, 0.f, FLT_MAX, "Gain", "Value to multiply weights by.", 0.0f, 10.f); } -static int vertex_group_normalize_exec(bContext *C, wmOperator *op) +static int vertex_group_normalize_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -1760,7 +1760,7 @@ void OBJECT_OT_vertex_group_invert(wmOperatorType *ot) } -static int vertex_group_blend_exec(bContext *C, wmOperator *op) +static int vertex_group_blend_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -1860,7 +1860,7 @@ void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot) } -static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *op) +static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -1901,7 +1901,7 @@ void OBJECT_OT_vertex_group_copy_to_linked(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op) +static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obact= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c index a18890881a8..0ba76bbe34c 100644 --- a/source/blender/editors/physics/particle_boids.c +++ b/source/blender/editors/physics/particle_boids.c @@ -98,7 +98,7 @@ void BOID_OT_rule_add(wmOperatorType *ot) ot->prop= RNA_def_enum(ot->srna, "type", boidrule_type_items, 0, "Type", ""); } -static int rule_del_exec(bContext *C, wmOperator *op) +static int rule_del_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -149,7 +149,7 @@ void BOID_OT_rule_del(wmOperatorType *ot) } /************************ move up/down boid rule operators *********************/ -static int rule_move_up_exec(bContext *C, wmOperator *op) +static int rule_move_up_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -187,7 +187,7 @@ void BOID_OT_rule_move_up(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int rule_move_down_exec(bContext *C, wmOperator *op) +static int rule_move_down_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -227,7 +227,7 @@ void BOID_OT_rule_move_down(wmOperatorType *ot) /************************ add/del boid state operators *********************/ -static int state_add_exec(bContext *C, wmOperator *op) +static int state_add_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -266,7 +266,7 @@ void BOID_OT_state_add(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int state_del_exec(bContext *C, wmOperator *op) +static int state_del_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -322,7 +322,7 @@ void BOID_OT_state_del(wmOperatorType *ot) } /************************ move up/down boid state operators *********************/ -static int state_move_up_exec(bContext *C, wmOperator *op) +static int state_move_up_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -359,7 +359,7 @@ void BOID_OT_state_move_up(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int state_move_down_exec(bContext *C, wmOperator *op) +static int state_move_down_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 132533fc123..610f6d95d42 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -1387,7 +1387,7 @@ static void select_root(PEData *data, int point_index) data->edit->points[point_index].flag |= PEP_EDIT_RECALC; /* redraw selection only */ } -static int select_roots_exec(bContext *C, wmOperator *op) +static int select_roots_exec(bContext *C, wmOperator *UNUSED(op)) { PEData data; @@ -1427,7 +1427,7 @@ static void select_tip(PEData *data, int point_index) point->flag |= PEP_EDIT_RECALC; /* redraw selection only */ } -static int select_tips_exec(bContext *C, wmOperator *op) +static int select_tips_exec(bContext *C, wmOperator *UNUSED(op)) { PEData data; @@ -1690,7 +1690,7 @@ void PARTICLE_OT_hide(wmOperatorType *ot) /*************************** reveal operator **************************/ -static int reveal_exec(bContext *C, wmOperator *op) +static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_active_object(C); Scene *scene= CTX_data_scene(C); @@ -1758,7 +1758,7 @@ static void select_less_keys(PEData *data, int point_index) } } -static int select_less_exec(bContext *C, wmOperator *op) +static int select_less_exec(bContext *C, wmOperator *UNUSED(op)) { PEData data; @@ -1819,7 +1819,7 @@ static void select_more_keys(PEData *data, int point_index) } } -static int select_more_exec(bContext *C, wmOperator *op) +static int select_more_exec(bContext *C, wmOperator *UNUSED(op)) { PEData data; @@ -1846,7 +1846,7 @@ void PARTICLE_OT_select_more(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int select_inverse_exec(bContext *C, wmOperator *op) +static int select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) { PEData data; PTCacheEdit *edit; @@ -2260,7 +2260,7 @@ static void subdivide_particle(PEData *data, int pa_index) pa->flag &= ~PARS_REKEY; } -static int subdivide_exec(bContext *C, wmOperator *op) +static int subdivide_exec(bContext *C, wmOperator *UNUSED(op)) { PEData data; @@ -2734,7 +2734,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged) MEM_freeN(mirrorfaces); } -static int mirror_exec(bContext *C, wmOperator *op) +static int mirror_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); @@ -4084,7 +4084,7 @@ static int particle_edit_toggle_poll(bContext *C) return (ob->particlesystem.first || modifiers_findByType(ob, eModifierType_Cloth) || modifiers_findByType(ob, eModifierType_Softbody)); } -static int particle_edit_toggle_exec(bContext *C, wmOperator *op) +static int particle_edit_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); @@ -4130,7 +4130,7 @@ void PARTICLE_OT_particle_edit_toggle(wmOperatorType *ot) /************************ set editable operator ************************/ -static int clear_edited_exec(bContext *C, wmOperator *op) +static int clear_edited_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_active_object(C); ParticleSystem *psys = psys_get_current(ob); diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index e364a881601..428d8ce6b82 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -60,7 +60,7 @@ /********************** particle system slot operators *********************/ -static int particle_system_add_exec(bContext *C, wmOperator *op) +static int particle_system_add_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Scene *scene = CTX_data_scene(C); @@ -91,7 +91,7 @@ void OBJECT_OT_particle_system_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int particle_system_remove_exec(bContext *C, wmOperator *op) +static int particle_system_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Scene *scene = CTX_data_scene(C); @@ -138,7 +138,7 @@ static int psys_poll(bContext *C) return (ptr.data != NULL); } -static int new_particle_settings_exec(bContext *C, wmOperator *op) +static int new_particle_settings_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); Main *bmain= CTX_data_main(C); @@ -191,7 +191,7 @@ void PARTICLE_OT_new(wmOperatorType *ot) /********************** keyed particle target operators *********************/ -static int new_particle_target_exec(bContext *C, wmOperator *op) +static int new_particle_target_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -237,7 +237,7 @@ void PARTICLE_OT_new_target(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int remove_particle_target_exec(bContext *C, wmOperator *op) +static int remove_particle_target_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -288,7 +288,7 @@ void PARTICLE_OT_target_remove(wmOperatorType *ot) /************************ move up particle target operator *********************/ -static int target_move_up_exec(bContext *C, wmOperator *op) +static int target_move_up_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -327,7 +327,7 @@ void PARTICLE_OT_target_move_up(wmOperatorType *ot) /************************ move down particle target operator *********************/ -static int target_move_down_exec(bContext *C, wmOperator *op) +static int target_move_down_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -365,7 +365,7 @@ void PARTICLE_OT_target_move_down(wmOperatorType *ot) /************************ move up particle dupliweight operator *********************/ -static int dupliob_move_up_exec(bContext *C, wmOperator *op) +static int dupliob_move_up_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -403,7 +403,7 @@ void PARTICLE_OT_dupliob_move_up(wmOperatorType *ot) /********************** particle dupliweight operators *********************/ -static int copy_particle_dupliob_exec(bContext *C, wmOperator *op) +static int copy_particle_dupliob_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -442,7 +442,7 @@ void PARTICLE_OT_dupliob_copy(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int remove_particle_dupliob_exec(bContext *C, wmOperator *op) +static int remove_particle_dupliob_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -487,7 +487,7 @@ void PARTICLE_OT_dupliob_remove(wmOperatorType *ot) /************************ move down particle dupliweight operator *********************/ -static int dupliob_move_down_exec(bContext *C, wmOperator *op) +static int dupliob_move_down_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index 35f86a49aa7..6664dd624b2 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -120,7 +120,7 @@ static int ptcache_bake_all_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int ptcache_free_bake_all_exec(bContext *C, wmOperator *op) +static int ptcache_free_bake_all_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Base *base; @@ -221,7 +221,7 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int ptcache_free_bake_exec(bContext *C, wmOperator *op) +static int ptcache_free_bake_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); PointCache *cache= ptr.data; @@ -241,7 +241,7 @@ static int ptcache_free_bake_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int ptcache_bake_from_cache_exec(bContext *C, wmOperator *op) +static int ptcache_bake_from_cache_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); PointCache *cache= ptr.data; @@ -295,7 +295,7 @@ void PTCACHE_OT_bake_from_cache(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int ptcache_add_new_exec(bContext *C, wmOperator *op) +static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); @@ -320,7 +320,7 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int ptcache_remove_exec(bContext *C, wmOperator *op) +static int ptcache_remove_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); Scene *scene= CTX_data_scene(C); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 083202e5a03..7f34e6fa333 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -596,7 +596,7 @@ static int render_breakjob(void *rjv) } /* catch esc */ -static int screen_render_modal(bContext *C, wmOperator *op, wmEvent *event) +static int screen_render_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { /* no running blender, remove handler and pass through */ if(0==WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C))) { @@ -763,7 +763,7 @@ void RENDER_OT_render(wmOperatorType *ot) /* *********************** cancel render viewer *************** */ -static int render_view_cancel_exec(bContext *C, wmOperator *unused) +static int render_view_cancel_exec(bContext *C, wmOperator *UNUSED(unused)) { wmWindow *win= CTX_wm_window(C); ScrArea *sa= CTX_wm_area(C); @@ -810,7 +810,7 @@ void RENDER_OT_view_cancel(struct wmOperatorType *ot) /* *********************** show render viewer *************** */ -static int render_view_show_invoke(bContext *C, wmOperator *unused, wmEvent *event) +static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(unused), wmEvent *event) { ScrArea *sa= find_area_showing_r_result(C); diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 71a46a16f98..a989171d617 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -254,7 +254,7 @@ void ED_render_id_flush_update(Main *bmain, ID *id) /********************** material slot operators *********************/ -static int material_slot_add_exec(bContext *C, wmOperator *op) +static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -282,7 +282,7 @@ void OBJECT_OT_material_slot_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int material_slot_remove_exec(bContext *C, wmOperator *op) +static int material_slot_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -310,7 +310,7 @@ void OBJECT_OT_material_slot_remove(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int material_slot_assign_exec(bContext *C, wmOperator *op) +static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; @@ -434,7 +434,7 @@ static int material_slot_de_select(bContext *C, int select) return OPERATOR_FINISHED; } -static int material_slot_select_exec(bContext *C, wmOperator *op) +static int material_slot_select_exec(bContext *C, wmOperator *UNUSED(op)) { return material_slot_de_select(C, 1); } @@ -453,7 +453,7 @@ void OBJECT_OT_material_slot_select(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int material_slot_deselect_exec(bContext *C, wmOperator *op) +static int material_slot_deselect_exec(bContext *C, wmOperator *UNUSED(op)) { return material_slot_de_select(C, 0); } @@ -473,7 +473,7 @@ void OBJECT_OT_material_slot_deselect(wmOperatorType *ot) } -static int material_slot_copy_exec(bContext *C, wmOperator *op) +static int material_slot_copy_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Material ***matar; @@ -514,7 +514,7 @@ void OBJECT_OT_material_slot_copy(wmOperatorType *ot) /********************** new material operator *********************/ -static int new_material_exec(bContext *C, wmOperator *op) +static int new_material_exec(bContext *C, wmOperator *UNUSED(op)) { Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data; PointerRNA ptr, idptr; @@ -560,7 +560,7 @@ void MATERIAL_OT_new(wmOperatorType *ot) /********************** new texture operator *********************/ -static int new_texture_exec(bContext *C, wmOperator *op) +static int new_texture_exec(bContext *C, wmOperator *UNUSED(op)) { Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data; PointerRNA ptr, idptr; @@ -606,7 +606,7 @@ void TEXTURE_OT_new(wmOperatorType *ot) /********************** new world operator *********************/ -static int new_world_exec(bContext *C, wmOperator *op) +static int new_world_exec(bContext *C, wmOperator *UNUSED(op)) { World *wo= CTX_data_pointer_get_type(C, "world", &RNA_World).data; PointerRNA ptr, idptr; @@ -652,7 +652,7 @@ void WORLD_OT_new(wmOperatorType *ot) /********************** render layer operators *********************/ -static int render_layer_add_exec(bContext *C, wmOperator *op) +static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); @@ -678,7 +678,7 @@ void SCENE_OT_render_layer_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int render_layer_remove_exec(bContext *C, wmOperator *op) +static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); SceneRenderLayer *rl; @@ -890,7 +890,7 @@ static int envmap_save_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { //Scene *scene= CTX_data_scene(C); @@ -942,7 +942,7 @@ void TEXTURE_OT_envmap_save(wmOperatorType *ot) WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); } -static int envmap_clear_exec(bContext *C, wmOperator *op) +static int envmap_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data; @@ -982,7 +982,7 @@ void TEXTURE_OT_envmap_clear(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int envmap_clear_all_exec(bContext *C, wmOperator *op) +static int envmap_clear_all_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); Tex *tex; @@ -1014,7 +1014,7 @@ void TEXTURE_OT_envmap_clear_all(wmOperatorType *ot) /********************** material operators *********************/ /* material copy/paste */ -static int copy_material_exec(bContext *C, wmOperator *op) +static int copy_material_exec(bContext *C, wmOperator *UNUSED(op)) { Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data; @@ -1042,7 +1042,7 @@ void MATERIAL_OT_copy(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int paste_material_exec(bContext *C, wmOperator *op) +static int paste_material_exec(bContext *C, wmOperator *UNUSED(op)) { Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data; @@ -1142,7 +1142,7 @@ void paste_mtex_copybuf(ID *id) } -static int copy_mtex_exec(bContext *C, wmOperator *op) +static int copy_mtex_exec(bContext *C, wmOperator *UNUSED(op)) { ID *id= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data; @@ -1181,7 +1181,7 @@ void TEXTURE_OT_slot_copy(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int paste_mtex_exec(bContext *C, wmOperator *op) +static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op)) { ID *id= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 6e921b57d9d..5caa6c5045b 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5087,7 +5087,7 @@ static int grab_clone_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int grab_clone_cancel(bContext *C, wmOperator *op) +static int grab_clone_cancel(bContext *UNUSED(C), wmOperator *op) { MEM_freeN(op->customdata); return OPERATOR_CANCELLED; diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index b5cadb9c484..d8544f34fdf 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -42,7 +42,7 @@ //#include /* Brush operators */ -static int brush_add_exec(bContext *C, wmOperator *op) +static int brush_add_exec(bContext *C, wmOperator *UNUSED(op)) { /*int type = RNA_enum_get(op->ptr, "type");*/ Paint *paint = paint_get_active(CTX_data_scene(C)); @@ -129,7 +129,7 @@ void BRUSH_OT_scale_size(wmOperatorType *ot) RNA_def_float(ot->srna, "scalar", 1, 0, 2, "Scalar", "Factor to scale brush size by", 0, 2); } -static int vertex_color_set_exec(bContext *C, wmOperator *op) +static int vertex_color_set_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); Object *obact = CTX_data_active_object(C); @@ -154,7 +154,7 @@ void PAINT_OT_vertex_color_set(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int brush_reset_exec(bContext *C, wmOperator *op) +static int brush_reset_exec(bContext *C, wmOperator *UNUSED(op)) { Paint *paint = paint_get_active(CTX_data_scene(C)); struct Brush *brush = paint_brush(paint); diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 0098b8ca12c..8fee8c7e8fc 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -233,7 +233,7 @@ void BRUSH_OT_curve_preset(wmOperatorType *ot) /* face-select ops */ -static int paint_select_linked_exec(bContext *C, wmOperator *op) +static int paint_select_linked_exec(bContext *C, wmOperator *UNUSED(op)) { select_linked_tfaces(C, CTX_data_active_object(C), NULL, 2); ED_region_tag_redraw(CTX_wm_region(C)); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index f033c2aac83..f5a02e6fb9c 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1061,7 +1061,7 @@ static void do_weight_paint_vertex(VPaint *wp, Object *ob, int index, /* *************** set wpaint operator ****************** */ -static int set_wpaint(bContext *C, wmOperator *op) /* toggle */ +static int set_wpaint(bContext *C, wmOperator *UNUSED(op)) /* toggle */ { Object *ob= CTX_data_active_object(C); Scene *scene= CTX_data_scene(C); @@ -1314,7 +1314,7 @@ static char *wpaint_make_validmap(Mesh *me, Object *ob) return validmap; } -static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *event) +static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Scene *scene= CTX_data_scene(C); struct PaintStroke *stroke = op->customdata; @@ -1663,7 +1663,7 @@ void PAINT_OT_weight_paint(wmOperatorType *ot) RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); } -static int weight_paint_set_exec(bContext *C, wmOperator *op) +static int weight_paint_set_exec(bContext *C, wmOperator *UNUSED(op)) { struct Scene *scene= CTX_data_scene(C); Object *obact = CTX_data_active_object(C); @@ -1780,7 +1780,7 @@ typedef struct VPaintData { float vpimat[3][3]; } VPaintData; -static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent *event) +static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent *UNUSED(event)) { ToolSettings *ts= CTX_data_tool_settings(C); struct PaintStroke *stroke = op->customdata; diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index fe1fe3266bc..18f35502f8b 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -280,7 +280,7 @@ static int unpack_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int unpack_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Editing* ed = CTX_data_scene(C)->ed; bSound* sound; diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 916b0032f17..86adc3d9e8c 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -70,7 +70,7 @@ /* ******************** New Action Operator *********************** */ -static int act_new_exec(bContext *C, wmOperator *op) +static int act_new_exec(bContext *C, wmOperator *UNUSED(op)) { bAction *action; PointerRNA ptr, idptr; @@ -173,7 +173,7 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max) /* ****************** Automatic Preview-Range Operator ****************** */ -static int actkeys_previewrange_exec(bContext *C, wmOperator *op) +static int actkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; Scene *scene; @@ -217,7 +217,7 @@ void ACTION_OT_previewrange_set (wmOperatorType *ot) /* ****************** View-All Operator ****************** */ -static int actkeys_viewall_exec(bContext *C, wmOperator *op) +static int actkeys_viewall_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; View2D *v2d; @@ -521,7 +521,7 @@ static void duplicate_action_keys (bAnimContext *ac) /* ------------------- */ -static int actkeys_duplicate_exec(bContext *C, wmOperator *op) +static int actkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -541,7 +541,7 @@ static int actkeys_duplicate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; // xxx - start transform } -static int actkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int actkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { actkeys_duplicate_exec(C, op); @@ -608,7 +608,7 @@ static void delete_action_keys (bAnimContext *ac) /* ------------------- */ -static int actkeys_delete_exec(bContext *C, wmOperator *op) +static int actkeys_delete_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -734,7 +734,7 @@ static void sample_action_keys (bAnimContext *ac) /* ------------------- */ -static int actkeys_sample_exec(bContext *C, wmOperator *op) +static int actkeys_sample_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -1096,7 +1096,7 @@ void ACTION_OT_keyframe_type (wmOperatorType *ot) /* ***************** Jump to Selected Frames Operator *********************** */ /* snap current-frame indicator to 'average time' of selected keyframe */ -static int actkeys_framejump_exec(bContext *C, wmOperator *op) +static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; ListBase anim_data= {NULL, NULL}; diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index b2c47194384..64d7a12bc4c 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -551,7 +551,7 @@ void ACTION_OT_select_column (wmOperatorType *ot) /* ******************** Select Linked Operator *********************** */ -static int actkeys_select_linked_exec (bContext *C, wmOperator *op) +static int actkeys_select_linked_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -650,7 +650,7 @@ static void select_moreless_action_keys (bAnimContext *ac, short mode) /* ----------------- */ -static int actkeys_select_more_exec (bContext *C, wmOperator *op) +static int actkeys_select_more_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -684,7 +684,7 @@ void ACTION_OT_select_more (wmOperatorType *ot) /* ----------------- */ -static int actkeys_select_less_exec (bContext *C, wmOperator *op) +static int actkeys_select_less_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index c1803dde805..2573470e8df 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -53,7 +53,7 @@ /********************** toolbox operator *********************/ -static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int toolbox_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { bScreen *sc= CTX_wm_screen(C); SpaceButs *sbuts= CTX_wm_space_buts(C); @@ -123,7 +123,7 @@ static int file_browse_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int file_browse_cancel(bContext *C, wmOperator *op) +static int file_browse_cancel(bContext *UNUSED(C), wmOperator *op) { MEM_freeN(op->customdata); op->customdata= NULL; diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index e9764a2d36a..5184e6b7fc0 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -304,7 +304,7 @@ void FILE_OT_select(wmOperatorType *ot) RNA_def_boolean(ot->srna, "fill", 0, "Fill", "Select everything beginning with the last selection."); } -static int file_select_all_exec(bContext *C, wmOperator *op) +static int file_select_all_exec(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); SpaceFile *sfile= CTX_wm_space_file(C); @@ -384,7 +384,7 @@ void FILE_OT_select_bookmark(wmOperatorType *ot) RNA_def_string(ot->srna, "dir", "", 256, "Dir", ""); } -static int bookmark_add_exec(bContext *C, wmOperator *op) +static int bookmark_add_exec(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); SpaceFile *sfile= CTX_wm_space_file(C); @@ -479,7 +479,7 @@ int file_hilight_set(SpaceFile *sfile, ARegion *ar, int mx, int my) return (params->active_file != origfile); } -static int file_highlight_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int file_highlight_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { ARegion *ar= CTX_wm_region(C); SpaceFile *sfile= CTX_wm_space_file(C); @@ -504,7 +504,7 @@ void FILE_OT_highlight(struct wmOperatorType *ot) ot->poll= ED_operator_file_active; } -int file_cancel_exec(bContext *C, wmOperator *unused) +int file_cancel_exec(bContext *C, wmOperator *UNUSED(unused)) { SpaceFile *sfile= CTX_wm_space_file(C); wmOperator *op = sfile->op; @@ -704,7 +704,7 @@ void FILE_OT_execute(struct wmOperatorType *ot) } -int file_parent_exec(bContext *C, wmOperator *unused) +int file_parent_exec(bContext *C, wmOperator *UNUSED(unused)) { SpaceFile *sfile= CTX_wm_space_file(C); @@ -735,7 +735,7 @@ void FILE_OT_parent(struct wmOperatorType *ot) } -int file_refresh_exec(bContext *C, wmOperator *unused) +int file_refresh_exec(bContext *C, wmOperator *UNUSED(unused)) { SpaceFile *sfile= CTX_wm_space_file(C); @@ -759,7 +759,7 @@ void FILE_OT_previous(struct wmOperatorType *ot) ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ } -int file_previous_exec(bContext *C, wmOperator *unused) +int file_previous_exec(bContext *C, wmOperator *UNUSED(unused)) { SpaceFile *sfile= CTX_wm_space_file(C); @@ -790,7 +790,7 @@ void FILE_OT_next(struct wmOperatorType *ot) ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ } -int file_next_exec(bContext *C, wmOperator *unused) +int file_next_exec(bContext *C, wmOperator *UNUSED(unused)) { SpaceFile *sfile= CTX_wm_space_file(C); if(sfile->params) { @@ -812,7 +812,7 @@ int file_next_exec(bContext *C, wmOperator *unused) /* only meant for timer usage */ -static int file_smoothscroll_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { ScrArea *sa = CTX_wm_area(C); SpaceFile *sfile= CTX_wm_space_file(C); @@ -995,7 +995,7 @@ void FILE_OT_directory_new(struct wmOperatorType *ot) ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ } -int file_directory_exec(bContext *C, wmOperator *unused) +int file_directory_exec(bContext *C, wmOperator *UNUSED(unused)) { SpaceFile *sfile= CTX_wm_space_file(C); @@ -1021,7 +1021,7 @@ int file_directory_exec(bContext *C, wmOperator *unused) return OPERATOR_FINISHED; } -int file_filename_exec(bContext *C, wmOperator *unused) +int file_filename_exec(bContext *C, wmOperator *UNUSED(unused)) { SpaceFile *sfile= CTX_wm_space_file(C); @@ -1049,7 +1049,7 @@ void FILE_OT_refresh(struct wmOperatorType *ot) ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ } -int file_hidedot_exec(bContext *C, wmOperator *unused) +int file_hidedot_exec(bContext *C, wmOperator *UNUSED(unused)) { SpaceFile *sfile= CTX_wm_space_file(C); @@ -1102,7 +1102,7 @@ struct ARegion *file_buttons_region(struct ScrArea *sa) return arnew; } -int file_bookmark_toggle_exec(bContext *C, wmOperator *unused) +int file_bookmark_toggle_exec(bContext *C, wmOperator *UNUSED(unused)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= file_buttons_region(sa); @@ -1158,7 +1158,7 @@ void FILE_OT_filenum(struct wmOperatorType *ot) RNA_def_int(ot->srna, "increment", 1, 0, 100, "Increment", "", 0,100); } -int file_rename_exec(bContext *C, wmOperator *op) +int file_rename_exec(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); @@ -1232,7 +1232,7 @@ int file_delete_poll(bContext *C) return poll; } -int file_delete_exec(bContext *C, wmOperator *op) +int file_delete_exec(bContext *C, wmOperator *UNUSED(op)) { char str[FILE_MAX]; SpaceFile *sfile= CTX_wm_space_file(C); diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index f4567255b91..568c76f3dfc 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -733,7 +733,7 @@ void graph_buttons_register(ARegionType *art) BLI_addtail(&art->paneltypes, pt); } -static int graph_properties(bContext *C, wmOperator *op) +static int graph_properties(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= graph_has_buttons_region(sa); diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 5c692ba1112..41c653048e8 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -140,7 +140,7 @@ void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xmax, flo /* ****************** Automatic Preview-Range Operator ****************** */ -static int graphkeys_previewrange_exec(bContext *C, wmOperator *op) +static int graphkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; Scene *scene; @@ -183,7 +183,7 @@ void GRAPH_OT_previewrange_set (wmOperatorType *ot) /* ****************** View-All Operator ****************** */ -static int graphkeys_viewall_exec(bContext *C, wmOperator *op) +static int graphkeys_viewall_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; View2D *v2d; @@ -305,7 +305,7 @@ static void create_ghost_curves (bAnimContext *ac, int start, int end) /* ------------------- */ -static int graphkeys_create_ghostcurves_exec(bContext *C, wmOperator *op) +static int graphkeys_create_ghostcurves_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; View2D *v2d; @@ -349,7 +349,7 @@ void GRAPH_OT_ghost_curves_create (wmOperatorType *ot) /* ******************** Clear Ghost-Curves Operator *********************** */ /* This operator clears the 'ghost curves' for the active Graph Editor */ -static int graphkeys_clear_ghostcurves_exec(bContext *C, wmOperator *op) +static int graphkeys_clear_ghostcurves_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; SpaceIpo *sipo; @@ -719,7 +719,7 @@ static void duplicate_graph_keys (bAnimContext *ac) /* ------------------- */ -static int graphkeys_duplicate_exec(bContext *C, wmOperator *op) +static int graphkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -739,7 +739,7 @@ static int graphkeys_duplicate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int graphkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int graphkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { graphkeys_duplicate_exec(C, op); @@ -799,7 +799,7 @@ static void delete_graph_keys (bAnimContext *ac) /* ------------------- */ -static int graphkeys_delete_exec(bContext *C, wmOperator *op) +static int graphkeys_delete_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -935,7 +935,7 @@ static void bake_graph_curves (bAnimContext *ac, int start, int end) /* ------------------- */ -static int graphkeys_bake_exec(bContext *C, wmOperator *op) +static int graphkeys_bake_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; Scene *scene= NULL; @@ -1149,7 +1149,7 @@ static void sample_graph_keys (bAnimContext *ac) /* ------------------- */ -static int graphkeys_sample_exec(bContext *C, wmOperator *op) +static int graphkeys_sample_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -1530,7 +1530,7 @@ void GRAPH_OT_euler_filter (wmOperatorType *ot) /* ***************** Jump to Selected Frames Operator *********************** */ /* snap current-frame indicator to 'average time' of selected keyframe */ -static int graphkeys_framejump_exec(bContext *C, wmOperator *op) +static int graphkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; ListBase anim_data= {NULL, NULL}; @@ -1835,7 +1835,7 @@ void GRAPH_OT_mirror (wmOperatorType *ot) /* ******************** Smooth Keyframes Operator *********************** */ -static int graphkeys_smooth_exec(bContext *C, wmOperator *op) +static int graphkeys_smooth_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; ListBase anim_data = {NULL, NULL}; @@ -1890,7 +1890,7 @@ void GRAPH_OT_smooth (wmOperatorType *ot) /* ******************** Add F-Modifier Operator *********************** */ /* present a special customised popup menu for this, with some filtering */ -static int graph_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *event) +static int graph_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { uiPopupMenu *pup; uiLayout *layout; diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 0069e6e0675..b4ca1b8c901 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -181,7 +181,7 @@ void GRAPH_OT_cursor_set(wmOperatorType *ot) /* Toggle Handles ----------------------------------------------------------------- */ -static int view_toggle_handles_exec (bContext *C, wmOperator *op) +static int view_toggle_handles_exec (bContext *C, wmOperator *UNUSED(op)) { SpaceIpo *sipo= CTX_wm_space_graph(C); ARegion *ar= CTX_wm_region(C); diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index cdc8166f2d6..9dd499a2cbf 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -539,7 +539,7 @@ void GRAPH_OT_select_column (wmOperatorType *ot) /* ******************** Select Linked Operator *********************** */ -static int graphkeys_select_linked_exec (bContext *C, wmOperator *op) +static int graphkeys_select_linked_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -638,7 +638,7 @@ static void select_moreless_graph_keys (bAnimContext *ac, short mode) /* ----------------- */ -static int graphkeys_select_more_exec (bContext *C, wmOperator *op) +static int graphkeys_select_more_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -672,7 +672,7 @@ void GRAPH_OT_select_more (wmOperatorType *ot) /* ----------------- */ -static int graphkeys_select_less_exec (bContext *C, wmOperator *op) +static int graphkeys_select_less_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 51767d3e006..c87b25877b4 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -73,7 +73,7 @@ static int pack_all_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int pack_all_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int pack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Main *bmain= CTX_data_main(C); Image *ima; @@ -133,7 +133,7 @@ static int unpack_all_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Main *bmain= CTX_data_main(C); uiPopupMenu *pup; @@ -184,7 +184,7 @@ void FILE_OT_unpack_all(wmOperatorType *ot) /********************* make paths relative operator *********************/ -static int make_paths_relative_exec(bContext *C, wmOperator *op) +static int make_paths_relative_exec(bContext *UNUSED(C), wmOperator *op) { if(!G.relbase_valid) { BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file."); @@ -211,7 +211,7 @@ void FILE_OT_make_paths_relative(wmOperatorType *ot) /********************* make paths absolute operator *********************/ -static int make_paths_absolute_exec(bContext *C, wmOperator *op) +static int make_paths_absolute_exec(bContext *UNUSED(C), wmOperator *op) { if(!G.relbase_valid) { BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file."); @@ -237,7 +237,7 @@ void FILE_OT_make_paths_absolute(wmOperatorType *ot) /********************* report missing files operator *********************/ -static int report_missing_files_exec(bContext *C, wmOperator *op) +static int report_missing_files_exec(bContext *UNUSED(C), wmOperator *op) { char txtname[24]; /* text block name */ @@ -264,7 +264,7 @@ void FILE_OT_report_missing_files(wmOperatorType *ot) /********************* find missing files operator *********************/ -static int find_missing_files_exec(bContext *C, wmOperator *op) +static int find_missing_files_exec(bContext *UNUSED(C), wmOperator *op) { char *path; @@ -275,7 +275,7 @@ static int find_missing_files_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int find_missing_files_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int find_missing_files_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { /* XXX file open button text "Find Missing Files" */ WM_event_add_fileselect(C, op); @@ -313,7 +313,7 @@ void FILE_OT_find_missing_files(wmOperatorType *ot) #define ERROR_TIMEOUT 10.0 #define ERROR_COLOR_TIMEOUT 6.0 #define COLLAPSE_TIMEOUT 0.2 -static int update_reports_display_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { wmWindowManager *wm= CTX_wm_manager(C); ReportList *reports= CTX_wm_reports(C); diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c index d8dfd8cb52d..195bc5df3c7 100644 --- a/source/blender/editors/space_logic/logic_buttons.c +++ b/source/blender/editors/space_logic/logic_buttons.c @@ -103,7 +103,7 @@ void logic_buttons_register(ARegionType *art) } -static int logic_properties(bContext *C, wmOperator *op) +static int logic_properties(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= logic_has_buttons_region(sa); diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c index 4641fd2ce61..5c498a59884 100644 --- a/source/blender/editors/space_logic/logic_ops.c +++ b/source/blender/editors/space_logic/logic_ops.c @@ -238,7 +238,7 @@ static int sensor_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } - static int sensor_remove_invoke(bContext *C, wmOperator *op, wmEvent *event) + static int sensor_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_sensor_invoke_properties(C, op)) return sensor_remove_exec(C, op); @@ -341,7 +341,7 @@ static int controller_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } - static int controller_remove_invoke(bContext *C, wmOperator *op, wmEvent *event) + static int controller_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_controller_invoke_properties(C, op)) return controller_remove_exec(C, op); @@ -455,7 +455,7 @@ static int actuator_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int actuator_remove_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int actuator_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_actuator_invoke_properties(C, op)) return actuator_remove_exec(C, op); @@ -562,7 +562,7 @@ static int sensor_move_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sensor_move_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sensor_move_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_sensor_invoke_properties(C, op)) { return sensor_move_exec(C, op); @@ -607,7 +607,7 @@ static int controller_move_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int controller_move_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int controller_move_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_controller_invoke_properties(C, op)) { return controller_move_exec(C, op); @@ -652,7 +652,7 @@ static int actuator_move_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int actuator_move_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int actuator_move_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (edit_actuator_invoke_properties(C, op)) { return actuator_move_exec(C, op); diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index a728cc900c2..ef91fc56bec 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -477,7 +477,7 @@ void nla_buttons_register(ARegionType *art) BLI_addtail(&art->paneltypes, pt); } -static int nla_properties(bContext *C, wmOperator *op) +static int nla_properties(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= nla_has_buttons_region(sa); diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index b00cba676d0..3cf1dcb5f68 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -433,7 +433,7 @@ void NLA_OT_tracks_add (wmOperatorType *ot) /* ******************** Delete Tracks Operator ***************************** */ /* Delete selected NLA Tracks */ -static int nlaedit_delete_tracks_exec (bContext *C, wmOperator *op) +static int nlaedit_delete_tracks_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 247987cda9f..f2e83f4168e 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -457,7 +457,7 @@ void NLA_OT_transition_add (wmOperatorType *ot) /* Add new meta-strips incorporating the selected strips */ /* add the specified action as new strip */ -static int nlaedit_add_meta_exec (bContext *C, wmOperator *op) +static int nlaedit_add_meta_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -518,7 +518,7 @@ void NLA_OT_meta_add (wmOperatorType *ot) /* ******************** Remove Meta-Strip Operator ***************************** */ /* Separate out the strips held by the selected meta-strips */ -static int nlaedit_remove_meta_exec (bContext *C, wmOperator *op) +static int nlaedit_remove_meta_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -572,7 +572,7 @@ void NLA_OT_meta_remove (wmOperatorType *ot) * the originals were housed in. */ -static int nlaedit_duplicate_exec (bContext *C, wmOperator *op) +static int nlaedit_duplicate_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -645,7 +645,7 @@ static int nlaedit_duplicate_exec (bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { nlaedit_duplicate_exec(C, op); @@ -677,7 +677,7 @@ void NLA_OT_duplicate (wmOperatorType *ot) /* ******************** Delete Strips Operator ***************************** */ /* Deletes the selected NLA-Strips */ -static int nlaedit_delete_exec (bContext *C, wmOperator *op) +static int nlaedit_delete_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -818,7 +818,7 @@ static void nlaedit_split_strip_meta (AnimData *adt, NlaTrack *nlt, NlaStrip *st /* ----- */ -static int nlaedit_split_exec (bContext *C, wmOperator *op) +static int nlaedit_split_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -893,7 +893,7 @@ void NLA_OT_split (wmOperatorType *ot) /* ******************** Bake Strips Operator ***************************** */ /* Bakes the NLA Strips for the active AnimData blocks */ -static int nlaedit_bake_exec (bContext *C, wmOperator *op) +static int nlaedit_bake_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -949,7 +949,7 @@ void NLA_OT_bake (wmOperatorType *ot) /* ******************** Toggle Muting Operator ************************** */ /* Toggles whether strips are muted or not */ -static int nlaedit_toggle_mute_exec (bContext *C, wmOperator *op) +static int nlaedit_toggle_mute_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -1008,7 +1008,7 @@ void NLA_OT_mute_toggle (wmOperatorType *ot) /* ******************** Move Strips Up Operator ************************** */ /* Tries to move the selected strips into the track above if possible. */ -static int nlaedit_move_up_exec (bContext *C, wmOperator *op) +static int nlaedit_move_up_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -1082,7 +1082,7 @@ void NLA_OT_move_up (wmOperatorType *ot) /* ******************** Move Strips Down Operator ************************** */ /* Tries to move the selected strips into the track above if possible. */ -static int nlaedit_move_down_exec (bContext *C, wmOperator *op) +static int nlaedit_move_down_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -1250,7 +1250,7 @@ static short bezt_apply_nlamapping (KeyframeEditData *ked, BezTriple *bezt) return 0; } -static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op) +static int nlaedit_apply_scale_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -1333,7 +1333,7 @@ void NLA_OT_apply_scale (wmOperatorType *ot) /* ******************** Clear Scale Operator ***************************** */ /* Reset the scaling of the selected strips to 1.0f */ -static int nlaedit_clear_scale_exec (bContext *C, wmOperator *op) +static int nlaedit_clear_scale_exec (bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; @@ -1544,7 +1544,7 @@ void NLA_OT_snap (wmOperatorType *ot) /* ******************** Add F-Modifier Operator *********************** */ /* present a special customised popup menu for this, with some filtering */ -static int nla_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *event) +static int nla_fmodifier_add_invoke (bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { uiPopupMenu *pup; uiLayout *layout; diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c index 11319d817c7..ca42193bff6 100644 --- a/source/blender/editors/space_node/node_buttons.c +++ b/source/blender/editors/space_node/node_buttons.c @@ -135,7 +135,7 @@ void node_buttons_register(ARegionType *art) BLI_addtail(&art->paneltypes, pt); } -static int node_properties(bContext *C, wmOperator *op) +static int node_properties(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= node_has_buttons_region(sa); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 968391f271e..42aec17cc8f 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -541,7 +541,7 @@ void snode_make_group_editable(SpaceNode *snode, bNode *gnode) ntreeSolveOrder(snode->nodetree); } -static int node_group_edit_exec(bContext *C, wmOperator *op) +static int node_group_edit_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode = CTX_wm_space_node(C); bNode *gnode; @@ -556,7 +556,7 @@ static int node_group_edit_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_group_edit_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int node_group_edit_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { SpaceNode *snode = CTX_wm_space_node(C); bNode *gnode; @@ -1100,7 +1100,7 @@ static void node_link_viewer(SpaceNode *snode, bNode *tonode) } -static int node_active_link_viewer(bContext *C, wmOperator *op) +static int node_active_link_viewer(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); bNode *node; @@ -1472,7 +1472,7 @@ bNode *node_add_node(SpaceNode *snode, Scene *scene, int type, float locx, float /* ****************** Duplicate *********************** */ -static int node_duplicate_exec(bContext *C, wmOperator *op) +static int node_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); @@ -1851,7 +1851,7 @@ void NODE_OT_links_cut(wmOperatorType *ot) // XXX some code needing updating to operators... /* goes over all scenes, reads render layers */ -static int node_read_renderlayers_exec(bContext *C, wmOperator *op) +static int node_read_renderlayers_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); SpaceNode *snode= CTX_wm_space_node(C); @@ -1893,7 +1893,7 @@ void NODE_OT_read_renderlayers(wmOperatorType *ot) ot->flag= 0; } -static int node_read_fullsamplelayers_exec(bContext *C, wmOperator *op) +static int node_read_fullsamplelayers_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); Scene *curscene= CTX_data_scene(C); @@ -2015,7 +2015,7 @@ static void node_flag_toggle_exec(SpaceNode *snode, int toggle_flag) } } -static int node_hide_exec(bContext *C, wmOperator *op) +static int node_hide_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); @@ -2045,7 +2045,7 @@ void NODE_OT_hide_toggle(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int node_preview_exec(bContext *C, wmOperator *op) +static int node_preview_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); @@ -2077,7 +2077,7 @@ void NODE_OT_preview_toggle(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int node_socket_toggle_exec(bContext *C, wmOperator *op) +static int node_socket_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); bNode *node; @@ -2128,7 +2128,7 @@ void NODE_OT_hide_socket_toggle(wmOperatorType *ot) /* ****************** Mute operator *********************** */ -static int node_mute_exec(bContext *C, wmOperator *op) +static int node_mute_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); bNode *node; @@ -2170,7 +2170,7 @@ void NODE_OT_mute_toggle(wmOperatorType *ot) /* ****************** Delete operator ******************* */ -static int node_delete_exec(bContext *C, wmOperator *op) +static int node_delete_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); bNode *node, *next; @@ -2211,7 +2211,7 @@ void NODE_OT_delete(wmOperatorType *ot) /* ****************** Show Cyclic Dependencies Operator ******************* */ -static int node_show_cycles_exec(bContext *C, wmOperator *op) +static int node_show_cycles_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index ec08cdf07ac..402e1b2d1cd 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -241,7 +241,7 @@ void NODE_OT_select_border(wmOperatorType *ot) /* ****** Select/Deselect All ****** */ -static int node_select_all_exec(bContext *C, wmOperator *op) +static int node_select_all_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode = CTX_wm_space_node(C); bNode *first = snode->edittree->nodes.first; @@ -282,7 +282,7 @@ void NODE_OT_select_all(wmOperatorType *ot) /* ****** Select Linked To ****** */ -static int node_select_linked_to_exec(bContext *C, wmOperator *op) +static int node_select_linked_to_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode = CTX_wm_space_node(C); bNodeLink *link; @@ -322,7 +322,7 @@ void NODE_OT_select_linked_to(wmOperatorType *ot) /* ****** Select Linked From ****** */ -static int node_select_linked_from_exec(bContext *C, wmOperator *op) +static int node_select_linked_from_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode = CTX_wm_space_node(C); bNodeLink *link; @@ -362,7 +362,7 @@ void NODE_OT_select_linked_from(wmOperatorType *ot) /* ****** Select Same Type ****** */ -static int node_select_same_type_exec(bContext *C, wmOperator *op) +static int node_select_same_type_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode = CTX_wm_space_node(C); @@ -388,7 +388,7 @@ void NODE_OT_select_same_type(wmOperatorType *ot) /* ****** Select The Next/Prev Node Of The Same Type ****** */ -static int node_select_same_type_next_exec(bContext *C, wmOperator *op) +static int node_select_same_type_next_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode = CTX_wm_space_node(C); @@ -412,7 +412,7 @@ void NODE_OT_select_same_type_next(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; } -static int node_select_same_type_prev_exec(bContext *C, wmOperator *op) +static int node_select_same_type_prev_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode = CTX_wm_space_node(C); diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c index b4f09f960d6..d426ee17af7 100644 --- a/source/blender/editors/space_node/node_state.c +++ b/source/blender/editors/space_node/node_state.c @@ -278,7 +278,7 @@ static void snode_home(ScrArea *sa, ARegion *ar, SpaceNode* snode) UI_view2d_curRect_validate(&ar->v2d); } -static int node_view_all_exec(bContext *C, wmOperator *op) +static int node_view_all_exec(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= CTX_wm_region(C); diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index dc6b9f342b3..c7e3340ba87 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1590,7 +1590,7 @@ void object_toggle_visibility_cb(bContext *C, Scene *scene, TreeElement *te, Tre } } -static int outliner_toggle_visibility_exec(bContext *C, wmOperator *op) +static int outliner_toggle_visibility_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); Scene *scene= CTX_data_scene(C); @@ -1630,7 +1630,7 @@ static void object_toggle_selectability_cb(bContext *C, Scene *scene, TreeElemen } } -static int outliner_toggle_selectability_exec(bContext *C, wmOperator *op) +static int outliner_toggle_selectability_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); Scene *scene= CTX_data_scene(C); @@ -1668,7 +1668,7 @@ void object_toggle_renderability_cb(bContext *C, Scene *scene, TreeElement *te, } } -static int outliner_toggle_renderability_exec(bContext *C, wmOperator *op) +static int outliner_toggle_renderability_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); Scene *scene= CTX_data_scene(C); @@ -1697,7 +1697,7 @@ void OUTLINER_OT_renderability_toggle(wmOperatorType *ot) /* --- */ -static int outliner_toggle_expanded_exec(bContext *C, wmOperator *op) +static int outliner_toggle_expanded_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); ARegion *ar= CTX_wm_region(C); @@ -1728,7 +1728,7 @@ void OUTLINER_OT_expanded_toggle(wmOperatorType *ot) /* --- */ -static int outliner_toggle_selected_exec(bContext *C, wmOperator *op) +static int outliner_toggle_selected_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); ARegion *ar= CTX_wm_region(C); @@ -2660,7 +2660,7 @@ static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, T return 0; } -static int outliner_item_rename(bContext *C, wmOperator *op, wmEvent *event) +static int outliner_item_rename(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { ARegion *ar= CTX_wm_region(C); SpaceOops *soops= CTX_wm_space_outliner(C); @@ -2739,7 +2739,7 @@ static TreeElement *outliner_find_id(SpaceOops *soops, ListBase *lb, ID *id) return NULL; } -static int outliner_show_active_exec(bContext *C, wmOperator *op) +static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *so= CTX_wm_space_outliner(C); Scene *scene= CTX_data_scene(C); @@ -2959,7 +2959,7 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOops *soops, ListBase } /* show entire object level hierarchy */ -static int outliner_show_hierarchy_exec(bContext *C, wmOperator *op) +static int outliner_show_hierarchy_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); ARegion *ar= CTX_wm_region(C); @@ -3714,7 +3714,7 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S } -static int outliner_operation(bContext *C, wmOperator *op, wmEvent *event) +static int outliner_operation(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { Scene *scene= CTX_data_scene(C); ARegion *ar= CTX_wm_region(C); @@ -3980,7 +3980,7 @@ static void do_outliner_drivers_editop(SpaceOops *soops, ListBase *tree, short m /* Add Operator ---------------------------------- */ -static int outliner_drivers_addsel_exec(bContext *C, wmOperator *op) +static int outliner_drivers_addsel_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soutliner= CTX_wm_space_outliner(C); @@ -4015,7 +4015,7 @@ void OUTLINER_OT_drivers_add_selected(wmOperatorType *ot) /* Remove Operator ---------------------------------- */ -static int outliner_drivers_deletesel_exec(bContext *C, wmOperator *op) +static int outliner_drivers_deletesel_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soutliner= CTX_wm_space_outliner(C); @@ -4190,7 +4190,7 @@ void OUTLINER_OT_keyingset_add_selected(wmOperatorType *ot) /* Remove Operator ---------------------------------- */ -static int outliner_keyingset_removeitems_exec(bContext *C, wmOperator *op) +static int outliner_keyingset_removeitems_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soutliner= CTX_wm_space_outliner(C); Scene *scene= CTX_data_scene(C); diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c index 610fecaa543..7e3b14ca04a 100644 --- a/source/blender/editors/space_script/script_edit.c +++ b/source/blender/editors/space_script/script_edit.c @@ -80,7 +80,7 @@ void SCRIPT_OT_python_file_run(wmOperatorType *ot) } -static int script_reload_exec(bContext *C, wmOperator *op) +static int script_reload_exec(bContext *C, wmOperator *UNUSED(op)) { #ifndef DISABLE_PYTHON /* TODO, this crashes on netrender and keying sets, need to look into why diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c index 4394e334614..69eccfec2e1 100644 --- a/source/blender/editors/space_sequencer/sequencer_buttons.c +++ b/source/blender/editors/space_sequencer/sequencer_buttons.c @@ -92,7 +92,7 @@ void sequencer_buttons_register(ARegionType *art) /* **************** operator to open/close properties view ************* */ -static int sequencer_properties(bContext *C, wmOperator *op) +static int sequencer_properties(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= sequencer_has_buttons_region(sa); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index d96b8a27c99..b41d0cb21d4 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1185,7 +1185,7 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_snap_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sequencer_snap_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); @@ -1310,7 +1310,7 @@ void SEQUENCER_OT_unmute(struct wmOperatorType *ot) /* lock operator */ -static int sequencer_lock_exec(bContext *C, wmOperator *op) +static int sequencer_lock_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); @@ -1343,7 +1343,7 @@ void SEQUENCER_OT_lock(struct wmOperatorType *ot) } /* unlock operator */ -static int sequencer_unlock_exec(bContext *C, wmOperator *op) +static int sequencer_unlock_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); @@ -1376,7 +1376,7 @@ void SEQUENCER_OT_unlock(struct wmOperatorType *ot) } /* reload operator */ -static int sequencer_reload_exec(bContext *C, wmOperator *op) +static int sequencer_reload_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); @@ -1409,7 +1409,7 @@ void SEQUENCER_OT_reload(struct wmOperatorType *ot) } /* reload operator */ -static int sequencer_refresh_all_exec(bContext *C, wmOperator *op) +static int sequencer_refresh_all_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); @@ -1609,7 +1609,7 @@ static int apply_unique_name_cb(Sequence *seq, void *arg_pt) } -static int sequencer_add_duplicate_exec(bContext *C, wmOperator *op) +static int sequencer_add_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); @@ -1636,7 +1636,7 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int sequencer_add_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sequencer_add_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { sequencer_add_duplicate_exec(C, op); @@ -1666,7 +1666,7 @@ void SEQUENCER_OT_duplicate(wmOperatorType *ot) } /* delete operator */ -static int sequencer_delete_exec(bContext *C, wmOperator *op) +static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); @@ -1840,7 +1840,7 @@ void SEQUENCER_OT_images_separate(wmOperatorType *ot) /* META Operators */ /* separate_meta_toggle operator */ -static int sequencer_meta_toggle_exec(bContext *C, wmOperator *op) +static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); @@ -1985,7 +1985,7 @@ static int seq_depends_on_meta(Sequence *seq, Sequence *seqm) } /* separate_meta_make operator */ -static int sequencer_meta_separate_exec(bContext *C, wmOperator *op) +static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); @@ -2046,7 +2046,7 @@ void SEQUENCER_OT_meta_separate(wmOperatorType *ot) } /* view_all operator */ -static int sequencer_view_all_exec(bContext *C, wmOperator *op) +static int sequencer_view_all_exec(bContext *C, wmOperator *UNUSED(op)) { //Scene *scene= CTX_data_scene(C); bScreen *sc= CTX_wm_screen(C); @@ -2078,7 +2078,7 @@ void SEQUENCER_OT_view_all(wmOperatorType *ot) } /* view_all operator */ -static int sequencer_view_all_preview_exec(bContext *C, wmOperator *op) +static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op)) { bScreen *sc= CTX_wm_screen(C); ScrArea *area= CTX_wm_area(C); @@ -2189,7 +2189,7 @@ static EnumPropertyItem view_type_items[] = { #endif /* view_all operator */ -static int sequencer_view_toggle_exec(bContext *C, wmOperator *op) +static int sequencer_view_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceSeq *sseq= (SpaceSeq *)CTX_wm_space_data(C); @@ -2218,7 +2218,7 @@ void SEQUENCER_OT_view_toggle(wmOperatorType *ot) /* view_selected operator */ -static int sequencer_view_selected_exec(bContext *C, wmOperator *op) +static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); View2D *v2d= UI_view2d_fromcontext(C); @@ -2354,7 +2354,7 @@ static int next_prev_edit_internal(Scene *scene, int side) } /* move frame to next edit point operator */ -static int sequencer_next_edit_exec(bContext *C, wmOperator *op) +static int sequencer_next_edit_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); @@ -2384,7 +2384,7 @@ void SEQUENCER_OT_next_edit(wmOperatorType *ot) } /* move frame to previous edit point operator */ -static int sequencer_previous_edit_exec(bContext *C, wmOperator *op) +static int sequencer_previous_edit_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); @@ -2518,7 +2518,7 @@ void SEQUENCER_OT_swap(wmOperatorType *ot) RNA_def_enum(ot->srna, "side", prop_side_lr_types, SEQ_SIDE_RIGHT, "Side", "Side of the strip to swap"); } -static int sequencer_rendersize_exec(bContext *C, wmOperator *op) +static int sequencer_rendersize_exec(bContext *C, wmOperator *UNUSED(op)) { int retval = OPERATOR_CANCELLED; Scene *scene= CTX_data_scene(C); @@ -2638,7 +2638,7 @@ static void seq_offset(Scene *scene, Sequence *seq, int ofs) calc_sequence_disp(scene, seq); } -static int sequencer_paste_exec(bContext *C, wmOperator *op) +static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, TRUE); /* create if needed */ diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index a61e05517d9..eee336eab1d 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -209,7 +209,7 @@ void select_neighbor_from_last(Scene *scene, int lr) /* (de)select operator */ -static int sequencer_deselect_exec(bContext *C, wmOperator *op) +static int sequencer_deselect_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); @@ -255,7 +255,7 @@ void SEQUENCER_OT_select_all_toggle(struct wmOperatorType *ot) /* (de)select operator */ -static int sequencer_select_inverse_exec(bContext *C, wmOperator *op) +static int sequencer_select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); @@ -582,7 +582,7 @@ static int select_more_less_seq__internal(Scene *scene, int sel, int linked) { /* select more operator */ -static int sequencer_select_more_exec(bContext *C, wmOperator *op) +static int sequencer_select_more_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); @@ -613,7 +613,7 @@ void SEQUENCER_OT_select_more(wmOperatorType *ot) /* select less operator */ -static int sequencer_select_less_exec(bContext *C, wmOperator *op) +static int sequencer_select_less_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); @@ -700,7 +700,7 @@ void SEQUENCER_OT_select_linked_pick(wmOperatorType *ot) /* select linked operator */ -static int sequencer_select_linked_exec(bContext *C, wmOperator *op) +static int sequencer_select_linked_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); int selected; diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index 672940cf3cb..464e144515f 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -101,7 +101,7 @@ static int properties_poll(bContext *C) return (CTX_wm_space_text(C) != NULL); } -static int properties_exec(bContext *C, wmOperator *op) +static int properties_exec(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= text_has_properties_region(sa); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 8ff82ce8be0..0d6c226c6d4 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -147,7 +147,7 @@ void text_update_edited(Text *text) /******************* new operator *********************/ -static int new_exec(bContext *C, wmOperator *op) +static int new_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceText *st= CTX_wm_space_text(C); Text *text; @@ -204,7 +204,7 @@ static void open_init(bContext *C, wmOperator *op) uiIDContextProperty(C, &pprop->ptr, &pprop->prop); } -static int open_cancel(bContext *C, wmOperator *op) +static int open_cancel(bContext *UNUSED(C), wmOperator *op) { MEM_freeN(op->customdata); return OPERATOR_CANCELLED; @@ -263,7 +263,7 @@ static int open_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int open_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Text *text= CTX_data_edit_text(C); char *path= (text && text->name)? text->name: G.sce; @@ -338,7 +338,7 @@ void TEXT_OT_reload(wmOperatorType *ot) /******************* delete operator *********************/ -static int unlink_exec(bContext *C, wmOperator *op) +static int unlink_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain= CTX_data_main(C); SpaceText *st= CTX_wm_space_text(C); @@ -385,7 +385,7 @@ void TEXT_OT_unlink(wmOperatorType *ot) /******************* make internal operator *********************/ -static int make_internal_exec(bContext *C, wmOperator *op) +static int make_internal_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); @@ -511,7 +511,7 @@ static int save_as_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Text *text= CTX_data_edit_text(C); char *str; @@ -593,7 +593,7 @@ void TEXT_OT_run_script(wmOperatorType *ot) /******************* refresh pyconstraints operator *********************/ -static int refresh_pyconstraints_exec(bContext *C, wmOperator *op) +static int refresh_pyconstraints_exec(bContext *UNUSED(C), wmOperator *UNUSED(op)) { #ifndef DISABLE_PYTHON #if 0 @@ -789,7 +789,7 @@ static void txt_copy_clipboard(Text *text) } } -static int copy_exec(bContext *C, wmOperator *op) +static int copy_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); @@ -845,7 +845,7 @@ void TEXT_OT_cut(wmOperatorType *ot) /******************* indent operator *********************/ -static int indent_exec(bContext *C, wmOperator *op) +static int indent_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); @@ -880,7 +880,7 @@ void TEXT_OT_indent(wmOperatorType *ot) /******************* unindent operator *********************/ -static int unindent_exec(bContext *C, wmOperator *op) +static int unindent_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); @@ -915,7 +915,7 @@ void TEXT_OT_unindent(wmOperatorType *ot) /******************* line break operator *********************/ -static int line_break_exec(bContext *C, wmOperator *op) +static int line_break_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceText *st= CTX_wm_space_text(C); Text *text= CTX_data_edit_text(C); @@ -962,7 +962,7 @@ void TEXT_OT_line_break(wmOperatorType *ot) /******************* comment operator *********************/ -static int comment_exec(bContext *C, wmOperator *op) +static int comment_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); @@ -995,7 +995,7 @@ void TEXT_OT_comment(wmOperatorType *ot) /******************* uncomment operator *********************/ -static int uncomment_exec(bContext *C, wmOperator *op) +static int uncomment_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); @@ -1172,7 +1172,7 @@ void TEXT_OT_convert_whitespace(wmOperatorType *ot) /******************* select all operator *********************/ -static int select_all_exec(bContext *C, wmOperator *op) +static int select_all_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); @@ -1198,7 +1198,7 @@ void TEXT_OT_select_all(wmOperatorType *ot) /******************* select line operator *********************/ -static int select_line_exec(bContext *C, wmOperator *op) +static int select_line_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); @@ -1224,7 +1224,7 @@ void TEXT_OT_select_line(wmOperatorType *ot) /******************* previous marker operator *********************/ -static int previous_marker_exec(bContext *C, wmOperator *op) +static int previous_marker_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); TextMarker *mrk; @@ -1260,7 +1260,7 @@ void TEXT_OT_previous_marker(wmOperatorType *ot) /******************* next marker operator *********************/ -static int next_marker_exec(bContext *C, wmOperator *op) +static int next_marker_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); TextMarker *mrk; @@ -1296,7 +1296,7 @@ void TEXT_OT_next_marker(wmOperatorType *ot) /******************* clear all markers operator *********************/ -static int clear_all_markers_exec(bContext *C, wmOperator *op) +static int clear_all_markers_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); @@ -1871,7 +1871,7 @@ static int jump_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int jump_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int jump_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { return WM_operator_props_dialog_popup(C,op,200,100); @@ -1947,7 +1947,7 @@ void TEXT_OT_delete(wmOperatorType *ot) /******************* toggle overwrite operator **********************/ -static int toggle_overwrite_exec(bContext *C, wmOperator *op) +static int toggle_overwrite_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceText *st= CTX_wm_space_text(C); @@ -2512,7 +2512,7 @@ void TEXT_OT_cursor_set(wmOperatorType *ot) /******************* line number operator **********************/ -static int line_number_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int line_number_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { SpaceText *st= CTX_wm_space_text(C); Text *text= CTX_data_edit_text(C); @@ -2810,7 +2810,7 @@ void TEXT_OT_find_set_selected(wmOperatorType *ot) /******************* replace set selected *********************/ -static int replace_set_selected_exec(bContext *C, wmOperator *op) +static int replace_set_selected_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceText *st= CTX_wm_space_text(C); Text *text= CTX_data_edit_text(C); @@ -2920,7 +2920,7 @@ static int resolve_conflict_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int resolve_conflict_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int resolve_conflict_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Text *text= CTX_data_edit_text(C); uiPopupMenu *pup; diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c index fb80d54d5e6..edb3da5a06e 100644 --- a/source/blender/editors/space_time/time_ops.c +++ b/source/blender/editors/space_time/time_ops.c @@ -46,7 +46,7 @@ /* ****************** Start/End Frame Operators *******************************/ -static int time_set_sfra_exec (bContext *C, wmOperator *op) +static int time_set_sfra_exec (bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); int frame= CFRA; @@ -86,7 +86,7 @@ void TIME_OT_start_frame_set (wmOperatorType *ot) } -static int time_set_efra_exec (bContext *C, wmOperator *op) +static int time_set_efra_exec (bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); int frame= CFRA; @@ -127,7 +127,7 @@ void TIME_OT_end_frame_set (wmOperatorType *ot) /* ************************ View All Operator *******************************/ -static int time_view_all_exec (bContext *C, wmOperator *op) +static int time_view_all_exec (bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); ARegion *ar= CTX_wm_region(C); diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index a0167c87d87..1bff01a02e4 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1451,7 +1451,7 @@ void view3d_buttons_register(ARegionType *art) // XXX view3d_panel_preview(C, ar, 0); } -static int view3d_properties(bContext *C, wmOperator *op) +static int view3d_properties(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= view3d_has_buttons_region(sa); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 9f1b55ee2ce..e60dde7c88b 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1374,7 +1374,7 @@ void VIEW3D_OT_view_all(wmOperatorType *ot) } -static int viewselected_exec(bContext *C, wmOperator *op) /* like a localview without local!, was centerview() in 2.4x */ +static int viewselected_exec(bContext *C, wmOperator *UNUSED(op)) /* like a localview without local!, was centerview() in 2.4x */ { ARegion *ar= CTX_wm_region(C); View3D *v3d = CTX_wm_view3d(C); @@ -1514,7 +1514,7 @@ void VIEW3D_OT_view_selected(wmOperatorType *ot) ot->flag= 0; } -static int viewcenter_cursor_exec(bContext *C, wmOperator *op) +static int viewcenter_cursor_exec(bContext *C, wmOperator *UNUSED(op)) { View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); @@ -2151,7 +2151,7 @@ void VIEW3D_OT_view_pan(wmOperatorType *ot) RNA_def_enum(ot->srna, "type", prop_view_pan_items, 0, "Pan", "Direction of View Pan"); } -static int viewpersportho_exec(bContext *C, wmOperator *op) +static int viewpersportho_exec(bContext *C, wmOperator *UNUSED(op)) { ARegion *ar= CTX_wm_region(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); @@ -2200,14 +2200,14 @@ static BGpic *add_background_image(bContext *C) return bgpic; } -static int add_background_image_exec(bContext *C, wmOperator *op) +static int add_background_image_exec(bContext *C, wmOperator *UNUSED(op)) { add_background_image(C); return OPERATOR_FINISHED; } -static int add_background_image_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int add_background_image_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Scene *scene= CTX_data_scene(C); View3D *v3d= CTX_wm_view3d(C); @@ -2410,7 +2410,7 @@ void VIEW3D_OT_clip_border(wmOperatorType *ot) /* ***************** 3d cursor cursor op ******************* */ /* mx my in region coords */ -static int set_3dcursor_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { Scene *scene= CTX_data_scene(C); ARegion *ar= CTX_wm_region(C); @@ -2535,7 +2535,7 @@ void VIEW3D_OT_manipulator(wmOperatorType *ot) Transform_Properties(ot, P_CONSTRAINT); } -static int enable_manipulator_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int enable_manipulator_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { View3D *v3d = CTX_wm_view3d(C); diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 7f5f7665028..4ef1d4daf92 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -443,7 +443,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode) /* *********************** operators ******************** */ -static int snap_sel_to_grid(bContext *C, wmOperator *op) +static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op)) { extern float originmat[3][3]; /* XXX object.c */ Main *bmain= CTX_data_main(C); @@ -577,7 +577,7 @@ void VIEW3D_OT_snap_selected_to_grid(wmOperatorType *ot) /* *************************************************** */ -static int snap_sel_to_curs(bContext *C, wmOperator *op) +static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op)) { extern float originmat[3][3]; /* XXX object.c */ Main *bmain= CTX_data_main(C); @@ -703,7 +703,7 @@ void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot) /* *************************************************** */ -static int snap_curs_to_grid(bContext *C, wmOperator *op) +static int snap_curs_to_grid(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); RegionView3D *rv3d= CTX_wm_region_data(C); @@ -740,7 +740,7 @@ void VIEW3D_OT_snap_cursor_to_grid(wmOperatorType *ot) /* **************************************************** */ -static int snap_curs_to_sel(bContext *C, wmOperator *op) +static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); Scene *scene= CTX_data_scene(C); @@ -847,7 +847,7 @@ void VIEW3D_OT_snap_cursor_to_selected(wmOperatorType *ot) /* ********************************************** */ -static int snap_curs_to_active(bContext *C, wmOperator *op) +static int snap_curs_to_active(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_edit_object(C); Object *obact= CTX_data_active_object(C); @@ -898,7 +898,7 @@ void VIEW3D_OT_snap_cursor_to_active(wmOperatorType *ot) /* **************************************************** */ /*New Code - Snap Cursor to Center -*/ -static int snap_curs_to_center(bContext *C, wmOperator *op) +static int snap_curs_to_center(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); View3D *v3d= CTX_wm_view3d(C); diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 6e2624cb60b..10496bc078d 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -280,7 +280,7 @@ void view3d_tool_props_register(ARegionType *art) /* ********** operator to open/close toolshelf region */ -static int view3d_toolshelf(bContext *C, wmOperator *op) +static int view3d_toolshelf(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= view3d_has_tools_region(sa); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index b49933cbb35..4bc921b6030 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -296,7 +296,7 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo } /* only meant for timer usage */ -static int view3d_smoothview_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); @@ -399,7 +399,7 @@ static void setcameratoview3d(View3D *v3d, RegionView3D *rv3d, Object *ob) } -static int view3d_setcameratoview_exec(bContext *C, wmOperator *op) +static int view3d_setcameratoview_exec(bContext *C, wmOperator *UNUSED(op)) { View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); @@ -444,7 +444,7 @@ void VIEW3D_OT_setcameratoview(wmOperatorType *ot) } -static int view3d_setobjectascamera_exec(bContext *C, wmOperator *op) +static int view3d_setobjectascamera_exec(bContext *C, wmOperator *UNUSED(op)) { View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); @@ -1600,7 +1600,7 @@ static void endlocalview(Scene *scene, ScrArea *sa) } } -static int localview_exec(bContext *C, wmOperator *unused) +static int localview_exec(bContext *C, wmOperator *UNUSED(unused)) { View3D *v3d= CTX_wm_view3d(C); @@ -1770,7 +1770,7 @@ int ED_view3d_context_activate(bContext *C) return 1; } -static int game_engine_exec(bContext *C, wmOperator *op) +static int game_engine_exec(bContext *C, wmOperator *UNUSED(op)) { #if GAMEBLENDER == 1 Scene *startscene = CTX_data_scene(C); diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 95e167053ec..381612bf1ef 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -145,7 +145,7 @@ static int select_orientation_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int select_orientation_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int select_orientation_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { uiPopupMenu *pup; uiLayout *layout; @@ -179,7 +179,7 @@ void TRANSFORM_OT_select_orientation(struct wmOperatorType *ot) } -static int delete_orientation_exec(bContext *C, wmOperator *op) +static int delete_orientation_exec(bContext *C, wmOperator *UNUSED(op)) { View3D *v3d = CTX_wm_view3d(C); int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM); @@ -192,7 +192,7 @@ static int delete_orientation_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int delete_orientation_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int delete_orientation_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { return delete_orientation_exec(C, op); } @@ -243,7 +243,7 @@ static int create_orientation_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int create_orientation_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int create_orientation_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { return create_orientation_exec(C, op); } diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index e5128ea784a..a4f661e9511 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -196,14 +196,14 @@ void ED_undo_pop_op(bContext *C, wmOperator *op) ed_undo_step(C, 0, op->type->name); } -static int ed_undo_exec(bContext *C, wmOperator *op) +static int ed_undo_exec(bContext *C, wmOperator *UNUSED(op)) { /* "last operator" should disappear, later we can tie ths with undo stack nicer */ WM_operator_stack_clear(C); return ed_undo_step(C, 1, NULL); } -static int ed_redo_exec(bContext *C, wmOperator *op) +static int ed_redo_exec(bContext *C, wmOperator *UNUSED(op)) { return ed_undo_step(C, -1, NULL); } diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 5c4564f1946..c300b668675 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -1052,7 +1052,7 @@ void UV_OT_align(wmOperatorType *ot) /* ******************** weld operator **************** */ -static int weld_exec(bContext *C, wmOperator *op) +static int weld_exec(bContext *C, wmOperator *UNUSED(op)) { weld_align_uv(C, 'w'); @@ -1264,7 +1264,7 @@ void UV_OT_stitch(wmOperatorType *ot) /* ******************** (de)select all operator **************** */ -static int select_inverse_exec(bContext *C, wmOperator *op) +static int select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene; ToolSettings *ts; @@ -2714,7 +2714,7 @@ void UV_OT_pin(wmOperatorType *ot) /******************* select pinned operator ***************/ -static int select_pinned_exec(bContext *C, wmOperator *op) +static int select_pinned_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); @@ -2902,7 +2902,7 @@ void UV_OT_hide(wmOperatorType *ot) /****************** reveal operator ******************/ -static int reveal_exec(bContext *C, wmOperator *op) +static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceImage *sima= CTX_wm_space_image(C); ToolSettings *ts= CTX_data_tool_settings(C); diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 20c9fa5877b..e5e46d407c9 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -330,7 +330,7 @@ static int minimize_stretch_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int minimize_stretch_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int minimize_stretch_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { MinStretch *ms; @@ -425,7 +425,7 @@ void UV_OT_minimize_stretch(wmOperatorType *ot) /* ******************** Pack Islands operator **************** */ -static int pack_islands_exec(bContext *C, wmOperator *op) +static int pack_islands_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); @@ -458,7 +458,7 @@ void UV_OT_pack_islands(wmOperatorType *ot) /* ******************** Average Islands Scale operator **************** */ -static int average_islands_scale_exec(bContext *C, wmOperator *op) +static int average_islands_scale_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); @@ -975,7 +975,7 @@ void UV_OT_from_view(wmOperatorType *ot) /********************** Reset operator ********************/ -static int reset_exec(bContext *C, wmOperator *op) +static int reset_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); -- cgit v1.2.3 From f0fcf140f8242c76c8a7373cd61c3d4ab6a57391 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Oct 2010 02:24:48 +0000 Subject: enable warning for unused args with gcc: -Wunused-parameter - for cmake only apply this to source/blender, will apply globally later. - ./extern/ ./source/blender/makesrna/intern/ ignore this. --- source/blender/CMakeLists.txt | 5 +++++ source/blender/makesrna/intern/CMakeLists.txt | 3 +++ 2 files changed, 8 insertions(+) (limited to 'source/blender') diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index 96d1ce3e8b2..dc0640c817f 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -24,6 +24,11 @@ # # ***** END GPL LICENSE BLOCK ***** +# TODO: remove this and uncommend the global arg, but for now adding here keeps it managable +IF(CMAKE_COMPILER_IS_GNUCC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-parameter") +ENDIF(CMAKE_COMPILER_IS_GNUCC) + ADD_SUBDIRECTORY(windowmanager) ADD_SUBDIRECTORY(editors) ADD_SUBDIRECTORY(avi) diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 4f9032ffc95..a48603e623c 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -24,6 +24,9 @@ # # ***** END GPL LICENSE BLOCK ***** +# this warning on generated files gets annoying +STRING(REGEX REPLACE "-Wunused-parameter" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) + FILE(GLOB DEFSRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") FILE(GLOB APISRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*_api.c") LIST(REMOVE_ITEM DEFSRC rna_access.c rna_define.c makesrna.c) -- cgit v1.2.3 From d3fcc2d0b4a02438f7e1ffa0bbdd9426d8dd0659 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Oct 2010 03:24:47 +0000 Subject: bugfix [#24256] Wrong bone subdivision number in tweak panel. there were 3 operators for armature subdivision, now only have 1 (as with mesh). + remove unused warnigns. --- source/blender/editors/armature/armature_intern.h | 4 +- source/blender/editors/armature/armature_ops.c | 4 +- source/blender/editors/armature/editarmature.c | 128 ++++----------------- source/blender/editors/armature/poselib.c | 4 +- source/blender/editors/armature/poseobject.c | 19 +-- source/blender/editors/include/ED_armature.h | 2 +- .../editors/transform/transform_conversions.c | 2 +- 7 files changed, 41 insertions(+), 122 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h index 2d28d3cb9e5..acbfec125e0 100644 --- a/source/blender/editors/armature/armature_intern.h +++ b/source/blender/editors/armature/armature_intern.h @@ -51,9 +51,7 @@ void ARMATURE_OT_align(struct wmOperatorType *ot); void ARMATURE_OT_calculate_roll(struct wmOperatorType *ot); void ARMATURE_OT_switch_direction(struct wmOperatorType *ot); -void ARMATURE_OT_subdivs(struct wmOperatorType *ot); -void ARMATURE_OT_subdivide_simple(struct wmOperatorType *ot); -void ARMATURE_OT_subdivide_multi(struct wmOperatorType *ot); +void ARMATURE_OT_subdivide(struct wmOperatorType *ot); void ARMATURE_OT_parent_set(struct wmOperatorType *ot); void ARMATURE_OT_parent_clear(struct wmOperatorType *ot); diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index 78b0b2e5e0d..ff4accfd066 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -57,9 +57,7 @@ void ED_operatortypes_armature(void) WM_operatortype_append(ARMATURE_OT_align); WM_operatortype_append(ARMATURE_OT_calculate_roll); WM_operatortype_append(ARMATURE_OT_switch_direction); - WM_operatortype_append(ARMATURE_OT_subdivs); - WM_operatortype_append(ARMATURE_OT_subdivide_simple); - WM_operatortype_append(ARMATURE_OT_subdivide_multi); + WM_operatortype_append(ARMATURE_OT_subdivide); WM_operatortype_append(ARMATURE_OT_parent_set); WM_operatortype_append(ARMATURE_OT_parent_clear); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index f786b50fcf9..c8c0a4e6980 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1075,7 +1075,7 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm) * sel: remove selected bones from the armature, otherwise the unselected bones are removed * (ob is not in editmode) */ -static void separate_armature_bones (Scene *scene, Object *ob, short sel) +static void separate_armature_bones(Object *ob, short sel) { bArmature *arm= (bArmature *)ob->data; bPoseChannel *pchan, *pchann; @@ -1176,8 +1176,8 @@ static int separate_armature_exec (bContext *C, wmOperator *UNUSED(op)) /* 3) remove bones that shouldn't still be around on both armatures */ - separate_armature_bones(scene, oldob, 1); - separate_armature_bones(scene, newob, 0); + separate_armature_bones(oldob, 1); + separate_armature_bones(newob, 0); /* 4) fix links before depsgraph flushes */ // err... or after? @@ -2087,7 +2087,7 @@ float ED_rollBoneToVector(EditBone *bone, float new_up_axis[3]) /* Set roll value for given bone -> Z-Axis Point up (original method) */ -static void auto_align_ebone_zaxisup(Scene *scene, View3D *v3d, EditBone *ebone) +static void auto_align_ebone_zaxisup(Scene *UNUSED(scene), View3D *UNUSED(v3d), EditBone *ebone) { float delta[3], curmat[3][3]; float xaxis[3]={1.0f, 0.0f, 0.0f}, yaxis[3], zaxis[3]={0.0f, 0.0f, 1.0f}; @@ -3632,10 +3632,7 @@ static int armature_subdivide_exec(bContext *C, wmOperator *op) int numcuts, i; /* there may not be a number_cuts property defined (for 'simple' subdivide) */ - if (RNA_property_is_set(op->ptr, "number_cuts")) - numcuts= RNA_int_get(op->ptr, "number_cuts"); - else - numcuts= 1; + numcuts= RNA_int_get(op->ptr, "number_cuts"); /* loop over all editable bones */ // XXX the old code did this in reverse order though! @@ -3690,26 +3687,11 @@ static int armature_subdivide_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } - -void ARMATURE_OT_subdivide_simple(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Subdivide Simple"; - ot->idname= "ARMATURE_OT_subdivide_simple"; - - /* api callbacks */ - ot->exec = armature_subdivide_exec; - ot->poll = ED_operator_editarmature; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; -} - -void ARMATURE_OT_subdivide_multi(wmOperatorType *ot) +void ARMATURE_OT_subdivide(wmOperatorType *ot) { /* identifiers */ ot->name= "Subdivide Multi"; - ot->idname= "ARMATURE_OT_subdivide_multi"; + ot->idname= "ARMATURE_OT_subdivide"; /* api callbacks */ ot->exec = armature_subdivide_exec; @@ -3719,65 +3701,7 @@ void ARMATURE_OT_subdivide_multi(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* Properties */ - RNA_def_int(ot->srna, "number_cuts", 2, 1, INT_MAX, "Number of Cuts", "", 1, 10); -} - - - -static int armature_subdivs_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) -{ - uiPopupMenu *pup; - uiLayout *layout; - - pup= uiPupMenuBegin(C, "Subdivision Type", 0); - layout= uiPupMenuLayout(pup); - uiItemsEnumO(layout, "ARMATURE_OT_subdivs", "type"); - uiPupMenuEnd(C, pup); - - return OPERATOR_CANCELLED; -} - -static int armature_subdivs_exec(bContext *C, wmOperator *op) -{ - switch (RNA_int_get(op->ptr, "type")) - { - case 0: /* simple */ - RNA_int_set(op->ptr, "number_cuts", 1); - armature_subdivide_exec(C, op); - break; - case 1: /* multi */ - armature_subdivide_exec(C, op); - break; - } - - return OPERATOR_FINISHED; -} - -void ARMATURE_OT_subdivs(wmOperatorType *ot) -{ - static EnumPropertyItem type_items[]= { - {0, "SIMPLE", 0, "Simple", ""}, - {1, "MULTI", 0, "Multi", ""}, - {0, NULL, 0, NULL, NULL}}; - - /* identifiers */ - ot->name= "subdivs"; - ot->idname= "ARMATURE_OT_subdivs"; - - /* api callbacks */ - ot->invoke= armature_subdivs_invoke; - ot->exec= armature_subdivs_exec; - - ot->poll= ED_operator_editarmature; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* props */ - RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); - - /* this is temp, the ops are different, but they are called from subdivs, so all the possible props should be here as well*/ - RNA_def_int(ot->srna, "number_cuts", 2, 1, INT_MAX, "Number of Cuts", "", 1, 10); + RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10); } /* ----------- */ @@ -4552,7 +4476,7 @@ void ED_pose_deselectall (Object *ob, int test) arm->act_bone= NULL; } -static int bone_skinnable(Object *ob, Bone *bone, void *datap) +static int bone_skinnable_cb(Object *ob, Bone *bone, void *datap) { /* Bones that are deforming * are regarded to be "skinnable" and are eligible for @@ -4601,7 +4525,7 @@ static int bone_skinnable(Object *ob, Bone *bone, void *datap) return 0; } -static int ED_vgroup_add_unique_bone(Object *ob, Bone *bone, void *data) +static int vgroup_add_unique_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr)) { /* This group creates a vertex group to ob that has the * same name as bone (provided the bone is skinnable). @@ -4616,7 +4540,7 @@ static int ED_vgroup_add_unique_bone(Object *ob, Bone *bone, void *data) return 0; } -static int dgroup_skinnable(Object *ob, Bone *bone, void *datap) +static int dgroup_skinnable_cb(Object *ob, Bone *bone, void *datap) { /* Bones that are deforming * are regarded to be "skinnable" and are eligible for @@ -4672,7 +4596,7 @@ static int dgroup_skinnable(Object *ob, Bone *bone, void *datap) return 0; } -static void add_vgroups__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) +static void add_vgroups__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) { /* DerivedMesh mapFunc for getting final coords in weight paint mode */ @@ -4755,7 +4679,7 @@ void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object looper_data.list= NULL; /* count the number of skinnable bones */ - numbones = bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable); + numbones = bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable_cb); if (numbones == 0) return; @@ -4764,7 +4688,7 @@ void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object * and fill it with all of the skinnable bones */ bonelist = MEM_callocN(numbones*sizeof(Bone *), "bonelist"); looper_data.list= bonelist; - bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable); + bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable_cb); /* create an array of pointers to the deform groups that * coorespond to the skinnable bones (creating them @@ -4773,7 +4697,7 @@ void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object dgroupflip = MEM_callocN(numbones*sizeof(bDeformGroup *), "dgroupflip"); looper_data.list= dgrouplist; - bone_looper(ob, arm->bonebase.first, &looper_data, dgroup_skinnable); + bone_looper(ob, arm->bonebase.first, &looper_data, dgroup_skinnable_cb); /* create an array of root and tip positions transformed into * global coords */ @@ -4907,7 +4831,7 @@ void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob, /* Traverse the bone list, trying to create empty vertex * groups cooresponding to the bone. */ - bone_looper(ob, arm->bonebase.first, NULL, ED_vgroup_add_unique_bone); + bone_looper(ob, arm->bonebase.first, NULL, vgroup_add_unique_bone_cb); if (ob->type == OB_MESH) ED_vgroup_data_create(ob->data); @@ -4964,7 +4888,7 @@ static int pose_clear_scale_exec(bContext *C, wmOperator *UNUSED(op)) /* now recalculate paths */ if ((ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) - ED_pose_recalculate_paths(C, scene, ob); + ED_pose_recalculate_paths(scene, ob); } DAG_id_flush_update(&ob->id, OB_RECALC_DATA); @@ -5033,7 +4957,7 @@ static int pose_clear_loc_exec(bContext *C, wmOperator *UNUSED(op)) /* now recalculate paths */ if ((ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) - ED_pose_recalculate_paths(C, scene, ob); + ED_pose_recalculate_paths(scene, ob); } DAG_id_flush_update(&ob->id, OB_RECALC_DATA); @@ -5186,7 +5110,7 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *UNUSED(op)) /* now recalculate paths */ if ((ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) - ED_pose_recalculate_paths(C, scene, ob); + ED_pose_recalculate_paths(scene, ob); } DAG_id_flush_update(&ob->id, OB_RECALC_DATA); @@ -5356,7 +5280,7 @@ void POSE_OT_select_parent(wmOperatorType *ot) /* ************* hide/unhide pose bones ******************* */ -static int hide_selected_pose_bone(Object *ob, Bone *bone, void *ptr) +static int hide_selected_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr)) { bArmature *arm= ob->data; @@ -5371,7 +5295,7 @@ static int hide_selected_pose_bone(Object *ob, Bone *bone, void *ptr) return 0; } -static int hide_unselected_pose_bone(Object *ob, Bone *bone, void *ptr) +static int hide_unselected_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr)) { bArmature *arm= ob->data; @@ -5393,11 +5317,9 @@ static int pose_hide_exec(bContext *C, wmOperator *op) bArmature *arm= ob->data; if(RNA_boolean_get(op->ptr, "unselected")) - bone_looper(ob, arm->bonebase.first, NULL, - hide_unselected_pose_bone); + bone_looper(ob, arm->bonebase.first, NULL, hide_unselected_pose_bone_cb); else - bone_looper(ob, arm->bonebase.first, NULL, - hide_selected_pose_bone); + bone_looper(ob, arm->bonebase.first, NULL, hide_selected_pose_bone_cb); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, ob); @@ -5422,7 +5344,7 @@ void POSE_OT_hide(wmOperatorType *ot) RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", ""); } -static int show_pose_bone(Object *ob, Bone *bone, void *ptr) +static int show_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr)) { bArmature *arm= ob->data; @@ -5442,7 +5364,7 @@ static int pose_reveal_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); bArmature *arm= ob->data; - bone_looper(ob, arm->bonebase.first, NULL, show_pose_bone); + bone_looper(ob, arm->bonebase.first, NULL, show_pose_bone_cb); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, ob); diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 3a90f75d2a1..a595396b15d 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -268,7 +268,7 @@ static KeyingSet *poselib_ks_locrotscale = NULL; /* the only keyingset we'll ne /* ----- */ -static void poselib_add_menu_invoke__replacemenu (bContext *C, uiLayout *layout, void *arg) +static void poselib_add_menu_invoke__replacemenu (bContext *C, uiLayout *layout, void *UNUSED(arg)) { Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); bAction *act= ob->poselib; @@ -402,7 +402,7 @@ void POSELIB_OT_pose_add (wmOperatorType *ot) /* ----- */ -static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *ptr, int *free) +static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { Object *ob= ED_object_pose_armature(CTX_data_active_object(C)); bAction *act= (ob) ? ob->poselib : NULL; diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index fa7f01da7b9..ecb34609b2d 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -71,9 +71,9 @@ #include "armature_intern.h" /* ************* XXX *************** */ -static int pupmenu(const char *dummy) {return 0;} -static void error(const char *dummy) {}; -static void BIF_undo_push(const char *dummy) {} +static int pupmenu(const char *UNUSED(dummy)) {return 0;} +static void error(const char *UNUSED(dummy)) {}; +static void BIF_undo_push(const char *UNUSED(dummy)) {} /* ************* XXX *************** */ @@ -226,7 +226,7 @@ int ED_pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan) * * To be called from various tools that do incremental updates */ -void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob) +void ED_pose_recalculate_paths(Scene *scene, Object *ob) { ListBase targets = {NULL, NULL}; @@ -267,7 +267,7 @@ static int pose_calculate_paths_exec (bContext *C, wmOperator *UNUSED(op)) /* calculate the bones that now have motionpaths... */ // TODO: only make for the selected bones? - ED_pose_recalculate_paths(C, scene, ob); + ED_pose_recalculate_paths(scene, ob); /* notifiers for updates */ WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob); @@ -1895,9 +1895,9 @@ void POSE_OT_quaternions_flip (wmOperatorType *ot) /* ********************************************** */ /* context: active channel */ +#if 0 void pose_special_editmenu(Scene *scene) { -#if 0 Object *obedit= scene->obedit; // XXX context Object *ob= OBACT; short nr; @@ -1920,7 +1920,7 @@ void pose_special_editmenu(Scene *scene) pose_clear_paths(ob); } else if(nr==5) { - pose_clear_user_transforms(scene, ob); + pose_clear_user_transforms(ob); } else if(nr==6) { pose_relax(); @@ -1928,11 +1928,11 @@ void pose_special_editmenu(Scene *scene) else if(ELEM3(nr, 7, 8, 9)) { pose_autoside_names(nr-7); } -#endif } + /* Restore selected pose-bones to 'action'-defined pose */ -void pose_clear_user_transforms(Scene *scene, Object *ob) +static void pose_clear_user_transforms(Object *ob) { bArmature *arm= ob->data; bPoseChannel *pchan; @@ -1964,3 +1964,4 @@ void pose_clear_user_transforms(Scene *scene, Object *ob) BIF_undo_push("Clear User Transform"); } +#endif diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index e91bafc9056..32fe10783a7 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -147,7 +147,7 @@ void ED_armature_exit_posemode(struct bContext *C, struct Base *base); void ED_armature_enter_posemode(struct bContext *C, struct Base *base); int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan); void ED_pose_deselectall(struct Object *ob, int test); -void ED_pose_recalculate_paths(struct bContext *C, struct Scene *scene, struct Object *ob); +void ED_pose_recalculate_paths(struct Scene *scene, struct Object *ob); /* sketch */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index fd97406652e..53e553a0391 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4720,7 +4720,7 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o */ if (C && (ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) { //ED_pose_clear_paths(C, ob); // XXX for now, don't need to clear - ED_pose_recalculate_paths(C, scene, ob); + ED_pose_recalculate_paths(scene, ob); } } else { -- cgit v1.2.3 From 68dea6591d4a08c50ade96ec58f00853d0d5340a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Oct 2010 04:27:09 +0000 Subject: bugfix [#24247] Duplicating a Composite Group Node no User Count Icon duplicating nodes wasnt changing the usercount of the referenced ID but file loading deleting was. also removed some unused args. --- source/blender/editors/include/ED_node.h | 2 +- source/blender/editors/space_node/node_draw.c | 16 ++++++++-------- source/blender/editors/space_node/node_edit.c | 11 ++++++++++- source/blender/makesrna/intern/rna_color.c | 2 +- source/blender/makesrna/intern/rna_nodetree.c | 2 +- 5 files changed, 21 insertions(+), 12 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index 6e42b772bef..d287066828f 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -40,7 +40,7 @@ void ED_init_node_butfuncs(void); /* node_draw.c */ void ED_node_changed_update(struct ID *id, struct bNode *node); -void ED_node_generic_update(struct Main *bmain, struct Scene *scene, struct bNodeTree *ntree, struct bNode *node); +void ED_node_generic_update(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node); /* node_edit.c */ void ED_node_shader_default(struct Material *ma); diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 8316d79c9f0..a81d6e3b0ce 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -111,7 +111,7 @@ static int has_nodetree(bNodeTree *ntree, bNodeTree *lookup) return 0; } -void ED_node_generic_update(Main *bmain, Scene *scene, bNodeTree *ntree, bNode *node) +void ED_node_generic_update(Main *bmain, bNodeTree *ntree, bNode *node) { Material *ma; Tex *tex; @@ -309,7 +309,7 @@ static void node_update(const bContext *C, bNodeTree *ntree, bNode *node) } /* based on settings in node, sets drawing rect info. each redraw! */ -static void node_update_hidden(const bContext *C, bNode *node) +static void node_update_hidden(bNode *node) { bNodeSocket *nsock; float rad, drad, hiddenrad= HIDDEN_RAD; @@ -392,7 +392,7 @@ static void node_update_group(const bContext *C, bNodeTree *ntree, bNode *gnode) node->locy+= gnode->locy; if(node->flag & NODE_HIDDEN) - node_update_hidden(C, node); + node_update_hidden(node); else node_update(C, ntree, node); node->locx-= gnode->locx; @@ -483,7 +483,7 @@ static void node_draw_mute_line(View2D *v2d, SpaceNode *snode, bNode *node) /* nice AA filled circle */ /* this might have some more generic use */ -static void circle_draw(float x, float y, float size, int type, int col[3]) +static void circle_draw(float x, float y, float size, int col[3]) { /* 16 values of sin function */ static float si[16] = { @@ -538,11 +538,11 @@ static void socket_circle_draw(bNodeSocket *sock, float size) else { col[0]= 100; col[1]= 200; col[2]= 100; } - - circle_draw(sock->locx, sock->locy, size, sock->type, col); + + circle_draw(sock->locx, sock->locy, size, col); } -static void node_sync_cb(bContext *C, void *snode_v, void *node_v) +static void node_sync_cb(bContext *UNUSED(C), void *snode_v, void *node_v) { SpaceNode *snode= snode_v; @@ -1103,7 +1103,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d) if(node->flag & NODE_GROUP_EDIT) node_update_group(C, snode->nodetree, node); else if(node->flag & NODE_HIDDEN) - node_update_hidden(C, node); + node_update_hidden(node); else node_update(C, snode->nodetree, node); } diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 42aec17cc8f..71f48f0de5d 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -98,7 +98,7 @@ static int compo_breakjob(void *cjv) } /* called by compo, wmJob sends notifier */ -static void compo_redrawjob(void *cjv, char *str) +static void compo_redrawjob(void *cjv, char *UNUSED(str)) { CompoJob *cj= cjv; @@ -1475,9 +1475,18 @@ bNode *node_add_node(SpaceNode *snode, Scene *scene, int type, float locx, float static int node_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceNode *snode= CTX_wm_space_node(C); + bNode *node; ED_preview_kill_jobs(C); + /* simple id user adjustment, node internal functions dont touch this + * but operators and readfile.c do. */ + for(node= snode->edittree->nodes.first; node; node= node->next) { + if(node->flag & SELECT) { + id_us_plus(node->id); + } + } + ntreeCopyTree(snode->edittree, 1); /* 1 == internally selected nodes */ ntreeSolveOrder(snode->edittree); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 509fecb0122..cd588b598bd 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -253,7 +253,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *scene, PointerRNA *ptr) for(node=ntree->nodes.first; node; node=node->next) { if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) { - ED_node_generic_update(bmain, scene, ntree, node); + ED_node_generic_update(bmain, ntree, node); } } } diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index a97033200de..ef56ad6a0c2 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -159,7 +159,7 @@ static void rna_Image_end_frame_set(PointerRNA *ptr, int value) static void node_update(Main *bmain, Scene *scene, bNodeTree *ntree, bNode *node) { - ED_node_generic_update(bmain, scene, ntree, node); + ED_node_generic_update(bmain, ntree, node); } static void rna_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr) -- cgit v1.2.3 From 25bbf99a79b0a1fa324dcd8d49bf80807b2d9672 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Oct 2010 05:18:45 +0000 Subject: replace SIDE_OF_LINE macro with line_point_side_v2() inline function. made a number of files build without unused warnings. --- source/blender/blenkernel/intern/displist.c | 2 +- source/blender/blenkernel/intern/library.c | 5 +- source/blender/blenlib/BLI_math_vector.h | 2 + source/blender/blenlib/BLI_scanfill.h | 2 +- source/blender/blenlib/intern/math_geom.c | 27 +++++---- source/blender/blenlib/intern/math_vector_inline.c | 6 ++ source/blender/blenlib/intern/scanfill.c | 2 +- source/blender/editors/mesh/editmesh_add.c | 8 +-- source/blender/editors/mesh/editmesh_tools.c | 2 +- source/blender/editors/object/object_bake.c | 2 +- source/blender/editors/object/object_constraint.c | 14 ++--- source/blender/editors/object/object_hook.c | 2 +- source/blender/editors/object/object_shapekey.c | 5 +- source/blender/editors/object/object_vgroup.c | 2 +- source/blender/editors/sculpt_paint/paint_image.c | 65 +++++++++++----------- source/blender/editors/sculpt_paint/paint_intern.h | 2 +- source/blender/editors/sculpt_paint/paint_stroke.c | 4 +- source/blender/editors/sculpt_paint/paint_utils.c | 2 +- source/blender/ikplugin/intern/iksolver_plugin.c | 2 +- source/blender/windowmanager/intern/wm_gesture.c | 2 +- 20 files changed, 79 insertions(+), 79 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index d0336d9f786..2ab7e32a9c6 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -979,7 +979,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal) dl= dl->next; } - if(totvert && BLI_edgefill(0, 0)) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) { + if(totvert && BLI_edgefill(0)) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) { /* count faces */ tot= 0; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 93e4b5fcfbe..3f94992cd11 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -71,6 +71,7 @@ #include "BLI_blenlib.h" #include "BLI_dynstr.h" +#include "BKE_utildefines.h" #include "BKE_animsys.h" #include "BKE_context.h" #include "BKE_library.h" @@ -668,7 +669,7 @@ void *copy_libblock(void *rt) return idn; } -static void free_library(Library *lib) +static void free_library(Library *UNUSED(lib)) { /* no freeing needed for libraries yet */ } @@ -680,7 +681,7 @@ void set_free_windowmanager_cb(void (*func)(bContext *C, wmWindowManager *) ) free_windowmanager_cb= func; } -void animdata_dtar_clear_cb(ID *id, AnimData *adt, void *userdata) +void animdata_dtar_clear_cb(ID *UNUSED(id), AnimData *adt, void *userdata) { ChannelDriver *driver; FCurve *fcu; diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index b160097a33d..5c17ac6b639 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -129,6 +129,8 @@ MINLINE int compare_len_v3v3(float a[3], float b[3], float limit); MINLINE int compare_v4v4(float a[4], float b[4], float limit); MINLINE int equals_v4v4(float a[4], float b[4]); +MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2]); + /********************************** Angles ***********************************/ /* - angle with 2 arguments is angle between vector */ /* - angle with 3 arguments is angle between 3 points at the middle point */ diff --git a/source/blender/blenlib/BLI_scanfill.h b/source/blender/blenlib/BLI_scanfill.h index 0ae40c0b83d..bae5375f757 100644 --- a/source/blender/blenlib/BLI_scanfill.h +++ b/source/blender/blenlib/BLI_scanfill.h @@ -50,7 +50,7 @@ extern "C" { /* scanfill.c: used in displist only... */ struct EditVert *BLI_addfillvert(float *vec); struct EditEdge *BLI_addfilledge(struct EditVert *v1, struct EditVert *v2); -int BLI_edgefill(int mode, int mat_nr); +int BLI_edgefill(int mat_nr); void BLI_end_edgefill(void); /* These callbacks are needed to make the lib finction properly */ diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 2aec707b4ea..c2e765388c8 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -336,20 +336,19 @@ static short IsectLLPt2Df(float x0,float y0,float x1,float y1, return 1; } // end Intersect_Lines -#define SIDE_OF_LINE(pa,pb,pp) ((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1])) /* point in tri */ -// XXX was called IsectPT2Df + int isect_point_tri_v2(float pt[2], float v1[2], float v2[2], float v3[2]) { - if (SIDE_OF_LINE(v1,v2,pt)>=0.0) { - if (SIDE_OF_LINE(v2,v3,pt)>=0.0) { - if (SIDE_OF_LINE(v3,v1,pt)>=0.0) { + if (line_point_side_v2(v1,v2,pt)>=0.0) { + if (line_point_side_v2(v2,v3,pt)>=0.0) { + if (line_point_side_v2(v3,v1,pt)>=0.0) { return 1; } } } else { - if (! (SIDE_OF_LINE(v2,v3,pt)>=0.0)) { - if (! (SIDE_OF_LINE(v3,v1,pt)>=0.0)) { + if (! (line_point_side_v2(v2,v3,pt)>=0.0)) { + if (! (line_point_side_v2(v3,v1,pt)>=0.0)) { return -1; } } @@ -360,18 +359,18 @@ int isect_point_tri_v2(float pt[2], float v1[2], float v2[2], float v3[2]) /* point in quad - only convex quads */ int isect_point_quad_v2(float pt[2], float v1[2], float v2[2], float v3[2], float v4[2]) { - if (SIDE_OF_LINE(v1,v2,pt)>=0.0) { - if (SIDE_OF_LINE(v2,v3,pt)>=0.0) { - if (SIDE_OF_LINE(v3,v4,pt)>=0.0) { - if (SIDE_OF_LINE(v4,v1,pt)>=0.0) { + if (line_point_side_v2(v1,v2,pt)>=0.0) { + if (line_point_side_v2(v2,v3,pt)>=0.0) { + if (line_point_side_v2(v3,v4,pt)>=0.0) { + if (line_point_side_v2(v4,v1,pt)>=0.0) { return 1; } } } } else { - if (! (SIDE_OF_LINE(v2,v3,pt)>=0.0)) { - if (! (SIDE_OF_LINE(v3,v4,pt)>=0.0)) { - if (! (SIDE_OF_LINE(v4,v1,pt)>=0.0)) { + if (! (line_point_side_v2(v2,v3,pt)>=0.0)) { + if (! (line_point_side_v2(v3,v4,pt)>=0.0)) { + if (! (line_point_side_v2(v4,v1,pt)>=0.0)) { return -1; } } diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index 2f75fcead79..a45356f0bde 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -454,5 +454,11 @@ MINLINE int compare_v4v4(float *v1, float *v2, float limit) return 0; } +MINLINE float line_point_side_v2(const float *l1, const float *l2, const float *pt) +{ + return ((l1[0]-pt[0]) * (l2[1]-pt[1])) - + ((l2[0]-pt[0]) * (l1[1]-pt[1])); +} + #endif /* BLI_MATH_VECTOR_INLINE */ diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index 7896ebdd263..85af307be16 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -747,7 +747,7 @@ static void scanfill(PolyFill *pf, int mat_nr) -int BLI_edgefill(int mode, int mat_nr) +int BLI_edgefill(int mat_nr) { /* - fill works with its own lists, so create that first (no faces!) diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 2501a01d0e6..ad4c02c834c 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -113,7 +113,6 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) EditVert *eve; float min[3], max[3]; int done= 0; - int rot_src= RNA_boolean_get(op->ptr, "rotate_source"); em_setup_viewcontext(C, &vc); @@ -130,14 +129,13 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) /* call extrude? */ if(done) { + int rot_src= RNA_boolean_get(op->ptr, "rotate_source"); EditEdge *eed; float vec[3], cent[3], mat[3][3]; float nor[3]= {0.0, 0.0, 0.0}; /* 2D normal calc */ float mval_f[2]= {(float)event->mval[0], (float)event->mval[1]}; - -#define SIDE_OF_LINE(pa,pb,pp) ((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1])) done= 0; @@ -155,7 +153,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) * * accumulate the screenspace normal in 2D, * with screenspace edge length weighting the result. */ - if(SIDE_OF_LINE(co1, co2, mval_f) >= 0.0f) { + if(line_point_side_v2(co1, co2, mval_f) >= 0.0f) { nor[0] += (co1[1] - co2[1]); nor[1] += -(co1[0] - co2[0]); } @@ -167,8 +165,6 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) } } -#undef SIDE_OF_LINE - if(done) { float view_vec[3], cross[3]; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index fc8a713230f..fb29257b184 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -7003,7 +7003,7 @@ static void fill_mesh(EditMesh *em) } } - if(BLI_edgefill(0, em->mat_nr)) { + if(BLI_edgefill(em->mat_nr)) { efa= fillfacebase.first; while(efa) { /* normals default pointing up */ diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index a921620fa71..0c28d4a608b 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -69,7 +69,7 @@ /* ****************** render BAKING ********************** */ /* threaded break test */ -static int thread_break(void *unused) +static int thread_break(void *UNUSED(arg)) { return G.afbreek; } diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index ab3c649299c..02c88d4149b 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -511,7 +511,7 @@ static int edit_constraint_invoke_properties(bContext *C, wmOperator *op) return 0; } -static bConstraint *edit_constraint_property_get(bContext *C, wmOperator *op, Object *ob, int type) +static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, int type) { char constraint_name[32]; int owner = RNA_enum_get(op->ptr, "owner"); @@ -547,7 +547,7 @@ static bConstraint *edit_constraint_property_get(bContext *C, wmOperator *op, Ob static int stretchto_reset_exec (bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); - bConstraint *con = edit_constraint_property_get(C, op, ob, CONSTRAINT_TYPE_STRETCHTO); + bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_STRETCHTO); bStretchToConstraint *data= (con) ? (bStretchToConstraint *)con->data : NULL; /* despite 3 layers of checks, we may still not be able to find a constraint */ @@ -590,7 +590,7 @@ void CONSTRAINT_OT_stretchto_reset (wmOperatorType *ot) static int limitdistance_reset_exec (bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); - bConstraint *con = edit_constraint_property_get(C, op, ob, CONSTRAINT_TYPE_DISTLIMIT); + bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_DISTLIMIT); bDistLimitConstraint *data= (con) ? (bDistLimitConstraint *)con->data : NULL; /* despite 3 layers of checks, we may still not be able to find a constraint */ @@ -636,7 +636,7 @@ static int childof_set_inverse_exec (bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob = ED_object_active_context(C); - bConstraint *con = edit_constraint_property_get(C, op, ob, CONSTRAINT_TYPE_CHILDOF); + bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_CHILDOF); bChildOfConstraint *data= (con) ? (bChildOfConstraint *)con->data : NULL; bPoseChannel *pchan= NULL; @@ -720,7 +720,7 @@ void CONSTRAINT_OT_childof_set_inverse (wmOperatorType *ot) static int childof_clear_inverse_exec (bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); - bConstraint *con = edit_constraint_property_get(C, op, ob, CONSTRAINT_TYPE_CHILDOF); + bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_CHILDOF); bChildOfConstraint *data= (con) ? (bChildOfConstraint *)con->data : NULL; /* simply clear the matrix */ @@ -837,7 +837,7 @@ void CONSTRAINT_OT_delete (wmOperatorType *ot) static int constraint_move_down_exec (bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); - bConstraint *con = edit_constraint_property_get(C, op, ob, 0); + bConstraint *con = edit_constraint_property_get(op, ob, 0); if (con && con->next) { ListBase *conlist= get_constraint_lb(ob, con, NULL); @@ -885,7 +885,7 @@ void CONSTRAINT_OT_move_down (wmOperatorType *ot) static int constraint_move_up_exec (bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); - bConstraint *con = edit_constraint_property_get(C, op, ob, 0); + bConstraint *con = edit_constraint_property_get(op, ob, 0); if (con && con->prev) { ListBase *conlist= get_constraint_lb(ob, con, NULL); diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index e6511b82eeb..3c3e7f1df76 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -557,7 +557,7 @@ static int object_hook_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static EnumPropertyItem *hook_mod_itemf(bContext *C, PointerRNA *ptr, int *free) +static EnumPropertyItem *hook_mod_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { Object *ob = CTX_data_edit_object(C); EnumPropertyItem tmp = {0, "", 0, "", ""}; diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 33f3534bb3b..0aefb09ee9e 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -161,7 +161,7 @@ static int ED_object_shape_key_remove(bContext *C, Object *ob) return 1; } -static int ED_object_shape_key_mirror(bContext *C, Scene *scene, Object *ob) +static int object_shape_key_mirror(bContext *C, Object *ob) { KeyBlock *kb; Key *key; @@ -327,10 +327,9 @@ void OBJECT_OT_shape_key_clear(wmOperatorType *ot) static int shape_key_mirror_exec(bContext *C, wmOperator *UNUSED(op)) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - if(!ED_object_shape_key_mirror(C, scene, ob)) + if(!object_shape_key_mirror(C, ob)) return OPERATOR_CANCELLED; return OPERATOR_FINISHED; diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index c8c5492c966..015fab05828 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1947,7 +1947,7 @@ static int set_active_group_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static EnumPropertyItem *vgroup_itemf(bContext *C, PointerRNA *ptr, int *free) +static EnumPropertyItem *vgroup_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; EnumPropertyItem tmp = {0, "", 0, "", ""}; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 5caa6c5045b..2521f138fee 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -473,8 +473,6 @@ static int project_bucket_offset_safe(const ProjPaintState *ps, const float proj } } -#define SIDE_OF_LINE(pa, pb, pp) ((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1])) - /* still use 2D X,Y space but this works for verts transformed by a perspective matrix, using their 4th component as a weight */ static void barycentric_weights_v2_persp(float v1[4], float v2[4], float v3[4], float co[2], float w[3]) { @@ -1689,7 +1687,7 @@ static float Vec2Lenf_nosqrt_other(const float *v1, const float v2_1, const floa /* note, use a squared value so we can use Vec2Lenf_nosqrt * be sure that you have done a bounds check first or this may fail */ /* only give bucket_bounds as an arg because we need it elsewhere */ -static int project_bucket_isect_circle(const int bucket_x, const int bucket_y, const float cent[2], const float radius_squared, rctf *bucket_bounds) +static int project_bucket_isect_circle(const float cent[2], const float radius_squared, rctf *bucket_bounds) { /* Would normally to a simple intersection test, however we know the bounds of these 2 already intersect @@ -1852,7 +1850,7 @@ static void project_bucket_clip_face( { int inside_bucket_flag = 0; int inside_face_flag = 0; - const int flip = ((SIDE_OF_LINE(v1coSS, v2coSS, v3coSS) > 0.0f) != (SIDE_OF_LINE(uv1co, uv2co, uv3co) > 0.0f)); + const int flip = ((line_point_side_v2(v1coSS, v2coSS, v3coSS) > 0.0f) != (line_point_side_v2(uv1co, uv2co, uv3co) > 0.0f)); float bucket_bounds_ss[4][2]; @@ -2134,15 +2132,15 @@ if __name__ == '__main__': /* checks if pt is inside a convex 2D polyline, the polyline must be ordered rotating clockwise - * otherwise it would have to test for mixed (SIDE_OF_LINE > 0.0f) cases */ + * otherwise it would have to test for mixed (line_point_side_v2 > 0.0f) cases */ int IsectPoly2Df(const float pt[2], float uv[][2], const int tot) { int i; - if (SIDE_OF_LINE(uv[tot-1], uv[0], pt) < 0.0f) + if (line_point_side_v2(uv[tot-1], uv[0], pt) < 0.0f) return 0; for (i=1; i 0.0f); + int side = (line_point_side_v2(uv[tot-1], uv[0], pt) > 0.0f); for (i=1; i 0.0f) != side) + if ((line_point_side_v2(uv[i-1], uv[i], pt) > 0.0f) != side) return 0; } @@ -2652,7 +2650,7 @@ static void project_bucket_init(const ProjPaintState *ps, const int thread_index * calculated when it might not be needed later, (at the moment at least) * obviously it shouldn't have bugs though */ -static int project_bucket_face_isect(ProjPaintState *ps, float min[2], float max[2], int bucket_x, int bucket_y, int bucket_index, const MFace *mf) +static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucket_y, const MFace *mf) { /* TODO - replace this with a tricker method that uses sideofline for all screenCoords's edges against the closest bucket corner */ rctf bucket_bounds; @@ -2712,11 +2710,11 @@ static int project_bucket_face_isect(ProjPaintState *ps, float min[2], float max /* Add faces to the bucket but dont initialize its pixels * TODO - when painting occluded, sort the faces on their min-Z and only add faces that faces that are not occluded */ -static void project_paint_delayed_face_init(ProjPaintState *ps, const MFace *mf, const MTFace *tf, const int face_index) +static void project_paint_delayed_face_init(ProjPaintState *ps, const MFace *mf, const int face_index) { float min[2], max[2], *vCoSS; int bucketMin[2], bucketMax[2]; /* for ps->bucketRect indexing */ - int fidx, bucket_x, bucket_y, bucket_index; + int fidx, bucket_x, bucket_y; int has_x_isect = -1, has_isect = 0; /* for early loop exit */ MemArena *arena = ps->arena_mt[0]; /* just use the first thread arena since threading has not started yet */ @@ -2733,10 +2731,8 @@ static void project_paint_delayed_face_init(ProjPaintState *ps, const MFace *mf, for (bucket_y = bucketMin[1]; bucket_y < bucketMax[1]; bucket_y++) { has_x_isect = 0; for (bucket_x = bucketMin[0]; bucket_x < bucketMax[0]; bucket_x++) { - - bucket_index = bucket_x + (bucket_y * ps->buckets_x); - - if (project_bucket_face_isect(ps, min, max, bucket_x, bucket_y, bucket_index, mf)) { + if (project_bucket_face_isect(ps, bucket_x, bucket_y, mf)) { + int bucket_index= bucket_x + (bucket_y * ps->buckets_x); BLI_linklist_prepend_arena( &ps->bucketFaces[ bucket_index ], SET_INT_IN_POINTER(face_index), /* cast to a pointer to shut up the compiler */ @@ -3194,7 +3190,7 @@ static void project_paint_begin(ProjPaintState *ps) } } else { - if (SIDE_OF_LINE(v1coSS, v2coSS, v3coSS) < 0.0f) { + if (line_point_side_v2(v1coSS, v2coSS, v3coSS) < 0.0f) { continue; } @@ -3217,7 +3213,7 @@ static void project_paint_begin(ProjPaintState *ps) if (image_index != -1) { /* Initialize the faces screen pixels */ /* Add this to a list to initialize later */ - project_paint_delayed_face_init(ps, mf, tf, face_index); + project_paint_delayed_face_init(ps, mf, face_index); } } } @@ -3500,7 +3496,7 @@ static int project_bucket_iter_next(ProjPaintState *ps, int *bucket_index, rctf project_bucket_bounds(ps, ps->context_bucket_x, ps->context_bucket_y, bucket_bounds); if ( (ps->source != PROJ_SRC_VIEW) || - project_bucket_isect_circle(ps->context_bucket_x, ps->context_bucket_y, mval, (float)(diameter*diameter), bucket_bounds) + project_bucket_isect_circle(mval, (float)(diameter*diameter), bucket_bounds) ) { *bucket_index = ps->context_bucket_x + (ps->context_bucket_y * ps->buckets_x); ps->context_bucket_x++; @@ -3569,7 +3565,7 @@ static void blend_color_mix_accum(unsigned char *cp, const unsigned char *cp1, c cp[3]= alpha > 255 ? 255 : alpha; } -static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask) +static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask) { if (ps->is_airbrush==0 && mask < 1.0f) { projPixel->newColor.uint = IMB_blend_color(projPixel->newColor.uint, ((ProjPixelClone*)projPixel)->clonepx.uint, (int)(alpha*255), ps->blend); @@ -3580,7 +3576,7 @@ static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, floa } } -static void do_projectpaint_clone_f(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask) +static void do_projectpaint_clone_f(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask) { if (ps->is_airbrush==0 && mask < 1.0f) { IMB_blend_color_float(projPixel->newColor.f, projPixel->newColor.f, ((ProjPixelClone *)projPixel)->clonepx.f, alpha, ps->blend); @@ -3597,7 +3593,7 @@ static void do_projectpaint_clone_f(ProjPaintState *ps, ProjPixel *projPixel, fl * accumulation of color greater then 'projPixel->mask' however in the case of smear its not * really that important to be correct as it is with clone and painting */ -static void do_projectpaint_smear(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask, MemArena *smearArena, LinkNode **smearPixels, float co[2]) +static void do_projectpaint_smear(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask, MemArena *smearArena, LinkNode **smearPixels, float co[2]) { unsigned char rgba_ub[4]; @@ -3608,7 +3604,7 @@ static void do_projectpaint_smear(ProjPaintState *ps, ProjPixel *projPixel, floa BLI_linklist_prepend_arena(smearPixels, (void *)projPixel, smearArena); } -static void do_projectpaint_smear_f(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask, MemArena *smearArena, LinkNode **smearPixels_f, float co[2]) +static void do_projectpaint_smear_f(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask, MemArena *smearArena, LinkNode **smearPixels_f, float co[2]) { unsigned char rgba_ub[4]; unsigned char rgba_smear[4]; @@ -3757,6 +3753,7 @@ static void *do_projectpaint_thread(void *ph_v) if (falloff > 0.0f) { if (ps->is_texbrush) { + /* note, for clone and smear, we only use the alpha, could be a special function */ brush_sample_tex(ps->brush, projPixel->projCoSS, rgba, thread_index); alpha = rgba[3]; } else { @@ -3808,20 +3805,20 @@ static void *do_projectpaint_thread(void *ph_v) case PAINT_TOOL_CLONE: if (is_floatbuf) { if (((ProjPixelClone *)projPixel)->clonepx.f[3]) { - do_projectpaint_clone_f(ps, projPixel, rgba, alpha, mask); + do_projectpaint_clone_f(ps, projPixel, alpha, mask); /* rgba isnt used for cloning, only alpha */ } } else { if (((ProjPixelClone*)projPixel)->clonepx.ch[3]) { - do_projectpaint_clone(ps, projPixel, rgba, alpha, mask); + do_projectpaint_clone(ps, projPixel, alpha, mask); /* rgba isnt used for cloning, only alpha */ } } break; case PAINT_TOOL_SMEAR: sub_v2_v2v2(co, projPixel->projCoSS, pos_ofs); - if (is_floatbuf) do_projectpaint_smear_f(ps, projPixel, rgba, alpha, mask, smearArena, &smearPixels_f, co); - else do_projectpaint_smear(ps, projPixel, rgba, alpha, mask, smearArena, &smearPixels, co); + if (is_floatbuf) do_projectpaint_smear_f(ps, projPixel, alpha, mask, smearArena, &smearPixels_f, co); + else do_projectpaint_smear(ps, projPixel, alpha, mask, smearArena, &smearPixels, co); break; default: if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, rgba, alpha, mask); @@ -3861,7 +3858,7 @@ static void *do_projectpaint_thread(void *ph_v) return NULL; } -static int project_paint_op(void *state, ImBuf *ibufb, float *lastpos, float *pos) +static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), float *lastpos, float *pos) { /* First unpack args from the struct */ ProjPaintState *ps = (ProjPaintState *)state; @@ -3928,7 +3925,7 @@ static int project_paint_op(void *state, ImBuf *ibufb, float *lastpos, float *po } -static int project_paint_sub_stroke(ProjPaintState *ps, BrushPainter *painter, int *prevmval_i, int *mval_i, double time, float pressure) +static int project_paint_sub_stroke(ProjPaintState *ps, BrushPainter *painter, int *UNUSED(prevmval_i), int *mval_i, double time, float pressure) { /* Use mouse coords as floats for projection painting */ @@ -4387,7 +4384,7 @@ static int imapaint_paint_stroke(ViewContext *vc, ImagePaintState *s, BrushPaint ibuf= BKE_image_get_ibuf(newimage, s->sima? &s->sima->iuser: NULL); if(ibuf && ibuf->rect) - imapaint_pick_uv(s->scene, s->ob, s->me, newfaceindex, mval, newuv); + imapaint_pick_uv(s->scene, s->ob, newfaceindex, mval, newuv); else { newimage = NULL; newuv[0] = newuv[1] = 0.0f; @@ -4398,8 +4395,8 @@ static int imapaint_paint_stroke(ViewContext *vc, ImagePaintState *s, BrushPaint /* see if stroke is broken, and if so finish painting in old position */ if (s->image) { - imapaint_pick_uv(s->scene, s->ob, s->me, s->faceindex, mval, fwuv); - imapaint_pick_uv(s->scene, s->ob, s->me, newfaceindex, prevmval, bkuv); + imapaint_pick_uv(s->scene, s->ob, s->faceindex, mval, fwuv); + imapaint_pick_uv(s->scene, s->ob, newfaceindex, prevmval, bkuv); if (newimage == s->image) breakstroke= texpaint_break_stroke(s->uv, fwuv, bkuv, newuv); @@ -4410,7 +4407,7 @@ static int imapaint_paint_stroke(ViewContext *vc, ImagePaintState *s, BrushPaint fwuv[0]= fwuv[1]= 0.0f; if (breakstroke) { - imapaint_pick_uv(s->scene, s->ob, s->me, s->faceindex, mval, fwuv); + imapaint_pick_uv(s->scene, s->ob, s->faceindex, mval, fwuv); redraw |= imapaint_paint_sub_stroke(s, painter, s->image, texpaint, fwuv, time, 1, pressure); imapaint_clear_partial_redraw(); @@ -4923,7 +4920,7 @@ static int get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy) /************************ cursor drawing *******************************/ -static void brush_drawcursor(bContext *C, int x, int y, void *customdata) +static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)) { Brush *brush= image_paint_brush(C); Paint *paint= paint_get_active(CTX_data_scene(C)); diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index 3ed314095ef..6232a8f2de1 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -99,7 +99,7 @@ void PAINT_OT_image_from_view(struct wmOperatorType *ot); /* paint_utils.c */ int imapaint_pick_face(struct ViewContext *vc, struct Mesh *me, int *mval, unsigned int *index); -void imapaint_pick_uv(struct Scene *scene, struct Object *ob, struct Mesh *mesh, unsigned int faceindex, int *xy, float *uv); +void imapaint_pick_uv(struct Scene *scene, struct Object *ob, unsigned int faceindex, int *xy, float *uv); void paint_sample_color(struct Scene *scene, struct ARegion *ar, int x, int y); void BRUSH_OT_curve_preset(struct wmOperatorType *ot); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 6d58731d79c..e991c4fc3fa 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -253,7 +253,7 @@ static void make_snap(Snapshot* snap, Brush* brush, ViewContext* vc) snap->winy = vc->ar->winy; } -int load_tex(Sculpt *sd, Brush* br, ViewContext* vc) +static int load_tex(Brush* br, ViewContext* vc) { static GLuint overlay_texture = 0; static int init = 0; @@ -611,7 +611,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *unused) GL_VIEWPORT_BIT| GL_TEXTURE_BIT); - if (load_tex(sd, brush, &vc)) { + if (load_tex(brush, &vc)) { glEnable(GL_BLEND); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 8fee8c7e8fc..e3a486a0fee 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -88,7 +88,7 @@ static void imapaint_tri_weights(Object *ob, float *v1, float *v2, float *v3, fl } /* compute uv coordinates of mouse in face */ -void imapaint_pick_uv(Scene *scene, Object *ob, Mesh *mesh, unsigned int faceindex, int *xy, float *uv) +void imapaint_pick_uv(Scene *scene, Object *ob, unsigned int faceindex, int *xy, float *uv) { DerivedMesh *dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH); int *index = dm->getFaceDataArray(dm, CD_ORIGINDEX); diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c index 9c0f151aa8b..240e91ad22e 100644 --- a/source/blender/ikplugin/intern/iksolver_plugin.c +++ b/source/blender/ikplugin/intern/iksolver_plugin.c @@ -488,7 +488,7 @@ static void free_posetree(PoseTree *tree) ///---------------------------------------- /// Plugin API for legacy iksolver -void iksolver_initialize_tree(struct Scene *scene, struct Object *ob, float ctime) +void iksolver_initialize_tree(struct Scene *UNUSED(scene), struct Object *ob, float UNUSED(ctime)) { bPoseChannel *pchan; diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index e87d2d79c39..e6220eac8f0 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -244,7 +244,7 @@ static void draw_filled_lasso(wmGesture *gt) /* highly unlikely this will fail, but could crash if (gt->points == 0) */ if(firstv) { BLI_addfilledge(firstv, v); - BLI_edgefill(0, 0); + BLI_edgefill(0); glEnable(GL_BLEND); glColor4f(1.0, 1.0, 1.0, 0.05); -- cgit v1.2.3 From 4e61d5420c6b45c406bc59bd311342579c619e9c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Oct 2010 05:27:57 +0000 Subject: Ctrl+Click extrude, project the source verts when projection and rotating the source are enabled (better for retopo workflow). --- source/blender/editors/mesh/editmesh_add.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index ad4c02c834c..30070581a1c 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -113,9 +113,12 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) EditVert *eve; float min[3], max[3]; int done= 0; - + short use_proj; + em_setup_viewcontext(C, &vc); + use_proj= ((vc.scene->toolsettings->snap_flag & (SCE_SNAP|SCE_SNAP_PROJECT))==(SCE_SNAP|SCE_SNAP_PROJECT)) && (vc.scene->toolsettings->snap_mode==SCE_SNAP_MODE_FACE); + invert_m4_m4(vc.obedit->imat, vc.obedit->obmat); INIT_MINMAX(min, max); @@ -129,7 +132,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) /* call extrude? */ if(done) { - int rot_src= RNA_boolean_get(op->ptr, "rotate_source"); + short rot_src= RNA_boolean_get(op->ptr, "rotate_source"); EditEdge *eed; float vec[3], cent[3], mat[3][3]; float nor[3]= {0.0, 0.0, 0.0}; @@ -221,8 +224,12 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) } } - if(rot_src) + if(rot_src) { rotateflag(vc.em, SELECT, cent, mat); + /* also project the source, for retopo workflow */ + if(use_proj) + EM_project_snap_verts(C, vc.ar, vc.obedit, vc.em); + } extrudeflag(vc.obedit, vc.em, SELECT, nor, 0); rotateflag(vc.em, SELECT, cent, mat); @@ -249,11 +256,8 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) eve->f= SELECT; } - if( ((vc.scene->toolsettings->snap_flag & (SCE_SNAP|SCE_SNAP_PROJECT))==(SCE_SNAP|SCE_SNAP_PROJECT)) && - (vc.scene->toolsettings->snap_mode==SCE_SNAP_MODE_FACE) - ) { + if(use_proj) EM_project_snap_verts(C, vc.ar, vc.obedit, vc.em); - } WM_event_add_notifier(C, NC_GEOM|ND_DATA, vc.obedit->data); DAG_id_flush_update(vc.obedit->data, OB_RECALC_DATA); -- cgit v1.2.3 From 271bbf4a0d7390f68ac973aa83bbb89fd0e4f583 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Oct 2010 07:26:26 +0000 Subject: fix for own recent unused commit that broke with OpenMP enabled. also build ./source/ first with cmake since testing new changes are most likely to be made here. --- source/blender/editors/sculpt_paint/paint_stroke.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index e991c4fc3fa..ea99844bfac 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -253,7 +253,7 @@ static void make_snap(Snapshot* snap, Brush* brush, ViewContext* vc) snap->winy = vc->ar->winy; } -static int load_tex(Brush* br, ViewContext* vc) +static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc) { static GLuint overlay_texture = 0; static int init = 0; @@ -268,8 +268,12 @@ static int load_tex(Brush* br, ViewContext* vc) int j; int refresh; +#ifndef _OPENMP + (void)sd; /* quied unused warning */ +#endif + if (br->mtex.brush_map_mode == MTEX_MAP_MODE_TILED && !br->mtex.tex) return 0; - + refresh = !overlay_texture || (br->mtex.tex && @@ -611,7 +615,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *unused) GL_VIEWPORT_BIT| GL_TEXTURE_BIT); - if (load_tex(brush, &vc)) { + if (load_tex(sd, brush, &vc)) { glEnable(GL_BLEND); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); -- cgit v1.2.3 From bb11d6337e334b9ceb6fc9b27c8f0aba13897d9a Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 15 Oct 2010 07:31:26 +0000 Subject: Fix [#24260] Window geometry command-line option doesn't work Override the first window size with --window-geometry if given. startup.blend would otherwise open as lastly saved. --- source/blender/windowmanager/intern/wm_window.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index d9d7abd3a68..3600267dabc 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -68,6 +68,7 @@ GHOST_SystemHandle g_system= NULL; /* set by commandline */ static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, initialstate= GHOST_kWindowStateNormal; +static int prefsizeused = 0; /* ******** win open & close ************ */ @@ -372,18 +373,19 @@ void wm_window_add_ghostwindows(bContext* C, wmWindowManager *wm) for(win= wm->windows.first; win; win= win->next) { if(win->ghostwin==NULL) { - if(win->sizex==0) { + if(win->sizex==0 || prefsizeused==0) { win->posx= prefstax; win->posy= prefstay; win->sizex= prefsizx; win->sizey= prefsizy; win->windowstate= initialstate; + prefsizeused= 1; } wm_window_add_ghostwindow(C, wm, "Blender", win); } /* happens after fileread */ if(win->eventstate==NULL) - win->eventstate= MEM_callocN(sizeof(wmEvent), "window event state"); + win->eventstate= MEM_callocN(sizeof(wmEvent), "window event state"); /* add keymap handlers (1 handler for all keys in map!) */ keymap= WM_keymap_find(wm->defaultconf, "Window", 0, 0); -- cgit v1.2.3 From 4cfecdd06ab3f45c944b42c003e8dbd9179e911f Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Fri, 15 Oct 2010 08:11:26 +0000 Subject: Fix for [#21822] Unusual material slot behaviour, edit v object mode, cascade, SVN 27833 * Disabled removing material slots in edit mode and added back error message from 2.49. --- source/blender/editors/render/render_shading.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender') diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index a989171d617..a058f5155de 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -289,6 +289,12 @@ static int material_slot_remove_exec(bContext *C, wmOperator *UNUSED(op)) if(!ob) return OPERATOR_CANCELLED; + /* Removing material slots in edit mode screws things up, see bug #21822.*/ + if(ob == CTX_data_edit_object(C)) { + BKE_report(op->reports, RPT_ERROR, "Unable to remove material slot in edit mode."); + return OPERATOR_CANCELLED; + } + object_remove_material_slot(ob); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); WM_event_add_notifier(C, NC_OBJECT|ND_OB_SHADING, ob); -- cgit v1.2.3 From 7a535ed3d9691d3d7df52848f8a8621633c00de0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Oct 2010 08:32:27 +0000 Subject: [#24263] Hooks influence area with vertex group assigned is not effected changes... - use vertex weights when hook indices are used. - use force as well as vertex weights (overall multiplier), before when vertex weights were used force was ignored. - rearranged the loops to be less confusing. - falloff now in its own function. - falloff curve slightly different, smoother towards the center /w 2 less sqrt calls. --- source/blender/modifiers/intern/MOD_hook.c | 176 ++++++++++++++++------------- 1 file changed, 95 insertions(+), 81 deletions(-) (limited to 'source/blender') diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index 8ad3c9aaf5b..c26d3ff0967 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -75,7 +75,8 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) CustomDataMask dataMask = 0; /* ask for vertexgroups if we need them */ - if(!hmd->indexar && hmd->name[0]) dataMask |= (1 << CD_MDEFORMVERT); + if(hmd->name[0]) dataMask |= (1 << CD_MDEFORMVERT); + // if(hmd->indexar) dataMask |= CD_MASK_ORIGINDEX; return dataMask; } @@ -121,6 +122,21 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, } } +static float hook_falloff(float *co_1, float *co_2, const float falloff_squared, float fac) +{ + if(falloff_squared) { + float len_squared = len_squared_v3v3(co_1, co_2); + if(len_squared > falloff_squared) { + return 0.0f; + } + else if(len_squared > 0.0) { + return fac * (1.0 - (len_squared / falloff_squared)); + } + } + + return fac; +} + static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], @@ -131,8 +147,13 @@ static void deformVerts(ModifierData *md, Object *ob, HookModifierData *hmd = (HookModifierData*) md; bPoseChannel *pchan= get_pose_channel(hmd->object->pose, hmd->subtarget); float vec[3], mat[4][4], dmat[4][4]; - int i; + int i, *index_pt; DerivedMesh *dm = derivedData; + const float falloff_squared= hmd->falloff * hmd->falloff; /* for faster comparisons */ + + int max_dvert= 0; + MDeformVert *dvert= NULL; + int defgrp_index = -1; /* get world-space matrix of target, corrected for the space the verts are in */ if (hmd->subtarget[0] && pchan) { @@ -147,98 +168,91 @@ static void deformVerts(ModifierData *md, Object *ob, mul_serie_m4(mat, ob->imat, dmat, hmd->parentinv, NULL, NULL, NULL, NULL, NULL); - /* vertex indices? */ - if(hmd->indexar) { - for(i = 0; i < hmd->totindex; i++) { - int index = hmd->indexar[i]; - - /* This should always be true and I don't generally like - * "paranoid" style code like this, but old files can have - * indices that are out of range because old blender did - * not correct them on exit editmode. - zr - */ - if(index < numVerts) { - float *co = vertexCos[index]; - float fac = hmd->force; - - /* if DerivedMesh is present and has original index data, - * use it - */ - if(dm && dm->getVertDataArray(dm, CD_ORIGINDEX)) { + if((defgrp_index= defgroup_name_index(ob, hmd->name)) != -1) { + Mesh *me = ob->data; + if(dm) { + dvert= dm->getVertDataArray(dm, CD_MDEFORMVERT); + if(dvert) { + max_dvert = numVerts; + } + } + else if(me->dvert) { + dvert= me->dvert; + if(dvert) { + max_dvert = me->totvert; + } + } + } + + /* Regarding index range checking below. + * + * This should always be true and I don't generally like + * "paranoid" style code like this, but old files can have + * indices that are out of range because old blender did + * not correct them on exit editmode. - zr + */ + + if(hmd->force == 0.0f) { + /* do nothing, avoid annoying checks in the loop */ + } + else if(hmd->indexar) { /* vertex indices? */ + const float fac_orig= hmd->force; + float fac; + const int *origindex_ar; + + /* if DerivedMesh is present and has original index data, + * use it + */ + if(dm && (origindex_ar= dm->getVertDataArray(dm, CD_ORIGINDEX))) { + for(i= 0, index_pt= hmd->indexar; i < hmd->totindex; i++, index_pt++) { + if(*index_pt < numVerts) { int j; - int orig_index; - for(j = 0; j < numVerts; ++j) { - fac = hmd->force; - orig_index = *(int *)dm->getVertData(dm, j, - CD_ORIGINDEX); - if(orig_index == index) { - co = vertexCos[j]; - if(hmd->falloff != 0.0) { - float len = len_v3v3(co, hmd->cent); - if(len > hmd->falloff) fac = 0.0; - else if(len > 0.0) - fac *= sqrt(1.0 - len / hmd->falloff); - } - if(fac != 0.0) { - mul_v3_m4v3(vec, mat, co); - interp_v3_v3v3(co, co, vec, fac); + for(j = 0; j < numVerts; j++) { + if(origindex_ar[j] == *index_pt) { + float *co = vertexCos[j]; + if((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) { + if(dvert) + fac *= defvert_find_weight(dvert+j, defgrp_index); + + if(fac) { + mul_v3_m4v3(vec, mat, co); + interp_v3_v3v3(co, co, vec, fac); + } } } } - } else { - if(hmd->falloff != 0.0) { - float len = len_v3v3(co, hmd->cent); - if(len > hmd->falloff) fac = 0.0; - else if(len > 0.0) - fac *= sqrt(1.0 - len / hmd->falloff); - } - - if(fac != 0.0) { - mul_v3_m4v3(vec, mat, co); - interp_v3_v3v3(co, co, vec, fac); - } } } } - } - else if(hmd->name[0]) { /* vertex group hook */ - Mesh *me = ob->data; - int use_dverts = 0; - int maxVerts = 0; - int defgrp_index = defgroup_name_index(ob, hmd->name); - - if(dm) { - if(dm->getVertData(dm, 0, CD_MDEFORMVERT)) { - maxVerts = dm->getNumVerts(dm); - use_dverts = 1; + else { /* missing dm or ORIGINDEX */ + for(i= 0, index_pt= hmd->indexar; i < hmd->totindex; i++, index_pt++) { + if(*index_pt < numVerts) { + float *co = vertexCos[*index_pt]; + if((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) { + if(dvert) + fac *= defvert_find_weight(dvert+(*index_pt), defgrp_index); + + if(fac) { + mul_v3_m4v3(vec, mat, co); + interp_v3_v3v3(co, co, vec, fac); + } + } + } } } - else if(me->dvert) { - maxVerts = me->totvert; - use_dverts = 1; - } + } + else if(dvert) { /* vertex group hook */ + int i; + const float fac_orig= hmd->force; - if(defgrp_index >= 0 && use_dverts) { - MDeformVert *dvert = me->dvert; - int i; + for(i = 0; i < max_dvert; i++, dvert++) { float fac; + float *co = vertexCos[i]; - for(i = 0; i < maxVerts; i++, dvert++) { - if(dm) dvert = dm->getVertData(dm, i, CD_MDEFORMVERT); - - fac= defvert_find_weight(dvert, defgrp_index); - - if(fac > 0.0f) { - float *co = vertexCos[i]; - - if(hmd->falloff != 0.0) { - float len = len_v3v3(co, hmd->cent); - if(len > hmd->falloff) fac = 0.0; - else if(len > 0.0) - fac *= sqrt(1.0 - len / hmd->falloff); - } - + if((fac= hook_falloff(hmd->cent, co, falloff_squared, fac_orig))) { + fac *= defvert_find_weight(dvert, defgrp_index); + if(fac) { mul_v3_m4v3(vec, mat, co); interp_v3_v3v3(co, co, vec, fac); } -- cgit v1.2.3 From f756a047e6ec13762f7f90dd03b72794e986459c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Oct 2010 09:07:19 +0000 Subject: bugfix [#24264] toggle UV selection fails. was using the 4th selection flag on tri's. also some minor changes, removed unused args and corrected some comments. --- source/blender/blenkernel/intern/DerivedMesh.c | 2 +- source/blender/editors/include/ED_uvedit.h | 1 - source/blender/editors/mesh/editmesh_add.c | 15 ++--- source/blender/editors/space_node/node_header.c | 2 +- source/blender/editors/space_node/node_intern.h | 2 +- source/blender/editors/space_node/space_node.c | 2 +- source/blender/editors/uvedit/uvedit_ops.c | 83 +++++++++++-------------- 7 files changed, 48 insertions(+), 59 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index eb5d77bb9b0..496bcc0f88c 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2237,7 +2237,7 @@ static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask) Object *obact = scene->basact?scene->basact->object:NULL; int editing = paint_facesel_test(ob); /* weight paint and face select need original indicies because of selection buffer drawing */ - int needMapping = (ob==obact) && (editing || (ob->mode & (OB_MODE_WEIGHT_PAINT|OB_MODE_VERTEX_PAINT)) || editing); + int needMapping = (ob==obact) && (editing || (ob->mode & (OB_MODE_WEIGHT_PAINT|OB_MODE_VERTEX_PAINT))); clear_mesh_caches(ob); diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h index 1710a8439d1..737d124b494 100644 --- a/source/blender/editors/include/ED_uvedit.h +++ b/source/blender/editors/include/ED_uvedit.h @@ -41,7 +41,6 @@ void ED_operatortypes_uvedit(void); void ED_keymap_uvedit(struct wmKeyConfig *keyconf); void ED_uvedit_assign_image(struct Scene *scene, struct Object *obedit, struct Image *ima, struct Image *previma); -void ED_uvedit_set_tile(struct bContext *C, struct Scene *scene, struct Object *obedit, struct Image *ima, int curtile, int dotile); int ED_uvedit_minmax(struct Scene *scene, struct Image *ima, struct Object *obedit, float *min, float *max); int ED_uvedit_test_silent(struct Object *obedit); diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 30070581a1c..e1a4b2b2fd4 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -151,7 +151,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) project_float_noclip(vc.ar, co1, co1); project_float_noclip(vc.ar, co2, co2); - /* 2D rotate by 90d while subtracting + /* 2D rotate by 90d while adding. * (x, y) = (y, -x) * * accumulate the screenspace normal in 2D, @@ -181,14 +181,11 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) cross_v3_v3v3(cross, nor, view_vec); cross_v3_v3v3(nor, view_vec, cross); normalize_v3(nor); - - /* correct for flipping */ } /* center */ - add_v3_v3v3(cent, min, max); - mul_v3_fl(cent, 0.5f); - VECCOPY(min, cent); + mid_v3_v3v3(cent, min, max); + copy_v3_v3(min, cent); mul_m4_v3(vc.obedit->obmat, min); // view space view3d_get_view_aligned_coordinate(&vc, min, event->mval); @@ -201,7 +198,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) if(done) { float dot; - VECCOPY(vec, min); + copy_v3_v3(vec, min); normalize_v3(vec); dot= INPR(vec, nor); @@ -241,7 +238,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) float mat[3][3],imat[3][3]; float *curs= give_cursor(vc.scene, vc.v3d); - VECCOPY(min, curs); + copy_v3_v3(min, curs); view3d_get_view_aligned_coordinate(&vc, min, event->mval); eve= addvertlist(vc.em, 0, NULL); @@ -249,7 +246,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) copy_m3_m4(mat, vc.obedit->obmat); invert_m3_m3(imat, mat); - VECCOPY(eve->co, min); + copy_v3_v3(eve->co, min); mul_m3_v3(imat, eve->co); sub_v3_v3v3(eve->co, eve->co, vc.obedit->obmat[3]); diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index 0711ef66497..f22ff1515c5 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -202,7 +202,7 @@ static void node_menu_add(const bContext *C, Menu *menu) } } -void node_menus_register(ARegionType *art) +void node_menus_register(void) { MenuType *mt; diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index 77fda0627e7..cba491deb01 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -41,7 +41,7 @@ ARegion *node_has_buttons_region(ScrArea *sa); /* node_header.c */ void node_header_buttons(const bContext *C, ARegion *ar); -void node_menus_register(struct ARegionType *art); +void node_menus_register(void); /* node_draw.c */ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d); diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index c94fcb52e38..2d7cde37ec4 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -452,7 +452,7 @@ void ED_spacetype_node(void) BLI_addhead(&st->regiontypes, art); - node_menus_register(art); + node_menus_register(); /* regions: listview/buttons */ art= MEM_callocN(sizeof(ARegionType), "spacetype node region"); diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index c300b668675..d311733e945 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -141,7 +141,7 @@ void ED_uvedit_assign_image(Scene *scene, Object *obedit, Image *ima, Image *pre /* dotile - 1, set the tile flag (from the space image) * 2, set the tile index for the faces. */ -void ED_uvedit_set_tile(bContext *C, Scene *scene, Object *obedit, Image *ima, int curtile) +static int uvedit_set_tile(Object *obedit, Image *ima, int curtile) { EditMesh *em; EditFace *efa; @@ -149,11 +149,14 @@ void ED_uvedit_set_tile(bContext *C, Scene *scene, Object *obedit, Image *ima, i /* verify if we have something to do */ if(!ima || !ED_uvedit_test(obedit)) - return; - + return 0; + + if((ima->tpageflag & IMA_TILES) == 0) + return 0; + /* skip assigning these procedural images... */ if(ima->type==IMA_TYPE_R_RESULT || ima->type==IMA_TYPE_COMPOSITE) - return; + return 0; em= BKE_mesh_get_editmesh((Mesh*)obedit->data); @@ -165,8 +168,9 @@ void ED_uvedit_set_tile(bContext *C, Scene *scene, Object *obedit, Image *ima, i } DAG_id_flush_update(obedit->data, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); + + return 1; } /*********************** space conversion *********************/ @@ -845,7 +849,8 @@ static void select_linked(Scene *scene, Image *ima, EditMesh *em, float limit[2] tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); if(uvedit_face_visible(scene, ima, efa, tf)) { - if(tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)) { + const char select_flag= efa->v4 ? (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4) : (TF_SEL1|TF_SEL2|TF_SEL3); + if(tf->flag & select_flag) { stack[stacksize]= a; stacksize++; flag[a]= 1; @@ -909,12 +914,9 @@ static void select_linked(Scene *scene, Image *ima, EditMesh *em, float limit[2] else { for(a=0, efa= em->faces.first; efa; efa= efa->next, a++) { if(flag[a]) { + const char select_flag= efa->v4 ? (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4) : (TF_SEL1|TF_SEL2|TF_SEL3); tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if(efa->v4) { - if((tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4))) - break; - } - else if(tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) + if((tf->flag & select_flag)) break; } } @@ -1355,10 +1357,11 @@ static int select_all_exec(bContext *C, wmOperator *op) if (action == SEL_TOGGLE) { action = SEL_SELECT; for(efa= em->faces.first; efa; efa= efa->next) { + const char select_flag= efa->v4 ? (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4) : (TF_SEL1|TF_SEL2|TF_SEL3); tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); if(uvedit_face_visible(scene, ima, efa, tf)) { - if(tf->flag & (TF_SEL1+TF_SEL2+TF_SEL3+TF_SEL4)) { + if(tf->flag & select_flag) { action = SEL_DESELECT; break; } @@ -1370,12 +1373,7 @@ static int select_all_exec(bContext *C, wmOperator *op) tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); if(uvedit_face_visible(scene, ima, efa, tf)) { - char select_flag; - - if(efa->v4) - select_flag = (TF_SEL1+TF_SEL2+TF_SEL3+TF_SEL4); - else - select_flag = (TF_SEL1+TF_SEL2+TF_SEL3); + const char select_flag= efa->v4 ? (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4) : (TF_SEL1|TF_SEL2|TF_SEL3); switch (action) { case SEL_SELECT: @@ -1937,14 +1935,10 @@ static int unlink_selection_exec(bContext *C, wmOperator *op) tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); if(uvedit_face_visible(scene, ima, efa, tf)) { - if(efa->v4) { - if(~tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)) - tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); - } - else { - if(~tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) - tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3); - } + const char select_flag= efa->v4 ? (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4) : (TF_SEL1|TF_SEL2|TF_SEL3); + if(~tf->flag & select_flag) + tf->flag &= ~select_flag; + } } @@ -2260,7 +2254,7 @@ void UV_OT_select_border(wmOperatorType *ot) /* ******************** circle select operator **************** */ -static void select_uv_inside_ellipse(SpaceImage *sima, Scene *scene, int select, EditFace *efa, MTFace *tface, int index, float *offset, float *ell, int select_index) +static void select_uv_inside_ellipse(Scene *scene, int select, EditFace *efa, MTFace *tface, int index, float *offset, float *ell, int select_index) { /* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */ float x, y, r2, *uv; @@ -2309,11 +2303,11 @@ int circle_select_exec(bContext *C, wmOperator *op) /* do selection */ for(efa= em->faces.first; efa; efa= efa->next) { tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - select_uv_inside_ellipse(sima, scene, select, efa, tface, 0, offset, ellipse, 0); - select_uv_inside_ellipse(sima, scene, select, efa, tface, 1, offset, ellipse, 1); - select_uv_inside_ellipse(sima, scene, select, efa, tface, 2, offset, ellipse, 2); + select_uv_inside_ellipse(scene, select, efa, tface, 0, offset, ellipse, 0); + select_uv_inside_ellipse(scene, select, efa, tface, 1, offset, ellipse, 1); + select_uv_inside_ellipse(scene, select, efa, tface, 2, offset, ellipse, 2); if(efa->v4) - select_uv_inside_ellipse(sima, scene, select, efa, tface, 3, offset, ellipse, 3); + select_uv_inside_ellipse(scene, select, efa, tface, 3, offset, ellipse, 3); } if(select) EM_select_flush(em); @@ -2800,11 +2794,9 @@ static int hide_exec(bContext *C, wmOperator *op) tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); } else if(em->selectmode == SCE_SELECT_FACE) { - if((tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3))==0) { - if(!efa->v4) - EM_select_face(efa, 0); - else if(!(tf->flag & TF_SEL4)) - EM_select_face(efa, 0); + const char select_flag= efa->v4 ? (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4) : (TF_SEL1|TF_SEL2|TF_SEL3); + if((tf->flag & select_flag)==0) { + EM_select_face(efa, 0); tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); } } @@ -2845,9 +2837,8 @@ static int hide_exec(bContext *C, wmOperator *op) tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); } else if(em->selectmode == SCE_SELECT_FACE) { - if(tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) - EM_select_face(efa, 0); - else if(efa->v4 && tf->flag & TF_SEL4) + const char select_flag= efa->v4 ? (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4) : (TF_SEL1|TF_SEL2|TF_SEL3); + if(tf->flag & select_flag) EM_select_face(efa, 0); tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); @@ -3086,16 +3077,18 @@ static int set_tile_exec(bContext *C, wmOperator *op) { Image *ima= CTX_data_edit_image(C); int tile[2]; - - if(!ima || !(ima->tpageflag & IMA_TILES)) - return OPERATOR_CANCELLED; + Object *obedit= CTX_data_edit_object(C); RNA_int_get_array(op->ptr, "tile", tile); - ED_uvedit_set_tile(C, CTX_data_scene(C), CTX_data_edit_object(C), ima, tile[0] + ima->xrep*tile[1]); - WM_event_add_notifier(C, NC_SPACE|ND_SPACE_IMAGE, NULL); + if(uvedit_set_tile(obedit, ima, tile[0] + ima->xrep*tile[1])) { + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_IMAGE, NULL); - return OPERATOR_FINISHED; + return OPERATOR_FINISHED; + } + + return OPERATOR_CANCELLED; } static int set_tile_invoke(bContext *C, wmOperator *op, wmEvent *event) -- cgit v1.2.3 From 572faf9e7a589e1712fa0a95223d5c8a180a5a2c Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Fri, 15 Oct 2010 09:23:18 +0000 Subject: Partial fix for [#22867] retopo bug * More logical to restrict snapping to all visible objects instead of just selectable objects * Rest of bug added to todo-list --- source/blender/editors/transform/transform_snap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 09c04168a71..a5950a72fe8 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1587,7 +1587,7 @@ int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, float mv base= FIRSTBASE; for ( base = FIRSTBASE; base != NULL; base = base->next ) { - if ( BASE_SELECTABLE(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) -- cgit v1.2.3 From 9ecf7c15a5c705b2ab336a7ea7e39f4b25006e8b Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 15 Oct 2010 09:30:33 +0000 Subject: Fix for r32487: the logic was suboptimal, improved to always work correctly. --- source/blender/windowmanager/intern/wm_window.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 3600267dabc..f791cb1667a 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -68,7 +68,7 @@ GHOST_SystemHandle g_system= NULL; /* set by commandline */ static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, initialstate= GHOST_kWindowStateNormal; -static int prefsizeused = 0; +static unsigned short useprefsize= 0; /* ******** win open & close ************ */ @@ -373,13 +373,13 @@ void wm_window_add_ghostwindows(bContext* C, wmWindowManager *wm) for(win= wm->windows.first; win; win= win->next) { if(win->ghostwin==NULL) { - if(win->sizex==0 || prefsizeused==0) { + if(win->sizex==0 || useprefsize) { win->posx= prefstax; win->posy= prefstay; win->sizex= prefsizx; win->sizey= prefsizy; win->windowstate= initialstate; - prefsizeused= 1; + useprefsize= 0; } wm_window_add_ghostwindow(C, wm, "Blender", win); } @@ -1111,6 +1111,7 @@ void WM_setprefsize(int stax, int stay, int sizx, int sizy) prefstay= stay; prefsizx= sizx; prefsizy= sizy; + useprefsize= 1; } /* for borderless and border windows set from command-line */ -- cgit v1.2.3 From a431b40de28c0bf79686fd14ea13bc72af01cf94 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 15 Oct 2010 09:32:40 +0000 Subject: Add comment about when prefsizx et al are used. --- source/blender/windowmanager/intern/wm_window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index f791cb1667a..12fa9a8bd7b 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -353,7 +353,10 @@ void wm_window_add_ghostwindows(bContext* C, wmWindowManager *wm) wmKeyMap *keymap; wmWindow *win; - /* no commandline prefsize? then we set this */ + /* no commandline prefsize? then we set this. + * Note that these values will be used only + * when there is no startup.blend yet. + */ if (!prefsizx) { wm_get_screensize(&prefsizx, &prefsizy); -- cgit v1.2.3 From 44afd8ae5af40dfbff51503894e9c5754ce5657a Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Fri, 15 Oct 2010 10:25:43 +0000 Subject: Fix for [#23314] Comp node renaming breaks animation * Old name was already overwritten before the update function, so changed the update function to a "set" function. --- source/blender/makesrna/intern/rna_nodetree.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index ef56ad6a0c2..52a19c6376f 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -180,7 +180,7 @@ static void rna_NodeGroup_update(Main *bmain, Scene *scene, PointerRNA *ptr) node_update(bmain, scene, ntree, node); } -static void rna_Node_update_name(Main *bmain, Scene *scene, PointerRNA *ptr) +static void rna_Node_name_set(PointerRNA *ptr, const char *value) { bNodeTree *ntree= (bNodeTree*)ptr->id.data; bNode *node= (bNode*)ptr->data; @@ -188,14 +188,14 @@ static void rna_Node_update_name(Main *bmain, Scene *scene, PointerRNA *ptr) /* make a copy of the old name first */ BLI_strncpy(oldname, node->name, sizeof(node->name)); + /* set new name */ + BLI_strncpy(node->name, value, sizeof(node->name)); nodeUniqueName(ntree, node); node->flag |= NODE_CUSTOM_NAME; /* fix all the animation data which may link to this */ BKE_all_animdata_fix_paths_rename("nodes", oldname, node->name); - - node_update(bmain, scene, ntree, node); } /* this should be done at display time! if no custom names are set */ @@ -2263,7 +2263,8 @@ static void rna_def_node(BlenderRNA *brna) prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Node name"); RNA_def_struct_name_property(srna, prop); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update_name"); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Node_name_set"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "inputs", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "inputs", NULL); -- cgit v1.2.3 From db09ca106dfddd64e62ca7da4c85e720007aba4b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Oct 2010 12:29:02 +0000 Subject: remove/tag unused args for view*.c, gpu*.c & image*.c --- source/blender/blenkernel/BKE_image.h | 2 +- source/blender/blenkernel/intern/image.c | 7 +-- source/blender/editors/interface/view2d_ops.c | 60 +++++++++++----------- source/blender/editors/mesh/mesh_data.c | 3 +- source/blender/editors/space_image/image_buttons.c | 2 +- source/blender/editors/space_image/image_ops.c | 2 +- source/blender/editors/space_image/image_render.c | 2 +- source/blender/editors/space_node/node_edit.c | 2 +- source/blender/editors/space_view3d/space_view3d.c | 10 ++-- .../blender/editors/space_view3d/view3d_buttons.c | 28 +++++----- source/blender/editors/space_view3d/view3d_draw.c | 8 +-- source/blender/editors/space_view3d/view3d_edit.c | 14 ++--- .../blender/editors/space_view3d/view3d_intern.h | 2 +- .../blender/editors/space_view3d/view3d_select.c | 24 ++++----- source/blender/editors/space_view3d/view3d_snap.c | 13 ++--- .../blender/editors/space_view3d/view3d_toolbar.c | 4 +- source/blender/editors/space_view3d/view3d_view.c | 6 +-- source/blender/gpu/GPU_draw.h | 2 +- source/blender/gpu/intern/gpu_buffers.c | 14 ++--- source/blender/gpu/intern/gpu_codegen.c | 6 +-- source/blender/gpu/intern/gpu_draw.c | 4 +- source/blender/gpu/intern/gpu_extensions.c | 10 ++-- source/blender/makesrna/intern/rna_main_api.c | 2 +- source/blender/nodes/intern/TEX_util.c | 2 +- source/blender/render/intern/source/imagetexture.c | 28 +++++----- source/blender/render/intern/source/pipeline.c | 2 +- 26 files changed, 128 insertions(+), 131 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index 0a07e6d482c..b0cb3f32d37 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -112,7 +112,7 @@ struct ImBuf *BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void BKE_image_release_ibuf(struct Image *ima, void *lock); /* returns existing Image when filename/type is same (frame optional) */ -struct Image *BKE_add_image_file(const char *name, int frame); +struct Image *BKE_add_image_file(const char *name); /* adds image, adds ibuf, generates color or pattern */ struct Image *BKE_add_image_size(unsigned int width, unsigned int height, char *name, int depth, int floatbuf, short uvtestgrid, float color[4]); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index e356e40c6fd..fec713805e3 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -330,7 +330,7 @@ void BKE_image_merge(Image *dest, Image *source) /* otherwise creates new. */ /* does not load ibuf itself */ /* pass on optional frame for #name images */ -Image *BKE_add_image_file(const char *name, int frame) +Image *BKE_add_image_file(const char *name) { Image *ima; int file, len; @@ -397,7 +397,7 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, char *name, rect= (unsigned char*)ibuf->rect; } - strcpy(ibuf->name, "//Untitled"); + BLI_strncpy(ibuf->name, name, sizeof(ibuf->name)); ibuf->userflags |= IB_BITMAPDIRTY; switch(uvtestgrid) { @@ -1202,7 +1202,8 @@ void BKE_stamp_info(Scene *scene, struct ImBuf *ibuf) int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, char *name, int imtype, int subimtype, int quality) { int ok; - + (void)subimtype; /* quies unused warnings */ + if(imtype==0) { /* pass */ } diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index c155aff8d70..48523ec1a5a 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -119,7 +119,7 @@ static int view_pan_init(bContext *C, wmOperator *op) } /* apply transform to view (i.e. adjust 'cur' rect) */ -static void view_pan_apply(bContext *C, wmOperator *op) +static void view_pan_apply(wmOperator *op) { v2dViewPanData *vpd= op->customdata; View2D *v2d= vpd->v2d; @@ -156,7 +156,7 @@ static void view_pan_apply(bContext *C, wmOperator *op) } /* cleanup temp customdata */ -static void view_pan_exit(bContext *C, wmOperator *op) +static void view_pan_exit(wmOperator *op) { if (op->customdata) { MEM_freeN(op->customdata); @@ -172,8 +172,8 @@ static int view_pan_exec(bContext *C, wmOperator *op) if (!view_pan_init(C, op)) return OPERATOR_CANCELLED; - view_pan_apply(C, op); - view_pan_exit(C, op); + view_pan_apply(op); + view_pan_exit(op); return OPERATOR_FINISHED; } @@ -199,8 +199,8 @@ static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event) RNA_int_set(op->ptr, "deltax", event->prevx - event->x); RNA_int_set(op->ptr, "deltay", event->prevy - event->y); - view_pan_apply(C, op); - view_pan_exit(C, op); + view_pan_apply(op); + view_pan_exit(op); return OPERATOR_FINISHED; } @@ -236,7 +236,7 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) vpd->lastx= event->x; vpd->lasty= event->y; - view_pan_apply(C, op); + view_pan_apply(op); } break; @@ -247,7 +247,7 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) RNA_int_set(op->ptr, "deltax", (vpd->startx - vpd->lastx)); RNA_int_set(op->ptr, "deltay", (vpd->starty - vpd->lasty)); - view_pan_exit(C, op); + view_pan_exit(op); WM_cursor_restore(CTX_wm_window(C)); WM_operator_name_call(C, "VIEW2D_OT_zoom", WM_OP_INVOKE_DEFAULT, NULL); @@ -260,7 +260,7 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) RNA_int_set(op->ptr, "deltax", (vpd->startx - vpd->lastx)); RNA_int_set(op->ptr, "deltay", (vpd->starty - vpd->lasty)); - view_pan_exit(C, op); + view_pan_exit(op); WM_cursor_restore(CTX_wm_window(C)); return OPERATOR_FINISHED; @@ -271,9 +271,9 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int view_pan_cancel(bContext *C, wmOperator *op) +static int view_pan_cancel(bContext *UNUSED(C), wmOperator *op) { - view_pan_exit(C, op); + view_pan_exit(op); return OPERATOR_CANCELLED; } @@ -312,7 +312,7 @@ static int view_scrollright_exec(bContext *C, wmOperator *op) /* also, check if can pan in horizontal axis */ vpd= op->customdata; if (vpd->v2d->keepofs & V2D_LOCKOFS_X) { - view_pan_exit(C, op); + view_pan_exit(op); return OPERATOR_PASS_THROUGH; } @@ -321,8 +321,8 @@ static int view_scrollright_exec(bContext *C, wmOperator *op) RNA_int_set(op->ptr, "deltay", 0); /* apply movement, then we're done */ - view_pan_apply(C, op); - view_pan_exit(C, op); + view_pan_apply(op); + view_pan_exit(op); return OPERATOR_FINISHED; } @@ -356,7 +356,7 @@ static int view_scrollleft_exec(bContext *C, wmOperator *op) /* also, check if can pan in horizontal axis */ vpd= op->customdata; if (vpd->v2d->keepofs & V2D_LOCKOFS_X) { - view_pan_exit(C, op); + view_pan_exit(op); return OPERATOR_PASS_THROUGH; } @@ -365,8 +365,8 @@ static int view_scrollleft_exec(bContext *C, wmOperator *op) RNA_int_set(op->ptr, "deltay", 0); /* apply movement, then we're done */ - view_pan_apply(C, op); - view_pan_exit(C, op); + view_pan_apply(op); + view_pan_exit(op); return OPERATOR_FINISHED; } @@ -399,7 +399,7 @@ static int view_scrolldown_exec(bContext *C, wmOperator *op) /* also, check if can pan in vertical axis */ vpd= op->customdata; if (vpd->v2d->keepofs & V2D_LOCKOFS_Y) { - view_pan_exit(C, op); + view_pan_exit(op); return OPERATOR_PASS_THROUGH; } @@ -408,8 +408,8 @@ static int view_scrolldown_exec(bContext *C, wmOperator *op) RNA_int_set(op->ptr, "deltay", -40); /* apply movement, then we're done */ - view_pan_apply(C, op); - view_pan_exit(C, op); + view_pan_apply(op); + view_pan_exit(op); return OPERATOR_FINISHED; } @@ -443,7 +443,7 @@ static int view_scrollup_exec(bContext *C, wmOperator *op) /* also, check if can pan in vertical axis */ vpd= op->customdata; if (vpd->v2d->keepofs & V2D_LOCKOFS_Y) { - view_pan_exit(C, op); + view_pan_exit(op); return OPERATOR_PASS_THROUGH; } @@ -452,8 +452,8 @@ static int view_scrollup_exec(bContext *C, wmOperator *op) RNA_int_set(op->ptr, "deltay", 40); /* apply movement, then we're done */ - view_pan_apply(C, op); - view_pan_exit(C, op); + view_pan_apply(op); + view_pan_exit(op); return OPERATOR_FINISHED; } @@ -632,7 +632,7 @@ static void view_zoomstep_apply(bContext *C, wmOperator *op) /* --------------- Individual Operators ------------------- */ /* cleanup temp customdata */ -static void view_zoomstep_exit(bContext *C, wmOperator *op) +static void view_zoomstep_exit(wmOperator *op) { if (op->customdata) { MEM_freeN(op->customdata); @@ -654,7 +654,7 @@ static int view_zoomin_exec(bContext *C, wmOperator *op) /* apply movement, then we're done */ view_zoomstep_apply(C, op); - view_zoomstep_exit(C, op); + view_zoomstep_exit(op); return OPERATOR_FINISHED; } @@ -711,7 +711,7 @@ static int view_zoomout_exec(bContext *C, wmOperator *op) /* apply movement, then we're done */ view_zoomstep_apply(C, op); - view_zoomstep_exit(C, op); + view_zoomstep_exit(op); return OPERATOR_FINISHED; } @@ -823,7 +823,7 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op) } /* cleanup temp customdata */ -static void view_zoomdrag_exit(bContext *C, wmOperator *op) +static void view_zoomdrag_exit(wmOperator *op) { if (op->customdata) { MEM_freeN(op->customdata); @@ -838,7 +838,7 @@ static int view_zoomdrag_exec(bContext *C, wmOperator *op) return OPERATOR_PASS_THROUGH; view_zoomdrag_apply(C, op); - view_zoomdrag_exit(C, op); + view_zoomdrag_exit(op); return OPERATOR_FINISHED; } @@ -873,7 +873,7 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event) RNA_float_set(op->ptr, "deltay", dy); view_zoomdrag_apply(C, op); - view_zoomdrag_exit(C, op); + view_zoomdrag_exit(op); return OPERATOR_FINISHED; } @@ -985,7 +985,7 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event) RNA_float_set(op->ptr, "deltay", 0); /* free customdata */ - view_zoomdrag_exit(C, op); + view_zoomdrag_exit(op); WM_cursor_restore(CTX_wm_window(C)); return OPERATOR_FINISHED; diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index f45786d3abe..272201df50d 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -334,8 +334,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event) char path[FILE_MAX]; RNA_string_get(op->ptr, "filepath", path); - ima= BKE_add_image_file(path, - scene ? scene->r.cfra : 1); + ima= BKE_add_image_file(path); } else { RNA_string_get(op->ptr, "name", name); diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 353d741fe27..bbc8925a152 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -494,7 +494,7 @@ static char *slot_menu() } /* TODO, curlay should be removed? */ -static char *layer_menu(RenderResult *rr, short *curlay) +static char *layer_menu(RenderResult *rr, short *UNUSED(curlay)) { RenderLayer *rl; int len= 64 + 32*BLI_countlist(&rr->layers); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 3e33fef6904..a44258351ce 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -701,7 +701,7 @@ static int open_exec(bContext *C, wmOperator *op) errno= 0; - ima= BKE_add_image_file(str, scene ? scene->r.cfra : 1); + ima= BKE_add_image_file(str); if(!ima) { if(op->customdata) MEM_freeN(op->customdata); diff --git a/source/blender/editors/space_image/image_render.c b/source/blender/editors/space_image/image_render.c index be9d60a5adb..5fa0a2de202 100644 --- a/source/blender/editors/space_image/image_render.c +++ b/source/blender/editors/space_image/image_render.c @@ -149,7 +149,7 @@ void imagewindow_toggle_render(bContext *C) } /* NOTE: called while render, so no malloc allowed! */ -static void imagewindow_renderinfo_cb(void *handle, RenderStats *rs) +static void imagewindow_renderinfo_cb(void *UNUSED(handle), RenderStats *UNUSED(rs)) { if(image_area) { // XXX BIF_make_render_text(rs); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 71f48f0de5d..b8bfed2b75e 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -2264,7 +2264,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op) errno= 0; - ima= BKE_add_image_file(path, scene ? scene->r.cfra : 1); + ima= BKE_add_image_file(path); if(!ima) { BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", path, errno ? strerror(errno) : "Unsupported image format"); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 629e0efe2ce..6261ca52564 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -274,7 +274,7 @@ static void view3d_free(SpaceLink *sl) /* spacetype; init callback */ -static void view3d_init(struct wmWindowManager *wm, ScrArea *sa) +static void view3d_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { } @@ -387,7 +387,7 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar) } -static int view3d_ob_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) { if(drag->type==WM_DRAG_ID) { ID *id= (ID *)drag->poin; @@ -397,7 +397,7 @@ static int view3d_ob_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) return 0; } -static int view3d_mat_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) { if(drag->type==WM_DRAG_ID) { ID *id= (ID *)drag->poin; @@ -407,7 +407,7 @@ static int view3d_mat_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) return 0; } -static int view3d_ima_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) { if(drag->type==WM_DRAG_ID) { ID *id= (ID *)drag->poin; @@ -726,7 +726,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) } /* concept is to retrieve cursor type context-less */ -static void view3d_main_area_cursor(wmWindow *win, ScrArea *sa, ARegion *ar) +static void view3d_main_area_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *UNUSED(ar)) { Scene *scene= win->screen->scene; diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 1bff01a02e4..141a8800365 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -128,7 +128,7 @@ typedef struct { /* is used for both read and write... */ -static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d, Object *ob, float lim) +static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim) { uiBlock *block= (layout)? uiLayoutAbsoluteBlock(layout): NULL; MDeformVert *dvert=NULL; @@ -643,7 +643,7 @@ static void vgroup_normalize_active(Object *ob) } -static void do_view3d_vgroup_buttons(bContext *C, void *arg, int event) +static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event) { Scene *scene= CTX_data_scene(C); Object *ob= OBACT; @@ -670,7 +670,7 @@ static void do_view3d_vgroup_buttons(bContext *C, void *arg, int event) WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data); } -int view3d_panel_vgroup_poll(const bContext *C, PanelType *pt) +int view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt)) { Scene *scene= CTX_data_scene(C); Object *ob= OBACT; @@ -794,7 +794,7 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) } } -static void v3d_posearmature_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim) +static void v3d_posearmature_buts(uiLayout *layout, Object *ob) { // uiBlock *block= uiLayoutGetBlock(layout); // bArmature *arm; @@ -896,7 +896,7 @@ void validate_editbonebutton_cb(bContext *C, void *bonev, void *namev) WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, CTX_data_edit_object(C)); // XXX fix } -static void v3d_editarmature_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim) +static void v3d_editarmature_buts(uiLayout *layout, Object *ob) { // uiBlock *block= uiLayoutGetBlock(layout); bArmature *arm= ob->data; @@ -930,7 +930,7 @@ static void v3d_editarmature_buts(uiLayout *layout, View3D *v3d, Object *ob, flo uiItemR(col, &eboneptr, "roll", 0, "Roll", 0); } -static void v3d_editmetaball_buts(uiLayout *layout, Object *ob, float lim) +static void v3d_editmetaball_buts(uiLayout *layout, Object *ob) { PointerRNA mbptr, ptr; MetaBall *mball= ob->data; @@ -989,7 +989,7 @@ static int test_parent_loop(Object *par, Object *ob) return test_parent_loop(par->parent, ob); } -static void do_view3d_region_buttons(bContext *C, void *arg, int event) +static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -1012,7 +1012,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) case B_OBJECTPANELMEDIAN: if(ob) { - v3d_editvertex_buts(C, NULL, v3d, ob, 1.0); + v3d_editvertex_buts(NULL, v3d, ob, 1.0); DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } break; @@ -1152,12 +1152,12 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, ob); } -void removeTransformOrientation_func(bContext *C, void *target, void *unused) +void removeTransformOrientation_func(bContext *C, void *target, void *UNUSED(arg)) { BIF_removeTransformOrientation(C, (TransformOrientation *) target); } -void selectTransformOrientation_func(bContext *C, void *target, void *unused) +void selectTransformOrientation_func(bContext *C, void *target, void *UNUSED(arg)) { BIF_selectTransformOrientation(C, (TransformOrientation *) target); } @@ -1203,12 +1203,12 @@ static void view3d_panel_object(const bContext *C, Panel *pa) RNA_id_pointer_create(&ob->id, &obptr); if(ob==obedit) { - if(ob->type==OB_ARMATURE) v3d_editarmature_buts(col, v3d, ob, lim); - if(ob->type==OB_MBALL) v3d_editmetaball_buts(col, ob, lim); - else v3d_editvertex_buts(C, col, v3d, ob, lim); + if(ob->type==OB_ARMATURE) v3d_editarmature_buts(col, ob); + if(ob->type==OB_MBALL) v3d_editmetaball_buts(col, ob); + else v3d_editvertex_buts(col, v3d, ob, lim); } else if(ob->mode & OB_MODE_POSE) { - v3d_posearmature_buts(col, v3d, ob, lim); + v3d_posearmature_buts(col, ob); } else { diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 24f71b8b1df..6e634252631 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1589,7 +1589,7 @@ static void draw_dupli_objects(Scene *scene, ARegion *ar, View3D *v3d, Base *bas } -void view3d_update_depths(ARegion *ar, View3D *v3d) +void view3d_update_depths(ARegion *ar) { RegionView3D *rv3d= ar->regiondata; @@ -2354,7 +2354,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) // retopo= retopo_mesh_check() || retopo_curve_check(); sculptparticle= (obact && obact->mode & (OB_MODE_PARTICLE_EDIT)) && !scene->obedit; if(retopo) - view3d_update_depths(ar, v3d); + view3d_update_depths(ar); /* draw selected and editmode */ for(base= scene->base.first; base; base= base->next) { @@ -2365,7 +2365,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) } if(!retopo && sculptparticle && !(obact && (obact->dtx & OB_DRAWXRAY))) { - view3d_update_depths(ar, v3d); + view3d_update_depths(ar); } // REEB_draw(); @@ -2378,7 +2378,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW); if(!retopo && sculptparticle && (obact && (OBACT->dtx & OB_DRAWXRAY))) { - view3d_update_depths(ar, v3d); + view3d_update_depths(ar); } if(rv3d->rflag & RV3D_CLIPPING) diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index e60dde7c88b..41899a70b34 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1548,7 +1548,7 @@ void VIEW3D_OT_view_center_cursor(wmOperatorType *ot) ot->flag= 0; } -static int view3d_center_camera_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.4x */ +static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was view3d_home() in 2.4x */ { RegionView3D *rv3d= CTX_wm_region_view3d(C); @@ -1691,7 +1691,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) rv3d->depths->damaged = 1; } - view3d_update_depths(ar, v3d); + view3d_update_depths(ar); /* Constrain rect to depth bounds */ if (rect.xmin < 0) rect.xmin = 0; @@ -2220,7 +2220,7 @@ static int add_background_image_invoke(bContext *C, wmOperator *op, wmEvent *UNU char path[FILE_MAX]; RNA_string_get(op->ptr, "filepath", path); - ima= BKE_add_image_file(path, scene ? scene->r.cfra : 1); + ima= BKE_add_image_file(path); } else if(RNA_property_is_set(op->ptr, "name")) { RNA_string_get(op->ptr, "name", name); @@ -2644,7 +2644,7 @@ int view_autodist(Scene *scene, ARegion *ar, View3D *v3d, short *mval, float mou rv3d->depths->damaged = 1; } - view3d_update_depths(ar, v3d); + view3d_update_depths(ar); depth_close= view_autodist_depth_margin(ar, mval, 4); @@ -2688,7 +2688,7 @@ int view_autodist_init(Scene *scene, ARegion *ar, View3D *v3d, int mode) //, flo rv3d->depths->damaged = 1; } - view3d_update_depths(ar, v3d); + view3d_update_depths(ar); return 1; } @@ -2785,7 +2785,7 @@ void filterNDOFvalues(float *sbval) int dz_flag = 0; float m_dist; -void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode) +void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int UNUSED(mode)) { RegionView3D *rv3d= ar->regiondata; int i; @@ -2914,7 +2914,7 @@ void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode) // XXX BIF_view3d_previewrender_signal(ar, PR_DBASE|PR_DISPRECT); } -void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode) +void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int UNUSED(mode)) { RegionView3D *rv3d= ar->regiondata; float fval[7]; diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 49ef803b1af..9d1f5a77a3f 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -130,7 +130,7 @@ void add_view3d_after(ListBase *lb, Base *base, int flag); void circf(float x, float y, float rad); void circ(float x, float y, float rad); -void view3d_update_depths(struct ARegion *ar, View3D *v3d); +void view3d_update_depths(struct ARegion *ar); /* view3d_select.c */ void VIEW3D_OT_select(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 7e6e8e0e6af..e3212e8a3d1 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -189,9 +189,9 @@ void EM_backbuf_checkAndSelectTFaces(Mesh *me, int select) } } +#if 0 void arrows_move_cursor(unsigned short event) { -#if 0 short mval[2]; getmouseco_sc(mval); @@ -205,8 +205,8 @@ void arrows_move_cursor(unsigned short event) } else if(event==RIGHTARROWKEY) { warp_pointer(mval[0]+1, mval[1]); } -#endif } +#endif /* *********************** GESTURE AND LASSO ******************* */ @@ -404,7 +404,7 @@ void lasso_select_boundbox(rcti *rect, short mcords[][2], short moves) } } -static void do_lasso_select_mesh__doSelectVert(void *userData, EditVert *eve, int x, int y, int index) +static void do_lasso_select_mesh__doSelectVert(void *userData, EditVert *eve, int x, int y, int UNUSED(index)) { struct { ViewContext vc; rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData; @@ -431,7 +431,7 @@ static void do_lasso_select_mesh__doSelectEdge(void *userData, EditEdge *eed, in } } } -static void do_lasso_select_mesh__doSelectFace(void *userData, EditFace *efa, int x, int y, int index) +static void do_lasso_select_mesh__doSelectFace(void *userData, EditFace *efa, int x, int y, int UNUSED(index)) { struct { ViewContext vc; rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData; @@ -560,7 +560,7 @@ static void do_lasso_select_mesh_uv(short mcords[][2], short moves, short select } #endif -static void do_lasso_select_curve__doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) +static void do_lasso_select_curve__doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) { struct { ViewContext *vc; short (*mcords)[2]; short moves; short select; } *data = userData; Object *obedit= data->vc->obedit; @@ -1291,7 +1291,7 @@ int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, return 0; } -static void do_nurbs_box_select__doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) +static void do_nurbs_box_select__doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) { struct { ViewContext *vc; rcti *rect; int select; } *data = userData; Object *obedit= data->vc->obedit; @@ -1359,7 +1359,7 @@ static void do_lattice_box_select(ViewContext *vc, rcti *rect, int select, int e lattice_foreachScreenVert(vc, do_lattice_box_select__doSelect, &data); } -static void do_mesh_box_select__doSelectVert(void *userData, EditVert *eve, int x, int y, int index) +static void do_mesh_box_select__doSelectVert(void *userData, EditVert *eve, int x, int y, int UNUSED(index)) { struct { ViewContext vc; rcti *rect; short select, pass, done; } *data = userData; @@ -1384,7 +1384,7 @@ static void do_mesh_box_select__doSelectEdge(void *userData, EditEdge *eed, int } } } -static void do_mesh_box_select__doSelectFace(void *userData, EditFace *efa, int x, int y, int index) +static void do_mesh_box_select__doSelectFace(void *userData, EditFace *efa, int x, int y, int UNUSED(index)) { struct { ViewContext vc; rcti *rect; short select, pass, done; } *data = userData; @@ -1800,7 +1800,7 @@ void VIEW3D_OT_select(wmOperatorType *ot) /* -------------------- circle select --------------------------------------------- */ -static void mesh_circle_doSelectVert(void *userData, EditVert *eve, int x, int y, int index) +static void mesh_circle_doSelectVert(void *userData, EditVert *eve, int x, int y, int UNUSED(index)) { struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData; int mx = x - data->mval[0], my = y - data->mval[1]; @@ -1810,7 +1810,7 @@ static void mesh_circle_doSelectVert(void *userData, EditVert *eve, int x, int y eve->f = data->select?(eve->f|1):(eve->f&~1); } } -static void mesh_circle_doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index) +static void mesh_circle_doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int UNUSED(index)) { struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData; @@ -1818,7 +1818,7 @@ static void mesh_circle_doSelectEdge(void *userData, EditEdge *eed, int x0, int EM_select_edge(eed, data->select); } } -static void mesh_circle_doSelectFace(void *userData, EditFace *efa, int x, int y, int index) +static void mesh_circle_doSelectFace(void *userData, EditFace *efa, int x, int y, int UNUSED(index)) { struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData; int mx = x - data->mval[0], my = y - data->mval[1]; @@ -1892,7 +1892,7 @@ static void paint_facesel_circle_select(ViewContext *vc, int selecting, short *m } -static void nurbscurve_circle_doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) +static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) { struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData; int mx = x - data->mval[0], my = y - data->mval[1]; diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 4ef1d4daf92..d6778070931 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -82,7 +82,7 @@ static TransVert *transvmain=NULL; static int tottrans= 0; /* copied from editobject.c, now uses (almost) proper depgraph */ -static void special_transvert_update(Scene *scene, Object *obedit) +static void special_transvert_update(Object *obedit) { if(obedit) { @@ -481,7 +481,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op)) VECCOPY(tv->loc, vec); } - special_transvert_update(scene, obedit); + special_transvert_update(obedit); MEM_freeN(transvmain); transvmain= NULL; @@ -602,15 +602,12 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op)) tv= transvmain; for(a=0; aobmat[3][0]; - vec[1]= curs[1]-obedit->obmat[3][1]; - vec[2]= curs[2]-obedit->obmat[3][2]; - + sub_v3_v3v3(vec, curs, obedit->obmat[3]); mul_m3_v3(imat, vec); - VECCOPY(tv->loc, vec); + copy_v3_v3(tv->loc, vec); } - special_transvert_update(scene, obedit); + special_transvert_update(obedit); MEM_freeN(transvmain); transvmain= NULL; diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 10496bc078d..0691895948a 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -65,7 +65,7 @@ /* op->invoke */ -static void redo_cb(bContext *C, void *arg_op, void *arg2) +static void redo_cb(bContext *C, void *arg_op, void *UNUSED(arg2)) { wmOperator *lastop= arg_op; @@ -177,7 +177,7 @@ static void operator_call_cb(struct bContext *C, void *arg_listbase, void *arg2) } -static void operator_search_cb(const struct bContext *C, void *arg, char *str, uiSearchItems *items) +static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), char *str, uiSearchItems *items) { wmOperatorType *ot = WM_operatortype_first(); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 4bc921b6030..312ae1df590 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -380,7 +380,7 @@ void VIEW3D_OT_smoothview(wmOperatorType *ot) /* ****************** change view operators ****************** */ -static void setcameratoview3d(View3D *v3d, RegionView3D *rv3d, Object *ob) +static void setcameratoview3d(RegionView3D *rv3d, Object *ob) { float dvec[3]; float mat3[3][3]; @@ -408,7 +408,7 @@ static int view3d_setcameratoview_exec(bContext *C, wmOperator *UNUSED(op)) rv3d->lview= rv3d->view; rv3d->lpersp= rv3d->persp; - setcameratoview3d(v3d, rv3d, v3d->camera); + setcameratoview3d(rv3d, v3d->camera); rv3d->persp = RV3D_CAMOB; WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, v3d->camera); @@ -1986,7 +1986,7 @@ typedef struct FlyInfo { } FlyInfo; -static void drawFlyPixel(const struct bContext *C, struct ARegion *ar, void *arg) +static void drawFlyPixel(const struct bContext *UNUSED(C), struct ARegion *UNUSED(ar), void *arg) { FlyInfo *fly = arg; diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index 92bf43e9a5a..1f1bbab9abf 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -114,7 +114,7 @@ void GPU_paint_set_mipmap(int mipmap); void GPU_paint_update_image(struct Image *ima, int x, int y, int w, int h, int mipmap); void GPU_update_images_framechange(void); int GPU_update_image_time(struct Image *ima, double time); -int GPU_verify_image(struct Image *ima, struct ImageUser *iuser, int tftile, int tfmode, int compare, int mipmap); +int GPU_verify_image(struct Image *ima, struct ImageUser *iuser, int tftile, int compare, int mipmap); void GPU_free_image(struct Image *ima); void GPU_free_images(void); void GPU_free_images_anim(void); diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 5bddb42add2..90c33f68c65 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -592,8 +592,8 @@ void GPU_update_grid_buffers(void *buffers_v, DMGridData **grids, //printf("node updated %p\n", buffers_v); } -void *GPU_build_grid_buffers(DMGridData **grids, - int *grid_indices, int totgrid, int gridsize) +void *GPU_build_grid_buffers(DMGridData **UNUSED(grids), int *UNUSED(grid_indices), + int totgrid, int gridsize) { GPU_Buffers *buffers; int i, j, k, totquad, offset= 0; @@ -852,7 +852,7 @@ GPUBuffer *GPU_buffer_setup( DerivedMesh *dm, GPUDrawObject *object, int size, G return buffer; } -void GPU_buffer_copy_vertex( DerivedMesh *dm, float *varray, int *index, int *redir, void *user ) +void GPU_buffer_copy_vertex(DerivedMesh *dm, float *varray, int *index, int *redir, void *UNUSED(user)) { int start; int i, j, numfaces; @@ -901,7 +901,7 @@ GPUBuffer *GPU_buffer_vertex( DerivedMesh *dm ) return GPU_buffer_setup( dm, dm->drawObject, sizeof(float)*3*(dm->drawObject->nelements+dm->drawObject->nlooseverts), GL_ARRAY_BUFFER_ARB, 0, GPU_buffer_copy_vertex); } -void GPU_buffer_copy_normal( DerivedMesh *dm, float *varray, int *index, int *redir, void *user ) +void GPU_buffer_copy_normal(DerivedMesh *dm, float *varray, int *index, int *redir, void *UNUSED(user)) { int i, numfaces; int start; @@ -965,7 +965,7 @@ GPUBuffer *GPU_buffer_normal( DerivedMesh *dm ) return GPU_buffer_setup( dm, dm->drawObject, sizeof(float)*3*dm->drawObject->nelements, GL_ARRAY_BUFFER_ARB, 0, GPU_buffer_copy_normal); } -void GPU_buffer_copy_uv( DerivedMesh *dm, float *varray, int *index, int *redir, void *user ) +void GPU_buffer_copy_uv(DerivedMesh *dm, float *varray, int *index, int *redir, void *UNUSED(user)) { int start; int i, numfaces; @@ -1107,7 +1107,7 @@ GPUBuffer *GPU_buffer_color( DerivedMesh *dm ) return result; } -void GPU_buffer_copy_edge( DerivedMesh *dm, float *varray, int *index, int *redir, void *user ) +void GPU_buffer_copy_edge(DerivedMesh *dm, float *varray, int *UNUSED(index), int *UNUSED(redir), void *UNUSED(user)) { int i; @@ -1135,7 +1135,7 @@ GPUBuffer *GPU_buffer_edge( DerivedMesh *dm ) return GPU_buffer_setup( dm, dm->drawObject, sizeof(int)*2*dm->drawObject->nedges, GL_ELEMENT_ARRAY_BUFFER_ARB, 0, GPU_buffer_copy_edge); } -void GPU_buffer_copy_uvedge( DerivedMesh *dm, float *varray, int *index, int *redir, void *user ) +void GPU_buffer_copy_uvedge(DerivedMesh *dm, float *varray, int *UNUSED(index), int *UNUSED(redir), void *UNUSED(user)) { MTFace *tf = DM_get_face_data_layer(dm, CD_MTFACE); int i, j=0; diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index d596f573682..34cf62462a7 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -686,7 +686,7 @@ static void codegen_call_functions(DynStr *ds, ListBase *nodes, GPUOutput *final BLI_dynstr_append(ds, ";\n"); } -static char *code_generate_fragment(ListBase *nodes, GPUOutput *output, const char *name) +static char *code_generate_fragment(ListBase *nodes, GPUOutput *output, const char *UNUSED(name)) { DynStr *ds = BLI_dynstr_new(); char *code; @@ -916,7 +916,7 @@ GPUNode *GPU_node_begin(char *name) return node; } -void GPU_node_end(GPUNode *node) +void GPU_node_end(GPUNode *UNUSED(node)) { /* empty */ } @@ -1036,7 +1036,7 @@ static void gpu_node_input_socket(GPUNode *node, GPUNodeStack *sock) } } -void GPU_node_output(GPUNode *node, int type, char *name, GPUNodeLink **link) +void GPU_node_output(GPUNode *node, int type, char *UNUSED(name), GPUNodeLink **link) { GPUOutput *output = MEM_callocN(sizeof(GPUOutput), "GPUOutput"); diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 55522ea18b9..a93d8cbbb8e 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -394,7 +394,7 @@ static void gpu_verify_reflection(Image *ima) } } -int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int tfmode, int compare, int mipmap) +int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int mipmap) { ImBuf *ibuf = NULL; unsigned int *bind = NULL; @@ -593,7 +593,7 @@ int GPU_set_tpage(MTFace *tface, int mipmap) gpu_verify_alpha_mode(tface); gpu_verify_reflection(ima); - if(GPU_verify_image(ima, NULL, tface->tile, tface->mode, 1, mipmap)) { + if(GPU_verify_image(ima, NULL, tface->tile, 1, mipmap)) { GTS.curtile= GTS.tile; GTS.curima= GTS.ima; GTS.curtilemode= GTS.tilemode; diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index fa8ff7a6354..c6b8a43918c 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -484,7 +484,7 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, double time, glGetIntegerv(GL_TEXTURE_BINDING_2D, &lastbindcode); GPU_update_image_time(ima, time); - bindcode = GPU_verify_image(ima, iuser, 0, 0, 0, mipmap); + bindcode = GPU_verify_image(ima, iuser, 0, 0, mipmap); if(ima->gputexture) { ima->gputexture->bindcode = bindcode; @@ -744,7 +744,7 @@ void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex) tex->fb = NULL; } -void GPU_framebuffer_texture_bind(GPUFrameBuffer *fb, GPUTexture *tex) +void GPU_framebuffer_texture_bind(GPUFrameBuffer *UNUSED(fb), GPUTexture *tex) { /* push attributes */ glPushAttrib(GL_ENABLE_BIT); @@ -766,7 +766,7 @@ void GPU_framebuffer_texture_bind(GPUFrameBuffer *fb, GPUTexture *tex) glLoadIdentity(); } -void GPU_framebuffer_texture_unbind(GPUFrameBuffer *fb, GPUTexture *tex) +void GPU_framebuffer_texture_unbind(GPUFrameBuffer *UNUSED(fb), GPUTexture *UNUSED(tex)) { /* restore matrix */ glMatrixMode(GL_PROJECTION); @@ -1063,7 +1063,7 @@ int GPU_shader_get_uniform(GPUShader *shader, char *name) return glGetUniformLocationARB(shader->object, name); } -void GPU_shader_uniform_vector(GPUShader *shader, int location, int length, int arraysize, float *value) +void GPU_shader_uniform_vector(GPUShader *UNUSED(shader), int location, int length, int arraysize, float *value) { if(location == -1) return; @@ -1080,7 +1080,7 @@ void GPU_shader_uniform_vector(GPUShader *shader, int location, int length, int GPU_print_error("Post Uniform Vector"); } -void GPU_shader_uniform_texture(GPUShader *shader, int location, GPUTexture *tex) +void GPU_shader_uniform_texture(GPUShader *UNUSED(shader), int location, GPUTexture *tex) { GLenum arbnumber; diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index b244d8ee5d3..63268f69438 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -261,7 +261,7 @@ Image *rna_Main_images_load(Main *bmain, ReportList *reports, char *filepath) Image *ima; errno= 0; - ima= BKE_add_image_file(filepath, 0); + ima= BKE_add_image_file(filepath); if(!ima) BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unsupported image format"); diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c index dc31685827f..4f085c84eda 100644 --- a/source/blender/nodes/intern/TEX_util.c +++ b/source/blender/nodes/intern/TEX_util.c @@ -173,7 +173,7 @@ int ntreeTexExecTree( float *dxt, float *dyt, int osatex, short thread, - Tex *tex, + Tex *UNUSED(tex), short which_output, int cfra, int preview, diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 5321d71194f..9376c798c39 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -500,7 +500,7 @@ static void boxsampleclip(struct ImBuf *ibuf, rctf *rf, TexResult *texres) } } -static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, int imaprepeat, int imapextend, int intpol) +static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, int imaprepeat, int imapextend) { /* Sample box, performs clip. minx etc are in range 0.0 - 1.0 . * Enlarge with antialiased edges of pixels. @@ -1606,11 +1606,11 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f //minx*= 1.35f; //miny*= 1.35f; - boxsample(curibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 0); + boxsample(curibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend); val1= texres->tr+texres->tg+texres->tb; - boxsample(curibuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend, 0); + boxsample(curibuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend); val2= texr.tr + texr.tg + texr.tb; - boxsample(curibuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend, 0); + boxsample(curibuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend); val3= texr.tr + texr.tg + texr.tb; /* don't switch x or y! */ @@ -1619,7 +1619,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f if(previbuf!=curibuf) { /* interpolate */ - boxsample(previbuf, fx-minx, fy-miny, fx+minx, fy+miny, &texr, imaprepeat, imapextend, 0); + boxsample(previbuf, fx-minx, fy-miny, fx+minx, fy+miny, &texr, imaprepeat, imapextend); /* calc rgb */ dx= 2.0f*(pixsize-maxd)/pixsize; @@ -1636,9 +1636,9 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f } val1= dy*val1+ dx*(texr.tr + texr.tg + texr.tb); - boxsample(previbuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend, 0); + boxsample(previbuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend); val2= dy*val2+ dx*(texr.tr + texr.tg + texr.tb); - boxsample(previbuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend, 0); + boxsample(previbuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend); val3= dy*val3+ dx*(texr.tr + texr.tg + texr.tb); texres->nor[0]= (val1-val2); /* vals have been interpolated above! */ @@ -1661,10 +1661,10 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f maxy= fy+miny; miny= fy-miny; - boxsample(curibuf, minx, miny, maxx, maxy, texres, imaprepeat, imapextend, 0); + boxsample(curibuf, minx, miny, maxx, maxy, texres, imaprepeat, imapextend); if(previbuf!=curibuf) { /* interpolate */ - boxsample(previbuf, minx, miny, maxx, maxy, &texr, imaprepeat, imapextend, 0); + boxsample(previbuf, minx, miny, maxx, maxy, &texr, imaprepeat, imapextend); fx= 2.0f*(pixsize-maxd)/pixsize; @@ -1690,11 +1690,11 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f } if(texres->nor && (tex->imaflag & TEX_NORMALMAP)==0) { - boxsample(ibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 0); + boxsample(ibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend); val1= texres->tr+texres->tg+texres->tb; - boxsample(ibuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend, 0); + boxsample(ibuf, fx-minx+dxt[0], fy-miny+dxt[1], fx+minx+dxt[0], fy+miny+dxt[1], &texr, imaprepeat, imapextend); val2= texr.tr + texr.tg + texr.tb; - boxsample(ibuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend, 0); + boxsample(ibuf, fx-minx+dyt[0], fy-miny+dyt[1], fx+minx+dyt[0], fy+miny+dyt[1], &texr, imaprepeat, imapextend); val3= texr.tr + texr.tg + texr.tb; /* don't switch x or y! */ @@ -1702,7 +1702,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f texres->nor[1]= (val1-val3); } else - boxsample(ibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 0); + boxsample(ibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend); } if(tex->imaflag & TEX_CALCALPHA) { @@ -1749,7 +1749,7 @@ void image_sample(Image *ima, float fx, float fy, float dx, float dy, float *res if( (R.flag & R_SEC_FIELD) && (ibuf->flags & IB_fields) ) ibuf->rect+= (ibuf->x*ibuf->y); - boxsample(ibuf, fx, fy, fx+dx, fy+dy, &texres, 0, 1, 0); + boxsample(ibuf, fx, fy, fx+dx, fy+dy, &texres, 0, 1); result[0]= texres.tr; result[1]= texres.tg; result[2]= texres.tb; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 44c6a6f008f..9179019f824 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2041,7 +2041,7 @@ static void load_backbuffer(Render *re) BKE_image_signal(re->backbuf, NULL, IMA_SIGNAL_RELOAD); } - re->backbuf= BKE_add_image_file(name, re->r.cfra); + re->backbuf= BKE_add_image_file(name); ibuf= BKE_image_get_ibuf(re->backbuf, NULL); if(ibuf==NULL) { // error() doesnt work with render window open -- cgit v1.2.3 From f5f935e58885096b7cb56f95d0525ccb9d1c4021 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 15 Oct 2010 13:03:10 +0000 Subject: Less cryptic modifier key types --- source/blender/windowmanager/intern/wm_window.c | 47 ++++++++++++++++--------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'source/blender') diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 12fa9a8bd7b..c31f72d8af1 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -521,22 +521,37 @@ int wm_window_fullscreen_toggle_op(bContext *C, wmOperator *op) /* ************ events *************** */ -static int query_qual(char qual) +typedef enum +{ + SHIFT = 's', + CONTROL = 'c', + ALT = 'a', + OS = 'C' +} modifierKeyType; + +/* check if specified modifier key type is pressed */ +static int query_qual(modifierKeyType qual) { GHOST_TModifierKeyMask left, right; int val= 0; - if (qual=='s') { - left= GHOST_kModifierKeyLeftShift; - right= GHOST_kModifierKeyRightShift; - } else if (qual=='c') { - left= GHOST_kModifierKeyLeftControl; - right= GHOST_kModifierKeyRightControl; - } else if (qual=='C') { - left= right= GHOST_kModifierKeyOS; - } else { - left= GHOST_kModifierKeyLeftAlt; - right= GHOST_kModifierKeyRightAlt; + switch(qual) { + case SHIFT: + left= GHOST_kModifierKeyLeftShift; + right= GHOST_kModifierKeyRightShift; + break; + case CONTROL: + left= GHOST_kModifierKeyLeftControl; + right= GHOST_kModifierKeyRightControl; + break; + case OS: + left= right= GHOST_kModifierKeyOS; + break; + case ALT: + default: + left= GHOST_kModifierKeyLeftAlt; + right= GHOST_kModifierKeyRightAlt; + break; } GHOST_GetModifierKeyState(g_system, left, &val); @@ -605,19 +620,19 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private) /* bad ghost support for modifier keys... so on activate we set the modifiers again */ kdata.ascii= 0; - if (win->eventstate->shift && !query_qual('s')) { + if (win->eventstate->shift && !query_qual(SHIFT)) { kdata.key= GHOST_kKeyLeftShift; wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata); } - if (win->eventstate->ctrl && !query_qual('c')) { + if (win->eventstate->ctrl && !query_qual(CONTROL)) { kdata.key= GHOST_kKeyLeftControl; wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata); } - if (win->eventstate->alt && !query_qual('a')) { + if (win->eventstate->alt && !query_qual(ALT)) { kdata.key= GHOST_kKeyLeftAlt; wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata); } - if (win->eventstate->oskey && !query_qual('C')) { + if (win->eventstate->oskey && !query_qual(OS)) { kdata.key= GHOST_kKeyOS; wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata); } -- cgit v1.2.3 From 17085e967ea38dd764a1b521b28f256941b1ce17 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 15 Oct 2010 14:56:31 +0000 Subject: Fix COLLADA import after recent API cleanups by Campbell. --- source/blender/collada/DocumentImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 25787e18b06..bc5653c8c45 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -807,7 +807,7 @@ public: BLI_split_dirfile(filename, dir, NULL); BLI_join_dirfile(full_path, dir, filepath.c_str()); - Image *ima = BKE_add_image_file(full_path, 0); + Image *ima = BKE_add_image_file(full_path); if (!ima) { fprintf(stderr, "Cannot create image. \n"); return true; -- cgit v1.2.3 From 1807beabf5372f297329b6be2ab3ba89f954d33a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Oct 2010 02:40:31 +0000 Subject: - UNUSED macro wasn't throwing an error with GCC if a var become used. - made interface, windowmanager, readfile build without unused warnings. - re-arranged CMake's source/blender build order so less changed libs are build later, eg: IK, avi --- source/blender/CMakeLists.txt | 18 +++--- source/blender/blenkernel/BKE_blender.h | 4 +- source/blender/blenkernel/BKE_utildefines.h | 4 +- source/blender/blenkernel/intern/blender.c | 8 +-- source/blender/blenlib/intern/pbvh.c | 2 +- source/blender/blenloader/BLO_writefile.h | 3 +- source/blender/blenloader/intern/readblenentry.c | 2 +- source/blender/blenloader/intern/readfile.c | 32 +++++----- source/blender/blenloader/intern/readfile.h | 2 +- source/blender/blenloader/intern/writefile.c | 2 +- source/blender/editors/animation/anim_filter.c | 4 +- source/blender/editors/armature/poseSlide.c | 38 +++++------ source/blender/editors/include/UI_interface.h | 12 ++-- source/blender/editors/interface/interface.c | 16 ++--- source/blender/editors/interface/interface_draw.c | 10 +-- source/blender/editors/interface/interface_icons.c | 18 +++--- .../blender/editors/interface/interface_intern.h | 2 +- .../blender/editors/interface/interface_layout.c | 4 +- source/blender/editors/interface/interface_panel.c | 10 +-- .../blender/editors/interface/interface_regions.c | 38 +++++------ .../editors/interface/interface_templates.c | 30 ++++----- source/blender/editors/interface/interface_utils.c | 2 +- .../blender/editors/interface/interface_widgets.c | 38 +++++------ source/blender/editors/mesh/meshtools.c | 4 +- source/blender/editors/render/render_shading.c | 2 +- source/blender/editors/screen/screen_ops.c | 2 +- source/blender/editors/sculpt_paint/paint_image.c | 8 +-- source/blender/editors/space_graph/graph_buttons.c | 49 +++++++------- source/blender/editors/space_info/space_info.c | 4 +- source/blender/editors/space_node/drawnode.c | 14 ++-- .../blender/editors/space_view3d/view3d_buttons.c | 2 +- .../blender/editors/space_view3d/view3d_toolbar.c | 2 +- source/blender/ikplugin/intern/iksolver_plugin.c | 2 +- source/blender/makesrna/intern/rna_ui_api.c | 5 -- source/blender/modifiers/intern/MOD_shapekey.c | 2 +- source/blender/python/generic/mathutils.c | 4 +- source/blender/python/generic/mathutils_color.c | 2 +- source/blender/windowmanager/WM_api.h | 2 +- source/blender/windowmanager/intern/wm.c | 2 +- .../blender/windowmanager/intern/wm_event_system.c | 4 +- source/blender/windowmanager/intern/wm_files.c | 8 +-- source/blender/windowmanager/intern/wm_gesture.c | 26 ++++---- source/blender/windowmanager/intern/wm_keymap.c | 4 +- source/blender/windowmanager/intern/wm_operators.c | 74 +++++++++++----------- source/blender/windowmanager/intern/wm_subwindow.c | 3 +- source/blender/windowmanager/intern/wm_window.c | 14 ++-- source/blender/windowmanager/wm.h | 2 +- source/blender/windowmanager/wm_window.h | 6 +- 48 files changed, 269 insertions(+), 277 deletions(-) (limited to 'source/blender') diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index dc0640c817f..83f76e38fd3 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -29,23 +29,23 @@ IF(CMAKE_COMPILER_IS_GNUCC) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-parameter") ENDIF(CMAKE_COMPILER_IS_GNUCC) -ADD_SUBDIRECTORY(windowmanager) ADD_SUBDIRECTORY(editors) -ADD_SUBDIRECTORY(avi) -ADD_SUBDIRECTORY(nodes) +ADD_SUBDIRECTORY(windowmanager) ADD_SUBDIRECTORY(blenkernel) -ADD_SUBDIRECTORY(modifiers) ADD_SUBDIRECTORY(blenlib) +ADD_SUBDIRECTORY(render) +ADD_SUBDIRECTORY(blenfont) ADD_SUBDIRECTORY(blenloader) +ADD_SUBDIRECTORY(readblenfile) ADD_SUBDIRECTORY(blenpluginapi) -ADD_SUBDIRECTORY(imbuf) +ADD_SUBDIRECTORY(ikplugin) ADD_SUBDIRECTORY(gpu) +ADD_SUBDIRECTORY(imbuf) +ADD_SUBDIRECTORY(avi) +ADD_SUBDIRECTORY(nodes) +ADD_SUBDIRECTORY(modifiers) ADD_SUBDIRECTORY(makesdna) ADD_SUBDIRECTORY(makesrna) -ADD_SUBDIRECTORY(readblenfile) -ADD_SUBDIRECTORY(render) -ADD_SUBDIRECTORY(blenfont) -ADD_SUBDIRECTORY(ikplugin) IF(WITH_IMAGE_OPENEXR) ADD_SUBDIRECTORY(imbuf/intern/openexr) diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index cd9f3971540..70badbc96e8 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -50,8 +50,8 @@ struct Main; #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 -int BKE_read_file(struct bContext *C, char *dir, void *type_r, struct ReportList *reports); -int BKE_read_file_from_memory(struct bContext *C, char* filebuf, int filelength, void *type_r, struct ReportList *reports); +int BKE_read_file(struct bContext *C, char *dir, struct ReportList *reports); +int BKE_read_file_from_memory(struct bContext *C, char* filebuf, int filelength, struct ReportList *reports); int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile, struct ReportList *reports); void free_blender(void); diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 7450e31e263..33ab6c36b74 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -44,8 +44,10 @@ #define STRINGIFY_ARG(x) #x #define STRINGIFY(x) STRINGIFY_ARG(x) + + #ifdef __GNUC__ -# define UNUSED(x) x __attribute__((__unused__)) +# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__)) #else # define UNUSED(x) x #endif diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index d120b42a286..5fcf3c77d3b 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -365,7 +365,7 @@ void BKE_userdef_free(void) 2: OK, and with new user settings */ -int BKE_read_file(bContext *C, char *dir, void *unused, ReportList *reports) +int BKE_read_file(bContext *C, char *dir, ReportList *reports) { BlendFileData *bfd; int retval= 1; @@ -392,7 +392,7 @@ int BKE_read_file(bContext *C, char *dir, void *unused, ReportList *reports) return (bfd?retval:0); } -int BKE_read_file_from_memory(bContext *C, char* filebuf, int filelength, void *unused, ReportList *reports) +int BKE_read_file_from_memory(bContext *C, char* filebuf, int filelength, ReportList *reports) { BlendFileData *bfd; @@ -474,7 +474,7 @@ static int read_undosave(bContext *C, UndoElem *uel) G.fileflags |= G_FILE_NO_UI; if(UNDO_DISK) - success= BKE_read_file(C, uel->str, NULL, NULL); + success= BKE_read_file(C, uel->str, NULL); else success= BKE_read_file_from_memfile(C, &uel->memfile, NULL); @@ -554,7 +554,7 @@ void BKE_write_undo(bContext *C, char *name) if(curundo->prev) prevfile= &(curundo->prev->memfile); memused= MEM_get_memory_in_use(); - success= BLO_write_file_mem(CTX_data_main(C), prevfile, &curundo->memfile, G.fileflags, NULL); + success= BLO_write_file_mem(CTX_data_main(C), prevfile, &curundo->memfile, G.fileflags); curundo->undosize= MEM_get_memory_in_use() - memused; } diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c index bd721871f0a..9d126a4a931 100644 --- a/source/blender/blenlib/intern/pbvh.c +++ b/source/blender/blenlib/intern/pbvh.c @@ -1399,7 +1399,7 @@ int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3], //#include -void BLI_pbvh_node_draw(PBVHNode *node, void *data) +void BLI_pbvh_node_draw(PBVHNode *node, void *UNUSED(data)) { #if 0 /* XXX: Just some quick code to show leaf nodes in different colors */ diff --git a/source/blender/blenloader/BLO_writefile.h b/source/blender/blenloader/BLO_writefile.h index 182c582cc0f..5758eca6076 100644 --- a/source/blender/blenloader/BLO_writefile.h +++ b/source/blender/blenloader/BLO_writefile.h @@ -36,8 +36,7 @@ struct Main; struct ReportList; extern int BLO_write_file(struct Main *mainvar, char *dir, int write_flags, struct ReportList *reports, int *thumb); -extern int BLO_write_file_mem(struct Main *mainvar, struct MemFile *compare, struct MemFile *current, - int write_flags, struct ReportList *reports); +extern int BLO_write_file_mem(struct Main *mainvar, struct MemFile *compare, struct MemFile *current, int write_flags); extern int BLO_write_runtime(struct Main *mainvar, char *file, char *exename, struct ReportList *reports); #define BLEN_THUMB_SIZE 128 diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index b637d538b91..c892e8457ca 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -284,7 +284,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil strcpy(fd->relabase, filename); /* clear ob->proxy_from pointers in old main */ - blo_clear_proxy_pointers_from_lib(fd, oldmain); + blo_clear_proxy_pointers_from_lib(oldmain); /* separate libraries from old main */ blo_split_main(&mainlist, oldmain); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index b6c1bd1c7bc..ebd407e7e21 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -704,7 +704,7 @@ BHead *blo_firstbhead(FileData *fd) return(bhead); } -BHead *blo_prevbhead(FileData *fd, BHead *thisblock) +BHead *blo_prevbhead(FileData *UNUSED(fd), BHead *thisblock) { BHeadN *bheadn= (BHeadN *) (((char *) thisblock) - GET_INT_FROM_POINTER( &((BHeadN*)0)->bhead) ); BHeadN *prev= bheadn->prev; @@ -1155,7 +1155,7 @@ static void change_idid_adr(ListBase *mainlist, FileData *basefd, void *old, voi * to clear that pointer before reading the undo memfile since * the object might be removed, it is set again in reading * if the local object still exists */ -void blo_clear_proxy_pointers_from_lib(FileData *fd, Main *oldmain) +void blo_clear_proxy_pointers_from_lib(Main *oldmain) { Object *ob= oldmain->object.first; @@ -1442,7 +1442,7 @@ static void IDP_DirectLinkArray(IDProperty *prop, int switch_endian, FileData *f } } -static void IDP_DirectLinkString(IDProperty *prop, int switch_endian, FileData *fd) +static void IDP_DirectLinkString(IDProperty *prop, FileData *fd) { /*since we didn't save the extra string buffer, set totallen to len.*/ prop->totallen = prop->len; @@ -1469,7 +1469,7 @@ void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd) IDP_DirectLinkGroup(prop, switch_endian, fd); break; case IDP_STRING: - IDP_DirectLinkString(prop, switch_endian, fd); + IDP_DirectLinkString(prop, fd); break; case IDP_ARRAY: IDP_DirectLinkArray(prop, switch_endian, fd); @@ -1499,7 +1499,7 @@ void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd) } /*stub function*/ -void IDP_LibLinkProperty(IDProperty *prop, int switch_endian, FileData *fd) +void IDP_LibLinkProperty(IDProperty *UNUSED(prop), int UNUSED(switch_endian), FileData *UNUSED(fd)) { } @@ -1552,7 +1552,7 @@ static void direct_link_brush(FileData *fd, Brush *brush) brush->icon_imbuf= NULL; } -static void direct_link_script(FileData *fd, Script *script) +static void direct_link_script(FileData *UNUSED(fd), Script *script) { script->id.us = 1; SCRIPT_SET_NULL(script) @@ -2030,7 +2030,7 @@ static void lib_link_nodetree(FileData *fd, Main *main) /* verify types for nodes and groups, all data has to be read */ /* open = 0: appending/linking, open = 1: open new file (need to clean out dynamic * typedefs*/ -static void lib_verify_nodetree(Main *main, int open) +static void lib_verify_nodetree(Main *main, int UNUSED(open)) { Scene *sce; Material *ma; @@ -2139,7 +2139,7 @@ typedef struct tConstraintLinkData { ID *id; } tConstraintLinkData; /* callback function used to relink constraint ID-links */ -static void lib_link_constraint_cb(bConstraint *con, ID **idpoin, void *userdata) +static void lib_link_constraint_cb(bConstraint *UNUSED(con), ID **idpoin, void *userdata) { tConstraintLinkData *cld= (tConstraintLinkData *)userdata; *idpoin = newlibadr(cld->fd, cld->id->lib, *idpoin); @@ -2534,7 +2534,7 @@ static void direct_link_world(FileData *fd, World *wrld) /* ************ READ VFONT ***************** */ -static void lib_link_vfont(FileData *fd, Main *main) +static void lib_link_vfont(FileData *UNUSED(fd), Main *main) { VFont *vf; @@ -2555,7 +2555,7 @@ static void direct_link_vfont(FileData *fd, VFont *vf) /* ************ READ TEXT ****************** */ -static void lib_link_text(FileData *fd, Main *main) +static void lib_link_text(FileData *UNUSED(fd), Main *main) { Text *text; @@ -5261,7 +5261,7 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main) lib->parent= NULL; } -static void lib_link_library(FileData *fd, Main *main) +static void lib_link_library(FileData *UNUSED(fd), Main *main) { Library *lib; for(lib= main->library.first; lib; lib= lib->id.next) { @@ -6473,7 +6473,7 @@ static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype) } } -static void do_version_mdef_250(FileData *fd, Library *lib, Main *main) +static void do_version_mdef_250(Main *main) { Object *ob; ModifierData *md; @@ -10899,7 +10899,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } - do_version_mdef_250(fd, lib, main); + do_version_mdef_250(main); /* parent type to modifier */ for(ob = main->object.first; ob; ob = ob->id.next) { @@ -11291,7 +11291,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filename) lib_link_all(fd, bfd->main); //do_versions_after_linking(fd, NULL, bfd->main); // XXX: not here (or even in this function at all)! this causes crashes on many files - Aligorith (July 04, 2010) - lib_verify_nodetree(bfd->main, 1); + lib_verify_nodetree(bfd->main, TRUE); fix_relpaths_library(fd->relabase, bfd->main); /* make all relative paths, relative to the open blend file */ link_global(fd, bfd); /* as last */ @@ -11776,7 +11776,7 @@ typedef struct tConstraintExpandData { Main *mainvar; } tConstraintExpandData; /* callback function used to expand constraint ID-links */ -static void expand_constraint_cb(bConstraint *con, ID **idpoin, void *userdata) +static void expand_constraint_cb(bConstraint *UNUSED(con), ID **idpoin, void *userdata) { tConstraintExpandData *ced= (tConstraintExpandData *)userdata; expand_doit(ced->fd, ced->mainvar, *idpoin); @@ -12461,7 +12461,7 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in mainl= NULL; /* blo_join_main free's mainl, cant use anymore */ lib_link_all(*fd, mainvar); - lib_verify_nodetree(mainvar, 0); + lib_verify_nodetree(mainvar, FALSE); fix_relpaths_library(G.sce, mainvar); /* make all relative paths, relative to the open blend file */ /* give a base to loose objects. If group append, do it for objects too */ diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index 8e391fa438e..ed89e93d66a 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -114,7 +114,7 @@ FileData *blo_openblenderfile(char *name, struct ReportList *reports); FileData *blo_openblendermemory(void *buffer, int buffersize, struct ReportList *reports); FileData *blo_openblendermemfile(struct MemFile *memfile, struct ReportList *reports); -void blo_clear_proxy_pointers_from_lib(FileData *fd, Main *oldmain); +void blo_clear_proxy_pointers_from_lib(Main *oldmain); void blo_make_image_pointer_map(FileData *fd, Main *oldmain); void blo_end_image_pointer_map(FileData *fd, Main *oldmain); void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index dc5a0dbeafa..440f1cc98a8 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2530,7 +2530,7 @@ int BLO_write_file(Main *mainvar, char *dir, int write_flags, ReportList *report } /* return: success (1) */ -int BLO_write_file_mem(Main *mainvar, MemFile *compare, MemFile *current, int write_flags, ReportList *reports) +int BLO_write_file_mem(Main *mainvar, MemFile *compare, MemFile *current, int write_flags) { int err; diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index feb680ff40a..6e5be217164 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -91,7 +91,7 @@ /* Get shapekey data being edited (for Action Editor -> ShapeKey mode) */ /* Note: there's a similar function in key.c (ob_get_key) */ -Key *actedit_get_shapekeys (bAnimContext *ac, SpaceAction *saction) +static Key *actedit_get_shapekeys (bAnimContext *ac) { Scene *scene= ac->scene; Object *ob; @@ -153,7 +153,7 @@ static short actedit_get_context (bAnimContext *ac, SpaceAction *saction) case SACTCONT_SHAPEKEY: /* 'ShapeKey Editor' */ ac->datatype= ANIMCONT_SHAPEKEY; - ac->data= actedit_get_shapekeys(ac, saction); + ac->data= actedit_get_shapekeys(ac); ac->mode= saction->mode; return 1; diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c index 64426b7dc6b..7b2ec9891f4 100644 --- a/source/blender/editors/armature/poseSlide.c +++ b/source/blender/editors/armature/poseSlide.c @@ -157,7 +157,7 @@ static int pose_slide_init (bContext *C, wmOperator *op, short mode) } /* exiting the operator - free data */ -static void pose_slide_exit (bContext *C, wmOperator *op) +static void pose_slide_exit(wmOperator *op) { tPoseSlideOp *pso= op->customdata; @@ -376,7 +376,7 @@ static void pose_slide_apply_quat (tPoseSlideOp *pso, tPChanFCurveLink *pfl) } /* apply() - perform the pose sliding based on weighting various poses */ -static void pose_slide_apply (bContext *C, wmOperator *op, tPoseSlideOp *pso) +static void pose_slide_apply(bContext *C, tPoseSlideOp *pso) { tPChanFCurveLink *pfl; @@ -434,7 +434,7 @@ static void pose_slide_autoKeyframe (bContext *C, tPoseSlideOp *pso) } /* reset changes made to current pose */ -static void pose_slide_reset (bContext *C, tPoseSlideOp *pso) +static void pose_slide_reset (tPoseSlideOp *pso) { /* wrapper around the generic call, so that custom stuff can be added later */ poseAnim_mapping_reset(&pso->pfLinks); @@ -501,7 +501,7 @@ static int pose_slide_invoke_common (bContext *C, wmOperator *op, tPoseSlideOp * /* initial apply for operator... */ // TODO: need to calculate percentage for initial round too... - pose_slide_apply(C, op, pso); + pose_slide_apply(C, pso); /* depsgraph updates + redraws */ pose_slide_refresh(C, pso); @@ -528,7 +528,7 @@ static int pose_slide_modal (bContext *C, wmOperator *op, wmEvent *evt) /* insert keyframes as required... */ pose_slide_autoKeyframe(C, pso); - pose_slide_exit(C, op); + pose_slide_exit(op); /* done! */ return OPERATOR_FINISHED; @@ -541,13 +541,13 @@ static int pose_slide_modal (bContext *C, wmOperator *op, wmEvent *evt) WM_cursor_restore(win); /* reset transforms back to original state */ - pose_slide_reset(C, pso); + pose_slide_reset(pso); /* depsgraph updates + redraws */ pose_slide_refresh(C, pso); /* clean up temp data */ - pose_slide_exit(C, op); + pose_slide_exit(op); /* cancelled! */ return OPERATOR_CANCELLED; @@ -562,10 +562,10 @@ static int pose_slide_modal (bContext *C, wmOperator *op, wmEvent *evt) RNA_float_set(op->ptr, "percentage", pso->percentage); /* reset transforms (to avoid accumulation errors) */ - pose_slide_reset(C, pso); + pose_slide_reset(pso); /* apply... */ - pose_slide_apply(C, op, pso); + pose_slide_apply(C, pso); } break; @@ -579,10 +579,10 @@ static int pose_slide_modal (bContext *C, wmOperator *op, wmEvent *evt) } /* common code for cancel() */ -static int pose_slide_cancel (bContext *C, wmOperator *op) +static int pose_slide_cancel (bContext *UNUSED(C), wmOperator *op) { /* cleanup and done */ - pose_slide_exit(C, op); + pose_slide_exit(op); return OPERATOR_CANCELLED; } @@ -590,13 +590,13 @@ static int pose_slide_cancel (bContext *C, wmOperator *op) static int pose_slide_exec_common (bContext *C, wmOperator *op, tPoseSlideOp *pso) { /* settings should have been set up ok for applying, so just apply! */ - pose_slide_apply(C, op, pso); + pose_slide_apply(C, pso); /* insert keyframes if needed */ pose_slide_autoKeyframe(C, pso); /* cleanup and done */ - pose_slide_exit(C, op); + pose_slide_exit(op); return OPERATOR_FINISHED; } @@ -618,7 +618,7 @@ static int pose_slide_push_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED( /* initialise data */ if (pose_slide_init(C, op, POSESLIDE_PUSH) == 0) { - pose_slide_exit(C, op); + pose_slide_exit(op); return OPERATOR_CANCELLED; } else @@ -635,7 +635,7 @@ static int pose_slide_push_exec (bContext *C, wmOperator *op) /* initialise data (from RNA-props) */ if (pose_slide_init(C, op, POSESLIDE_PUSH) == 0) { - pose_slide_exit(C, op); + pose_slide_exit(op); return OPERATOR_CANCELLED; } else @@ -675,7 +675,7 @@ static int pose_slide_relax_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED /* initialise data */ if (pose_slide_init(C, op, POSESLIDE_RELAX) == 0) { - pose_slide_exit(C, op); + pose_slide_exit(op); return OPERATOR_CANCELLED; } else @@ -692,7 +692,7 @@ static int pose_slide_relax_exec (bContext *C, wmOperator *op) /* initialise data (from RNA-props) */ if (pose_slide_init(C, op, POSESLIDE_RELAX) == 0) { - pose_slide_exit(C, op); + pose_slide_exit(op); return OPERATOR_CANCELLED; } else @@ -732,7 +732,7 @@ static int pose_slide_breakdown_invoke (bContext *C, wmOperator *op, wmEvent *UN /* initialise data */ if (pose_slide_init(C, op, POSESLIDE_BREAKDOWN) == 0) { - pose_slide_exit(C, op); + pose_slide_exit(op); return OPERATOR_CANCELLED; } else @@ -749,7 +749,7 @@ static int pose_slide_breakdown_exec (bContext *C, wmOperator *op) /* initialise data (from RNA-props) */ if (pose_slide_init(C, op, POSESLIDE_BREAKDOWN) == 0) { - pose_slide_exit(C, op); + pose_slide_exit(op); return OPERATOR_CANCELLED; } else diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 4689153c9f5..2a1527b670d 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -492,7 +492,7 @@ uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxle void uiBlockPickerButtons(struct uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval); uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, char *name, int icon, int x1, int y1, int x2, int y2); -void uiDefAutoButsRNA(const struct bContext *C, uiLayout *layout, struct PointerRNA *ptr, int columns); +void uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, int columns); /* Links * @@ -680,17 +680,17 @@ void uiTemplateIDBrowse(uiLayout *layout, struct bContext *C, struct PointerRNA char *newop, char *openop, char *unlinkop); void uiTemplateIDPreview(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop, int rows, int cols); -void uiTemplateAnyID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, +void uiTemplateAnyID(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *proptypename, char *text); -void uiTemplatePathBuilder(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, +void uiTemplatePathBuilder(uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *root_ptr, char *text); uiLayout *uiTemplateModifier(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr); uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr); void uiTemplatePreview(uiLayout *layout, struct ID *id, struct ID *parent, struct MTex *slot); void uiTemplateColorRamp(uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand); -void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand); -void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand); -void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand); +void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, char *propname); +void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, char *propname); +void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, char *propname); void uiTemplateCurveMapping(uiLayout *layout, struct PointerRNA *ptr, char *propname, int type, int levels, int brush); void uiTemplateColorWheel(uiLayout *layout, struct PointerRNA *ptr, char *propname, int value_slider, int lock, int lock_luminosity, int cubic); void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname, diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 55428a4a241..f65b10eaaea 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -441,7 +441,7 @@ void uiCenteredBoundsBlock(uiBlock *block, int addval) /* link line drawing is not part of buttons or theme.. so we stick with it here */ -static void ui_draw_linkline(uiBut *but, uiLinkLine *line) +static void ui_draw_linkline(uiLinkLine *line) { rcti rect; @@ -470,7 +470,7 @@ static void ui_draw_links(uiBlock *block) if(but->type==LINK && but->link) { line= but->link->lines.first; while(line) { - ui_draw_linkline(but, line); + ui_draw_linkline(line); line= line->next; } } @@ -748,7 +748,7 @@ void uiDrawBlock(const bContext *C, uiBlock *block) if(block->flag & UI_BLOCK_LOOP) ui_draw_menu_back(&style, block, &rect); else if(block->panel) - ui_draw_aligned_panel(ar, &style, block, &rect); + ui_draw_aligned_panel(&style, block, &rect); /* widgets */ for(but= block->buttons.first; but; but= but->next) { @@ -835,7 +835,7 @@ static void ui_is_but_sel(uiBut *but) /* XXX 2.50 no links supported yet */ -static int uibut_contains_pt(uiBut *but, short *mval) +static int uibut_contains_pt(uiBut *UNUSED(but), short *UNUSED(mval)) { return 0; @@ -1093,12 +1093,12 @@ static void ui_do_active_linklines(uiBlock *block, short *mval) if(line==act) { if((line->flag & UI_SELECT)==0) { line->flag |= UI_SELECT; - ui_draw_linkline(but, line); + ui_draw_linkline(line); } } else if(line->flag & UI_SELECT) { line->flag &= ~UI_SELECT; - ui_draw_linkline(but, line); + ui_draw_linkline(line); } line= line->next; } @@ -2182,7 +2182,7 @@ int ui_but_can_align(uiBut *but) return !ELEM3(but->type, LABEL, OPTION, OPTIONN); } -static void ui_block_do_align_but(uiBlock *block, uiBut *first, int nr) +static void ui_block_do_align_but(uiBut *first, int nr) { uiBut *prev, *but=NULL, *next; int flag= 0, cols=0, rows=0; @@ -2316,7 +2316,7 @@ void ui_block_do_align(uiBlock *block) for(but=block->buttons.first; but;) { if(but->alignnr) { nr= but->alignnr; - ui_block_do_align_but(block, but, nr); + ui_block_do_align_but(but, nr); /* skip with same number */ for(; but && but->alignnr == nr; but=but->next); diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 093d175adce..855ca45f61a 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -460,7 +460,7 @@ void uiEmboss(float x1, float y1, float x2, float y2, int sel) /* ************** SPECIAL BUTTON DRAWING FUNCTIONS ************* */ -void ui_draw_but_IMAGE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect) +void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors *UNUSED(wcol), rcti *rect) { extern char datatoc_splash_png[]; extern int datatoc_splash_png_size; @@ -747,7 +747,7 @@ void histogram_draw_one(float r, float g, float b, float alpha, float x, float y glDisable(GL_LINE_SMOOTH); } -void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *recti) +void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti) { Histogram *hist = (Histogram *)but->poin; int res = hist->x_resolution; @@ -800,7 +800,7 @@ void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti * draw_scope_end(&rect, scissor); } -void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *recti) +void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti) { Scopes *scopes = (Scopes *)but->poin; rctf rect; @@ -1023,7 +1023,7 @@ void vectorscope_draw_target(float centerx, float centery, float diam, float r, glEnd(); } -void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *recti) +void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti) { Scopes *scopes = (Scopes *)but->poin; rctf rect; @@ -1105,7 +1105,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti glDisable(GL_BLEND); } -void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect) +void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect) { ColorBand *coba; CBData *cbd; diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 3fa53b73015..cbd4939b1b1 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -331,7 +331,7 @@ static void vicon_editmode_hlt_draw(int x, int y, int w, int h, float alpha) viconutil_draw_points(pts, 3, 1); } -static void vicon_editmode_dehlt_draw(int x, int y, int w, int h, float alpha) +static void vicon_editmode_dehlt_draw(int x, int y, int w, int h, float UNUSED(alpha)) { GLint pts[3][2]; @@ -346,7 +346,7 @@ static void vicon_editmode_dehlt_draw(int x, int y, int w, int h, float alpha) viconutil_draw_points(pts, 3, 1); } -static void vicon_disclosure_tri_right_draw(int x, int y, int w, int h, float alpha) +static void vicon_disclosure_tri_right_draw(int x, int y, int w, int UNUSED(h), float alpha) { GLint pts[3][2]; int cx = x+w/2; @@ -371,7 +371,7 @@ static void vicon_disclosure_tri_right_draw(int x, int y, int w, int h, float al viconutil_draw_lineloop_smooth(pts, 3); } -static void vicon_small_tri_right_draw(int x, int y, int w, int h, float alpha) +static void vicon_small_tri_right_draw(int x, int y, int w, int UNUSED(h), float alpha) { GLint pts[3][2]; int cx = x+w/2-4; @@ -393,7 +393,7 @@ static void vicon_small_tri_right_draw(int x, int y, int w, int h, float alpha) glShadeModel(GL_FLAT); } -static void vicon_disclosure_tri_down_draw(int x, int y, int w, int h, float alpha) +static void vicon_disclosure_tri_down_draw(int x, int y, int w, int UNUSED(h), float alpha) { GLint pts[3][2]; int cx = x+w/2; @@ -418,7 +418,7 @@ static void vicon_disclosure_tri_down_draw(int x, int y, int w, int h, float alp viconutil_draw_lineloop_smooth(pts, 3); } -static void vicon_move_up_draw(int x, int y, int w, int h, float alpha) +static void vicon_move_up_draw(int x, int y, int w, int h, float UNUSED(alpha)) { int d=-2; @@ -436,7 +436,7 @@ static void vicon_move_up_draw(int x, int y, int w, int h, float alpha) glDisable(GL_LINE_SMOOTH); } -static void vicon_move_down_draw(int x, int y, int w, int h, float alpha) +static void vicon_move_down_draw(int x, int y, int w, int h, float UNUSED(alpha)) { int d=2; @@ -843,7 +843,7 @@ static void icon_set_image(bContext *C, ID *id, PreviewImage* prv_img, int miple prv_img->w[miplevel], prv_img->h[miplevel]); } -static void icon_draw_rect(float x, float y, int w, int h, float aspect, int rw, int rh, unsigned int *rect, float alpha, float *rgb) +static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh, unsigned int *rect, float alpha, float *rgb) { /* modulate color */ if(alpha != 1.0f) @@ -895,7 +895,7 @@ static void icon_draw_rect(float x, float y, int w, int h, float aspect, int rw, } } -static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy, int iw, int ih, float alpha, float *rgb) +static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy, int UNUSED(iw), int ih, float alpha, float *rgb) { float x1, x2, y1, y2; @@ -938,7 +938,7 @@ static int preview_size(int miplevel) return 0; } -static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, float *rgb, int miplevel, int draw_size, int nocreate) +static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, float *rgb, int miplevel, int draw_size, int UNUSED(nocreate)) { Icon *icon = NULL; DrawInfo *di = NULL; diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 91776b41817..7a0f69fc838 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -441,7 +441,7 @@ void autocomplete_end(struct AutoComplete *autocpl, char *autoname); /* interface_panel.c */ extern int ui_handler_panel_region(struct bContext *C, struct wmEvent *event); -extern void ui_draw_aligned_panel(struct ARegion *ar, struct uiStyle *style, uiBlock *block, rcti *rect); +extern void ui_draw_aligned_panel(struct uiStyle *style, uiBlock *block, rcti *rect); /* interface_draw.c */ extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 3db68fd89c0..f729124e405 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -434,7 +434,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, char *name, int icon uiBlockSetCurLayout(block, layout); } -static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, char *uiname, int x, int y, int w, int h, int icon_only) +static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, char *uiname, int h, int icon_only) { uiBut *but; EnumPropertyItem *item; @@ -956,7 +956,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index } /* expanded enum */ else if(type == PROP_ENUM && (expand || RNA_property_flag(prop) & PROP_ENUM_FLAG)) - ui_item_enum_expand(layout, block, ptr, prop, name, 0, 0, w, h, icon_only); + ui_item_enum_expand(layout, block, ptr, prop, name, h, icon_only); /* property with separate label */ else if(type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) { but= ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h, flag); diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index a7b74900a21..d6cb8161916 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -316,7 +316,7 @@ void uiPanelPush(uiBlock *block) glTranslatef((float)block->panel->ofsx, (float)block->panel->ofsy, 0.0); } -void uiPanelPop(uiBlock *block) +void uiPanelPop(uiBlock *UNUSED(block)) { glPopMatrix(); } @@ -425,7 +425,7 @@ static void ui_draw_panel_dragwidget(rctf *rect) } -static void ui_draw_aligned_panel_header(ARegion *ar, uiStyle *style, uiBlock *block, rcti *rect, char dir) +static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *rect, char dir) { Panel *panel= block->panel; rcti hrect; @@ -468,7 +468,7 @@ static void rectf_scale(rctf *rect, float scale) } /* panel integrated in buttonswindow, tool/property lists etc */ -void ui_draw_aligned_panel(ARegion *ar, uiStyle *style, uiBlock *block, rcti *rect) +void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) { Panel *panel= block->panel; rcti headrect; @@ -499,7 +499,7 @@ void ui_draw_aligned_panel(ARegion *ar, uiStyle *style, uiBlock *block, rcti *re /* horizontal title */ if(!(panel->flag & PNL_CLOSEDX)) { - ui_draw_aligned_panel_header(ar, style, block, &headrect, 'h'); + ui_draw_aligned_panel_header(style, block, &headrect, 'h'); /* itemrect smaller */ itemrect.xmax= headrect.xmax - 5.0f/block->aspect; @@ -518,7 +518,7 @@ void ui_draw_aligned_panel(ARegion *ar, uiStyle *style, uiBlock *block, rcti *re } else if(panel->flag & PNL_CLOSEDX) { /* draw vertical title */ - ui_draw_aligned_panel_header(ar, style, block, &headrect, 'v'); + ui_draw_aligned_panel_header(style, block, &headrect, 'v'); } /* an open panel */ else { diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index f6a13dae71c..5f8d604817a 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -306,7 +306,7 @@ typedef struct uiTooltipData { int toth, spaceh, lineh; } uiTooltipData; -static void ui_tooltip_region_draw(const bContext *C, ARegion *ar) +static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar) { uiTooltipData *data= ar->regiondata; rcti bbox= data->bbox; @@ -328,7 +328,7 @@ static void ui_tooltip_region_draw(const bContext *C, ARegion *ar) } } -static void ui_tooltip_region_free(ARegion *ar) +static void ui_tooltip_region_free_cb(ARegion *ar) { uiTooltipData *data; @@ -455,8 +455,8 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) ar= ui_add_temporary_region(CTX_wm_screen(C)); memset(&type, 0, sizeof(ARegionType)); - type.draw= ui_tooltip_region_draw; - type.free= ui_tooltip_region_free; + type.draw= ui_tooltip_region_draw_cb; + type.free= ui_tooltip_region_free_cb; ar->type= &type; /* set font, get bb */ @@ -832,7 +832,7 @@ void ui_searchbox_autocomplete(bContext *C, ARegion *ar, uiBut *but, char *str) } } -static void ui_searchbox_region_draw(const bContext *C, ARegion *ar) +static void ui_searchbox_region_draw_cb(const bContext *UNUSED(C), ARegion *ar) { uiSearchboxData *data= ar->regiondata; @@ -840,7 +840,7 @@ static void ui_searchbox_region_draw(const bContext *C, ARegion *ar) wmOrtho2(-0.01f, ar->winx-0.01f, -0.01f, ar->winy-0.01f); if(!data->noback) - ui_draw_search_back(U.uistyles.first, NULL, &data->bbox); + ui_draw_search_back(NULL, NULL, &data->bbox); /* style not used yet */ /* draw text */ if(data->items.totitem) { @@ -899,7 +899,7 @@ static void ui_searchbox_region_draw(const bContext *C, ARegion *ar) } } -static void ui_searchbox_region_free(ARegion *ar) +static void ui_searchbox_region_free_cb(ARegion *ar) { uiSearchboxData *data= ar->regiondata; int a; @@ -931,8 +931,8 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) ar= ui_add_temporary_region(CTX_wm_screen(C)); memset(&type, 0, sizeof(ARegionType)); - type.draw= ui_searchbox_region_draw; - type.free= ui_searchbox_region_free; + type.draw= ui_searchbox_region_draw_cb; + type.free= ui_searchbox_region_free_cb; ar->type= &type; /* create searchbox data */ @@ -1418,7 +1418,7 @@ void ui_popup_block_free(bContext *C, uiPopupBlockHandle *handle) /***************************** Menu Button ***************************/ -static void ui_block_func_MENUSTR(bContext *C, uiLayout *layout, void *arg_str) +static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *arg_str) { uiBlock *block= uiLayoutGetBlock(layout); uiPopupBlockHandle *handle= block->handle; @@ -1500,7 +1500,7 @@ static void ui_block_func_MENUSTR(bContext *C, uiLayout *layout, void *arg_str) menudata_free(md); } -void ui_block_func_ICONROW(bContext *C, uiLayout *layout, void *arg_but) +void ui_block_func_ICONROW(bContext *UNUSED(C), uiLayout *layout, void *arg_but) { uiBlock *block= uiLayoutGetBlock(layout); uiPopupBlockHandle *handle= block->handle; @@ -1514,7 +1514,7 @@ void ui_block_func_ICONROW(bContext *C, uiLayout *layout, void *arg_but) &handle->retvalue, (float)a, 0.0, 0, 0, ""); } -void ui_block_func_ICONTEXTROW(bContext *C, uiLayout *layout, void *arg_but) +void ui_block_func_ICONTEXTROW(bContext *UNUSED(C), uiLayout *layout, void *arg_but) { uiBlock *block= uiLayoutGetBlock(layout); uiPopupBlockHandle *handle= block->handle; @@ -1642,7 +1642,7 @@ void ui_update_block_buts_rgb(uiBlock *block, float *rgb) } } -static void do_picker_rna_cb(bContext *C, void *bt1, void *unused) +static void do_picker_rna_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg)) { uiBut *but= (uiBut *)bt1; uiPopupBlockHandle *popup= but->block->handle; @@ -1659,7 +1659,7 @@ static void do_picker_rna_cb(bContext *C, void *bt1, void *unused) popup->menuretval= UI_RETURN_UPDATE; } -static void do_hsv_rna_cb(bContext *C, void *bt1, void *arg_dummy) +static void do_hsv_rna_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg)) { uiBut *but= (uiBut *)bt1; uiPopupBlockHandle *popup= but->block->handle; @@ -1674,7 +1674,7 @@ static void do_hsv_rna_cb(bContext *C, void *bt1, void *arg_dummy) popup->menuretval= UI_RETURN_UPDATE; } -static void do_hex_rna_cb(bContext *C, void *bt1, void *hexcl) +static void do_hex_rna_cb(bContext *UNUSED(C), void *bt1, void *hexcl) { uiBut *but= (uiBut *)bt1; uiPopupBlockHandle *popup= but->block->handle; @@ -1695,7 +1695,7 @@ static void do_hex_rna_cb(bContext *C, void *bt1, void *hexcl) popup->menuretval= UI_RETURN_UPDATE; } -static void close_popup_cb(bContext *C, void *bt1, void *arg) +static void close_popup_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg)) { uiBut *but= (uiBut *)bt1; uiPopupBlockHandle *popup= but->block->handle; @@ -1735,7 +1735,7 @@ static void picker_new_hide_reveal(uiBlock *block, short colormode) } } -static void do_picker_new_mode_cb(bContext *C, void *bt1, void *dummy) +static void do_picker_new_mode_cb(bContext *UNUSED(C), void *bt1, void *UNUSED(arg)) { uiBut *bt= bt1; short colormode= ui_get_but_val(bt); @@ -1886,7 +1886,7 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR } -static int ui_picker_small_wheel(const bContext *C, uiBlock *block, wmEvent *event) +static int ui_picker_small_wheel_cb(const bContext *UNUSED(C), uiBlock *block, wmEvent *event) { float add= 0.0f; @@ -1945,7 +1945,7 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN; uiBoundsBlock(block, 10); - block->block_event_func= ui_picker_small_wheel; + block->block_event_func= ui_picker_small_wheel_cb; /* and lets go */ block->direction= UI_TOP; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 77770452f84..bbbb5bec7c0 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -491,7 +491,7 @@ void uiTemplateIDPreview(uiLayout *layout, bContext *C, PointerRNA *ptr, char *p * - propname: property identifier for property that ID-pointer gets stored to * - proptypename: property identifier for property used to determine the type of ID-pointer that can be used */ -void uiTemplateAnyID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *proptypename, char *text) +void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, char *propname, char *proptypename, char *text) { PropertyRNA *propID, *propType; uiLayout *row; @@ -536,7 +536,7 @@ void uiTemplateAnyID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn * - propname: property identifier for property that path gets stored to * - root_ptr: struct that path gets built from */ -void uiTemplatePathBuilder(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, PointerRNA *root_ptr, char *text) +void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, char *propname, PointerRNA *UNUSED(root_ptr), char *text) { PropertyRNA *propPath; uiLayout *row; @@ -817,7 +817,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr) #define REMAKEIPO 8 #define B_DIFF 9 -void do_constraint_panels(bContext *C, void *arg, int event) +void do_constraint_panels(bContext *C, void *UNUSED(arg), int event) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -853,7 +853,7 @@ void do_constraint_panels(bContext *C, void *arg, int event) // XXX allqueue(REDRAWBUTSEDIT, 0); } -static void constraint_active_func(bContext *C, void *ob_v, void *con_v) +static void constraint_active_func(bContext *UNUSED(C), void *ob_v, void *con_v) { ED_object_constraint_set_active(ob_v, con_v); } @@ -1142,7 +1142,7 @@ typedef struct RNAUpdateCb { PropertyRNA *prop; } RNAUpdateCb; -static void rna_update_cb(bContext *C, void *arg_cb, void *arg_unused) +static void rna_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg)) { RNAUpdateCb *cb= (RNAUpdateCb*)arg_cb; @@ -1319,7 +1319,7 @@ void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, char *propname, int /********************* Histogram Template ************************/ -void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, char *propname, int expand) +void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, char *propname) { PropertyRNA *prop= RNA_struct_find_property(ptr, propname); PointerRNA cptr; @@ -1358,7 +1358,7 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, char *propname, int /********************* Waveform Template ************************/ -void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, char *propname, int expand) +void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, char *propname) { PropertyRNA *prop= RNA_struct_find_property(ptr, propname); PointerRNA cptr; @@ -1394,7 +1394,7 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, char *propname, int e /********************* Vectorscope Template ************************/ -void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, char *propname, int expand) +void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, char *propname) { PropertyRNA *prop= RNA_struct_find_property(ptr, propname); PointerRNA cptr; @@ -1432,7 +1432,7 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, char *propname, in /********************* CurveMapping Template ************************/ -static void curvemap_buttons_zoom_in(bContext *C, void *cumap_v, void *unused) +static void curvemap_buttons_zoom_in(bContext *C, void *cumap_v, void *UNUSED(arg)) { CurveMapping *cumap = cumap_v; float d; @@ -1450,7 +1450,7 @@ static void curvemap_buttons_zoom_in(bContext *C, void *cumap_v, void *unused) ED_region_tag_redraw(CTX_wm_region(C)); } -static void curvemap_buttons_zoom_out(bContext *C, void *cumap_v, void *unused) +static void curvemap_buttons_zoom_out(bContext *C, void *cumap_v, void *UNUSED(unused)) { CurveMapping *cumap = cumap_v; float d, d1; @@ -1487,7 +1487,7 @@ static void curvemap_buttons_zoom_out(bContext *C, void *cumap_v, void *unused) ED_region_tag_redraw(CTX_wm_region(C)); } -static void curvemap_buttons_setclip(bContext *C, void *cumap_v, void *unused) +static void curvemap_buttons_setclip(bContext *UNUSED(C), void *cumap_v, void *UNUSED(arg)) { CurveMapping *cumap = cumap_v; @@ -1607,7 +1607,7 @@ static uiBlock *curvemap_brush_tools_func(bContext *C, struct ARegion *ar, void return block; } -static void curvemap_buttons_redraw(bContext *C, void *arg1, void *arg2) +static void curvemap_buttons_redraw(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) { ED_region_tag_redraw(CTX_wm_region(C)); } @@ -2200,7 +2200,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propna /************************* Operator Search Template **************************/ -static void operator_call_cb(bContext *C, void *arg1, void *arg2) +static void operator_call_cb(bContext *C, void *UNUSED(arg1), void *arg2) { wmOperatorType *ot= arg2; @@ -2208,7 +2208,7 @@ static void operator_call_cb(bContext *C, void *arg1, void *arg2) WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL); } -static void operator_search_cb(const bContext *C, void *arg, char *str, uiSearchItems *items) +static void operator_search_cb(const bContext *C, void *UNUSED(arg), char *str, uiSearchItems *items) { wmOperatorType *ot = WM_operatortype_first(); @@ -2255,7 +2255,7 @@ void uiTemplateOperatorSearch(uiLayout *layout) #define B_STOPANIM 3 #define B_STOPCOMPO 4 -static void do_running_jobs(bContext *C, void *arg, int event) +static void do_running_jobs(bContext *C, void *UNUSED(arg), int event) { switch(event) { case B_STOPRENDER: diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 37278340275..6d8aa89afb0 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -131,7 +131,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind return but; } -void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr, int columns) +void uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, int columns) { uiLayout *split, *col; int flag; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 44fec4d4e07..7e15f9b1f74 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -744,7 +744,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) #define PREVIEW_PAD 4 -static void widget_draw_preview(BIFIconID icon, float aspect, float alpha, rcti *rect) +static void widget_draw_preview(BIFIconID icon, float aspect, float UNUSED(alpha), rcti *rect) { int w, h, x, y, size; @@ -1492,7 +1492,7 @@ static void widget_state_label(uiWidgetType *wt, int state) } -static void widget_state_nothing(uiWidgetType *wt, int state) +static void widget_state_nothing(uiWidgetType *wt, int UNUSED(state)) { wt->wcol= *(wt->wcol_theme); } @@ -1949,7 +1949,7 @@ static void ui_draw_but_HSV_v(uiBut *but, rcti *rect) /* ************ separator, for menus etc ***************** */ -static void ui_draw_separator(uiBut *but, rcti *rect, uiWidgetColors *wcol) +static void ui_draw_separator(rcti *rect, uiWidgetColors *wcol) { int y = rect->ymin + (rect->ymax - rect->ymin)/2 - 1; unsigned char col[4]; @@ -2121,7 +2121,7 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat } } -static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int UNUSED(roundboxalign)) { rcti rect1; double value; @@ -2182,7 +2182,7 @@ static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat uiWidgetScrollDraw(wcol, rect, &rect1, state); } -static void widget_progressbar(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_progressbar(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int UNUSED(roundboxalign)) { rcti rect_prog = *rect, rect_bar = *rect; float value = but->a1; @@ -2208,7 +2208,7 @@ static void widget_progressbar(uiBut *but, uiWidgetColors *wcol, rcti *rect, int rect->xmin -= 6; } -static void widget_link(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_link(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect, int UNUSED(state), int UNUSED(roundboxalign)) { if(but->flag & UI_SELECT) { @@ -2362,7 +2362,7 @@ static void widget_textbut(uiWidgetColors *wcol, rcti *rect, int state, int roun } -static void widget_menubut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_menubut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign) { uiWidgetBase wtb; @@ -2380,7 +2380,7 @@ static void widget_menubut(uiWidgetColors *wcol, rcti *rect, int state, int roun rect->xmax -= (rect->ymax-rect->ymin); } -static void widget_menuiconbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_menuiconbut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign) { uiWidgetBase wtb; @@ -2393,7 +2393,7 @@ static void widget_menuiconbut(uiWidgetColors *wcol, rcti *rect, int state, int widgetbase_draw(&wtb, wcol); } -static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int UNUSED(roundboxalign)) { if(state & UI_ACTIVE) { uiWidgetBase wtb; @@ -2408,7 +2408,7 @@ static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int } } -static void widget_menu_itembut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_menu_itembut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int UNUSED(roundboxalign)) { uiWidgetBase wtb; @@ -2421,7 +2421,7 @@ static void widget_menu_itembut(uiWidgetColors *wcol, rcti *rect, int state, int widgetbase_draw(&wtb, wcol); } -static void widget_list_itembut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_list_itembut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int UNUSED(roundboxalign)) { uiWidgetBase wtb; @@ -2434,7 +2434,7 @@ static void widget_list_itembut(uiWidgetColors *wcol, rcti *rect, int state, int widgetbase_draw(&wtb, wcol); } -static void widget_optionbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_optionbut(uiWidgetColors *wcol, rcti *rect, int state, int UNUSED(roundboxalign)) { uiWidgetBase wtb; rcti recttemp= *rect; @@ -2467,7 +2467,7 @@ static void widget_optionbut(uiWidgetColors *wcol, rcti *rect, int state, int ro } -static void widget_radiobut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_radiobut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign) { uiWidgetBase wtb; @@ -2480,7 +2480,7 @@ static void widget_radiobut(uiWidgetColors *wcol, rcti *rect, int state, int rou } -static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign) { uiWidgetBase wtb; char old_col[3]; @@ -2508,7 +2508,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, VECCOPY(wcol->inner, old_col); } -static void widget_but(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_but(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign) { uiWidgetBase wtb; @@ -2521,7 +2521,7 @@ static void widget_but(uiWidgetColors *wcol, rcti *rect, int state, int roundbox } -static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign) { uiWidgetBase wtb; float rad= 5.0f; //0.5f*(rect->ymax - rect->ymin); @@ -2786,7 +2786,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct widget_draw_text_icon(&style->widgetlabel, &tui->wcol_menu_back, but, rect); break; case SEPR: - ui_draw_separator(but, rect, &tui->wcol_menu_item); + ui_draw_separator(rect, &tui->wcol_menu_item); break; default: @@ -2972,7 +2972,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct } } -void ui_draw_menu_back(uiStyle *style, uiBlock *block, rcti *rect) +void ui_draw_menu_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect) { uiWidgetType *wt= widget_type(UI_WTYPE_MENU_BACK); @@ -2984,7 +2984,7 @@ void ui_draw_menu_back(uiStyle *style, uiBlock *block, rcti *rect) } -void ui_draw_search_back(uiStyle *style, uiBlock *block, rcti *rect) +void ui_draw_search_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect) { uiWidgetType *wt= widget_type(UI_WTYPE_BOX); diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 0f1efbcf7cf..d8b34311e76 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -1104,14 +1104,14 @@ static EditVert *editmesh_get_x_mirror_vert_topo(Object *ob, struct EditMesh *em if(poinval != -1) return (EditVert *)(poinval); return NULL; -} +} EditVert *editmesh_get_x_mirror_vert(Object *ob, struct EditMesh *em, EditVert *eve, float *co, int index) { if (((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_TOPO) { return editmesh_get_x_mirror_vert_topo(ob, em, eve, index); } else { - return editmesh_get_x_mirror_vert_spacial(ob, em, eve->co); + return editmesh_get_x_mirror_vert_spacial(ob, em, co); } } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index a058f5155de..840ab0b2098 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -282,7 +282,7 @@ void OBJECT_OT_material_slot_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int material_slot_remove_exec(bContext *C, wmOperator *UNUSED(op)) +static int material_slot_remove_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 9ae16b1bfa6..5bcf8c18074 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2463,7 +2463,7 @@ static int match_region_with_redraws(int spacetype, int regiontype, int redraws) return 0; } -static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { bScreen *screen= CTX_wm_screen(C); diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 2521f138fee..cd498c274cf 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4986,10 +4986,10 @@ static int paint_radial_control_exec(bContext *C, wmOperator *op) Brush *brush = paint_brush(&CTX_data_scene(C)->toolsettings->imapaint.paint); float zoom; int ret; - char str[256]; + char str[64]; get_imapaint_zoom(C, &zoom, &zoom); ret = brush_radial_control_exec(op, brush, 1.0f / zoom); - WM_radial_control_string(op, str, 256); + WM_radial_control_string(op, str, sizeof(str)); WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, brush); @@ -5333,8 +5333,8 @@ static int texture_paint_radial_control_exec(bContext *C, wmOperator *op) { Brush *brush = paint_brush(&CTX_data_scene(C)->toolsettings->imapaint.paint); int ret = brush_radial_control_exec(op, brush, 1); - char str[256]; - WM_radial_control_string(op, str, 256); + char str[64]; + WM_radial_control_string(op, str, sizeof(str)); WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, brush); diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 568c76f3dfc..dd3672b656a 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -76,7 +76,7 @@ /* -------------- */ -static void do_graph_region_buttons(bContext *C, void *arg, int event) +static void do_graph_region_buttons(bContext *UNUSED(C), void *UNUSED(arg), int event) { //Scene *scene= CTX_data_scene(C); @@ -116,7 +116,7 @@ static int graph_panel_context(const bContext *C, bAnimListElem **ale, FCurve ** return 1; } -static int graph_panel_poll(const bContext *C, PanelType *pt) +static int graph_panel_poll(const bContext *C, PanelType *UNUSED(pt)) { return graph_panel_context(C, NULL, NULL); } @@ -288,7 +288,7 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa) #define B_IPO_DEPCHANGE 10 -static void do_graph_region_driver_buttons(bContext *C, void *arg, int event) +static void do_graph_region_driver_buttons(bContext *C, void *UNUSED(arg), int event) { Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); @@ -310,7 +310,7 @@ static void do_graph_region_driver_buttons(bContext *C, void *arg, int event) } /* callback to remove the active driver */ -static void driver_remove_cb (bContext *C, void *ale_v, void *dummy_v) +static void driver_remove_cb (bContext *UNUSED(C), void *ale_v, void *UNUSED(arg)) { bAnimListElem *ale= (bAnimListElem *)ale_v; ID *id= ale->id; @@ -325,7 +325,7 @@ static void driver_remove_cb (bContext *C, void *ale_v, void *dummy_v) } /* callback to add a target variable to the active driver */ -static void driver_add_var_cb (bContext *C, void *driver_v, void *dummy_v) +static void driver_add_var_cb (bContext *UNUSED(C), void *driver_v, void *UNUSED(arg)) { ChannelDriver *driver= (ChannelDriver *)driver_v; @@ -334,7 +334,7 @@ static void driver_add_var_cb (bContext *C, void *driver_v, void *dummy_v) } /* callback to remove target variable from active driver */ -static void driver_delete_var_cb (bContext *C, void *driver_v, void *dvar_v) +static void driver_delete_var_cb (bContext *UNUSED(C), void *driver_v, void *dvar_v) { ChannelDriver *driver= (ChannelDriver *)driver_v; DriverVar *dvar= (DriverVar *)dvar_v; @@ -344,7 +344,7 @@ static void driver_delete_var_cb (bContext *C, void *driver_v, void *dvar_v) } /* callback to reset the driver's flags */ -static void driver_update_flags_cb (bContext *C, void *fcu_v, void *dummy_v) +static void driver_update_flags_cb (bContext *UNUSED(C), void *fcu_v, void *UNUSED(arg)) { FCurve *fcu= (FCurve *)fcu_v; ChannelDriver *driver= fcu->driver; @@ -355,7 +355,7 @@ static void driver_update_flags_cb (bContext *C, void *fcu_v, void *dummy_v) } /* drivers panel poll */ -static int graph_panel_drivers_poll(const bContext *C, PanelType *pt) +static int graph_panel_drivers_poll(const bContext *C, PanelType *UNUSED(pt)) { SpaceIpo *sipo= CTX_wm_space_graph(C); @@ -365,9 +365,8 @@ static int graph_panel_drivers_poll(const bContext *C, PanelType *pt) return graph_panel_context(C, NULL, NULL); } - /* settings for 'single property' driver variable type */ -static void graph_panel_driverVar__singleProp(const bContext *C, uiLayout *layout, ID *id, DriverVar *dvar) +static void graph_panel_driverVar__singleProp(uiLayout *layout, ID *id, DriverVar *dvar) { DriverTarget *dtar= &dvar->targets[0]; PointerRNA dtar_ptr; @@ -379,7 +378,7 @@ static void graph_panel_driverVar__singleProp(const bContext *C, uiLayout *layou /* Target ID */ row= uiLayoutRow(layout, 0); - uiTemplateAnyID(row, (bContext *)C, &dtar_ptr, "id", "id_type", "Prop:"); + uiTemplateAnyID(row, &dtar_ptr, "id", "id_type", "Prop:"); /* Target Property */ // TODO: make this less technical... @@ -392,12 +391,12 @@ static void graph_panel_driverVar__singleProp(const bContext *C, uiLayout *layou col= uiLayoutColumn(layout, 1); block= uiLayoutGetBlock(col); /* rna path */ - uiTemplatePathBuilder(col, (bContext *)C, &dtar_ptr, "data_path", &root_ptr, "Path"); + uiTemplatePathBuilder(col, &dtar_ptr, "data_path", &root_ptr, "Path"); } } /* settings for 'rotation difference' driver variable type */ -static void graph_panel_driverVar__rotDiff(const bContext *C, uiLayout *layout, ID *id, DriverVar *dvar) +static void graph_panel_driverVar__rotDiff(uiLayout *layout, ID *id, DriverVar *dvar) { DriverTarget *dtar= &dvar->targets[0]; DriverTarget *dtar2= &dvar->targets[1]; @@ -412,7 +411,7 @@ static void graph_panel_driverVar__rotDiff(const bContext *C, uiLayout *layout, /* Bone 1 */ col= uiLayoutColumn(layout, 1); - uiTemplateAnyID(col, (bContext *)C, &dtar_ptr, "id", "id_type", "Bone 1:"); + uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", "Bone 1:"); if (dtar->id && ob1->pose) { PointerRNA tar_ptr; @@ -422,7 +421,7 @@ static void graph_panel_driverVar__rotDiff(const bContext *C, uiLayout *layout, } col= uiLayoutColumn(layout, 1); - uiTemplateAnyID(col, (bContext *)C, &dtar2_ptr, "id", "id_type", "Bone 2:"); + uiTemplateAnyID(col, &dtar2_ptr, "id", "id_type", "Bone 2:"); if (dtar2->id && ob2->pose) { PointerRNA tar_ptr; @@ -433,7 +432,7 @@ static void graph_panel_driverVar__rotDiff(const bContext *C, uiLayout *layout, } /* settings for 'location difference' driver variable type */ -static void graph_panel_driverVar__locDiff(const bContext *C, uiLayout *layout, ID *id, DriverVar *dvar) +static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar *dvar) { DriverTarget *dtar= &dvar->targets[0]; DriverTarget *dtar2= &dvar->targets[1]; @@ -448,7 +447,7 @@ static void graph_panel_driverVar__locDiff(const bContext *C, uiLayout *layout, /* Bone 1 */ col= uiLayoutColumn(layout, 1); - uiTemplateAnyID(col, (bContext *)C, &dtar_ptr, "id", "id_type", "Ob/Bone 1:"); + uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", "Ob/Bone 1:"); if (dtar->id && ob1->pose) { PointerRNA tar_ptr; @@ -460,7 +459,7 @@ static void graph_panel_driverVar__locDiff(const bContext *C, uiLayout *layout, uiItemR(col, &dtar_ptr, "use_local_space_transform", 0, NULL, 0); col= uiLayoutColumn(layout, 1); - uiTemplateAnyID(col, (bContext *)C, &dtar2_ptr, "id", "id_type", "Ob/Bone 2:"); + uiTemplateAnyID(col, &dtar2_ptr, "id", "id_type", "Ob/Bone 2:"); if (dtar2->id && ob2->pose) { PointerRNA tar_ptr; @@ -473,7 +472,7 @@ static void graph_panel_driverVar__locDiff(const bContext *C, uiLayout *layout, } /* settings for 'transform channel' driver variable type */ -static void graph_panel_driverVar__transChan(const bContext *C, uiLayout *layout, ID *id, DriverVar *dvar) +static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar *dvar) { DriverTarget *dtar= &dvar->targets[0]; Object *ob = (Object *)dtar->id; @@ -485,7 +484,7 @@ static void graph_panel_driverVar__transChan(const bContext *C, uiLayout *layout /* properties */ col= uiLayoutColumn(layout, 1); - uiTemplateAnyID(col, (bContext *)C, &dtar_ptr, "id", "id_type", "Ob/Bone:"); + uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", "Ob/Bone:"); if (dtar->id && ob->pose) { PointerRNA tar_ptr; @@ -606,16 +605,16 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) /* controls to draw depends on the type of variable */ switch (dvar->type) { case DVAR_TYPE_SINGLE_PROP: /* single property */ - graph_panel_driverVar__singleProp(C, box, ale->id, dvar); + graph_panel_driverVar__singleProp(box, ale->id, dvar); break; case DVAR_TYPE_ROT_DIFF: /* rotational difference */ - graph_panel_driverVar__rotDiff(C, box, ale->id, dvar); + graph_panel_driverVar__rotDiff(box, ale->id, dvar); break; case DVAR_TYPE_LOC_DIFF: /* location difference */ - graph_panel_driverVar__locDiff(C, box, ale->id, dvar); + graph_panel_driverVar__locDiff(box, ale->id, dvar); break; case DVAR_TYPE_TRANSFORM_CHAN: /* transform channel */ - graph_panel_driverVar__transChan(C, box, ale->id, dvar); + graph_panel_driverVar__transChan(box, ale->id, dvar); break; } @@ -642,7 +641,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) #define B_FMODIFIER_REDRAW 20 -static void do_graph_region_modifier_buttons(bContext *C, void *arg, int event) +static void do_graph_region_modifier_buttons(bContext *C, void *UNUSED(arg), int event) { switch (event) { case B_REDR: diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index b47c8e8d189..6799d9390d7 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -179,7 +179,7 @@ static void info_header_listener(ARegion *ar, wmNotifier *wmn) } -static void recent_files_menu(const bContext *C, Menu *menu) +static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu) { struct RecentFile *recent; uiLayout *layout= menu->layout; @@ -200,7 +200,7 @@ void recent_files_menu_register() mt= MEM_callocN(sizeof(MenuType), "spacetype info menu recent files"); strcpy(mt->idname, "INFO_MT_file_open_recent"); strcpy(mt->label, "Open Recent..."); - mt->draw= recent_files_menu; + mt->draw= recent_files_menu_draw; WM_menutype_add(mt); } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 16a2ac3c52e..78ae82c57b0 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -72,7 +72,7 @@ /* ****************** BUTTON CALLBACKS FOR ALL TREES ***************** */ -void node_buts_group(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +void node_buts_group(uiLayout *layout, bContext *C, PointerRNA *ptr) { uiTemplateIDBrowse(layout, C, ptr, "node_tree", NULL, NULL, ""); } @@ -297,7 +297,7 @@ static void node_browse_text_cb(bContext *C, void *ntree_v, void *node_v) node->menunr= 0; } -static void node_shader_buts_material(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +static void node_shader_buts_material(uiLayout *layout, bContext *C, PointerRNA *ptr) { bNode *node= ptr->data; uiLayout *col; @@ -343,7 +343,7 @@ static void node_shader_buts_vect_math(uiLayout *layout, bContext *UNUSED(C), Po uiItemR(layout, ptr, "operation", 0, "", 0); } -static void node_shader_buts_geometry(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +static void node_shader_buts_geometry(uiLayout *layout, bContext *C, PointerRNA *ptr) { PointerRNA obptr= CTX_data_pointer_get(C, "active_object"); uiLayout *col; @@ -362,7 +362,7 @@ static void node_shader_buts_geometry(uiLayout *layout, bContext *UNUSED(C), Poi } } -static void node_shader_buts_dynamic(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA *ptr) { Main *bmain= CTX_data_main(C); uiBlock *block= uiLayoutAbsoluteBlock(layout); @@ -457,7 +457,7 @@ static void node_shader_set_butfunc(bNodeType *ntype) /* ****************** BUTTON CALLBACKS FOR COMPOSITE NODES ***************** */ -static void node_composit_buts_image(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *ptr) { uiLayout *col; bNode *node= ptr->data; @@ -491,7 +491,7 @@ static void node_composit_buts_image(uiLayout *layout, bContext *UNUSED(C), Poin uiItemR(col, ptr, "layer", 0, NULL, 0); } -static void node_composit_buts_renderlayers(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, PointerRNA *ptr) { bNode *node= ptr->data; uiLayout *col, *row; @@ -1210,7 +1210,7 @@ static void node_texture_buts_proc(uiLayout *layout, bContext *UNUSED(C), Pointe } } -static void node_texture_buts_image(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +static void node_texture_buts_image(uiLayout *layout, bContext *C, PointerRNA *ptr) { uiTemplateID(layout, C, ptr, "image", NULL, "IMAGE_OT_open", NULL); } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 141a8800365..450b3725bdb 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1421,7 +1421,7 @@ static void view3d_panel_operator_redo(const bContext *C, Panel *pa) } RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); - uiDefAutoButsRNA(C, pa->layout, &ptr, 2); + uiDefAutoButsRNA(pa->layout, &ptr, 2); } #endif // XXX not used diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 0691895948a..16896f75915 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -114,7 +114,7 @@ static void view3d_panel_operator_redo_buts(const bContext *C, Panel *pa, wmOper op->layout= NULL; } else - uiDefAutoButsRNA(C, pa->layout, &ptr, 1); + uiDefAutoButsRNA(pa->layout, &ptr, 1); } static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa) diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c index 240e91ad22e..c0c4cd9bc6c 100644 --- a/source/blender/ikplugin/intern/iksolver_plugin.c +++ b/source/blender/ikplugin/intern/iksolver_plugin.c @@ -50,7 +50,7 @@ /* allocates PoseTree, and links that to root bone/channel */ /* Note: detecting the IK chain is duplicate code... in drawarmature.c and in transform_conversions.c */ -static void initialize_posetree(struct Object *ob, bPoseChannel *pchan_tip) +static void initialize_posetree(struct Object *UNUSED(ob), bPoseChannel *pchan_tip) { bPoseChannel *curchan, *pchan_root=NULL, *chanlist[256], **oldchan; PoseTree *tree; diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 1d86faa5e53..a230a51e792 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -287,7 +287,6 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_int(func, "cols", 0, 0, INT_MAX, "Number of thumbnail preview columns to display", "", 0, INT_MAX); func= RNA_def_function(srna, "template_any_ID", "uiTemplateAnyID"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT); parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); @@ -297,7 +296,6 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_string(func, "text", "", 0, "", "Custom label to display in UI."); func= RNA_def_function(srna, "template_path_builder", "uiTemplatePathBuilder"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT); parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); @@ -343,17 +341,14 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "template_histogram", "uiTemplateHistogram"); RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data."); api_ui_item_rna_common(func); - RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); func= RNA_def_function(srna, "template_waveform", "uiTemplateWaveform"); RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data."); api_ui_item_rna_common(func); - RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); func= RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope"); RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data."); api_ui_item_rna_common(func); - RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); func= RNA_def_function(srna, "template_layers", "uiTemplateLayers"); api_ui_item_rna_common(func); diff --git a/source/blender/modifiers/intern/MOD_shapekey.c b/source/blender/modifiers/intern/MOD_shapekey.c index 3a3150022d8..ff2f7c5e3b7 100644 --- a/source/blender/modifiers/intern/MOD_shapekey.c +++ b/source/blender/modifiers/intern/MOD_shapekey.c @@ -77,7 +77,7 @@ static void deformVertsEM(ModifierData *md, Object *ob, static void deformMatricesEM(ModifierData *UNUSED(md), Object *ob, struct EditMesh *UNUSED(editData), DerivedMesh *UNUSED(derivedData), - float UNUSED((*vertexCos)[3]), + float (*vertexCos)[3], float (*defMats)[3][3], int numVerts) { diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c index 540a9831dce..c1f24e413c8 100644 --- a/source/blender/python/generic/mathutils.c +++ b/source/blender/python/generic/mathutils.c @@ -205,7 +205,7 @@ int _BaseMathObject_WriteIndexCallback(BaseMathObject *self, int index) /* BaseMathObject generic functions for all mathutils types */ char BaseMathObject_Owner_doc[] = "The item this is wrapping or None (readonly)."; -PyObject *BaseMathObject_getOwner(BaseMathObject *UNUSED(self), void *UNUSED(type)) +PyObject *BaseMathObject_getOwner(BaseMathObject *self, void *UNUSED(closure)) { PyObject *ret= self->cb_user ? self->cb_user : Py_None; Py_INCREF(ret); @@ -213,7 +213,7 @@ PyObject *BaseMathObject_getOwner(BaseMathObject *UNUSED(self), void *UNUSED(typ } char BaseMathObject_Wrapped_doc[] = "True when this object wraps external data (readonly).\n\n:type: boolean"; -PyObject *BaseMathObject_getWrapped(BaseMathObject *UNUSED(self), void *UNUSED(type)) +PyObject *BaseMathObject_getWrapped(BaseMathObject *self, void *UNUSED(closure)) { return PyBool_FromLong((self->wrapped == Py_WRAP) ? 1:0); } diff --git a/source/blender/python/generic/mathutils_color.c b/source/blender/python/generic/mathutils_color.c index 8380adef496..26af8a38f6d 100644 --- a/source/blender/python/generic/mathutils_color.c +++ b/source/blender/python/generic/mathutils_color.c @@ -31,7 +31,7 @@ //----------------------------------mathutils.Color() ------------------- //makes a new color for you to play with -static PyObject *Color_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds) +static PyObject *Color_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { float col[3]= {0.0f, 0.0f, 0.0f}; diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index f103cbe2d4e..197f99b989e 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -107,7 +107,7 @@ wmKeyConfig *WM_keyconfig_new (struct wmWindowManager *wm, char *idname); wmKeyConfig *WM_keyconfig_new_user(struct wmWindowManager *wm, char *idname); void WM_keyconfig_remove (struct wmWindowManager *wm, struct wmKeyConfig *keyconf); void WM_keyconfig_free (struct wmKeyConfig *keyconf); -void WM_keyconfig_userdef(struct wmWindowManager *wm); +void WM_keyconfig_userdef(void); void WM_keymap_init (struct bContext *C); void WM_keymap_free (struct wmKeyMap *keymap); diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 148932fa941..1b0870194a6 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -205,7 +205,7 @@ void WM_keymap_init(bContext *C) /* create default key config */ wm_window_keymap(wm->defaultconf); ED_spacetypes_keymap(wm->defaultconf); - WM_keyconfig_userdef(wm); + WM_keyconfig_userdef(); wm->initialized |= WM_INIT_KEYMAP; } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 334bc79b96a..f2b880bd0d5 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1894,7 +1894,7 @@ wmEventHandler *WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap } /* priorities not implemented yet, for time being just insert in begin of list */ -wmEventHandler *WM_event_add_keymap_handler_priority(ListBase *handlers, wmKeyMap *keymap, int priority) +wmEventHandler *WM_event_add_keymap_handler_priority(ListBase *handlers, wmKeyMap *keymap, int UNUSED(priority)) { wmEventHandler *handler; @@ -2167,7 +2167,7 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi /* windows store own event queues, no bContext here */ /* time is in 1000s of seconds, from ghost */ -void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int time, void *customdata) +void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int UNUSED(time), void *customdata) { wmWindow *owin; wmEvent event, *evt= win->eventstate; diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 74a8310c2b3..66d2a1efdea 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -283,7 +283,7 @@ void WM_read_file(bContext *C, char *name, ReportList *reports) /* also exit screens and editors */ wm_window_match_init(C, &wmbase); - retval= BKE_read_file(C, name, NULL, reports); + retval= BKE_read_file(C, name, reports); G.save_over = 1; /* this flag is initialized by the operator but overwritten on read. @@ -369,9 +369,9 @@ int WM_read_homefile(bContext *C, wmOperator *op) wm_window_match_init(C, &wmbase); if (!from_memory && BLI_exists(tstr)) { - success = BKE_read_file(C, tstr, NULL, NULL); + success = BKE_read_file(C, tstr, NULL); } else { - success = BKE_read_file_from_memory(C, datatoc_startup_blend, datatoc_startup_blend_size, NULL, NULL); + success = BKE_read_file_from_memory(C, datatoc_startup_blend, datatoc_startup_blend_size, NULL); if (wmbase.first == NULL) wm_clear_default_size(C); } @@ -735,7 +735,7 @@ void WM_autosave_init(wmWindowManager *wm) wm->autosavetimer= WM_event_add_timer(wm, NULL, TIMERAUTOSAVE, U.savetime*60.0); } -void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt) +void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *UNUSED(wt)) { wmWindow *win; wmEventHandler *handler; diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index e6220eac8f0..8dcf65886e4 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -121,7 +121,7 @@ void WM_gestures_remove(bContext *C) /* tweak and line gestures */ #define TWEAK_THRESHOLD 10 -int wm_gesture_evaluate(bContext *C, wmGesture *gesture) +int wm_gesture_evaluate(wmGesture *gesture) { if(gesture->type==WM_GESTURE_TWEAK) { rcti *rect= gesture->customdata; @@ -159,7 +159,7 @@ int wm_gesture_evaluate(bContext *C, wmGesture *gesture) /* ******************* gesture draw ******************* */ -static void wm_gesture_draw_rect(wmWindow *win, wmGesture *gt) +static void wm_gesture_draw_rect(wmGesture *gt) { rcti *rect= (rcti *)gt->customdata; @@ -183,7 +183,7 @@ static void wm_gesture_draw_rect(wmWindow *win, wmGesture *gt) glDisable(GL_LINE_STIPPLE); } -static void wm_gesture_draw_line(wmWindow *win, wmGesture *gt) +static void wm_gesture_draw_line(wmGesture *gt) { rcti *rect= (rcti *)gt->customdata; @@ -199,7 +199,7 @@ static void wm_gesture_draw_line(wmWindow *win, wmGesture *gt) } -static void wm_gesture_draw_circle(wmWindow *win, wmGesture *gt) +static void wm_gesture_draw_circle(wmGesture *gt) { rcti *rect= (rcti *)gt->customdata; @@ -261,7 +261,7 @@ static void draw_filled_lasso(wmGesture *gt) } } -static void wm_gesture_draw_lasso(wmWindow *win, wmGesture *gt) +static void wm_gesture_draw_lasso(wmGesture *gt) { short *lasso= (short *)gt->customdata; int i; @@ -320,23 +320,23 @@ void wm_gesture_draw(wmWindow *win) wmSubWindowSet(win, gt->swinid); if(gt->type==WM_GESTURE_RECT) - wm_gesture_draw_rect(win, gt); + wm_gesture_draw_rect(gt); else if(gt->type==WM_GESTURE_TWEAK) - wm_gesture_draw_line(win, gt); + wm_gesture_draw_line(gt); else if(gt->type==WM_GESTURE_CIRCLE) - wm_gesture_draw_circle(win, gt); + wm_gesture_draw_circle(gt); else if(gt->type==WM_GESTURE_CROSS_RECT) { if(gt->mode==1) - wm_gesture_draw_rect(win, gt); + wm_gesture_draw_rect(gt); else wm_gesture_draw_cross(win, gt); } else if(gt->type==WM_GESTURE_LINES) - wm_gesture_draw_lasso(win, gt); + wm_gesture_draw_lasso(gt); else if(gt->type==WM_GESTURE_LASSO) - wm_gesture_draw_lasso(win, gt); + wm_gesture_draw_lasso(gt); else if(gt->type==WM_GESTURE_STRAIGHTLINE) - wm_gesture_draw_line(win, gt); + wm_gesture_draw_line(gt); } } @@ -351,5 +351,3 @@ void wm_gesture_tag_redraw(bContext *C) wm_tag_redraw_overlay(win, ar); } - - diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index f1873b14232..436494be975 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -118,7 +118,7 @@ void WM_keyconfig_free(wmKeyConfig *keyconf) MEM_freeN(keyconf); } -void WM_keyconfig_userdef(wmWindowManager *wm) +void WM_keyconfig_userdef(void) { wmKeyMap *km; wmKeyMapItem *kmi; @@ -419,7 +419,7 @@ char *WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, int len) return str; } -static wmKeyMapItem *wm_keymap_item_find_handlers(const bContext *C, ListBase *handlers, const char *opname, int opcontext, IDProperty *properties, int compare_props, int hotkey, wmKeyMap **keymap_r) +static wmKeyMapItem *wm_keymap_item_find_handlers(const bContext *C, ListBase *handlers, const char *opname, int UNUSED(opcontext), IDProperty *properties, int compare_props, int hotkey, wmKeyMap **keymap_r) { wmWindowManager *wm= CTX_wm_manager(C); wmEventHandler *handler; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 3b342f440b3..ef3c8fb789e 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -619,7 +619,7 @@ void WM_operator_properties_free(PointerRNA *ptr) /* ************ default op callbacks, exported *********** */ /* invoke callback, uses enum property named "type" */ -int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *event) +int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { PropertyRNA *prop= op->type->prop; uiPopupMenu *pup; @@ -724,7 +724,7 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op) } -int WM_enum_search_invoke(bContext *C, wmOperator *op, wmEvent *event) +int WM_enum_search_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { uiPupBlock(C, wm_enum_search_menu, op); return OPERATOR_CANCELLED; @@ -751,13 +751,13 @@ int WM_operator_confirm_message(bContext *C, wmOperator *op, char *message) } -int WM_operator_confirm(bContext *C, wmOperator *op, wmEvent *event) +int WM_operator_confirm(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { return WM_operator_confirm_message(C, op, NULL); } /* op->invoke, opens fileselect if path property not set, otherwise executes */ -int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *event) +int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if (RNA_property_is_set(op->ptr, "filepath")) { return WM_operator_call(C, op); @@ -862,7 +862,7 @@ int WM_operator_winactive(bContext *C) } /* op->invoke */ -static void redo_cb(bContext *C, void *arg_op, int event) +static void redo_cb(bContext *C, void *arg_op, int UNUSED(event)) { wmOperator *lastop= arg_op; @@ -903,7 +903,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) op->layout= NULL; } else - uiDefAutoButsRNA(C, layout, &ptr, columns); + uiDefAutoButsRNA(layout, &ptr, columns); uiPopupBoundsBlock(block, 4.0f, 0, 0); uiEndBlock(C, block); @@ -922,7 +922,7 @@ static void dialog_exec_cb(bContext *C, void *arg1, void *arg2) uiPupBlockClose(C, block); } -void dialog_check_cb(bContext *C, void *op_ptr, void *dummy2) +void dialog_check_cb(bContext *C, void *op_ptr, void *UNUSED(arg)) { wmOperator *op= op_ptr; if(op->type->check) { @@ -966,7 +966,7 @@ static uiBlock *wm_block_create_dialog(bContext *C, ARegion *ar, void *userData) op->layout= NULL; } else - uiDefAutoButsRNA(C, layout, &ptr, columns); + uiDefAutoButsRNA(layout, &ptr, columns); uiBlockSetFunc(block, NULL, NULL, NULL); @@ -1014,7 +1014,7 @@ static uiBlock *wm_operator_create_ui(bContext *C, ARegion *ar, void *userData) return block; } -int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *event) +int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { int retval= OPERATOR_CANCELLED; @@ -1083,7 +1083,7 @@ static uiBlock *wm_block_create_menu(bContext *C, ARegion *ar, void *arg_op) op->layout= NULL; } else - uiDefAutoButsRNA(C, layout, op->ptr, 2); + uiDefAutoButsRNA(layout, op->ptr, 2); uiPopupBoundsBlock(block, 4.0f, 0, 0); uiEndBlock(C, block); @@ -1100,7 +1100,7 @@ static int wm_debug_menu_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int wm_debug_menu_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wm_debug_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { RNA_int_set(op->ptr, "debugval", G.rt); @@ -1127,7 +1127,7 @@ static void WM_OT_debug_menu(wmOperatorType *ot) /* ***************** Splash Screen ************************* */ -static void wm_block_splash_close(bContext *C, void *arg_block, void *arg_unused) +static void wm_block_splash_close(bContext *C, void *arg_block, void *UNUSED(arg)) { uiPupBlockClose(C, arg_block); } @@ -1136,7 +1136,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse /* XXX: hack to refresh splash screen with updated prest menu name, * since popup blocks don't get regenerated like panels do */ -void wm_block_splash_refreshmenu (bContext *C, void *arg_block, void *unused) +void wm_block_splash_refreshmenu (bContext *UNUSED(C), void *UNUSED(arg_block), void *UNUSED(arg)) { /* ugh, causes crashes in other buttons, disabling for now until * a better fix @@ -1145,7 +1145,7 @@ void wm_block_splash_refreshmenu (bContext *C, void *arg_block, void *unused) */ } -static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unused) +static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(arg)) { uiBlock *block; uiBut *but; @@ -1231,7 +1231,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse return block; } -static int wm_splash_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wm_splash_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) { uiPupBlock(C, wm_block_create_splash, NULL); @@ -1250,7 +1250,7 @@ static void WM_OT_splash(wmOperatorType *ot) /* ***************** Search menu ************************* */ -static void operator_call_cb(struct bContext *C, void *arg1, void *arg2) +static void operator_call_cb(struct bContext *C, void *UNUSED(arg1), void *arg2) { wmOperatorType *ot= arg2; @@ -1258,7 +1258,7 @@ static void operator_call_cb(struct bContext *C, void *arg1, void *arg2) WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL); } -static void operator_search_cb(const struct bContext *C, void *arg, char *str, uiSearchItems *items) +static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), char *str, uiSearchItems *items) { wmOperatorType *ot = WM_operatortype_first(); @@ -1285,7 +1285,7 @@ static void operator_search_cb(const struct bContext *C, void *arg, char *str, u } } -static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *arg_op) +static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *UNUSED(arg_op)) { static char search[256]= ""; wmEvent event; @@ -1315,15 +1315,13 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *arg_op) return block; } -static int wm_search_menu_exec(bContext *C, wmOperator *op) +static int wm_search_menu_exec(bContext *UNUSED(C), wmOperator *UNUSED(op)) { - return OPERATOR_FINISHED; } -static int wm_search_menu_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wm_search_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { - uiPupBlock(C, wm_block_search_menu, op); return OPERATOR_CANCELLED; @@ -1389,7 +1387,7 @@ static void WM_OT_window_duplicate(wmOperatorType *ot) ot->idname= "WM_OT_window_duplicate"; ot->description="Duplicate the current Blender window"; - ot->exec= wm_window_duplicate_op; + ot->exec= wm_window_duplicate_exec; ot->poll= wm_operator_winactive_normal; } @@ -1440,7 +1438,7 @@ static void open_set_use_scripts(wmOperator *op) RNA_boolean_set(op->ptr, "use_scripts", !(U.flag & USER_SCRIPT_AUTOEXEC_DISABLE)); } -static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { RNA_string_set(op->ptr, "filepath", G.sce); open_set_load_ui(op); @@ -1496,7 +1494,7 @@ static void WM_OT_open_mainfile(wmOperatorType *ot) /* **************** link/append *************** */ -static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { if(!RNA_property_is_set(op->ptr, "relative_path")) RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); @@ -1721,7 +1719,7 @@ static int wm_recover_auto_save_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int wm_recover_auto_save_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wm_recover_auto_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { char filename[FILE_MAX]; @@ -1769,7 +1767,7 @@ static void save_set_compress(wmOperator *op) } } -static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { char name[FILE_MAX]; @@ -1820,7 +1818,7 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op) } /* function used for WM_OT_save_mainfile too */ -static int blend_save_check(bContext *C, wmOperator *op) +static int blend_save_check(bContext *UNUSED(C), wmOperator *op) { char filepath[FILE_MAX]; RNA_string_get(op->ptr, "filepath", filepath); @@ -1850,7 +1848,7 @@ static void WM_OT_save_as_mainfile(wmOperatorType *ot) /* *************** save file directly ******** */ -static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { char name[FILE_MAX]; int check_existing=1; @@ -1985,7 +1983,7 @@ static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot) ot->idname= "WM_OT_window_fullscreen_toggle"; ot->description="Toggle the current window fullscreen"; - ot->exec= wm_window_fullscreen_toggle_op; + ot->exec= wm_window_fullscreen_toggle_exec; ot->poll= WM_operator_winactive; } @@ -2301,7 +2299,7 @@ static void tweak_gesture_modal(bContext *C, wmEvent *event) rect->xmax= event->x - sx; rect->ymax= event->y - sy; - if((val= wm_gesture_evaluate(C, gesture))) { + if((val= wm_gesture_evaluate(gesture))) { wmEvent event; event= *(window->eventstate); @@ -2394,7 +2392,7 @@ int WM_gesture_lines_invoke(bContext *C, wmOperator *op, wmEvent *event) } -static void gesture_lasso_apply(bContext *C, wmOperator *op, int event_type) +static void gesture_lasso_apply(bContext *C, wmOperator *op) { wmGesture *gesture= op->customdata; PointerRNA itemptr; @@ -2463,7 +2461,7 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event) case MIDDLEMOUSE: case RIGHTMOUSE: if(event->val==KM_RELEASE) { /* key release */ - gesture_lasso_apply(C, op, event->type); + gesture_lasso_apply(C, op); return OPERATOR_FINISHED; } break; @@ -2856,11 +2854,11 @@ void WM_radial_control_string(wmOperator *op, char str[], int maxlen) float v = RNA_float_get(op->ptr, "new_value"); if(mode == WM_RADIALCONTROL_SIZE) - sprintf(str, "Size: %d", (int)v); + BLI_snprintf(str, maxlen, "Size: %d", (int)v); else if(mode == WM_RADIALCONTROL_STRENGTH) - sprintf(str, "Strength: %d", (int)v); + BLI_snprintf(str, maxlen, "Strength: %d", (int)v); else if(mode == WM_RADIALCONTROL_ANGLE) - sprintf(str, "Angle: %d", (int)(v * 180.0f/M_PI)); + BLI_snprintf(str, maxlen, "Angle: %d", (int)(v * 180.0f/M_PI)); } /** Important: this doesn't define an actual operator, it @@ -3027,7 +3025,7 @@ static void WM_OT_redraw_timer(wmOperatorType *ot) /* ************************** memory statistics for testing ***************** */ -static int memory_statistics_exec(bContext *C, wmOperator *op) +static int memory_statistics_exec(bContext *UNUSED(C), wmOperator *UNUSED(op)) { MEM_printmemlist_stats(); return OPERATOR_FINISHED; @@ -3351,7 +3349,7 @@ void wm_window_keymap(wmKeyConfig *keyconf) } /* Generic itemf's for operators that take library args */ -static EnumPropertyItem *rna_id_itemf(bContext *C, PointerRNA *ptr, int *free, ID *id, int local) +static EnumPropertyItem *rna_id_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), int *free, ID *id, int local) { EnumPropertyItem *item= NULL, item_tmp; int totitem= 0; diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index 207b6cebfe6..271b32359f5 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -40,6 +40,7 @@ #include "BLI_blenlib.h" #include "BLI_math.h" +#include "BKE_utildefines.h" #include "BKE_context.h" #include "BKE_global.h" @@ -73,7 +74,7 @@ typedef struct wmSubWindow { /* ******************* open, free, set, get data ******************** */ /* not subwindow itself */ -static void wm_subwindow_free(wmSubWindow *swin) +static void wm_subwindow_free(wmSubWindow *UNUSED(swin)) { /* future fancy stuff */ } diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index c31f72d8af1..fbc77d0d06d 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -290,7 +290,7 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win) } /* belongs to below */ -static void wm_window_add_ghostwindow(bContext *C, wmWindowManager *wm, char *title, wmWindow *win) +static void wm_window_add_ghostwindow(bContext *C, char *title, wmWindow *win) { GHOST_WindowHandle ghostwin; int scr_w, scr_h, posy; @@ -384,7 +384,7 @@ void wm_window_add_ghostwindows(bContext* C, wmWindowManager *wm) win->windowstate= initialstate; useprefsize= 0; } - wm_window_add_ghostwindow(C, wm, "Blender", win); + wm_window_add_ghostwindow(C, "Blender", win); } /* happens after fileread */ if(win->eventstate==NULL) @@ -493,7 +493,7 @@ void WM_window_open_temp(bContext *C, rcti *position, int type) /* ****************** Operators ****************** */ /* operator callback */ -int wm_window_duplicate_op(bContext *C, wmOperator *op) +int wm_window_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) { wm_window_copy(C, CTX_wm_window(C)); WM_check(C); @@ -505,7 +505,7 @@ int wm_window_duplicate_op(bContext *C, wmOperator *op) /* fullscreen operator callback */ -int wm_window_fullscreen_toggle_op(bContext *C, wmOperator *op) +int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { wmWindow *window= CTX_wm_window(C); GHOST_TWindowState state = GHOST_GetWindowState(window->ghostwin); @@ -895,7 +895,7 @@ void wm_window_process_events(const bContext *C) PIL_sleep_ms(5); } -void wm_window_process_events_nosleep(const bContext *C) +void wm_window_process_events_nosleep(void) { if(GHOST_ProcessEvents(g_system, 0)) GHOST_DispatchEvents(g_system); @@ -943,7 +943,7 @@ void wm_ghost_exit(void) /* **************** timer ********************** */ /* to (de)activate running timers temporary */ -void WM_event_timer_sleep(wmWindowManager *wm, wmWindow *win, wmTimer *timer, int dosleep) +void WM_event_timer_sleep(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer, int dosleep) { wmTimer *wt; @@ -971,7 +971,7 @@ wmTimer *WM_event_add_timer(wmWindowManager *wm, wmWindow *win, int event_type, return wt; } -void WM_event_remove_timer(wmWindowManager *wm, wmWindow *win, wmTimer *timer) +void WM_event_remove_timer(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer) { wmTimer *wt; diff --git a/source/blender/windowmanager/wm.h b/source/blender/windowmanager/wm.h index 7228a6dcd93..e1ca1793c04 100644 --- a/source/blender/windowmanager/wm.h +++ b/source/blender/windowmanager/wm.h @@ -61,7 +61,7 @@ void wm_tweakevent_test(bContext *C, wmEvent *event, int action); /* wm_gesture.c */ #define WM_LASSO_MIN_POINTS 1024 void wm_gesture_draw(struct wmWindow *win); -int wm_gesture_evaluate(bContext *C, wmGesture *gesture); +int wm_gesture_evaluate(wmGesture *gesture); void wm_gesture_tag_redraw(bContext *C); /* wm_jobs.c */ diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h index 5a425df01e1..b0aec50e228 100644 --- a/source/blender/windowmanager/wm_window.h +++ b/source/blender/windowmanager/wm_window.h @@ -45,7 +45,7 @@ void wm_window_close (bContext *C, wmWindowManager *wm, wmWindow *win); void wm_window_title (wmWindowManager *wm, wmWindow *win); void wm_window_add_ghostwindows (bContext *C, wmWindowManager *wm); void wm_window_process_events (const bContext *C); -void wm_window_process_events_nosleep(const bContext *C); +void wm_window_process_events_nosleep(void); void wm_window_make_drawable(bContext *C, wmWindow *win); @@ -65,8 +65,8 @@ wmWindow *wm_window_copy (bContext *C, wmWindow *winorig); void wm_window_testbreak (void); /* *************** window operators ************** */ -int wm_window_duplicate_op (bContext *C, struct wmOperator *op); -int wm_window_fullscreen_toggle_op(bContext *C, struct wmOperator *op); +int wm_window_duplicate_exec(bContext *C, struct wmOperator *op); +int wm_window_fullscreen_toggle_exec(bContext *C, struct wmOperator *op); #endif /* WM_WINDOW_H */ -- cgit v1.2.3 From d977da3b2ca319da74cb43845b440ce5f6dda791 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 16 Oct 2010 03:13:40 +0000 Subject: Bugfix #24276: Unable to set extrapolation on a per curve basis Selected-curves only flag was missing. --- source/blender/editors/space_action/action_edit.c | 2 +- source/blender/editors/space_graph/graph_edit.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 86adc3d9e8c..b0704e76138 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -791,7 +791,7 @@ static void setexpo_action_keys(bAnimContext *ac, short mode) int filter; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through setting mode per F-Curve */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 41c653048e8..46e7840cec8 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1205,7 +1205,7 @@ static void setexpo_graph_keys(bAnimContext *ac, short mode) int filter; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through setting mode per F-Curve */ -- cgit v1.2.3 From 00e3ef9b132db3c9136322bd7de1e50c862e883c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 16 Oct 2010 04:14:26 +0000 Subject: Bugfix #24143: Edit NLA Strips When editing an action used by a NLA strip and editing it 'in place' (controlled by pin icon on green 'tweaking' channel), the animation would only get played back in the action's original frame range while the keyframes were still displayed in the strip-altered positions. --- source/blender/blenkernel/intern/anim_sys.c | 34 ++++++++++++++++++----------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 10c2c1801cb..ea0b2945821 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1607,7 +1607,7 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) /* 1. get the stack of strips to evaluate at current time (influence calculated here) */ for (nlt=adt->nla_tracks.first; nlt; nlt=nlt->next, track_index++) { - /* if tweaking is on and this strip is the tweaking track, stop on this one */ + /* stop here if tweaking is on and this strip is the tweaking track (it will be the first one that's 'disabled')... */ if ((adt->flag & ADT_NLA_EDIT_ON) && (nlt->flag & NLATRACK_DISABLED)) break; @@ -1634,22 +1634,30 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) */ if ((adt->action) && !(adt->flag & ADT_NLA_SOLO_TRACK)) { /* if there are strips, evaluate action as per NLA rules */ - if (has_strips) { + if ((has_strips) || (adt->actstrip)) { /* make dummy NLA strip, and add that to the stack */ memset(&dummy_strip, 0, sizeof(NlaStrip)); dummy_trackslist.first= dummy_trackslist.last= &dummy_strip; - dummy_strip.act= adt->action; - dummy_strip.remap= adt->remap; - - /* action range is calculated taking F-Modifiers into account (which making new strips doesn't do due to the troublesome nature of that) */ - calc_action_range(dummy_strip.act, &dummy_strip.actstart, &dummy_strip.actend, 1); - dummy_strip.start = dummy_strip.actstart; - dummy_strip.end = (IS_EQ(dummy_strip.actstart, dummy_strip.actend)) ? (dummy_strip.actstart + 1.0f): (dummy_strip.actend); - - dummy_strip.blendmode= adt->act_blendmode; - dummy_strip.extendmode= adt->act_extendmode; - dummy_strip.influence= adt->act_influence; + if ((nlt) && !(adt->flag & ADT_NLA_EDIT_NOMAP)) { + /* edit active action in-place according to its active strip, so copy the data */ + memcpy(&dummy_strip, adt->actstrip, sizeof(NlaStrip)); + dummy_strip.next = dummy_strip.prev = NULL; + } + else { + /* set settings of dummy NLA strip from AnimData settings */ + dummy_strip.act= adt->action; + dummy_strip.remap= adt->remap; + + /* action range is calculated taking F-Modifiers into account (which making new strips doesn't do due to the troublesome nature of that) */ + calc_action_range(dummy_strip.act, &dummy_strip.actstart, &dummy_strip.actend, 1); + dummy_strip.start = dummy_strip.actstart; + dummy_strip.end = (IS_EQ(dummy_strip.actstart, dummy_strip.actend)) ? (dummy_strip.actstart + 1.0f): (dummy_strip.actend); + + dummy_strip.blendmode= adt->act_blendmode; + dummy_strip.extendmode= adt->act_extendmode; + dummy_strip.influence= adt->act_influence; + } /* add this to our list of evaluation strips */ nlastrips_ctime_get_strip(&estrips, &dummy_trackslist, -1, ctime); -- cgit v1.2.3 From ad65cd59870df1e59a5960c7c355c2c888a8141a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 16 Oct 2010 05:07:33 +0000 Subject: Bugfix #24099: nla content moves out of sync - with fix Thanks Shane Ambler (sambler) for the patch! This kind of follows on from a report that I think was closed prematurely - #22775 - I can't find any reference to an outstanding todo that relates to it. When resizing the nla editor the channel names and the main area get out of sync. When toggling back from fullscreen the content is hidden off the top of the area requiring scrolling to see it. The dopesheet displays similar problems but after fixing the ui_view2d_sync call it appears to behave as if the v2d.keepofs has been set for the most part. Two areas seem to be related to this - the first is calls to UI_view2d_sync used for these two views use the wrong flags. The other is v2d.keepofs not being set. (dopesheet has less issue here but I think it is meant to be set the same as nla) --- source/blender/editors/space_action/action_draw.c | 4 ++-- source/blender/editors/space_action/space_action.c | 5 +++-- source/blender/editors/space_nla/nla_draw.c | 4 ++-- source/blender/editors/space_nla/space_nla.c | 5 +++-- 4 files changed, 10 insertions(+), 8 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index d2067790b2f..d9093c5db85 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -90,8 +90,8 @@ void draw_channel_names(bContext *C, bAnimContext *ac, SpaceAction *saction, ARe */ v2d->tot.ymin= (float)(-height); } - /* need to do a view-sync here, so that the keys area doesn't jump around */ - UI_view2d_sync(NULL, ac->sa, v2d, V2D_VIEWSYNC_AREA_VERTICAL); + /* need to do a view-sync here, so that the keys area doesn't jump around (it must copy this) */ + UI_view2d_sync(NULL, ac->sa, v2d, V2D_LOCK_COPY); /* loop through channels, and set up drawing depending on their type */ { /* first pass: just the standard GL-drawing for backdrop + text */ diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 01ae28a20d6..199d06ccb82 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -101,16 +101,17 @@ static SpaceLink *action_new(const bContext *C) ar->v2d.cur = ar->v2d.tot; ar->v2d.min[0]= 0.0f; - ar->v2d.min[1]= 0.0f; + ar->v2d.min[1]= 0.0f; ar->v2d.max[0]= MAXFRAMEF; - ar->v2d.max[1]= FLT_MAX; + ar->v2d.max[1]= FLT_MAX; ar->v2d.minzoom= 0.01f; ar->v2d.maxzoom= 50; ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); ar->v2d.scroll |= (V2D_SCROLL_RIGHT); ar->v2d.keepzoom= V2D_LOCKZOOM_Y; + ar->v2d.keepofs= V2D_KEEPOFS_Y; ar->v2d.align= V2D_ALIGN_NO_POS_Y; ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index ef9c46c8042..7df9db11472 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -477,8 +477,6 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) * (NOTE: this is ok here, the configuration is pretty straightforward) */ v2d->tot.ymin= (float)(-height); - /* need to do a view-sync here, so that the strips area doesn't jump around */ - UI_view2d_sync(NULL, ac->sa, v2d, V2D_VIEWSYNC_AREA_VERTICAL); /* loop through channels, and set up drawing depending on their type */ y= (float)(-NLACHANNEL_HEIGHT); @@ -837,6 +835,8 @@ void draw_nla_channel_list (bContext *C, bAnimContext *ac, SpaceNla *snla, ARegi * (NOTE: this is ok here, the configuration is pretty straightforward) */ v2d->tot.ymin= (float)(-height); + /* need to do a view-sync here, so that the keys area doesn't jump around (it must copy this) */ + UI_view2d_sync(NULL, ac->sa, v2d, V2D_LOCK_COPY); /* draw channels */ { /* first pass: backdrops + oldstyle drawing */ diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 2ae47ddbc7f..ad6e183995f 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -148,16 +148,17 @@ static SpaceLink *nla_new(const bContext *C) ar->v2d.cur = ar->v2d.tot; ar->v2d.min[0]= 0.0f; - ar->v2d.min[1]= 0.0f; + ar->v2d.min[1]= 0.0f; ar->v2d.max[0]= MAXFRAMEF; - ar->v2d.max[1]= 10000.0f; + ar->v2d.max[1]= 10000.0f; ar->v2d.minzoom= 0.01f; ar->v2d.maxzoom= 50; ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); ar->v2d.scroll |= (V2D_SCROLL_RIGHT); ar->v2d.keepzoom= V2D_LOCKZOOM_Y; + ar->v2d.keepofs= V2D_KEEPOFS_Y; ar->v2d.align= V2D_ALIGN_NO_POS_Y; ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; -- cgit v1.2.3 From 03e6bb7ede4ac5e45ba8db7233ba775a07b27ced Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Oct 2010 05:12:31 +0000 Subject: patch for bug [#24253] r32218 breaks outliner icon drawing provided by Shane Ambler (sambler) with some changes. --- source/blender/editors/interface/interface_icons.c | 41 +++++++++++++++------- 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index cbd4939b1b1..2da54b492e6 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -843,7 +843,7 @@ static void icon_set_image(bContext *C, ID *id, PreviewImage* prv_img, int miple prv_img->w[miplevel], prv_img->h[miplevel]); } -static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh, unsigned int *rect, float alpha, float *rgb) +static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh, unsigned int *rect, float alpha, float *rgb, short is_preview) { /* modulate color */ if(alpha != 1.0f) @@ -855,6 +855,11 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), glPixelTransferf(GL_BLUE_SCALE, rgb[2]); } + if(is_preview == 0) { + /* position */ + glRasterPos2f(x,y); + } + /* draw */ if((w<1 || h<1)) { // XXX - TODO 2.5 verify whether this case can happen @@ -876,13 +881,25 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), /* scale it */ IMB_scaleImBuf(ima, w, h); - glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, ima->rect); - + + if(is_preview) { + glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, ima->rect); + } + else { + glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, ima->rect); + } + IMB_freeImBuf(ima); } } - else - glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect); + else { + if(is_preview) { + glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect); + } + else { + glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect); + } + } /* restore color */ if(alpha != 0.0f) @@ -938,7 +955,7 @@ static int preview_size(int miplevel) return 0; } -static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, float *rgb, int miplevel, int draw_size, int UNUSED(nocreate)) +static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, float *rgb, int miplevel, int draw_size, int UNUSED(nocreate), int is_preview) { Icon *icon = NULL; DrawInfo *di = NULL; @@ -981,7 +998,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al if(!iimg->rect) return; /* something has gone wrong! */ - icon_draw_rect(x, y, w, h, aspect, iimg->w, iimg->h, iimg->rect, alpha, rgb); + icon_draw_rect(x, y, w, h, aspect, iimg->w, iimg->h, iimg->rect, alpha, rgb, is_preview); } else if(di->type == ICON_TYPE_PREVIEW) { PreviewImage* pi = BKE_previewimg_get((ID*)icon->obj); @@ -992,7 +1009,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al /* preview images use premul alpha ... */ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - icon_draw_rect(x, y, w, h, aspect, pi->w[miplevel], pi->h[miplevel], pi->rect[miplevel], 1.0f, NULL); + icon_draw_rect(x, y, w, h, aspect, pi->w[miplevel], pi->h[miplevel], pi->rect[miplevel], 1.0f, NULL, is_preview); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } } @@ -1082,7 +1099,7 @@ int ui_id_icon_get(bContext *C, ID *id, int preview) static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, float alpha, int miplevel, int nocreate) { int draw_size = preview_size(miplevel); - icon_draw_size(x, y, icon_id, aspect, alpha, NULL, miplevel, draw_size, nocreate); + icon_draw_size(x, y, icon_id, aspect, alpha, NULL, miplevel, draw_size, nocreate, FALSE); } void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect, float alpha) @@ -1093,7 +1110,7 @@ void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect, float alph void UI_icon_draw_aspect_color(float x, float y, int icon_id, float aspect, float *rgb) { int draw_size = preview_size(PREVIEW_MIPMAP_ZERO); - icon_draw_size(x, y, icon_id, aspect, 1.0f, rgb, PREVIEW_MIPMAP_ZERO, draw_size, 0); + icon_draw_size(x, y, icon_id, aspect, 1.0f, rgb, PREVIEW_MIPMAP_ZERO, draw_size, FALSE, FALSE); } void UI_icon_draw(float x, float y, int icon_id) @@ -1103,7 +1120,7 @@ void UI_icon_draw(float x, float y, int icon_id) void UI_icon_draw_size(float x, float y, int size, int icon_id, float alpha) { - icon_draw_size(x, y, icon_id, 1.0f, alpha, NULL, 0, size, 1); + icon_draw_size(x, y, icon_id, 1.0f, alpha, NULL, PREVIEW_MIPMAP_ZERO, size, TRUE, FALSE); } void UI_icon_draw_preview(float x, float y, int icon_id) @@ -1118,6 +1135,6 @@ void UI_icon_draw_preview_aspect(float x, float y, int icon_id, float aspect) void UI_icon_draw_preview_aspect_size(float x, float y, int icon_id, float aspect, int size) { - icon_draw_size(x, y, icon_id, aspect, 1.0f, NULL, PREVIEW_MIPMAP_LARGE, size, 0); + icon_draw_size(x, y, icon_id, aspect, 1.0f, NULL, PREVIEW_MIPMAP_LARGE, size, FALSE, TRUE); } -- cgit v1.2.3 From e5fbd93cecc8527467cfe33a4c74a252c3d39828 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Oct 2010 08:03:28 +0000 Subject: editors/space_* build without unused args warnings --- source/blender/blenkernel/BKE_sequencer.h | 2 +- source/blender/blenkernel/intern/anim_sys.c | 10 +- source/blender/blenkernel/intern/sequencer.c | 4 +- source/blender/editors/space_action/action_draw.c | 2 +- .../blender/editors/space_action/action_intern.h | 2 +- source/blender/editors/space_action/space_action.c | 11 +- source/blender/editors/space_api/spacetypes.c | 11 +- .../editors/space_buttons/buttons_context.c | 16 +- .../blender/editors/space_buttons/buttons_header.c | 3 +- .../blender/editors/space_buttons/space_buttons.c | 6 +- source/blender/editors/space_file/file_draw.c | 4 +- source/blender/editors/space_file/file_ops.c | 2 +- source/blender/editors/space_file/file_panels.c | 4 +- source/blender/editors/space_file/filelist.c | 6 +- source/blender/editors/space_file/filesel.c | 4 +- source/blender/editors/space_file/space_file.c | 8 +- source/blender/editors/space_file/writeimage.c | 8 +- source/blender/editors/space_graph/graph_draw.c | 52 ++--- source/blender/editors/space_graph/graph_edit.c | 2 +- source/blender/editors/space_graph/graph_intern.h | 4 +- source/blender/editors/space_graph/graph_select.c | 4 +- source/blender/editors/space_graph/space_graph.c | 9 +- source/blender/editors/space_info/space_info.c | 14 +- source/blender/editors/space_logic/logic_buttons.c | 2 +- source/blender/editors/space_logic/logic_window.c | 36 ++-- source/blender/editors/space_logic/space_logic.c | 14 +- source/blender/editors/space_nla/nla_buttons.c | 10 +- source/blender/editors/space_nla/nla_draw.c | 10 +- source/blender/editors/space_nla/nla_edit.c | 4 +- source/blender/editors/space_nla/nla_intern.h | 2 +- source/blender/editors/space_nla/nla_ops.c | 4 +- source/blender/editors/space_nla/space_nla.c | 7 +- source/blender/editors/space_node/node_buttons.c | 4 +- source/blender/editors/space_node/node_header.c | 2 +- source/blender/editors/space_node/node_state.c | 6 +- source/blender/editors/space_node/space_node.c | 10 +- source/blender/editors/space_outliner/outliner.c | 233 +++++++++++---------- .../editors/space_outliner/space_outliner.c | 12 +- .../blender/editors/space_script/script_header.c | 8 +- source/blender/editors/space_script/space_script.c | 8 +- .../editors/space_sequencer/sequencer_buttons.c | 6 +- .../editors/space_sequencer/sequencer_draw.c | 22 +- .../editors/space_sequencer/sequencer_edit.c | 40 ++-- .../editors/space_sequencer/sequencer_select.c | 2 +- .../editors/space_sequencer/space_sequencer.c | 12 +- source/blender/editors/space_sound/sound_header.c | 7 +- source/blender/editors/space_sound/space_sound.c | 12 +- source/blender/editors/space_text/space_text.c | 10 +- source/blender/editors/space_text/text_draw.c | 10 +- source/blender/editors/space_text/text_intern.h | 2 +- source/blender/editors/space_text/text_ops.c | 18 +- source/blender/editors/space_text/text_python.c | 14 +- source/blender/editors/space_time/space_time.c | 24 +-- .../editors/space_userpref/space_userpref.c | 17 +- source/blender/editors/space_view3d/view3d_edit.c | 1 - source/blender/makesrna/intern/rna_sequencer.c | 6 +- source/blender/render/intern/source/pipeline.c | 2 +- 57 files changed, 378 insertions(+), 387 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 252c9fee8f7..8cf541ae03a 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -156,7 +156,7 @@ void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown, i void calc_sequence(struct Scene *scene, struct Sequence *seq); void calc_sequence_disp(struct Scene *scene, struct Sequence *seq); void new_tstripdata(struct Sequence *seq); -void reload_sequence_new_file(struct Main *bmain, struct Scene *scene, struct Sequence * seq, int lock_range); +void reload_sequence_new_file(struct Scene *scene, struct Sequence * seq, int lock_range); void sort_seq(struct Scene *scene); void build_seqar_cb(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq, int (*test_func)(struct Sequence * seq)); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index ea0b2945821..22f5ac181f1 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -565,7 +565,7 @@ void BKE_all_animdata_fix_paths_rename (char *prefix, char *oldName, char *newNa /* Find the first path that matches the given criteria */ // TODO: do we want some method to perform partial matches too? -KS_Path *BKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, int group_mode) +KS_Path *BKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, int UNUSED(group_mode)) { KS_Path *ksp; @@ -767,7 +767,7 @@ void BKE_keyingsets_free (ListBase *list) * - path: original path string (as stored in F-Curve data) * - dst: destination string to write data to */ -static short animsys_remap_path (AnimMapper *remap, char *path, char **dst) +static short animsys_remap_path (AnimMapper *UNUSED(remap), char *path, char **dst) { /* is there a valid remapping table to use? */ //if (remap) { @@ -1693,7 +1693,7 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) /* Clear all overides */ /* Add or get existing Override for given setting */ -AnimOverride *BKE_animsys_validate_override (PointerRNA *ptr, char *path, int array_index) +AnimOverride *BKE_animsys_validate_override (PointerRNA *UNUSED(ptr), char *UNUSED(path), int UNUSED(array_index)) { // FIXME: need to define how to get overrides return NULL; @@ -1702,7 +1702,7 @@ AnimOverride *BKE_animsys_validate_override (PointerRNA *ptr, char *path, int ar /* -------------------- */ /* Evaluate Overrides */ -static void animsys_evaluate_overrides (PointerRNA *ptr, AnimData *adt, float ctime) +static void animsys_evaluate_overrides (PointerRNA *ptr, AnimData *adt) { AnimOverride *aor; @@ -1801,7 +1801,7 @@ void BKE_animsys_evaluate_animdata (ID *id, AnimData *adt, float ctime, short re * - Overrides are cleared upon frame change and/or keyframing * - It is best that we execute this everytime, so that no errors are likely to occur. */ - animsys_evaluate_overrides(&id_ptr, adt, ctime); + animsys_evaluate_overrides(&id_ptr, adt); /* clear recalc flag now */ adt->recalc= 0; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 040ca832a80..dcd411409f9 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -554,7 +554,7 @@ void calc_sequence(Scene *scene, Sequence *seq) } /* note: caller should run calc_sequence(scene, seq) after */ -void reload_sequence_new_file(Main *bmain, Scene *scene, Sequence * seq, int lock_range) +void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range) { char str[FILE_MAXDIR+FILE_MAXFILE]; int prev_startdisp, prev_enddisp; @@ -621,7 +621,7 @@ void reload_sequence_new_file(Main *bmain, Scene *scene, Sequence * seq, int loc seq->strip->len = seq->len; } else if (seq->type == SEQ_SCENE) { /* 'seq->scenenr' should be replaced with something more reliable */ - Scene * sce = bmain->scene.first; + Scene * sce = G.main->scene.first; int nr = 1; while(sce) { diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index d9093c5db85..ce9a96af38c 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -63,7 +63,7 @@ /* Channel List */ /* left hand part */ -void draw_channel_names(bContext *C, bAnimContext *ac, SpaceAction *saction, ARegion *ar) +void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h index b02e95ac138..cc363b76479 100644 --- a/source/blender/editors/space_action/action_intern.h +++ b/source/blender/editors/space_action/action_intern.h @@ -41,7 +41,7 @@ struct bAnimListElem; /* ***************************************** */ /* action_draw.c */ -void draw_channel_names(struct bContext *C, struct bAnimContext *ac, struct SpaceAction *saction, struct ARegion *ar); +void draw_channel_names(struct bContext *C, struct bAnimContext *ac, struct ARegion *ar); void draw_channel_strips(struct bAnimContext *ac, struct SpaceAction *saction, struct ARegion *ar); struct ActKeysInc *init_aki_data(struct bAnimContext *ac, struct bAnimListElem *ale); diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 199d06ccb82..bb3b40fbf9b 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -119,7 +119,7 @@ static SpaceLink *action_new(const bContext *C) } /* not spacelink itself */ -static void action_free(SpaceLink *sl) +static void action_free(SpaceLink *UNUSED(sl)) { // SpaceAction *saction= (SpaceAction*) sl; @@ -127,7 +127,7 @@ static void action_free(SpaceLink *sl) /* spacetype; init callback */ -static void action_init(struct wmWindowManager *wm, ScrArea *sa) +static void action_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) { SpaceAction *saction = sa->spacedata.first; saction->flag |= SACTION_TEMP_NEEDCHANSYNC; @@ -220,7 +220,6 @@ static void action_channel_area_init(wmWindowManager *wm, ARegion *ar) static void action_channel_area_draw(const bContext *C, ARegion *ar) { /* draw entirely, view changes should be handled here */ - SpaceAction *saction= CTX_wm_space_action(C); bAnimContext ac; View2D *v2d= &ar->v2d; View2DScrollers *scrollers; @@ -233,7 +232,7 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar) /* data */ if (ANIM_animdata_get_context(C, &ac)) { - draw_channel_names((bContext *)C, &ac, saction, ar); + draw_channel_names((bContext *)C, &ac, ar); } /* reset view matrix */ @@ -247,7 +246,7 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar) /* add handlers, stuff you only do once or on area/region changes */ -static void action_header_area_init(wmWindowManager *wm, ARegion *ar) +static void action_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } @@ -418,7 +417,7 @@ static void action_header_area_listener(ARegion *ar, wmNotifier *wmn) static void action_refresh(const bContext *C, ScrArea *sa) { - SpaceAction *saction= CTX_wm_space_action(C); + SpaceAction *saction= (SpaceAction *)sa->spacedata.first; /* update the state of the animchannels in response to changes from the data they represent * NOTE: the temp flag is used to indicate when this needs to be done, and will be cleared once handled diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 2140c59da67..0d0d3713723 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -30,6 +30,7 @@ #include "DNA_object_types.h" #include "DNA_windowmanager_types.h" +#include "BKE_utildefines.h" #include "BKE_context.h" #include "BKE_screen.h" @@ -224,19 +225,19 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type) /* ********************* space template *********************** */ /* allocate and init some vars */ -static SpaceLink *xxx_new(const bContext *C) +static SpaceLink *xxx_new(const bContext *UNUSED(C)) { return NULL; } /* not spacelink itself */ -static void xxx_free(SpaceLink *sl) +static void xxx_free(SpaceLink *UNUSED(sl)) { } /* spacetype; init callback for usage, should be redoable */ -static void xxx_init(wmWindowManager *wm, ScrArea *sa) +static void xxx_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { /* link area to SpaceXXX struct */ @@ -246,7 +247,7 @@ static void xxx_init(wmWindowManager *wm, ScrArea *sa) /* add types to regions */ } -static SpaceLink *xxx_duplicate(SpaceLink *sl) +static SpaceLink *xxx_duplicate(SpaceLink *UNUSED(sl)) { return NULL; @@ -257,7 +258,7 @@ static void xxx_operatortypes(void) /* register operator types for this space */ } -static void xxx_keymap(wmKeyConfig *keyconf) +static void xxx_keymap(wmKeyConfig *UNUSED(keyconf)) { /* add default items to keymap */ } diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 343237dee5e..2d16bb6bc81 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -323,7 +323,7 @@ static int buttons_context_path_particle(ButsContextPath *path) return 0; } -static int buttons_context_path_brush(const bContext *C, ButsContextPath *path) +static int buttons_context_path_brush(ButsContextPath *path) { Scene *scene; Brush *br= NULL; @@ -352,7 +352,7 @@ static int buttons_context_path_brush(const bContext *C, ButsContextPath *path) return 0; } -static int buttons_context_path_texture(const bContext *C, ButsContextPath *path) +static int buttons_context_path_texture(ButsContextPath *path) { Material *ma; Lamp *la; @@ -367,7 +367,7 @@ static int buttons_context_path_texture(const bContext *C, ButsContextPath *path return 1; } /* try brush */ - if((path->flag & SB_BRUSH_TEX) && buttons_context_path_brush(C, path)) { + if((path->flag & SB_BRUSH_TEX) && buttons_context_path_brush(path)) { br= path->ptr[path->len-1].data; if(br) { @@ -416,7 +416,7 @@ static int buttons_context_path_texture(const bContext *C, ButsContextPath *path } /* try brushes again in case of no material, lamp, etc */ path->len = orig_len; - if(buttons_context_path_brush(C, path)) { + if(buttons_context_path_brush(path)) { br= path->ptr[path->len-1].data; if(br) { @@ -485,7 +485,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma found= buttons_context_path_material(path); break; case BCONTEXT_TEXTURE: - found= buttons_context_path_texture(C, path); + found= buttons_context_path_texture(path); break; case BCONTEXT_BONE: found= buttons_context_path_bone(path); @@ -515,7 +515,7 @@ static int buttons_shading_context(const bContext *C, int mainb) return 0; } -static int buttons_shading_new_context(const bContext *C, int flag, int mainb) +static int buttons_shading_new_context(const bContext *C, int flag) { Object *ob= CTX_data_active_object(C); @@ -568,7 +568,7 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts) if((flag & (1 << sbuts->mainb)) == 0) { if(sbuts->flag & SB_SHADING_CONTEXT) { /* try to keep showing shading related buttons */ - sbuts->mainb= buttons_shading_new_context(C, flag, sbuts->mainb); + sbuts->mainb= buttons_shading_new_context(C, flag); } else if(flag & BCONTEXT_OBJECT) { sbuts->mainb= BCONTEXT_OBJECT; @@ -821,7 +821,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r /************************* Drawing the Path ************************/ -static void pin_cb(bContext *C, void *arg1, void *arg2) +static void pin_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) { SpaceButs *sbuts= CTX_wm_space_buts(C); diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index ab756b638fa..9071d9f27d9 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -33,6 +33,7 @@ #include "BLI_blenlib.h" +#include "BKE_utildefines.h" #include "BKE_context.h" #include "ED_screen.h" @@ -50,7 +51,7 @@ #define B_CONTEXT_SWITCH 101 #define B_BUTSPREVIEW 102 -static void do_buttons_buttons(bContext *C, void *arg, int event) +static void do_buttons_buttons(bContext *C, void *UNUSED(arg), int event) { SpaceButs *sbuts= CTX_wm_space_buts(C); diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 5927a7473e2..44138119f7a 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -55,7 +55,7 @@ /* ******************** default callbacks for buttons space ***************** */ -static SpaceLink *buttons_new(const bContext *C) +static SpaceLink *buttons_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceButs *sbuts; @@ -103,7 +103,7 @@ static void buttons_free(SpaceLink *sl) } /* spacetype; init callback */ -static void buttons_init(struct wmWindowManager *wm, ScrArea *sa) +static void buttons_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) { SpaceButs *sbuts= sa->spacedata.first; @@ -191,7 +191,7 @@ void buttons_keymap(struct wmKeyConfig *keyconf) } /* add handlers, stuff you only do once or on area/region changes */ -static void buttons_header_area_init(wmWindowManager *wm, ARegion *ar) +static void buttons_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); } diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 0f627bda3dc..421b14e5bbe 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -79,7 +79,7 @@ enum { } eFile_ButEvents; -static void do_file_buttons(bContext *C, void *arg, int event) +static void do_file_buttons(bContext *C, void *UNUSED(arg), int event) { switch(event) { case B_FS_FILENAME: @@ -433,7 +433,7 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int } } -static void renamebutton_cb(bContext *C, void *arg1, char *oldname) +static void renamebutton_cb(bContext *C, void *UNUSED(arg1), char *oldname) { char newname[FILE_MAX+12]; char orgname[FILE_MAX+12]; diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 5184e6b7fc0..6dfdcfd430a 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -613,7 +613,7 @@ void file_operator_to_sfile(SpaceFile *sfile, wmOperator *op) /* XXX, files and dirs updates missing, not really so important though */ } -void file_draw_check_cb(bContext *C, void *dummy1, void *dummy2) +void file_draw_check_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) { SpaceFile *sfile= CTX_wm_space_file(C); wmOperator *op= sfile->op; diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 33d740e18a6..9096b9eed27 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -49,7 +49,7 @@ #include -static void file_panel_cb(bContext *C, void *arg_entry, void *arg_unused) +static void file_panel_cb(bContext *C, void *arg_entry, void *UNUSED(arg_v)) { PointerRNA ptr; char *entry= (char*)arg_entry; @@ -151,7 +151,7 @@ static void file_panel_recent(const bContext *C, Panel *pa) } -static int file_panel_operator_poll(const bContext *C, PanelType *pt) +static int file_panel_operator_poll(const bContext *C, PanelType *UNUSED(pt)) { SpaceFile *sfile= CTX_wm_space_file(C); return (sfile && sfile->op); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index eba0df9f963..1b997ade956 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -295,7 +295,7 @@ static int is_hidden_file(const char* filename, short hide_dot) return is_hidden; } -static int is_filtered_file(struct direntry* file, const char* dir, unsigned int filter, short hide_dot) +static int is_filtered_file(struct direntry* file, const char* UNUSED(dir), unsigned int filter, short hide_dot) { int is_filtered=0; if (filter) { @@ -324,7 +324,7 @@ static int is_filtered_lib(struct direntry* file, const char* dir, unsigned int return is_filtered; } -static int is_filtered_main(struct direntry* file, const char* dir, unsigned int filter, short hide_dot) +static int is_filtered_main(struct direntry* file, const char* UNUSED(dir), unsigned int UNUSED(filter), short hide_dot) { return !is_hidden_file(file->relname, hide_dot); } @@ -1145,7 +1145,7 @@ static void thumbnail_joblist_free(ThumbnailJob *tj) BLI_freelistN(&tj->loadimages); } -static void thumbnails_startjob(void *tjv, short *stop, short *do_update, float *progress) +static void thumbnails_startjob(void *tjv, short *stop, short *do_update, float *UNUSED(progress)) { ThumbnailJob *tj= tjv; FileImage* limg = tj->loadimages.first; diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 7192870bcc8..b36cfe66a36 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -463,7 +463,7 @@ int file_select_match(struct SpaceFile *sfile, const char *pattern) return match; } -void autocomplete_directory(struct bContext *C, char *str, void *arg_v) +void autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v)) { SpaceFile *sfile= CTX_wm_space_file(C); @@ -510,7 +510,7 @@ void autocomplete_directory(struct bContext *C, char *str, void *arg_v) } } -void autocomplete_file(struct bContext *C, char *str, void *arg_v) +void autocomplete_file(struct bContext *C, char *str, void *UNUSED(arg_v)) { SpaceFile *sfile= CTX_wm_space_file(C); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 52805c39816..92244165dc1 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -66,7 +66,7 @@ /* ******************** default callbacks for file space ***************** */ -static SpaceLink *file_new(const bContext *C) +static SpaceLink *file_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceFile *sfile; @@ -143,7 +143,7 @@ static void file_free(SpaceLink *sl) /* spacetype; init callback, area size changes, screen set, etc */ -static void file_init(struct wmWindowManager *wm, ScrArea *sa) +static void file_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) { SpaceFile *sfile= (SpaceFile*)sa->spacedata.first; //printf("file_init\n"); @@ -178,7 +178,7 @@ static SpaceLink *file_duplicate(SpaceLink *sl) return (SpaceLink *)sfilen; } -static void file_refresh(const bContext *C, ScrArea *sa) +static void file_refresh(const bContext *C, ScrArea *UNUSED(sa)) { SpaceFile *sfile= CTX_wm_space_file(C); FileSelectParams *params = ED_fileselect_get_params(sfile); @@ -457,7 +457,7 @@ static void file_channel_area_draw(const bContext *C, ARegion *ar) ED_region_panels(C, ar, 1, NULL, -1); } -static void file_channel_area_listener(ARegion *ar, wmNotifier *wmn) +static void file_channel_area_listener(ARegion *UNUSED(ar), wmNotifier *wmn) { /* context changes */ switch(wmn->category) { diff --git a/source/blender/editors/space_file/writeimage.c b/source/blender/editors/space_file/writeimage.c index b69bfdc0231..1277ad9d69c 100644 --- a/source/blender/editors/space_file/writeimage.c +++ b/source/blender/editors/space_file/writeimage.c @@ -48,10 +48,10 @@ #include "file_intern.h" /* XXX */ -static void error(const char *dummy) {} -static void waitcursor(int val) {} -static void activate_fileselect(int d1, char *d2, char *d3, void *d4) {} -static int saveover(const char *dummy) {return 0;} +static void error(const char *UNUSED(dummy)) {} +static void waitcursor(int UNUSED(val)) {} +static void activate_fileselect(int UNUSED(d1), char *UNUSED(d2), char *UNUSED(d3), void *UNUSED(d4)) {} +static int saveover(const char *UNUSED(dummy)) {return 0;} /* XXX */ diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index f780a6c31ee..01a8ba4797c 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -87,7 +87,7 @@ /* Envelope -------------- */ // TODO: draw a shaded poly showing the region of influence too!!! -static void draw_fcurve_modifier_controls_envelope (FCurve *fcu, FModifier *fcm, View2D *v2d) +static void draw_fcurve_modifier_controls_envelope (FModifier *fcm, View2D *v2d) { FMod_Envelope *env= (FMod_Envelope *)fcm->data; FCM_EnvelopeData *fed; @@ -137,7 +137,7 @@ static void draw_fcurve_modifier_controls_envelope (FCurve *fcu, FModifier *fcm, /* Points ---------------- */ /* helper func - draw keyframe vertices only for an F-Curve */ -static void draw_fcurve_vertices_keyframes (bAnimContext *ac, FCurve *fcu, View2D *v2d, short edit, short sel) +static void draw_fcurve_vertices_keyframes (FCurve *fcu, View2D *v2d, short edit, short sel) { BezTriple *bezt= fcu->bezt; const float fac= 0.05f * (v2d->cur.xmax - v2d->cur.xmin); @@ -209,7 +209,7 @@ static void draw_fcurve_handle_control (float x, float y, float xscale, float ys } /* helper func - draw handle vertices only for an F-Curve (if it is not protected) */ -static void draw_fcurve_vertices_handles (bAnimContext *ac, SpaceIpo *sipo, FCurve *fcu, View2D *v2d, short sel) +static void draw_fcurve_vertices_handles (FCurve *fcu, View2D *v2d, short sel, short sel_handle_only) { BezTriple *bezt= fcu->bezt; BezTriple *prevbezt = NULL; @@ -237,7 +237,7 @@ static void draw_fcurve_vertices_handles (bAnimContext *ac, SpaceIpo *sipo, FCur * Also, need to take into account whether the keyframe was selected * if a Graph Editor option to only show handles of selected keys is on. */ - if ( !(sipo->flag & SIPO_SELVHANDLESONLY) || BEZSELECTED(bezt) ) { + if ( !sel_handle_only || BEZSELECTED(bezt) ) { if ( (!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) ) { if ((bezt->f1 & SELECT) == sel)/* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax)*/ draw_fcurve_handle_control(bezt->vec[0][0], bezt->vec[0][1], xscale, yscale, hsize); @@ -255,7 +255,7 @@ static void draw_fcurve_vertices_handles (bAnimContext *ac, SpaceIpo *sipo, FCur } /* helper func - set color to draw F-Curve data with */ -static void set_fcurve_vertex_color (SpaceIpo *sipo, FCurve *fcu, short sel) +static void set_fcurve_vertex_color (FCurve *fcu, short sel) { /* Fade the 'intensity' of the vertices based on the selection of the curves too */ int alphaOffset= (int)((drawFCurveFade(fcu) - 1.0f) * 255); @@ -274,7 +274,7 @@ static void set_fcurve_vertex_color (SpaceIpo *sipo, FCurve *fcu, short sel) } -static void draw_fcurve_vertices (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve *fcu, int do_handles) +static void draw_fcurve_vertices (ARegion *ar, FCurve *fcu, short do_handles, short sel_handle_only) { View2D *v2d= &ar->v2d; @@ -290,19 +290,19 @@ static void draw_fcurve_vertices (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, /* draw the two handles first (if they're shown, the curve doesn't have just a single keyframe, and the curve is being edited) */ if (do_handles) { - set_fcurve_vertex_color(sipo, fcu, 0); - draw_fcurve_vertices_handles(ac, sipo, fcu, v2d, 0); + set_fcurve_vertex_color(fcu, 0); + draw_fcurve_vertices_handles(fcu, v2d, 0, sel_handle_only); - set_fcurve_vertex_color(sipo, fcu, 1); - draw_fcurve_vertices_handles(ac, sipo, fcu, v2d, 1); + set_fcurve_vertex_color(fcu, 1); + draw_fcurve_vertices_handles(fcu, v2d, 1, sel_handle_only); } /* draw keyframes over the handles */ - set_fcurve_vertex_color(sipo, fcu, 0); - draw_fcurve_vertices_keyframes(ac, fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), 0); + set_fcurve_vertex_color(fcu, 0); + draw_fcurve_vertices_keyframes(fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), 0); - set_fcurve_vertex_color(sipo, fcu, 1); - draw_fcurve_vertices_keyframes(ac, fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), 1); + set_fcurve_vertex_color(fcu, 1); + draw_fcurve_vertices_keyframes(fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), 1); glPointSize(1.0f); } @@ -329,7 +329,7 @@ static int draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu) /* draw lines for F-Curve handles only (this is only done in EditMode) * note: draw_fcurve_handles_check must be checked before running this. */ -static void draw_fcurve_handles (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve *fcu) +static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu) { int sel, b; @@ -455,7 +455,7 @@ static void draw_fcurve_sample_control (float x, float y, float xscale, float ys } /* helper func - draw keyframe vertices only for an F-Curve */ -static void draw_fcurve_samples (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve *fcu) +static void draw_fcurve_samples (ARegion *ar, FCurve *fcu) { FPoint *first, *last; float hsize, xscale, yscale; @@ -489,7 +489,7 @@ static void draw_fcurve_samples (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, /* Curve ---------------- */ /* helper func - just draw the F-Curve by sampling the visible region (for drawing curves with modifiers) */ -static void draw_fcurve_curve (bAnimContext *ac, ID *id, FCurve *fcu, SpaceIpo *sipo, View2D *v2d, View2DGrid *grid) +static void draw_fcurve_curve (bAnimContext *ac, ID *id, FCurve *fcu, View2D *v2d, View2DGrid *grid) { ChannelDriver *driver; float samplefreq, ctime; @@ -627,7 +627,7 @@ static void draw_fcurve_curve_samples (bAnimContext *ac, ID *id, FCurve *fcu, Vi } /* helper func - draw one repeat of an F-Curve */ -static void draw_fcurve_curve_bezts (bAnimContext *ac, ID *id, FCurve *fcu, View2D *v2d, View2DGrid *grid) +static void draw_fcurve_curve_bezts (bAnimContext *ac, ID *id, FCurve *fcu, View2D *v2d) { BezTriple *prevbezt= fcu->bezt; BezTriple *bezt= prevbezt+1; @@ -784,7 +784,7 @@ static void draw_fcurve_curve_bezts (bAnimContext *ac, ID *id, FCurve *fcu, View /* Draw the 'ghost' F-Curves (i.e. snapshots of the curve) * NOTE: unit mapping has already been applied to the values, so do not try and apply again */ -void graph_draw_ghost_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid *grid) +void graph_draw_ghost_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) { FCurve *fcu; @@ -878,12 +878,12 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri /* draw a curve affected by modifiers or only allowed to have integer values * by sampling it at various small-intervals over the visible region */ - draw_fcurve_curve(ac, ale->id, fcu, sipo, &ar->v2d, grid); + draw_fcurve_curve(ac, ale->id, fcu, &ar->v2d, grid); } else if ( ((fcu->bezt) || (fcu->fpt)) && (fcu->totvert) ) { /* just draw curve based on defined data (i.e. no modifiers) */ if (fcu->bezt) - draw_fcurve_curve_bezts(ac, ale->id, fcu, &ar->v2d, grid); + draw_fcurve_curve_bezts(ac, ale->id, fcu, &ar->v2d); else if (fcu->fpt) draw_fcurve_curve_samples(ac, ale->id, fcu, &ar->v2d); } @@ -904,7 +904,7 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri if ((fcu->flag & FCURVE_ACTIVE) && (fcm)) { switch (fcm->type) { case FMODIFIER_TYPE_ENVELOPE: /* envelope */ - draw_fcurve_modifier_controls_envelope(fcu, fcm, &ar->v2d); + draw_fcurve_modifier_controls_envelope(fcm, &ar->v2d); break; } } @@ -919,15 +919,15 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri if (do_handles) { /* only draw handles/vertices on keyframes */ glEnable(GL_BLEND); - draw_fcurve_handles(ac, sipo, ar, fcu); + draw_fcurve_handles(sipo, fcu); glDisable(GL_BLEND); } - draw_fcurve_vertices(ac, sipo, ar, fcu, do_handles); + draw_fcurve_vertices(ar, fcu, do_handles, sipo->flag&SIPO_SELVHANDLESONLY); } else { /* samples: only draw two indicators at either end as indicators */ - draw_fcurve_samples(ac, sipo, ar, fcu); + draw_fcurve_samples(ar, fcu); } /* unapply unit mapping */ @@ -948,7 +948,7 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri /* Channel List */ /* left hand part */ -void graph_draw_channel_names(bContext *C, bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) +void graph_draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 46e7840cec8..e1d1e4194d5 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1001,7 +1001,7 @@ typedef struct tSoundBakeInfo { /* Sampling callback used to determine the value from the sound to * save in the F-Curve at the specified frame */ -static float fcurve_samplingcb_sound (FCurve *fcu, void *data, float evaltime) +static float fcurve_samplingcb_sound (FCurve *UNUSED(fcu), void *data, float evaltime) { tSoundBakeInfo *sbi= (tSoundBakeInfo *)data; diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index a637ed15fcd..560dabbb634 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -48,10 +48,10 @@ struct ARegion *graph_has_buttons_region(struct ScrArea *sa); /* ***************************************** */ /* graph_draw.c */ -void graph_draw_channel_names(struct bContext *C, struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar); +void graph_draw_channel_names(struct bContext *C, struct bAnimContext *ac, struct ARegion *ar); void graph_draw_curves(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar, struct View2DGrid *grid, short sel); -void graph_draw_ghost_curves(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar, struct View2DGrid *grid); +void graph_draw_ghost_curves(struct bAnimContext *ac, struct SpaceIpo *sipo, struct ARegion *ar); /* ***************************************** */ /* graph_header.c */ diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 9dd499a2cbf..0aa0a87dbac 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -886,7 +886,7 @@ static void get_nearest_fcurve_verts_list (bAnimContext *ac, int mval[2], ListBa } /* helper for find_nearest_fcurve_vert() - get the best match to use */ -static tNearestVertInfo *get_best_nearest_fcurve_vert (bAnimContext *ac, ListBase *matches) +static tNearestVertInfo *get_best_nearest_fcurve_vert (ListBase *matches) { tNearestVertInfo *nvi = NULL; short found = 0; @@ -941,7 +941,7 @@ static tNearestVertInfo *find_nearest_fcurve_vert (bAnimContext *ac, int mval[2] get_nearest_fcurve_verts_list(ac, mval, &matches); /* step 2: find the best vert */ - nvi= get_best_nearest_fcurve_vert(ac, &matches); + nvi= get_best_nearest_fcurve_vert(&matches); BLI_freelistN(&matches); diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 994d9725762..ff2d233ccdb 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -175,7 +175,7 @@ static void graph_free(SpaceLink *sl) /* spacetype; init callback */ -static void graph_init(struct wmWindowManager *wm, ScrArea *sa) +static void graph_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) { SpaceIpo *sipo= (SpaceIpo *)sa->spacedata.first; @@ -239,7 +239,7 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar) /* draw data */ if (ANIM_animdata_get_context(C, &ac)) { /* draw ghost curves */ - graph_draw_ghost_curves(&ac, sipo, ar, grid); + graph_draw_ghost_curves(&ac, sipo, ar); /* draw curves twice - unselected, then selected, so that the are fewer occlusion problems */ graph_draw_curves(&ac, sipo, ar, grid, 0); @@ -314,7 +314,6 @@ static void graph_channel_area_init(wmWindowManager *wm, ARegion *ar) static void graph_channel_area_draw(const bContext *C, ARegion *ar) { - SpaceIpo *sipo= CTX_wm_space_graph(C); bAnimContext ac; View2D *v2d= &ar->v2d; View2DScrollers *scrollers; @@ -329,7 +328,7 @@ static void graph_channel_area_draw(const bContext *C, ARegion *ar) /* draw channels */ if (ANIM_animdata_get_context(C, &ac)) { - graph_draw_channel_names((bContext*)C, &ac, sipo, ar); + graph_draw_channel_names((bContext*)C, &ac, ar); } /* reset view matrix */ @@ -342,7 +341,7 @@ static void graph_channel_area_draw(const bContext *C, ARegion *ar) } /* add handlers, stuff you only do once or on area/region changes */ -static void graph_header_area_init(wmWindowManager *wm, ARegion *ar) +static void graph_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 6799d9390d7..5173621d9c1 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -55,7 +55,7 @@ /* ******************** default callbacks for info space ***************** */ -static SpaceLink *info_new(const bContext *C) +static SpaceLink *info_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceInfo *sinfo; @@ -80,7 +80,7 @@ static SpaceLink *info_new(const bContext *C) } /* not spacelink itself */ -static void info_free(SpaceLink *sl) +static void info_free(SpaceLink *UNUSED(sl)) { // SpaceInfo *sinfo= (SpaceInfo*) sl; @@ -88,7 +88,7 @@ static void info_free(SpaceLink *sl) /* spacetype; init callback */ -static void info_init(struct wmWindowManager *wm, ScrArea *sa) +static void info_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { } @@ -105,11 +105,11 @@ static SpaceLink *info_duplicate(SpaceLink *sl) /* add handlers, stuff you only do once or on area/region changes */ -static void info_main_area_init(wmWindowManager *wm, ARegion *ar) +static void info_main_area_init(wmWindowManager *UNUSED(wm), ARegion *UNUSED(ar)) { } -static void info_main_area_draw(const bContext *C, ARegion *ar) +static void info_main_area_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar)) { /* clear and setup matrix */ @@ -137,7 +137,7 @@ void info_keymap(struct wmKeyConfig *keyconf) } /* add handlers, stuff you only do once or on area/region changes */ -static void info_header_area_init(wmWindowManager *wm, ARegion *ar) +static void info_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } @@ -147,7 +147,7 @@ static void info_header_area_draw(const bContext *C, ARegion *ar) ED_region_header(C, ar); } -static void info_main_area_listener(ARegion *ar, wmNotifier *wmn) +static void info_main_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn)) { /* context changes */ } diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c index 195bc5df3c7..e41627ad0a4 100644 --- a/source/blender/editors/space_logic/logic_buttons.c +++ b/source/blender/editors/space_logic/logic_buttons.c @@ -83,7 +83,7 @@ static void logic_panel_view_properties(const bContext *C, Panel *pa) } #endif -void logic_buttons_register(ARegionType *art) +void logic_buttons_register(ARegionType *UNUSED(art)) { #if 0 PanelType *pt; diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 148bcf1459f..c8d6e960132 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -182,7 +182,7 @@ void make_unique_prop_names(bContext *C, char *str) MEM_freeN(names); } -static void make_unique_prop_names_cb(bContext *C, void *strv, void *redraw_view3d_flagv) +static void make_unique_prop_names_cb(bContext *C, void *strv, void *UNUSED(redraw_view3d_flagv)) { char *str= strv; // int redraw_view3d_flag= GET_INT_FROM_POINTER(redraw_view3d_flagv); @@ -354,7 +354,7 @@ static void old_sca_move_actuator(bContext *C, void *datav, void *move_up) } } -void do_logic_buts(bContext *C, void *arg, int event) +void do_logic_buts(bContext *C, void *UNUSED(arg), int event) { Main *bmain= CTX_data_main(C); bSensor *sens; @@ -964,7 +964,7 @@ static void set_col_sensor(int type, int medium) } -static void verify_logicbutton_func(bContext *C, void *data1, void *data2) +static void verify_logicbutton_func(bContext *UNUSED(C), void *data1, void *data2) { bSensor *sens= (bSensor*)data1; @@ -1017,7 +1017,7 @@ static void test_scenepoin_but(struct bContext *C, char *name, ID **idpp) id_us_plus(*idpp); } -static void test_keyboard_event(struct bContext *C, void *arg_ks, void *arg_unused) +static void test_keyboard_event(struct bContext *UNUSED(C), void *arg_ks, void *UNUSED(arg)) { bKeyboardSensor *ks= (bKeyboardSensor*)arg_ks; @@ -1116,7 +1116,7 @@ static void check_armature_sensor(bContext *C, void *arg1_but, void *arg2_sens) check_armature_bone_constraint(ob, sens->posechannel, sens->constraint); } -static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short xco, short yco, short width,char* objectname) +static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short xco, short yco, short width) { bNearSensor *ns = NULL; bTouchSensor *ts = NULL; @@ -1734,7 +1734,7 @@ static void set_col_actuator(int item, int medium) } -static void change_object_actuator(bContext *C, void *act, void *arg) +static void change_object_actuator(bContext *UNUSED(C), void *act, void *UNUSED(arg)) { bObjectActuator *oa = act; @@ -1758,7 +1758,7 @@ static void change_object_actuator(bContext *C, void *act, void *arg) } } -static void change_ipo_actuator(bContext *C, void *arg1_but, void *arg2_ia) +static void change_ipo_actuator(bContext *UNUSED(C), void *arg1_but, void *arg2_ia) { bIpoActuator *ia = arg2_ia; uiBut *but = arg1_but; @@ -1770,7 +1770,7 @@ static void change_ipo_actuator(bContext *C, void *arg1_but, void *arg2_ia) but->retval = B_REDR; } -void update_object_actuator_PID(bContext *C, void *act, void *arg) +void update_object_actuator_PID(bContext *UNUSED(C), void *act, void *UNUSED(arg)) { bObjectActuator *oa = act; oa->forcerot[0] = 60.0f*oa->forcerot[1]; @@ -2920,7 +2920,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo return yco-4; } -static void do_sensor_menu(bContext *C, void *arg, int event) +static void do_sensor_menu(bContext *C, void *UNUSED(arg), int event) { SpaceLogic *slogic= CTX_wm_space_logic(C); ID **idar; @@ -2949,7 +2949,7 @@ static void do_sensor_menu(bContext *C, void *arg, int event) if(idar) MEM_freeN(idar); } -static uiBlock *sensor_menu(bContext *C, ARegion *ar, void *arg_unused) +static uiBlock *sensor_menu(bContext *C, ARegion *ar, void *UNUSED(arg)) { uiBlock *block; int yco=0; @@ -2969,7 +2969,7 @@ static uiBlock *sensor_menu(bContext *C, ARegion *ar, void *arg_unused) return block; } -static void do_controller_menu(bContext *C, void *arg, int event) +static void do_controller_menu(bContext *C, void *UNUSED(arg), int event) { SpaceLogic *slogic= CTX_wm_space_logic(C); ID **idar; @@ -2998,7 +2998,7 @@ static void do_controller_menu(bContext *C, void *arg, int event) if(idar) MEM_freeN(idar); } -static uiBlock *controller_menu(bContext *C, ARegion *ar, void *arg_unused) +static uiBlock *controller_menu(bContext *C, ARegion *ar, void *UNUSED(arg)) { uiBlock *block; int yco=0; @@ -3018,7 +3018,7 @@ static uiBlock *controller_menu(bContext *C, ARegion *ar, void *arg_unused) return block; } -static void do_actuator_menu(bContext *C, void *arg, int event) +static void do_actuator_menu(bContext *C, void *UNUSED(arg), int event) { SpaceLogic *slogic= CTX_wm_space_logic(C); ID **idar; @@ -3047,7 +3047,7 @@ static void do_actuator_menu(bContext *C, void *arg, int event) if(idar) MEM_freeN(idar); } -static uiBlock *actuator_menu(bContext *C, ARegion *ar, void *arg_unused) +static uiBlock *actuator_menu(bContext *C, ARegion *ar, void *UNUSED(arg)) { uiBlock *block; int xco=0; @@ -3069,7 +3069,7 @@ static uiBlock *actuator_menu(bContext *C, ARegion *ar, void *arg_unused) -static void check_controller_state_mask(bContext *C, void *arg1_but, void *arg2_mask) +static void check_controller_state_mask(bContext *UNUSED(C), void *arg1_but, void *arg2_mask) { unsigned int *cont_mask = arg2_mask; uiBut *but = arg1_but; @@ -3122,7 +3122,7 @@ static uiBlock *controller_state_mask_menu(bContext *C, ARegion *ar, void *arg_c return block; } -static void do_object_state_menu(bContext *C, void *arg, int event) +static void do_object_state_menu(bContext *UNUSED(C), void *arg, int event) { Object *ob = arg; @@ -3579,7 +3579,7 @@ static void draw_controller_python(uiLayout *layout, PointerRNA *ptr) } } -static void draw_controller_state(uiLayout *layout, PointerRNA *ptr) +static void draw_controller_state(uiLayout *UNUSED(layout), PointerRNA *UNUSED(ptr)) { } @@ -4955,7 +4955,7 @@ void logic_buttons(bContext *C, ARegion *ar) uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0); sens->otype= sens->type; - yco= draw_sensorbuttons(ob, sens, block, xco, yco, width,ob->id.name); + yco= draw_sensorbuttons(ob, sens, block, xco, yco, width); if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; } else { diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c index 5af5b5ee6c0..9a3cac02c50 100644 --- a/source/blender/editors/space_logic/space_logic.c +++ b/source/blender/editors/space_logic/space_logic.c @@ -82,7 +82,7 @@ ARegion *logic_has_buttons_region(ScrArea *sa) /* ******************** default callbacks for image space ***************** */ -static SpaceLink *logic_new(const bContext *C) +static SpaceLink *logic_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceLogic *slogic; @@ -145,7 +145,7 @@ static SpaceLink *logic_new(const bContext *C) } /* not spacelink itself */ -static void logic_free(SpaceLink *sl) +static void logic_free(SpaceLink *UNUSED(sl)) { // Spacelogic *slogic= (SpaceLogic*) sl; @@ -156,7 +156,7 @@ static void logic_free(SpaceLink *sl) /* spacetype; init callback */ -static void logic_init(struct wmWindowManager *wm, ScrArea *sa) +static void logic_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { } @@ -183,7 +183,7 @@ void logic_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_menu(keymap, "LOGIC_MT_logicbricks_add", AKEY, KM_PRESS, KM_SHIFT, 0); } -static void logic_refresh(const bContext *C, ScrArea *sa) +static void logic_refresh(const bContext *UNUSED(C), ScrArea *UNUSED(sa)) { // SpaceLogic *slogic= CTX_wm_space_logic(C); // Object *obedit= CTX_data_edit_object(C); @@ -217,11 +217,9 @@ static void logic_listener(ARegion *ar, wmNotifier *wmn) } } -static int logic_context(const bContext *C, const char *member, bContextDataResult *result) +static int logic_context(const bContext *UNUSED(C), const char *UNUSED(member), bContextDataResult *UNUSED(result)) { // SpaceLogic *slogic= CTX_wm_space_logic(C); - - return 0; } @@ -287,7 +285,7 @@ static void logic_buttons_area_draw(const bContext *C, ARegion *ar) /************************* header region **************************/ /* add handlers, stuff you only do once or on area/region changes */ -static void logic_header_area_init(wmWindowManager *wm, ARegion *ar) +static void logic_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index ef91fc56bec..49cd09043c2 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -66,7 +66,7 @@ /* -------------- */ -static void do_nla_region_buttons(bContext *C, void *arg, int event) +static void do_nla_region_buttons(bContext *C, void *UNUSED(arg), int event) { //Scene *scene= CTX_data_scene(C); @@ -172,25 +172,25 @@ static int nla_panel_poll(const bContext *C, PanelType *pt) } #endif -static int nla_animdata_panel_poll(const bContext *C, PanelType *pt) +static int nla_animdata_panel_poll(const bContext *C, PanelType *UNUSED(pt)) { PointerRNA ptr; return (nla_panel_context(C, &ptr, NULL, NULL) && (ptr.data != NULL)); } -static int nla_track_panel_poll(const bContext *C, PanelType *pt) +static int nla_track_panel_poll(const bContext *C, PanelType *UNUSED(pt)) { PointerRNA ptr; return (nla_panel_context(C, NULL, &ptr, NULL) && (ptr.data != NULL)); } -static int nla_strip_panel_poll(const bContext *C, PanelType *pt) +static int nla_strip_panel_poll(const bContext *C, PanelType *UNUSED(pt)) { PointerRNA ptr; return (nla_panel_context(C, NULL, NULL, &ptr) && (ptr.data != NULL)); } -static int nla_strip_actclip_panel_poll(const bContext *C, PanelType *pt) +static int nla_strip_actclip_panel_poll(const bContext *C, PanelType *UNUSED(pt)) { PointerRNA ptr; NlaStrip *strip; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 7df9db11472..98550b7e452 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -219,7 +219,7 @@ static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float co } /* helper call for drawing influence/time control curves for a given NLA-strip */ -static void nla_draw_strip_curves (NlaStrip *strip, View2D *v2d, float yminc, float ymaxc) +static void nla_draw_strip_curves (NlaStrip *strip, float yminc, float ymaxc) { const float yheight = ymaxc - yminc; @@ -280,7 +280,7 @@ static void nla_draw_strip_curves (NlaStrip *strip, View2D *v2d, float yminc, fl } /* main call for drawing a single NLA-strip */ -static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float yminc, float ymaxc) +static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *UNUSED(nlt), NlaStrip *strip, View2D *v2d, float yminc, float ymaxc) { float color[3]; @@ -351,7 +351,7 @@ static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStr * - only if user hasn't hidden them... */ if ((snla->flag & SNLA_NOSTRIPCURVES) == 0) - nla_draw_strip_curves(strip, v2d, yminc, ymaxc); + nla_draw_strip_curves(strip, yminc, ymaxc); /* draw strip outline * - color used here is to indicate active vs non-active @@ -414,7 +414,7 @@ static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStr } /* add the relevant text to the cache of text-strings to draw in pixelspace */ -static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View2D *v2d, float yminc, float ymaxc) +static void nla_draw_strip_text (NlaTrack *UNUSED(nlt), NlaStrip *strip, int UNUSED(index), View2D *v2d, float yminc, float ymaxc) { char str[256], dir[3]; rctf rect; @@ -810,7 +810,7 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie } } -void draw_nla_channel_list (bContext *C, bAnimContext *ac, SpaceNla *snla, ARegion *ar) +void draw_nla_channel_list (bContext *C, bAnimContext *ac, ARegion *ar) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index f2e83f4168e..e13a229fdd1 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -810,7 +810,7 @@ static void nlaedit_split_strip_actclip (AnimData *adt, NlaTrack *nlt, NlaStrip } /* split a given Meta strip */ -static void nlaedit_split_strip_meta (AnimData *adt, NlaTrack *nlt, NlaStrip *strip) +static void nlaedit_split_strip_meta (NlaTrack *nlt, NlaStrip *strip) { /* simply ungroup it for now... */ BKE_nlastrips_clear_metastrip(&nlt->strips, strip); @@ -852,7 +852,7 @@ static int nlaedit_split_exec (bContext *C, wmOperator *UNUSED(op)) break; case NLASTRIP_TYPE_META: /* meta-strips need special handling */ - nlaedit_split_strip_meta(adt, nlt, strip); + nlaedit_split_strip_meta(nlt, strip); break; default: /* for things like Transitions, do not split! */ diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 7570969158b..6906a151936 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -45,7 +45,7 @@ void NLA_OT_properties(wmOperatorType *ot); /* nla_draw.c */ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *ar); -void draw_nla_channel_list(bContext *C, bAnimContext *ac, SpaceNla *snla, ARegion *ar); +void draw_nla_channel_list(bContext *C, bAnimContext *ac, ARegion *ar); /* **************************************** */ /* nla_header.c */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 85a169f2bb0..13380cd17f7 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -156,7 +156,7 @@ void nla_operatortypes(void) /* ************************** registration - keymaps **********************************/ -static void nla_keymap_channels (wmKeyConfig *keyconf, wmKeyMap *keymap) +static void nla_keymap_channels(wmKeyMap *keymap) { /* NLA-specific (different to standard channels keymap) -------------------------- */ /* selection */ @@ -287,7 +287,7 @@ void nla_keymap(wmKeyConfig *keyconf) * However, those operations which involve clicking on channels and/or the placement of them in the view are implemented here instead */ keymap= WM_keymap_find(keyconf, "NLA Channels", SPACE_NLA, 0); - nla_keymap_channels(keyconf, keymap); + nla_keymap_channels(keymap); /* data */ keymap= WM_keymap_find(keyconf, "NLA Editor", SPACE_NLA, 0); diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index ad6e183995f..25c53687597 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -178,7 +178,7 @@ static void nla_free(SpaceLink *sl) /* spacetype; init callback */ -static void nla_init(struct wmWindowManager *wm, ScrArea *sa) +static void nla_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) { SpaceNla *snla= (SpaceNla *)sa->spacedata.first; @@ -219,7 +219,6 @@ static void nla_channel_area_init(wmWindowManager *wm, ARegion *ar) /* draw entirely, view changes should be handled here */ static void nla_channel_area_draw(const bContext *C, ARegion *ar) { - SpaceNla *snla= CTX_wm_space_nla(C); bAnimContext ac; View2D *v2d= &ar->v2d; View2DScrollers *scrollers; @@ -232,7 +231,7 @@ static void nla_channel_area_draw(const bContext *C, ARegion *ar) /* data */ if (ANIM_animdata_get_context(C, &ac)) { - draw_nla_channel_list((bContext *)C, &ac, snla, ar); + draw_nla_channel_list((bContext *)C, &ac, ar); } /* reset view matrix */ @@ -316,7 +315,7 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar) /* add handlers, stuff you only do once or on area/region changes */ -static void nla_header_area_init(wmWindowManager *wm, ARegion *ar) +static void nla_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c index ca42193bff6..954018bfd4f 100644 --- a/source/blender/editors/space_node/node_buttons.c +++ b/source/blender/editors/space_node/node_buttons.c @@ -63,7 +63,7 @@ #define B_NOP 1 #define B_REDR 2 -static void do_node_region_buttons(bContext *C, void *arg, int event) +static void do_node_region_buttons(bContext *C, void *UNUSED(arg), int event) { //SpaceNode *snode= CTX_wm_space_node(C); @@ -75,7 +75,7 @@ static void do_node_region_buttons(bContext *C, void *arg, int event) } /* poll callback for active node */ -static int active_node_poll(const bContext *C, PanelType *pt) +static int active_node_poll(const bContext *C, PanelType *UNUSED(pt)) { SpaceNode *snode= CTX_wm_space_node(C); diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index f22ff1515c5..64e4bc4cbc8 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -55,7 +55,7 @@ /* ************************ add menu *********************** */ -static void do_node_add(bContext *C, void *arg, int event) +static void do_node_add(bContext *C, void *UNUSED(arg), int event) { SpaceNode *snode= CTX_wm_space_node(C); bNode *node; diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c index d426ee17af7..48801d4369d 100644 --- a/source/blender/editors/space_node/node_state.c +++ b/source/blender/editors/space_node/node_state.c @@ -140,7 +140,7 @@ static int do_header_node(SpaceNode *snode, bNode *node, float mx, float my) return 0; } -static int do_header_hidden_node(SpaceNode *snode, bNode *node, float mx, float my) +static int do_header_hidden_node(bNode *node, float mx, float my) { rctf totr= node->totr; @@ -164,7 +164,7 @@ static int node_toggle_visibility(SpaceNode *snode, ARegion *ar, short *mval) for(next_node(snode->edittree); (node=next_node(NULL));) { if(node->flag & NODE_HIDDEN) { - if(do_header_hidden_node(snode, node, mx, my)) { + if(do_header_hidden_node(node, mx, my)) { ED_region_tag_redraw(ar); return 1; } @@ -227,7 +227,7 @@ void NODE_OT_visibility_toggle(wmOperatorType *ot) /* **************** View All Operator ************** */ -static void snode_home(ScrArea *sa, ARegion *ar, SpaceNode* snode) +static void snode_home(ScrArea *UNUSED(sa), ARegion *ar, SpaceNode* snode) { bNode *node; rctf *cur, *tot; diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 2d7cde37ec4..d38e2af734b 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -89,7 +89,7 @@ ARegion *node_has_buttons_region(ScrArea *sa) /* ******************** default callbacks for node space ***************** */ -static SpaceLink *node_new(const bContext *C) +static SpaceLink *node_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceNode *snode; @@ -145,14 +145,14 @@ static SpaceLink *node_new(const bContext *C) } /* not spacelink itself */ -static void node_free(SpaceLink *sl) +static void node_free(SpaceLink *UNUSED(sl)) { } /* spacetype; init callback */ -static void node_init(struct wmWindowManager *wm, ScrArea *sa) +static void node_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { } @@ -306,7 +306,7 @@ static void node_main_area_draw(const bContext *C, ARegion *ar) /* ************* dropboxes ************* */ -static int node_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int node_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) { if(drag->type==WM_DRAG_ID) { ID *id= (ID *)drag->poin; @@ -345,7 +345,7 @@ static void node_dropboxes(void) /* add handlers, stuff you only do once or on area/region changes */ -static void node_header_area_init(wmWindowManager *wm, ARegion *ar) +static void node_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index c7e3340ba87..6040b755e30 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -120,7 +120,7 @@ /* ************* XXX **************** */ -static void error(const char *dummy, ...) {} +static void error(const char *UNUSED(arg), ...) {} /* ********************************** */ @@ -1556,7 +1556,7 @@ static void outliner_set_flag(SpaceOops *soops, ListBase *lb, short flag, short /* same check needed for both object operation and restrict column button func * return 0 when in edit mode (cannot restrict view or select) * otherwise return 1 */ -static int common_restrict_check(bContext *C, Scene *scene, Object *ob) +static int common_restrict_check(bContext *C, Object *ob) { /* Don't allow hide an object in edit mode, * check the bug #22153 and #21609, #23977 @@ -1575,13 +1575,13 @@ static int common_restrict_check(bContext *C, Scene *scene, Object *ob) return 1; } -void object_toggle_visibility_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +void object_toggle_visibility_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; Object *ob = (Object *)tselem->id; /* add check for edit mode */ - if(!common_restrict_check(C, scene, ob)) return; + if(!common_restrict_check(C, ob)) return; if(base || (base= object_in_scene(ob, scene))) { if((base->object->restrictflag ^= OB_RESTRICT_VIEW)) { @@ -1620,7 +1620,7 @@ void OUTLINER_OT_visibility_toggle(wmOperatorType *ot) /* --- */ -static void object_toggle_selectability_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void object_toggle_selectability_cb(bContext *UNUSED(C), Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; @@ -1658,7 +1658,7 @@ void OUTLINER_OT_selectability_toggle(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -void object_toggle_renderability_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +void object_toggle_renderability_cb(bContext *UNUSED(C), Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; @@ -1820,6 +1820,8 @@ void OUTLINER_OT_show_one_level(wmOperatorType *ot) RNA_def_boolean(ot->srna, "open", 1, "Open", "Expand all entries one level deep."); } +/* This is not used anywhere at the moment */ +#if 0 /* return 1 when levels were opened */ static int outliner_open_back(SpaceOops *soops, TreeElement *te) { @@ -1836,8 +1838,6 @@ static int outliner_open_back(SpaceOops *soops, TreeElement *te) return retval; } -/* This is not used anywhere at the moment */ -#if 0 static void outliner_open_reveal(SpaceOops *soops, ListBase *lb, TreeElement *teFind, int *found) { TreeElement *te; @@ -1863,7 +1863,7 @@ static void outliner_open_reveal(SpaceOops *soops, ListBase *lb, TreeElement *te #endif // XXX just use View2D ops for this? -void outliner_page_up_down(Scene *scene, ARegion *ar, SpaceOops *soops, int up) +void outliner_page_up_down(Scene *UNUSED(scene), ARegion *ar, SpaceOops *soops, int up) { int dy= ar->v2d.mask.ymax-ar->v2d.mask.ymin; @@ -2056,7 +2056,7 @@ static int tree_element_active_texture(bContext *C, Scene *scene, SpaceOops *soo } -static int tree_element_active_lamp(bContext *C, Scene *scene, SpaceOops *soops, TreeElement *te, int set) +static int tree_element_active_lamp(bContext *UNUSED(C), Scene *scene, SpaceOops *soops, TreeElement *te, int set) { Object *ob; @@ -2204,7 +2204,7 @@ static int tree_element_active_bone(bContext *C, Scene *scene, TreeElement *te, /* ebones only draw in editmode armature */ -static int tree_element_active_ebone(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_ebone(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tselem), int set) { EditBone *ebone= te->directdata; @@ -2229,7 +2229,7 @@ static int tree_element_active_ebone(bContext *C, Scene *scene, TreeElement *te, return 0; } -static int tree_element_active_modifier(bContext *C, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_modifier(bContext *C, TreeElement *UNUSED(te), TreeStoreElem *tselem, int set) { if(set) { Object *ob= (Object *)tselem->id; @@ -2242,7 +2242,7 @@ static int tree_element_active_modifier(bContext *C, TreeElement *te, TreeStoreE return 0; } -static int tree_element_active_psys(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_psys(bContext *C, Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *tselem, int set) { if(set) { Object *ob= (Object *)tselem->id; @@ -2255,7 +2255,7 @@ static int tree_element_active_psys(bContext *C, Scene *scene, TreeElement *te, return 0; } -static int tree_element_active_constraint(bContext *C, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_constraint(bContext *C, TreeElement *UNUSED(te), TreeStoreElem *tselem, int set) { if(set) { Object *ob= (Object *)tselem->id; @@ -2267,7 +2267,7 @@ static int tree_element_active_constraint(bContext *C, TreeElement *te, TreeStor return 0; } -static int tree_element_active_text(bContext *C, Scene *scene, SpaceOops *soops, TreeElement *te, int set) +static int tree_element_active_text(bContext *UNUSED(C), Scene *UNUSED(scene), SpaceOops *UNUSED(soops), TreeElement *UNUSED(te), int UNUSED(set)) { // XXX removed return 0; @@ -2292,7 +2292,7 @@ static int tree_element_active(bContext *C, Scene *scene, SpaceOops *soops, Tree return 0; } -static int tree_element_active_pose(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_pose(bContext *C, Scene *scene, TreeElement *UNUSED(te), TreeStoreElem *tselem, int set) { Object *ob= (Object *)tselem->id; Base *base= object_in_scene(ob, scene); @@ -2312,7 +2312,7 @@ static int tree_element_active_pose(bContext *C, Scene *scene, TreeElement *te, return 0; } -static int tree_element_active_sequence(bContext *C, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_sequence(TreeElement *te, TreeStoreElem *UNUSED(tselem), int set) { Sequence *seq= (Sequence*) te->directdata; @@ -2326,7 +2326,7 @@ static int tree_element_active_sequence(bContext *C, TreeElement *te, TreeStoreE return(0); } -static int tree_element_active_sequence_dup(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_sequence_dup(Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tselem), int set) { Sequence *seq, *p; Editing *ed= seq_give_editing(scene, FALSE); @@ -2353,7 +2353,7 @@ static int tree_element_active_sequence_dup(bContext *C, Scene *scene, TreeEleme return(0); } -static int tree_element_active_keymap_item(bContext *C, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_keymap_item(bContext *UNUSED(C), TreeElement *te, TreeStoreElem *UNUSED(tselem), int set) { wmKeyMapItem *kmi= te->directdata; @@ -2398,9 +2398,9 @@ static int tree_element_type_active(bContext *C, Scene *scene, SpaceOops *soops, case TSE_POSEGRP: return tree_element_active_posegroup(C, scene, te, tselem, set); case TSE_SEQUENCE: - return tree_element_active_sequence(C, te, tselem, set); + return tree_element_active_sequence(te, tselem, set); case TSE_SEQUENCE_DUP: - return tree_element_active_sequence_dup(C, scene, te, tselem, set); + return tree_element_active_sequence_dup(scene, te, tselem, set); case TSE_KEYMAP_ITEM: return tree_element_active_keymap_item(C, te, tselem, set); @@ -2687,39 +2687,6 @@ void OUTLINER_OT_item_rename(wmOperatorType *ot) ot->poll= ED_operator_outliner_active; } - - -/* recursive helper for function below */ -static void outliner_set_coordinates_element(SpaceOops *soops, TreeElement *te, int startx, int *starty) -{ - TreeStoreElem *tselem= TREESTORE(te); - - /* store coord and continue, we need coordinates for elements outside view too */ - te->xs= (float)startx; - te->ys= (float)(*starty); - *starty-= OL_H; - - if((tselem->flag & TSE_CLOSED)==0) { - TreeElement *ten; - for(ten= te->subtree.first; ten; ten= ten->next) { - outliner_set_coordinates_element(soops, ten, startx+OL_X, starty); - } - } - -} - -/* to retrieve coordinates with redrawing the entire tree */ -static void outliner_set_coordinates(ARegion *ar, SpaceOops *soops) -{ - TreeElement *te; - int starty= (int)(ar->v2d.tot.ymax)-OL_H; - int startx= 0; - - for(te= soops->tree.first; te; te= te->next) { - outliner_set_coordinates_element(soops, te, startx, &starty); - } -} - static TreeElement *outliner_find_id(SpaceOops *soops, ListBase *lb, ID *id) { TreeElement *te, *tes; @@ -2789,6 +2756,66 @@ void OUTLINER_OT_show_active(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/* tse is not in the treestore, we use its contents to find a match */ +static TreeElement *outliner_find_tse(SpaceOops *soops, TreeStoreElem *tse) +{ + TreeStore *ts= soops->treestore; + TreeStoreElem *tselem; + int a; + + if(tse->id==NULL) return NULL; + + /* check if 'tse' is in treestore */ + tselem= ts->data; + for(a=0; ausedelem; a++, tselem++) { + if((tse->type==0 && tselem->type==0) || (tselem->type==tse->type && tselem->nr==tse->nr)) { + if(tselem->id==tse->id) { + break; + } + } + } + if(tselem) + return outliner_find_tree_element(&soops->tree, a); + + return NULL; +} + + +/* Called to find an item based on name. + */ +#if 0 + +/* recursive helper for function below */ +static void outliner_set_coordinates_element(SpaceOops *soops, TreeElement *te, int startx, int *starty) +{ + TreeStoreElem *tselem= TREESTORE(te); + + /* store coord and continue, we need coordinates for elements outside view too */ + te->xs= (float)startx; + te->ys= (float)(*starty); + *starty-= OL_H; + + if((tselem->flag & TSE_CLOSED)==0) { + TreeElement *ten; + for(ten= te->subtree.first; ten; ten= ten->next) { + outliner_set_coordinates_element(soops, ten, startx+OL_X, starty); + } + } + +} + +/* to retrieve coordinates with redrawing the entire tree */ +static void outliner_set_coordinates(ARegion *ar, SpaceOops *soops) +{ + TreeElement *te; + int starty= (int)(ar->v2d.tot.ymax)-OL_H; + int startx= 0; + + for(te= soops->tree.first; te; te= te->next) { + outliner_set_coordinates_element(soops, te, startx, &starty); + } +} + /* find next element that has this name */ static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound) { @@ -2818,34 +2845,7 @@ static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *na return NULL; } -/* tse is not in the treestore, we use its contents to find a match */ -static TreeElement *outliner_find_tse(SpaceOops *soops, TreeStoreElem *tse) -{ - TreeStore *ts= soops->treestore; - TreeStoreElem *tselem; - int a; - - if(tse->id==NULL) return NULL; - - /* check if 'tse' is in treestore */ - tselem= ts->data; - for(a=0; ausedelem; a++, tselem++) { - if((tse->type==0 && tselem->type==0) || (tselem->type==tse->type && tselem->nr==tse->nr)) { - if(tselem->id==tse->id) { - break; - } - } - } - if(tselem) - return outliner_find_tree_element(&soops->tree, a); - - return NULL; -} - - -/* Called to find an item based on name. - */ -void outliner_find_panel(Scene *scene, ARegion *ar, SpaceOops *soops, int again, int flags) +static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *soops, int again, int flags) { TreeElement *te= NULL; TreeElement *last_find; @@ -2917,6 +2917,7 @@ void outliner_find_panel(Scene *scene, ARegion *ar, SpaceOops *soops, int again, error("Not found: %s", name); } } +#endif /* helper function for tree_element_shwo_hierarchy() - recursively checks whether subtrees have any objects*/ static int subtree_has_objects(SpaceOops *soops, ListBase *lb) @@ -3077,7 +3078,7 @@ static void set_operation_types(SpaceOops *soops, ListBase *lb, } } -static void unlink_material_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void unlink_material_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *UNUSED(tselem)) { Material **matar=NULL; int a, totcol=0; @@ -3111,7 +3112,7 @@ static void unlink_material_cb(bContext *C, Scene *scene, TreeElement *te, TreeS } } -static void unlink_texture_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void unlink_texture_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *UNUSED(tselem)) { MTex **mtex= NULL; int a; @@ -3140,7 +3141,7 @@ static void unlink_texture_cb(bContext *C, Scene *scene, TreeElement *te, TreeSt } } -static void unlink_group_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void unlink_group_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *tsep, TreeStoreElem *tselem) { Group *group= (Group *)tselem->id; @@ -3177,7 +3178,7 @@ static void outliner_do_libdata_operation(bContext *C, Scene *scene, SpaceOops * /* */ -static void object_select_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void object_select_cb(bContext *UNUSED(C), Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; @@ -3188,7 +3189,7 @@ static void object_select_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto } } -static void object_deselect_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void object_deselect_cb(bContext *UNUSED(C), Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; @@ -3199,7 +3200,7 @@ static void object_deselect_cb(bContext *C, Scene *scene, TreeElement *te, TreeS } } -static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; @@ -3217,7 +3218,7 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto } -static void id_local_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void id_local_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { if(tselem->id->lib && (tselem->id->flag & LIB_EXTERN)) { tselem->id->lib= NULL; @@ -3226,7 +3227,7 @@ static void id_local_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreEle } } -static void group_linkobs2scene_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void group_linkobs2scene_cb(bContext *UNUSED(C), Scene *scene, TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Group *group= (Group *)tselem->id; GroupObject *gob; @@ -3279,7 +3280,7 @@ static void outliner_do_object_operation(bContext *C, Scene *scene_act, SpaceOop /* ******************************************** */ -static void pchan_cb(int event, TreeElement *te, TreeStoreElem *tselem) +static void pchan_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem)) { bPoseChannel *pchan= (bPoseChannel *)te->directdata; @@ -3295,7 +3296,7 @@ static void pchan_cb(int event, TreeElement *te, TreeStoreElem *tselem) pchan->bone->flag &= ~BONE_HIDDEN_P; } -static void bone_cb(int event, TreeElement *te, TreeStoreElem *tselem) +static void bone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem)) { Bone *bone= (Bone *)te->directdata; @@ -3311,7 +3312,7 @@ static void bone_cb(int event, TreeElement *te, TreeStoreElem *tselem) bone->flag &= ~BONE_HIDDEN_P; } -static void ebone_cb(int event, TreeElement *te, TreeStoreElem *tselem) +static void ebone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem)) { EditBone *ebone= (EditBone *)te->directdata; @@ -3327,7 +3328,7 @@ static void ebone_cb(int event, TreeElement *te, TreeStoreElem *tselem) ebone->flag &= ~BONE_HIDDEN_A; } -static void sequence_cb(int event, TreeElement *te, TreeStoreElem *tselem) +static void sequence_cb(int event, TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tselem)) { // Sequence *seq= (Sequence*) te->directdata; if(event==1) { @@ -3354,7 +3355,7 @@ static void outliner_do_data_operation(SpaceOops *soops, int type, int event, Li } } -void outliner_del(bContext *C, Scene *scene, ARegion *ar, SpaceOops *soops) +void outliner_del(bContext *C, Scene *scene, ARegion *UNUSED(ar), SpaceOops *soops) { if(soops->outlinevis==SO_SEQUENCE) @@ -3764,7 +3765,7 @@ static int ed_operator_outliner_datablocks_active(bContext *C) * this function does not do that yet */ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreElem *tselem, - ID **id, char **path, int *array_index, short *flag, short *groupmode) + ID **id, char **path, int *array_index, short *flag, short *UNUSED(groupmode)) { ListBase hierarchy = {NULL, NULL}; LinkData *ld; @@ -4816,7 +4817,7 @@ static void outliner_draw_tree(bContext *C, uiBlock *block, Scene *scene, ARegio } -static void outliner_back(ARegion *ar, SpaceOops *soops) +static void outliner_back(ARegion *ar) { int ystart; @@ -4830,7 +4831,7 @@ static void outliner_back(ARegion *ar, SpaceOops *soops) } } -static void outliner_draw_restrictcols(ARegion *ar, SpaceOops *soops) +static void outliner_draw_restrictcols(ARegion *ar) { int ystart; @@ -4873,7 +4874,7 @@ static void restrictbutton_view_cb(bContext *C, void *poin, void *poin2) Scene *scene = (Scene *)poin; Object *ob = (Object *)poin2; - if(!common_restrict_check(C, scene, ob)) return; + if(!common_restrict_check(C, ob)) return; /* deselect objects that are invisible */ if (ob->restrictflag & OB_RESTRICT_VIEW) { @@ -4890,7 +4891,7 @@ static void restrictbutton_sel_cb(bContext *C, void *poin, void *poin2) Scene *scene = (Scene *)poin; Object *ob = (Object *)poin2; - if(!common_restrict_check(C, scene, ob)) return; + if(!common_restrict_check(C, ob)) return; /* if select restriction has just been turned on */ if (ob->restrictflag & OB_RESTRICT_SELECT) { @@ -4902,17 +4903,17 @@ static void restrictbutton_sel_cb(bContext *C, void *poin, void *poin2) } -static void restrictbutton_rend_cb(bContext *C, void *poin, void *poin2) +static void restrictbutton_rend_cb(bContext *C, void *poin, void *UNUSED(poin2)) { WM_event_add_notifier(C, NC_SCENE|ND_OB_RENDER, poin); } -static void restrictbutton_r_lay_cb(bContext *C, void *poin, void *poin2) +static void restrictbutton_r_lay_cb(bContext *C, void *poin, void *UNUSED(poin2)) { WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, poin); } -static void restrictbutton_modifier_cb(bContext *C, void *poin, void *poin2) +static void restrictbutton_modifier_cb(bContext *C, void *UNUSED(poin), void *poin2) { Object *ob = (Object *)poin2; @@ -4921,7 +4922,7 @@ static void restrictbutton_modifier_cb(bContext *C, void *poin, void *poin2) WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); } -static void restrictbutton_bone_cb(bContext *C, void *poin, void *poin2) +static void restrictbutton_bone_cb(bContext *C, void *UNUSED(poin), void *poin2) { Bone *bone= (Bone *)poin2; if(bone && (bone->flag & BONE_HIDDEN_P)) @@ -4929,7 +4930,7 @@ static void restrictbutton_bone_cb(bContext *C, void *poin, void *poin2) WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL); } -static void restrictbutton_ebone_cb(bContext *C, void *poin, void *poin2) +static void restrictbutton_ebone_cb(bContext *C, void *UNUSED(poin), void *poin2) { EditBone *ebone= (EditBone *)poin2; if(ebone && (ebone->flag & BONE_HIDDEN_A)) @@ -4961,7 +4962,7 @@ static int group_select_flag(Group *gr) return 0; } -static void restrictbutton_gr_restrict_flag(bContext *C, void *poin, void *poin2, int flag) +static void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag) { Scene *scene = (Scene *)poin; GroupObject *gob; @@ -4989,17 +4990,17 @@ static void restrictbutton_gr_restrict_flag(bContext *C, void *poin, void *poin2 static void restrictbutton_gr_restrict_view(bContext *C, void *poin, void *poin2) { - restrictbutton_gr_restrict_flag(C, poin, poin2, OB_RESTRICT_VIEW); + restrictbutton_gr_restrict_flag(poin, poin2, OB_RESTRICT_VIEW); WM_event_add_notifier(C, NC_GROUP, NULL); } static void restrictbutton_gr_restrict_select(bContext *C, void *poin, void *poin2) { - restrictbutton_gr_restrict_flag(C, poin, poin2, OB_RESTRICT_SELECT); + restrictbutton_gr_restrict_flag(poin, poin2, OB_RESTRICT_SELECT); WM_event_add_notifier(C, NC_GROUP, NULL); } static void restrictbutton_gr_restrict_render(bContext *C, void *poin, void *poin2) { - restrictbutton_gr_restrict_flag(C, poin, poin2, OB_RESTRICT_RENDER); + restrictbutton_gr_restrict_flag(poin, poin2, OB_RESTRICT_RENDER); WM_event_add_notifier(C, NC_GROUP, NULL); } @@ -5245,7 +5246,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar } } -static void outliner_draw_rnacols(ARegion *ar, SpaceOops *soops, int sizex) +static void outliner_draw_rnacols(ARegion *ar, int sizex) { View2D *v2d= &ar->v2d; @@ -5297,7 +5298,7 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa } } -static void operator_call_cb(struct bContext *C, void *arg_kmi, void *arg2) +static void operator_call_cb(struct bContext *UNUSED(C), void *arg_kmi, void *arg2) { wmOperatorType *ot= arg2; wmKeyMapItem *kmi= arg_kmi; @@ -5306,7 +5307,7 @@ static void operator_call_cb(struct bContext *C, void *arg_kmi, void *arg2) BLI_strncpy(kmi->idname, ot->idname, OP_MAX_TYPENAME); } -static void operator_search_cb(const struct bContext *C, void *arg_kmi, char *str, uiSearchItems *items) +static void operator_search_cb(const struct bContext *UNUSED(C), void *UNUSED(arg_kmi), char *str, uiSearchItems *items) { wmOperatorType *ot = WM_operatortype_first(); @@ -5457,7 +5458,7 @@ static char *keymap_tweak_dir_menu(void) } -static void keymap_type_cb(bContext *C, void *kmi_v, void *unused_v) +static void keymap_type_cb(bContext *C, void *kmi_v, void *UNUSED(arg_v)) { wmKeyMapItem *kmi= kmi_v; short maptype= keymap_menu_type(kmi->type); @@ -5662,13 +5663,13 @@ void draw_outliner(const bContext *C) UI_view2d_view_ortho(v2d); /* draw outliner stuff (background, hierachy lines and names) */ - outliner_back(ar, soops); + outliner_back(ar); block= uiBeginBlock(C, ar, "outliner buttons", UI_EMBOSS); outliner_draw_tree((bContext *)C, block, scene, ar, soops); if(ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) { /* draw rna buttons */ - outliner_draw_rnacols(ar, soops, sizex_rna); + outliner_draw_rnacols(ar, sizex_rna); outliner_draw_rnabuts(block, scene, ar, soops, sizex_rna, &soops->tree); } else if(soops->outlinevis == SO_KEYMAP) { @@ -5676,7 +5677,7 @@ void draw_outliner(const bContext *C) } else if (!(soops->flag & SO_HIDE_RESTRICTCOLS)) { /* draw restriction columns */ - outliner_draw_restrictcols(ar, soops); + outliner_draw_restrictcols(ar); outliner_draw_restrictbuts(block, scene, ar, soops, &soops->tree); } diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index cb51b609a31..f31910d8289 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -84,11 +84,11 @@ static void outliner_main_area_draw(const bContext *C, ARegion *ar) } -static void outliner_main_area_free(ARegion *ar) +static void outliner_main_area_free(ARegion *UNUSED(ar)) { + } - static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ @@ -179,7 +179,7 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn) /* ************************ header outliner area region *********************** */ /* add handlers, stuff you only do once or on area/region changes */ -static void outliner_header_area_init(wmWindowManager *wm, ARegion *ar) +static void outliner_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } @@ -189,7 +189,7 @@ static void outliner_header_area_draw(const bContext *C, ARegion *ar) ED_region_header(C, ar); } -static void outliner_header_area_free(ARegion *ar) +static void outliner_header_area_free(ARegion *UNUSED(ar)) { } @@ -210,7 +210,7 @@ static void outliner_header_area_listener(ARegion *ar, wmNotifier *wmn) /* ******************** default callbacks for outliner space ***************** */ -static SpaceLink *outliner_new(const bContext *C) +static SpaceLink *outliner_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceOops *soutliner; @@ -254,7 +254,7 @@ static void outliner_free(SpaceLink *sl) } /* spacetype; init callback */ -static void outliner_init(wmWindowManager *wm, ScrArea *sa) +static void outliner_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { } diff --git a/source/blender/editors/space_script/script_header.c b/source/blender/editors/space_script/script_header.c index 6e65d458451..1159139eff5 100644 --- a/source/blender/editors/space_script/script_header.c +++ b/source/blender/editors/space_script/script_header.c @@ -32,7 +32,7 @@ #include "BLI_blenlib.h" - +#include "BKE_utildefines.h" #include "BKE_context.h" #include "ED_screen.h" @@ -50,12 +50,12 @@ /* ************************ header area region *********************** */ -static void do_viewmenu(bContext *C, void *arg, int event) +static void do_viewmenu(bContext *UNUSED(C), void *UNUSED(arg), int UNUSED(event)) { } -static uiBlock *dummy_viewmenu(bContext *C, ARegion *ar, void *arg_unused) +static uiBlock *dummy_viewmenu(bContext *C, ARegion *ar, void *UNUSED(arg)) { ScrArea *curarea= CTX_wm_area(C); uiBlock *block; @@ -81,7 +81,7 @@ static uiBlock *dummy_viewmenu(bContext *C, ARegion *ar, void *arg_unused) return block; } -static void do_script_buttons(bContext *C, void *arg, int event) +static void do_script_buttons(bContext *UNUSED(C), void *UNUSED(arg), int event) { switch(event) { } diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index ce6edc3a565..66f630bb5b3 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -61,7 +61,7 @@ /* ******************** default callbacks for script space ***************** */ -static SpaceLink *script_new(const bContext *C) +static SpaceLink *script_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceScript *sscript; @@ -107,7 +107,7 @@ static void script_free(SpaceLink *sl) /* spacetype; init callback */ -static void script_init(struct wmWindowManager *wm, ScrArea *sa) +static void script_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { } @@ -164,7 +164,7 @@ static void script_main_area_draw(const bContext *C, ARegion *ar) } /* add handlers, stuff you only do once or on area/region changes */ -static void script_header_area_init(wmWindowManager *wm, ARegion *ar) +static void script_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } @@ -174,7 +174,7 @@ static void script_header_area_draw(const bContext *C, ARegion *ar) ED_region_header(C, ar); } -static void script_main_area_listener(ARegion *ar, wmNotifier *wmn) +static void script_main_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn)) { /* context changes */ // XXX - Todo, need the ScriptSpace accessible to get the python script to run. diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c index 69eccfec2e1..aa0686bc9bb 100644 --- a/source/blender/editors/space_sequencer/sequencer_buttons.c +++ b/source/blender/editors/space_sequencer/sequencer_buttons.c @@ -47,13 +47,13 @@ #include "sequencer_intern.h" -static void do_sequencer_panel_events(bContext *C, void *arg, int event) +static void do_sequencer_panel_events(bContext *UNUSED(C), void *UNUSED(arg), int UNUSED(event)) { } -static void sequencer_panel_view_properties(const bContext *C, Panel *pa) +static void sequencer_panel_view_properties(const bContext *UNUSED(C), Panel *pa) { uiBlock *block; @@ -63,7 +63,7 @@ static void sequencer_panel_view_properties(const bContext *C, Panel *pa) } -static void sequencer_panel_properties(const bContext *C, Panel *pa) +static void sequencer_panel_properties(const bContext *UNUSED(C), Panel *pa) { uiBlock *block; diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index eb61633d44c..c4ae658ce37 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -357,7 +357,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short dire } } -static void draw_seq_extensions(Scene *scene, ARegion *ar, SpaceSeq *sseq, Sequence *seq) +static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq) { float x1, x2, y1, y2, pixely, a; char col[3], blendcol[3]; @@ -586,7 +586,7 @@ Draw a sequence strip, bounds check already made ARegion is currently only used to get the windows width in pixels so wave file sample drawing precision is zoom adjusted */ -static void draw_seq_strip(Scene *scene, ARegion *ar, SpaceSeq *sseq, Sequence *seq, int outline_tint, float pixelx) +static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline_tint, float pixelx) { View2D *v2d= &ar->v2d; float x1, x2, y1, y2; @@ -616,7 +616,7 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, SpaceSeq *sseq, Sequence * /* draw additional info and controls */ if (!is_single_image) - draw_seq_extensions(scene, ar, sseq, seq); + draw_seq_extensions(scene, ar, seq); draw_seq_handle(v2d, seq, pixelx, SEQ_LEFTHANDLE); draw_seq_handle(v2d, seq, pixelx, SEQ_RIGHTHANDLE); @@ -866,7 +866,7 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq UI_view2d_view_restore(C); } -void drawprefetchseqspace(Scene *scene, ARegion *ar, SpaceSeq *sseq) +void drawprefetchseqspace(Scene *scene, ARegion *UNUSED(ar), SpaceSeq *sseq) { int rectx, recty; int render_size = sseq->render_size; @@ -936,7 +936,6 @@ static void draw_seq_backdrop(View2D *v2d) static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) { Scene *scene= CTX_data_scene(C); - SpaceSeq *sseq= CTX_wm_space_seq(C); View2D *v2d= &ar->v2d; Sequence *last_seq = seq_active_get(scene); int sel = 0, j; @@ -958,7 +957,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) else if (seq->machine > v2d->cur.ymax) continue; /* strip passed all tests unscathed... so draw it now */ - draw_seq_strip(scene, ar, sseq, seq, outline_tint, pixelx); + draw_seq_strip(scene, ar, seq, outline_tint, pixelx); } /* draw selected next time round */ @@ -967,14 +966,11 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) /* draw the last selected last (i.e. 'active' in other parts of Blender), removes some overlapping error */ if (last_seq) - draw_seq_strip(scene, ar, sseq, last_seq, 120, pixelx); + draw_seq_strip(scene, ar, last_seq, 120, pixelx); } -static void seq_draw_sfra_efra(const bContext *C, SpaceSeq *sseq, ARegion *ar) -{ - View2D *v2d= UI_view2d_fromcontext(C); - Scene *scene= CTX_data_scene(C); - +static void seq_draw_sfra_efra(Scene *scene, View2D *v2d) +{ glEnable(GL_BLEND); /* draw darkened area outside of active timeline @@ -1031,7 +1027,7 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) /* regular grid-pattern over the rest of the view (i.e. frame grid lines) */ UI_view2d_constant_grid_draw(v2d); - seq_draw_sfra_efra(C, sseq, ar); + seq_draw_sfra_efra(scene, v2d); /* sequence strips (if there is data available to be drawn) */ if (ed) { diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index b41d0cb21d4..bd53615feda 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -69,11 +69,11 @@ /* own include */ #include "sequencer_intern.h" -static void error(const char *dummy) {} -static void waitcursor(int val) {} -static void activate_fileselect(int d1, char *d2, char *d3, void *d4) {} -static int pupmenu(const char *dummy) {return 0;} -static int okee(const char *dummy) {return 0;} +static void error(const char *UNUSED(dummy)) {} +static void waitcursor(int UNUSED(val)) {} +static void activate_fileselect(int UNUSED(d1), char *UNUSED(d2), char *UNUSED(d3), void *UNUSED(d4)) {} +static int pupmenu(const char *UNUSED(dummy)) {return 0;} +static int okee(const char *UNUSED(dummy)) {return 0;} /* XXX */ @@ -468,7 +468,7 @@ static void reload_sound_strip(Scene *scene, char *name) } #endif -static void reload_image_strip(Scene *scene, char *name) +static void reload_image_strip(Scene *scene, char *UNUSED(name)) { Editing *ed= seq_give_editing(scene, FALSE); Sequence *seq=NULL, *seqact; @@ -735,7 +735,7 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de } -static Sequence *cut_seq_hard(Main *bmain, Scene *scene, Sequence * seq, int cutframe) +static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe) { TransSeq ts; Sequence *seqn = 0; @@ -782,7 +782,7 @@ static Sequence *cut_seq_hard(Main *bmain, Scene *scene, Sequence * seq, int cut } } - reload_sequence_new_file(bmain, scene, seq, FALSE); + reload_sequence_new_file(scene, seq, FALSE); calc_sequence(scene, seq); new_tstripdata(seq); @@ -822,14 +822,14 @@ static Sequence *cut_seq_hard(Main *bmain, Scene *scene, Sequence * seq, int cut seqn->startstill = 0; } - reload_sequence_new_file(bmain, scene, seqn, FALSE); + reload_sequence_new_file(scene, seqn, FALSE); calc_sequence(scene, seqn); new_tstripdata(seqn); } return seqn; } -static Sequence *cut_seq_soft(Main *bmain, Scene *scene, Sequence * seq, int cutframe) +static Sequence *cut_seq_soft(Scene *scene, Sequence * seq, int cutframe) { TransSeq ts; Sequence *seqn = 0; @@ -919,8 +919,8 @@ static Sequence *cut_seq_soft(Main *bmain, Scene *scene, Sequence * seq, int cut /* like duplicate, but only duplicate and cut overlapping strips, * strips to the left of the cutframe are ignored and strips to the right are moved into the new list */ -static int cut_seq_list(Main *bmain, Scene *scene, ListBase *old, ListBase *new, int cutframe, - Sequence * (*cut_seq)(Main *, Scene *, Sequence *, int)) +static int cut_seq_list(Scene *scene, ListBase *old, ListBase *new, int cutframe, + Sequence * (*cut_seq)(Scene *, Sequence *, int)) { int did_something = FALSE; Sequence *seq, *seq_next; @@ -934,7 +934,7 @@ static int cut_seq_list(Main *bmain, Scene *scene, ListBase *old, ListBase *new, if(seq->flag & SELECT) { if(cutframe > seq->startdisp && cutframe < seq->enddisp) { - Sequence * seqn = cut_seq(bmain, scene, seq, cutframe); + Sequence * seqn = cut_seq(scene, seq, cutframe); if (seqn) { BLI_addtail(new, seqn); } @@ -1004,7 +1004,8 @@ void touch_seq_files(Scene *scene) waitcursor(0); } -void set_filter_seq(Main *bmain, Scene *scene) +/* +static void set_filter_seq(Scene *scene) { Sequence *seq; Editing *ed= seq_give_editing(scene, FALSE); @@ -1018,15 +1019,15 @@ void set_filter_seq(Main *bmain, Scene *scene) if(seq->flag & SELECT) { if(seq->type==SEQ_MOVIE) { seq->flag |= SEQ_FILTERY; - reload_sequence_new_file(bmain, scene, seq, FALSE); + reload_sequence_new_file(scene, seq, FALSE); calc_sequence(scene, seq); } } } SEQ_END - } +*/ void seq_remap_paths(Scene *scene) { @@ -1506,7 +1507,6 @@ static EnumPropertyItem prop_cut_types[] = { static int sequencer_cut_exec(bContext *C, wmOperator *op) { - Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); int cut_side, cut_hard, cut_frame; @@ -1521,11 +1521,9 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op) newlist.first= newlist.last= NULL; if (cut_hard==SEQ_CUT_HARD) { - changed = cut_seq_list(bmain, scene, - ed->seqbasep, &newlist, cut_frame, cut_seq_hard); + changed = cut_seq_list(scene, ed->seqbasep, &newlist, cut_frame, cut_seq_hard); } else { - changed = cut_seq_list(bmain, scene, - ed->seqbasep, &newlist, cut_frame, cut_seq_soft); + changed = cut_seq_list(scene, ed->seqbasep, &newlist, cut_frame, cut_seq_soft); } if (newlist.first) { /* got new strips ? */ diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index eee336eab1d..720aa098ff6 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -58,7 +58,7 @@ /* own include */ #include "sequencer_intern.h" -static void *find_nearest_marker(int d1, int d2) {return NULL;} +static void *find_nearest_marker(int UNUSED(d1), int UNUSED(d2)) {return NULL;} void select_surrounding_handles(Scene *scene, Sequence *test) /* XXX BRING BACK */ { diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index a4b7a17ec13..84daf04e4aa 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -236,7 +236,7 @@ static SpaceLink *sequencer_new(const bContext *C) } /* not spacelink itself */ -static void sequencer_free(SpaceLink *sl) +static void sequencer_free(SpaceLink *UNUSED(sl)) { // SpaceSeq *sseq= (SpaceSequencer*) sl; @@ -246,7 +246,7 @@ static void sequencer_free(SpaceLink *sl) /* spacetype; init callback */ -static void sequencer_init(struct wmWindowManager *wm, ScrArea *sa) +static void sequencer_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { } @@ -296,7 +296,7 @@ static void sequencer_main_area_draw(const bContext *C, ARegion *ar) /* ************* dropboxes ************* */ -static int image_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int image_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) { if(drag->type==WM_DRAG_PATH) if(ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */ @@ -304,7 +304,7 @@ static int image_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) return 0; } -static int movie_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int movie_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) { if(drag->type==WM_DRAG_PATH) if(ELEM3(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */ @@ -312,7 +312,7 @@ static int movie_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) return 0; } -static int sound_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int sound_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) { if(drag->type==WM_DRAG_PATH) if(ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) /* rule might not work? */ @@ -352,7 +352,7 @@ static void sequencer_dropboxes(void) /* ************* end drop *********** */ /* add handlers, stuff you only do once or on area/region changes */ -static void sequencer_header_area_init(wmWindowManager *wm, ARegion *ar) +static void sequencer_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } diff --git a/source/blender/editors/space_sound/sound_header.c b/source/blender/editors/space_sound/sound_header.c index fbf6d8c85c9..c857d33bcab 100644 --- a/source/blender/editors/space_sound/sound_header.c +++ b/source/blender/editors/space_sound/sound_header.c @@ -34,6 +34,7 @@ #include "BLI_blenlib.h" +#include "BKE_utildefines.h" #include "BKE_context.h" #include "ED_screen.h" @@ -53,12 +54,12 @@ /* ************************ header area region *********************** */ -static void do_viewmenu(bContext *C, void *arg, int event) +static void do_viewmenu(bContext *UNUSED(C), void *UNUSED(arg), int UNUSED(event)) { } -static uiBlock *dummy_viewmenu(bContext *C, ARegion *ar, void *arg_unused) +static uiBlock *dummy_viewmenu(bContext *C, ARegion *ar, void *UNUSED(arg)) { ScrArea *curarea= CTX_wm_area(C); uiBlock *block; @@ -84,7 +85,7 @@ static uiBlock *dummy_viewmenu(bContext *C, ARegion *ar, void *arg_unused) return block; } -static void do_sound_buttons(bContext *C, void *arg, int event) +static void do_sound_buttons(bContext *UNUSED(C), void *UNUSED(arg), int event) { switch(event) { } diff --git a/source/blender/editors/space_sound/space_sound.c b/source/blender/editors/space_sound/space_sound.c index 919395f3bff..99b24479967 100644 --- a/source/blender/editors/space_sound/space_sound.c +++ b/source/blender/editors/space_sound/space_sound.c @@ -55,7 +55,7 @@ /* ******************** default callbacks for sound space ***************** */ -static SpaceLink *sound_new(const bContext *C) +static SpaceLink *sound_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceSound *ssound; @@ -106,7 +106,7 @@ static SpaceLink *sound_new(const bContext *C) } /* not spacelink itself */ -static void sound_free(SpaceLink *sl) +static void sound_free(SpaceLink *UNUSED(sl)) { // SpaceSound *ssound= (SpaceSound*) sl; @@ -115,7 +115,7 @@ static void sound_free(SpaceLink *sl) /* spacetype; init callback */ -static void sound_init(struct wmWindowManager *wm, ScrArea *sa) +static void sound_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { } @@ -169,13 +169,13 @@ void sound_operatortypes(void) } -void sound_keymap(struct wmKeyConfig *keyconf) +void sound_keymap(struct wmKeyConfig *UNUSED(keyconf)) { } /* add handlers, stuff you only do once or on area/region changes */ -static void sound_header_area_init(wmWindowManager *wm, ARegion *ar) +static void sound_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); } @@ -202,7 +202,7 @@ static void sound_header_area_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); } -static void sound_main_area_listener(ARegion *ar, wmNotifier *wmn) +static void sound_main_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn)) { /* context changes */ } diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 4e1bc818ce4..06346bc89ed 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -59,7 +59,7 @@ /* ******************** default callbacks for text space ***************** */ -static SpaceLink *text_new(const bContext *C) +static SpaceLink *text_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceText *stext; @@ -97,7 +97,7 @@ static void text_free(SpaceLink *sl) /* spacetype; init callback */ -static void text_init(struct wmWindowManager *wm, ScrArea *sa) +static void text_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { } @@ -395,7 +395,7 @@ static void text_main_area_draw(const bContext *C, ARegion *ar) /* scrollers? */ } -static void text_cursor(wmWindow *win, ScrArea *sa, ARegion *ar) +static void text_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *UNUSED(ar)) { WM_cursor_set(win, BC_TEXTEDITCURSOR); } @@ -404,7 +404,7 @@ static void text_cursor(wmWindow *win, ScrArea *sa, ARegion *ar) /* ************* dropboxes ************* */ -static int text_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int text_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) { if(drag->type==WM_DRAG_PATH) if(ELEM(drag->icon, 0, ICON_FILE_BLANK)) /* rule might not work? */ @@ -433,7 +433,7 @@ static void text_dropboxes(void) /****************** header region ******************/ /* add handlers, stuff you only do once or on area/region changes */ -static void text_header_area_init(wmWindowManager *wm, ARegion *ar) +static void text_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index c6036eb354b..024eef9092a 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -67,11 +67,11 @@ static void text_font_begin(SpaceText *st) BLF_size(mono, st->lheight, 72); } -static void text_font_end(SpaceText *st) +static void text_font_end(SpaceText *UNUSED(st)) { } -static int text_font_draw(SpaceText *st, int x, int y, char *str) +static int text_font_draw(SpaceText *UNUSED(st), int x, int y, char *str) { BLF_position(mono, x, y, 0); BLF_draw(mono, str); @@ -92,7 +92,7 @@ static int text_font_draw_character(SpaceText *st, int x, int y, char c) return st->cwidth; } -int text_font_width(SpaceText *st, char *str) +int text_font_width(SpaceText *UNUSED(st), char *str) { return BLF_width(mono, str); } @@ -1173,7 +1173,7 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll) CLAMP(st->txtscroll.ymax, pix_bottom_margin, ar->winy - pix_top_margin); } -static void draw_textscroll(SpaceText *st, ARegion *ar, rcti *scroll) +static void draw_textscroll(SpaceText *st, rcti *scroll) { bTheme *btheme= U.themes.first; uiWidgetColors wcol= btheme->tui.wcol_scroll; @@ -1781,7 +1781,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) draw_brackets(st, ar); draw_markers(st, ar); glTranslatef(0.375f, 0.375f, 0.0f); /* XXX scroll requires exact pixel space */ - draw_textscroll(st, ar, &scroll); + draw_textscroll(st, &scroll); draw_documentation(st, ar); draw_suggestion_list(st, ar); diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index 81968221765..c229e685aba 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -53,7 +53,7 @@ int text_check_whitespace(char ch); int text_font_width_character(struct SpaceText *st); int text_font_width(struct SpaceText *st, char *str); -void text_update_line_edited(struct Text *text, struct TextLine *line); +void text_update_line_edited(struct TextLine *line); void text_update_edited(struct Text *text); void text_update_character_width(struct SpaceText *st); void text_update_cursor_moved(struct bContext *C); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 0d6c226c6d4..90fab7b2902 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -66,7 +66,7 @@ /************************ poll ***************************/ -static int text_new_poll(bContext *C) +static int text_new_poll(bContext *UNUSED(C)) { return 1; } @@ -125,7 +125,7 @@ static int text_region_edit_poll(bContext *C) /********************** updates *********************/ -void text_update_line_edited(Text *text, TextLine *line) +void text_update_line_edited(TextLine *line) { if(!line) return; @@ -142,7 +142,7 @@ void text_update_edited(Text *text) TextLine *line; for(line=text->lines.first; line; line=line->next) - text_update_line_edited(text, line); + text_update_line_edited(line); } /******************* new operator *********************/ @@ -938,8 +938,8 @@ static int line_break_exec(bContext *C, wmOperator *UNUSED(op)) if(text->curl) { if(text->curl->prev) - text_update_line_edited(text, text->curl->prev); - text_update_line_edited(text, text->curl); + text_update_line_edited(text->curl->prev); + text_update_line_edited(text->curl); } text_update_cursor_moved(C); @@ -1417,7 +1417,7 @@ static int text_get_cursor_rel(SpaceText* st, ARegion *ar, TextLine *linein, int return selc; } -static int cursor_skip_find_line(SpaceText* st, ARegion *ar, Text *text, +static int cursor_skip_find_line(SpaceText* st, ARegion *ar, int lines, TextLine **linep, int *charp, int *rell, int *relc) { int offl, offc, visible_lines; @@ -1713,7 +1713,7 @@ static void cursor_skip(SpaceText* st, ARegion *ar, Text *text, int lines, int s int rell, relc; /* find line and offsets inside it needed to set cursor position */ - if(cursor_skip_find_line(st, ar, text, lines, linep, charp, &rell, &relc)) + if(cursor_skip_find_line(st, ar, lines, linep, charp, &rell, &relc)) *charp= text_get_cursor_rel (st, ar, *linep, rell, relc); } else { while (lines>0 && (*linep)->next) { @@ -1918,7 +1918,7 @@ static int delete_exec(bContext *C, wmOperator *op) else if(type == DEL_NEXT_CHAR) txt_delete_char(text); - text_update_line_edited(text, text->curl); + text_update_line_edited(text->curl); text_update_cursor_moved(C); WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); @@ -2587,7 +2587,7 @@ static int insert_exec(bContext *C, wmOperator *op) if(!done) return OPERATOR_CANCELLED; - text_update_line_edited(text, text->curl); + text_update_line_edited(text->curl); text_update_cursor_moved(C); WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c index 9be554924c9..6e64bef4c85 100644 --- a/source/blender/editors/space_text/text_python.c +++ b/source/blender/editors/space_text/text_python.c @@ -204,7 +204,7 @@ short do_texttools(SpaceText *st, char ascii, unsigned short evnt, short val) if(tools & TOOL_SUGG_LIST) { if((ascii != '_' && ascii != '*' && ispunct(ascii)) || text_check_whitespace(ascii)) { confirm_suggestion(st->text, 0); - text_update_line_edited(st->text, st->text->curl); + text_update_line_edited(st->text->curl); } else if((st->overwrite && txt_replace_char(st->text, ascii)) || txt_add_char(st->text, ascii)) { get_suggest_prefix(st->text, 0); @@ -230,7 +230,7 @@ short do_texttools(SpaceText *st, char ascii, unsigned short evnt, short val) case MIDDLEMOUSE: if(text_do_suggest_select(st, ar)) { confirm_suggestion(st->text, 0); - text_update_line_edited(st->text, st->text->curl); + text_update_line_edited(st->text->curl); swallow= 1; } else { @@ -248,7 +248,7 @@ short do_texttools(SpaceText *st, char ascii, unsigned short evnt, short val) case RETKEY: if(tools & TOOL_SUGG_LIST) { confirm_suggestion(st->text, 0); - text_update_line_edited(st->text, st->text->curl); + text_update_line_edited(st->text->curl); swallow= 1; draw= 1; } @@ -430,11 +430,11 @@ short do_textmarkers(SpaceText *st, char ascii, unsigned short evnt, short val) if(s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1); if(st->overwrite) { if(txt_replace_char(text, ascii)) - text_update_line_edited(st->text, st->text->curl); + text_update_line_edited(st->text->curl); } else { if(txt_add_char(text, ascii)) { - text_update_line_edited(st->text, st->text->curl); + text_update_line_edited(st->text->curl); } } @@ -459,7 +459,7 @@ short do_textmarkers(SpaceText *st, char ascii, unsigned short evnt, short val) txt_move_to(text, mrk->lineno, mrk->start+c, 0); if(s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1); txt_backspace_char(text); - text_update_line_edited(st->text, st->text->curl); + text_update_line_edited(st->text->curl); if(mrk==marker || mrk==nxt) break; mrk= nxt; } @@ -479,7 +479,7 @@ short do_textmarkers(SpaceText *st, char ascii, unsigned short evnt, short val) txt_move_to(text, mrk->lineno, mrk->start+c, 0); if(s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1); txt_delete_char(text); - text_update_line_edited(st->text, st->text->curl); + text_update_line_edited(st->text->curl); if(mrk==marker || mrk==nxt) break; mrk= nxt; } diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 37867890c15..a03baa2fa72 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -61,11 +61,8 @@ /* ************************ main time area region *********************** */ -static void time_draw_sfra_efra(const bContext *C, SpaceTime *stime, ARegion *ar) -{ - View2D *v2d= UI_view2d_fromcontext(C); - Scene *scene= CTX_data_scene(C); - +static void time_draw_sfra_efra(Scene *scene, View2D *v2d) +{ /* draw darkened area outside of active timeline * frame range used is preview range or scene range */ UI_ThemeColorShade(TH_BACK, -25); @@ -86,7 +83,7 @@ static void time_draw_sfra_efra(const bContext *C, SpaceTime *stime, ARegion *ar #define CACHE_DRAW_HEIGHT 3.0f -static void time_draw_cache(const bContext *C, SpaceTime *stime, ARegion *ar) +static void time_draw_cache(SpaceTime *stime) { SpaceTimeCache *stc; float yoffs=0.f; @@ -162,7 +159,7 @@ static void time_cache_free(SpaceTime *stime) BLI_freelistN(&stime->caches); } -static void time_cache_refresh(const bContext *C, SpaceTime *stime, ARegion *ar) +static void time_cache_refresh(const bContext *C, SpaceTime *stime) { Object *ob = CTX_data_active_object(C); PTCacheID *pid; @@ -389,7 +386,7 @@ static void time_refresh(const bContext *C, ScrArea *sa) /* find the main timeline region and refresh cache display*/ for (ar= sa->regionbase.first; ar; ar= ar->next) { if (ar->regiontype==RGN_TYPE_WINDOW) { - time_cache_refresh(C, stime, ar); + time_cache_refresh(C, stime); break; } } @@ -457,6 +454,7 @@ static void time_main_area_init(wmWindowManager *wm, ARegion *ar) static void time_main_area_draw(const bContext *C, ARegion *ar) { /* draw entirely, view changes should be handled here */ + Scene *scene= CTX_data_scene(C); SpaceTime *stime= CTX_wm_space_time(C); View2D *v2d= &ar->v2d; View2DGrid *grid; @@ -470,11 +468,11 @@ static void time_main_area_draw(const bContext *C, ARegion *ar) UI_view2d_view_ortho(v2d); /* start and end frame */ - time_draw_sfra_efra(C, stime, ar); + time_draw_sfra_efra(scene, v2d); /* grid */ unit= (stime->flag & TIME_DRAWFRAMES)? V2D_UNIT_FRAMES: V2D_UNIT_SECONDS; - grid= UI_view2d_grid_calc(CTX_data_scene(C), v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy); + grid= UI_view2d_grid_calc(scene, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy); UI_view2d_grid_draw(v2d, grid, (V2D_VERTICAL_LINES|V2D_VERTICAL_AXIS)); UI_view2d_grid_free(grid); @@ -492,7 +490,7 @@ static void time_main_area_draw(const bContext *C, ARegion *ar) draw_markers_time(C, 0); /* caches */ - time_draw_cache(C, stime, ar); + time_draw_cache(stime); /* reset view matrix */ UI_view2d_view_restore(C); @@ -533,7 +531,7 @@ static void time_main_area_listener(ARegion *ar, wmNotifier *wmn) /* ************************ header time area region *********************** */ /* add handlers, stuff you only do once or on area/region changes */ -static void time_header_area_init(wmWindowManager *wm, ARegion *ar) +static void time_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } @@ -632,7 +630,7 @@ static void time_free(SpaceLink *sl) /* spacetype; init callback in ED_area_initialize() */ /* init is called to (re)initialize an existing editor (file read, screen changes) */ /* validate spacedata, add own area level handlers */ -static void time_init(wmWindowManager *wm, ScrArea *sa) +static void time_init(wmWindowManager *UNUSED(wm), ScrArea *sa) { SpaceTime *stime= (SpaceTime *)sa->spacedata.first; diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c index 8eea83a1083..a59c03ad17d 100644 --- a/source/blender/editors/space_userpref/space_userpref.c +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -47,7 +47,7 @@ /* ******************** default callbacks for userpref space ***************** */ -static SpaceLink *userpref_new(const bContext *C) +static SpaceLink *userpref_new(const bContext *UNUSED(C)) { ARegion *ar; SpaceUserPref *spref; @@ -72,7 +72,7 @@ static SpaceLink *userpref_new(const bContext *C) } /* not spacelink itself */ -static void userpref_free(SpaceLink *sl) +static void userpref_free(SpaceLink *UNUSED(sl)) { // SpaceUserPref *spref= (SpaceUserPref*) sl; @@ -80,7 +80,7 @@ static void userpref_free(SpaceLink *sl) /* spacetype; init callback */ -static void userpref_init(struct wmWindowManager *wm, ScrArea *sa) +static void userpref_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { } @@ -111,13 +111,13 @@ void userpref_operatortypes(void) { } -void userpref_keymap(struct wmKeyConfig *keyconf) +void userpref_keymap(struct wmKeyConfig *UNUSED(keyconf)) { } /* add handlers, stuff you only do once or on area/region changes */ -static void userpref_header_area_init(wmWindowManager *wm, ARegion *ar) +static void userpref_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) { ED_region_header_init(ar); } @@ -127,19 +127,20 @@ static void userpref_header_area_draw(const bContext *C, ARegion *ar) ED_region_header(C, ar); } -static void userpref_main_area_listener(ARegion *ar, wmNotifier *wmn) +static void userpref_main_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn)) { /* context changes */ } -static void userpref_header_listener(ARegion *ar, wmNotifier *wmn) +static void userpref_header_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn)) { /* context changes */ +#if 0 switch(wmn->category) { default: break; } - +#endif } /* only called once, from space/spacetypes.c */ diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 41899a70b34..dc75efcc5ca 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2209,7 +2209,6 @@ static int add_background_image_exec(bContext *C, wmOperator *UNUSED(op)) static int add_background_image_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { - Scene *scene= CTX_data_scene(C); View3D *v3d= CTX_wm_view3d(C); Image *ima= NULL; BGpic *bgpic; diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index c004f32f586..923f4560532 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -150,7 +150,7 @@ static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value) seq->anim_startofs = MIN2(value, seq->len + seq->anim_startofs); - reload_sequence_new_file(G.main, scene, seq, FALSE); + reload_sequence_new_file(scene, seq, FALSE); rna_Sequence_frame_change_update(scene, seq); } @@ -161,7 +161,7 @@ static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value) seq->anim_endofs = MIN2(value, seq->len + seq->anim_endofs); - reload_sequence_new_file(G.main, scene, seq, FALSE); + reload_sequence_new_file(scene, seq, FALSE); rna_Sequence_frame_change_update(scene, seq); } @@ -552,7 +552,7 @@ static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Sequence_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Sequence *seq= (Sequence*)(ptr->data); - reload_sequence_new_file(G.main, scene, seq, TRUE); + reload_sequence_new_file(scene, seq, TRUE); calc_sequence(scene, seq); rna_Sequence_update(bmain, scene, ptr); } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 9179019f824..79f489137f3 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2226,7 +2226,7 @@ static int composite_needs_render(Scene *sce) } /* bad call... need to think over proper method still */ -static void render_composit_stats(void *unused, char *str) +static void render_composit_stats(void *UNUSED(arg), char *str) { R.i.infostr= str; R.stats_draw(R.sdh, &R.i); -- cgit v1.2.3 From 87533e679c3134bb3ba972a45c0d648df47703dd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Oct 2010 09:42:52 +0000 Subject: dont check for project anymore for ctrl+click, face snapping is enough. --- source/blender/editors/mesh/editmesh_add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index e1a4b2b2fd4..f90f1b095e6 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -117,7 +117,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) em_setup_viewcontext(C, &vc); - use_proj= ((vc.scene->toolsettings->snap_flag & (SCE_SNAP|SCE_SNAP_PROJECT))==(SCE_SNAP|SCE_SNAP_PROJECT)) && (vc.scene->toolsettings->snap_mode==SCE_SNAP_MODE_FACE); + use_proj= (vc.scene->toolsettings->snap_flag & SCE_SNAP) && (vc.scene->toolsettings->snap_mode==SCE_SNAP_MODE_FACE); invert_m4_m4(vc.obedit->imat, vc.obedit->obmat); -- cgit v1.2.3 From 5999658569d781bdc4e0b8fa6e0cceb2efb5e612 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 16 Oct 2010 10:14:17 +0000 Subject: Fix #24280: NURBS default "12x12" UV resolution is not actually "12x12" When adding new nurb primitive it'll have got the same resolution as curve --- source/blender/editors/curve/editcurve.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 9fa7ba44c58..97379cc110c 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -5620,6 +5620,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) Nurb *nu = NULL; BezTriple *bezt; BPoint *bp; + Curve *cu= (Curve*)obedit->data; float vec[3]; float fac, grid; int a, b, cutype, stype; @@ -5641,13 +5642,13 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) if (stype!=CU_PRIM_TUBE && stype!=CU_PRIM_DONUT) { nu = (Nurb*)MEM_callocN(sizeof(Nurb), "addNurbprim"); nu->type= cutype; - nu->resolu= 4; - nu->resolv= 4; + nu->resolu= cu->resolu; + nu->resolv= cu->resolv; } switch(stype) { case CU_PRIM_CURVE: /* curve */ - nu->resolu= 12; /* set as 4 above */ + nu->resolu= cu->resolu; if(newname) { rename_id((ID *)obedit, "Curve"); rename_id((ID *)obedit->data, "Curve"); @@ -5724,7 +5725,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) nu->pntsv= 1; nu->orderu= 5; nu->flagu= CU_NURB_ENDPOINT; /* endpoint */ - nu->resolu= 8; + nu->resolu= cu->resolu; nu->bp= callocstructN(BPoint, 5, "addNurbprim3"); bp= nu->bp; @@ -5753,7 +5754,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) break; case CU_PRIM_CIRCLE: /* circle */ - nu->resolu= 12; /* set as 4 above */ + nu->resolu= cu->resolu; if(newname) { rename_id((ID *)obedit, "CurveCircle"); rename_id((ID *)obedit->data, "CurveCircle"); @@ -5870,7 +5871,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) } nu= add_nurbs_primitive(C, mat, CU_NURBS|CU_PRIM_CIRCLE, 0); /* circle */ - nu->resolu= 4; + nu->resolu= cu->resolu; nu->flag= CU_SMOOTH; BLI_addtail(editnurb, nu); /* temporal for extrude and translate */ vec[0]=vec[1]= 0.0; @@ -5913,8 +5914,8 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) nu->pntsu= 5; nu->pntsv= 1; nu->orderu= 3; - nu->resolu= 4; - nu->resolv= 4; + nu->resolu= cu->resolu; + nu->resolv= cu->resolv; nu->flag= CU_SMOOTH; nu->bp= callocstructN(BPoint, 5, "addNurbprim6"); nu->flagu= 0; @@ -5962,8 +5963,8 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname) xzproj= 1; nu= add_nurbs_primitive(C, mat, CU_NURBS|CU_PRIM_CIRCLE, 0); /* circle */ xzproj= 0; - nu->resolu= 4; - nu->resolv= 4; + nu->resolu= cu->resolu; + nu->resolv= cu->resolv; nu->flag= CU_SMOOTH; BLI_addtail(editnurb, nu); /* temporal for spin */ -- cgit v1.2.3 From 98d6c533a606f7965d0a2bfe1da4f83942693066 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 16 Oct 2010 11:30:41 +0000 Subject: Bugfix #23979: FCurve.keyframe_points.add(..., replace=True) ... fails if there were no keyframes in the curve yet. Was a missing null-check for case when no keyframe array is created. Also, changed the description for the "replace" arg to better reflect what it really does. --- source/blender/makesrna/intern/rna_fcurve.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 63405e08f69..31ba51a9b04 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -542,14 +542,14 @@ static BezTriple *rna_FKeyframe_points_add(FCurve *fcu, float frame, float value index= insert_vert_fcurve(fcu, frame, value, flag); - return index >= 0 ? fcu->bezt + index : NULL; + return ((fcu->bezt) && (index >= 0))? (fcu->bezt + index) : NULL; } static void rna_FKeyframe_points_remove(FCurve *fcu, ReportList *reports, BezTriple *bezt, int do_fast) { int index= (int)(bezt - fcu->bezt); if (index < 0 || index >= fcu->totvert) { - BKE_report(reports, RPT_ERROR, "bezier not in fcurve."); + BKE_report(reports, RPT_ERROR, "Keyframe not in F-Curve."); return; } @@ -1320,7 +1320,7 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop) parm= RNA_def_float(func, "value", 0.0f, -FLT_MAX, FLT_MAX, "", "Y Value of this keyframe point", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); /* optional */ - parm= RNA_def_boolean(func, "replace", 0, "Replace", "Replace existing keyframes"); + parm= RNA_def_boolean(func, "replace", 0, "Replace", "Don't add any new keyframes, but just replace existing ones"); parm= RNA_def_boolean(func, "needed", 0, "Needed", "Only adds keyframes that are needed"); parm= RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe insertion to avoid recalculating the curve each time"); -- cgit v1.2.3 From 7cc5aaf18afd882ee8fefdf773fb83eb2e0f467b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 16 Oct 2010 11:52:30 +0000 Subject: Added panel for accessing the "delta transforms" for Objects (this is closed by default to not clutter that much). This should help silence complaints from some about "dloc",etc. not being easily keyable. It's also a nice way to have instances of animated objects located in different places, by animating either the standard transforms or the deltas, and then modifying by not animating the other version to keep the instances from going to a single point. This was a common newbie problem in 2.4x. --- source/blender/blenkernel/intern/object.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 861904335d7..3df9bd6ed05 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1646,7 +1646,7 @@ void object_scale_to_mat3(Object *ob, float mat[][3]) size_to_mat3( mat,vec); } -// TODO: this should take rotation orders into account later... + void object_rot_to_mat3(Object *ob, float mat[][3]) { float rmat[3][3], dmat[3][3]; @@ -1675,7 +1675,6 @@ void object_rot_to_mat3(Object *ob, float mat[][3]) } /* combine these rotations */ - // XXX is this correct? if errors, change the order of multiplication... mul_m3_m3m3(mat, dmat, rmat); } -- cgit v1.2.3 From 8268a4be71fe326b5b7b43e5e55ef751844dddbc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Oct 2010 14:32:17 +0000 Subject: most unused arg warnings corrected. - removed deprecated bitmap arg from IMB_allocImBuf (plugins will need updating). - mostly tagged UNUSED() since some of these functions look like they may need to have the arguments used later. --- source/blender/avi/intern/endian.c | 2 + source/blender/avi/intern/mjpeg.c | 2 +- source/blender/blenfont/intern/blf_lang.c | 2 + source/blender/blenkernel/BKE_cloth.h | 2 +- source/blender/blenkernel/BKE_mesh.h | 4 +- source/blender/blenkernel/BKE_object.h | 2 +- source/blender/blenkernel/BKE_scene.h | 2 +- source/blender/blenkernel/BKE_sound.h | 4 +- source/blender/blenkernel/intern/BME_tools.c | 4 +- source/blender/blenkernel/intern/DerivedMesh.c | 19 ++- source/blender/blenkernel/intern/action.c | 2 +- source/blender/blenkernel/intern/anim.c | 2 +- source/blender/blenkernel/intern/armature.c | 8 +- source/blender/blenkernel/intern/boids.c | 4 +- source/blender/blenkernel/intern/brush.c | 6 +- source/blender/blenkernel/intern/bvhutils.c | 2 +- source/blender/blenkernel/intern/cdderivedmesh.c | 6 +- source/blender/blenkernel/intern/cloth.c | 22 ++-- source/blender/blenkernel/intern/collision.c | 4 +- source/blender/blenkernel/intern/colortools.c | 10 +- source/blender/blenkernel/intern/constraint.c | 32 +++--- source/blender/blenkernel/intern/curve.c | 8 +- source/blender/blenkernel/intern/customdata.c | 6 +- source/blender/blenkernel/intern/customdata_file.c | 2 +- source/blender/blenkernel/intern/depsgraph.c | 4 +- source/blender/blenkernel/intern/displist.c | 4 +- source/blender/blenkernel/intern/effect.c | 4 +- source/blender/blenkernel/intern/fcurve.c | 4 +- source/blender/blenkernel/intern/fmodifier.c | 20 ++-- source/blender/blenkernel/intern/group.c | 3 +- source/blender/blenkernel/intern/image.c | 20 ++-- source/blender/blenkernel/intern/implicit.c | 4 +- source/blender/blenkernel/intern/ipo.c | 4 +- source/blender/blenkernel/intern/key.c | 4 +- source/blender/blenkernel/intern/library.c | 4 +- source/blender/blenkernel/intern/mesh.c | 12 +- source/blender/blenkernel/intern/multires.c | 6 +- source/blender/blenkernel/intern/nla.c | 2 +- source/blender/blenkernel/intern/object.c | 4 +- source/blender/blenkernel/intern/packedFile.c | 2 +- source/blender/blenkernel/intern/paint.c | 3 +- source/blender/blenkernel/intern/particle.c | 16 +-- source/blender/blenkernel/intern/particle_system.c | 12 +- source/blender/blenkernel/intern/pointcache.c | 26 +++-- source/blender/blenkernel/intern/scene.c | 2 +- source/blender/blenkernel/intern/seqeffects.c | 118 +++++++++---------- source/blender/blenkernel/intern/sequencer.c | 20 ++-- source/blender/blenkernel/intern/smoke.c | 4 +- source/blender/blenkernel/intern/softbody.c | 6 +- source/blender/blenkernel/intern/sound.c | 10 +- source/blender/blenkernel/intern/writeavi.c | 4 +- .../blender/blenkernel/intern/writeframeserver.c | 9 +- source/blender/blenlib/intern/BLI_kdtree.c | 1 + source/blender/blenlib/intern/dynlib.c | 1 + source/blender/blenlib/intern/noise.c | 10 +- source/blender/blenlib/intern/threads.c | 2 + source/blender/blenloader/intern/readfile.c | 2 +- source/blender/blenpluginapi/iff.h | 2 +- source/blender/blenpluginapi/intern/pluginapi.c | 5 +- .../editors/animation/anim_channels_defines.c | 128 ++++++++++----------- .../blender/editors/animation/anim_channels_edit.c | 2 +- source/blender/editors/animation/anim_deps.c | 6 +- source/blender/editors/animation/anim_filter.c | 2 +- source/blender/editors/animation/anim_markers.c | 16 +-- source/blender/editors/animation/drivers.c | 8 +- source/blender/editors/animation/fmodifier_ui.c | 18 +-- source/blender/editors/animation/keyframes_draw.c | 4 +- source/blender/editors/animation/keyframes_edit.c | 2 +- .../blender/editors/animation/keyframes_general.c | 2 +- source/blender/editors/animation/keyframing.c | 2 +- source/blender/editors/animation/keyingsets.c | 2 +- .../editors/armature/editarmature_generate.c | 6 +- .../editors/armature/editarmature_retarget.c | 6 +- .../blender/editors/armature/editarmature_sketch.c | 36 +++--- source/blender/editors/armature/meshlaplacian.c | 6 +- source/blender/editors/armature/reeb.c | 4 +- source/blender/editors/gpencil/gpencil_paint.c | 14 +-- source/blender/editors/include/ED_keyframes_draw.h | 2 +- source/blender/editors/include/ED_keyframing.h | 2 +- source/blender/editors/include/ED_mesh.h | 2 +- source/blender/editors/include/ED_object.h | 2 +- .../blender/editors/interface/interface_handlers.c | 2 +- source/blender/editors/interface/interface_icons.c | 2 +- source/blender/editors/mesh/editface.c | 16 +-- source/blender/editors/mesh/editmesh.c | 12 +- source/blender/editors/mesh/editmesh_add.c | 6 +- source/blender/editors/mesh/editmesh_lib.c | 8 +- source/blender/editors/mesh/editmesh_loop.c | 4 +- source/blender/editors/mesh/editmesh_mods.c | 10 +- source/blender/editors/mesh/editmesh_tools.c | 24 ++-- source/blender/editors/mesh/loopcut.c | 28 ++--- source/blender/editors/mesh/mesh_data.c | 4 +- source/blender/editors/metaball/mball_edit.c | 4 +- source/blender/editors/object/object_add.c | 12 +- source/blender/editors/object/object_edit.c | 20 ++-- source/blender/editors/object/object_modifier.c | 36 +++--- source/blender/editors/object/object_ops.c | 2 +- source/blender/editors/object/object_relations.c | 8 +- source/blender/editors/physics/particle_edit.c | 32 +++--- source/blender/editors/physics/physics_fluid.c | 14 +-- .../blender/editors/physics/physics_pointcache.c | 6 +- source/blender/editors/render/render_preview.c | 18 +-- source/blender/editors/render/render_shading.c | 8 +- source/blender/editors/screen/screen_edit.c | 2 +- source/blender/editors/screen/screen_ops.c | 2 +- source/blender/editors/screen/screendump.c | 4 +- source/blender/editors/sculpt_paint/paint_image.c | 6 +- source/blender/editors/sculpt_paint/paint_ops.c | 2 +- source/blender/editors/sculpt_paint/paint_undo.c | 4 +- source/blender/editors/sculpt_paint/paint_vertex.c | 8 +- source/blender/editors/sculpt_paint/sculpt.c | 2 +- source/blender/editors/sound/sound_ops.c | 2 +- .../blender/editors/space_action/action_select.c | 2 +- source/blender/editors/space_file/filelist.c | 4 +- source/blender/editors/space_file/writeimage.c | 2 +- .../editors/space_sequencer/sequencer_scopes.c | 18 +-- source/blender/editors/space_view3d/view3d_draw.c | 6 +- source/blender/editors/space_view3d/view3d_view.c | 5 +- source/blender/editors/transform/transform.c | 62 +++++----- source/blender/editors/transform/transform.h | 2 +- .../editors/transform/transform_constraints.c | 2 +- .../editors/transform/transform_conversions.c | 46 ++++---- source/blender/editors/transform/transform_input.c | 12 +- .../editors/transform/transform_manipulator.c | 2 +- .../editors/transform/transform_ndofinput.c | 2 +- .../editors/transform/transform_orientations.c | 2 +- source/blender/editors/transform/transform_snap.c | 12 +- source/blender/editors/util/editmode_undo.c | 7 +- source/blender/editors/uvedit/uvedit_draw.c | 8 +- source/blender/imbuf/IMB_imbuf.h | 3 +- source/blender/imbuf/intern/allocimbuf.c | 4 +- source/blender/imbuf/intern/anim.c | 18 +-- source/blender/imbuf/intern/bmp.c | 4 +- source/blender/imbuf/intern/cineon/cineon_dpx.c | 2 +- source/blender/imbuf/intern/dds/dds_api.cpp | 2 +- source/blender/imbuf/intern/divers.c | 8 +- source/blender/imbuf/intern/filter.c | 2 +- source/blender/imbuf/intern/iris.c | 10 +- source/blender/imbuf/intern/jp2.c | 2 +- source/blender/imbuf/intern/jpeg.c | 6 +- .../blender/imbuf/intern/openexr/openexr_api.cpp | 2 +- .../blender/imbuf/intern/openexr/openexr_multi.h | 2 +- source/blender/imbuf/intern/png.c | 5 +- source/blender/imbuf/intern/radiance_hdr.c | 4 +- source/blender/imbuf/intern/scaling.c | 10 +- source/blender/imbuf/intern/targa.c | 4 +- source/blender/imbuf/intern/thumbs.c | 2 +- source/blender/imbuf/intern/thumbs_blend.c | 2 +- source/blender/imbuf/intern/tiff.c | 19 ++- source/blender/makesrna/intern/rna_animation.c | 2 +- source/blender/makesrna/intern/rna_main_api.c | 2 +- source/blender/makesrna/intern/rna_mesh.c | 2 +- source/blender/makesrna/intern/rna_sound.c | 2 +- source/blender/makesrna/intern/rna_userdef.c | 2 +- .../blender/modifiers/intern/MOD_fluidsim_util.c | 10 ++ .../blender/nodes/intern/CMP_nodes/CMP_alphaOver.c | 6 +- .../nodes/intern/CMP_nodes/CMP_bilateralblur.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_blur.c | 2 +- .../nodes/intern/CMP_nodes/CMP_brightness.c | 2 +- .../nodes/intern/CMP_nodes/CMP_channelMatte.c | 4 +- .../nodes/intern/CMP_nodes/CMP_chromaMatte.c | 4 +- .../nodes/intern/CMP_nodes/CMP_colorSpill.c | 2 +- .../nodes/intern/CMP_nodes/CMP_colorbalance.c | 2 +- .../blender/nodes/intern/CMP_nodes/CMP_composite.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_crop.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_curves.c | 6 +- .../blender/nodes/intern/CMP_nodes/CMP_defocus.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_dilate.c | 2 +- .../nodes/intern/CMP_nodes/CMP_directionalblur.c | 2 +- .../blender/nodes/intern/CMP_nodes/CMP_displace.c | 6 +- source/blender/nodes/intern/CMP_nodes/CMP_flip.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_gamma.c | 4 +- source/blender/nodes/intern/CMP_nodes/CMP_glare.c | 2 +- .../blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c | 2 +- .../nodes/intern/CMP_nodes/CMP_huecorrect.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_image.c | 4 +- source/blender/nodes/intern/CMP_nodes/CMP_invert.c | 2 +- .../blender/nodes/intern/CMP_nodes/CMP_lensdist.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c | 4 +- .../blender/nodes/intern/CMP_nodes/CMP_mapValue.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_math.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_normal.c | 2 +- .../blender/nodes/intern/CMP_nodes/CMP_normalize.c | 4 +- .../nodes/intern/CMP_nodes/CMP_outputFile.c | 4 +- .../blender/nodes/intern/CMP_nodes/CMP_premulkey.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_rgb.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_rotate.c | 6 +- source/blender/nodes/intern/CMP_nodes/CMP_scale.c | 2 +- .../nodes/intern/CMP_nodes/CMP_sepcombHSVA.c | 8 +- .../nodes/intern/CMP_nodes/CMP_sepcombRGBA.c | 6 +- .../nodes/intern/CMP_nodes/CMP_sepcombYCCA.c | 8 +- .../nodes/intern/CMP_nodes/CMP_sepcombYUVA.c | 8 +- .../blender/nodes/intern/CMP_nodes/CMP_setalpha.c | 2 +- .../nodes/intern/CMP_nodes/CMP_splitViewer.c | 4 +- .../blender/nodes/intern/CMP_nodes/CMP_tonemap.c | 2 +- .../blender/nodes/intern/CMP_nodes/CMP_translate.c | 2 +- .../blender/nodes/intern/CMP_nodes/CMP_valToRgb.c | 6 +- source/blender/nodes/intern/CMP_nodes/CMP_value.c | 2 +- .../blender/nodes/intern/CMP_nodes/CMP_vecBlur.c | 2 +- source/blender/nodes/intern/CMP_nodes/CMP_viewer.c | 2 +- .../blender/nodes/intern/CMP_nodes/CMP_zcombine.c | 2 +- source/blender/nodes/intern/CMP_util.c | 20 ++-- source/blender/nodes/intern/SHD_nodes/SHD_camera.c | 4 +- source/blender/nodes/intern/SHD_nodes/SHD_curves.c | 4 +- source/blender/nodes/intern/SHD_nodes/SHD_geom.c | 2 +- .../blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c | 6 +- source/blender/nodes/intern/SHD_nodes/SHD_invert.c | 4 +- .../blender/nodes/intern/SHD_nodes/SHD_mapping.c | 2 +- source/blender/nodes/intern/SHD_nodes/SHD_math.c | 2 +- source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c | 2 +- source/blender/nodes/intern/SHD_nodes/SHD_normal.c | 2 +- source/blender/nodes/intern/SHD_nodes/SHD_output.c | 4 +- source/blender/nodes/intern/SHD_nodes/SHD_rgb.c | 2 +- .../nodes/intern/SHD_nodes/SHD_sepcombRGB.c | 8 +- .../blender/nodes/intern/SHD_nodes/SHD_squeeze.c | 4 +- .../blender/nodes/intern/SHD_nodes/SHD_valToRgb.c | 6 +- source/blender/nodes/intern/SHD_nodes/SHD_value.c | 2 +- .../blender/nodes/intern/SHD_nodes/SHD_vectMath.c | 2 +- source/blender/nodes/intern/TEX_nodes/TEX_at.c | 2 +- .../blender/nodes/intern/TEX_nodes/TEX_checker.c | 2 +- .../blender/nodes/intern/TEX_nodes/TEX_compose.c | 2 +- source/blender/nodes/intern/TEX_nodes/TEX_coord.c | 2 +- source/blender/nodes/intern/TEX_nodes/TEX_curves.c | 2 +- .../blender/nodes/intern/TEX_nodes/TEX_decompose.c | 8 +- .../blender/nodes/intern/TEX_nodes/TEX_distance.c | 2 +- .../blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c | 2 +- source/blender/nodes/intern/TEX_nodes/TEX_image.c | 2 +- source/blender/nodes/intern/TEX_nodes/TEX_invert.c | 2 +- source/blender/nodes/intern/TEX_nodes/TEX_output.c | 2 +- source/blender/nodes/intern/TEX_nodes/TEX_proc.c | 2 +- source/blender/nodes/intern/TEX_nodes/TEX_rotate.c | 2 +- source/blender/nodes/intern/TEX_nodes/TEX_scale.c | 2 +- .../blender/nodes/intern/TEX_nodes/TEX_translate.c | 2 +- .../blender/nodes/intern/TEX_nodes/TEX_valToNor.c | 2 +- .../blender/nodes/intern/TEX_nodes/TEX_valToRgb.c | 2 +- source/blender/nodes/intern/TEX_nodes/TEX_viewer.c | 2 +- .../blender/render/intern/source/convertblender.c | 2 +- source/blender/render/intern/source/envmap.c | 4 +- source/blender/render/intern/source/pipeline.c | 22 ++-- .../render/intern/source/rayobject_instance.c | 2 +- source/blender/render/intern/source/shadbuf.c | 2 +- source/blender/render/intern/source/sss.c | 4 +- .../blender/render/intern/source/volume_precache.c | 2 +- source/blender/windowmanager/intern/wm_files.c | 2 +- 244 files changed, 881 insertions(+), 843 deletions(-) (limited to 'source/blender') diff --git a/source/blender/avi/intern/endian.c b/source/blender/avi/intern/endian.c index 282e26b3ee8..137c664568c 100644 --- a/source/blender/avi/intern/endian.c +++ b/source/blender/avi/intern/endian.c @@ -206,6 +206,8 @@ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int t MEM_freeN (data); #else /* WORDS_BIGENDIAN */ + (void)movie; /* unused */ + (void)type; /* unused */ fwrite (datain, block, size, fp); #endif /* WORDS_BIGENDIAN */ } diff --git a/source/blender/avi/intern/mjpeg.c b/source/blender/avi/intern/mjpeg.c index fd7e8aaef83..56ba352dcf8 100644 --- a/source/blender/avi/intern/mjpeg.c +++ b/source/blender/avi/intern/mjpeg.c @@ -403,7 +403,7 @@ static void jpegmemdestmgr_build(j_compress_ptr cinfo, unsigned char *buffer, in /* Decompression from memory */ static void jpegmemsrcmgr_init_source(j_decompress_ptr dinfo) { - ; + (void)dinfo; } static boolean jpegmemsrcmgr_fill_input_buffer(j_decompress_ptr dinfo) { diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index 7054d955faf..21bf73b56d9 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -118,11 +118,13 @@ void BLF_lang_init(void) void BLF_lang_encoding(char *str) { + (void)str; return; } void BLF_lang_set(char *str) { + (void)str; return; } diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h index 034bedbb07d..e9f0304e645 100644 --- a/source/blender/blenkernel/BKE_cloth.h +++ b/source/blender/blenkernel/BKE_cloth.h @@ -220,7 +220,7 @@ void clmdSetInterruptCallBack ( int ( *f ) ( void ) ); // needed for modifier.c void cloth_free_modifier_extern ( struct ClothModifierData *clmd ); -void cloth_free_modifier ( struct Object *ob, struct ClothModifierData *clmd ); +void cloth_free_modifier ( struct ClothModifierData *clmd ); void cloth_init ( struct ClothModifierData *clmd ); struct DerivedMesh *clothModifier_do ( struct ClothModifierData *clmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc ); diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index e80c266ff70..7e1ab138acc 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -132,8 +132,8 @@ void create_vert_edge_map(ListBase **map, IndexNode **mem, const struct MEdge *m /* Partial Mesh Visibility */ struct PartialVisibility *mesh_pmv_copy(struct PartialVisibility *); void mesh_pmv_free(struct PartialVisibility *); -void mesh_pmv_revert(struct Object *ob, struct Mesh *me); -void mesh_pmv_off(struct Object *ob, struct Mesh *me); +void mesh_pmv_revert(struct Mesh *me); +void mesh_pmv_off(struct Mesh *me); /* functions for making menu's from customdata layers */ int mesh_layers_menu_charlen(struct CustomData *data, int type); /* use this to work out how many chars to allocate */ diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 2a7ba4f98c9..7451d43a578 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -71,7 +71,7 @@ void object_free_modifiers(struct Object *ob); void object_make_proxy(struct Object *ob, struct Object *target, struct Object *gob); void object_copy_proxy_drivers(struct Object *ob, struct Object *target); -void unlink_object(struct Scene *scene, struct Object *ob); +void unlink_object(struct Object *ob); int exist_object(struct Object *obtest); void *add_camera(char *name); struct Camera *copy_camera(struct Camera *cam); diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 8d5ebb64cf0..8a49e432ebd 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -64,7 +64,7 @@ struct Base *object_in_scene(struct Object *ob, struct Scene *sce); void set_scene_bg(struct Main *bmain, struct Scene *sce); struct Scene *set_scene_name(struct Main *bmain, char *name); -struct Scene *copy_scene(struct Main *bmain, struct Scene *sce, int type); +struct Scene *copy_scene(struct Scene *sce, int type); void unlink_scene(struct Main *bmain, struct Scene *sce, struct Scene *newsce); int next_object(struct Scene **scene, int val, struct Base **base, struct Object **ob); diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 190b0400aff..fb2ea4c1ca9 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -40,7 +40,7 @@ struct Sequence; void sound_init_once(); -void sound_init(struct Main *main); +void sound_init(void); void sound_exit(); @@ -62,7 +62,7 @@ void sound_cache(struct bSound* sound, int ignore); void sound_delete_cache(struct bSound* sound); -void sound_load(struct Main *main, struct bSound* sound); +void sound_load(struct bSound* sound); void sound_free(struct bSound* sound); diff --git a/source/blender/blenkernel/intern/BME_tools.c b/source/blender/blenkernel/intern/BME_tools.c index 7d9c9a431f8..e5a355e5f24 100644 --- a/source/blender/blenkernel/intern/BME_tools.c +++ b/source/blender/blenkernel/intern/BME_tools.c @@ -918,7 +918,7 @@ static int BME_face_sharededges(BME_Poly *f1, BME_Poly *f2){ * Returns - * A BME_Mesh pointer to the BMesh passed as a parameter. */ -static BME_Mesh *BME_bevel_initialize(BME_Mesh *bm, int options, int defgrp_index, float angle, BME_TransData_Head *td) { +static BME_Mesh *BME_bevel_initialize(BME_Mesh *bm, int options, int UNUSED(defgrp_index), float angle, BME_TransData_Head *td) { BME_Vert *v; BME_Edge *e; BME_Poly *f; @@ -1162,7 +1162,7 @@ static void bmesh_dissolve_disk(BME_Mesh *bm, BME_Vert *v){ //BME_JEKV(bm,v->edge,v); } } -static BME_Mesh *BME_bevel_mesh(BME_Mesh *bm, float value, int res, int options, int defgrp_index, BME_TransData_Head *td) { +static BME_Mesh *BME_bevel_mesh(BME_Mesh *bm, float value, int res, int options, int UNUSED(defgrp_index), BME_TransData_Head *td) { BME_Vert *v, *nv; BME_Edge *e, *oe; BME_Loop *l, *l2; diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 496bcc0f88c..e70dde1474a 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -517,7 +517,7 @@ static void emDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us glEnd(); } } -static void emDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges) +static void emDM_drawEdges(DerivedMesh *dm, int UNUSED(drawLooseEdges), int UNUSED(drawAllEdges)) { emDM_drawMappedEdges(dm, NULL, NULL); } @@ -628,7 +628,7 @@ static void emDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *use } /* note, material function is ignored for now. */ -static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int useColors, int (*setMaterial)(int, void *attribs)) +static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int UNUSED(useColors), int (*setMaterial)(int, void *attribs)) { EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; EditFace *efa; @@ -1326,8 +1326,7 @@ static void emDM_release(DerivedMesh *dm) } } -static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob, - float (*vertexCos)[3]) +static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, float (*vertexCos)[3]) { EditMeshDerivedMesh *emdm = MEM_callocN(sizeof(*emdm), "emdm"); @@ -2023,7 +2022,7 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri modifiers_clearErrors(ob); if(cage_r && cageIndex == -1) { - *cage_r = getEditMeshDerivedMesh(em, ob, NULL); + *cage_r = getEditMeshDerivedMesh(em, NULL); } dm = NULL; @@ -2156,7 +2155,7 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri *cage_r = dm; } else { *cage_r = - getEditMeshDerivedMesh(em, ob, + getEditMeshDerivedMesh(em, deformedVerts ? MEM_dupallocN(deformedVerts) : NULL); } } @@ -2180,7 +2179,7 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri } else if (!deformedVerts && cage_r && *cage_r) { *final_r = *cage_r; } else { - *final_r = getEditMeshDerivedMesh(em, ob, deformedVerts); + *final_r = getEditMeshDerivedMesh(em, deformedVerts); deformedVerts = NULL; } @@ -2396,9 +2395,9 @@ DerivedMesh *editmesh_get_derived_cage(Scene *scene, Object *obedit, EditMesh *e return em->derivedCage; } -DerivedMesh *editmesh_get_derived_base(Object *obedit, EditMesh *em) +DerivedMesh *editmesh_get_derived_base(Object *UNUSED(obedit), EditMesh *em) { - return getEditMeshDerivedMesh(em, obedit, NULL); + return getEditMeshDerivedMesh(em, NULL); } @@ -2484,7 +2483,7 @@ int editmesh_get_first_deform_matrices(Scene *scene, Object *ob, EditMesh *em, f if(mti->type==eModifierTypeType_OnlyDeform && mti->deformMatricesEM) { if(!defmats) { - dm= getEditMeshDerivedMesh(em, ob, NULL); + dm= getEditMeshDerivedMesh(em, NULL); deformedVerts= editmesh_getVertexCos(em, &numVerts); defmats= MEM_callocN(sizeof(*defmats)*numVerts, "defmats"); diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 90a3a6ce664..5a96575452b 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1091,7 +1091,7 @@ void copy_pose_result(bPose *to, bPose *from) /* For the calculation of the effects of an Action at the given frame on an object * This is currently only used for the Action Constraint */ -void what_does_obaction (Scene *scene, Object *ob, Object *workob, bPose *pose, bAction *act, char groupname[], float cframe) +void what_does_obaction (Scene *UNUSED(scene), Object *ob, Object *workob, bPose *pose, bAction *act, char groupname[], float cframe) { bActionGroup *agrp= action_groups_find_named(act, groupname); diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index b2feb01352e..7b52d9c586a 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1138,7 +1138,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa dm->release(dm); } -static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], ParticleSystem *psys, int level, int animated) +static void new_particle_duplilist(ListBase *lb, ID *UNUSED(id), Scene *scene, Object *par, float par_space_mat[][4], ParticleSystem *psys, int level, int animated) { GroupObject *go; Object *ob=0, **oblist=0, obcopy, *obcopylist=0; diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index f1f9fe08717..f0c39e6373e 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -252,7 +252,7 @@ Bone *get_named_bone (bArmature *arm, const char *name) * axis: the axis to name on * head/tail: the head/tail co-ordinate of the bone on the specified axis */ -int bone_autoside_name (char *name, int strip_number, short axis, float head, float tail) +int bone_autoside_name (char *name, int UNUSED(strip_number), short axis, float head, float tail) { unsigned int len; char basename[32]={""}; @@ -1057,7 +1057,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, /* ************ END Armature Deform ******************* */ -void get_objectspace_bone_matrix (struct Bone* bone, float M_accumulatedMatrix[][4], int root, int posed) +void get_objectspace_bone_matrix (struct Bone* bone, float M_accumulatedMatrix[][4], int UNUSED(root), int UNUSED(posed)) { copy_m4_m4(M_accumulatedMatrix, bone->arm_mat); } @@ -1616,7 +1616,7 @@ typedef struct tSplineIK_Tree { /* ----------- */ /* Tag the bones in the chain formed by the given bone for IK */ -static void splineik_init_tree_from_pchan(Scene *scene, Object *ob, bPoseChannel *pchan_tip) +static void splineik_init_tree_from_pchan(Scene *scene, Object *UNUSED(ob), bPoseChannel *pchan_tip) { bPoseChannel *pchan, *pchanRoot=NULL; bPoseChannel *pchanChain[255]; @@ -1785,7 +1785,7 @@ static void splineik_init_tree_from_pchan(Scene *scene, Object *ob, bPoseChannel } /* Tag which bones are members of Spline IK chains */ -static void splineik_init_tree(Scene *scene, Object *ob, float ctime) +static void splineik_init_tree(Scene *scene, Object *ob, float UNUSED(ctime)) { bPoseChannel *pchan; diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index 69a42e52247..cfe16e089cf 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -58,7 +58,7 @@ typedef struct BoidValues { static int apply_boid_rule(BoidBrainData *bbd, BoidRule *rule, BoidValues *val, ParticleData *pa, float fuzziness); -static int rule_none(BoidRule *rule, BoidBrainData *data, BoidValues *val, ParticleData *pa) +static int rule_none(BoidRule *rule, BoidBrainData *UNUSED(data), BoidValues *val, ParticleData *pa) { return 0; } @@ -823,7 +823,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro return NULL; } } -static int boid_rule_applies(ParticleData *pa, BoidSettings *boids, BoidRule *rule) +static int boid_rule_applies(ParticleData *pa, BoidSettings *UNUSED(boids), BoidRule *rule) { BoidParticle *bpa = pa->boid; diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index c67db9382f3..d894aef4ac5 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -530,7 +530,7 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf if (*outbuf) ibuf= *outbuf; else - ibuf= IMB_allocImBuf(bufsize, bufsize, 32, imbflag, 0); + ibuf= IMB_allocImBuf(bufsize, bufsize, 32, imbflag); if (flt) { for (y=0; y < ibuf->y; y++) { @@ -796,11 +796,11 @@ static void brush_painter_fixed_tex_partial_update(BrushPainter *painter, float imbflag= (cache->flt)? IB_rectfloat: IB_rect; if (!cache->ibuf) - cache->ibuf= IMB_allocImBuf(diameter, diameter, 32, imbflag, 0); + cache->ibuf= IMB_allocImBuf(diameter, diameter, 32, imbflag); ibuf= cache->ibuf; oldtexibuf= cache->texibuf; - cache->texibuf= IMB_allocImBuf(diameter, diameter, 32, imbflag, 0); + cache->texibuf= IMB_allocImBuf(diameter, diameter, 32, imbflag); if (oldtexibuf) { srcx= srcy= 0; diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 1b7257519b1..671bcb36680 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -42,7 +42,7 @@ /* Math stuff for ray casting on mesh faces and for nearest surface */ -static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float *v0, const float *v1, const float *v2) +static float ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_dist), const float *v0, const float *v1, const float *v2) { float dist; diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index b9ca7bfafe3..eb895d62f17 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -418,7 +418,7 @@ static void cdDM_drawLooseEdges(DerivedMesh *dm) static void cdDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)[4], - int fast, int (*setMaterial)(int, void *attribs)) + int UNUSED(fast), int (*setMaterial)(int, void *attribs)) { CDDerivedMesh *cddm = (CDDerivedMesh*) dm; MVert *mvert = cddm->mvert; @@ -1489,7 +1489,7 @@ DerivedMesh *CDDM_new(int numVerts, int numEdges, int numFaces) return dm; } -DerivedMesh *CDDM_from_mesh(Mesh *mesh, Object *ob) +DerivedMesh *CDDM_from_mesh(Mesh *mesh, Object *UNUSED(ob)) { CDDerivedMesh *cddm = cdDM_create("CDDM_from_mesh dm"); DerivedMesh *dm = &cddm->dm; @@ -1518,7 +1518,7 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh, Object *ob) return dm; } -DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *me) +DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *UNUSED(me)) { DerivedMesh *dm = CDDM_new(BLI_countlist(&em->verts), BLI_countlist(&em->edges), diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 3f47676d7fd..e7e94c407f1 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -87,7 +87,7 @@ static CM_SOLVER_DEF solvers [] = /* Prototypes for internal functions. */ static void cloth_to_object (Object *ob, ClothModifierData *clmd, DerivedMesh *dm); -static void cloth_from_mesh ( Object *ob, ClothModifierData *clmd, DerivedMesh *dm ); +static void cloth_from_mesh ( ClothModifierData *clmd, DerivedMesh *dm ); static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *dm, float framenr, int first); static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm ); static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm ); @@ -423,7 +423,7 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul /************************************************ * clothModifier_do - main simulation function ************************************************/ -DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) +DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, DerivedMesh *dm, int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) { DerivedMesh *result; PointCache *cache; @@ -546,7 +546,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, } /* frees all */ -void cloth_free_modifier ( Object *ob, ClothModifierData *clmd ) +void cloth_free_modifier(ClothModifierData *clmd ) { Cloth *cloth = NULL; @@ -804,7 +804,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm ) } } -static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *dm, float framenr, int first) +static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *dm, float UNUSED(framenr), int first) { int i = 0; MVert *mvert = NULL; @@ -817,7 +817,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d // If we have a clothObject, free it. if ( clmd->clothObject != NULL ) { - cloth_free_modifier ( ob, clmd ); + cloth_free_modifier ( clmd ); if(G.rt > 0) printf("cloth_free_modifier cloth_from_object\n"); } @@ -841,7 +841,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d if ( !dm ) return 0; - cloth_from_mesh ( ob, clmd, dm ); + cloth_from_mesh ( clmd, dm ); // create springs clmd->clothObject->springs = NULL; @@ -897,7 +897,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d if ( !cloth_build_springs ( clmd, dm ) ) { - cloth_free_modifier ( ob, clmd ); + cloth_free_modifier ( clmd ); modifier_setError ( & ( clmd->modifier ), "Can't build springs." ); printf("cloth_free_modifier cloth_build_springs\n"); return 0; @@ -931,7 +931,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d return 1; } -static void cloth_from_mesh ( Object *ob, ClothModifierData *clmd, DerivedMesh *dm ) +static void cloth_from_mesh ( ClothModifierData *clmd, DerivedMesh *dm ) { unsigned int numverts = dm->getNumVerts ( dm ); unsigned int numfaces = dm->getNumFaces ( dm ); @@ -943,7 +943,7 @@ static void cloth_from_mesh ( Object *ob, ClothModifierData *clmd, DerivedMesh * clmd->clothObject->verts = MEM_callocN ( sizeof ( ClothVertex ) * clmd->clothObject->numverts, "clothVertex" ); if ( clmd->clothObject->verts == NULL ) { - cloth_free_modifier ( ob, clmd ); + cloth_free_modifier ( clmd ); modifier_setError ( & ( clmd->modifier ), "Out of memory on allocating clmd->clothObject->verts." ); printf("cloth_free_modifier clmd->clothObject->verts\n"); return; @@ -954,7 +954,7 @@ static void cloth_from_mesh ( Object *ob, ClothModifierData *clmd, DerivedMesh * clmd->clothObject->mfaces = MEM_callocN ( sizeof ( MFace ) * clmd->clothObject->numfaces, "clothMFaces" ); if ( clmd->clothObject->mfaces == NULL ) { - cloth_free_modifier ( ob, clmd ); + cloth_free_modifier ( clmd ); modifier_setError ( & ( clmd->modifier ), "Out of memory on allocating clmd->clothObject->mfaces." ); printf("cloth_free_modifier clmd->clothObject->mfaces\n"); return; @@ -1006,7 +1006,7 @@ int cloth_add_spring ( ClothModifierData *clmd, unsigned int indexA, unsigned in return 0; } -static void cloth_free_errorsprings(Cloth *cloth, EdgeHash *edgehash, LinkNode **edgelist) +static void cloth_free_errorsprings(Cloth *cloth, EdgeHash *UNUSED(edgehash), LinkNode **edgelist) { unsigned int i = 0; diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index af12d23b2c2..5c9cc441b95 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -79,7 +79,7 @@ void collision_move_object ( CollisionModifierData *collmd, float step, float pr bvhtree_update_from_mvert ( collmd->bvhtree, collmd->mfaces, collmd->numfaces, collmd->current_x, collmd->current_xnew, collmd->numverts, 1 ); } -BVHTree *bvhtree_build_from_mvert ( MFace *mfaces, unsigned int numfaces, MVert *x, unsigned int numverts, float epsilon ) +BVHTree *bvhtree_build_from_mvert ( MFace *mfaces, unsigned int numfaces, MVert *x, unsigned int UNUSED(numverts), float epsilon ) { BVHTree *tree; float co[12]; @@ -106,7 +106,7 @@ BVHTree *bvhtree_build_from_mvert ( MFace *mfaces, unsigned int numfaces, MVert return tree; } -void bvhtree_update_from_mvert ( BVHTree * bvhtree, MFace *faces, int numfaces, MVert *x, MVert *xnew, int numverts, int moving ) +void bvhtree_update_from_mvert ( BVHTree * bvhtree, MFace *faces, int numfaces, MVert *x, MVert *xnew, int UNUSED(numverts), int moving ) { int i; MFace *mfaces = faces; diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 90ffa39c88f..83ed65a1bf2 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -53,7 +53,7 @@ #include "IMB_imbuf_types.h" -void floatbuf_to_srgb_byte(float *rectf, unsigned char *rectc, int x1, int x2, int y1, int y2, int w) +void floatbuf_to_srgb_byte(float *rectf, unsigned char *rectc, int x1, int x2, int y1, int y2, int UNUSED(w)) { int x, y; float *rf= rectf; @@ -74,7 +74,7 @@ void floatbuf_to_srgb_byte(float *rectf, unsigned char *rectc, int x1, int x2, i } } -void floatbuf_to_byte(float *rectf, unsigned char *rectc, int x1, int x2, int y1, int y2, int w) +void floatbuf_to_byte(float *rectf, unsigned char *rectc, int x1, int x2, int y1, int y2, int UNUSED(w)) { int x, y; float *rf= rectf; @@ -356,7 +356,7 @@ void curvemap_sethandle(CurveMap *cuma, int type) /* *********************** Making the tables and display ************** */ /* reduced copy of garbled calchandleNurb() code in curve.c */ -static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) +static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *next, int UNUSED(mode)) { float *p1,*p2,*p3,pt[3]; float dx1,dy1, dx,dy, vx,vy, len,len1,len2; @@ -830,6 +830,10 @@ void colorcorrection_do_ibuf(ImBuf *ibuf, const char *profile) cmsCloseProfile(proofingProfile); } } +#else + /* unused */ + (void)ibuf; + (void)profile; #endif } diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 3df395244f4..5dad01a126f 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -655,7 +655,7 @@ static bConstraintTypeInfo CTI_CONSTRNAME = { /* This function should be used for the get_target_matrix member of all * constraints that are not picky about what happens to their target matrix. */ -static void default_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float ctime) +static void default_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float UNUSED(ctime)) { if (VALID_CONS_TARGET(ct)) constraint_target_to_mat4(cob->scene, ct->tar, ct->subtarget, ct->matrix, CONSTRAINT_SPACE_WORLD, ct->space, con->headtail); @@ -1107,7 +1107,7 @@ static void kinematic_flush_tars (bConstraint *con, ListBase *list, short nocopy } } -static void kinematic_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float ctime) +static void kinematic_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float UNUSED(ctime)) { bKinematicConstraint *data= con->data; @@ -1195,7 +1195,7 @@ static void followpath_flush_tars (bConstraint *con, ListBase *list, short nocop } } -static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float ctime) +static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float UNUSED(ctime)) { bFollowPathConstraint *data= con->data; @@ -1330,7 +1330,7 @@ static bConstraintTypeInfo CTI_FOLLOWPATH = { /* --------- Limit Location --------- */ -static void loclimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) +static void loclimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets)) { bLocLimitConstraint *data = con->data; @@ -1378,7 +1378,7 @@ static bConstraintTypeInfo CTI_LOCLIMIT = { /* -------- Limit Rotation --------- */ -static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) +static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets)) { bRotLimitConstraint *data = con->data; float loc[3]; @@ -1437,7 +1437,7 @@ static bConstraintTypeInfo CTI_ROTLIMIT = { /* --------- Limit Scaling --------- */ -static void sizelimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) +static void sizelimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets)) { bSizeLimitConstraint *data = con->data; float obsize[3], size[3]; @@ -1831,7 +1831,7 @@ static void translike_flush_tars (bConstraint *con, ListBase *list, short nocopy } } -static void translike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) +static void translike_evaluate (bConstraint *UNUSED(con), bConstraintOb *cob, ListBase *targets) { bConstraintTarget *ct= targets->first; @@ -1867,7 +1867,7 @@ static void samevolume_new_data (void *cdata) data->volume = 1.0f; } -static void samevolume_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) +static void samevolume_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets)) { bSameVolumeConstraint *data= con->data; @@ -1981,7 +1981,7 @@ static void pycon_id_looper (bConstraint *con, ConstraintIDFunc func, void *user } /* Whether this approach is maintained remains to be seen (aligorith) */ -static void pycon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float ctime) +static void pycon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float UNUSED(ctime)) { #ifndef DISABLE_PYTHON bPythonConstraint *data= con->data; @@ -2105,7 +2105,7 @@ static void actcon_flush_tars (bConstraint *con, ListBase *list, short nocopy) } } -static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float ctime) +static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float UNUSED(ctime)) { extern void chan_calc_mat(bPoseChannel *chan); bActionConstraint *data = con->data; @@ -2196,7 +2196,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint } } -static void actcon_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) +static void actcon_evaluate (bConstraint *UNUSED(con), bConstraintOb *cob, ListBase *targets) { bConstraintTarget *ct= targets->first; @@ -3076,7 +3076,7 @@ static void clampto_flush_tars (bConstraint *con, ListBase *list, short nocopy) } } -static void clampto_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float ctime) +static void clampto_get_tarmat (bConstraint *UNUSED(con), bConstraintOb *cob, bConstraintTarget *ct, float UNUSED(ctime)) { if (VALID_CONS_TARGET(ct)) { Curve *cu= ct->tar->data; @@ -3410,7 +3410,7 @@ static void shrinkwrap_flush_tars (bConstraint *con, ListBase *list, short nocop } -static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float ctime) +static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float UNUSED(ctime)) { bShrinkwrapConstraint *scon = (bShrinkwrapConstraint *) con->data; @@ -3513,7 +3513,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr } } -static void shrinkwrap_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) +static void shrinkwrap_evaluate (bConstraint *UNUSED(con), bConstraintOb *cob, ListBase *targets) { bConstraintTarget *ct= targets->first; @@ -3729,7 +3729,7 @@ static void splineik_flush_tars (bConstraint *con, ListBase *list, short nocopy) } } -static void splineik_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float ctime) +static void splineik_get_tarmat (bConstraint *UNUSED(con), bConstraintOb *cob, bConstraintTarget *ct, float UNUSED(ctime)) { if (VALID_CONS_TARGET(ct)) { Curve *cu= ct->tar->data; @@ -4161,7 +4161,7 @@ void id_loop_constraints (ListBase *conlist, ConstraintIDFunc func, void *userda /* ......... */ /* helper for copy_constraints(), to be used for making sure that ID's are valid */ -static void con_extern_cb(bConstraint *con, ID **idpoin, void *userdata) +static void con_extern_cb(bConstraint *UNUSED(con), ID **idpoin, void *UNUSED(userData)) { if (*idpoin && (*idpoin)->lib) id_lib_extern(*idpoin); diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 9578b5185af..a7dd80bff4d 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2951,7 +2951,7 @@ void switchdirectionNurb(Nurb *nu) } -float (*curve_getVertexCos(Curve *cu, ListBase *lb, int *numVerts_r))[3] +float (*curve_getVertexCos(Curve *UNUSED(cu), ListBase *lb, int *numVerts_r))[3] { int i, numVerts = *numVerts_r = count_curveverts(lb); float *co, (*cos)[3] = MEM_mallocN(sizeof(*cos)*numVerts, "cu_vcos"); @@ -2979,7 +2979,7 @@ float (*curve_getVertexCos(Curve *cu, ListBase *lb, int *numVerts_r))[3] return cos; } -void curve_applyVertexCos(Curve *cu, ListBase *lb, float (*vertexCos)[3]) +void curve_applyVertexCos(Curve *UNUSED(cu), ListBase *lb, float (*vertexCos)[3]) { float *co = vertexCos[0]; Nurb *nu; @@ -3004,7 +3004,7 @@ void curve_applyVertexCos(Curve *cu, ListBase *lb, float (*vertexCos)[3]) } } -float (*curve_getKeyVertexCos(Curve *cu, ListBase *lb, float *key))[3] +float (*curve_getKeyVertexCos(Curve *UNUSED(cu), ListBase *lb, float *key))[3] { int i, numVerts = count_curveverts(lb); float *co, (*cos)[3] = MEM_mallocN(sizeof(*cos)*numVerts, "cu_vcos"); @@ -3035,7 +3035,7 @@ float (*curve_getKeyVertexCos(Curve *cu, ListBase *lb, float *key))[3] return cos; } -void curve_applyKeyVertexTilts(Curve *cu, ListBase *lb, float *key) +void curve_applyKeyVertexTilts(Curve *UNUSED(cu), ListBase *lb, float *key) { Nurb *nu; int i; diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 1f867a615b2..f4db8e953f9 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -468,8 +468,8 @@ static void layerSwap_mdisps(void *data, const int *ci) } } -static void layerInterp_mdisps(void **sources, float *weights, float *sub_weights, - int count, void *dest) +static void layerInterp_mdisps(void **UNUSED(sources), float *weights, float *sub_weights, + int UNUSED(count), void *dest) { MDisps *d = dest; int i; @@ -2503,7 +2503,7 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in cdf_free(cdf); } -void CustomData_external_add(CustomData *data, ID *id, int type, int totelem, const char *filename) +void CustomData_external_add(CustomData *data, ID *id, int type, int UNUSED(totelem), const char *filename) { CustomDataExternal *external= data->external; CustomDataLayer *layer; diff --git a/source/blender/blenkernel/intern/customdata_file.c b/source/blender/blenkernel/intern/customdata_file.c index 65a0d731beb..5954ac1b022 100644 --- a/source/blender/blenkernel/intern/customdata_file.c +++ b/source/blender/blenkernel/intern/customdata_file.c @@ -379,7 +379,7 @@ int cdf_write_open(CDataFile *cdf, char *filename) return 1; } -int cdf_write_layer(CDataFile *cdf, CDataFileLayer *blay) +int cdf_write_layer(CDataFile *UNUSED(cdf), CDataFileLayer *UNUSED(blay)) { return 1; } diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 382c0690ae3..d95b7010993 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -846,7 +846,7 @@ DagNode * dag_get_sub_node (DagForest *forest,void * fob) return node; } -static void dag_add_parent_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, char *name) +static void dag_add_parent_relation(DagForest *UNUSED(forest), DagNode *fob1, DagNode *fob2, short rel, char *name) { DagAdjList *itA = fob2->parent; @@ -2280,7 +2280,7 @@ void DAG_on_load_update(Main *bmain) } } -static void dag_id_flush_update__isDependentTexture(void *userData, Object *ob, ID **idpoin) +static void dag_id_flush_update__isDependentTexture(void *userData, Object *UNUSED(ob), ID **idpoin) { struct { ID *id; int is_dependent; } *data = userData; diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 2ab7e32a9c6..d1830cb8243 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -289,7 +289,7 @@ static void init_fastshade_shadeinput(Render *re) shi.combinedflag= -1; } -static Render *fastshade_get_render(Scene *scene) +static Render *fastshade_get_render(Scene *UNUSED(scene)) { // XXX 2.5: this crashes combined with previewrender // due to global R so disabled for now @@ -1117,7 +1117,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase) } -static void curve_to_filledpoly(Curve *cu, ListBase *nurb, ListBase *dispbase) +static void curve_to_filledpoly(Curve *cu, ListBase *UNUSED(nurb), ListBase *dispbase) { if(cu->flag & CU_3D) return; diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 4860e7d8eed..f4fae3ed3c6 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -410,7 +410,7 @@ void pd_point_from_soft(Scene *scene, float *loc, float *vel, int index, Effecte /************************************************/ // triangle - ray callback function -static void eff_tri_ray_hit(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) +static void eff_tri_ray_hit(void *UNUSED(userData), int UNUSED(index), const BVHTreeRay *UNUSED(ray), BVHTreeRayHit *hit) { // whenever we hit a bounding box, we don't check further hit->dist = -1; @@ -515,7 +515,7 @@ static float falloff_func_rad(PartDeflect *pd, float fac) return falloff_func(fac, pd->flag&PFIELD_USEMINR, pd->minrad, pd->flag&PFIELD_USEMAXR, pd->maxrad, pd->f_power_r); } -float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *point, EffectorWeights *weights) +float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNUSED(point), EffectorWeights *weights) { float temp[3]; float falloff = weights ? weights->weight[0] * weights->weight[eff->pd->forcefield] : 1.0f; diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 43f01199b69..1575f69209f 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -556,7 +556,7 @@ void bezt_add_to_cfra_elem (ListBase *lb, BezTriple *bezt) /* Basic sampling callback which acts as a wrapper for evaluate_fcurve() * 'data' arg here is unneeded here... */ -float fcurve_samplingcb_evalcurve (FCurve *fcu, void *data, float evaltime) +float fcurve_samplingcb_evalcurve (FCurve *fcu, void *UNUSED(data), float evaltime) { /* assume any interference from drivers on the curve is intended... */ return evaluate_fcurve(fcu, evaltime); @@ -1331,7 +1331,7 @@ float driver_get_variable_value (ChannelDriver *driver, DriverVar *dvar) * - "evaltime" is the frame at which F-Curve is being evaluated * - has to return a float value */ -static float evaluate_driver (ChannelDriver *driver, float evaltime) +static float evaluate_driver (ChannelDriver *driver, float UNUSED(evaltime)) { DriverVar *dvar; diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 5a10f93ac72..6660442b14a 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -190,7 +190,7 @@ static void fcm_generator_verify (FModifier *fcm) } } -static void fcm_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +static void fcm_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float evaltime) { FMod_Generator *data= (FMod_Generator *)fcm->data; @@ -303,7 +303,7 @@ static double sinc (double x) return sin(M_PI * x) / (M_PI * x); } -static void fcm_fn_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +static void fcm_fn_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float evaltime) { FMod_FunctionGenerator *data= (FMod_FunctionGenerator *)fcm->data; double arg= data->phase_multiplier*evaltime + data->phase_offset; @@ -432,7 +432,7 @@ static void fcm_envelope_verify (FModifier *fcm) } } -static void fcm_envelope_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +static void fcm_envelope_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float evaltime) { FMod_Envelope *env= (FMod_Envelope *)fcm->data; FCM_EnvelopeData *fed, *prevfed, *lastfed; @@ -524,7 +524,7 @@ static void fcm_cycles_new_data (void *mdata) data->before_mode= data->after_mode= FCM_EXTRAPOLATE_CYCLIC; } -static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float cvalue, float evaltime) +static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue), float evaltime) { FMod_Cycles *data= (FMod_Cycles *)fcm->data; float prevkey[2], lastkey[2], cycyofs=0.0f; @@ -664,7 +664,7 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float cvalue, float e return evaltime; } -static void fcm_cycles_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +static void fcm_cycles_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float UNUSED(evaltime)) { tFCMED_Cycles *edata= (tFCMED_Cycles *)fcm->edata; @@ -708,7 +708,7 @@ static void fcm_noise_new_data (void *mdata) data->modification = FCM_NOISE_MODIF_REPLACE; } -static void fcm_noise_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +static void fcm_noise_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float evaltime) { FMod_Noise *data= (FMod_Noise *)fcm->data; float noise; @@ -800,7 +800,7 @@ static void fcm_python_copy (FModifier *fcm, FModifier *src) pymod->prop = IDP_CopyProperty(opymod->prop); } -static void fcm_python_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +static void fcm_python_evaluate (FCurve *UNUSED(fcu), FModifier *UNUSED(fcm), float *UNUSED(cvalue), float UNUSED(evaltime)) { #ifndef DISABLE_PYTHON //FMod_Python *data= (FMod_Python *)fcm->data; @@ -829,7 +829,7 @@ static FModifierTypeInfo FMI_PYTHON = { /* Limits F-Curve Modifier --------------------------- */ -static float fcm_limits_time (FCurve *fcu, FModifier *fcm, float cvalue, float evaltime) +static float fcm_limits_time (FCurve *UNUSED(fcu), FModifier *fcm, float UNUSED(cvalue), float evaltime) { FMod_Limits *data= (FMod_Limits *)fcm->data; @@ -843,7 +843,7 @@ static float fcm_limits_time (FCurve *fcu, FModifier *fcm, float cvalue, float e return evaltime; } -static void fcm_limits_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +static void fcm_limits_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float UNUSED(evaltime)) { FMod_Limits *data= (FMod_Limits *)fcm->data; @@ -880,7 +880,7 @@ static void fcm_stepped_new_data (void *mdata) data->step_size = 2.0f; } -static float fcm_stepped_time (FCurve *fcu, FModifier *fcm, float cvalue, float evaltime) +static float fcm_stepped_time (FCurve *UNUSED(fcu), FModifier *fcm, float UNUSED(cvalue), float evaltime) { FMod_Stepped *data= (FMod_Stepped *)fcm->data; int snapblock; diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index bdf203119c3..5a031d62fcb 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -42,6 +42,7 @@ #include "BLI_blenlib.h" +#include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_group.h" #include "BKE_library.h" @@ -327,7 +328,7 @@ static void group_replaces_nla(Object *parent, Object *target, char mode) you can draw everything, leaves tags in objects to signal it needs further updating */ /* note: does not work for derivedmesh and render... it recreates all again in convertblender.c */ -void group_handle_recalc_and_update(Scene *scene, Object *parent, Group *group) +void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group *group) { GroupObject *go; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index fec713805e3..d750300291b 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -103,8 +103,8 @@ static void de_interlace_ng(struct ImBuf *ibuf) /* neogeo fields */ if (ibuf->rect) { /* make copies */ - tbuf1 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, (int)IB_rect, (unsigned char)0); - tbuf2 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, (int)IB_rect, (unsigned char)0); + tbuf1 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, (int)IB_rect); + tbuf2 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, (int)IB_rect); ibuf->x *= 2; @@ -131,8 +131,8 @@ static void de_interlace_st(struct ImBuf *ibuf) /* standard fields */ if (ibuf->rect) { /* make copies */ - tbuf1 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, IB_rect, 0); - tbuf2 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, IB_rect, 0); + tbuf1 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, IB_rect); + tbuf2 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, IB_rect); ibuf->x *= 2; @@ -389,11 +389,11 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, char *name, float *rect_float= NULL; if (floatbuf) { - ibuf= IMB_allocImBuf(width, height, depth, IB_rectfloat, 0); + ibuf= IMB_allocImBuf(width, height, depth, IB_rectfloat); rect_float= (float*)ibuf->rect_float; } else { - ibuf= IMB_allocImBuf(width, height, depth, IB_rect, 0); + ibuf= IMB_allocImBuf(width, height, depth, IB_rect); rect= (unsigned char*)ibuf->rect; } @@ -1681,7 +1681,7 @@ static ImBuf *image_load_sequence_multilayer(Image *ima, ImageUser *iuser, int f if(rpass) { // printf("load from pass %s\n", rpass->name); /* since we free render results, we copy the rect */ - ibuf= IMB_allocImBuf(ima->rr->rectx, ima->rr->recty, 32, 0, 0); + ibuf= IMB_allocImBuf(ima->rr->rectx, ima->rr->recty, 32, 0); ibuf->rect_float= MEM_dupallocN(rpass->rect); ibuf->flags |= IB_rectfloat; ibuf->mall= IB_rectfloat; @@ -1831,7 +1831,7 @@ static ImBuf *image_get_ibuf_multilayer(Image *ima, ImageUser *iuser) RenderPass *rpass= BKE_image_multilayer_index(ima->rr, iuser); if(rpass) { - ibuf= IMB_allocImBuf(ima->rr->rectx, ima->rr->recty, 32, 0, 0); + ibuf= IMB_allocImBuf(ima->rr->rectx, ima->rr->recty, 32, 0); image_initialize_after_load(ima, ibuf); @@ -1938,7 +1938,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_ /* make ibuf if needed, and initialize it */ if(ibuf==NULL) { - ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, 0, 0); + ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, 0); image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0); } @@ -2148,7 +2148,7 @@ ImBuf *BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r) if(!ibuf) { /* Composite Viewer, all handled in compositor */ /* fake ibuf, will be filled in compositor */ - ibuf= IMB_allocImBuf(256, 256, 32, IB_rect, 0); + ibuf= IMB_allocImBuf(256, 256, 32, IB_rect); image_assign_ibuf(ima, ibuf, 0, frame); } } diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 158f964a846..9baaf7e5abc 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -726,7 +726,7 @@ typedef struct Implicit_Data fmatrix3x3 *A, *dFdV, *dFdX, *S, *P, *Pinv, *bigI, *M; } Implicit_Data; -int implicit_init (Object *ob, ClothModifierData *clmd) +int implicit_init (Object *UNUSED(ob), ClothModifierData *clmd) { unsigned int i = 0; unsigned int pinned = 0; @@ -1555,7 +1555,7 @@ static void hair_velocity_smoothing(ClothModifierData *clmd, lfVector *lF, lfVec free_collider_cache(&colliders); } -static void cloth_calc_force(ClothModifierData *clmd, float frame, lfVector *lF, lfVector *lX, lfVector *lV, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, ListBase *effectors, float time, fmatrix3x3 *M) +static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVector *lF, lfVector *lX, lfVector *lV, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, ListBase *effectors, float time, fmatrix3x3 *M) { /* Collect forces and derivatives: F,dFdX,dFdV */ Cloth *cloth = clmd->clothObject; diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 5c0c0fbf0c1..846592f0f2f 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -317,7 +317,7 @@ static char *constraint_adrcodes_to_paths (int adrcode, int *array_index) * NOTE: as we don't have access to the keyblock where the data comes from (for now), * we'll just use numerical indicies for now... */ -static char *shapekey_adrcodes_to_paths (int adrcode, int *array_index) +static char *shapekey_adrcodes_to_paths (int adrcode, int *UNUSED(array_index)) { static char buf[128]; @@ -331,7 +331,7 @@ static char *shapekey_adrcodes_to_paths (int adrcode, int *array_index) } /* MTex (Texture Slot) types */ -static char *mtex_adrcodes_to_paths (int adrcode, int *array_index) +static char *mtex_adrcodes_to_paths (int adrcode, int *UNUSED(array_index)) { char *base=NULL, *prop=NULL; static char buf[128]; diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 708403ab1f7..aa9d0b4f57c 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -1163,7 +1163,7 @@ static void do_cu_key(Curve *cu, Key *key, KeyBlock *actkb, KeyBlock **k, float } } -static void do_rel_cu_key(Curve *cu, Key *key, KeyBlock *actkb, float ctime, char *out, int tot) +static void do_rel_cu_key(Curve *cu, Key *key, KeyBlock *actkb, float UNUSED(ctime), char *out, int tot) { Nurb *nu; int a, step; @@ -1657,7 +1657,7 @@ void curve_to_key(Curve *cu, KeyBlock *kb, ListBase *nurb) } } -void key_to_curve(KeyBlock *kb, Curve *cu, ListBase *nurb) +void key_to_curve(KeyBlock *kb, Curve *UNUSED(cu), ListBase *nurb) { Nurb *nu; BezTriple *bezt; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 3f94992cd11..1e08432c271 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -337,7 +337,7 @@ int id_unlink(ID *id, int test) break; case ID_OB: if(test) return 1; - unlink_object(NULL, (Object*)id); + unlink_object((Object*)id); break; } @@ -822,7 +822,7 @@ void free_libblock_us(ListBase *lb, void *idv) /* test users */ else printf("ERROR block %s users %d\n", id->name, id->us); } if(id->us==0) { - if( GS(id->name)==ID_OB ) unlink_object(NULL, (Object *)id); + if( GS(id->name)==ID_OB ) unlink_object((Object *)id); free_libblock(lb, id); } diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 3e9287dd511..faefbdacb45 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -71,7 +71,7 @@ EditMesh *BKE_mesh_get_editmesh(Mesh *me) return me->edit_mesh; } -void BKE_mesh_end_editmesh(Mesh *me, EditMesh *em) +void BKE_mesh_end_editmesh(Mesh *UNUSED(me), EditMesh *UNUSED(em)) { } @@ -561,7 +561,7 @@ static void mfaces_strip_loose(MFace *mface, int *totface) } /* Create edges based on known verts and faces */ -static void make_edges_mdata(MVert *allvert, MFace *allface, int totvert, int totface, +static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, int UNUSED(totvert), int totface, int old, MEdge **alledge, int *_totedge) { MFace *mface; @@ -1441,7 +1441,7 @@ void mesh_pmv_free(PartialVisibility *pv) MEM_freeN(pv); } -void mesh_pmv_revert(Object *ob, Mesh *me) +void mesh_pmv_revert(Mesh *me) { if(me->pv) { unsigned i; @@ -1480,10 +1480,10 @@ void mesh_pmv_revert(Object *ob, Mesh *me) } } -void mesh_pmv_off(Object *ob, Mesh *me) +void mesh_pmv_off(Mesh *me) { - if(ob && me->pv) { - mesh_pmv_revert(ob, me); + if(me->pv) { + mesh_pmv_revert(me); MEM_freeN(me->pv); me->pv= NULL; } diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 57f568e6094..b0ab947d478 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -456,7 +456,7 @@ static DerivedMesh *multires_dm_create_local(Object *ob, DerivedMesh *dm, int lv return multires_dm_create_from_derived(&mmd, 1, dm, ob, 0, 0); } -static DerivedMesh *subsurf_dm_create_local(Object *ob, DerivedMesh *dm, int lvl, int simple, int optimal) +static DerivedMesh *subsurf_dm_create_local(Object *UNUSED(ob), DerivedMesh *dm, int lvl, int simple, int optimal) { SubsurfModifierData smd; @@ -780,7 +780,7 @@ void multires_stitch_grids(Object *ob) } DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, int local_mmd, DerivedMesh *dm, Object *ob, - int useRenderParams, int isFinalCalc) + int useRenderParams, int UNUSED(isFinalCalc)) { Mesh *me= ob->data; DerivedMesh *result; @@ -874,7 +874,7 @@ static void old_mdisps_bilinear(float out[3], float (*disps)[3], int st, float u add_v3_v3v3(out, d2[0], d2[1]); } -static void old_mdisps_rotate(int S, int newside, int oldside, int x, int y, float *u, float *v) +static void old_mdisps_rotate(int S, int UNUSED(newside), int oldside, int x, int y, float *u, float *v) { float offset = oldside*0.5f - 0.5f; diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index b053d615756..09ba967e265 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1585,7 +1585,7 @@ void BKE_nla_tweakmode_exit (AnimData *adt) /* Baking Tools ------------------------------------------- */ -void BKE_nla_bake (Scene *scene, ID *id, AnimData *adt, int flag) +void BKE_nla_bake (Scene *scene, ID *id, AnimData *adt, int UNUSED(flag)) { /* verify that data is valid diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 3df9bd6ed05..17e488c8353 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -320,7 +320,7 @@ static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Objec } } -void unlink_object(Scene *scene, Object *ob) +void unlink_object(Object *ob) { Main *bmain= G.main; Object *obt; @@ -1617,7 +1617,7 @@ void disable_speed_curve(int val) // XXX THIS CRUFT NEEDS SERIOUS RECODING ASAP! /* ob can be NULL */ -float bsystem_time(struct Scene *scene, Object *ob, float cfra, float ofs) +float bsystem_time(struct Scene *scene, Object *UNUSED(ob), float cfra, float ofs) { /* returns float ( see BKE_curframe in scene.c) */ cfra += scene->r.subframe; diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 5bbb3506a78..78340288836 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -486,7 +486,7 @@ int unpackSound(ReportList *reports, bSound *sound, int how) freePackedFile(sound->packedfile); sound->packedfile = 0; - sound_load(NULL, sound); + sound_load(sound); ret_value = RET_OK; } diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index ffb99c10c40..116ed3c8ef2 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -31,6 +31,7 @@ #include "DNA_scene_types.h" #include "DNA_brush_types.h" +#include "BKE_utildefines.h" #include "BKE_brush.h" #include "BKE_library.h" #include "BKE_paint.h" @@ -100,7 +101,7 @@ void paint_init(Paint *p, const char col[3]) p->flags |= PAINT_SHOW_BRUSH; } -void free_paint(Paint *paint) +void free_paint(Paint *UNUSED(paint)) { /* nothing */ } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index ebbb3ea1020..f7345d6159a 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -380,7 +380,7 @@ void psys_free_settings(ParticleSettings *part) fluid_free_settings(part->fluid); } -void free_hair(Object *ob, ParticleSystem *psys, int dynamics) +void free_hair(Object *UNUSED(ob), ParticleSystem *psys, int dynamics) { PARTICLE_P; @@ -405,7 +405,7 @@ void free_hair(Object *ob, ParticleSystem *psys, int dynamics) psys->pointcache = BKE_ptcache_add(&psys->ptcaches); } else { - cloth_free_modifier(ob, psys->clmd); + cloth_free_modifier(psys->clmd); } } @@ -1052,7 +1052,7 @@ typedef struct ParticleInterpolationData { } ParticleInterpolationData; /* Assumes pointcache->mem_cache exists, so for disk cached particles call psys_make_temp_pointcache() before use */ /* It uses ParticleInterpolationData->pm to store the current memory cache frame so it's thread safe. */ -static void get_pointcache_keys_for_time(Object *ob, PointCache *cache, PTCacheMem **cur, int index, float t, ParticleKey *key1, ParticleKey *key2) +static void get_pointcache_keys_for_time(Object *UNUSED(ob), PointCache *cache, PTCacheMem **cur, int index, float t, ParticleKey *key1, ParticleKey *key2) { static PTCacheMem *pm = NULL; @@ -1803,7 +1803,7 @@ ParticleSystemModifierData *psys_get_modifier(Object *ob, ParticleSystem *psys) /* Particles on a shape */ /************************************************/ /* ready for future use */ -static void psys_particle_on_shape(int distr, int index, float *fuv, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor) +static void psys_particle_on_shape(int UNUSED(distr), int index, float *UNUSED(fuv), float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor) { /* TODO */ float zerovec[3]={0.0f,0.0f,0.0f}; @@ -2185,7 +2185,7 @@ static void do_rough_end(float *loc, float mat[4][4], float t, float fac, float VECADDFAC(state->co,state->co,mat[0],rough[0]); VECADDFAC(state->co,state->co,mat[1],rough[1]); } -static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheKey *ca, int k, int steps, float *rootco, float effector, float dfra, float cfra, float *length, float *vec) +static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheKey *ca, int k, int steps, float *rootco, float effector, float dfra, float UNUSED(cfra), float *length, float *vec) { float force[3] = {0.0f,0.0f,0.0f}; ParticleKey eff_key; @@ -3339,7 +3339,7 @@ static void psys_face_mat(Object *ob, DerivedMesh *dm, ParticleData *pa, float m triatomat(v[0], v[1], v[2], (osface)? osface->uv: NULL, mat); } -void psys_mat_hair_to_object(Object *ob, DerivedMesh *dm, short from, ParticleData *pa, float hairmat[][4]) +void psys_mat_hair_to_object(Object *UNUSED(ob), DerivedMesh *dm, short from, ParticleData *pa, float hairmat[][4]) { float vec[3]; @@ -3818,7 +3818,7 @@ float psys_get_child_time(ParticleSystem *psys, ChildParticle *cpa, float cfra, return (cfra-time)/life; } -float psys_get_child_size(ParticleSystem *psys, ChildParticle *cpa, float cfra, float *pa_time) +float psys_get_child_size(ParticleSystem *psys, ChildParticle *cpa, float UNUSED(cfra), float *UNUSED(pa_time)) { ParticleSettings *part = psys->part; float size; // time XXX @@ -4249,7 +4249,7 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta } } -void psys_get_dupli_texture(Object *ob, ParticleSettings *part, ParticleSystemModifierData *psmd, ParticleData *pa, ChildParticle *cpa, float *uv, float *orco) +void psys_get_dupli_texture(Object *UNUSED(ob), ParticleSettings *part, ParticleSystemModifierData *psmd, ParticleData *pa, ChildParticle *cpa, float *uv, float *orco) { MFace *mface; MTFace *mtface; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index fa82d2c5359..8ab4117c8a1 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -1437,7 +1437,7 @@ static void distribute_particles_on_dm(ParticleSimulationData *sim, int from) } /* ready for future use, to emit particles without geometry */ -static void distribute_particles_on_shape(ParticleSimulationData *sim, int from) +static void distribute_particles_on_shape(ParticleSimulationData *sim, int UNUSED(from)) { ParticleSystem *psys = sim->psys; PARTICLE_P; @@ -2289,7 +2289,7 @@ static void psys_update_effectors(ParticleSimulationData *sim) In theory, there could be unlimited implementation of SPH simulators **************************************************/ -void particle_fluidsim(ParticleSystem *psys, ParticleData *pa, ParticleSettings *part, ParticleSimulationData *sim, float dfra, float cfra, float mass){ +void particle_fluidsim(ParticleSystem *psys, ParticleData *pa, ParticleSettings *part, ParticleSimulationData *sim, float dfra, float UNUSED(cfra), float mass){ /**************************************************************************************************************** * This code uses in some parts adapted algorithms from the pseduo code as outlined in the Research paper * Titled: Particle-based Viscoelastic Fluid Simulation. @@ -3284,7 +3284,7 @@ static void hair_step(ParticleSimulationData *sim, float cfra) psys_calc_dmcache(sim->ob, sim->psmd->dm, psys); if(psys->clmd) - cloth_free_modifier(sim->ob, psys->clmd); + cloth_free_modifier(psys->clmd); } /* dynamics with cloth simulation */ @@ -3298,7 +3298,7 @@ static void hair_step(ParticleSimulationData *sim, float cfra) psys->flag |= PSYS_HAIR_UPDATED; } -static void save_hair(ParticleSimulationData *sim, float cfra){ +static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra)){ Object *ob = sim->ob; ParticleSystem *psys = sim->psys; HairKey *key, *root; @@ -3574,7 +3574,7 @@ static void cached_step(ParticleSimulationData *sim, float cfra) } } -static void particles_fluid_step(ParticleSimulationData *sim, int cfra) +static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra)) { ParticleSystem *psys = sim->psys; if(psys->particles){ @@ -3682,7 +3682,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int cfra) #endif // DISABLE_ELBEEM } -static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float cfra) +static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float UNUSED(cfra)) { ParticleSystem *psys = sim->psys; ParticleSettings *part = psys->part; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index f9d2c1c3fec..3896d523b11 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -132,7 +132,7 @@ static int ptcache_write_basic_header(PTCacheFile *pf) return 1; } /* Softbody functions */ -static int ptcache_write_softbody(int index, void *soft_v, void **data, int cfra) +static int ptcache_write_softbody(int index, void *soft_v, void **data, int UNUSED(cfra)) { SoftBody *soft= soft_v; BodyPoint *bp = soft->bpoint + index; @@ -142,7 +142,7 @@ static int ptcache_write_softbody(int index, void *soft_v, void **data, int cfra return 1; } -static void ptcache_read_softbody(int index, void *soft_v, void **data, float frs_sec, float cfra, float *old_data) +static void ptcache_read_softbody(int index, void *soft_v, void **data, float UNUSED(frs_sec), float UNUSED(cfra), float *old_data) { SoftBody *soft= soft_v; BodyPoint *bp = soft->bpoint + index; @@ -156,7 +156,7 @@ static void ptcache_read_softbody(int index, void *soft_v, void **data, float fr PTCACHE_DATA_TO(data, BPHYS_DATA_VELOCITY, 0, bp->vec); } } -static void ptcache_interpolate_softbody(int index, void *soft_v, void **data, float frs_sec, float cfra, float cfra1, float cfra2, float *old_data) +static void ptcache_interpolate_softbody(int index, void *soft_v, void **data, float UNUSED(frs_sec), float cfra, float cfra1, float cfra2, float *old_data) { SoftBody *soft= soft_v; BodyPoint *bp = soft->bpoint + index; @@ -188,7 +188,7 @@ static void ptcache_interpolate_softbody(int index, void *soft_v, void **data, f VECCOPY(bp->pos, keys->co); VECCOPY(bp->vec, keys->vel); } -static int ptcache_totpoint_softbody(void *soft_v, int cfra) +static int ptcache_totpoint_softbody(void *soft_v, int UNUSED(cfra)) { SoftBody *soft= soft_v; return soft->totpoint; @@ -348,7 +348,7 @@ static void ptcache_interpolate_particle(int index, void *psys_v, void **data, f pa->state.time = cfra; } -static int ptcache_totpoint_particle(void *psys_v, int cfra) +static int ptcache_totpoint_particle(void *psys_v, int UNUSED(cfra)) { ParticleSystem *psys = psys_v; return psys->totpart; @@ -493,7 +493,7 @@ static int ptcache_totwrite_particle(void *psys_v, int cfra) //} // /* Cloth functions */ -static int ptcache_write_cloth(int index, void *cloth_v, void **data, int cfra) +static int ptcache_write_cloth(int index, void *cloth_v, void **data, int UNUSED(cfra)) { ClothModifierData *clmd= cloth_v; Cloth *cloth= clmd->clothObject; @@ -505,7 +505,7 @@ static int ptcache_write_cloth(int index, void *cloth_v, void **data, int cfra) return 1; } -static void ptcache_read_cloth(int index, void *cloth_v, void **data, float frs_sec, float cfra, float *old_data) +static void ptcache_read_cloth(int index, void *cloth_v, void **data, float UNUSED(frs_sec), float UNUSED(cfra), float *old_data) { ClothModifierData *clmd= cloth_v; Cloth *cloth= clmd->clothObject; @@ -522,7 +522,7 @@ static void ptcache_read_cloth(int index, void *cloth_v, void **data, float frs_ PTCACHE_DATA_TO(data, BPHYS_DATA_XCONST, 0, vert->xconst); } } -static void ptcache_interpolate_cloth(int index, void *cloth_v, void **data, float frs_sec, float cfra, float cfra1, float cfra2, float *old_data) +static void ptcache_interpolate_cloth(int index, void *cloth_v, void **data, float UNUSED(frs_sec), float cfra, float cfra1, float cfra2, float *old_data) { ClothModifierData *clmd= cloth_v; Cloth *cloth= clmd->clothObject; @@ -558,7 +558,7 @@ static void ptcache_interpolate_cloth(int index, void *cloth_v, void **data, flo /* should vert->xconst be interpolated somehow too? - jahka */ } -static int ptcache_totpoint_cloth(void *cloth_v, int cfra) +static int ptcache_totpoint_cloth(void *cloth_v, int UNUSED(cfra)) { ClothModifierData *clmd= cloth_v; return clmd->clothObject ? clmd->clothObject->numverts : 0; @@ -635,7 +635,7 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *p } /* Smoke functions */ -static int ptcache_totpoint_smoke(void *smoke_v, int cfra) +static int ptcache_totpoint_smoke(void *smoke_v, int UNUSED(cfra)) { SmokeModifierData *smd= (SmokeModifierData *)smoke_v; SmokeDomainSettings *sds = smd->domain; @@ -648,7 +648,7 @@ static int ptcache_totpoint_smoke(void *smoke_v, int cfra) } /* Smoke functions */ -static int ptcache_totpoint_smoke_turbulence(void *smoke_v, int cfra) +static int ptcache_totpoint_smoke_turbulence(void *smoke_v, int UNUSED(cfra)) { SmokeModifierData *smd= (SmokeModifierData *)smoke_v; SmokeDomainSettings *sds = smd->domain; @@ -671,6 +671,8 @@ static int ptcache_compress_write(PTCacheFile *pf, unsigned char *in, unsigned i unsigned char *props = MEM_callocN(16*sizeof(char), "tmp"); size_t sizeOfIt = 5; + (void)mode; /* unused when building w/o compression */ + #ifdef WITH_LZO out_len= LZO_OUT_LEN(in_len); if(mode == 1) { @@ -2220,7 +2222,7 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode) cache->flag &= ~PTCACHE_REDO_NEEDED; if(pid->type == PTCACHE_TYPE_CLOTH) - cloth_free_modifier(pid->ob, pid->calldata); + cloth_free_modifier(pid->calldata); else if(pid->type == PTCACHE_TYPE_SOFTBODY) sbFreeSimulation(pid->calldata); else if(pid->type == PTCACHE_TYPE_PARTICLES) diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 3f41b704f97..fde180cadc6 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -106,7 +106,7 @@ void free_qtcodecdata(QuicktimeCodecData *qcd) } } -Scene *copy_scene(Main *bmain, Scene *sce, int type) +Scene *copy_scene(Scene *sce, int type) { Scene *scen; ToolSettings *ts; diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 7b428661c6d..7ce5dcc3884 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -53,7 +53,7 @@ #include "RNA_access.h" /* **** XXX **** */ -static void error(const char *error, ...) {} +static void error(const char *UNUSED(error), ...) {} #define INT 96 #define FLO 128 @@ -77,15 +77,15 @@ static struct ImBuf * prepare_effect_imbufs( if (!ibuf1 && !ibuf2 && !ibuf3) { /* hmmm, global float option ? */ - out = IMB_allocImBuf((short)x, (short)y, 32, IB_rect, 0); + out = IMB_allocImBuf((short)x, (short)y, 32, IB_rect); } else if ((ibuf1 && ibuf1->rect_float) || (ibuf2 && ibuf2->rect_float) || (ibuf3 && ibuf3->rect_float)) { /* if any inputs are rectfloat, output is float too */ - out = IMB_allocImBuf((short)x, (short)y, 32, IB_rectfloat, 0); + out = IMB_allocImBuf((short)x, (short)y, 32, IB_rectfloat); } else { - out = IMB_allocImBuf((short)x, (short)y, 32, IB_rect, 0); + out = IMB_allocImBuf((short)x, (short)y, 32, IB_rect); } if (ibuf1 && !ibuf1->rect_float && out->rect_float) { @@ -273,9 +273,9 @@ static ImBuf * IMB_cast_away_list(ImBuf * i) } static struct ImBuf * do_plugin_effect( - Main *bmain, Scene *scene, Sequence *seq, float cfra, + Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *seq, float cfra, float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -370,8 +370,8 @@ static struct ImBuf * do_plugin_effect( return out; } -static int do_plugin_early_out(struct Sequence *seq, - float facf0, float facf1) +static int do_plugin_early_out(struct Sequence *UNUSED(seq), + float UNUSED(facf0), float UNUSED(facf1)) { return 0; } @@ -524,9 +524,9 @@ static void do_alphaover_effect_float(float facf0, float facf1, int x, int y, } static struct ImBuf * do_alphaover_effect( - Main *bmain, Scene *scene, Sequence *seq, float cfra, + Main *bmain, Scene *UNUSED(scene), Sequence *UNUSED(seq), float UNUSED(cfra), float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -696,9 +696,9 @@ static void do_alphaunder_effect_float(float facf0, float facf1, int x, int y, } static struct ImBuf* do_alphaunder_effect( - Main *bmain, Scene *scene, Sequence *seq, float cfra, + Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *UNUSED(seq), float UNUSED(cfra), float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -821,9 +821,9 @@ void do_cross_effect_float(float facf0, float facf1, int x, int y, /* carefull: also used by speed effect! */ static struct ImBuf* do_cross_effect( - Main *bmain, Scene *scene, Sequence *seq, float cfra, + Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *UNUSED(seq), float UNUSED(cfra), float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -976,19 +976,19 @@ static void build_gammatabs() } } -static void init_gammacross(Sequence * seq) +static void init_gammacross(Sequence * UNUSED(seq)) { } -static void load_gammacross(Sequence * seq) +static void load_gammacross(Sequence * UNUSED(seq)) { } -static void free_gammacross(Sequence * seq) +static void free_gammacross(Sequence * UNUSED(seq)) { } -static void do_gammacross_effect_byte(float facf0, float facf1, +static void do_gammacross_effect_byte(float facf0, float UNUSED(facf1), int x, int y, unsigned char *rect1, unsigned char *rect2, @@ -1044,7 +1044,7 @@ static void do_gammacross_effect_byte(float facf0, float facf1, } -static void do_gammacross_effect_float(float facf0, float facf1, +static void do_gammacross_effect_float(float facf0, float UNUSED(facf1), int x, int y, float *rect1, float *rect2, float *out) @@ -1088,9 +1088,9 @@ static void do_gammacross_effect_float(float facf0, float facf1, } static struct ImBuf * do_gammacross_effect( - Main *bmain, Scene *scene, Sequence *seq, float cfra, + Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *UNUSED(seq), float UNUSED(cfra), float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -1206,9 +1206,9 @@ static void do_add_effect_float(float facf0, float facf1, int x, int y, } } -static struct ImBuf * do_add_effect(Main *bmain, Scene *scene, Sequence *seq, float cfra, +static struct ImBuf * do_add_effect(Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *UNUSED(seq), float UNUSED(cfra), float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -1323,9 +1323,9 @@ static void do_sub_effect_float(float facf0, float facf1, int x, int y, } static struct ImBuf * do_sub_effect( - Main *bmain, Scene *scene, Sequence *seq, float cfra, + Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *UNUSED(seq), float UNUSED(cfra), float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -1537,9 +1537,9 @@ static void do_mul_effect_float(float facf0, float facf1, int x, int y, } static struct ImBuf * do_mul_effect( - Main *bmain, Scene *scene, Sequence *seq, float cfra, + Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *UNUSED(seq), float UNUSED(cfra), float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -1876,7 +1876,7 @@ static void copy_wipe_effect(Sequence *dst, Sequence *src) dst->effectdata = MEM_dupallocN(src->effectdata); } -static void do_wipe_effect_byte(Sequence *seq, float facf0, float facf1, +static void do_wipe_effect_byte(Sequence *seq, float facf0, float UNUSED(facf1), int x, int y, unsigned char *rect1, unsigned char *rect2, unsigned char *out) @@ -1934,7 +1934,7 @@ static void do_wipe_effect_byte(Sequence *seq, float facf0, float facf1, } } -static void do_wipe_effect_float(Sequence *seq, float facf0, float facf1, +static void do_wipe_effect_float(Sequence *seq, float facf0, float UNUSED(facf1), int x, int y, float *rect1, float *rect2, float *out) @@ -1993,9 +1993,9 @@ static void do_wipe_effect_float(Sequence *seq, float facf0, float facf1, } static struct ImBuf * do_wipe_effect( - Main *bmain, Scene *scene, Sequence *seq, float cfra, + Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *seq, float UNUSED(cfra), float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -2111,7 +2111,7 @@ static void transform_image(int x, int y, struct ImBuf *ibuf1, struct ImBuf *out } } -static void do_transform(Scene *scene, Sequence *seq, float facf0, int x, int y, +static void do_transform(Scene *scene, Sequence *seq, float UNUSED(facf0), int x, int y, struct ImBuf *ibuf1,struct ImBuf *out) { TransformVars *transform = (TransformVars *)seq->effectdata; @@ -2144,9 +2144,9 @@ static void do_transform(Scene *scene, Sequence *seq, float facf0, int x, int y, static struct ImBuf * do_transform_effect( - Main *bmain, Scene *scene, Sequence *seq,float cfra, - float facf0, float facf1, int x, int y, - int preview_render_size, + Main *UNUSED(bmain), Scene *scene, Sequence *seq,float UNUSED(cfra), + float facf0, float UNUSED(facf1), int x, int y, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -2631,7 +2631,7 @@ static void copy_glow_effect(Sequence *dst, Sequence *src) } //void do_glow_effect(Cast *cast, float facf0, float facf1, int xo, int yo, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *outbuf, ImBuf *use) -static void do_glow_effect_byte(Sequence *seq, float facf0, float facf1, +static void do_glow_effect_byte(Sequence *seq, float facf0, float UNUSED(facf1), int x, int y, char *rect1, char *rect2, char *out) { @@ -2646,7 +2646,7 @@ static void do_glow_effect_byte(Sequence *seq, float facf0, float facf1, RVAddBitmaps_byte (inbuf , outbuf, outbuf, x, y); } -static void do_glow_effect_float(Sequence *seq, float facf0, float facf1, +static void do_glow_effect_float(Sequence *seq, float facf0, float UNUSED(facf1), int x, int y, float *rect1, float *rect2, float *out) { @@ -2662,9 +2662,9 @@ static void do_glow_effect_float(Sequence *seq, float facf0, float facf1, } static struct ImBuf * do_glow_effect( - Main *bmain, Scene *scene, Sequence *seq, float cfra, + Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *seq, float UNUSED(cfra), float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -2716,16 +2716,16 @@ static void copy_solid_color(Sequence *dst, Sequence *src) dst->effectdata = MEM_dupallocN(src->effectdata); } -static int early_out_color(struct Sequence *seq, - float facf0, float facf1) +static int early_out_color(struct Sequence *UNUSED(seq), + float UNUSED(facf0), float UNUSED(facf1)) { return -1; } static struct ImBuf * do_solid_color( - Main *bmain, Scene *scene, Sequence *seq, float cfra, + Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *seq, float UNUSED(cfra), float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) { @@ -2813,14 +2813,14 @@ static int num_inputs_multicam() return 0; } -static int early_out_multicam(struct Sequence *seq, float facf0, float facf1) +static int early_out_multicam(struct Sequence *UNUSED(seq), float UNUSED(facf0), float UNUSED(facf1)) { return -1; } static struct ImBuf * do_multicam( Main *bmain, Scene *scene, Sequence *seq, float cfra, - float facf0, float facf1, int x, int y, + float UNUSED(facf0), float UNUSED(facf1), int x, int y, int preview_render_size, struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3) @@ -2907,8 +2907,8 @@ static void copy_speed_effect(Sequence *dst, Sequence *src) v->length = 0; } -static int early_out_speed(struct Sequence *seq, - float facf0, float facf1) +static int early_out_speed(struct Sequence *UNUSED(seq), + float UNUSED(facf0), float UNUSED(facf1)) { return 1; } @@ -3039,22 +3039,22 @@ static void do_speed_effect(Sequence * seq,int cfra, ********************************************************************** */ -static void init_noop(struct Sequence *seq) +static void init_noop(struct Sequence *UNUSED(seq)) { } -static void load_noop(struct Sequence *seq) +static void load_noop(struct Sequence *UNUSED(seq)) { } -static void init_plugin_noop(struct Sequence *seq, const char * fname) +static void init_plugin_noop(struct Sequence *UNUSED(seq), const char *UNUSED(fname)) { } -static void free_noop(struct Sequence *seq) +static void free_noop(struct Sequence *UNUSED(seq)) { } @@ -3064,13 +3064,13 @@ static int num_inputs_default() return 2; } -static int early_out_noop(struct Sequence *seq, - float facf0, float facf1) +static int early_out_noop(struct Sequence *UNUSED(seq), + float UNUSED(facf0), float UNUSED(facf1)) { return 0; } -static int early_out_fade(struct Sequence *seq, +static int early_out_fade(struct Sequence *UNUSED(seq), float facf0, float facf1) { if (facf0 == 0.0 && facf1 == 0.0) { @@ -3081,7 +3081,7 @@ static int early_out_fade(struct Sequence *seq, return 0; } -static int early_out_mul_input2(struct Sequence *seq, +static int early_out_mul_input2(struct Sequence *UNUSED(seq), float facf0, float facf1) { if (facf0 == 0.0 && facf1 == 0.0) { @@ -3090,13 +3090,13 @@ static int early_out_mul_input2(struct Sequence *seq, return 0; } -static void store_icu_yrange_noop(struct Sequence * seq, +static void store_icu_yrange_noop(struct Sequence * UNUSED(seq), short adrcode, float * ymin, float * ymax) { /* defaults are fine */ } -static void get_default_fac_noop(struct Sequence *seq, float cfra, +static void get_default_fac_noop(struct Sequence *UNUSED(seq), float UNUSED(cfra), float * facf0, float * facf1) { *facf0 = *facf1 = 1.0; @@ -3111,10 +3111,10 @@ static void get_default_fac_fade(struct Sequence *seq, float cfra, *facf1 /= seq->len; } -static struct ImBuf * do_overdrop_effect(Main *bmain, Scene *scene, Sequence *seq, float cfra, +static struct ImBuf * do_overdrop_effect(Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *UNUSED(seq), float UNUSED(cfra), float facf0, float facf1, int x, int y, - int preview_render_size, + int UNUSED(preview_render_size), struct ImBuf * ibuf1, struct ImBuf * ibuf2, struct ImBuf * ibuf3) diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index dcd411409f9..6d087837302 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1021,7 +1021,7 @@ static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Se #define PROXY_MAXFILE (2*FILE_MAXDIR+FILE_MAXFILE) -static int seq_proxy_get_fname(Scene *scene, Sequence * seq, int cfra, char * name, int render_size) +static int seq_proxy_get_fname(Scene *UNUSED(scene), Sequence * seq, int cfra, char * name, int render_size) { int frameno; char dir[FILE_MAXDIR]; @@ -1444,7 +1444,7 @@ static void color_balance(Sequence * seq, ImBuf* ibuf, float mul) */ int input_have_to_preprocess( - Scene *scene, Sequence * seq, float cfra, int seqrectx, int seqrecty) + Scene *UNUSED(scene), Sequence * seq, float UNUSED(cfra), int UNUSED(seqrectx), int UNUSED(seqrecty)) { float mul; @@ -1476,7 +1476,7 @@ int input_have_to_preprocess( } static ImBuf * input_preprocess( - Scene *scene, Sequence *seq, float cfra, int seqrectx, int seqrecty, + Scene *scene, Sequence *seq, float UNUSED(cfra), int seqrectx, int seqrecty, ImBuf * ibuf) { float mul; @@ -1521,9 +1521,9 @@ static ImBuf * input_preprocess( ImBuf * i; if (ibuf->rect_float) { - i = IMB_allocImBuf(dx, dy,32, IB_rectfloat, 0); + i = IMB_allocImBuf(dx, dy,32, IB_rectfloat); } else { - i = IMB_allocImBuf(dx, dy,32, IB_rect, 0); + i = IMB_allocImBuf(dx, dy,32, IB_rect); } IMB_rectcpy(i, ibuf, @@ -1787,7 +1787,7 @@ finish: if (!out) { out = IMB_allocImBuf( - (short)seqrectx, (short)seqrecty, 32, IB_rect, 0); + (short)seqrectx, (short)seqrecty, 32, IB_rect); } return out; @@ -1878,7 +1878,7 @@ static ImBuf * seq_render_scene_strip_impl( RE_AcquireResultImage(re, &rres); if(rres.rectf) { - ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rectfloat, 0); + ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rectfloat); memcpy(ibuf->rect_float, rres.rectf, 4*sizeof(float)*rres.rectx*rres.recty); if(rres.rectz) { addzbuffloatImBuf(ibuf); @@ -1890,7 +1890,7 @@ static ImBuf * seq_render_scene_strip_impl( IMB_convert_profile(ibuf, IB_PROFILE_SRGB); } else if (rres.rect32) { - ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rect, 0); + ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rect); memcpy(ibuf->rect, rres.rect32, 4*rres.rectx*rres.recty); } @@ -2079,7 +2079,7 @@ static ImBuf * seq_render_strip(Main *bmain, Scene *scene, Sequence * seq, float if (!ibuf) { ibuf = IMB_allocImBuf( - (short)seqrectx, (short)seqrecty, 32, IB_rect, 0); + (short)seqrectx, (short)seqrecty, 32, IB_rect); } if (ibuf->x != seqrectx || ibuf->y != seqrecty) { @@ -2213,7 +2213,7 @@ static ImBuf* seq_render_strip_stack( if (i == 0) { out = IMB_allocImBuf( (short)seqrectx, (short)seqrecty, - 32, IB_rect, 0); + 32, IB_rect); } break; case 0: diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 965ce9801d7..d1eed94d330 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -435,7 +435,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs) } /*! init triangle divisions */ -void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *faces, int numfaces, int numtris, int **tridivs, float cell_len) +void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFace *faces, int numfaces, int numtris, int **tridivs, float cell_len) { // mTriangleDivs1.resize( faces.size() ); // mTriangleDivs2.resize( faces.size() ); @@ -1270,7 +1270,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd) } } } -void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) +void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm, int UNUSED(useRenderParams), int UNUSED(isFinalCalc)) { if((smd->type & MOD_SMOKE_TYPE_FLOW)) { diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 98a50eee146..58aa171e97b 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -171,7 +171,7 @@ static void Vec3PlusStVec(float *v, float s, float *v1); /*physical unit of force is [kg * m / sec^2]*/ -static float sb_grav_force_scale(Object *ob) +static float sb_grav_force_scale(Object *UNUSED(ob)) /* since unit of g is [m/sec^2] and F = mass * g we rescale unit mass of node to 1 gramm put it to a function here, so we can add user options later without touching simulation code */ @@ -179,7 +179,7 @@ static float sb_grav_force_scale(Object *ob) return (0.001f); } -static float sb_fric_force_scale(Object *ob) +static float sb_fric_force_scale(Object *UNUSED(ob)) /* rescaling unit of drag [1 / sec] to somehow reasonable put it to a function here, so we can add user options later without touching simulation code */ @@ -1029,7 +1029,7 @@ static int query_external_colliders(Scene *scene, Object *me) /* +++ the aabb "force" section*/ -static int sb_detect_aabb_collisionCached( float force[3], unsigned int par_layer,struct Object *vertexowner,float time) +static int sb_detect_aabb_collisionCached( float force[3], unsigned int par_layer,struct Object *vertexowner,float UNUSED(time)) { Object *ob; SoftBody *sb=vertexowner->soft; diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 5e95b19b64f..bf8e2d348ac 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -79,7 +79,7 @@ void sound_init_once() AUD_initOnce(); } -void sound_init(struct Main *bmain) +void sound_init(void) { AUD_DeviceSpecs specs; int device, buffersize; @@ -141,7 +141,7 @@ struct bSound* sound_new_file(struct Main *bmain, char* filename) BLI_strncpy(sound->name, filename, FILE_MAX); // XXX unused currently sound->type = SOUND_TYPE_FILE; - sound_load(bmain, sound); + sound_load(sound); if(!sound->playback_handle) { @@ -167,7 +167,7 @@ struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source) sound->child_sound = source; sound->type = SOUND_TYPE_BUFFER; - sound_load(CTX_data_main(C), sound); + sound_load(sound); if(!sound->playback_handle) { @@ -193,7 +193,7 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa sound->end = end; sound->type = SOUND_TYPE_LIMITER; - sound_load(CTX_data_main(C), sound); + sound_load(sound); if(!sound->playback_handle) { @@ -234,7 +234,7 @@ void sound_delete_cache(struct bSound* sound) } } -void sound_load(struct Main *bmain, struct bSound* sound) +void sound_load(struct bSound* sound) { if(sound) { diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 00614ef0f4f..8363ff13ef9 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -137,6 +137,8 @@ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportL int quality; double framerate; + (void)scene; /* unused */ + filepath_avi(name, rd); sframe = (rd->sfra); @@ -175,7 +177,7 @@ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportL return 1; } -static int append_avi(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports) +static int append_avi(RenderData *UNUSED(rd), int frame, int *pixels, int rectx, int recty, ReportList *UNUSED(reports)) { unsigned int *rt1, *rt2, *rectot; int x, y; diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c index b0c05c31fa1..bbc441f3622 100644 --- a/source/blender/blenkernel/intern/writeframeserver.c +++ b/source/blender/blenkernel/intern/writeframeserver.c @@ -47,6 +47,7 @@ #include "DNA_userdef_types.h" +#include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_report.h" @@ -96,10 +97,12 @@ static int closesocket(int fd) } #endif -int start_frameserver(struct Scene *scene, RenderData *rd, int rectx, int recty, ReportList *reports) +int start_frameserver(struct Scene *scene, RenderData *UNUSED(rd), int rectx, int recty, ReportList *reports) { struct sockaddr_in addr; int arg = 1; + + (void)scene; /* unused */ if (!startup_socket_system()) { BKE_report(reports, RPT_ERROR, "Can't startup socket system"); @@ -243,7 +246,7 @@ static int handle_request(RenderData *rd, char * req) return -1; } -int frameserver_loop(RenderData *rd, ReportList *reports) +int frameserver_loop(RenderData *rd, ReportList *UNUSED(reports)) { fd_set readfds; struct timeval tv; @@ -350,7 +353,7 @@ static void serve_ppm(int *pixels, int rectx, int recty) connsock = -1; } -int append_frameserver(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports) +int append_frameserver(RenderData *UNUSED(rd), int frame, int *pixels, int rectx, int recty, ReportList *UNUSED(reports)) { fprintf(stderr, "Serving frame: %d\n", frame); if (write_ppm) { diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c index cf94a0c9ffe..0d541c1fe37 100644 --- a/source/blender/blenlib/intern/BLI_kdtree.c +++ b/source/blender/blenlib/intern/BLI_kdtree.c @@ -132,6 +132,7 @@ void BLI_kdtree_balance(KDTree *tree) static float squared_distance(float *v2, float *v1, float *n1, float *n2) { float d[3], dist; + (void)n1; /* unused */ d[0]= v2[0]-v1[0]; d[1]= v2[1]-v1[1]; diff --git a/source/blender/blenlib/intern/dynlib.c b/source/blender/blenlib/intern/dynlib.c index 55d6ce7a241..a674f38cec6 100644 --- a/source/blender/blenlib/intern/dynlib.c +++ b/source/blender/blenlib/intern/dynlib.c @@ -122,6 +122,7 @@ void *PIL_dynlib_find_symbol(PILdynlib* lib, char *symname) { } char *PIL_dynlib_get_error_as_string(PILdynlib* lib) { + (void)lib; /* unused */ return dlerror(); } diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index 141e5438bc9..801130eebc8 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -1052,15 +1052,17 @@ float BLI_hnoisep(float noisesize, float x, float y, float z) /* Camberra omitted, didn't seem useful */ /* distance squared */ -static float dist_Squared(float x, float y, float z, float e) { return (x*x + y*y + z*z); } +static float dist_Squared(float x, float y, float z, float e) { (void)e; return (x*x + y*y + z*z); } /* real distance */ -static float dist_Real(float x, float y, float z, float e) { return sqrt(x*x + y*y + z*z); } +static float dist_Real(float x, float y, float z, float e) { (void)e; return sqrt(x*x + y*y + z*z); } /* manhattan/taxicab/cityblock distance */ -static float dist_Manhattan(float x, float y, float z, float e) { return (fabs(x) + fabs(y) + fabs(z)); } +static float dist_Manhattan(float x, float y, float z, float e) { (void)e; return (fabs(x) + fabs(y) + fabs(z)); } /* Chebychev */ static float dist_Chebychev(float x, float y, float z, float e) { float t; + (void)e; + x = fabs(x); y = fabs(y); z = fabs(z); @@ -1072,12 +1074,14 @@ static float dist_Chebychev(float x, float y, float z, float e) static float dist_MinkovskyH(float x, float y, float z, float e) { float d = sqrt(fabs(x)) + sqrt(fabs(y)) + sqrt(fabs(z)); + (void)e; return (d*d); } /* minkovsky preset exponent 4 */ static float dist_Minkovsky4(float x, float y, float z, float e) { + (void)e; x *= x; y *= y; z *= z; diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 726ed817f8b..eb2057220fe 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -442,6 +442,8 @@ ThreadedWorker *BLI_create_worker(void *(*do_thread)(void *), int tot, int sleep { ThreadedWorker *worker; + (void)sleep_time; /* unused */ + worker = MEM_callocN(sizeof(ThreadedWorker), "threadedworker"); if (tot > RE_MAX_THREAD) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ebd407e7e21..7c8c7eb6e5d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5308,7 +5308,7 @@ static void lib_link_sound(FileData *fd, Main *main) sound->id.flag -= LIB_NEEDLINK; sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system - sound_load(main, sound); + sound_load(sound); if(sound->cache) sound_cache(sound, 1); diff --git a/source/blender/blenpluginapi/iff.h b/source/blender/blenpluginapi/iff.h index b8628b00575..668d14508ec 100644 --- a/source/blender/blenpluginapi/iff.h +++ b/source/blender/blenpluginapi/iff.h @@ -81,7 +81,7 @@ typedef struct ImBuf { int refcounter; /* reference counter for multiple users */ } ImBuf; -LIBIMPORT struct ImBuf *allocImBuf(short,short,uchar,uint,uchar); +LIBIMPORT struct ImBuf *allocImBuf(short,short,uchar,uint); LIBIMPORT struct ImBuf *dupImBuf(struct ImBuf *); LIBIMPORT void freeImBuf(struct ImBuf*); diff --git a/source/blender/blenpluginapi/intern/pluginapi.c b/source/blender/blenpluginapi/intern/pluginapi.c index 9e739f7927d..a12488ae868 100644 --- a/source/blender/blenpluginapi/intern/pluginapi.c +++ b/source/blender/blenpluginapi/intern/pluginapi.c @@ -101,10 +101,9 @@ LIBEXPORT void freeT(void *vmemh) LIBEXPORT struct ImBuf *allocImBuf(short x, short y, uchar d, - uint flags, - uchar bitmap) + uint flags) { - return IMB_allocImBuf(x, y, d, flags, bitmap); + return IMB_allocImBuf(x, y, d, flags); } diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 3fb8e441d6f..73c7cfd4381 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -89,7 +89,7 @@ /* Draw Backdrop ---------------------------------- */ /* get backdrop color for top-level widgets (Scene and Object only) */ -static void acf_generic_root_color(bAnimContext *ac, bAnimListElem *ale, float *color) +static void acf_generic_root_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float *color) { /* darker blue for top-level widgets */ UI_GetThemeColor3fv(TH_DOPESHEET_CHANNELOB, color); @@ -115,7 +115,7 @@ static void acf_generic_root_backdrop(bAnimContext *ac, bAnimListElem *ale, floa /* get backdrop color for data expanders under top-level Scene/Object */ -static void acf_generic_dataexpand_color(bAnimContext *ac, bAnimListElem *ale, float *color) +static void acf_generic_dataexpand_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float *color) { /* lighter color than top-level widget */ UI_GetThemeColor3fv(TH_DOPESHEET_CHANNELSUBOB, color); @@ -202,11 +202,11 @@ static void acf_generic_channel_backdrop(bAnimContext *ac, bAnimListElem *ale, f /* Indention + Offset ------------------------------------------- */ /* indention level is always the value in the name */ -static short acf_generic_indention_0(bAnimContext *ac, bAnimListElem *ale) +static short acf_generic_indention_0(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale)) { return 0; } -static short acf_generic_indention_1(bAnimContext *ac, bAnimListElem *ale) +static short acf_generic_indention_1(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale)) { return 1; } @@ -218,7 +218,7 @@ static short acf_generic_indention_2(bAnimContext *ac, bAnimListElem *ale) #endif /* indention which varies with the grouping status */ -static short acf_generic_indention_flexible(bAnimContext *ac, bAnimListElem *ale) +static short acf_generic_indention_flexible(bAnimContext *UNUSED(ac), bAnimListElem *ale) { short indent= 0; @@ -352,7 +352,7 @@ static void *acf_generic_dsexpand_setting_ptr(bAnimListElem *ale, int setting, s } /* check if some setting exists for this object-based data-expander (datablock only) */ -static short acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting) +static short acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting) { switch (setting) { /* expand is always supported */ @@ -375,7 +375,7 @@ static short acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListEle /* Animation Summary ----------------------------------- */ /* get backdrop color for summary widget */ -static void acf_summary_color(bAnimContext *ac, bAnimListElem *ale, float *color) +static void acf_summary_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), float *color) { // FIXME: hardcoded color - same as the 'action' line in NLA // reddish color @@ -404,27 +404,27 @@ static void acf_summary_backdrop(bAnimContext *ac, bAnimListElem *ale, float ymi } /* name for summary entries */ -static void acf_summary_name(bAnimListElem *ale, char *name) +static void acf_summary_name(bAnimListElem *UNUSED(ale), char *name) { if (name) strcpy(name, "DopeSheet Summary"); } // TODO: this is really a temp icon I think -static int acf_summary_icon(bAnimListElem *ale) +static int acf_summary_icon(bAnimListElem *UNUSED(ale)) { return ICON_BORDERMOVE; } /* check if some setting exists for this channel */ -static short acf_summary_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting) +static short acf_summary_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting) { /* only expanded is supported, as it is used for hiding all stuff which the summary covers */ return (setting == ACHANNEL_SETTING_EXPAND); } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_summary_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_summary_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { if (setting == ACHANNEL_SETTING_EXPAND) { /* expanded */ @@ -481,13 +481,13 @@ static bAnimChannelType ACF_SUMMARY = /* Scene ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_scene_icon(bAnimListElem *ale) +static int acf_scene_icon(bAnimListElem *UNUSED(ale)) { return ICON_SCENE_DATA; } /* check if some setting exists for this channel */ -static short acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting) +static short acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting) { switch (setting) { /* muted only in NLA */ @@ -509,7 +509,7 @@ static short acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *ale, int s } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_scene_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_scene_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -652,7 +652,7 @@ static short acf_object_setting_valid(bAnimContext *ac, bAnimListElem *ale, int } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_object_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_object_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -726,7 +726,7 @@ static bAnimChannelType ACF_OBJECT = /* Group ------------------------------------------- */ /* get backdrop color for group widget */ -static void acf_group_color(bAnimContext *ac, bAnimListElem *ale, float *color) +static void acf_group_color(bAnimContext *UNUSED(ac), bAnimListElem *ale, float *color) { /* highlight only for action group channels */ if (ale->flag & AGRP_ACTIVE) @@ -764,7 +764,7 @@ static void acf_group_name(bAnimListElem *ale, char *name) } /* check if some setting exists for this channel */ -static short acf_group_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting) +static short acf_group_setting_valid(bAnimContext *ac, bAnimListElem *UNUSED(ale), int setting) { /* for now, all settings are supported, though some are only conditionally */ switch (setting) { @@ -814,7 +814,7 @@ static int acf_group_setting_flag(bAnimContext *ac, int setting, short *neg) } /* get pointer to the setting */ -static void *acf_group_setting_ptr(bAnimListElem *ale, int setting, short *type) +static void *acf_group_setting_ptr(bAnimListElem *ale, int UNUSED(setting), short *type) { bActionGroup *agrp= (bActionGroup *)ale->data; @@ -875,7 +875,7 @@ static short acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_fcurve_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_fcurve_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -900,7 +900,7 @@ static int acf_fcurve_setting_flag(bAnimContext *ac, int setting, short *neg) } /* get pointer to the setting */ -static void *acf_fcurve_setting_ptr(bAnimListElem *ale, int setting, short *type) +static void *acf_fcurve_setting_ptr(bAnimListElem *ale, int UNUSED(setting), short *type) { FCurve *fcu= (FCurve *)ale->data; @@ -929,13 +929,13 @@ static bAnimChannelType ACF_FCURVE = /* Object Action Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_fillactd_icon(bAnimListElem *ale) +static int acf_fillactd_icon(bAnimListElem *UNUSED(ale)) { return ICON_ACTION; } /* check if some setting exists for this channel */ -static short acf_fillactd_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting) +static short acf_fillactd_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting) { switch (setting) { /* only select and expand supported */ @@ -949,7 +949,7 @@ static short acf_fillactd_setting_valid(bAnimContext *ac, bAnimListElem *ale, in } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_fillactd_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_fillactd_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1013,19 +1013,19 @@ static bAnimChannelType ACF_FILLACTD = /* Drivers Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_filldrivers_icon(bAnimListElem *ale) +static int acf_filldrivers_icon(bAnimListElem *UNUSED(ale)) { return ICON_ANIM_DATA; } -static void acf_filldrivers_name(bAnimListElem *ale, char *name) +static void acf_filldrivers_name(bAnimListElem *UNUSED(ale), char *name) { strcpy(name, "Drivers"); } /* check if some setting exists for this channel */ // TODO: this could be made more generic -static short acf_filldrivers_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting) +static short acf_filldrivers_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting) { switch (setting) { /* only expand supported */ @@ -1038,7 +1038,7 @@ static short acf_filldrivers_setting_valid(bAnimContext *ac, bAnimListElem *ale, } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_filldrivers_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_filldrivers_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1091,18 +1091,18 @@ static bAnimChannelType ACF_FILLDRIVERS = /* Materials Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_fillmatd_icon(bAnimListElem *ale) +static int acf_fillmatd_icon(bAnimListElem *UNUSED(ale)) { return ICON_MATERIAL_DATA; } -static void acf_fillmatd_name(bAnimListElem *ale, char *name) +static void acf_fillmatd_name(bAnimListElem *UNUSED(ale), char *name) { strcpy(name, "Materials"); } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_fillmatd_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_fillmatd_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1137,18 +1137,18 @@ static bAnimChannelType ACF_FILLMATD= /* Particles Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_fillpartd_icon(bAnimListElem *ale) +static int acf_fillpartd_icon(bAnimListElem *UNUSED(ale)) { return ICON_PARTICLE_DATA; } -static void acf_fillpartd_name(bAnimListElem *ale, char *name) +static void acf_fillpartd_name(bAnimListElem *UNUSED(ale), char *name) { strcpy(name, "Particles"); } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_fillpartd_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_fillpartd_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1205,12 +1205,12 @@ static short acf_filltexd_offset(bAnimContext *ac, bAnimListElem *ale) } // TODO: just get this from RNA? -static int acf_filltexd_icon(bAnimListElem *ale) +static int acf_filltexd_icon(bAnimListElem *UNUSED(ale)) { return ICON_TEXTURE_DATA; } -static void acf_filltexd_name(bAnimListElem *ale, char *name) +static void acf_filltexd_name(bAnimListElem *UNUSED(ale), char *name) { strcpy(name, "Textures"); } @@ -1253,7 +1253,7 @@ static void *acf_filltexd_setting_ptr(bAnimListElem *ale, int setting, short *ty } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_filltexd_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_filltexd_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1289,19 +1289,19 @@ static bAnimChannelType ACF_FILLTEXD= /* Material Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dsmat_icon(bAnimListElem *ale) +static int acf_dsmat_icon(bAnimListElem *UNUSED(ale)) { return ICON_MATERIAL_DATA; } /* offset for material expanders */ -static short acf_dsmat_offset(bAnimContext *ac, bAnimListElem *ale) +static short acf_dsmat_offset(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale)) { return 21; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dsmat_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dsmat_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1371,13 +1371,13 @@ static bAnimChannelType ACF_DSMAT= /* Lamp Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dslam_icon(bAnimListElem *ale) +static int acf_dslam_icon(bAnimListElem *UNUSED(ale)) { return ICON_LAMP_DATA; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dslam_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dslam_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1447,13 +1447,13 @@ static bAnimChannelType ACF_DSLAM= /* Texture Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dstex_icon(bAnimListElem *ale) +static int acf_dstex_icon(bAnimListElem *UNUSED(ale)) { return ICON_TEXTURE_DATA; } /* offset for texture expanders */ -static short acf_dstex_offset(bAnimContext *ac, bAnimListElem *ale) +static short acf_dstex_offset(bAnimContext *UNUSED(ac), bAnimListElem *ale) { short offset = 21; @@ -1472,7 +1472,7 @@ static short acf_dstex_offset(bAnimContext *ac, bAnimListElem *ale) } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dstex_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dstex_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1542,13 +1542,13 @@ static bAnimChannelType ACF_DSTEX= /* Camera Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dscam_icon(bAnimListElem *ale) +static int acf_dscam_icon(bAnimListElem *UNUSED(ale)) { return ICON_CAMERA_DATA; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dscam_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dscam_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1634,7 +1634,7 @@ static int acf_dscur_icon(bAnimListElem *ale) } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dscur_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dscur_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1704,13 +1704,13 @@ static bAnimChannelType ACF_DSCUR= /* Shape Key Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dsskey_icon(bAnimListElem *ale) +static int acf_dsskey_icon(bAnimListElem *UNUSED(ale)) { return ICON_SHAPEKEY_DATA; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dsskey_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dsskey_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1780,13 +1780,13 @@ static bAnimChannelType ACF_DSSKEY= /* World Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dswor_icon(bAnimListElem *ale) +static int acf_dswor_icon(bAnimListElem *UNUSED(ale)) { return ICON_WORLD_DATA; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dswor_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dswor_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1856,13 +1856,13 @@ static bAnimChannelType ACF_DSWOR= /* Particle Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dspart_icon(bAnimListElem *ale) +static int acf_dspart_icon(bAnimListElem *UNUSED(ale)) { return ICON_PARTICLE_DATA; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dspart_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dspart_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -1932,13 +1932,13 @@ static bAnimChannelType ACF_DSPART= /* MetaBall Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dsmball_icon(bAnimListElem *ale) +static int acf_dsmball_icon(bAnimListElem *UNUSED(ale)) { return ICON_META_DATA; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dsmball_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dsmball_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -2008,13 +2008,13 @@ static bAnimChannelType ACF_DSMBALL= /* Armature Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dsarm_icon(bAnimListElem *ale) +static int acf_dsarm_icon(bAnimListElem *UNUSED(ale)) { return ICON_ARMATURE_DATA; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dsarm_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dsarm_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -2084,13 +2084,13 @@ static bAnimChannelType ACF_DSARM= /* NodeTree Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dsntree_icon(bAnimListElem *ale) +static int acf_dsntree_icon(bAnimListElem *UNUSED(ale)) { return ICON_NODETREE; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dsntree_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dsntree_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -2160,13 +2160,13 @@ static bAnimChannelType ACF_DSNTREE= /* Mesh Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dsmesh_icon(bAnimListElem *ale) +static int acf_dsmesh_icon(bAnimListElem *UNUSED(ale)) { return ICON_MESH_DATA; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dsmesh_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_dsmesh_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -2251,7 +2251,7 @@ static void acf_shapekey_name(bAnimListElem *ale, char *name) } /* check if some setting exists for this channel */ -static short acf_shapekey_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting) +static short acf_shapekey_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), int setting) { switch (setting) { case ACHANNEL_SETTING_SELECT: /* selected */ @@ -2266,7 +2266,7 @@ static short acf_shapekey_setting_valid(bAnimContext *ac, bAnimListElem *ale, in } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_shapekey_setting_flag(bAnimContext *ac, int setting, short *neg) +static int acf_shapekey_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg) { /* clear extra return data first */ *neg= 0; @@ -2851,7 +2851,7 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float /* ------------------ */ /* callback for (normal) widget settings - send notifiers */ -static void achannel_setting_widget_cb(bContext *C, void *poin, void *poin2) +static void achannel_setting_widget_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) { WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); } diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 1ac17aee871..16eb08be933 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1628,7 +1628,7 @@ void ANIM_OT_channels_select_border(wmOperatorType *ot) /* ******************** Mouse-Click Operator *********************** */ /* Handle selection changes due to clicking on channels. Settings will get caught by UI code... */ -static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, short selectmode) +static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_index, short selectmode) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 5312e97c604..ed23e72b328 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -96,7 +96,7 @@ void ANIM_list_elem_update(Scene *scene, bAnimListElem *ale) /* tags the given ID block for refreshes (if applicable) due to * Animation Editor editing */ -void ANIM_id_update(Scene *scene, ID *id) +void ANIM_id_update(Scene *UNUSED(scene), ID *id) { if (id) { AnimData *adt= BKE_animdata_from_id(id); @@ -121,7 +121,7 @@ void ANIM_id_update(Scene *scene, ID *id) */ /* perform syncing updates for Action Groups */ -static void animchan_sync_group (bAnimContext *ac, bAnimListElem *ale) +static void animchan_sync_group (bAnimContext *UNUSED(ac), bAnimListElem *ale) { bActionGroup *agrp= (bActionGroup *)ale->data; ID *owner_id= ale->id; @@ -154,7 +154,7 @@ static void animchan_sync_group (bAnimContext *ac, bAnimListElem *ale) } /* perform syncing updates for F-Curves */ -static void animchan_sync_fcurve (bAnimContext *ac, bAnimListElem *ale) +static void animchan_sync_fcurve (bAnimContext *UNUSED(ac), bAnimListElem *ale) { FCurve *fcu= (FCurve *)ale->data; ID *owner_id= ale->id; diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 6e5be217164..08b4f8a7bc8 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1065,7 +1065,7 @@ static int animdata_filter_action (bAnimContext *ac, ListBase *anim_data, bDopeS * - for normal filtering (i.e. for editing), we only need the NLA-tracks but they can be in 'normal' evaluation * order, i.e. first to last. Otherwise, some tools may get screwed up. */ -static int animdata_filter_nla (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, AnimData *adt, int filter_mode, void *owner, short ownertype, ID *owner_id) +static int animdata_filter_nla (bAnimContext *UNUSED(ac), ListBase *anim_data, bDopeSheet *UNUSED(ads), AnimData *adt, int filter_mode, void *owner, short ownertype, ID *owner_id) { bAnimListElem *ale; NlaTrack *nlt; diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 0f9ef45ac94..055ee1c3392 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -489,7 +489,7 @@ static int ed_marker_move_invoke(bContext *C, wmOperator *op, wmEvent *evt) } /* note, init has to be called succesfully */ -static void ed_marker_move_apply(bContext *C, wmOperator *op) +static void ed_marker_move_apply(wmOperator *op) { MarkerMove *mm= op->customdata; TimeMarker *marker; @@ -508,7 +508,7 @@ static void ed_marker_move_apply(bContext *C, wmOperator *op) static void ed_marker_move_cancel(bContext *C, wmOperator *op) { RNA_int_set(op->ptr, "frames", 0); - ed_marker_move_apply(C, op); + ed_marker_move_apply(op); ed_marker_move_exit(C, op); WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); @@ -565,7 +565,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) offs= (int)fac; RNA_int_set(op->ptr, "frames", offs); - ed_marker_move_apply(C, op); + ed_marker_move_apply(op); /* cruft below is for header print */ for (a=0, marker= mm->markers->first; marker; marker= marker->next) { @@ -632,7 +632,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) outputNumInput(&mm->num, str_tx); RNA_int_set(op->ptr, "frames", vec[0]); - ed_marker_move_apply(C, op); + ed_marker_move_apply(op); // ed_marker_header_update(C, op, str, (int)vec[0]); // strcat(str, str_tx); sprintf(str, "Marker offset %s", str_tx); @@ -649,7 +649,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) static int ed_marker_move_exec(bContext *C, wmOperator *op) { if(ed_marker_move_init(C, op)) { - ed_marker_move_apply(C, op); + ed_marker_move_apply(op); ed_marker_move_exit(C, op); return OPERATOR_FINISHED; } @@ -697,7 +697,7 @@ callbacks: /* duplicate selected TimeMarkers */ -static void ed_marker_duplicate_apply(bContext *C, wmOperator *op) +static void ed_marker_duplicate_apply(bContext *C) { ListBase *markers= context_get_markers(C); TimeMarker *marker, *newmarker; @@ -731,7 +731,7 @@ static void ed_marker_duplicate_apply(bContext *C, wmOperator *op) static int ed_marker_duplicate_exec(bContext *C, wmOperator *op) { - ed_marker_duplicate_apply(C, op); + ed_marker_duplicate_apply(C); ed_marker_move_exec(C, op); /* assumes frs delta set */ return OPERATOR_FINISHED; @@ -740,7 +740,7 @@ static int ed_marker_duplicate_exec(bContext *C, wmOperator *op) static int ed_marker_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *evt) { - ed_marker_duplicate_apply(C, op); + ed_marker_duplicate_apply(C); return ed_marker_move_invoke(C, op, evt); } diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 28b51ad0602..6ace48dd301 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -115,7 +115,7 @@ FCurve *verify_driver_fcurve (ID *id, const char rna_path[], const int array_ind /* Main Driver Management API calls: * Add a new driver for the specified property on the given ID block */ -short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short flag, int type) +short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short UNUSED(flag), int type) { PointerRNA id_ptr, ptr; PropertyRNA *prop; @@ -193,7 +193,7 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla /* Main Driver Management API calls: * Remove the driver for the specified property on the given ID block (if available) */ -short ANIM_remove_driver (struct ID *id, const char rna_path[], int array_index, short flag) +short ANIM_remove_driver (struct ID *id, const char rna_path[], int array_index, short UNUSED(flag)) { AnimData *adt; FCurve *fcu; @@ -262,7 +262,7 @@ short ANIM_driver_can_paste (void) /* Main Driver Management API calls: * Make a copy of the driver for the specified property on the given ID block */ -short ANIM_copy_driver (ID *id, const char rna_path[], int array_index, short flag) +short ANIM_copy_driver (ID *id, const char rna_path[], int array_index, short UNUSED(flag)) { PointerRNA id_ptr, ptr; PropertyRNA *prop; @@ -307,7 +307,7 @@ short ANIM_copy_driver (ID *id, const char rna_path[], int array_index, short fl * Add a new driver for the specified property on the given ID block or replace an existing one * with the driver + driver-curve data from the buffer */ -short ANIM_paste_driver (ID *id, const char rna_path[], int array_index, short flag) +short ANIM_paste_driver (ID *id, const char rna_path[], int array_index, short UNUSED(flag)) { PointerRNA id_ptr, ptr; PropertyRNA *prop; diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 35e6cb66d45..2b8d0f35b9a 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -74,7 +74,7 @@ } /* callback to verify modifier data */ -static void validate_fmodifier_cb (bContext *C, void *fcm_v, void *dummy) +static void validate_fmodifier_cb (bContext *UNUSED(C), void *fcm_v, void *UNUSED(arg)) { FModifier *fcm= (FModifier *)fcm_v; FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); @@ -215,7 +215,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s /* --------------- */ /* draw settings for generator modifier */ -static void draw_modifier__fn_generator(uiLayout *layout, ID *id, FModifier *fcm, short width) +static void draw_modifier__fn_generator(uiLayout *layout, ID *id, FModifier *fcm, short UNUSED(width)) { uiLayout *col; PointerRNA ptr; @@ -238,7 +238,7 @@ static void draw_modifier__fn_generator(uiLayout *layout, ID *id, FModifier *fcm /* --------------- */ /* draw settings for cycles modifier */ -static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, short width) +static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, short UNUSED(width)) { uiLayout *split, *col; PointerRNA ptr; @@ -267,7 +267,7 @@ static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, shor /* --------------- */ /* draw settings for noise modifier */ -static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short width) +static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short UNUSED(width)) { uiLayout *split, *col; PointerRNA ptr; @@ -374,7 +374,7 @@ static int binarysearch_fcm_envelopedata_index (FCM_EnvelopeData array[], float /* callback to add new envelope data point */ // TODO: should we have a separate file for things like this? -static void fmod_envelope_addpoint_cb (bContext *C, void *fcm_dv, void *dummy) +static void fmod_envelope_addpoint_cb (bContext *C, void *fcm_dv, void *UNUSED(arg)) { Scene *scene= CTX_data_scene(C); FMod_Envelope *env= (FMod_Envelope *)fcm_dv; @@ -426,7 +426,7 @@ static void fmod_envelope_addpoint_cb (bContext *C, void *fcm_dv, void *dummy) /* callback to remove envelope data point */ // TODO: should we have a separate file for things like this? -static void fmod_envelope_deletepoint_cb (bContext *C, void *fcm_dv, void *ind_v) +static void fmod_envelope_deletepoint_cb (bContext *UNUSED(C), void *fcm_dv, void *ind_v) { FMod_Envelope *env= (FMod_Envelope *)fcm_dv; FCM_EnvelopeData *fedn; @@ -454,7 +454,7 @@ static void fmod_envelope_deletepoint_cb (bContext *C, void *fcm_dv, void *ind_v } /* draw settings for envelope modifier */ -static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, short width) +static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, short UNUSED(width)) { FMod_Envelope *env= (FMod_Envelope *)fcm->data; FCM_EnvelopeData *fed; @@ -509,7 +509,7 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh /* --------------- */ /* draw settings for limits modifier */ -static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, short width) +static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, short UNUSED(width)) { uiLayout *split, *col, *row; PointerRNA ptr; @@ -557,7 +557,7 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor /* --------------- */ /* draw settings for stepped interpolation modifier */ -static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, short width) +static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, short UNUSED(width)) { uiLayout *col, *subcol; PointerRNA ptr; diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 02e141a7a69..c895baa49f8 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -655,7 +655,7 @@ void draw_gpl_channel(View2D *v2d, bDopeSheet *ads, bGPDlayer *gpl, float ypos) BLI_dlrbTree_init(&keys); - gpl_to_keylist(ads, gpl, &keys, NULL); + gpl_to_keylist(ads, gpl, &keys); BLI_dlrbTree_linkedlist_sync(&keys); @@ -898,7 +898,7 @@ void action_to_keylist(AnimData *adt, bAction *act, DLRBT_Tree *keys, DLRBT_Tree } -void gpl_to_keylist(bDopeSheet *ads, bGPDlayer *gpl, DLRBT_Tree *keys, DLRBT_Tree *blocks) +void gpl_to_keylist(bDopeSheet *UNUSED(ads), bGPDlayer *gpl, DLRBT_Tree *keys) { bGPDframe *gpf; ActKeyColumn *ak; diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index 17d674784f8..590d609ce02 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -369,7 +369,7 @@ static short scene_keyframes_loop(KeyframeEditData *ked, Scene *sce, KeyframeEdi } /* This function is used to loop over the keyframe data in a DopeSheet summary */ -static short summary_keyframes_loop(KeyframeEditData *ked, bAnimContext *ac, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb, int filterflag) +static short summary_keyframes_loop(KeyframeEditData *ked, bAnimContext *ac, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb, int UNUSED(filterflag)) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index befcc0a71cb..68e38d04620 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -486,7 +486,7 @@ void free_anim_copybuf (void) /* ------------------- */ /* This function adds data to the keyframes copy/paste buffer, freeing existing data first */ -short copy_animedit_keys (bAnimContext *ac, ListBase *anim_data) +short copy_animedit_keys (bAnimContext *UNUSED(ac), ListBase *anim_data) { bAnimListElem *ale; diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 160116bb1a3..ddd692d26ea 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -917,7 +917,7 @@ short insert_keyframe (ID *id, bAction *act, const char group[], const char rna_ * The flag argument is used for special settings that alter the behaviour of * the keyframe deletion. These include the quick refresh options. */ -short delete_keyframe (ID *id, bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag) +short delete_keyframe (ID *id, bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short UNUSED(flag)) { AnimData *adt= BKE_animdata_from_id(id); PointerRNA id_ptr, ptr; diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 55c14411328..57617651823 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -558,7 +558,7 @@ KeyingSet *ANIM_builtin_keyingset_get_named (KeyingSet *prevKS, const char name[ /* --------------- */ /* Add the given KeyingSetInfo to the list of type infos, and create an appropriate builtin set too */ -void ANIM_keyingset_info_register (const bContext *C, KeyingSetInfo *ksi) +void ANIM_keyingset_info_register (KeyingSetInfo *ksi) { KeyingSet *ks; diff --git a/source/blender/editors/armature/editarmature_generate.c b/source/blender/editors/armature/editarmature_generate.c index 1c9024f6f91..6eda622ead8 100644 --- a/source/blender/editors/armature/editarmature_generate.c +++ b/source/blender/editors/armature/editarmature_generate.c @@ -46,7 +46,7 @@ #include "armature_intern.h" #include "BIF_generate.h" -void setBoneRollFromNormal(EditBone *bone, float *no, float invmat[][4], float tmat[][3]) +void setBoneRollFromNormal(EditBone *bone, float *no, float UNUSED(invmat[][4]), float tmat[][3]) { if (no != NULL && !is_zero_v3(no)) { @@ -118,7 +118,7 @@ float calcArcCorrelation(BArcIterator *iter, int start, int end, float v0[3], fl } } -int nextFixedSubdivision(ToolSettings *toolsettings, BArcIterator *iter, int start, int end, float head[3], float p[3]) +int nextFixedSubdivision(ToolSettings *toolsettings, BArcIterator *iter, int start, int end, float UNUSED(head[3]), float p[3]) { static float stroke_length = 0; static float current_length; @@ -277,7 +277,7 @@ int nextLengthSubdivision(ToolSettings *toolsettings, BArcIterator *iter, int st return -1; } -EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *editbones, BArcIterator *iter, float invmat[][4], float tmat[][3], NextSubdivisionFunc next_subdividion) +EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *UNUSED(editbones), BArcIterator *iter, float invmat[][4], float tmat[][3], NextSubdivisionFunc next_subdividion) { EditBone *lastBone = NULL; EditBone *child = NULL; diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index 637c6076314..e80f1494d8c 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -374,7 +374,7 @@ static RigNode *newRigNodeHead(RigGraph *rg, RigArc *arc, float p[3]) return node; } -static void addRigNodeHead(RigGraph *rg, RigArc *arc, RigNode *node) +static void addRigNodeHead(RigGraph *UNUSED(rg), RigArc *arc, RigNode *node) { node->degree++; @@ -1784,7 +1784,7 @@ static void repositionTailControl(RigGraph *rigg, RigControl *ctrl) finalizeControl(rigg, ctrl, 1); /* resize will be recalculated anyway so we don't need it */ } -static void repositionControl(RigGraph *rigg, RigControl *ctrl, float head[3], float tail[3], float qrot[4], float resize) +static void repositionControl(RigGraph *rigg, RigControl *ctrl, float head[3], float UNUSED(tail[3]), float qrot[4], float resize) { float parent_offset[3], tail_offset[3]; @@ -2051,7 +2051,7 @@ static float calcCostLengthDistance(BArcIterator *iter, float **vec_cache, RigEd } #endif -static float calcCostAngleLengthDistance(BArcIterator *iter, float **vec_cache, RigEdge *edge, float *vec0, float *vec1, float *vec2, int i1, int i2, float angle_weight, float length_weight, float distance_weight) +static float calcCostAngleLengthDistance(BArcIterator *iter, float **UNUSED(vec_cache), RigEdge *edge, float *vec0, float *vec1, float *vec2, int i1, int i2, float angle_weight, float length_weight, float distance_weight) { float vec_second[3], vec_first[3]; float length2; diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 84f8513878c..93bddb3834b 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -184,7 +184,7 @@ void BIF_makeListTemplates(const bContext *C) } } -char *BIF_listTemplates(const bContext *C) +char *BIF_listTemplates(const bContext *UNUSED(C)) { GHashIterator ghi; char menu_header[] = "Template%t|None%x0|"; @@ -309,7 +309,7 @@ char * BIF_nameBoneTemplate(const bContext *C) return RIG_nameBone(rg, 0, index); } -void BIF_freeTemplates(bContext *C) +void BIF_freeTemplates(bContext *UNUSED(C)) { if (TEMPLATES_MENU != NULL) { @@ -1029,7 +1029,7 @@ void sk_projectDrawPoint(bContext *C, float vec[3], SK_Stroke *stk, SK_DrawData sub_v3_v3v3(vec, fp, dvec); } -int sk_getStrokeDrawPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd) +int sk_getStrokeDrawPoint(bContext *C, SK_Point *pt, SK_Sketch *UNUSED(sketch), SK_Stroke *stk, SK_DrawData *dd) { pt->type = dd->type; pt->mode = PT_PROJECT; @@ -1773,7 +1773,7 @@ int sk_getSegments(SK_Stroke *segments, SK_Stroke *gesture) return segments->nb_points - 1; } -int sk_detectCutGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +int sk_detectCutGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { if (gest->nb_segments == 1 && gest->nb_intersections == 1) { @@ -1783,7 +1783,7 @@ int sk_detectCutGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) return 0; } -void sk_applyCutGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +void sk_applyCutGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { SK_Intersection *isect; @@ -1800,7 +1800,7 @@ void sk_applyCutGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) } } -int sk_detectTrimGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +int sk_detectTrimGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { if (gest->nb_segments == 2 && gest->nb_intersections == 1 && gest->nb_self_intersections == 0) { @@ -1821,7 +1821,7 @@ int sk_detectTrimGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) return 0; } -void sk_applyTrimGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +void sk_applyTrimGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { SK_Intersection *isect; float trim_dir[3]; @@ -1856,7 +1856,7 @@ void sk_applyTrimGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) } } -int sk_detectCommandGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +int sk_detectCommandGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { if (gest->nb_segments > 2 && gest->nb_intersections == 2 && gest->nb_self_intersections == 1) { @@ -1883,7 +1883,7 @@ int sk_detectCommandGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) return 0; } -void sk_applyCommandGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +void sk_applyCommandGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { SK_Intersection *isect; int command = 1; @@ -1918,7 +1918,7 @@ void sk_applyCommandGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) } } -int sk_detectDeleteGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +int sk_detectDeleteGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { if (gest->nb_segments == 2 && gest->nb_intersections == 2) { @@ -1939,7 +1939,7 @@ int sk_detectDeleteGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) return 0; } -void sk_applyDeleteGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +void sk_applyDeleteGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *sketch) { SK_Intersection *isect; @@ -1955,7 +1955,7 @@ void sk_applyDeleteGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) } } -int sk_detectMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +int sk_detectMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { ARegion *ar = CTX_wm_region(C); if (gest->nb_segments > 2 && gest->nb_intersections == 2) @@ -2003,7 +2003,7 @@ int sk_detectMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) return 0; } -void sk_applyMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +void sk_applyMergeGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { SK_Intersection *isect; @@ -2034,7 +2034,7 @@ void sk_applyMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) } } -int sk_detectReverseGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +int sk_detectReverseGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { if (gest->nb_segments > 2 && gest->nb_intersections == 2 && gest->nb_self_intersections == 0) { @@ -2076,7 +2076,7 @@ int sk_detectReverseGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) return 0; } -void sk_applyReverseGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +void sk_applyReverseGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { SK_Intersection *isect; @@ -2093,7 +2093,7 @@ void sk_applyReverseGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) } } -int sk_detectConvertGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +int sk_detectConvertGesture(bContext *UNUSED(C), SK_Gesture *gest, SK_Sketch *UNUSED(sketch)) { if (gest->nb_segments == 3 && gest->nb_self_intersections == 1) { @@ -2102,7 +2102,7 @@ int sk_detectConvertGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) return 0; } -void sk_applyConvertGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) +void sk_applyConvertGesture(bContext *C, SK_Gesture *UNUSED(gest), SK_Sketch *sketch) { sk_convert(C, sketch); } @@ -2215,7 +2215,7 @@ void sk_queueRedrawSketch(SK_Sketch *sketch) } } -void sk_drawSketch(Scene *scene, View3D *v3d, SK_Sketch *sketch, int with_names) +void sk_drawSketch(Scene *scene, View3D *UNUSED(v3d), SK_Sketch *sketch, int with_names) { ToolSettings *ts= scene->toolsettings; SK_Stroke *stk; diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 38372850ff8..10627f95aa7 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -62,7 +62,7 @@ /* ************* XXX *************** */ static void waitcursor(int val) {} -static void progress_bar(int dummy_val, const char *dummy) {} +static void progress_bar(int UNUSED(dummy_val), const char *UNUSED(dummy)) {} static void start_progress_bar() {} static void end_progress_bar() {} static void error(char *str) { printf("error: %s\n", str); } @@ -362,7 +362,7 @@ void laplacian_begin_solve(LaplacianSystem *sys, int index) } } -void laplacian_add_right_hand_side(LaplacianSystem *sys, int v, float value) +void laplacian_add_right_hand_side(LaplacianSystem *UNUSED(sys), int v, float value) { nlRightHandSideAdd(0, v, value); } @@ -1712,7 +1712,7 @@ static void meshdeform_matrix_solve(MeshDeformBind *mdb) nlDeleteContext(context); } -static void harmonic_coordinates_bind(Scene *scene, MeshDeformModifierData *mmd, MeshDeformBind *mdb) +static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierData *mmd, MeshDeformBind *mdb) { MDefBindInfluence *inf; MDefInfluence *mdinf; diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 9602d80575a..32362afca2b 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -1692,7 +1692,7 @@ int filterInternalExternalReebGraph(ReebGraph *rg, float threshold_internal, flo return value; } -int filterCyclesReebGraph(ReebGraph *rg, float distance_threshold) +int filterCyclesReebGraph(ReebGraph *rg, float UNUSED(distance_threshold)) { ReebArc *arc1, *arc2; ReebArc *next2; @@ -1723,7 +1723,7 @@ int filterCyclesReebGraph(ReebGraph *rg, float distance_threshold) return filtered; } -int filterSmartReebGraph(ReebGraph *rg, float threshold) +int filterSmartReebGraph(ReebGraph *rg, float UNUSED(threshold)) { int value = 0; #if 0 //XXX diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 083a90efb25..75156571cf4 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -662,7 +662,7 @@ static short gp_stroke_eraser_splitdel (bGPDframe *gpf, bGPDstroke *gps, int i) } /* eraser tool - check if part of stroke occurs within last segment drawn by eraser */ -static short gp_stroke_eraser_strokeinside (int mval[], int mvalo[], short rad, short x0, short y0, short x1, short y1) +static short gp_stroke_eraser_strokeinside (int mval[], int UNUSED(mvalo[]), short rad, short x0, short y0, short x1, short y1) { /* simple within-radius check for now */ if (edge_inside_circle(mval[0], mval[1], rad, x0, y0, x1, y1)) @@ -1250,7 +1250,7 @@ static int gpencil_draw_cancel (bContext *C, wmOperator *op) /* ------------------------------- */ /* create a new stroke point at the point indicated by the painting context */ -static void gpencil_draw_apply (bContext *C, wmOperator *op, tGPsdata *p) +static void gpencil_draw_apply (wmOperator *op, tGPsdata *p) { /* handle drawing/erasing -> test for erasing first */ if (p->paintmode == GP_PAINTMODE_ERASER) { @@ -1294,7 +1294,7 @@ static void gpencil_draw_apply (bContext *C, wmOperator *op, tGPsdata *p) } /* handle draw event */ -static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *event) +static void gpencil_draw_apply_event (wmOperator *op, wmEvent *event) { tGPsdata *p= op->customdata; ARegion *ar= p->ar; @@ -1343,7 +1343,7 @@ static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *even RNA_float_set(&itemptr, "pressure", p->pressure); /* apply the current latest drawing point */ - gpencil_draw_apply(C, op, p); + gpencil_draw_apply(op, p); /* force refresh */ ED_region_tag_redraw(p->ar); /* just active area for now, since doing whole screen is too slow */ @@ -1394,7 +1394,7 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op) } /* apply this data as necessary now (as per usual) */ - gpencil_draw_apply(C, op, p); + gpencil_draw_apply(op, p); } RNA_END; @@ -1456,7 +1456,7 @@ static int gpencil_draw_invoke (bContext *C, wmOperator *op, wmEvent *event) p->status= GP_STATUS_PAINTING; /* handle the initial drawing - i.e. for just doing a simple dot */ - gpencil_draw_apply_event(C, op, event); + gpencil_draw_apply_event(op, event); } else { /* toolbar invoked - don't start drawing yet... */ @@ -1516,7 +1516,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) if (p->status == GP_STATUS_PAINTING) { /* handle drawing event */ //printf("\t\tGP - add point\n"); - gpencil_draw_apply_event(C, op, event); + gpencil_draw_apply_event(op, event); /* finish painting operation if anything went wrong just now */ if (p->status == GP_STATUS_ERROR) { diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index 78a645d6b50..ec74ea6123b 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -136,7 +136,7 @@ void scene_to_keylist(struct bDopeSheet *ads, struct Scene *sce, struct DLRBT_Tr void summary_to_keylist(struct bAnimContext *ac, struct DLRBT_Tree *keys, struct DLRBT_Tree *blocks); /* Grease Pencil Layer */ // XXX not restored -void gpl_to_keylist(struct bDopeSheet *ads, struct bGPDlayer *gpl, struct DLRBT_Tree *keys, struct DLRBT_Tree *blocks); +void gpl_to_keylist(struct bDopeSheet *ads, struct bGPDlayer *gpl, struct DLRBT_Tree *keys); /* ActKeyColumn API ---------------- */ /* Comparator callback used for ActKeyColumns and cframe float-value pointer */ diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index b3aac489852..2650005a489 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -183,7 +183,7 @@ struct KeyingSet *ANIM_builtin_keyingset_get_named(struct KeyingSet *prevKS, con KeyingSetInfo *ANIM_keyingset_info_find_named(const char name[]); /* for RNA type registrations... */ -void ANIM_keyingset_info_register(const struct bContext *C, KeyingSetInfo *ksi); +void ANIM_keyingset_info_register(KeyingSetInfo *ksi); void ANIM_keyingset_info_unregister(const struct bContext *C, KeyingSetInfo *ksi); /* cleanup on exit */ diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 313df32fd6f..22779fbba0b 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -225,7 +225,7 @@ void ED_mesh_calc_normals(struct Mesh *me); void ED_mesh_material_link(struct Mesh *me, struct Material *ma); void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges); -int ED_mesh_uv_texture_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me, const char *name, int active_set); +int ED_mesh_uv_texture_add(struct bContext *C, struct Mesh *me, const char *name, int active_set); int ED_mesh_uv_texture_remove(struct bContext *C, struct Object *ob, struct Mesh *me); int ED_mesh_color_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me, const char *name, int active_set); int ED_mesh_color_remove(struct bContext *C, struct Object *ob, struct Mesh *me); diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 64e72a5e2fa..63af7c5abd3 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -109,7 +109,7 @@ int object_is_libdata(struct Object *ob); int object_data_is_libdata(struct Object *ob); /* object motion paths */ -void ED_objects_clear_paths(struct bContext *C, struct Scene *scene); +void ED_objects_clear_paths(struct bContext *C); void ED_objects_recalculate_paths(struct bContext *C, struct Scene *scene); /* constraints */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c450b41b183..ab8fda85ff2 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3806,7 +3806,7 @@ static int ui_do_but_VECTORSCOPE(bContext *C, uiBlock *block, uiBut *but, uiHand } #ifdef INTERNATIONAL -static int ui_do_but_CHARTAB(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event) +static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut *UNUSED(but), uiHandleButtonData *UNUSED(data), wmEvent *UNUSED(event)) { /* XXX 2.50 bad global and state access */ #if 0 diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 2da54b492e6..6d1a72fcd1a 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -876,7 +876,7 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), ImBuf *ima; /* first allocate imbuf for scaling and copy preview into it */ - ima = IMB_allocImBuf(rw, rh, 32, IB_rect, 0); + ima = IMB_allocImBuf(rw, rh, 32, IB_rect); memcpy(ima->rect, rect, rw*rh*sizeof(unsigned int)); /* scale it */ diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index fc92598591a..e33e24a75ce 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -68,7 +68,7 @@ #include "mesh_intern.h" /* ***************** XXX **************** */ -static int pupmenu(const char *dummy) {return 0;} +static int pupmenu(const char *UNUSED(dummy)) {return 0;} /* ***************** XXX **************** */ @@ -343,7 +343,7 @@ void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int index) // object_tface_flags_changed(OBACT, 0); } -void select_linked_tfaces(bContext *C, Object *ob, short mval[2], int mode) +void select_linked_tfaces(bContext *UNUSED(C), Object *ob, short UNUSED(mval[2]), int mode) { Mesh *me; unsigned int index=0; @@ -464,7 +464,7 @@ int minmax_tface(Object *ob, float *min, float *max) #define ME_SEAM_DONE 2 /* reuse this flag */ -static float edgetag_cut_cost(EditMesh *em, int e1, int e2, int vert) +static float edgetag_cut_cost(int e1, int e2, int vert) { EditVert *v = EM_get_vert_for_index(vert); EditEdge *eed1 = EM_get_edge_for_index(e1), *eed2 = EM_get_edge_for_index(e2); @@ -483,7 +483,7 @@ static float edgetag_cut_cost(EditMesh *em, int e1, int e2, int vert) return cost; } -static void edgetag_add_adjacent(EditMesh *em, Heap *heap, int mednum, int vertnum, int *nedges, int *edges, int *prevedge, float *cost) +static void edgetag_add_adjacent(Heap *heap, int mednum, int vertnum, int *nedges, int *edges, int *prevedge, float *cost) { int startadj, endadj = nedges[vertnum+1]; @@ -495,7 +495,7 @@ static void edgetag_add_adjacent(EditMesh *em, Heap *heap, int mednum, int vertn if (eedadj->f2 & ME_SEAM_DONE) continue; - newcost = cost[mednum] + edgetag_cut_cost(em, mednum, adjnum, vertnum); + newcost = cost[mednum] + edgetag_cut_cost(mednum, adjnum, vertnum); if (cost[adjnum] > newcost) { cost[adjnum] = newcost; @@ -621,8 +621,8 @@ int edgetag_shortest_path(Scene *scene, EditMesh *em, EditEdge *source, EditEdge eed->f2 |= ME_SEAM_DONE; - edgetag_add_adjacent(em, heap, mednum, eed->v1->tmp.l, nedges, edges, prevedge, cost); - edgetag_add_adjacent(em, heap, mednum, eed->v2->tmp.l, nedges, edges, prevedge, cost); + edgetag_add_adjacent(heap, mednum, eed->v1->tmp.l, nedges, edges, prevedge, cost); + edgetag_add_adjacent(heap, mednum, eed->v2->tmp.l, nedges, edges, prevedge, cost); } @@ -819,7 +819,7 @@ void face_borderselect(struct bContext *C, Object *ob, rcti *rect, int select, i view3d_validate_backbuf(&vc); - ibuf = IMB_allocImBuf(sx,sy,32,IB_rect,0); + ibuf = IMB_allocImBuf(sx,sy,32,IB_rect); rt = ibuf->rect; glReadPixels(rect->xmin+vc.ar->winrct.xmin, rect->ymin+vc.ar->winrct.ymin, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); if(ENDIAN_ORDER==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf); diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index ff2fad3f551..80df034552d 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -78,8 +78,8 @@ editmesh.c: */ /* XXX */ -static void BIF_undo_push(const char *dummy) {} -static void error(const char *dummy) {} +static void BIF_undo_push(const char *UNUSED(arg)) {} +static void error(const char *UNUSED(arg)) {} /* ***************** HASH ********************* */ @@ -91,7 +91,7 @@ static void error(const char *dummy) {} /* ************ ADD / REMOVE / FIND ****************** */ -static void *calloc_em(EditMesh *em, size_t size, size_t nr) +static void *calloc_em(EditMesh *UNUSED(em), size_t size, size_t nr) { return calloc(size, nr); } @@ -447,19 +447,19 @@ int editface_containsEdge(EditFace *efa, EditEdge *eed) /* ************************ stuct EditMesh manipulation ***************************** */ /* fake callocs for fastmalloc below */ -static void *calloc_fastvert(EditMesh *em, size_t size, size_t nr) +static void *calloc_fastvert(EditMesh *em, size_t UNUSED(size), size_t UNUSED(nr)) { EditVert *eve= em->curvert++; eve->fast= 1; return eve; } -static void *calloc_fastedge(EditMesh *em, size_t size, size_t nr) +static void *calloc_fastedge(EditMesh *em, size_t UNUSED(size), size_t UNUSED(nr)) { EditEdge *eed= em->curedge++; eed->fast= 1; return eed; } -static void *calloc_fastface(EditMesh *em, size_t size, size_t nr) +static void *calloc_fastface(EditMesh *em, size_t UNUSED(size), size_t UNUSED(nr)) { EditFace *efa= em->curface++; efa->fast= 1; diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index f90f1b095e6..7b23b556994 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -116,7 +116,11 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) short use_proj; em_setup_viewcontext(C, &vc); - + wmWindow *win= CTX_wm_window(C); + + printf("\n%d %d\n", event->x, event->y); + printf("%d %d\n", win->eventstate->x, win->eventstate->y); + use_proj= (vc.scene->toolsettings->snap_flag & SCE_SNAP) && (vc.scene->toolsettings->snap_mode==SCE_SNAP_MODE_FACE); invert_m4_m4(vc.obedit->imat, vc.obedit->obmat); diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c index 209a7975357..b632cb2a842 100644 --- a/source/blender/editors/mesh/editmesh_lib.c +++ b/source/blender/editors/mesh/editmesh_lib.c @@ -215,7 +215,7 @@ static int EM_check_selection(EditMesh *em, void *data) return 0; } -void EM_remove_selection(EditMesh *em, void *data, int type) +void EM_remove_selection(EditMesh *em, void *data, int UNUSED(type)) { EditSelection *ese; for(ese=em->selected.first; ese; ese = ese->next){ @@ -1051,7 +1051,7 @@ static void set_edge_directions_f2(EditMesh *em, int val) /* individual face extrude */ /* will use vertex normals for extrusion directions, so *nor is unaffected */ -short extrudeflag_face_indiv(EditMesh *em, short flag, float *nor) +short extrudeflag_face_indiv(EditMesh *em, short UNUSED(flag), float *UNUSED(nor)) { EditVert *eve, *v1, *v2, *v3, *v4; EditEdge *eed; @@ -1205,7 +1205,7 @@ short extrudeflag_edges_indiv(EditMesh *em, short flag, float *nor) } /* extrudes individual vertices */ -short extrudeflag_verts_indiv(EditMesh *em, short flag, float *nor) +short extrudeflag_verts_indiv(EditMesh *em, short flag, float *UNUSED(nor)) { EditVert *eve; @@ -1231,7 +1231,7 @@ short extrudeflag_verts_indiv(EditMesh *em, short flag, float *nor) /* this is actually a recode of extrudeflag(), using proper edge/face select */ /* hurms, doesnt use 'flag' yet, but its not called by primitive making stuff anyway */ -static short extrudeflag_edge(Object *obedit, EditMesh *em, short flag, float *nor, int all) +static short extrudeflag_edge(Object *obedit, EditMesh *em, short UNUSED(flag), float *nor, int all) { /* all select edges/faces: extrude */ /* old select is cleared, in new ones it is set */ diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c index 682fbca5072..7595e0d2fe1 100644 --- a/source/blender/editors/mesh/editmesh_loop.c +++ b/source/blender/editors/mesh/editmesh_loop.c @@ -69,9 +69,9 @@ editmesh_loop: tools with own drawing subloops, select, knife, subdiv #include "mesh_intern.h" /* **** XXX ******** */ -static void BIF_undo_push(const char *dummy) {} +static void BIF_undo_push(const char *UNUSED(arg)) {} static void BIF_undo() {} -static void error(const char *dummy) {} +static void error(const char *UNUSED(arg)) {} static int qtest() {return 0;} /* **** XXX ******** */ diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index c4ca6166f02..ab01a773020 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -83,8 +83,8 @@ editmesh_mods.c, UI level access, no geometry changes #include "BLO_sys_types.h" // for intptr_t support /* XXX */ -static void waitcursor(int val) {} -static int pupmenu(const char *dummy) {return 0;} +static void waitcursor(int UNUSED(val)) {} +static int pupmenu(const char *UNUSED(arg)) {return 0;} /* ****************************** MIRROR **************** */ @@ -475,7 +475,7 @@ static float labda_PdistVL2Dfl( float *v1, float *v2, float *v3) } /* note; uses v3d, so needs active 3d window */ -static void findnearestedge__doClosest(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index) +static void findnearestedge__doClosest(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int UNUSED(index)) { struct { ViewContext vc; float mval[2]; int dist; EditEdge *closest; } *data = userData; float v1[2], v2[2]; @@ -544,7 +544,7 @@ EditEdge *findnearestedge(ViewContext *vc, int *dist) } } -static void findnearestface__getDistance(void *userData, EditFace *efa, int x, int y, int index) +static void findnearestface__getDistance(void *userData, EditFace *efa, int x, int y, int UNUSED(index)) { struct { short mval[2]; int dist; EditFace *toFace; } *data = userData; @@ -1252,7 +1252,7 @@ static int select_similar_exec(bContext *C, wmOperator *op) return similar_face_select_exec(C, op); } -static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *ptr, int *free) +static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { Object *obedit= CTX_data_edit_object(C); EnumPropertyItem *item= NULL; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index fb29257b184..66090f14fff 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -80,7 +80,7 @@ editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise #include "mesh_intern.h" /* XXX */ -static void waitcursor(int val) {} +static void waitcursor(int UNUSED(val)) {} #define add_numbut(a, b, c, d, e, f, g) {} /* XXX */ @@ -511,7 +511,7 @@ void MESH_OT_remove_doubles(wmOperatorType *ot) // XXX is this needed? /* called from buttons */ -static void xsortvert_flag__doSetX(void *userData, EditVert *eve, int x, int y, int index) +static void xsortvert_flag__doSetX(void *userData, EditVert *UNUSED(eve), int x, int UNUSED(y), int index) { xvertsort *sortblock = userData; @@ -616,7 +616,7 @@ void hashvert_flag(EditMesh *em, int flag) } /* generic extern called extruder */ -void extrude_mesh(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op, short type) +static void extrude_mesh(Object *obedit, EditMesh *em, wmOperator *op, short type) { float nor[3]= {0.0, 0.0, 0.0}; short transmode= 0; @@ -666,11 +666,10 @@ void extrude_mesh(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op, sh // XXX should be a menu item static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - extrude_mesh(scene, obedit, em, op, RNA_int_get(op->ptr, "type")); + extrude_mesh(obedit, em, op, RNA_int_get(op->ptr, "type")); BKE_mesh_end_editmesh(obedit->data, em); @@ -683,11 +682,10 @@ static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even /* extrude without transform */ static int mesh_extrude_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(obedit->data); - extrude_mesh(scene, obedit, em, op, RNA_int_get(op->ptr, "type")); + extrude_mesh(obedit, em, op, RNA_int_get(op->ptr, "type")); DAG_id_flush_update(obedit->data, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); @@ -704,7 +702,7 @@ EnumPropertyItem extrude_items[] = { {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem *extrude_itemf(bContext *C, PointerRNA *ptr, int *free) +static EnumPropertyItem *extrude_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { EnumPropertyItem *item= NULL; Object *obedit= CTX_data_edit_object(C); @@ -1189,7 +1187,7 @@ static void erase_vertices(EditMesh *em, ListBase *l) } } -void delete_mesh(Object *obedit, EditMesh *em, wmOperator *op, int event) +static void delete_mesh(EditMesh *em, wmOperator *op, int event) { EditFace *efa, *nextvl; EditVert *eve,*nextve; @@ -1347,7 +1345,7 @@ static int delete_mesh_exec(bContext *C, wmOperator *op) if(type==6) return WM_operator_name_call(C, "MESH_OT_delete_edgeloop", WM_OP_EXEC_DEFAULT, NULL); - delete_mesh(obedit, em, op, type); + delete_mesh(em, op, type); DAG_id_flush_update(obedit->data, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); @@ -4703,7 +4701,7 @@ useless: } #endif // END OF XXX -int EdgeLoopDelete(EditMesh *em, wmOperator *op) +int EdgeLoopDelete(EditMesh *UNUSED(em), wmOperator *UNUSED(op)) { #if 0 //XXX won't work with new edgeslide @@ -5185,7 +5183,7 @@ static int blend_from_shape_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static EnumPropertyItem *shape_itemf(bContext *C, PointerRNA *ptr, int *free) +static EnumPropertyItem *shape_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { Object *obedit= CTX_data_edit_object(C); Mesh *me= (obedit) ? obedit->data : NULL; @@ -5884,7 +5882,7 @@ static EnumPropertyItem merge_type_items[]= { {5, "COLLAPSE", 0, "Collapse", ""}, {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem *merge_type_itemf(bContext *C, PointerRNA *ptr, int *free) +static EnumPropertyItem *merge_type_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { Object *obedit= CTX_data_edit_object(C); EnumPropertyItem *item= NULL; diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index 13538a6f218..ac65a3c21d3 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -94,7 +94,7 @@ typedef struct tringselOpData { } tringselOpData; /* modal loop selection drawing callback */ -static void ringsel_draw(const bContext *C, ARegion *ar, void *arg) +static void ringsel_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *arg) { int i; tringselOpData *lcd = arg; @@ -248,7 +248,7 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select) lcd->totedge = tot; } -static void ringsel_find_edge(tringselOpData *lcd, const bContext *C, ARegion *ar, int cuts) +static void ringsel_find_edge(tringselOpData *lcd, int cuts) { if (lcd->eed) { edgering_sel(lcd, cuts, 0); @@ -293,7 +293,7 @@ static void ringsel_finish(bContext *C, wmOperator *op) } /* called when modal loop selection is done... */ -static void ringsel_exit (bContext *C, wmOperator *op) +static void ringsel_exit(wmOperator *op) { tringselOpData *lcd= op->customdata; @@ -332,10 +332,10 @@ static int ringsel_init (bContext *C, wmOperator *op, int do_cut) return 1; } -static int ringcut_cancel (bContext *C, wmOperator *op) +static int ringcut_cancel (bContext *UNUSED(C), wmOperator *op) { /* this is just a wrapper around exit() */ - ringsel_exit(C, op); + ringsel_exit(op); return OPERATOR_CANCELLED; } @@ -353,7 +353,7 @@ static int ringsel_invoke (bContext *C, wmOperator *op, wmEvent *evt) lcd = op->customdata; if (lcd->em->selectmode == SCE_SELECT_FACE) { - ringsel_exit(C, op); + ringsel_exit(op); WM_operator_name_call(C, "MESH_OT_loop_select", WM_OP_INVOKE_REGION_WIN, NULL); return OPERATOR_CANCELLED; } @@ -363,15 +363,15 @@ static int ringsel_invoke (bContext *C, wmOperator *op, wmEvent *evt) edge = findnearestedge(&lcd->vc, &dist); if(!edge) { - ringsel_exit(C, op); + ringsel_exit(op); return OPERATOR_CANCELLED; } lcd->eed = edge; - ringsel_find_edge(lcd, C, lcd->ar, 1); + ringsel_find_edge(lcd, 1); ringsel_finish(C, op); - ringsel_exit(C, op); + ringsel_exit(op); return OPERATOR_FINISHED; } @@ -397,7 +397,7 @@ static int ringcut_invoke (bContext *C, wmOperator *op, wmEvent *evt) edge = findnearestedge(&lcd->vc, &dist); if (edge != lcd->eed) { lcd->eed = edge; - ringsel_find_edge(lcd, C, lcd->ar, 1); + ringsel_find_edge(lcd, 1); } return OPERATOR_RUNNING_MODAL; @@ -418,7 +418,7 @@ static int ringcut_modal (bContext *C, wmOperator *op, wmEvent *event) ED_region_tag_redraw(lcd->ar); ringsel_finish(C, op); - ringsel_exit(C, op); + ringsel_exit(op); return OPERATOR_FINISHED; } @@ -441,7 +441,7 @@ static int ringcut_modal (bContext *C, wmOperator *op, wmEvent *event) if (event->val == KM_PRESS) { cuts++; RNA_int_set(op->ptr, "number_cuts",cuts); - ringsel_find_edge(lcd, C, lcd->ar, cuts); + ringsel_find_edge(lcd, cuts); ED_region_tag_redraw(lcd->ar); } @@ -451,7 +451,7 @@ static int ringcut_modal (bContext *C, wmOperator *op, wmEvent *event) if (event->val == KM_PRESS) { cuts=MAX2(cuts-1,1); RNA_int_set(op->ptr,"number_cuts",cuts); - ringsel_find_edge(lcd, C, lcd->ar,cuts); + ringsel_find_edge(lcd, cuts); ED_region_tag_redraw(lcd->ar); } @@ -466,7 +466,7 @@ static int ringcut_modal (bContext *C, wmOperator *op, wmEvent *event) if (edge != lcd->eed) { lcd->eed = edge; - ringsel_find_edge(lcd, C, lcd->ar, cuts); + ringsel_find_edge(lcd, cuts); } ED_region_tag_redraw(lcd->ar); diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 272201df50d..03f2bb42b51 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -157,7 +157,7 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la } } -int ED_mesh_uv_texture_add(bContext *C, Scene *scene, Object *ob, Mesh *me, const char *name, int active_set) +int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_set) { EditMesh *em; int layernum; @@ -292,7 +292,7 @@ static int uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Mesh *me= ob->data; - if(!ED_mesh_uv_texture_add(C, scene, ob, me, NULL, TRUE)) + if(!ED_mesh_uv_texture_add(C, me, NULL, TRUE)) return OPERATOR_CANCELLED; return OPERATOR_FINISHED; diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index c110222a109..ec727d7d82b 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -84,12 +84,12 @@ void make_editMball(Object *obedit) /* This function is called, when MetaBall Object switched from * edit mode to object mode. List od MetaElements is copied * from object->data->edit_elems to object->data->elems. */ -void load_editMball(Object *obedit) +void load_editMball(Object *UNUSED(obedit)) { } /* Add metaelem primitive to metaball object (which is in edit mode) */ -MetaElem *add_metaball_primitive(bContext *C, float mat[4][4], int type, int newname) +MetaElem *add_metaball_primitive(bContext *C, float mat[4][4], int type, int UNUSED(newname)) { Object *obedit= CTX_data_edit_object(C); MetaBall *mball = (MetaBall*)obedit->data; diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 9de6d002a43..56af4ce1b1c 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -161,11 +161,6 @@ float ED_object_new_primitive_matrix(bContext *C, Object *obedit, float *loc, fl /********************* Add Object Operator ********************/ -void add_object_draw(Scene *scene, View3D *v3d, int type) /* for toolbox or menus, only non-editmode stuff */ -{ - /* keep here to get things compile, remove later */ -} - void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode) { PropertyRNA *prop; @@ -363,11 +358,6 @@ static EnumPropertyItem field_type_items[] = { {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", ""}, {0, NULL, 0, NULL, NULL}}; -void add_effector_draw(Scene *scene, View3D *v3d, int type) /* for toolbox or menus, only non-editmode stuff */ -{ - /* keep here to get things compile, remove later */ -} - /* for effector add primitive operators */ static Object *effector_add_type(bContext *C, wmOperator *op, int type) { @@ -855,7 +845,7 @@ void OBJECT_OT_delete(wmOperatorType *ot) /**************************** Copy Utilities ******************************/ -static void copy_object__forwardModifierLinks(void *userData, Object *ob, +static void copy_object__forwardModifierLinks(void *UNUSED(userData), Object *UNUSED(ob), ID **idpoin) { /* this is copied from ID_NEW; it might be better to have a macro */ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 5882478f05e..32e49ce3f71 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -97,9 +97,9 @@ #include "object_intern.h" // own include /* ************* XXX **************** */ -static void error(const char *dummy) {} -static void waitcursor(int val) {} -static int pupmenu(const char *msg) {return 0;} +static void error(const char *UNUSED(arg)) {} +static void waitcursor(int UNUSED(val)) {} +static int pupmenu(const char *UNUSED(msg)) {return 0;} /* port over here */ static bContext *C; @@ -433,7 +433,7 @@ void ED_object_enter_editmode(bContext *C, int flag) if(ob->type==OB_MESH) { Mesh *me= ob->data; - if(me->pv) mesh_pmv_off(ob, me); + if(me->pv) mesh_pmv_off(me); ok= 1; scene->obedit= ob; // context sees this @@ -1565,7 +1565,7 @@ void OBJECT_OT_paths_calculate (wmOperatorType *ot) /* --------- */ /* for the object with pose/action: clear path curves for selected bones only */ -void ED_objects_clear_paths(bContext *C, Scene *scene) +void ED_objects_clear_paths(bContext *C) { /* loop over objects in scene */ CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) @@ -1581,11 +1581,9 @@ void ED_objects_clear_paths(bContext *C, Scene *scene) /* operator callback for this */ static int object_clear_paths_exec (bContext *C, wmOperator *UNUSED(op)) -{ - Scene *scene= CTX_data_scene(C); - +{ /* use the backend function for this */ - ED_objects_clear_paths(C, scene); + ED_objects_clear_paths(C); /* notifiers for updates */ WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL); @@ -1838,7 +1836,7 @@ void rand_timeoffs(Scene *scene, View3D *v3d) } -static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *ptr, int *free) +static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { EnumPropertyItem *input = object_mode_items; EnumPropertyItem *item= NULL; @@ -2082,7 +2080,7 @@ static EnumPropertyItem game_properties_copy_operations[] ={ static EnumPropertyItem gameprops_items[]= { {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem *gameprops_itemf(bContext *C, PointerRNA *ptr, int *free) +static EnumPropertyItem *gameprops_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { Object *ob= ED_object_active_context(C); EnumPropertyItem tmp = {0, "", 0, "", ""}; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 1c22c1820ce..3bdf202aca9 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -250,7 +250,7 @@ int ED_object_modifier_move_down(ReportList *reports, Object *ob, ModifierData * return 1; } -int ED_object_modifier_convert(ReportList *reports, Main *bmain, Scene *scene, Object *ob, ModifierData *md) +int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *scene, Object *ob, ModifierData *md) { Object *obn; ParticleSystem *psys; @@ -365,7 +365,7 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M BKE_report(reports, RPT_ERROR, "Only deforming modifiers can be applied to Shapes"); return 0; } - mesh_pmv_off(ob, me); + mesh_pmv_off(me); dm = mesh_create_derived_for_modifier(scene, ob, md); if (!dm) { @@ -413,7 +413,7 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, return 0; } - mesh_pmv_off(ob, me); + mesh_pmv_off(me); /* Multires: ensure that recent sculpting is applied */ if(md->type == eModifierType_Multires) @@ -511,7 +511,7 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi return 1; } -int ED_object_modifier_copy(ReportList *reports, Object *ob, ModifierData *md) +int ED_object_modifier_copy(ReportList *UNUSED(reports), Object *ob, ModifierData *md) { ModifierData *nmd; @@ -540,7 +540,7 @@ static int modifier_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *ptr, int *free) +static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { Object *ob= ED_object_active_context(C); EnumPropertyItem *item= NULL, *md_item; @@ -636,7 +636,7 @@ static int edit_modifier_invoke_properties(bContext *C, wmOperator *op) return 0; } -static ModifierData *edit_modifier_property_get(bContext *C, wmOperator *op, Object *ob, int type) +static ModifierData *edit_modifier_property_get(wmOperator *op, Object *ob, int type) { char modifier_name[32]; ModifierData *md; @@ -657,7 +657,7 @@ static int modifier_remove_exec(bContext *C, wmOperator *op) Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); Object *ob = ED_object_active_context(C); - ModifierData *md = edit_modifier_property_get(C, op, ob, 0); + ModifierData *md = edit_modifier_property_get(op, ob, 0); if(!ob || !md || !ED_object_modifier_remove(op->reports, bmain, scene, ob, md)) return OPERATOR_CANCELLED; @@ -695,7 +695,7 @@ void OBJECT_OT_modifier_remove(wmOperatorType *ot) static int modifier_move_up_exec(bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); - ModifierData *md = edit_modifier_property_get(C, op, ob, 0); + ModifierData *md = edit_modifier_property_get(op, ob, 0); if(!ob || !md || !ED_object_modifier_move_up(op->reports, ob, md)) return OPERATOR_CANCELLED; @@ -734,7 +734,7 @@ void OBJECT_OT_modifier_move_up(wmOperatorType *ot) static int modifier_move_down_exec(bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); - ModifierData *md = edit_modifier_property_get(C, op, ob, 0); + ModifierData *md = edit_modifier_property_get(op, ob, 0); if(!ob || !md || !ED_object_modifier_move_down(op->reports, ob, md)) return OPERATOR_CANCELLED; @@ -774,7 +774,7 @@ static int modifier_apply_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob = ED_object_active_context(C); - ModifierData *md = edit_modifier_property_get(C, op, ob, 0); + ModifierData *md = edit_modifier_property_get(op, ob, 0); int apply_as= RNA_enum_get(op->ptr, "apply_as"); if(!ob || !md || !ED_object_modifier_apply(op->reports, scene, ob, md, apply_as)) { @@ -824,7 +824,7 @@ static int modifier_convert_exec(bContext *C, wmOperator *op) Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); Object *ob = ED_object_active_context(C); - ModifierData *md = edit_modifier_property_get(C, op, ob, 0); + ModifierData *md = edit_modifier_property_get(op, ob, 0); if(!ob || !md || !ED_object_modifier_convert(op->reports, bmain, scene, ob, md)) return OPERATOR_CANCELLED; @@ -863,7 +863,7 @@ void OBJECT_OT_modifier_convert(wmOperatorType *ot) static int modifier_copy_exec(bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); - ModifierData *md = edit_modifier_property_get(C, op, ob, 0); + ModifierData *md = edit_modifier_property_get(op, ob, 0); if(!ob || !md || !ED_object_modifier_copy(op->reports, ob, md)) return OPERATOR_CANCELLED; @@ -907,7 +907,7 @@ static int multires_poll(bContext *C) static int multires_higher_levels_delete_exec(bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); - MultiresModifierData *mmd = (MultiresModifierData *)edit_modifier_property_get(C, op, ob, eModifierType_Multires); + MultiresModifierData *mmd = (MultiresModifierData *)edit_modifier_property_get(op, ob, eModifierType_Multires); if (!mmd) return OPERATOR_CANCELLED; @@ -946,7 +946,7 @@ void OBJECT_OT_multires_higher_levels_delete(wmOperatorType *ot) static int multires_subdivide_exec(bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); - MultiresModifierData *mmd = (MultiresModifierData *)edit_modifier_property_get(C, op, ob, eModifierType_Multires); + MultiresModifierData *mmd = (MultiresModifierData *)edit_modifier_property_get(op, ob, eModifierType_Multires); if (!mmd) return OPERATOR_CANCELLED; @@ -988,7 +988,7 @@ static int multires_reshape_exec(bContext *C, wmOperator *op) { Object *ob= ED_object_active_context(C), *secondob= NULL; Scene *scene= CTX_data_scene(C); - MultiresModifierData *mmd = (MultiresModifierData *)edit_modifier_property_get(C, op, ob, eModifierType_Multires); + MultiresModifierData *mmd = (MultiresModifierData *)edit_modifier_property_get(op, ob, eModifierType_Multires); if (!mmd) return OPERATOR_CANCELLED; @@ -1076,7 +1076,7 @@ static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *U if (!edit_modifier_invoke_properties(C, op)) return OPERATOR_CANCELLED; - mmd = (MultiresModifierData *)edit_modifier_property_get(C, op, ob, eModifierType_Multires); + mmd = (MultiresModifierData *)edit_modifier_property_get(op, ob, eModifierType_Multires); if (!mmd) return OPERATOR_CANCELLED; @@ -1158,7 +1158,7 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob = ED_object_active_context(C); - MeshDeformModifierData *mmd = (MeshDeformModifierData *)edit_modifier_property_get(C, op, ob, eModifierType_MeshDeform); + MeshDeformModifierData *mmd = (MeshDeformModifierData *)edit_modifier_property_get(op, ob, eModifierType_MeshDeform); if (!mmd) return OPERATOR_CANCELLED; @@ -1245,7 +1245,7 @@ static int explode_poll(bContext *C) static int explode_refresh_exec(bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); - ExplodeModifierData *emd = (ExplodeModifierData *)edit_modifier_property_get(C, op, ob, eModifierType_Explode); + ExplodeModifierData *emd = (ExplodeModifierData *)edit_modifier_property_get(op, ob, eModifierType_Explode); if (!emd) return OPERATOR_CANCELLED; diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 6e9e8eeb5e5..221d1211930 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -378,7 +378,7 @@ void ED_keymap_object(wmKeyConfig *keyconf) ED_object_generic_keymap(keyconf, keymap, 2); } -void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet) +void ED_object_generic_keymap(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyMap *keymap, int do_pet) { wmKeyMapItem *kmi; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 2a01c870ad6..14f88c6d99e 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -353,7 +353,7 @@ static int make_proxy_exec (bContext *C, wmOperator *op) } /* Generic itemf's for operators that take library args */ -static EnumPropertyItem *proxy_group_object_itemf(bContext *C, PointerRNA *ptr, int *free) +static EnumPropertyItem *proxy_group_object_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { EnumPropertyItem *item= NULL, item_tmp; int totitem= 0; @@ -1140,7 +1140,7 @@ void OBJECT_OT_move_to_layer(wmOperatorType *ot) /************************** Link to Scene Operator *****************************/ -void link_to_scene(Main *bmain, unsigned short nr) +void link_to_scene(Main *UNUSED(bmain), unsigned short UNUSED(nr)) { #if 0 Scene *sce= (Scene*) BLI_findlink(&bmain->scene, G.curscreen->scenenr-1); @@ -1344,7 +1344,7 @@ void OBJECT_OT_make_links_data(wmOperatorType *ot) /**************************** Make Single User ********************************/ -static void single_object_users__forwardModifierLinks(void *userData, Object *ob, Object **obpoin) +static void single_object_users__forwardModifierLinks(void *UNUSED(userData), Object *UNUSED(ob), Object **obpoin) { ID_NEW(*obpoin); } @@ -1538,7 +1538,7 @@ void single_obdata_users(Main *bmain, Scene *scene, int flag) } } -void single_ipo_users(Scene *scene, int flag) +void single_ipo_users(Scene *UNUSED(scene), int UNUSED(flag)) { #if 0 // XXX old animation system Object *ob; diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 610f6d95d42..796314ba2e3 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -2022,7 +2022,7 @@ static void rekey_particle_to_time(Scene *scene, Object *ob, int pa_index, float /************************* utilities **************************/ -static int remove_tagged_particles(Scene *scene, Object *ob, ParticleSystem *psys, int mirror) +static int remove_tagged_particles(Object *ob, ParticleSystem *psys, int mirror) { PTCacheEdit *edit = psys->edit; ParticleData *pa, *npa=0, *new_pars=0; @@ -2092,7 +2092,7 @@ static int remove_tagged_particles(Scene *scene, Object *ob, ParticleSystem *psy return removed; } -static void remove_tagged_keys(Scene *scene, Object *ob, ParticleSystem *psys) +static void remove_tagged_keys(Object *ob, ParticleSystem *psys) { PTCacheEdit *edit= psys->edit; ParticleData *pa; @@ -2123,7 +2123,7 @@ static void remove_tagged_keys(Scene *scene, Object *ob, ParticleSystem *psys) if(new_totkey < 2) point->flag |= PEP_TAG; } - remove_tagged_particles(scene, ob, psys, pe_x_mirror(ob)); + remove_tagged_particles(ob, psys, pe_x_mirror(ob)); LOOP_POINTS { pa = psys->particles + p; @@ -2347,7 +2347,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) BLI_kdtree_free(tree); /* remove tagged particles - don't do mirror here! */ - remove_tagged_particles(scene, ob, psys, 0); + remove_tagged_particles(ob, psys, 0); totremoved += removed; } while(removed); @@ -2430,7 +2430,7 @@ void PARTICLE_OT_weight_set(wmOperatorType *ot) /************************ cursor drawing *******************************/ -static void brush_drawcursor(bContext *C, int x, int y, void *customdata) +static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)) { ParticleEditSettings *pset= PE_settings(CTX_data_scene(C)); ParticleBrushData *brush; @@ -2574,12 +2574,12 @@ static int delete_exec(bContext *C, wmOperator *op) if(type == DEL_KEY) { foreach_selected_key(&data, set_delete_particle_key); - remove_tagged_keys(data.scene, data.ob, data.edit->psys); + remove_tagged_keys(data.ob, data.edit->psys); recalc_lengths(data.edit); } else if(type == DEL_PARTICLE) { foreach_selected_point(&data, set_delete_particle); - remove_tagged_particles(data.scene, data.ob, data.edit->psys, pe_x_mirror(data.ob)); + remove_tagged_particles(data.ob, data.edit->psys, pe_x_mirror(data.ob)); recalc_lengths(data.edit); } @@ -2765,7 +2765,7 @@ void PARTICLE_OT_mirror(wmOperatorType *ot) /************************* brush edit callbacks ********************/ -static void brush_comb(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key) +static void brush_comb(PEData *data, float UNUSED(mat[][4]), float imat[][4], int point_index, int key_index, PTCacheEditKey *key) { ParticleEditSettings *pset= PE_settings(data->scene); float cvec[3], fac; @@ -3034,7 +3034,7 @@ static void brush_puff(PEData *data, int point_index) } -static void brush_weight(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key) +static void brush_weight(PEData *data, float UNUSED(mat[][4]), float imat[][4], int point_index, int key_index, PTCacheEditKey *key) { /* roots have full weight allways */ if(key_index) { @@ -3060,7 +3060,7 @@ static void brush_smooth_get(PEData *data, float mat[][4], float imat[][4], int } } -static void brush_smooth_do(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key) +static void brush_smooth_do(PEData *data, float UNUSED(mat[][4]), float imat[][4], int point_index, int key_index, PTCacheEditKey *key) { float vec[3], dvec[3]; @@ -3401,7 +3401,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) else foreach_point(&data, brush_cut); - removed= remove_tagged_particles(scene, ob, edit->psys, pe_x_mirror(ob)); + removed= remove_tagged_particles(ob, edit->psys, pe_x_mirror(ob)); if(pset->flag & PE_KEEP_LENGTHS) recalc_lengths(edit); } @@ -3538,7 +3538,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) pset->flag |= lock_root; } -static void brush_edit_exit(bContext *C, wmOperator *op) +static void brush_edit_exit(wmOperator *op) { BrushEdit *bedit= op->customdata; @@ -3555,7 +3555,7 @@ static int brush_edit_exec(bContext *C, wmOperator *op) } RNA_END; - brush_edit_exit(C, op); + brush_edit_exit(op); return OPERATOR_FINISHED; } @@ -3597,7 +3597,7 @@ static int brush_edit_modal(bContext *C, wmOperator *op, wmEvent *event) case LEFTMOUSE: case MIDDLEMOUSE: case RIGHTMOUSE: // XXX hardcoded - brush_edit_exit(C, op); + brush_edit_exit(op); return OPERATOR_FINISHED; case MOUSEMOVE: brush_edit_apply_event(C, op, event); @@ -3607,9 +3607,9 @@ static int brush_edit_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int brush_edit_cancel(bContext *C, wmOperator *op) +static int brush_edit_cancel(bContext *UNUSED(C), wmOperator *op) { - brush_edit_exit(C, op); + brush_edit_exit(op); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index f411f92d395..e4934269173 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -720,7 +720,7 @@ static void fluidbake_free(void *customdata) } /* called by fluidbake, only to check job 'stop' value */ -static int fluidbake_breakjob(void *customdata) +static int fluidbake_breakjob(void *UNUSED(customdata)) { //FluidBakeJob *fb= (FluidBakeJob *)customdata; //return *(fb->stop); @@ -1047,7 +1047,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain) return 1; } -void fluidsimFreeBake(Object *ob) +void fluidsimFreeBake(Object *UNUSED(ob)) { /* not implemented yet */ } @@ -1056,27 +1056,27 @@ void fluidsimFreeBake(Object *ob) /* compile dummy functions for disabled fluid sim */ -FluidsimSettings *fluidsimSettingsNew(Object *srcob) +FluidsimSettings *fluidsimSettingsNew(Object *UNUSED(srcob)) { return NULL; } -void fluidsimSettingsFree(FluidsimSettings *fss) +void fluidsimSettingsFree(FluidsimSettings *UNUSED(fss)) { } -FluidsimSettings* fluidsimSettingsCopy(FluidsimSettings *fss) +FluidsimSettings* fluidsimSettingsCopy(FluidsimSettings *UNUSED(fss)) { return NULL; } /* only compile dummy functions */ -int fluidsimBake(bContext *C, ReportList *reports, Object *ob) +int fluidsimBake(bContext *UNUSED(C), ReportList *UNUSED(reports), Object *UNUSED(ob)) { return 0; } -void fluidsimFreeBake(Object *ob) +void fluidsimFreeBake(Object *UNUSED(ob)) { } diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index 6664dd624b2..9e39862cf5d 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -56,7 +56,7 @@ #include "physics_intern.h" -static int cache_break_test(void *cbd) { +static int cache_break_test(void *UNUSED(cbd)) { return G.afbreek==1; } static int ptcache_bake_all_poll(bContext *C) @@ -75,13 +75,13 @@ static int ptcache_poll(bContext *C) return (ptr.data && ptr.id.data); } -void bake_console_progress(void *arg, int nr) +void bake_console_progress(void *UNUSED(arg), int nr) { printf("\rbake: %3i%%", nr); fflush(stdout); } -void bake_console_progress_end(void *arg) +void bake_console_progress_end(void *UNUSED(arg)) { printf("\n"); } diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 71bee8c5b08..21f10d936bf 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -190,7 +190,7 @@ void draw_tex_crop(Tex *tex) } /* temporal abuse; if id_code is -1 it only does texture.... solve! */ -void BIF_preview_changed(short id_code) +void BIF_preview_changed(short UNUSED(id_code)) { #if 0 ScrArea *sa; @@ -571,7 +571,7 @@ void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, r /* ******************************** Icon Preview **************************** */ -void ED_preview_icon_draw(const bContext *C, void *idp, void *arg1, void *arg2, rcti *rect) +void ED_preview_icon_draw(const bContext *UNUSED(C), void *UNUSED(idp), void *UNUSED(arg1), void *UNUSED(arg2), rcti *UNUSED(rect)) { } @@ -603,7 +603,7 @@ void view3d_previewrender_progress(RenderResult *rr, volatile rcti *renrect) } -void BIF_view3d_previewrender_signal(ScrArea *sa, short signal) +void BIF_view3d_previewrender_signal(ScrArea *UNUSED(sa), short UNUSED(signal)) { #if 0 View3D *v3d= sa->spacedata.first; @@ -625,7 +625,7 @@ void BIF_view3d_previewrender_signal(ScrArea *sa, short signal) #endif } -void BIF_view3d_previewrender_free(View3D *v3d) +void BIF_view3d_previewrender_free(View3D *UNUSED(v3d)) { #if 0 if(v3d->ri) { @@ -683,7 +683,7 @@ static int view3d_previewrender_get_rects(ScrArea *sa, rctf *viewplane, RenderIn } /* called before a panel gets moved/scaled, makes sure we can see through */ -void BIF_view3d_previewrender_clear(ScrArea *sa) +void BIF_view3d_previewrender_clear(ScrArea *UNUSED(sa)) { #if 0 View3D *v3d= sa->spacedata.first; @@ -844,7 +844,7 @@ void BIF_view3d_previewrender(Main *bmain, Scene *scene, ScrArea *sa) } /* in panel space! */ -static void view3d_previewdraw_rect(ScrArea *sa, uiBlock *block, RenderInfo *ri) +static void view3d_previewdraw_rect(ScrArea *UNUSED(sa), uiBlock *UNUSED(block), RenderInfo *ri) { // rctf dispf; @@ -887,7 +887,7 @@ void BIF_view3d_previewdraw(struct ScrArea *sa, struct uiBlock *block) /* **************************** new shader preview system ****************** */ /* inside thread, called by renderer, sets job update value */ -static void shader_preview_draw(void *spv, RenderResult *rr, volatile struct rcti *rect) +static void shader_preview_draw(void *spv, RenderResult *UNUSED(rr), volatile struct rcti *UNUSED(rect)) { ShaderPreview *sp= spv; @@ -903,7 +903,7 @@ static int shader_preview_break(void *spv) } /* outside thread, called before redraw notifiers, it moves finished preview over */ -static void shader_preview_updatejob(void *spv) +static void shader_preview_updatejob(void *UNUSED(spv)) { // ShaderPreview *sp= spv; @@ -1141,7 +1141,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat /* use same function for icon & shader, so the job manager does not run two of them at the same time. */ -static void common_preview_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void common_preview_startjob(void *customdata, short *stop, short *do_update, float *UNUSED(progress)) { ShaderPreview *sp= customdata; diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 840ab0b2098..bca8100a809 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -116,7 +116,7 @@ static int nodes_use_tex(bNodeTree *ntree, Tex *tex) return 0; } -static void material_changed(Main *bmain, Material *ma) +static void material_changed(Main *UNUSED(bmain), Material *ma) { /* icons */ BKE_icon_changed(BKE_icon_getid(&ma->id)); @@ -208,7 +208,7 @@ static void image_changed(Main *bmain, Image *ima) texture_changed(bmain, tex); } -static void scene_changed(Main *bmain, Scene *sce) +static void scene_changed(Main *bmain, Scene *UNUSED(scene)) { Object *ob; Material *ma; @@ -834,7 +834,7 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int dx= env->cube[1]->x; if (env->type == ENV_CUBE) { - ibuf = IMB_allocImBuf(3*dx, 2*dx, 24, IB_rectfloat, 0); + ibuf = IMB_allocImBuf(3*dx, 2*dx, 24, IB_rectfloat); IMB_rectcpy(ibuf, env->cube[0], 0, 0, 0, 0, dx, dx); IMB_rectcpy(ibuf, env->cube[1], dx, 0, 0, 0, dx, dx); @@ -844,7 +844,7 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int IMB_rectcpy(ibuf, env->cube[5], 2*dx, dx, 0, 0, dx, dx); } else if (env->type == ENV_PLANE) { - ibuf = IMB_allocImBuf(dx, dx, 24, IB_rectfloat, 0); + ibuf = IMB_allocImBuf(dx, dx, 24, IB_rectfloat); IMB_rectcpy(ibuf, env->cube[1], 0, 0, 0, 0, dx, dx); } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 138ce19951d..9d178a57465 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1739,7 +1739,7 @@ void ED_screen_animation_timer_update(bScreen *screen, int redraws, int refresh) } /* results in fully updated anim system */ -void ED_update_for_newframe(const bContext *C, int mute) +void ED_update_for_newframe(const bContext *C, int UNUSED(mute)) { Main *bmain= CTX_data_main(C); bScreen *screen= CTX_wm_screen(C); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 5bcf8c18074..5a6acd24c5f 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2897,7 +2897,7 @@ static int scene_new_exec(bContext *C, wmOperator *op) Main *bmain= CTX_data_main(C); int type= RNA_enum_get(op->ptr, "type"); - newscene= copy_scene(bmain, scene, type); + newscene= copy_scene(scene, type); /* these can't be handled in blenkernel curently, so do them here */ if(type == SCE_COPY_LINK_DATA) diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index f1e11430573..937441a6e43 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -84,7 +84,7 @@ static int screenshot_exec(bContext *C, wmOperator *op) if(strlen(path)r.imtype); - ibuf= IMB_allocImBuf(scd->dumpsx, scd->dumpsy, 24, 0, 0); + ibuf= IMB_allocImBuf(scd->dumpsx, scd->dumpsy, 24, 0); ibuf->rect= scd->dumprect; BKE_write_ibuf(scene, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality); @@ -251,7 +251,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float break; } else { - ImBuf *ibuf= IMB_allocImBuf(sj->dumpsx, sj->dumpsy, rd.planes, 0, 0); + ImBuf *ibuf= IMB_allocImBuf(sj->dumpsx, sj->dumpsy, rd.planes, 0); char name[FILE_MAXDIR+FILE_MAXFILE]; int ok; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index cd498c274cf..71754c3589a 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -383,7 +383,7 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int return tile->rect; if (*tmpibuf==NULL) - *tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat|IB_rect, 0); + *tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat|IB_rect); tile= MEM_callocN(sizeof(UndoImageTile), "UndoImageTile"); strcpy(tile->idname, ima->id.name); @@ -410,7 +410,7 @@ static void image_undo_restore(bContext *C, ListBase *lb) UndoImageTile *tile; tmpibuf= IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, - IB_rectfloat|IB_rect, 0); + IB_rectfloat|IB_rect); for(tile=lb->first; tile; tile=tile->next) { /* find image based on name, pointer becomes invalid with global undo */ @@ -4191,7 +4191,7 @@ static ImBuf *imapaint_lift_clone(ImBuf *ibuf, ImBuf *ibufb, int *pos) /* note: allocImbuf returns zero'd memory, so regions outside image will have zero alpha, and hence not be blended onto the image */ int w=ibufb->x, h=ibufb->y, destx=0, desty=0, srcx=pos[0], srcy=pos[1]; - ImBuf *clonebuf= IMB_allocImBuf(w, h, ibufb->depth, ibufb->flags, 0); + ImBuf *clonebuf= IMB_allocImBuf(w, h, ibufb->depth, ibufb->flags); IMB_rectclip(clonebuf, ibuf, &destx, &desty, &srcx, &srcy, &w, &h); IMB_rectblend(clonebuf, ibuf, destx, desty, srcx, srcy, w, h, diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index d8544f34fdf..2e0338b370e 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -290,7 +290,7 @@ static void ed_keymap_paint_brush_switch(wmKeyMap *keymap, const char *path) RNA_int_set(kmi->ptr, "value", 19); } -static void ed_keymap_paint_brush_size(wmKeyMap *keymap, const char *path) +static void ed_keymap_paint_brush_size(wmKeyMap *keymap, const char *UNUSED(path)) { wmKeyMapItem *kmi; diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c index c2f82b8e2e0..c21bbadc242 100644 --- a/source/blender/editors/sculpt_paint/paint_undo.c +++ b/source/blender/editors/sculpt_paint/paint_undo.c @@ -62,13 +62,13 @@ static UndoStack MeshUndoStack = {UNDO_PAINT_MESH, {NULL, NULL}, NULL}; /* Generic */ -static void undo_restore(bContext *C, UndoStack *stack, UndoElem *uel) +static void undo_restore(bContext *C, UndoStack *UNUSED(stack), UndoElem *uel) { if(uel && uel->restore) uel->restore(C, &uel->elems); } -static void undo_elem_free(UndoStack *stack, UndoElem *uel) +static void undo_elem_free(UndoStack *UNUSED(stack), UndoElem *uel) { if(uel && uel->free) { uel->free(&uel->elems); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index f5a02e6fb9c..3c25d861d2f 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -852,7 +852,7 @@ static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float /* else */ /* sets wp->weight to the closest weight value to vertex */ /* note: we cant sample frontbuf, weight colors are interpolated too unpredictable */ -void sample_wpaint(Scene *scene, ARegion *ar, View3D *v3d, int mode) +void sample_wpaint(Scene *scene, ARegion *ar, View3D *UNUSED(v3d), int mode) { ViewContext vc; ToolSettings *ts= scene->toolsettings; @@ -1256,7 +1256,7 @@ struct WPaintData { char *vgroup_validmap; /*stores if vgroups tie to deforming bones or not*/ }; -static char *wpaint_make_validmap(Mesh *me, Object *ob) +static char *wpaint_make_validmap(Object *ob) { bDeformGroup *dg; ModifierData *md; @@ -1344,7 +1344,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED vgroups affect deform bones*/ wpd->auto_normalize = ts->auto_normalize; if (wpd->auto_normalize) - wpd->vgroup_validmap = wpaint_make_validmap(me, ob); + wpd->vgroup_validmap = wpaint_make_validmap(ob); // if(qual & LR_CTRLKEY) { // sample_wpaint(scene, ar, v3d, 0); @@ -1817,7 +1817,7 @@ static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent return 1; } -static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob, int index, float mval[2], float pressure, int flip) +static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob, int index, float mval[2], float pressure, int UNUSED(flip)) { ViewContext *vc = &vpd->vc; Brush *brush = paint_brush(&vp->paint); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 2e192a08ca5..a3252ca7621 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -2534,7 +2534,7 @@ static void sculpt_combine_proxies(Sculpt *sd, SculptSession *ss) /* Flip all the editdata across the axis/axes specified by symm. Used to calculate multiple modifications to the mesh when symmetry is enabled. */ -static void calc_brushdata_symm(Sculpt *sd, StrokeCache *cache, const char symm, const char axis, const float angle, const float feather) +static void calc_brushdata_symm(Sculpt *sd, StrokeCache *cache, const char symm, const char axis, const float angle, const float UNUSED(feather)) { flip_coord(cache->location, cache->true_location, symm); flip_coord(cache->grab_delta_symmetry, cache->grab_delta, symm); diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 18f35502f8b..2be3a51869b 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -180,7 +180,7 @@ static int pack_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; sound->packedfile= newPackedFile(op->reports, sound->name); - sound_load(CTX_data_main(C), sound); + sound_load(sound); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 64d7a12bc4c..11b6123dbbb 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -990,7 +990,7 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, } else if (ale->type == ANIMTYPE_GPLAYER) { struct bGPDlayer *gpl= (struct bGPDlayer *)ale->data; - gpl_to_keylist(ads, gpl, &anim_keys, NULL); + gpl_to_keylist(ads, gpl, &anim_keys); } /* loop through keyframes, finding one that was within the range clicked on */ diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 1b997ade956..68a93d39062 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -371,7 +371,7 @@ void filelist_init_icons() for (x=0; xrect[k*SPECIAL_IMG_SIZE], &bbuf->rect[(k+y*SPECIAL_IMG_SIZE)*SPECIAL_IMG_SIZE*SPECIAL_IMG_COLS+x*SPECIAL_IMG_SIZE], SPECIAL_IMG_SIZE*sizeof(int)); } @@ -965,7 +965,7 @@ void filelist_from_library(struct FileList* filelist) /* first allocate imbuf for copying preview into it */ if (w > 0 && h > 0 && rect) { - ima = IMB_allocImBuf(w, h, 32, IB_rect, 0); + ima = IMB_allocImBuf(w, h, 32, IB_rect); memcpy(ima->rect, rect, w*h*sizeof(unsigned int)); filelist->filelist[i + 1].image = ima; filelist->filelist[i + 1].flags = IMAGEFILE; diff --git a/source/blender/editors/space_file/writeimage.c b/source/blender/editors/space_file/writeimage.c index 1277ad9d69c..f5ce5a818d7 100644 --- a/source/blender/editors/space_file/writeimage.c +++ b/source/blender/editors/space_file/writeimage.c @@ -99,7 +99,7 @@ static void save_rendered_image_cb_real(char *name, int confirm) waitcursor(1); /* from screen.c */ - ibuf= IMB_allocImBuf(rres.rectx, rres.recty, scene->r.planes, 0, 0); + ibuf= IMB_allocImBuf(rres.rectx, rres.recty, scene->r.planes, 0); ibuf->rect= (unsigned int *)rres.rect32; ibuf->rect_float= rres.rectf; ibuf->zbuf_float= rres.rectz; diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index d9d027823bc..f5c8388bf67 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -143,7 +143,7 @@ static void wform_put_grid(unsigned char * tgt, int w, int h) static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf) { - struct ImBuf * rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect, 0); + struct ImBuf * rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect); int x,y; unsigned char* src = (unsigned char*) ibuf->rect; unsigned char* tgt = (unsigned char*) rval->rect; @@ -189,7 +189,7 @@ static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf) static struct ImBuf *make_waveform_view_from_ibuf_float(struct ImBuf * ibuf) { - struct ImBuf * rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect, 0); + struct ImBuf * rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect); int x,y; float* src = ibuf->rect_float; unsigned char* tgt = (unsigned char*) rval->rect; @@ -249,7 +249,7 @@ struct ImBuf *make_waveform_view_from_ibuf(struct ImBuf * ibuf) static struct ImBuf *make_sep_waveform_view_from_ibuf_byte(struct ImBuf * ibuf) { struct ImBuf * rval = IMB_allocImBuf( - ibuf->x + 3, 515, 32, IB_rect, 0); + ibuf->x + 3, 515, 32, IB_rect); int x,y; unsigned char* src = (unsigned char*) ibuf->rect; unsigned char* tgt = (unsigned char*) rval->rect; @@ -299,7 +299,7 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_float( struct ImBuf * ibuf) { struct ImBuf * rval = IMB_allocImBuf( - ibuf->x + 3, 515, 32, IB_rect, 0); + ibuf->x + 3, 515, 32, IB_rect); int x,y; float* src = ibuf->rect_float; unsigned char* tgt = (unsigned char*) rval->rect; @@ -422,7 +422,7 @@ static void draw_zebra_float(struct ImBuf * src,struct ImBuf * ibuf,float perc) struct ImBuf * make_zebra_view_from_ibuf(struct ImBuf * src, float perc) { - struct ImBuf * ibuf = IMB_allocImBuf(src->x, src->y, 32, IB_rect, 0); + struct ImBuf * ibuf = IMB_allocImBuf(src->x, src->y, 32, IB_rect); if (src->rect_float) { draw_zebra_float(src, ibuf, perc); @@ -463,7 +463,7 @@ static void draw_histogram_bar(struct ImBuf * ibuf, int x,float val, int col) static struct ImBuf *make_histogram_view_from_ibuf_byte( struct ImBuf * ibuf) { - struct ImBuf * rval = IMB_allocImBuf(515, 128, 32, IB_rect, 0); + struct ImBuf * rval = IMB_allocImBuf(515, 128, 32, IB_rect); int n,c,x,y; unsigned char* src = (unsigned char*) ibuf->rect; @@ -517,7 +517,7 @@ static int get_bin_float(float f) static struct ImBuf *make_histogram_view_from_ibuf_float( struct ImBuf * ibuf) { - struct ImBuf * rval = IMB_allocImBuf(515, 128, 32, IB_rect, 0); + struct ImBuf * rval = IMB_allocImBuf(515, 128, 32, IB_rect); int n,c,x,y; float* src = ibuf->rect_float; @@ -596,7 +596,7 @@ static void vectorscope_put_cross(unsigned char r, unsigned char g, static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf) { - struct ImBuf * rval = IMB_allocImBuf(515, 515, 32, IB_rect, 0); + struct ImBuf * rval = IMB_allocImBuf(515, 515, 32, IB_rect); int x,y; char* src = (char*) ibuf->rect; char* tgt = (char*) rval->rect; @@ -643,7 +643,7 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf) static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf) { - struct ImBuf * rval = IMB_allocImBuf(515, 515, 32, IB_rect, 0); + struct ImBuf * rval = IMB_allocImBuf(515, 515, 32, IB_rect); int x,y; float* src = ibuf->rect_float; char* tgt = (char*) rval->rect; diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 6e634252631..67c2a4f1c56 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1140,7 +1140,7 @@ ImBuf *view3d_read_backbuf(ViewContext *vc, short xmin, short ymin, short xmax, if(ymax >= vc->ar->winy) ymaxc= vc->ar->winy-1; else ymaxc= ymax; if(yminc > ymaxc) return NULL; - ibuf= IMB_allocImBuf((xmaxc-xminc+1), (ymaxc-yminc+1), 32, IB_rect,0); + ibuf= IMB_allocImBuf((xmaxc-xminc+1), (ymaxc-yminc+1), 32, IB_rect); view3d_validate_backbuf(vc); @@ -1160,7 +1160,7 @@ ImBuf *view3d_read_backbuf(ViewContext *vc, short xmin, short ymin, short xmax, if(xminc==xmin && xmaxc==xmax && yminc==ymin && ymaxc==ymax) return ibuf; - ibuf1= IMB_allocImBuf( (xmax-xmin+1),(ymax-ymin+1),32,IB_rect,0); + ibuf1= IMB_allocImBuf( (xmax-xmin+1),(ymax-ymin+1),32,IB_rect); rd= ibuf->rect; dr= ibuf1->rect; @@ -2092,7 +2092,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in } /* read in pixels & stamp */ - ibuf= IMB_allocImBuf(sizex, sizey, 32, flag, 0); + ibuf= IMB_allocImBuf(sizex, sizey, 32, flag); if(ibuf->rect_float) glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, ibuf->rect_float); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 312ae1df590..8b3d99e355d 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1770,7 +1770,7 @@ int ED_view3d_context_activate(bContext *C) return 1; } -static int game_engine_exec(bContext *C, wmOperator *UNUSED(op)) +static int game_engine_exec(bContext *C, wmOperator *op) { #if GAMEBLENDER == 1 Scene *startscene = CTX_data_scene(C); @@ -1780,6 +1780,8 @@ static int game_engine_exec(bContext *C, wmOperator *UNUSED(op)) RegionView3D *rv3d; rcti cam_frame; + (void)op; /* unused */ + // bad context switch .. if(!ED_view3d_context_activate(C)) return OPERATOR_CANCELLED; @@ -1828,6 +1830,7 @@ static int game_engine_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; #else + (void)C; /* unused */ BKE_report(op->reports, RPT_ERROR, "Game engine is disabled in this build."); return OPERATOR_CANCELLED; #endif diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 1778e648e20..4a95d0ec081 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -384,7 +384,7 @@ void BIF_selectOrientation() { #endif } -static void view_editmove(unsigned short event) +static void view_editmove(unsigned short UNUSED(event)) { #if 0 // TRANSFORM_FIX_ME int refresh = 0; @@ -1201,7 +1201,7 @@ static void drawArc(float size, float angle_start, float angle_end, int segments glEnd(); } -static void drawHelpline(bContext *C, int x, int y, void *customdata) +static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata) { TransInfo *t = (TransInfo*)customdata; @@ -1333,16 +1333,16 @@ static void drawHelpline(bContext *C, int x, int y, void *customdata) } } -void drawTransformView(const struct bContext *C, struct ARegion *ar, void *arg) +void drawTransformView(const struct bContext *C, struct ARegion *UNUSED(ar), void *arg) { TransInfo *t = arg; - drawConstraint(C, t); + drawConstraint(t); drawPropCircle(C, t); drawSnapping(C, t); } -void drawTransformPixel(const struct bContext *C, struct ARegion *ar, void *arg) +void drawTransformPixel(const struct bContext *UNUSED(C), struct ARegion *UNUSED(ar), void *UNUSED(arg)) { // TransInfo *t = arg; // @@ -1723,7 +1723,7 @@ void transformApply(const bContext *C, TransInfo *t) } } -void drawTransformApply(const struct bContext *C, struct ARegion *ar, void *arg) +void drawTransformApply(const struct bContext *C, struct ARegion *UNUSED(ar), void *arg) { TransInfo *t = arg; @@ -1896,7 +1896,7 @@ static void protectedQuaternionBits(short protectflag, float *quat, float *oldqu /* ******************* TRANSFORM LIMITS ********************** */ -static void constraintTransLim(TransInfo *t, TransData *td) +static void constraintTransLim(TransInfo *UNUSED(t), TransData *td) { if (td->con) { bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_LOCLIMIT); @@ -1991,7 +1991,7 @@ static void constraintob_from_transdata(bConstraintOb *cob, TransData *td) } } -static void constraintRotLim(TransInfo *t, TransData *td) +static void constraintRotLim(TransInfo *UNUSED(t), TransData *td) { if (td->con) { bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_ROTLIMIT); @@ -2211,7 +2211,7 @@ int handleEventWarp(TransInfo *t, wmEvent *event) return status; } -int Warp(TransInfo *t, short mval[2]) +int Warp(TransInfo *t, short UNUSED(mval[2])) { TransData *td = t->data; float vec[3], circumfac, dist, phi0, co, si, *curs, cursor[3], gcursor[3]; @@ -2309,7 +2309,7 @@ int Warp(TransInfo *t, short mval[2]) /* ************************** SHEAR *************************** */ -void postInputShear(TransInfo *t, float values[3]) +void postInputShear(TransInfo *UNUSED(t), float values[3]) { mul_v3_fl(values, 0.05f); } @@ -2359,7 +2359,7 @@ int handleEventShear(TransInfo *t, wmEvent *event) } -int Shear(TransInfo *t, short mval[2]) +int Shear(TransInfo *t, short UNUSED(mval[2])) { TransData *td = t->data; float vec[3]; @@ -2723,7 +2723,7 @@ void initToSphere(TransInfo *t) t->val /= (float)t->total; } -int ToSphere(TransInfo *t, short mval[2]) +int ToSphere(TransInfo *t, short UNUSED(mval[2])) { float vec[3]; float ratio, radius; @@ -3058,7 +3058,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) } } -int Rotation(TransInfo *t, short mval[2]) +int Rotation(TransInfo *t, short UNUSED(mval[2])) { char str[64]; @@ -3172,7 +3172,7 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a } } -int Trackball(TransInfo *t, short mval[2]) +int Trackball(TransInfo *t, short UNUSED(mval[2])) { char str[128]; float axis1[3], axis2[3]; @@ -3391,7 +3391,7 @@ static void applyTranslation(TransInfo *t, float vec[3]) { } /* uses t->vec to store actual translation in */ -int Translation(TransInfo *t, short mval[2]) +int Translation(TransInfo *t, short UNUSED(mval[2])) { char str[250]; @@ -3457,7 +3457,7 @@ void initShrinkFatten(TransInfo *t) -int ShrinkFatten(TransInfo *t, short mval[2]) +int ShrinkFatten(TransInfo *t, short UNUSED(mval[2])) { float vec[3]; float distance; @@ -3532,7 +3532,7 @@ void initTilt(TransInfo *t) -int Tilt(TransInfo *t, short mval[2]) +int Tilt(TransInfo *t, short UNUSED(mval[2])) { TransData *td = t->data; int i; @@ -3604,7 +3604,7 @@ void initCurveShrinkFatten(TransInfo *t) t->flag |= T_NO_CONSTRAINT; } -int CurveShrinkFatten(TransInfo *t, short mval[2]) +int CurveShrinkFatten(TransInfo *t, short UNUSED(mval[2])) { TransData *td = t->data; float ratio; @@ -3672,7 +3672,7 @@ void initPushPull(TransInfo *t) } -int PushPull(TransInfo *t, short mval[2]) +int PushPull(TransInfo *t, short UNUSED(mval[2])) { float vec[3], axis[3]; float distance; @@ -3805,7 +3805,7 @@ int handleEventBevel(TransInfo *t, wmEvent *event) return 0; } -int Bevel(TransInfo *t, short mval[2]) +int Bevel(TransInfo *t, short UNUSED(mval[2])) { float distance,d; int i; @@ -3873,7 +3873,7 @@ void initBevelWeight(TransInfo *t) t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; } -int BevelWeight(TransInfo *t, short mval[2]) +int BevelWeight(TransInfo *t, short UNUSED(mval[2])) { TransData *td = t->data; float weight; @@ -3946,7 +3946,7 @@ void initCrease(TransInfo *t) t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; } -int Crease(TransInfo *t, short mval[2]) +int Crease(TransInfo *t, short UNUSED(mval[2])) { TransData *td = t->data; float crease; @@ -4140,7 +4140,7 @@ void initBoneEnvelope(TransInfo *t) t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; } -int BoneEnvelope(TransInfo *t, short mval[2]) +int BoneEnvelope(TransInfo *t, short UNUSED(mval[2])) { TransData *td = t->data; float ratio; @@ -4846,7 +4846,7 @@ int doEdgeSlide(TransInfo *t, float perc) return 1; } -int EdgeSlide(TransInfo *t, short mval[2]) +int EdgeSlide(TransInfo *t, short UNUSED(mval[2])) { char str[50]; float final; @@ -4905,7 +4905,7 @@ void initBoneRoll(TransInfo *t) t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; } -int BoneRoll(TransInfo *t, short mval[2]) +int BoneRoll(TransInfo *t, short UNUSED(mval[2])) { TransData *td = t->data; int i; @@ -5041,7 +5041,7 @@ void initMirror(TransInfo *t) } } -int Mirror(TransInfo *t, short mval[2]) +int Mirror(TransInfo *t, short UNUSED(mval[2])) { TransData *td; float size[3], mat[3][3]; @@ -5118,7 +5118,7 @@ void initAlign(TransInfo *t) initMouseInputMode(t, &t->mouse, INPUT_NONE); } -int Align(TransInfo *t, short mval[2]) +int Align(TransInfo *t, short UNUSED(mval[2])) { TransData *td = t->data; float center[3]; @@ -5221,7 +5221,7 @@ static void applySeqSlide(TransInfo *t, float val[2]) { } } -int SeqSlide(TransInfo *t, short mval[2]) +int SeqSlide(TransInfo *t, short UNUSED(mval[2])) { char str[200]; @@ -5449,7 +5449,7 @@ static void headerTimeTranslate(TransInfo *t, char *str) sprintf(str, "DeltaX: %s", &tvec[0]); } -static void applyTimeTranslate(TransInfo *t, float sval) +static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) { TransData *td = t->data; TransData2D *td2d = t->data2d; @@ -5751,7 +5751,7 @@ static void applyTimeScale(TransInfo *t) { } } -int TimeScale(TransInfo *t, short mval[2]) +int TimeScale(TransInfo *t, short UNUSED(mval[2])) { char str[200]; @@ -5772,7 +5772,7 @@ int TimeScale(TransInfo *t, short mval[2]) /* ************************************ */ -void BIF_TransformSetUndo(char *str) +void BIF_TransformSetUndo(char *UNUSED(str)) { // TRANSFORM_FIX_ME //Trans.undostr= str; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 6cfe78a979d..bb6ffe9155f 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -571,7 +571,7 @@ void autokeyframe_pose_cb_func(struct bContext *C, struct Scene *scene, struct V /*********************** Constraints *****************************/ -void drawConstraint(const struct bContext *C, TransInfo *t); +void drawConstraint(TransInfo *t); void getConstraintMatrix(TransInfo *t); void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]); diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 1e6916f0a86..b15c5b07758 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -593,7 +593,7 @@ void setUserConstraint(TransInfo *t, short orientation, int mode, const char fte /*----------------- DRAWING CONSTRAINTS -------------------*/ -void drawConstraint(const struct bContext *C, TransInfo *t) +void drawConstraint(TransInfo *t) { TransCon *tc = &(t->con); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 53e553a0391..22b83ee4c89 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -232,7 +232,7 @@ static void set_prop_dist(TransInfo *t, short with_dist) /* ********************* texture space ********* */ -static void createTransTexspace(bContext *C, TransInfo *t) +static void createTransTexspace(TransInfo *t) { Scene *scene = t->scene; TransData *td; @@ -277,7 +277,7 @@ static void createTransTexspace(bContext *C, TransInfo *t) /* ********************* edge (for crease) ***** */ -static void createTransEdge(bContext *C, TransInfo *t) { +static void createTransEdge(TransInfo *t) { EditMesh *em = ((Mesh *)t->obedit->data)->edit_mesh; TransData *td = NULL; EditEdge *eed; @@ -930,7 +930,7 @@ static short pose_grab_with_ik(Object *ob) /* only called with pose mode active object now */ -static void createTransPose(bContext *C, TransInfo *t, Object *ob) +static void createTransPose(TransInfo *t, Object *ob) { bArmature *arm; bPoseChannel *pchan; @@ -995,7 +995,7 @@ static void createTransPose(bContext *C, TransInfo *t, Object *ob) /* ********************* armature ************** */ -static void createTransArmatureVerts(bContext *C, TransInfo *t) +static void createTransArmatureVerts(TransInfo *t) { EditBone *ebo; bArmature *arm= t->obedit->data; @@ -1195,7 +1195,7 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t) /* ********************* meta elements ********* */ -static void createTransMBallVerts(bContext *C, TransInfo *t) +static void createTransMBallVerts(TransInfo *t) { MetaBall *mb = (MetaBall*)t->obedit->data; MetaElem *ml; @@ -1530,7 +1530,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) /* ********************* lattice *************** */ -static void createTransLatticeVerts(bContext *C, TransInfo *t) +static void createTransLatticeVerts(TransInfo *t) { Lattice *latt = ((Lattice*)t->obedit->data)->editlatt->latt; TransData *td = NULL; @@ -1896,7 +1896,7 @@ static void VertsToTransData(TransInfo *t, TransData *td, EditMesh *em, EditVert /* *********************** CrazySpace correction. Now without doing subsurf optimal ****************** */ -static void make_vertexcos__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) +static void make_vertexcos__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) { float *vec = userData; @@ -3978,7 +3978,7 @@ static int SeqTransCount(TransInfo *t, ListBase *seqbase, int depth) } -static TransData *SeqToTransData(TransInfo *t, TransData *td, TransData2D *td2d, TransDataSeq *tdsq, Sequence *seq, int flag, int sel_flag) +static TransData *SeqToTransData(TransData *td, TransData2D *td2d, TransDataSeq *tdsq, Sequence *seq, int flag, int sel_flag) { int start_left; @@ -4063,16 +4063,16 @@ static int SeqToTransData_Recursive(TransInfo *t, ListBase *seqbase, TransData * if (flag & SELECT) { if (flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)) { if (flag & SEQ_LEFTSEL) { - SeqToTransData(t, td++, td2d++, tdsq++, seq, flag, SEQ_LEFTSEL); + SeqToTransData(td++, td2d++, tdsq++, seq, flag, SEQ_LEFTSEL); tot++; } if (flag & SEQ_RIGHTSEL) { - SeqToTransData(t, td++, td2d++, tdsq++, seq, flag, SEQ_RIGHTSEL); + SeqToTransData(td++, td2d++, tdsq++, seq, flag, SEQ_RIGHTSEL); tot++; } } else { - SeqToTransData(t, td++, td2d++, tdsq++, seq, flag, SELECT); + SeqToTransData(td++, td2d++, tdsq++, seq, flag, SELECT); tot++; } } @@ -4232,7 +4232,7 @@ static void createTransSeqData(bContext *C, TransInfo *t) /* transcribe given object into TransData for Transforming */ -static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object *ob) +static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob) { Scene *scene = t->scene; float obmtx[3][3]; @@ -4342,7 +4342,7 @@ static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object * /* sets flags in Bases to define whether they take part in transform */ /* it deselects Bases, so we have to call the clear function always after */ -static void set_trans_object_base_flags(bContext *C, TransInfo *t) +static void set_trans_object_base_flags(TransInfo *t) { Scene *scene = t->scene; View3D *v3d = t->view; @@ -5091,7 +5091,7 @@ static void createTransObject(bContext *C, TransInfo *t) TransDataExtension *tx; int propmode = t->flag & T_PROP_EDIT; - set_trans_object_base_flags(C, t); + set_trans_object_base_flags(t); /* count */ t->total= CTX_DATA_COUNT(C, selected_objects); @@ -5130,7 +5130,7 @@ static void createTransObject(bContext *C, TransInfo *t) td->flag |= TD_SKIP; } - ObjectToTransData(C, t, td, ob); + ObjectToTransData(t, td, ob); td->val = NULL; td++; tx++; @@ -5153,7 +5153,7 @@ static void createTransObject(bContext *C, TransInfo *t) td->ext = tx; td->rotOrder= ob->rotmode; - ObjectToTransData(C, t, td, ob); + ObjectToTransData(t, td, ob); td->val = NULL; td++; tx++; @@ -5210,12 +5210,12 @@ void createTransData(bContext *C, TransInfo *t) if (t->options & CTX_TEXTURE) { t->flag |= T_TEXTURE; - createTransTexspace(C, t); + createTransTexspace(t); } else if (t->options & CTX_EDGE) { t->ext = NULL; t->flag |= T_EDIT; - createTransEdge(C, t); + createTransEdge(t); if(t->data && t->flag & T_PROP_EDIT) { sort_trans_data(t); // makes selected become first in array set_prop_dist(t, 1); @@ -5277,14 +5277,14 @@ void createTransData(bContext *C, TransInfo *t) createTransCurveVerts(C, t); } else if (t->obedit->type==OB_LATTICE) { - createTransLatticeVerts(C, t); + createTransLatticeVerts(t); } else if (t->obedit->type==OB_MBALL) { - createTransMBallVerts(C, t); + createTransMBallVerts(t); } else if (t->obedit->type==OB_ARMATURE) { t->flag &= ~T_PROP_EDIT; - createTransArmatureVerts(C, t); + createTransArmatureVerts(t); } else { printf("edit type not implemented!\n"); @@ -5315,7 +5315,7 @@ void createTransData(bContext *C, TransInfo *t) else if (ob && (ob->mode & OB_MODE_POSE)) { // XXX this is currently limited to active armature only... // XXX active-layer checking isn't done as that should probably be checked through context instead - createTransPose(C, t, ob); + createTransPose(t, ob); } else if (ob && (ob->mode & OB_MODE_WEIGHT_PAINT)) { /* important that ob_armature can be set even when its not selected [#23412] @@ -5326,7 +5326,7 @@ void createTransData(bContext *C, TransInfo *t) if(base_arm) { View3D *v3d = t->view; if(BASE_VISIBLE(v3d, base_arm)) { - createTransPose(C, t, ob_armature); + createTransPose(t, ob_armature); } } diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 54a86b3dca1..ce0888b6a30 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -55,7 +55,7 @@ void InputVector(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) } -void InputSpring(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) +void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, short mval[2], float output[3]) { float ratio, precise_ratio, dx, dy; if(mi->precision) @@ -93,7 +93,7 @@ void InputSpringFlip(TransInfo *t, MouseInput *mi, short mval[2], float output[3 } } -void InputTrackBall(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) +void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, short mval[2], float output[3]) { if(mi->precision) @@ -162,7 +162,7 @@ void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, short mval[2], float ou output[0] = dot_v3v3(t->viewinv[1], vec) * 2.0f; } -void setCustomPoints(TransInfo *t, MouseInput *mi, short start[2], short end[2]) +void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, short start[2], short end[2]) { short *data; @@ -178,7 +178,7 @@ void setCustomPoints(TransInfo *t, MouseInput *mi, short start[2], short end[2]) data[3] = end[1]; } -void InputCustomRatio(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) +void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, short mval[2], float output[3]) { float length; float distance; @@ -211,7 +211,7 @@ void InputCustomRatio(TransInfo *t, MouseInput *mi, short mval[2], float output[ } } -void InputAngle(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) +void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, short mval[2], float output[3]) { double dx2 = mval[0] - mi->center[0]; double dy2 = mval[1] - mi->center[1]; @@ -272,7 +272,7 @@ void InputAngle(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) output[0] = *angle; } -void initMouseInput(TransInfo *t, MouseInput *mi, int center[2], short mval[2]) +void initMouseInput(TransInfo *UNUSED(t), MouseInput *mi, int center[2], short mval[2]) { mi->factor = 0; mi->precision = 0; diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 1d32f893b80..030ad190dc3 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1187,7 +1187,7 @@ static void draw_cylinder(GLUquadricObj *qobj, float len, float width) } -static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode) +static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUSED(moving), int drawflags, int combo, int colcode) { GLUquadricObj *qobj; float cylen= 0.01f*(float)U.tw_handlesize; diff --git a/source/blender/editors/transform/transform_ndofinput.c b/source/blender/editors/transform/transform_ndofinput.c index 3e47484c54c..1ff16dd5f5f 100644 --- a/source/blender/editors/transform/transform_ndofinput.c +++ b/source/blender/editors/transform/transform_ndofinput.c @@ -65,7 +65,7 @@ static void resetNDofInput(NDofInput *n) } -int handleNDofInput(NDofInput *n, wmEvent *event) +int handleNDofInput(NDofInput *UNUSED(n), wmEvent *UNUSED(event)) { int retval = 0; // TRANSFORM_FIX_ME diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 210ab0d45a8..a01a3b17cd2 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -141,7 +141,7 @@ void BIF_createTransformOrientation(bContext *C, ReportList *reports, char *name } } -TransformOrientation *createObjectSpace(bContext *C, ReportList *reports, char *name, int overwrite) { +TransformOrientation *createObjectSpace(bContext *C, ReportList *UNUSED(reports), char *name, int overwrite) { Base *base = CTX_data_active_base(C); Object *ob; float mat[3][3]; diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index a5950a72fe8..adaaf7c9de6 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -210,7 +210,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t) } } -int handleSnapping(TransInfo *t, wmEvent *event) +int handleSnapping(TransInfo *UNUSED(t), wmEvent *UNUSED(event)) { int status = 0; @@ -596,7 +596,7 @@ void ApplySnapResize(TransInfo *t, float vec[3]) /********************** DISTANCE **************************/ -float TranslationBetween(TransInfo *t, float p1[3], float p2[3]) +float TranslationBetween(TransInfo *UNUSED(t), float p1[3], float p2[3]) { return len_v3v3(p1, p2); } @@ -680,12 +680,12 @@ float ResizeBetween(TransInfo *t, float p1[3], float p2[3]) /********************** CALC **************************/ -void CalcSnapGrid(TransInfo *t, float *vec) +void CalcSnapGrid(TransInfo *t, float *UNUSED(vec)) { snapGridAction(t, t->tsnap.snapPoint, BIG_GEARS); } -void CalcSnapGeometry(TransInfo *t, float *vec) +void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) { if (t->spacetype == SPACE_VIEW3D) { @@ -1194,7 +1194,7 @@ int snapVertex(ARegion *ar, float vco[3], short vno[3], float mval[2], float ray return retval; } -int snapArmature(short snap_mode, ARegion *ar, Object *ob, bArmature *arm, float obmat[][4], float ray_start[3], float ray_normal[3], float mval[2], float *loc, float *no, int *dist, float *depth) +int snapArmature(short snap_mode, ARegion *ar, Object *ob, bArmature *arm, float obmat[][4], float ray_start[3], float ray_normal[3], float mval[2], float *loc, float *UNUSED(no), int *dist, float *depth) { float imat[4][4]; float ray_start_local[3], ray_normal_local[3]; @@ -1682,7 +1682,7 @@ void addDepthPeel(ListBase *depth_peels, float depth, float p[3], float no[3], O peel->flag = 0; } -int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_start[3], float ray_normal[3], float mval[2], ListBase *depth_peels) +int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_start[3], float ray_normal[3], float UNUSED(mval[2]), ListBase *depth_peels) { int retval = 0; int totvert = dm->getNumVerts(dm); diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 290c8a64881..debb8cedd07 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -37,6 +37,7 @@ #include "DNA_object_types.h" #include "DNA_screen_types.h" +#include "BKE_utildefines.h" #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_global.h" @@ -74,7 +75,7 @@ void undo_editmode_menu(void) // history menu /* ********************************************************************* */ /* ****** XXX ***** */ -void error(const char *dummy) {} +void error(const char *UNUSED(arg)) {} /* ****** XXX ***** */ @@ -341,7 +342,7 @@ void undo_editmode_menu(bContext *C) if(event>0) undo_number(C, event); } -static void do_editmode_undohistorymenu(bContext *C, void *arg, int event) +static void do_editmode_undohistorymenu(bContext *C, void *UNUSED(arg), int event) { Object *obedit= CTX_data_edit_object(C); @@ -351,7 +352,7 @@ static void do_editmode_undohistorymenu(bContext *C, void *arg, int event) } -uiBlock *editmode_undohistorymenu(bContext *C, ARegion *ar, void *arg_unused) +uiBlock *editmode_undohistorymenu(bContext *C, ARegion *ar, void *UNUSED(arg)) { uiBlock *block; UndoElem *uel; diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index f1f2dd8548a..5169b096d09 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -113,7 +113,7 @@ static int draw_uvs_face_check(Scene *scene) return (ts->uv_selectmode == UV_SELECT_FACE); } -static void draw_uvs_shadow(SpaceImage *sima, Object *obedit) +static void draw_uvs_shadow(Object *obedit) { EditMesh *em; EditFace *efa; @@ -374,7 +374,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac } } -static void draw_uvs_other(SpaceImage *sima, Scene *scene, Object *obedit, MTFace *activetf) +static void draw_uvs_other(Scene *scene, Object *obedit, MTFace *activetf) { Base *base; Image *curimage; @@ -440,7 +440,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) /* draw other uvs */ if(sima->flag & SI_DRAW_OTHER) - draw_uvs_other(sima, scene, obedit, activetf); + draw_uvs_other(scene, obedit, activetf); /* 1. draw shadow mesh */ @@ -838,7 +838,7 @@ void draw_uvedit_main(SpaceImage *sima, ARegion *ar, Scene *scene, Object *obedi if(show_uvedit || show_uvshadow) { if(show_uvshadow) - draw_uvs_shadow(sima, obedit); + draw_uvs_shadow(obedit); else draw_uvs(sima, scene, obedit); diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index d8c7be06aa1..4a9adaf59fd 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -118,8 +118,7 @@ void IMB_freeImBuf(struct ImBuf *ibuf); * @attention Defined in allocimbuf.c */ struct ImBuf *IMB_allocImBuf(unsigned int x, unsigned int y, - unsigned char d, unsigned int flags, - unsigned char bitmap); + unsigned char d, unsigned int flags); /** * diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index e67c319e61a..53828ed8ea8 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -324,7 +324,7 @@ short imb_addtilesImBuf(ImBuf *ibuf) return (ibuf->tiles != NULL); } -ImBuf *IMB_allocImBuf(unsigned int x, unsigned int y, uchar d, unsigned int flags, uchar bitmap) /* XXX bitmap argument is deprecated */ +ImBuf *IMB_allocImBuf(unsigned int x, unsigned int y, uchar d, unsigned int flags) { ImBuf *ibuf; @@ -384,7 +384,7 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1) y = ibuf1->y; if(ibuf1->flags & IB_fields) y *= 2; - ibuf2 = IMB_allocImBuf(x, y, ibuf1->depth, flags, 0); + ibuf2 = IMB_allocImBuf(x, y, ibuf1->depth, flags); if(ibuf2 == NULL) return NULL; if(flags & IB_rect) diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c index 096ed499f85..57d65bc6761 100644 --- a/source/blender/imbuf/intern/anim.c +++ b/source/blender/imbuf/intern/anim.c @@ -163,7 +163,7 @@ static ImBuf * movie_fetchibuf(struct anim * anim, int position) { if (anim == 0) return (0); - ibuf = IMB_allocImBuf(anim->x, anim->y, 24, IB_rect, 0); + ibuf = IMB_allocImBuf(anim->x, anim->y, 24, IB_rect); if ( mvReadFrames(anim->track, position, 1, ibuf->x * ibuf->y * sizeof(int), ibuf->rect ) != DM_SUCCESS ) { @@ -483,7 +483,7 @@ static ImBuf * avi_fetchibuf (struct anim *anim, int position) { #else if (1) { #endif - ibuf = IMB_allocImBuf (anim->x, anim->y, 24, IB_rect, 0); + ibuf = IMB_allocImBuf (anim->x, anim->y, 24, IB_rect); tmp = AVI_read_frame (anim->avi, AVI_FORMAT_RGB32, position, AVI_get_stream(anim->avi, AVIST_VIDEO, 0)); @@ -809,7 +809,7 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) { if (anim == 0) return (0); - ibuf = IMB_allocImBuf(anim->x, anim->y, 32, IB_rect, 0); + ibuf = IMB_allocImBuf(anim->x, anim->y, 32, IB_rect); avpicture_fill((AVPicture*) anim->pFrameRGB, (unsigned char*) ibuf->rect, @@ -998,7 +998,7 @@ static ImBuf * redcode_fetchibuf(struct anim * anim, int position) { } ibuf = IMB_allocImBuf(raw_frame->width * 2, - raw_frame->height * 2, 32, IB_rectfloat, 0); + raw_frame->height * 2, 32, IB_rectfloat); redcode_decode_video_float(raw_frame, ibuf->rect_float, 1); @@ -1050,31 +1050,31 @@ static struct ImBuf * anim_getnew(struct anim * anim) { break; case ANIM_MOVIE: if (startmovie(anim)) return (0); - ibuf = IMB_allocImBuf (anim->x, anim->y, 24, 0, 0); /* fake */ + ibuf = IMB_allocImBuf (anim->x, anim->y, 24, 0); /* fake */ break; case ANIM_AVI: if (startavi(anim)) { printf("couldnt start avi\n"); return (0); } - ibuf = IMB_allocImBuf (anim->x, anim->y, 24, 0, 0); + ibuf = IMB_allocImBuf (anim->x, anim->y, 24, 0); break; #ifdef WITH_QUICKTIME case ANIM_QTIME: if (startquicktime(anim)) return (0); - ibuf = IMB_allocImBuf (anim->x, anim->y, 24, 0, 0); + ibuf = IMB_allocImBuf (anim->x, anim->y, 24, 0); break; #endif #ifdef WITH_FFMPEG case ANIM_FFMPEG: if (startffmpeg(anim)) return (0); - ibuf = IMB_allocImBuf (anim->x, anim->y, 24, 0, 0); + ibuf = IMB_allocImBuf (anim->x, anim->y, 24, 0); break; #endif #ifdef WITH_REDCODE case ANIM_REDCODE: if (startredcode(anim)) return (0); - ibuf = IMB_allocImBuf (8, 8, 32, 0, 0); + ibuf = IMB_allocImBuf (8, 8, 32, 0); break; #endif } diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c index 450b09c923b..4c7cf669d18 100644 --- a/source/blender/imbuf/intern/bmp.c +++ b/source/blender/imbuf/intern/bmp.c @@ -129,9 +129,9 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags) /* printf("skip: %d, x: %d y: %d, depth: %d (%x)\n", skip, x, y, depth, bmi.biBitCount); */ if (flags & IB_test) { - ibuf = IMB_allocImBuf(x, y, depth, 0, 0); + ibuf = IMB_allocImBuf(x, y, depth, 0); } else { - ibuf = IMB_allocImBuf(x, y, depth, IB_rect, 0); + ibuf = IMB_allocImBuf(x, y, depth, IB_rect); bmp = mem + skip; rect = (unsigned char *) ibuf->rect; diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c index a9b229536cb..0eee1bd082a 100644 --- a/source/blender/imbuf/intern/cineon/cineon_dpx.c +++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c @@ -88,7 +88,7 @@ static struct ImBuf *imb_load_dpx_cineon(unsigned char *mem, int use_cineon, int return NULL; } - ibuf = IMB_allocImBuf(width, height, 32, IB_rectfloat | flags, 0); + ibuf = IMB_allocImBuf(width, height, 32, IB_rectfloat | flags); row = MEM_mallocN(sizeof(unsigned short)*width*depth, "row in cineon_dpx.c"); frow = ibuf->rect_float+width*height*4; diff --git a/source/blender/imbuf/intern/dds/dds_api.cpp b/source/blender/imbuf/intern/dds/dds_api.cpp index 2e224893271..08f60589977 100644 --- a/source/blender/imbuf/intern/dds/dds_api.cpp +++ b/source/blender/imbuf/intern/dds/dds_api.cpp @@ -104,7 +104,7 @@ struct ImBuf *imb_load_dds(unsigned char *mem, size_t size, int flags) // TODO use the image RGB or RGBA tag to determine the bits per pixel if (dds.hasAlpha()) bits_per_pixel = 32; else bits_per_pixel = 24; - ibuf = IMB_allocImBuf(dds.width(), dds.height(), bits_per_pixel, 0, 0); + ibuf = IMB_allocImBuf(dds.width(), dds.height(), bits_per_pixel, 0); if (ibuf == 0) return(0); /* memory allocation failed */ ibuf->ftype = DDS; diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index 7b3a07f10ad..dfe316628f6 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -50,8 +50,8 @@ void IMB_de_interlace(struct ImBuf *ibuf) if (ibuf->rect) { /* make copies */ - tbuf1 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect, 0); - tbuf2 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect, 0); + tbuf1 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect); + tbuf2 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect); ibuf->x *= 2; IMB_rectcpy(tbuf1, ibuf, 0, 0, 0, 0, ibuf->x, ibuf->y); @@ -78,8 +78,8 @@ void IMB_interlace(struct ImBuf *ibuf) if (ibuf->rect) { /* make copies */ - tbuf1 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect, 0); - tbuf2 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect, 0); + tbuf1 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect); + tbuf2 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect); IMB_rectcpy(tbuf1, ibuf, 0, 0, 0, 0, ibuf->x, ibuf->y); IMB_rectcpy(tbuf2, ibuf, 0, 0, 0, tbuf2->y, ibuf->x, ibuf->y); diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c index 3cc266e460e..3c2c276b6e4 100644 --- a/source/blender/imbuf/intern/filter.c +++ b/source/blender/imbuf/intern/filter.c @@ -380,7 +380,7 @@ void IMB_makemipmap(ImBuf *ibuf, int use_filter) while(curmap < IB_MIPMAP_LEVELS) { if(use_filter) { - ImBuf *nbuf= IMB_allocImBuf(hbuf->x, hbuf->y, 32, IB_rect, 0); + ImBuf *nbuf= IMB_allocImBuf(hbuf->x, hbuf->y, 32, IB_rect); IMB_filterN(nbuf, hbuf); ibuf->mipmap[curmap] = IMB_onehalf(nbuf); IMB_freeImBuf(nbuf); diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c index 883de823745..9037285a1c5 100644 --- a/source/blender/imbuf/intern/iris.c +++ b/source/blender/imbuf/intern/iris.c @@ -283,7 +283,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags) zsize = image.zsize; if (flags & IB_test) { - ibuf = IMB_allocImBuf(image.xsize, image.ysize, 8 * image.zsize, 0, 0); + ibuf = IMB_allocImBuf(image.xsize, image.ysize, 8 * image.zsize, 0); if (ibuf) ibuf->ftype = IMAGIC; return(ibuf); } @@ -315,7 +315,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags) if (bpp == 1) { - ibuf = IMB_allocImBuf(xsize, ysize, 8 * zsize, IB_rect, 0); + ibuf = IMB_allocImBuf(xsize, ysize, 8 * zsize, IB_rect); if (ibuf->depth > 32) ibuf->depth = 32; base = ibuf->rect; zbase = (unsigned int *)ibuf->zbuf; @@ -356,7 +356,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags) } else { /* bpp == 2 */ - ibuf = IMB_allocImBuf(xsize, ysize, 32, (flags & IB_rect)|IB_rectfloat, 0); + ibuf = IMB_allocImBuf(xsize, ysize, 32, (flags & IB_rect)|IB_rectfloat); fbase = ibuf->rect_float; @@ -399,7 +399,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags) } else { if (bpp == 1) { - ibuf = IMB_allocImBuf(xsize, ysize, 8 * zsize, IB_rect, 0); + ibuf = IMB_allocImBuf(xsize, ysize, 8 * zsize, IB_rect); if (ibuf->depth > 32) ibuf->depth = 32; base = ibuf->rect; @@ -424,7 +424,7 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags) } else { /* bpp == 2 */ - ibuf = IMB_allocImBuf(xsize, ysize, 32, (flags & IB_rect)|IB_rectfloat, 0); + ibuf = IMB_allocImBuf(xsize, ysize, 32, (flags & IB_rect)|IB_rectfloat); fbase = ibuf->rect_float; diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index a70c154014a..5e7ef199500 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -189,7 +189,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags) float_divs[i]= (1<comps[i].prec)-1; } - ibuf= IMB_allocImBuf(w, h, depth, use_float ? IB_rectfloat : IB_rect, 0); + ibuf= IMB_allocImBuf(w, h, depth, use_float ? IB_rectfloat : IB_rect); if (ibuf==NULL) { if(dinfo) diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index 0a070646fd5..e020a5fa8fd 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -297,9 +297,9 @@ static ImBuf * ibJpegImageFromCinfo(struct jpeg_decompress_struct * cinfo, int f if (flags & IB_test) { jpeg_abort_decompress(cinfo); - ibuf = IMB_allocImBuf(x, y, 8 * depth, 0, 0); + ibuf = IMB_allocImBuf(x, y, 8 * depth, 0); } - else if ((ibuf = IMB_allocImBuf(x, y, 8 * depth, IB_rect, 0)) == NULL) { + else if ((ibuf = IMB_allocImBuf(x, y, 8 * depth, IB_rect)) == NULL) { jpeg_abort_decompress(cinfo); } else { @@ -699,7 +699,7 @@ static int save_jstjpeg(char * name, struct ImBuf * ibuf) struct ImBuf * tbuf; int oldy, returnval; - tbuf = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 24, IB_rect, 0); + tbuf = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 24, IB_rect); tbuf->ftype = ibuf->ftype; tbuf->flags = ibuf->flags; diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 4107f051d73..5b8c5c72802 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -975,7 +975,7 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, size_t size, int flags) } else { - ibuf = IMB_allocImBuf(width, height, 32, 0, 0); + ibuf = IMB_allocImBuf(width, height, 32, 0); ibuf->ftype = OPENEXR; /* openEXR is linear as per EXR spec */ diff --git a/source/blender/imbuf/intern/openexr/openexr_multi.h b/source/blender/imbuf/intern/openexr/openexr_multi.h index c66abe76289..3f80e5577a8 100644 --- a/source/blender/imbuf/intern/openexr/openexr_multi.h +++ b/source/blender/imbuf/intern/openexr/openexr_multi.h @@ -70,7 +70,7 @@ void * IMB_exr_get_handle (void) {return NULL;} void IMB_exr_add_channel (void *handle, const char *layname, const char *channame, int xstride, int ystride, float *rect) {} int IMB_exr_begin_read (void *handle, char *filename, int *width, int *height) {return 0;} -void IMB_exr_begin_write (void *handle, char *filename, int width, int height, int compress) {} +void IMB_exr_begin_write (void *handle, char *filename, int width, int height, int compress) { (void)handle; (void)filename; (void)width; (void)height; (void)compress; } void IMB_exrtile_begin_write (void *handle, char *filename, int mipmap, int width, int height, int tilex, int tiley) {} void IMB_exr_set_channel (void *handle, char *layname, char *channame, int xstride, int ystride, float *rect) {} diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c index 6b21f20b3fb..b29a4ae0627 100644 --- a/source/blender/imbuf/intern/png.c +++ b/source/blender/imbuf/intern/png.c @@ -61,7 +61,8 @@ int imb_is_a_png(unsigned char *mem) } static void Flush(png_structp png_ptr) -{ +{ + (void)png_ptr; } static void WriteData( png_structp png_ptr, png_bytep data, png_size_t length) @@ -368,7 +369,7 @@ struct ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags) longjmp(png_jmpbuf(png_ptr), 1); } - ibuf = IMB_allocImBuf(width, height, 8 * bytesperpixel, 0, 0); + ibuf = IMB_allocImBuf(width, height, 8 * bytesperpixel, 0); if (ibuf) { ibuf->ftype = PNG; diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index 4064246c866..385124cd717 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -202,8 +202,8 @@ struct ImBuf *imb_loadhdr(unsigned char *mem, size_t size, int flags) ptr = (unsigned char *)strchr((char*)&mem[x+1], '\n'); ptr++; - if (flags & IB_test) ibuf = IMB_allocImBuf(width, height, 32, 0, 0); - else ibuf = IMB_allocImBuf(width, height, 32, (flags & IB_rect)|IB_rectfloat, 0); + if (flags & IB_test) ibuf = IMB_allocImBuf(width, height, 32, 0); + else ibuf = IMB_allocImBuf(width, height, 32, (flags & IB_rect)|IB_rectfloat); if (ibuf==NULL) return NULL; ibuf->ftype = RADHDR; diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index 4fccf5dae41..73dcc0c8ea9 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -62,7 +62,7 @@ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1) if (ibuf1->x <= 1) return(IMB_dupImBuf(ibuf1)); - ibuf2 = IMB_allocImBuf((ibuf1->x)/2, ibuf1->y, ibuf1->depth, ibuf1->flags, 0); + ibuf2 = IMB_allocImBuf((ibuf1->x)/2, ibuf1->y, ibuf1->depth, ibuf1->flags); if (ibuf2==NULL) return (0); _p1 = (uchar *) ibuf1->rect; @@ -123,7 +123,7 @@ struct ImBuf *IMB_double_fast_x(struct ImBuf *ibuf1) do_rect= (ibuf1->rect != NULL); do_float= (ibuf1->rect_float != NULL); - ibuf2 = IMB_allocImBuf(2 * ibuf1->x , ibuf1->y , ibuf1->depth, ibuf1->flags, 0); + ibuf2 = IMB_allocImBuf(2 * ibuf1->x , ibuf1->y , ibuf1->depth, ibuf1->flags); if (ibuf2==NULL) return (0); p1 = (int *) ibuf1->rect; @@ -181,7 +181,7 @@ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1) do_rect= (ibuf1->rect != NULL); do_float= (ibuf1->rect_float != NULL); - ibuf2 = IMB_allocImBuf(ibuf1->x , (ibuf1->y) / 2 , ibuf1->depth, ibuf1->flags, 0); + ibuf2 = IMB_allocImBuf(ibuf1->x , (ibuf1->y) / 2 , ibuf1->depth, ibuf1->flags); if (ibuf2==NULL) return (0); _p1 = (uchar *) ibuf1->rect; @@ -249,7 +249,7 @@ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1) do_rect= (ibuf1->rect != NULL); do_float= (ibuf1->rect_float != NULL); - ibuf2 = IMB_allocImBuf(ibuf1->x , 2 * ibuf1->y , ibuf1->depth, ibuf1->flags, 0); + ibuf2 = IMB_allocImBuf(ibuf1->x , 2 * ibuf1->y , ibuf1->depth, ibuf1->flags); if (ibuf2==NULL) return (0); p1 = (int *) ibuf1->rect; @@ -303,7 +303,7 @@ struct ImBuf *IMB_onehalf(struct ImBuf *ibuf1) if (ibuf1->x <= 1) return(IMB_half_y(ibuf1)); if (ibuf1->y <= 1) return(IMB_half_x(ibuf1)); - ibuf2=IMB_allocImBuf((ibuf1->x)/2, (ibuf1->y)/2, ibuf1->depth, ibuf1->flags, 0); + ibuf2=IMB_allocImBuf((ibuf1->x)/2, (ibuf1->y)/2, ibuf1->depth, ibuf1->flags); if (ibuf2==NULL) return (0); p1f = ibuf1->rect_float; diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index ada1f448bfc..e50e445034e 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -537,8 +537,8 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags) if (checktarga(&tga,mem) == 0) return(0); - if (flags & IB_test) ibuf = IMB_allocImBuf(tga.xsize,tga.ysize,tga.pixsize, 0, 0); - else ibuf = IMB_allocImBuf(tga.xsize,tga.ysize,(tga.pixsize + 0x7) & ~0x7, IB_rect, 0); + if (flags & IB_test) ibuf = IMB_allocImBuf(tga.xsize,tga.ysize,tga.pixsize, 0); + else ibuf = IMB_allocImBuf(tga.xsize,tga.ysize,(tga.pixsize + 0x7) & ~0x7, IB_rect); if (ibuf == 0) return(0); ibuf->ftype = TGA; diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index f3415d44ecb..8abc2e89952 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -280,7 +280,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im return NULL; } if (size == THB_FAIL) { - img = IMB_allocImBuf(1,1,32, IB_rect | IB_metadata, 0); + img = IMB_allocImBuf(1,1,32, IB_rect | IB_metadata); if (!img) return 0; } else { if (THB_SOURCE_IMAGE == source || THB_SOURCE_BLEND == source) { diff --git a/source/blender/imbuf/intern/thumbs_blend.c b/source/blender/imbuf/intern/thumbs_blend.c index f1f8383b85e..cd9bf9c7a3a 100644 --- a/source/blender/imbuf/intern/thumbs_blend.c +++ b/source/blender/imbuf/intern/thumbs_blend.c @@ -102,7 +102,7 @@ static ImBuf *loadblend_thumb(gzFile gzfile) return NULL; /* finally malloc and read the data */ - img= IMB_allocImBuf(size[0], size[1], 32, IB_rect | IB_metadata, 0); + img= IMB_allocImBuf(size[0], size[1], 32, IB_rect | IB_metadata); if(gzread(gzfile, img->rect, bhead[1]) != bhead[1]) { IMB_freeImBuf(img); diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 5b77c6c7c36..eb5d1f2c039 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -93,11 +93,18 @@ typedef struct ImbTIFFMemFile { static void imb_tiff_DummyUnmapProc(thandle_t fd, tdata_t base, toff_t size) { + (void)fd; + (void)base; + (void)size; } static int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) { - return (0); + (void)fd; + (void)pbase; + (void)psize; + + return (0); } /** @@ -154,6 +161,10 @@ static tsize_t imb_tiff_ReadProc(thandle_t handle, tdata_t data, tsize_t n) */ static tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n) { + (void)handle; + (void)data; + (void)n; + printf("imb_tiff_WriteProc: this function should not be called.\n"); return (-1); } @@ -368,7 +379,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul) ib_flag = IB_rect; } - tmpibuf= IMB_allocImBuf(ibuf->x, ibuf->y, ibuf->depth, ib_flag, 0); + tmpibuf= IMB_allocImBuf(ibuf->x, ibuf->y, ibuf->depth, ib_flag); /* simple RGBA image */ if (!(bitspersample == 32 || bitspersample == 16)) { @@ -497,7 +508,7 @@ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags) ib_depth = (spp==3)?24:32; - ibuf = IMB_allocImBuf(width, height, ib_depth, 0, 0); + ibuf = IMB_allocImBuf(width, height, ib_depth, 0); if(ibuf) { ibuf->ftype = TIF; } @@ -533,7 +544,7 @@ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags) width= (width > 1)? width/2: 1; height= (height > 1)? height/2: 1; - hbuf= IMB_allocImBuf(width, height, 32, 0, 0); + hbuf= IMB_allocImBuf(width, height, 32, 0); hbuf->miplevel= level; hbuf->ftype= ibuf->ftype; ibuf->mipmap[level-1] = hbuf; diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index cee6b7f854a..9f5308cce33 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -206,7 +206,7 @@ static StructRNA *rna_KeyingSetInfo_register(const bContext *C, ReportList *repo ksi->generate= (have_function[2])? RKS_GEN_rna_internal: NULL; /* add and register with other info as needed */ - ANIM_keyingset_info_register(C, ksi); + ANIM_keyingset_info_register(ksi); /* return the struct-rna added */ return ksi->ext.srna; diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 63268f69438..76930e3cc52 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -176,7 +176,7 @@ Object *rna_Main_objects_new(Main *bmain, ReportList *reports, char* name, ID *d void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *object) { if(ID_REAL_USERS(object) <= 0) { - unlink_object(NULL, object); /* needed or ID pointers to this are not cleared */ + unlink_object(object); /* needed or ID pointers to this are not cleared */ free_libblock(&bmain->object, object); } else { diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index dc3cb675f7a..95e17451e62 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1084,7 +1084,7 @@ static CustomDataLayer *rna_Mesh_uv_texture_new(struct Mesh *me, struct bContext CustomDataLayer *cdl= NULL; int index; - if(ED_mesh_uv_texture_add(C, NULL, NULL, me, name, FALSE)) { + if(ED_mesh_uv_texture_add(C, me, name, FALSE)) { fdata= rna_mesh_fdata(me); index= CustomData_get_named_layer_index(fdata, CD_MTFACE, name); cdl= (index == -1)? NULL: &fdata->layers[index]; diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 674fbbad9c6..0c217837226 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -38,7 +38,7 @@ static void rna_Sound_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - sound_load(bmain, (bSound*)ptr->data); + sound_load((bSound*)ptr->data); } static int rna_Sound_caching_get(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 4196b3585b3..b3b263fe030 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -169,7 +169,7 @@ static PointerRNA rna_UserDef_system_get(PointerRNA *ptr) static void rna_UserDef_audio_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - sound_init(bmain); + sound_init(); } static void rna_Userdef_memcache_update(Main *bmain, Scene *scene, PointerRNA *ptr) diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 42c2fc5bbe4..176a52251e7 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -138,6 +138,8 @@ void fluidsim_init(FluidsimModifierData *fluidmd) fss->flag |= OB_FLUIDSIM_ACTIVE; } +#else + (void)fluidmd; /* unused */ #endif return; } @@ -154,7 +156,10 @@ void fluidsim_free(FluidsimModifierData *fluidmd) } MEM_freeN(fluidmd->fss); } +#else + (void)fluidmd; /* unused */ #endif + return; } @@ -607,6 +612,11 @@ DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene, return dm; #else + /* unused */ + (void)fluidmd; + (void)scene; + (void)dm; + (void)useRenderParams; return NULL; #endif } diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c b/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c index 37061dd7eae..3f6bd989477 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_alphaOver.c @@ -41,7 +41,7 @@ static bNodeSocketType cmp_node_alphaover_out[]= { { -1, 0, "" } }; -static void do_alphaover_premul(bNode *node, float *out, float *src, float *over, float *fac) +static void do_alphaover_premul(bNode *UNUSED(node), float *out, float *src, float *over, float *fac) { if(over[3]<=0.0f) { @@ -61,7 +61,7 @@ static void do_alphaover_premul(bNode *node, float *out, float *src, float *over } /* result will be still premul, but the over part is premulled */ -static void do_alphaover_key(bNode *node, float *out, float *src, float *over, float *fac) +static void do_alphaover_key(bNode *UNUSED(node), float *out, float *src, float *over, float *fac) { if(over[3]<=0.0f) { @@ -107,7 +107,7 @@ static void do_alphaover_mixed(bNode *node, float *out, float *src, float *over, -static void node_composit_exec_alphaover(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_alphaover(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order in: col col */ /* stack order out: col */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_bilateralblur.c b/source/blender/nodes/intern/CMP_nodes/CMP_bilateralblur.c index 97577fa6b5e..404f0aefb3c 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_bilateralblur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_bilateralblur.c @@ -81,7 +81,7 @@ static bNodeSocketType cmp_node_bilateralblur_out[]= { /* code of this node was heavily inspired by the smooth function of opencv library. The main change is an optional image input */ -static void node_composit_exec_bilateralblur(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_bilateralblur(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { NodeBilateralBlurData *nbbd= node->storage; CompBuf *new, *source, *img= in[0]->data , *refimg= in[1]->data; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c index 894cc20e999..f367e7b473d 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c @@ -205,7 +205,7 @@ static void blur_single_image(bNode *node, CompBuf *new, CompBuf *img, float sca } /* reference has to be mapped 0-1, and equal in size */ -static void bloom_with_reference(CompBuf *new, CompBuf *img, CompBuf *ref, float fac, NodeBlurData *nbd) +static void bloom_with_reference(CompBuf *new, CompBuf *img, CompBuf *UNUSED(ref), float UNUSED(fac), NodeBlurData *nbd) { CompBuf *wbuf; register float val; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c b/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c index 03eed59a4c4..889d61fe4fa 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c @@ -77,7 +77,7 @@ static void do_brightnesscontrast(bNode *node, float *out, float *in) } } -static void node_composit_exec_brightcontrast(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_brightcontrast(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { if(out[0]->hasoutput==0) return; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c index ca7c19cc778..182c339132e 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c @@ -42,7 +42,7 @@ static bNodeSocketType cmp_node_channel_matte_out[]={ {-1,0,""} }; -static void do_normalized_rgba_to_ycca2(bNode *node, float *out, float *in) +static void do_normalized_rgba_to_ycca2(bNode *UNUSED(node), float *out, float *in) { /*normalize to the range 0.0 to 1.0) */ rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); @@ -52,7 +52,7 @@ static void do_normalized_rgba_to_ycca2(bNode *node, float *out, float *in) out[3]=in[3]; } -static void do_normalized_ycca_to_rgba2(bNode *node, float *out, float *in) +static void do_normalized_ycca_to_rgba2(bNode *UNUSED(node), float *out, float *in) { /*un-normalize the normalize from above */ in[0]=in[0]*255.0; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c index e502129c3d3..d102afbbd16 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c @@ -42,7 +42,7 @@ static bNodeSocketType cmp_node_chroma_out[]={ {-1,0,""} }; -static void do_rgba_to_ycca_normalized(bNode *node, float *out, float *in) +static void do_rgba_to_ycca_normalized(bNode *UNUSED(node), float *out, float *in) { rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); @@ -62,7 +62,7 @@ static void do_rgba_to_ycca_normalized(bNode *node, float *out, float *in) out[3]=in[3]; } -static void do_ycca_to_rgba_normalized(bNode *node, float *out, float *in) +static void do_ycca_to_rgba_normalized(bNode *UNUSED(node), float *out, float *in) { /*un-normalize the normalize from above */ in[0]=(in[0]+1.0)/2.0; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c index 3191ad757a0..408bda02ee4 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c @@ -182,7 +182,7 @@ static void do_apply_spillmap_blue(bNode *node, float* out, float *in, float *ma } } -static void node_composit_exec_color_spill(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* Originally based on the information from the book "The Art and Science of Digital Composition" and diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c index 33f5680eaa9..c8e0108a5c8 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c @@ -120,7 +120,7 @@ static void do_colorbalance_lgg_fac(bNode *node, float* out, float *in, float *f out[3] = in[3]; } -static void node_composit_exec_colorbalance(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_colorbalance(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { CompBuf *cbuf= in[1]->data; CompBuf *stackbuf; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_composite.c b/source/blender/nodes/intern/CMP_nodes/CMP_composite.c index 7510a2d11d4..ffb090f3a94 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_composite.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_composite.c @@ -40,7 +40,7 @@ static bNodeSocketType cmp_node_composite_in[]= { }; /* applies to render pipeline */ -static void node_composit_exec_composite(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_composite(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out)) { /* image assigned to output */ /* stack order input sockets: col, alpha, z */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_crop.c b/source/blender/nodes/intern/CMP_nodes/CMP_crop.c index dd5ce88bd36..7ecfe40f739 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_crop.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_crop.c @@ -40,7 +40,7 @@ static bNodeSocketType cmp_node_crop_out[]= { { -1, 0, "" } }; -static void node_composit_exec_crop(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_crop(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { if(in[0]->data) { NodeTwoXYs *ntxy= node->storage; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_curves.c b/source/blender/nodes/intern/CMP_nodes/CMP_curves.c index e4afa1922bb..1a88e9541c6 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_curves.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_curves.c @@ -38,7 +38,7 @@ static bNodeSocketType cmp_node_time_out[]= { { -1, 0, "" } }; -static void node_composit_exec_curves_time(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_curves_time(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out) { RenderData *rd= data; /* stack order output: fac */ @@ -89,7 +89,7 @@ static bNodeSocketType cmp_node_curve_vec_out[]= { { -1, 0, "" } }; -static void node_composit_exec_curve_vec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_curve_vec(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order input: vec */ /* stack order output: vec */ @@ -158,7 +158,7 @@ static void do_curves_fac(bNode *node, float *out, float *in, float *fac) out[3]= in[3]; } -static void node_composit_exec_curve_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order input: fac, image, black level, white level */ /* stack order output: image */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c index a93a5760842..5c25bffa5d9 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c @@ -791,7 +791,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, } -static void node_composit_exec_defocus(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_defocus(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { CompBuf *new, *old, *zbuf_use = NULL, *img = in[0]->data, *zbuf = in[1]->data; NodeDefocus *nqd = node->storage; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_dilate.c b/source/blender/nodes/intern/CMP_nodes/CMP_dilate.c index 6c67413ea1f..71990b7403a 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_dilate.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_dilate.c @@ -110,7 +110,7 @@ static void morpho_erode(CompBuf *cbuf) } -static void node_composit_exec_dilateerode(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_dilateerode(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order in: mask */ /* stack order out: mask */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_directionalblur.c b/source/blender/nodes/intern/CMP_nodes/CMP_directionalblur.c index b0cf5559772..42bf48b9128 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_directionalblur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_directionalblur.c @@ -102,7 +102,7 @@ static CompBuf *dblur(bNode *node, CompBuf *img, int iterations, int wrap, return img; } -static void node_composit_exec_dblur(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_dblur(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { NodeDBlurData *ndbd= node->storage; CompBuf *new, *img= in[0]->data; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_displace.c b/source/blender/nodes/intern/CMP_nodes/CMP_displace.c index aa7fac81c2c..1ce545e2ca8 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_displace.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_displace.c @@ -48,7 +48,7 @@ static bNodeSocketType cmp_node_displace_out[]= { * in order to take effect */ #define DISPLACE_EPSILON 0.01 -static void do_displace(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *vecbuf, float *veccol, CompBuf *xbuf, CompBuf *ybuf, float *xscale, float *yscale) +static void do_displace(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *vecbuf, float *UNUSED(veccol), CompBuf *xbuf, CompBuf *ybuf, float *xscale, float *yscale) { ImBuf *ibuf; int x, y; @@ -60,7 +60,7 @@ static void do_displace(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *vecbuf, float float vec[3], vecdx[3], vecdy[3]; float col[3]; - ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0, 0); + ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0); ibuf->rect_float= cbuf->rect; for(y=0; y < stackbuf->y; y++) { @@ -140,7 +140,7 @@ static void do_displace(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *vecbuf, float } -static void node_composit_exec_displace(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_displace(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out) { if(out[0]->hasoutput==0) return; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_flip.c b/source/blender/nodes/intern/CMP_nodes/CMP_flip.c index fbc570c4028..33a17f890d8 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_flip.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_flip.c @@ -40,7 +40,7 @@ static bNodeSocketType cmp_node_flip_out[]= { { -1, 0, "" } }; -static void node_composit_exec_flip(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_flip(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { if(in[0]->data) { CompBuf *cbuf= in[0]->data; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c index c0e524a3ae9..2e3162b0c30 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c @@ -42,7 +42,7 @@ static bNodeSocketType cmp_node_gamma_out[]= { { -1, 0, "" } }; -static void do_gamma(bNode *node, float *out, float *in, float *fac) +static void do_gamma(bNode *UNUSED(node), float *out, float *in, float *fac) { int i=0; for(i=0; i<3; i++) { @@ -51,7 +51,7 @@ static void do_gamma(bNode *node, float *out, float *in, float *fac) } out[3] = in[3]; } -static void node_composit_exec_gamma(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_gamma(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order in: Fac, Image */ /* stack order out: Image */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_glare.c b/source/blender/nodes/intern/CMP_nodes/CMP_glare.c index 1d50acfdc26..d4968caee0f 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_glare.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_glare.c @@ -422,7 +422,7 @@ static void fglow(NodeGlare* ndg, CompBuf* dst, CompBuf* src) //-------------------------------------------------------------------------------------------- -static void node_composit_exec_glare(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_glare(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { CompBuf *new, *src, *img = in[0]->data; NodeGlare* ndg = node->storage; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c b/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c index c274c580771..e8ce3e20f11 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c @@ -65,7 +65,7 @@ static void do_hue_sat_fac(bNode *node, float *out, float *in, float *fac) } } -static void node_composit_exec_hue_sat(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_hue_sat(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order in: Fac, Image */ /* stack order out: Image */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c b/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c index 9eb79bb8c36..ac009ccb69d 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c @@ -98,7 +98,7 @@ static void do_huecorrect_fac(bNode *node, float *out, float *in, float *fac) out[3]= in[3]; } -static void node_composit_exec_huecorrect(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_huecorrect(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { CompBuf *cbuf= in[1]->data; CompBuf *stackbuf; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c index c99496d9664..dcf9a059c83 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c @@ -215,7 +215,7 @@ void outputs_multilayer_get(RenderData *rd, RenderLayer *rl, bNodeStack **out, I }; -static void node_composit_exec_image(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_image(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out) { /* image assigned to output */ @@ -378,7 +378,7 @@ void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStack **out out[RRES_OUT_ENV]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_ENVIRONMENT); }; -static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out) { Scene *sce= (Scene *)node->id; Render *re= (sce)? RE_GetRender(sce->id.name): NULL; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_invert.c b/source/blender/nodes/intern/CMP_nodes/CMP_invert.c index 08ae51975b9..7ea146c7d4d 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_invert.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_invert.c @@ -75,7 +75,7 @@ static void do_invert_fac(bNode *node, float *out, float *in, float *fac) QUATCOPY(out, col); } -static void node_composit_exec_invert(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_invert(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order in: fac, Image, Image */ /* stack order out: Image */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_lensdist.c b/source/blender/nodes/intern/CMP_nodes/CMP_lensdist.c index fc9045caafd..b6e1fffcce8 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_lensdist.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_lensdist.c @@ -147,7 +147,7 @@ static void lensDistort(CompBuf* dst, CompBuf* src, float kr, float kg, float kb } -static void node_composit_exec_lensdist(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_lensdist(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { CompBuf *new, *img = in[0]->data; NodeLensDist* nld = node->storage; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c b/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c index 91d1aa148b2..c605a661556 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_mapUV.c @@ -51,7 +51,7 @@ static void do_mapuv(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *uvbuf, float thr int x, y, sx, sy, row= 3*stackbuf->x; /* ibuf needed for sampling */ - ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0, 0); + ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0); ibuf->rect_float= cbuf->rect; /* vars for efficient looping */ @@ -134,7 +134,7 @@ static void do_mapuv(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *uvbuf, float thr } -static void node_composit_exec_mapuv(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_mapuv(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { if(out[0]->hasoutput==0) return; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c b/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c index 357218ea937..92709025a84 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_mapValue.c @@ -52,7 +52,7 @@ static void do_map_value(bNode *node, float *out, float *src) out[0]= texmap->max[0]; } -static void node_composit_exec_map_value(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_map_value(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order in: valbuf */ /* stack order out: valbuf */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_math.c b/source/blender/nodes/intern/CMP_nodes/CMP_math.c index f663dc76b5c..98bbbf6c752 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_math.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_math.c @@ -151,7 +151,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2) } } -static void node_composit_exec_math(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_math(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { CompBuf *cbuf=in[0]->data; CompBuf *cbuf2=in[1]->data; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_normal.c b/source/blender/nodes/intern/CMP_nodes/CMP_normal.c index c57caf180ad..04162956ac3 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_normal.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_normal.c @@ -52,7 +52,7 @@ static void do_normal(bNode *node, float *out, float *in) } /* generates normal, does dot product */ -static void node_composit_exec_normal(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_normal(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { bNodeSocket *sock= node->outputs.first; /* stack order input: normal */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c b/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c index 64855ba5cf3..07a11cdc997 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c @@ -40,7 +40,7 @@ static bNodeSocketType cmp_node_normalize_out[]= { { -1, 0, "" } }; -static void do_normalize(bNode *node, float *out, float *src, float *min, float *mult) +static void do_normalize(bNode *UNUSED(node), float *out, float *src, float *min, float *mult) { float res; res = (src[0] - min[0]) * mult[0]; @@ -58,7 +58,7 @@ static void do_normalize(bNode *node, float *out, float *src, float *min, float /* The code below assumes all data is inside range +- this, and that input buffer is single channel */ #define BLENDER_ZMAX 10000.0f -static void node_composit_exec_normalize(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_normalize(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order in: valbuf */ /* stack order out: valbuf */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c b/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c index 6f29548fcc3..85baa8c347a 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c @@ -36,7 +36,7 @@ static bNodeSocketType cmp_node_output_file_in[]= { { -1, 0, "" } }; -static void node_composit_exec_output_file(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_output_file(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out)) { /* image assigned to output */ /* stack order input sockets: col, alpha */ @@ -54,7 +54,7 @@ static void node_composit_exec_output_file(void *data, bNode *node, bNodeStack * return; } else { CompBuf *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA); - ImBuf *ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0, 0); + ImBuf *ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0); char string[256]; ibuf->rect_float= cbuf->rect; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_premulkey.c b/source/blender/nodes/intern/CMP_nodes/CMP_premulkey.c index 5058fa51c11..1aa2e338f94 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_premulkey.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_premulkey.c @@ -41,7 +41,7 @@ static bNodeSocketType cmp_node_premulkey_out[]= { { -1, 0, "" } }; -static void node_composit_exec_premulkey(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_premulkey(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { if(out[0]->hasoutput==0) return; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c b/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c index 3b9b993d5f8..5fbed05ac8d 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c @@ -36,7 +36,7 @@ static bNodeSocketType cmp_node_rgb_out[]= { { -1, 0, "" } }; -static void node_composit_exec_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_rgb(void *UNUSED(data), bNode *node, bNodeStack **UNUSED(in), bNodeStack **out) { bNodeSocket *sock= node->outputs.first; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c b/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c index ccb1d8abfd9..8fed6972c20 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c @@ -42,7 +42,7 @@ static bNodeSocketType cmp_node_rotate_out[]= { }; /* only supports RGBA nodes now */ -static void node_composit_exec_rotate(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_rotate(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { if(out[0]->hasoutput==0) @@ -68,8 +68,8 @@ static void node_composit_exec_rotate(void *data, bNode *node, bNodeStack **in, maxy= -centy + (float)cbuf->y; - ibuf=IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0, 0); - obuf=IMB_allocImBuf(stackbuf->x, stackbuf->y, 32, 0, 0); + ibuf=IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0); + obuf=IMB_allocImBuf(stackbuf->x, stackbuf->y, 32, 0); if(ibuf && obuf){ ibuf->rect_float=cbuf->rect; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_scale.c b/source/blender/nodes/intern/CMP_nodes/CMP_scale.c index 9779875b01a..40785f3bc77 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_scale.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_scale.c @@ -75,7 +75,7 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b newx= MIN2(newx, CMP_SCALE_MAX); newy= MIN2(newy, CMP_SCALE_MAX); - ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0, 0); + ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0); if(ibuf) { ibuf->rect_float= cbuf->rect; IMB_scaleImBuf(ibuf, newx, newy); diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c index 0ac47c58ab3..ef8723fd4e9 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c @@ -43,7 +43,7 @@ static bNodeSocketType cmp_node_sephsva_out[]= { { -1, 0, "" } }; -static void do_sephsva(bNode *node, float *out, float *in) +static void do_sephsva(bNode *UNUSED(node), float *out, float *in) { float h, s, v; @@ -55,7 +55,7 @@ static void do_sephsva(bNode *node, float *out, float *in) out[3]= in[3]; } -static void node_composit_exec_sephsva(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_sephsva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order out: bw channels */ /* stack order in: col */ @@ -127,7 +127,7 @@ static bNodeSocketType cmp_node_combhsva_out[]= { { -1, 0, "" } }; -static void do_comb_hsva(bNode *node, float *out, float *in1, float *in2, float *in3, float *in4) +static void do_comb_hsva(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4) { float r,g,b; hsv_to_rgb(in1[0], in2[0], in3[0], &r, &g, &b); @@ -138,7 +138,7 @@ static void do_comb_hsva(bNode *node, float *out, float *in1, float *in2, float out[3] = in4[0]; } -static void node_composit_exec_combhsva(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_combhsva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order out: 1 rgba channels */ /* stack order in: 4 value channels */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombRGBA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombRGBA.c index c5a57f8a175..36603785bb3 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombRGBA.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombRGBA.c @@ -42,7 +42,7 @@ static bNodeSocketType cmp_node_seprgba_out[]= { { -1, 0, "" } }; -static void node_composit_exec_seprgba(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_seprgba(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out) { /* stack order out: bw channels */ /* stack order in: col */ @@ -106,7 +106,7 @@ static bNodeSocketType cmp_node_combrgba_out[]= { { -1, 0, "" } }; -static void do_combrgba(bNode *node, float *out, float *in1, float *in2, float *in3, float *in4) +static void do_combrgba(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4) { out[0] = in1[0]; out[1] = in2[0]; @@ -114,7 +114,7 @@ static void do_combrgba(bNode *node, float *out, float *in1, float *in2, float * out[3] = in4[0]; } -static void node_composit_exec_combrgba(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_combrgba(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order out: 1 rgba channels */ /* stack order in: 4 value channels */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c index 7b3dfccab50..4b164729bbc 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c @@ -43,7 +43,7 @@ static bNodeSocketType cmp_node_sepycca_out[]= { { -1, 0, "" } }; -static void do_sepycca(bNode *node, float *out, float *in) +static void do_sepycca(bNode *UNUSED(node), float *out, float *in) { float y, cb, cr; @@ -56,7 +56,7 @@ static void do_sepycca(bNode *node, float *out, float *in) out[3]= in[3]; } -static void node_composit_exec_sepycca(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_sepycca(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* input no image? then only color operation */ if(in[0]->data==NULL) { @@ -126,7 +126,7 @@ static bNodeSocketType cmp_node_combycca_out[]= { { -1, 0, "" } }; -static void do_comb_ycca(bNode *node, float *out, float *in1, float *in2, float *in3, float *in4) +static void do_comb_ycca(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4) { float r,g,b; float y, cb, cr; @@ -144,7 +144,7 @@ static void do_comb_ycca(bNode *node, float *out, float *in1, float *in2, float out[3] = in4[0]; } -static void node_composit_exec_combycca(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_combycca(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order out: 1 ycca channels */ /* stack order in: 4 value channels */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYUVA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYUVA.c index 13b71026054..333a4a2596e 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYUVA.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYUVA.c @@ -43,7 +43,7 @@ static bNodeSocketType cmp_node_sepyuva_out[]= { { -1, 0, "" } }; -static void do_sepyuva(bNode *node, float *out, float *in) +static void do_sepyuva(bNode *UNUSED(node), float *out, float *in) { float y, u, v; @@ -55,7 +55,7 @@ static void do_sepyuva(bNode *node, float *out, float *in) out[3]= in[3]; } -static void node_composit_exec_sepyuva(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_sepyuva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order out: bw channels */ /* stack order in: col */ @@ -127,7 +127,7 @@ static bNodeSocketType cmp_node_combyuva_out[]= { { -1, 0, "" } }; -static void do_comb_yuva(bNode *node, float *out, float *in1, float *in2, float *in3, float *in4) +static void do_comb_yuva(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4) { float r,g,b; yuv_to_rgb(in1[0], in2[0], in3[0], &r, &g, &b); @@ -138,7 +138,7 @@ static void do_comb_yuva(bNode *node, float *out, float *in1, float *in2, float out[3] = in4[0]; } -static void node_composit_exec_combyuva(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_combyuva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order out: 1 rgba channels */ /* stack order in: 4 value channels */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_setalpha.c b/source/blender/nodes/intern/CMP_nodes/CMP_setalpha.c index a7d10017c1f..f4c5603ce49 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_setalpha.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_setalpha.c @@ -40,7 +40,7 @@ static bNodeSocketType cmp_node_setalpha_out[]= { { -1, 0, "" } }; -static void node_composit_exec_setalpha(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_setalpha(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order out: RGBA image */ /* stack order in: col, alpha */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c b/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c index 98bda1bd7fa..efb8c12fa84 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_splitViewer.c @@ -36,7 +36,7 @@ static bNodeSocketType cmp_node_splitviewer_in[]= { { -1, 0, "" } }; -static void do_copy_split_rgba(bNode *node, float *out, float *in1, float *in2, float *fac) +static void do_copy_split_rgba(bNode *UNUSED(node), float *out, float *in1, float *in2, float *fac) { if(*fac==0.0f) { QUATCOPY(out, in1); @@ -46,7 +46,7 @@ static void do_copy_split_rgba(bNode *node, float *out, float *in1, float *in2, } } -static void node_composit_exec_splitviewer(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_splitviewer(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out)) { /* image assigned to output */ /* stack order input sockets: image image */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c b/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c index 12f0c171f94..49031e1625a 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c @@ -123,7 +123,7 @@ static void tonemap(NodeTonemap* ntm, CompBuf* dst, CompBuf* src) } -static void node_composit_exec_tonemap(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_tonemap(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { CompBuf *new, *img = in[0]->data; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_translate.c b/source/blender/nodes/intern/CMP_nodes/CMP_translate.c index ca359d436f6..0d8ad41d2dd 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_translate.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_translate.c @@ -43,7 +43,7 @@ static bNodeSocketType cmp_node_translate_out[]= { { -1, 0, "" } }; -static void node_composit_exec_translate(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_translate(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out) { if(in[0]->data) { CompBuf *cbuf= in[0]->data; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c b/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c index 6ce03f38cdb..7e0ecbcb888 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_valToRgb.c @@ -46,7 +46,7 @@ static void do_colorband_composit(bNode *node, float *out, float *in) do_colorband(node->storage, in[0], out); } -static void node_composit_exec_valtorgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_valtorgb(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order in: fac */ /* stack order out: col, alpha */ @@ -109,12 +109,12 @@ static bNodeSocketType cmp_node_rgbtobw_out[]= { { -1, 0, "" } }; -static void do_rgbtobw(bNode *node, float *out, float *in) +static void do_rgbtobw(bNode *UNUSED(node), float *out, float *in) { out[0]= in[0]*0.35f + in[1]*0.45f + in[2]*0.2f; } -static void node_composit_exec_rgbtobw(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_rgbtobw(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order out: bw */ /* stack order in: col */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_value.c b/source/blender/nodes/intern/CMP_nodes/CMP_value.c index 14a3b6fe15c..a37742c77e9 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_value.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_value.c @@ -35,7 +35,7 @@ static bNodeSocketType cmp_node_value_out[]= { { -1, 0, "" } }; -static void node_composit_exec_value(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_value(void *UNUSED(data), bNode *node, bNodeStack **UNUSED(in), bNodeStack **out) { bNodeSocket *sock= node->outputs.first; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c b/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c index eaeeadd02af..9ea626e39d6 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_vecBlur.c @@ -44,7 +44,7 @@ static bNodeSocketType cmp_node_vecblur_out[]= { -static void node_composit_exec_vecblur(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_vecblur(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { NodeBlurData *nbd= node->storage; CompBuf *new, *img= in[0]->data, *vecbuf= in[2]->data, *zbuf= in[1]->data; diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c b/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c index 80200ad9ce6..24d8a9eb09e 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_viewer.c @@ -39,7 +39,7 @@ static bNodeSocketType cmp_node_viewer_in[]= { }; -static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out)) { /* image assigned to output */ /* stack order input sockets: col, alpha, z */ diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c b/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c index 7be9f34f00b..80989feaf26 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_zcombine.c @@ -67,7 +67,7 @@ static void do_zcombine_mask(bNode *node, float *out, float *z1, float *z2) } } -static void do_zcombine_add(bNode *node, float *out, float *col1, float *col2, float *acol) +static void do_zcombine_add(bNode *UNUSED(node), float *out, float *col1, float *col2, float *acol) { float alpha= *acol; float malpha= 1.0f - alpha; diff --git a/source/blender/nodes/intern/CMP_util.c b/source/blender/nodes/intern/CMP_util.c index 9edcc8b0eec..c762d8cb42d 100644 --- a/source/blender/nodes/intern/CMP_util.c +++ b/source/blender/nodes/intern/CMP_util.c @@ -662,59 +662,59 @@ void generate_preview(void *data, bNode *node, CompBuf *stackbuf) } } -void do_rgba_to_yuva(bNode *node, float *out, float *in) +void do_rgba_to_yuva(bNode *UNUSED(node), float *out, float *in) { rgb_to_yuv(in[0],in[1],in[2], &out[0], &out[1], &out[2]); out[3]=in[3]; } -void do_rgba_to_hsva(bNode *node, float *out, float *in) +void do_rgba_to_hsva(bNode *UNUSED(node), float *out, float *in) { rgb_to_hsv(in[0],in[1],in[2], &out[0], &out[1], &out[2]); out[3]=in[3]; } -void do_rgba_to_ycca(bNode *node, float *out, float *in) +void do_rgba_to_ycca(bNode *UNUSED(node), float *out, float *in) { rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); out[3]=in[3]; } -void do_yuva_to_rgba(bNode *node, float *out, float *in) +void do_yuva_to_rgba(bNode *UNUSED(node), float *out, float *in) { yuv_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2]); out[3]=in[3]; } -void do_hsva_to_rgba(bNode *node, float *out, float *in) +void do_hsva_to_rgba(bNode *UNUSED(node), float *out, float *in) { hsv_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2]); out[3]=in[3]; } -void do_ycca_to_rgba(bNode *node, float *out, float *in) +void do_ycca_to_rgba(bNode *UNUSED(node), float *out, float *in) { ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); out[3]=in[3]; } -void do_copy_rgba(bNode *node, float *out, float *in) +void do_copy_rgba(bNode *UNUSED(node), float *out, float *in) { QUATCOPY(out, in); } -void do_copy_rgb(bNode *node, float *out, float *in) +void do_copy_rgb(bNode *UNUSED(node), float *out, float *in) { VECCOPY(out, in); out[3]= 1.0f; } -void do_copy_value(bNode *node, float *out, float *in) +void do_copy_value(bNode *UNUSED(node), float *out, float *in) { out[0]= in[0]; } -void do_copy_a_rgba(bNode *node, float *out, float *in, float *fac) +void do_copy_a_rgba(bNode *UNUSED(node), float *out, float *in, float *fac) { VECCOPY(out, in); out[3]= *fac; diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_camera.c b/source/blender/nodes/intern/SHD_nodes/SHD_camera.c index d89099955aa..869b1d1e54c 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_camera.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_camera.c @@ -38,7 +38,7 @@ static bNodeSocketType sh_node_camera_out[]= { }; -static void node_shader_exec_camera(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_camera(void *data, bNode *UNUSED(node), bNodeStack **UNUSED(in), bNodeStack **out) { if(data) { ShadeInput *shi= ((ShaderCallData *)data)->shi; /* Data we need for shading. */ @@ -49,7 +49,7 @@ static void node_shader_exec_camera(void *data, bNode *node, bNodeStack **in, bN } } -static int gpu_shader_camera(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) +static int gpu_shader_camera(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { return GPU_stack_link(mat, "camera", in, out, GPU_builtin(GPU_VIEW_POSITION)); } diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_curves.c b/source/blender/nodes/intern/SHD_nodes/SHD_curves.c index 4e47e75993d..56aaa4fe8a7 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_curves.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_curves.c @@ -42,7 +42,7 @@ static bNodeSocketType sh_node_curve_vec_out[]= { { -1, 0, "" } }; -static void node_shader_exec_curve_vec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_curve_vec(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { float vec[3]; @@ -97,7 +97,7 @@ static bNodeSocketType sh_node_curve_rgb_out[]= { { -1, 0, "" } }; -static void node_shader_exec_curve_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { float vec[3]; diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_geom.c b/source/blender/nodes/intern/SHD_nodes/SHD_geom.c index aefe7d104b5..a27918df275 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_geom.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_geom.c @@ -47,7 +47,7 @@ static bNodeSocketType sh_node_geom_out[]= { }; /* node execute callback */ -static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out) { if(data) { ShadeInput *shi= ((ShaderCallData *)data)->shi; diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c b/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c index 4f319f8937c..5c95577e32d 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c @@ -45,7 +45,7 @@ static bNodeSocketType sh_node_hue_sat_out[]= { }; /* note: it would be possible to use CMP version for both nodes */ -static void do_hue_sat_fac(bNode *node, float *out, float *hue, float *sat, float *val, float *in, float *fac) +static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float *hue, float *sat, float *val, float *in, float *fac) { if(*fac!=0.0f && (*hue!=0.5f || *sat!=1.0 || *val!=1.0)) { float col[3], hsv[3], mfac= 1.0f - *fac; @@ -66,13 +66,13 @@ static void do_hue_sat_fac(bNode *node, float *out, float *hue, float *sat, floa } } -static void node_shader_exec_hue_sat(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_hue_sat(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { do_hue_sat_fac(node, out[0]->vec, in[0]->vec, in[1]->vec, in[2]->vec, in[4]->vec, in[3]->vec); } -static int gpu_shader_hue_sat(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) +static int gpu_shader_hue_sat(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { return GPU_stack_link(mat, "hue_sat", in, out); } diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_invert.c b/source/blender/nodes/intern/SHD_nodes/SHD_invert.c index 08666f4dd52..73fccf7cd0b 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_invert.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_invert.c @@ -43,7 +43,7 @@ static bNodeSocketType sh_node_invert_out[]= { { -1, 0, "" } }; -static void node_shader_exec_invert(void *data, bNode *node, bNodeStack **in, +static void node_shader_exec_invert(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out) { float col[3], facm; @@ -64,7 +64,7 @@ bNodeStack **out) VECCOPY(out[0]->vec, col); } -static int gpu_shader_invert(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) +static int gpu_shader_invert(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { return GPU_stack_link(mat, "invert", in, out); } diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c b/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c index 49778625446..f01ed3d7ab8 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_mapping.c @@ -41,7 +41,7 @@ static bNodeSocketType sh_node_mapping_out[]= { }; /* do the regular mapping options for blender textures */ -static void node_shader_exec_mapping(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_mapping(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { TexMapping *texmap= node->storage; float *vec= out[0]->vec; diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_math.c b/source/blender/nodes/intern/SHD_nodes/SHD_math.c index 7429c084ab3..40a2e53c665 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_math.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_math.c @@ -43,7 +43,7 @@ static bNodeSocketType sh_node_math_out[]= { { -1, 0, "" } }; -static void node_shader_exec_math(void *data, bNode *node, bNodeStack **in, +static void node_shader_exec_math(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { switch(node->custom1){ diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c b/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c index bc4342e11e3..56d863f002a 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c @@ -42,7 +42,7 @@ static bNodeSocketType sh_node_mix_rgb_out[]= { { -1, 0, "" } }; -static void node_shader_exec_mix_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_mix_rgb(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order in: fac, col1, col2 */ /* stack order out: col */ diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_normal.c b/source/blender/nodes/intern/SHD_nodes/SHD_normal.c index eb3786286ae..8054f184cea 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_normal.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_normal.c @@ -42,7 +42,7 @@ static bNodeSocketType sh_node_normal_out[]= { }; /* generates normal, does dot product */ -static void node_shader_exec_normal(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_normal(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { bNodeSocket *sock= node->outputs.first; float vec[3]; diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_output.c b/source/blender/nodes/intern/SHD_nodes/SHD_output.c index 740639b6ab4..4395716e599 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_output.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_output.c @@ -36,7 +36,7 @@ static bNodeSocketType sh_node_output_in[]= { { -1, 0, "" } }; -static void node_shader_exec_output(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_output(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out)) { if(data) { ShadeInput *shi= ((ShaderCallData *)data)->shi; @@ -62,7 +62,7 @@ static void node_shader_exec_output(void *data, bNode *node, bNodeStack **in, bN } } -static int gpu_shader_output(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) +static int gpu_shader_output(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { GPUNodeLink *outlink; diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c b/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c index 71af58beb67..600518962ab 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_rgb.c @@ -35,7 +35,7 @@ static bNodeSocketType sh_node_rgb_out[]= { { -1, 0, "" } }; -static void node_shader_exec_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_rgb(void *UNUSED(data), bNode *node, bNodeStack **UNUSED(in), bNodeStack **out) { bNodeSocket *sock= node->outputs.first; diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c b/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c index 883cd4d3bf4..1de200c7b1c 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c @@ -41,14 +41,14 @@ static bNodeSocketType sh_node_seprgb_out[]= { { -1, 0, "" } }; -static void node_shader_exec_seprgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_seprgb(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out) { out[0]->vec[0] = in[0]->vec[0]; out[1]->vec[0] = in[0]->vec[1]; out[2]->vec[0] = in[0]->vec[2]; } -static int gpu_shader_seprgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) +static int gpu_shader_seprgb(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { return GPU_stack_link(mat, "separate_rgb", in, out); } @@ -85,14 +85,14 @@ static bNodeSocketType sh_node_combrgb_out[]= { { -1, 0, "" } }; -static void node_shader_exec_combrgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_combrgb(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out) { out[0]->vec[0] = in[0]->vec[0]; out[0]->vec[1] = in[1]->vec[0]; out[0]->vec[2] = in[2]->vec[0]; } -static int gpu_shader_combrgb(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) +static int gpu_shader_combrgb(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { return GPU_stack_link(mat, "combine_rgb", in, out); } diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c b/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c index 926dcd0f046..06b06affaa0 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c @@ -42,7 +42,7 @@ static bNodeSocketType sh_node_squeeze_out[]= { { -1, 0, "" } }; -static void node_shader_exec_squeeze(void *data, bNode *node, bNodeStack **in, +static void node_shader_exec_squeeze(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out) { float vec[3]; @@ -54,7 +54,7 @@ bNodeStack **out) 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 *node, GPUNodeStack *in, GPUNodeStack *out) +static int gpu_shader_squeeze(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { return GPU_stack_link(mat, "squeeze", in, out); } diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c b/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c index e2260461152..1e5b9cf935e 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c @@ -40,7 +40,7 @@ static bNodeSocketType sh_node_valtorgb_out[]= { { -1, 0, "" } }; -static void node_shader_exec_valtorgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_valtorgb(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { /* stack order in: fac */ /* stack order out: col, alpha */ @@ -98,7 +98,7 @@ static bNodeSocketType sh_node_rgbtobw_out[]= { }; -static void node_shader_exec_rgbtobw(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_rgbtobw(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **in, bNodeStack **out) { /* stack order out: bw */ /* stack order in: col */ @@ -106,7 +106,7 @@ static void node_shader_exec_rgbtobw(void *data, bNode *node, bNodeStack **in, b out[0]->vec[0]= in[0]->vec[0]*0.35f + in[0]->vec[1]*0.45f + in[0]->vec[2]*0.2f; } -static int gpu_shader_rgbtobw(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) +static int gpu_shader_rgbtobw(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out) { return GPU_stack_link(mat, "rgbtobw", in, out); } diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_value.c b/source/blender/nodes/intern/SHD_nodes/SHD_value.c index 1663ea352aa..f78480bd794 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_value.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_value.c @@ -35,7 +35,7 @@ static bNodeSocketType sh_node_value_out[]= { { -1, 0, "" } }; -static void node_shader_exec_value(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_value(void *UNUSED(data), bNode *node, bNodeStack **UNUSED(in), bNodeStack **out) { bNodeSocket *sock= node->outputs.first; diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c index 062c6402fb6..dbdb04c2a6a 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c @@ -44,7 +44,7 @@ static bNodeSocketType sh_node_vect_math_out[]= { { -1, 0, "" } }; -static void node_shader_exec_vect_math(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void node_shader_exec_vect_math(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { float vec1[3], vec2[3]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_at.c b/source/blender/nodes/intern/TEX_nodes/TEX_at.c index 08c1c65792d..1ca293acb5b 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_at.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_at.c @@ -38,7 +38,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { TexParams np = *p; float new_co[3]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c index 4155cec4d7f..64b70455a19 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c @@ -40,7 +40,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { float x = p->co[0]; float y = p->co[1]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_compose.c b/source/blender/nodes/intern/TEX_nodes/TEX_compose.c index 7319a50b7d9..f05e1e987da 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_compose.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_compose.c @@ -40,7 +40,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { int i; for(i = 0; i < 4; i++) diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_coord.c b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c index 68e892ce77c..4ad32bc872e 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_coord.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c @@ -33,7 +33,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void vectorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void vectorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **UNUSED(in), short UNUSED(thread)) { out[0] = p->co[0]; out[1] = p->co[1]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c index 49a1ef35fbb..0fca0aa30ad 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c @@ -36,7 +36,7 @@ static bNodeSocketType time_outputs[]= { { -1, 0, "" } }; -static void time_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void time_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(in), short UNUSED(thread)) { /* stack order output: fac */ float fac= 0.0f; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c b/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c index f031091e08d..13768aaa868 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c @@ -41,25 +41,25 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void valuefn_r(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void valuefn_r(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { tex_input_rgba(out, in[0], p, thread); *out = out[0]; } -static void valuefn_g(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void valuefn_g(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { tex_input_rgba(out, in[0], p, thread); *out = out[1]; } -static void valuefn_b(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void valuefn_b(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { tex_input_rgba(out, in[0], p, thread); *out = out[2]; } -static void valuefn_a(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void valuefn_a(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { tex_input_rgba(out, in[0], p, thread); *out = out[3]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c index e0fee3e3153..5d624205f43 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c @@ -41,7 +41,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void valuefn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { float co1[3], co2[3]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c index 367ea7b9e5f..2ccde083823 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c @@ -42,7 +42,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void do_hue_sat_fac(bNode *node, float *out, float hue, float sat, float val, float *in, float fac) +static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float hue, float sat, float val, float *in, float fac) { if(fac != 0 && (hue != 0.5f || sat != 1 || val != 1)) { float col[3], hsv[3], mfac= 1.0f - fac; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_image.c b/source/blender/nodes/intern/TEX_nodes/TEX_image.c index 628d9026db1..c764c7a22d2 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_image.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_image.c @@ -34,7 +34,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(in), short UNUSED(thread)) { float x = p->co[0]; float y = p->co[1]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_invert.c b/source/blender/nodes/intern/TEX_nodes/TEX_invert.c index 1619ed73023..421082aeb34 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_invert.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_invert.c @@ -39,7 +39,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { float col[4]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_output.c b/source/blender/nodes/intern/TEX_nodes/TEX_output.c index 09bc893cc1f..26733a94180 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_output.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_output.c @@ -36,7 +36,7 @@ static bNodeSocketType inputs[]= { }; /* applies to render pipeline */ -static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out)) { TexCallData *cdata = (TexCallData *)data; TexResult *target = cdata->target; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c index 3e7ef0e94fe..a4a608e777c 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c @@ -111,7 +111,7 @@ static int count_outputs(bNode *node) /* Boilerplate generators */ #define ProcNoInputs(name) \ - static void name##_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) \ + static void name##_map_inputs(Tex *UNUSED(tex), bNodeStack **UNUSED(in), TexParams *UNUSED(p), short UNUSED(thread)) \ {} #define ProcDef(name) \ diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c index 9a855938eef..88ed5382a6a 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c @@ -64,7 +64,7 @@ static void rotate(float new_co[3], float a, float ax[3], float co[3]) new_co[2] = para[2] + perp[2] + cp[2]; } -static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { float new_co[3], new_dxt[3], new_dyt[3], a, ax[3]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_scale.c b/source/blender/nodes/intern/TEX_nodes/TEX_scale.c index 721c322c540..8045c1ca07a 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_scale.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_scale.c @@ -40,7 +40,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { float scale[3], new_co[3], new_dxt[3], new_dyt[3]; TexParams np = *p; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c index a823338faf9..a9d7fbcf3da 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c @@ -40,7 +40,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { float offset[3], new_co[3]; TexParams np = *p; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c index 46aefe5ad47..c71d442cef3 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c @@ -39,7 +39,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void normalfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void normalfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { float new_co[3]; float *co = p->co; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c index 3810167a58a..fcaa9550efa 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c @@ -87,7 +87,7 @@ static bNodeSocketType rgbtobw_out[]= { }; -static void rgbtobw_valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) +static void rgbtobw_valuefn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack **in, short thread) { float cin[4]; tex_input_rgba(cin, in[0], p, thread); diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c b/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c index 698c894a8d8..75fe6945261 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c @@ -37,7 +37,7 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out)) { TexCallData *cdata = (TexCallData *)data; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index e741c622380..e70287e522e 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -321,7 +321,7 @@ u | | F1 | F2 | /* ------------------------------------------------------------------------- */ -static void split_v_renderfaces(ObjectRen *obr, int startvlak, int startvert, int usize, int vsize, int uIndex, int cyclu, int cyclv) +static void split_v_renderfaces(ObjectRen *obr, int startvlak, int startvert, int usize, int vsize, int uIndex, int UNUSED(cyclu), int cyclv) { int vLen = vsize-1+(!!cyclv); int v; diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 8977bc7f379..f7da13373d1 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -86,7 +86,7 @@ static void envmap_split_ima(EnvMap *env, ImBuf *ibuf) if (env->type == ENV_CUBE) { for(part=0; part<6; part++) { - env->cube[part]= IMB_allocImBuf(dx, dx, 24, IB_rect|IB_rectfloat, 0); + env->cube[part]= IMB_allocImBuf(dx, dx, 24, IB_rect|IB_rectfloat); } IMB_float_from_rect(ibuf); @@ -458,7 +458,7 @@ static void render_envmap(Render *re, EnvMap *env) int y; float *alpha; - ibuf= IMB_allocImBuf(envre->rectx, envre->recty, 24, IB_rect|IB_rectfloat, 0); + ibuf= IMB_allocImBuf(envre->rectx, envre->recty, 24, IB_rect|IB_rectfloat); memcpy(ibuf->rect_float, rl->rectf, ibuf->channels * ibuf->x * ibuf->y * sizeof(float)); if (re->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 79f489137f3..ed390fe102a 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -122,20 +122,20 @@ Render R; static volatile int g_break= 0; -static int thread_break(void *unused) +static int thread_break(void *UNUSED(arg)) { return g_break; } /* default callbacks, set in each new render */ -static void result_nothing(void *unused, RenderResult *rr) {} -static void result_rcti_nothing(void *unused, RenderResult *rr, volatile struct rcti *rect) {} -static void stats_nothing(void *unused, RenderStats *rs) {} -static void float_nothing(void *unused, float val) {} -static void print_error(void *unused, char *str) {printf("ERROR: %s\n", str);} -static int default_break(void *unused) {return G.afbreek == 1;} +static void result_nothing(void *UNUSED(arg), RenderResult *UNUSED(rr)) {} +static void result_rcti_nothing(void *UNUSED(arg), RenderResult *UNUSED(rr), volatile struct rcti *UNUSED(rect)) {} +static void stats_nothing(void *UNUSED(arg), RenderStats *UNUSED(rs)) {} +static void float_nothing(void *UNUSED(arg), float UNUSED(val)) {} +static void print_error(void *UNUSED(arg), char *str) {printf("ERROR: %s\n", str);} +static int default_break(void *UNUSED(arg)) {return G.afbreek == 1;} -static void stats_background(void *unused, RenderStats *rs) +static void stats_background(void *UNUSED(arg), RenderStats *rs) { char str[400], *spos= str; uintptr_t mem_in_use, mmap_in_use, peak_memory; @@ -1398,7 +1398,7 @@ void RE_error_cb(Render *re, void *handle, void (*f)(void *handle, char *str)) /* object is considered fully prepared on correct time etc */ /* includes lights */ -void RE_AddObject(Render *re, Object *ob) +void RE_AddObject(Render *UNUSED(re), Object *UNUSED(ob)) { } @@ -2813,7 +2813,7 @@ static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, R } } else { - ImBuf *ibuf= IMB_allocImBuf(rres.rectx, rres.recty, scene->r.planes, 0, 0); + ImBuf *ibuf= IMB_allocImBuf(rres.rectx, rres.recty, scene->r.planes, 0); /* if not exists, BKE_write_ibuf makes one */ ibuf->rect= (unsigned int *)rres.rect32; @@ -3170,7 +3170,7 @@ void RE_layer_load_from_file(RenderLayer *layer, ReportList *reports, char *file if(ibuf->rect_float==NULL) IMB_float_from_rect(ibuf); - ibuf_clip = IMB_allocImBuf(layer->rectx, layer->recty, 32, IB_rectfloat, 0); + ibuf_clip = IMB_allocImBuf(layer->rectx, layer->recty, 32, IB_rectfloat); if(ibuf_clip) { IMB_rectcpy(ibuf_clip, ibuf, 0,0, 0,0, layer->rectx, layer->recty); diff --git a/source/blender/render/intern/source/rayobject_instance.c b/source/blender/render/intern/source/rayobject_instance.c index 25765c4763a..a8098d2e8ef 100644 --- a/source/blender/render/intern/source/rayobject_instance.c +++ b/source/blender/render/intern/source/rayobject_instance.c @@ -41,7 +41,7 @@ static void RE_rayobject_instance_free(RayObject *o); static void RE_rayobject_instance_bb(RayObject *o, float *min, float *max); static float RE_rayobject_instance_cost(RayObject *o); -static void RE_rayobject_instance_hint_bb(RayObject *o, RayHint *hint, float *min, float *max) +static void RE_rayobject_instance_hint_bb(RayObject *UNUSED(o), RayHint *UNUSED(hint), float *UNUSED(min), float *UNUSED(max)) {} static RayObjectAPI instance_api = diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 7101ce5daaf..e589bb3a840 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -820,7 +820,7 @@ static void *do_shadow_thread(void *re_v) } static volatile int g_break= 0; -static int thread_break(void *unused) +static int thread_break(void *UNUSED(arg)) { return g_break; } diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c index e8c95a34ac4..1e8709d09f7 100644 --- a/source/blender/render/intern/source/sss.c +++ b/source/blender/render/intern/source/sss.c @@ -466,7 +466,7 @@ static void compute_radiance(ScatterTree *tree, float *co, float *rad) /* building */ -static void sum_leaf_radiance(ScatterTree *tree, ScatterNode *node) +static void sum_leaf_radiance(ScatterTree *UNUSED(tree), ScatterNode *node) { ScatterPoint *p; float rad, totrad= 0.0f, inv; @@ -540,7 +540,7 @@ static void sum_leaf_radiance(ScatterTree *tree, ScatterNode *node) } } -static void sum_branch_radiance(ScatterTree *tree, ScatterNode *node) +static void sum_branch_radiance(ScatterTree *UNUSED(tree), ScatterNode *node) { ScatterNode *subnode; float rad, totrad= 0.0f, inv; diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index d3e8f4058c5..39e8315e7cf 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -89,7 +89,7 @@ int intersect_outside_volume(RayObject *tree, Isect *isect, float *offset, int l } /* Uses ray tracing to check if a point is inside or outside an ObjectInstanceRen */ -int point_inside_obi(RayObject *tree, ObjectInstanceRen *obi, float *co) +int point_inside_obi(RayObject *tree, ObjectInstanceRen *UNUSED(obi), float *co) { Isect isect; float vec[3] = {0.0f,0.0f,1.0f}; diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 66d2a1efdea..e925d651490 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -254,7 +254,7 @@ static void wm_init_userdef(bContext *C) UI_init_userdef(); MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024); - sound_init(CTX_data_main(C)); + sound_init(); /* set the python auto-execute setting from user prefs */ /* disabled by default, unless explicitly enabled in the command line */ -- cgit v1.2.3 From 5ca362c4224ef9254477ead5696cc61cbac273cc Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 16 Oct 2010 14:43:47 +0000 Subject: Declaration before any statements. Doesn't GCC warn about this? --- source/blender/editors/mesh/editmesh_add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 7b23b556994..a33d64cad29 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -114,9 +114,9 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) float min[3], max[3]; int done= 0; short use_proj; + wmWindow *win= CTX_wm_window(C); em_setup_viewcontext(C, &vc); - wmWindow *win= CTX_wm_window(C); printf("\n%d %d\n", event->x, event->y); printf("%d %d\n", win->eventstate->x, win->eventstate->y); -- cgit v1.2.3 From fe693b4631b604e502cfd40078a1fcad9e03dc58 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 16 Oct 2010 14:49:56 +0000 Subject: Revert overaggressive parameter removal: Main struct is used in audio when Jack support is enabled. --- source/blender/blenkernel/BKE_sound.h | 2 +- source/blender/blenkernel/intern/sound.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index fb2ea4c1ca9..09cea572deb 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -40,7 +40,7 @@ struct Sequence; void sound_init_once(); -void sound_init(void); +void sound_init(struct Main *main); void sound_exit(); diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index bf8e2d348ac..ca1fd80b406 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -79,7 +79,7 @@ void sound_init_once() AUD_initOnce(); } -void sound_init(void) +void sound_init(struct Main *bmain) { AUD_DeviceSpecs specs; int device, buffersize; -- cgit v1.2.3 From 1aecaaf815676700cb297fc43953cdecfdcf90c4 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 16 Oct 2010 14:51:50 +0000 Subject: Forgot to commit RNA part of revert in 32519 --- source/blender/makesrna/intern/rna_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 0c217837226..674fbbad9c6 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -38,7 +38,7 @@ static void rna_Sound_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - sound_load((bSound*)ptr->data); + sound_load(bmain, (bSound*)ptr->data); } static int rna_Sound_caching_get(PointerRNA *ptr) -- cgit v1.2.3 From 03eb8d02229843c3257076c00a8f51925f3c93a6 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 16 Oct 2010 14:53:54 +0000 Subject: =?UTF-8?q?Maybe=20now=20correct=20commit=20:=C2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/blender/makesrna/intern/rna_sound.c | 2 +- source/blender/makesrna/intern/rna_userdef.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 674fbbad9c6..0c217837226 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -38,7 +38,7 @@ static void rna_Sound_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - sound_load(bmain, (bSound*)ptr->data); + sound_load((bSound*)ptr->data); } static int rna_Sound_caching_get(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index b3b263fe030..4196b3585b3 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -169,7 +169,7 @@ static PointerRNA rna_UserDef_system_get(PointerRNA *ptr) static void rna_UserDef_audio_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - sound_init(); + sound_init(bmain); } static void rna_Userdef_memcache_update(Main *bmain, Scene *scene, PointerRNA *ptr) -- cgit v1.2.3 From 53ced0be29c2672226d16d63118a02a4c8eee342 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 16 Oct 2010 15:00:04 +0000 Subject: Now sound init param removal revert should be fine (apparently my cmake project files missed rebuild hint for these, fortunately SCons did its job well). --- source/blender/windowmanager/intern/wm_files.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index e925d651490..66d2a1efdea 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -254,7 +254,7 @@ static void wm_init_userdef(bContext *C) UI_init_userdef(); MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024); - sound_init(); + sound_init(CTX_data_main(C)); /* set the python auto-execute setting from user prefs */ /* disabled by default, unless explicitly enabled in the command line */ -- cgit v1.2.3 From ac03fbe4c9d836f7dffaf230a4019371b6f5874d Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 16 Oct 2010 15:53:01 +0000 Subject: Adapt OSX code for IMB_allocImBuf param changes. --- source/blender/quicktime/apple/qtkit_import.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/quicktime/apple/qtkit_import.m b/source/blender/quicktime/apple/qtkit_import.m index 41c4e0cc5a3..f067d717a7c 100644 --- a/source/blender/quicktime/apple/qtkit_import.m +++ b/source/blender/quicktime/apple/qtkit_import.m @@ -149,7 +149,7 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height) NSEnumerator *enumerator; NSImageRep *representation; - ibuf = IMB_allocImBuf (width, height, 32, IB_rect, 0); + ibuf = IMB_allocImBuf (width, height, 32, IB_rect); if (!ibuf) { if(QTIME_DEBUG) printf("quicktime_import: could not allocate memory for the " \ "image.\n"); @@ -359,7 +359,7 @@ int startquicktime (struct anim *anim) return -1; } - anim->qtime->ibuf = IMB_allocImBuf (anim->x, anim->y, 32, IB_rect, 0); + anim->qtime->ibuf = IMB_allocImBuf (anim->x, anim->y, 32, IB_rect); qtTimeDuration = [[anim->qtime->media attributeForKey:QTMediaDurationAttribute] QTTimeValue]; anim->qtime->durationTime = qtTimeDuration.timeValue; @@ -450,7 +450,7 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags) [bitmapImage setSize:bitmapSize]; /* allocate the image buffer */ - ibuf = IMB_allocImBuf(bitmapSize.width, bitmapSize.height, 32/*RGBA*/, 0, 0); + ibuf = IMB_allocImBuf(bitmapSize.width, bitmapSize.height, 32/*RGBA*/, 0); if (!ibuf) { fprintf(stderr, "imb_cocoaLoadImage: could not allocate memory for the " \ -- cgit v1.2.3 From 3b6564a821e8797942132ad30f93af810952237a Mon Sep 17 00:00:00 2001 From: Elia Sarti Date: Sat, 16 Oct 2010 17:28:52 +0000 Subject: Fix for [#24292] When rendering with the stamp feature the scene opt. affects the seq. strip placement Fixed typo. --- source/blender/blenkernel/intern/image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index d750300291b..8ba7cde519d 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1161,7 +1161,7 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i } if (stamp_data.strip[0]) { - BLF_width_and_height(mono, stamp_data.scene, &w, &h); h= h_fixed; + BLF_width_and_height(mono, stamp_data.strip, &w, &h); h= h_fixed; /* Top right corner, with an extra space because blenfont is too strict! */ x= width - w - pad; -- cgit v1.2.3 From 28e144db920699a13e6cd196ac91f13e11b2877c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 16 Oct 2010 20:43:16 +0000 Subject: Fix #24139: Edge loop + Multi-Resolution modifier results weird artifacts - mdisp_corners used to return incorrect number of verts in some cases - fixed memory corruption when face changed vertex count in edit mode (forgot displacement for such faces atm, could be changed in the future) --- source/blender/blenkernel/intern/customdata.c | 34 ++++++++++++++++++++------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index f4db8e953f9..58cd08f1c4c 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -442,8 +442,15 @@ static void mdisps_bilinear(float out[3], float (*disps)[3], int st, float u, fl static int mdisp_corners(MDisps *s) { - /* silly trick because we don't get it from callback */ - return (s->totdisp % (3*3) == 0)? 3: 4; + int lvl= 13; + + while(lvl > 0) { + int side = (1 << (lvl-1)) + 1; + if ((s->totdisp % (side*side)) == 0) return s->totdisp / (side*side); + lvl--; + } + + return 0; } static void layerSwap_mdisps(void *data, const int *ci) @@ -452,19 +459,28 @@ static void layerSwap_mdisps(void *data, const int *ci) float (*d)[3] = NULL; int corners, cornersize, S; - /* this function is untested .. */ if(s->disps) { - corners = mdisp_corners(s); - cornersize = s->totdisp/corners; + int nverts= (ci[1] == 3) ? 4 : 3; /* silly way to know vertex count of face */ + corners= mdisp_corners(s); + cornersize= s->totdisp/corners; + + if(corners!=nverts) { + /* happens when face changed vertex count in edit mode + if it happened, just forgot displacement */ - d = MEM_callocN(sizeof(float) * 3 * s->totdisp, "mdisps swap"); + MEM_freeN(s->disps); + s->disps= NULL; + s->totdisp= 0; /* flag to update totdisp */ + return; + } + + d= MEM_callocN(sizeof(float) * 3 * s->totdisp, "mdisps swap"); for(S = 0; S < corners; S++) memcpy(d + cornersize*S, s->disps + cornersize*ci[S], cornersize*3*sizeof(float)); - if(s->disps) - MEM_freeN(s->disps); - s->disps = d; + MEM_freeN(s->disps); + s->disps= d; } } -- cgit v1.2.3 From 30b79ddcc6e2737add3a7ebd49b167c1776e4087 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Oct 2010 06:38:56 +0000 Subject: - fixed remaining unused warnings. - omit render code from this warning (cmake only), until render branch is merged. - moved -Wunused-parameter warning to apply to all C code in blender (not just ./source/blender), (cmake only). --- source/blender/CMakeLists.txt | 5 ---- source/blender/avi/intern/avirgb.c | 4 +++ source/blender/avi/intern/mjpeg.c | 9 ++++-- source/blender/avi/intern/options.c | 2 ++ source/blender/avi/intern/rgb32.c | 4 +++ source/blender/blenkernel/intern/BME_tools.c | 14 ++++----- source/blender/blenkernel/intern/CCGSubSurf.c | 19 ++++++++---- source/blender/blenkernel/intern/DerivedMesh.c | 2 ++ source/blender/blenkernel/intern/boids.c | 6 ++-- source/blender/blenkernel/intern/customdata.c | 16 +++++----- source/blender/blenkernel/intern/implicit.c | 6 ++-- source/blender/blenkernel/intern/nla.c | 2 +- source/blender/blenkernel/intern/particle.c | 6 ++-- source/blender/blenkernel/intern/seqeffects.c | 14 ++++----- source/blender/blenkernel/intern/softbody.c | 22 +++++++------- source/blender/blenkernel/intern/sound.c | 2 ++ source/blender/blenkernel/intern/subsurf_ccg.c | 8 ++--- source/blender/editors/animation/keyframes_edit.c | 34 +++++++++++----------- source/blender/editors/armature/meshlaplacian.c | 10 +++---- source/blender/editors/armature/reeb.c | 10 +++---- source/blender/editors/mesh/mesh_data.c | 1 - source/blender/editors/physics/particle_edit.c | 10 +++---- source/blender/editors/physics/physics_fluid.c | 2 +- source/blender/editors/sculpt_paint/paint_undo.c | 1 + source/blender/editors/sculpt_paint/sculpt.c | 8 +++++ source/blender/imbuf/intern/anim.c | 9 +++--- source/blender/imbuf/intern/bmp.c | 4 +++ source/blender/imbuf/intern/cineon/cineon_dpx.c | 2 ++ source/blender/imbuf/intern/cineon/cineonlib.c | 4 +++ source/blender/imbuf/intern/cineon/dpxlib.c | 9 +++++- source/blender/imbuf/intern/filetype.c | 2 +- source/blender/imbuf/intern/iris.c | 6 +++- source/blender/imbuf/intern/jp2.c | 2 ++ source/blender/imbuf/intern/jpeg.c | 2 ++ .../blender/imbuf/intern/openexr/openexr_multi.h | 23 ++++++++------- source/blender/imbuf/intern/radiance_hdr.c | 2 ++ source/blender/imbuf/intern/targa.c | 2 ++ source/blender/modifiers/intern/MOD_shapekey.c | 2 ++ source/blender/render/CMakeLists.txt | 3 ++ source/blender/render/intern/source/pipeline.c | 4 +-- source/blender/render/intern/source/pointdensity.c | 2 +- source/blender/render/intern/source/volumetric.c | 2 +- 42 files changed, 182 insertions(+), 115 deletions(-) (limited to 'source/blender') diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index 83f76e38fd3..7f4ed753956 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -24,11 +24,6 @@ # # ***** END GPL LICENSE BLOCK ***** -# TODO: remove this and uncommend the global arg, but for now adding here keeps it managable -IF(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-parameter") -ENDIF(CMAKE_COMPILER_IS_GNUCC) - ADD_SUBDIRECTORY(editors) ADD_SUBDIRECTORY(windowmanager) ADD_SUBDIRECTORY(blenkernel) diff --git a/source/blender/avi/intern/avirgb.c b/source/blender/avi/intern/avirgb.c index f7acbf238b5..c7d411b2fc6 100644 --- a/source/blender/avi/intern/avirgb.c +++ b/source/blender/avi/intern/avirgb.c @@ -51,6 +51,8 @@ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *bu unsigned char *buf; AviBitmapInfoHeader *bi; short bits= 32; + + (void)size; /* unused */ bi= (AviBitmapInfoHeader *) movie->streams[stream].sf; if (bi) bits= bi->BitCount; @@ -120,6 +122,8 @@ void *avi_converter_to_avi_rgb (AviMovie *movie, int stream, unsigned char *buff int y, x, i, rowstride; unsigned char *buf; + (void)stream; /* unused */ + *size= movie->header->Height * movie->header->Width * 3; if (movie->header->Width%2) *size+= movie->header->Height; diff --git a/source/blender/avi/intern/mjpeg.c b/source/blender/avi/intern/mjpeg.c index 56ba352dcf8..e8c96476fd1 100644 --- a/source/blender/avi/intern/mjpeg.c +++ b/source/blender/avi/intern/mjpeg.c @@ -144,6 +144,8 @@ static int Decode_JPEG(unsigned char *inBuffer, unsigned char *outBuffer, unsign unsigned int y; struct jpeg_decompress_struct dinfo; struct jpeg_error_mgr jerr; + + (void)width; /* unused */ numbytes= 0; @@ -324,7 +326,9 @@ static void check_and_compress_jpeg(int quality, unsigned char *outbuf, unsigned void *avi_converter_from_mjpeg (AviMovie *movie, int stream, unsigned char *buffer, int *size) { int deint; unsigned char *buf; - + + (void)stream; /* unused */ + buf= MEM_mallocN (movie->header->Height * movie->header->Width * 3, "avi.avi_converter_from_mjpeg 1"); deint= check_and_decode_jpeg(buffer, buf, movie->header->Width, movie->header->Height, *size); @@ -374,10 +378,11 @@ void *avi_converter_to_mjpeg (AviMovie *movie, int stream, unsigned char *buffer /* Compression from memory */ static void jpegmemdestmgr_init_destination(j_compress_ptr cinfo) { - ; + (void)cinfo; /* unused */ } static boolean jpegmemdestmgr_empty_output_buffer(j_compress_ptr cinfo) { + (void)cinfo; /* unused */ return TRUE; } diff --git a/source/blender/avi/intern/options.c b/source/blender/avi/intern/options.c index 15ec40ade8c..bec7060e118 100644 --- a/source/blender/avi/intern/options.c +++ b/source/blender/avi/intern/options.c @@ -41,6 +41,8 @@ AviError AVI_set_compress_option (AviMovie *movie, int option_type, int stream, AviOption option, void *opt_data) { int i; + (void)stream; /* unused */ + if (movie->header->TotalFrames != 0) /* Can't change params after we have already started writing frames */ return AVI_ERROR_OPTION; diff --git a/source/blender/avi/intern/rgb32.c b/source/blender/avi/intern/rgb32.c index 68e3ce4d1d2..f66f57924df 100644 --- a/source/blender/avi/intern/rgb32.c +++ b/source/blender/avi/intern/rgb32.c @@ -41,6 +41,8 @@ void *avi_converter_from_rgb32 (AviMovie *movie, int stream, unsigned char *buff int y, x, rowstridea, rowstrideb; unsigned char *buf; + (void)stream; /* unused */ + buf = MEM_mallocN (movie->header->Height * movie->header->Width * 3, "fromrgb32buf"); *size = movie->header->Height * movie->header->Width * 3; @@ -65,6 +67,8 @@ void *avi_converter_to_rgb32 (AviMovie *movie, int stream, unsigned char *buffer unsigned char *buf; unsigned char *to, *from; + (void)stream; /* unused */ + buf= MEM_mallocN (movie->header->Height * movie->header->Width * 4, "torgb32buf"); *size= movie->header->Height * movie->header->Width * 4; diff --git a/source/blender/blenkernel/intern/BME_tools.c b/source/blender/blenkernel/intern/BME_tools.c index e5a355e5f24..444bc10d562 100644 --- a/source/blender/blenkernel/intern/BME_tools.c +++ b/source/blender/blenkernel/intern/BME_tools.c @@ -107,7 +107,7 @@ float *BME_new_transdata_float(BME_TransData_Head *td) { return BLI_memarena_alloc(td->ma, sizeof(float)); } -static int BME_is_nonmanifold_vert(BME_Mesh *bm, BME_Vert *v) { +static int BME_is_nonmanifold_vert(BME_Mesh *UNUSED(bm), BME_Vert *v) { BME_Edge *e, *oe; BME_Loop *l; int len, count, flag; @@ -217,7 +217,7 @@ static void BME_data_interp_from_verts(BME_Mesh *bm, BME_Vert *v1, BME_Vert *v2, #endif -static void BME_data_facevert_edgesplit(BME_Mesh *bm, BME_Vert *v1, BME_Vert *v2, BME_Vert *v, BME_Edge *e1, float fac){ +static void BME_data_facevert_edgesplit(BME_Mesh *bm, BME_Vert *v1, BME_Vert *UNUSED(v2), BME_Vert *v, BME_Edge *e1, float fac){ void *src[2]; float w[2]; BME_Loop *l=NULL, *v1loop = NULL, *vloop = NULL, *v2loop = NULL; @@ -356,7 +356,7 @@ static int BME_bevel_get_vec(float *vec, BME_Vert *v1, BME_Vert *v2, BME_TransDa * vec2 is the direction of projection (pointing away from vec1) * up_vec is used for orientation (expected to be normalized) * returns the length of the projected vector that lies along vec1 */ -static float BME_bevel_project_vec(float *vec1, float *vec2, float *up_vec, int is_forward, BME_TransData_Head *td) { +static float BME_bevel_project_vec(float *vec1, float *vec2, float *up_vec, int is_forward, BME_TransData_Head *UNUSED(td)) { float factor, vec3[3], tmp[3],c1,c2; cross_v3_v3v3(tmp,vec1,vec2); @@ -582,7 +582,7 @@ static float BME_bevel_set_max(BME_Vert *v1, BME_Vert *v2, float value, BME_Tran return max; } -static BME_Vert *BME_bevel_wire(BME_Mesh *bm, BME_Vert *v, float value, int res, int options, BME_TransData_Head *td) { +static BME_Vert *BME_bevel_wire(BME_Mesh *bm, BME_Vert *v, float value, int res, int UNUSED(options), BME_TransData_Head *td) { BME_Vert *ov1, *ov2, *v1, *v2; ov1 = BME_edge_getothervert(v->edge, v); @@ -607,7 +607,7 @@ static BME_Vert *BME_bevel_wire(BME_Mesh *bm, BME_Vert *v, float value, int res, return v1; } -static BME_Loop *BME_bevel_edge(BME_Mesh *bm, BME_Loop *l, float value, int options, float *up_vec, BME_TransData_Head *td) { +static BME_Loop *BME_bevel_edge(BME_Mesh *bm, BME_Loop *l, float value, int UNUSED(options), float *up_vec, BME_TransData_Head *td) { BME_Vert *v1, *v2, *kv; BME_Loop *kl=NULL, *nl; BME_Edge *e; @@ -708,7 +708,7 @@ static BME_Loop *BME_bevel_edge(BME_Mesh *bm, BME_Loop *l, float value, int opti return l; } -static BME_Loop *BME_bevel_vert(BME_Mesh *bm, BME_Loop *l, float value, int options, float *up_vec, BME_TransData_Head *td) { +static BME_Loop *BME_bevel_vert(BME_Mesh *bm, BME_Loop *l, float value, int UNUSED(options), float *up_vec, BME_TransData_Head *td) { BME_Vert *v1, *v2; BME_Poly *f; @@ -859,7 +859,7 @@ static void BME_bevel_add_vweight(BME_TransData_Head *td, BME_Mesh *bm, BME_Vert } } -static float BME_bevel_get_angle(BME_Mesh *bm, BME_Edge *e, BME_Vert *v) { +static float BME_bevel_get_angle(BME_Mesh *UNUSED(bm), BME_Edge *e, BME_Vert *v) { BME_Vert *v1, *v2; BME_Loop *l1, *l2; float vec1[3], vec2[3], vec3[3], vec4[3]; diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index bbd68fb797b..1cd5ae381c4 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -15,6 +15,13 @@ #define CCG_INLINE inline #endif +/* copied from BKE_utildefines.h ugh */ +#ifdef __GNUC__ +# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__)) +#else +# define UNUSED(x) x +#endif + /* used for normalize_v3 in BLI_math_vector * float.h's FLT_EPSILON causes trouble with subsurf normals - campbell */ #define EPSILON (1.0e-35f) @@ -185,13 +192,13 @@ static int _ehashIterator_isStopped(EHashIterator *ehi) { /***/ -static void *_stdAllocator_alloc(CCGAllocatorHDL a, int numBytes) { +static void *_stdAllocator_alloc(CCGAllocatorHDL UNUSED(a), int numBytes) { return malloc(numBytes); } -static void *_stdAllocator_realloc(CCGAllocatorHDL a, void *ptr, int newSize, int oldSize) { +static void *_stdAllocator_realloc(CCGAllocatorHDL UNUSED(a), void *ptr, int newSize, int UNUSED(oldSize)) { return realloc(ptr, newSize); } -static void _stdAllocator_free(CCGAllocatorHDL a, void *ptr) { +static void _stdAllocator_free(CCGAllocatorHDL UNUSED(a), void *ptr) { free(ptr); } @@ -2601,7 +2608,7 @@ float ccgSubSurf_getEdgeCrease(CCGEdge *e) { /* Face accessors */ -CCGFaceHDL ccgSubSurf_getFaceFaceHandle(CCGSubSurf *ss, CCGFace *f) { +CCGFaceHDL ccgSubSurf_getFaceFaceHandle(CCGSubSurf *UNUSED(ss), CCGFace *f) { return f->fHDL; } int ccgSubSurf_getFaceAge(CCGSubSurf *ss, CCGFace *f) { @@ -2619,14 +2626,14 @@ void *ccgSubSurf_getFaceUserData(CCGSubSurf *ss, CCGFace *f) { int ccgSubSurf_getFaceNumVerts(CCGFace *f) { return f->numVerts; } -CCGVert *ccgSubSurf_getFaceVert(CCGSubSurf *ss, CCGFace *f, int index) { +CCGVert *ccgSubSurf_getFaceVert(CCGSubSurf *UNUSED(ss), CCGFace *f, int index) { if (index<0 || index>=f->numVerts) { return NULL; } else { return FACE_getVerts(f)[index]; } } -CCGEdge *ccgSubSurf_getFaceEdge(CCGSubSurf *ss, CCGFace *f, int index) { +CCGEdge *ccgSubSurf_getFaceEdge(CCGSubSurf *UNUSED(ss), CCGFace *f, int index) { if (index<0 || index>=f->numVerts) { return NULL; } else { diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index e70dde1474a..2e8922dec1b 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -633,6 +633,8 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm; EditFace *efa; int i, draw; + + (void)setMaterial; /* unused */ if (emdm->vertexCos) { EditVert *eve; diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index cfe16e089cf..943cf20720e 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -58,7 +58,7 @@ typedef struct BoidValues { static int apply_boid_rule(BoidBrainData *bbd, BoidRule *rule, BoidValues *val, ParticleData *pa, float fuzziness); -static int rule_none(BoidRule *rule, BoidBrainData *UNUSED(data), BoidValues *val, ParticleData *pa) +static int rule_none(BoidRule *UNUSED(rule), BoidBrainData *UNUSED(data), BoidValues *UNUSED(val), ParticleData *UNUSED(pa)) { return 0; } @@ -344,7 +344,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues * return ret; } -static int rule_separate(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, ParticleData *pa) +static int rule_separate(BoidRule *UNUSED(rule), BoidBrainData *bbd, BoidValues *val, ParticleData *pa) { KDTreeNearest *ptn = NULL; ParticleTarget *pt; @@ -384,7 +384,7 @@ static int rule_separate(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Pa } return ret; } -static int rule_flock(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, ParticleData *pa) +static int rule_flock(BoidRule *UNUSED(rule), BoidBrainData *bbd, BoidValues *UNUSED(val), ParticleData *pa) { KDTreeNearest ptn[11]; float vec[3] = {0.0f, 0.0f, 0.0f}, loc[3] = {0.0f, 0.0f, 0.0f}; diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 58cd08f1c4c..7f91df3b281 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -145,7 +145,7 @@ static void linklist_free_simple(void *link) } static void layerInterp_mdeformvert(void **sources, float *weights, - float *sub_weights, int count, void *dest) + float *UNUSED(sub_weights), int count, void *dest) { MDeformVert *dvert = dest; LinkNode *dest_dw = NULL; /* a list of lists of MDeformWeight pointers */ @@ -203,7 +203,7 @@ static void layerInterp_mdeformvert(void **sources, float *weights, static void layerInterp_msticky(void **sources, float *weights, - float *sub_weights, int count, void *dest) + float *UNUSED(sub_weights), int count, void *dest) { float co[2], w; MSticky *mst; @@ -484,8 +484,8 @@ static void layerSwap_mdisps(void *data, const int *ci) } } -static void layerInterp_mdisps(void **UNUSED(sources), float *weights, float *sub_weights, - int UNUSED(count), void *dest) +static void layerInterp_mdisps(void **UNUSED(sources), float *UNUSED(weights), + float *UNUSED(sub_weights), int UNUSED(count), void *dest) { MDisps *d = dest; int i; @@ -563,7 +563,7 @@ static void layerCopy_mdisps(const void *source, void *dest, int count) } } -static void layerFree_mdisps(void *data, int count, int size) +static void layerFree_mdisps(void *data, int count, int UNUSED(size)) { int i; MDisps *d = data; @@ -609,7 +609,7 @@ static int layerWrite_mdisps(CDataFile *cdf, void *data, int count) return 1; } -static size_t layerFilesize_mdisps(CDataFile *cdf, void *data, int count) +static size_t layerFilesize_mdisps(CDataFile *UNUSED(cdf), void *data, int count) { MDisps *d = data; size_t size = 0; @@ -2349,7 +2349,7 @@ static void customdata_external_filename(char filename[FILE_MAX], ID *id, Custom BLI_path_abs(filename, path); } -void CustomData_external_reload(CustomData *data, ID *id, CustomDataMask mask, int totelem) +void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask mask, int totelem) { CustomDataLayer *layer; const LayerTypeInfo *typeInfo; @@ -2519,7 +2519,7 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in cdf_free(cdf); } -void CustomData_external_add(CustomData *data, ID *id, int type, int UNUSED(totelem), const char *filename) +void CustomData_external_add(CustomData *data, ID *UNUSED(id), int type, int UNUSED(totelem), const char *filename) { CustomDataExternal *external= data->external; CustomDataLayer *layer; diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 9baaf7e5abc..e0077ec7d26 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -1218,7 +1218,7 @@ DO_INLINE void dfdx_damp(float to[3][3], float dir[3],float length,const float } -DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s, lfVector *lF, lfVector *X, lfVector *V, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, float time) +DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s, lfVector *UNUSED(lF), lfVector *X, lfVector *V, fmatrix3x3 *UNUSED(dFdV), fmatrix3x3 *UNUSED(dFdX), float time) { Cloth *cloth = clmd->clothObject; ClothVertex *verts = cloth->verts; @@ -1353,7 +1353,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s, } } -DO_INLINE void cloth_apply_spring_force(ClothModifierData *clmd, ClothSpring *s, lfVector *lF, lfVector *X, lfVector *V, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX) +DO_INLINE void cloth_apply_spring_force(ClothModifierData *UNUSED(clmd), ClothSpring *s, lfVector *lF, lfVector *UNUSED(X), lfVector *UNUSED(V), fmatrix3x3 *dFdV, fmatrix3x3 *dFdX) { if(s->flags & CLOTH_SPRING_FLAG_NEEDED) { @@ -1708,7 +1708,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec // printf("\n"); } -static void simulate_implicit_euler(lfVector *Vnew, lfVector *lX, lfVector *lV, lfVector *lF, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, float dt, fmatrix3x3 *A, lfVector *B, lfVector *dV, fmatrix3x3 *S, lfVector *z, lfVector *olddV, fmatrix3x3 *P, fmatrix3x3 *Pinv, fmatrix3x3 *M, fmatrix3x3 *bigI) +static void simulate_implicit_euler(lfVector *Vnew, lfVector *UNUSED(lX), lfVector *lV, lfVector *lF, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, float dt, fmatrix3x3 *A, lfVector *B, lfVector *dV, fmatrix3x3 *S, lfVector *z, lfVector *olddV, fmatrix3x3 *UNUSED(P), fmatrix3x3 *UNUSED(Pinv), fmatrix3x3 *M, fmatrix3x3 *UNUSED(bigI)) { unsigned int numverts = dFdV[0].vcount; diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 09ba967e265..67c3e746a63 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1585,7 +1585,7 @@ void BKE_nla_tweakmode_exit (AnimData *adt) /* Baking Tools ------------------------------------------- */ -void BKE_nla_bake (Scene *scene, ID *id, AnimData *adt, int UNUSED(flag)) +void BKE_nla_bake (Scene *scene, ID *UNUSED(id), AnimData *adt, int UNUSED(flag)) { /* verify that data is valid diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index f7345d6159a..624587338c9 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -1647,7 +1647,7 @@ int psys_particle_dm_face_lookup(Object *ob, DerivedMesh *dm, int index, float * return DMCACHE_NOTFOUND; } -static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache, float *fw, float foffset, int *mapindex, float *mapfw) +static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache, float *fw, float UNUSED(foffset), int *mapindex, float *mapfw) { if(index < 0) return 0; @@ -1803,7 +1803,7 @@ ParticleSystemModifierData *psys_get_modifier(Object *ob, ParticleSystem *psys) /* Particles on a shape */ /************************************************/ /* ready for future use */ -static void psys_particle_on_shape(int UNUSED(distr), int index, float *UNUSED(fuv), float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor) +static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float *UNUSED(fuv), float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor) { /* TODO */ float zerovec[3]={0.0f,0.0f,0.0f}; @@ -2185,7 +2185,7 @@ static void do_rough_end(float *loc, float mat[4][4], float t, float fac, float VECADDFAC(state->co,state->co,mat[0],rough[0]); VECADDFAC(state->co,state->co,mat[1],rough[1]); } -static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheKey *ca, int k, int steps, float *rootco, float effector, float dfra, float UNUSED(cfra), float *length, float *vec) +static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheKey *ca, int k, int steps, float *UNUSED(rootco), float effector, float UNUSED(dfra), float UNUSED(cfra), float *length, float *vec) { float force[3] = {0.0f,0.0f,0.0f}; ParticleKey eff_key; diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 7ce5dcc3884..6477c6b4f75 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -524,7 +524,7 @@ static void do_alphaover_effect_float(float facf0, float facf1, int x, int y, } static struct ImBuf * do_alphaover_effect( - Main *bmain, Scene *UNUSED(scene), Sequence *UNUSED(seq), float UNUSED(cfra), + Main *UNUSED(bmain), Scene *UNUSED(scene), Sequence *UNUSED(seq), float UNUSED(cfra), float facf0, float facf1, int x, int y, int UNUSED(preview_render_size), struct ImBuf *ibuf1, struct ImBuf *ibuf2, @@ -2633,7 +2633,7 @@ static void copy_glow_effect(Sequence *dst, Sequence *src) //void do_glow_effect(Cast *cast, float facf0, float facf1, int xo, int yo, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *outbuf, ImBuf *use) static void do_glow_effect_byte(Sequence *seq, float facf0, float UNUSED(facf1), int x, int y, char *rect1, - char *rect2, char *out) + char *UNUSED(rect2), char *out) { unsigned char *outbuf=(unsigned char *)out; unsigned char *inbuf=(unsigned char *)rect1; @@ -2648,7 +2648,7 @@ static void do_glow_effect_byte(Sequence *seq, float facf0, float UNUSED(facf1), static void do_glow_effect_float(Sequence *seq, float facf0, float UNUSED(facf1), int x, int y, - float *rect1, float *rect2, float *out) + float *rect1, float *UNUSED(rect2), float *out) { float *outbuf = out; float *inbuf = rect1; @@ -2822,8 +2822,8 @@ static struct ImBuf * do_multicam( Main *bmain, Scene *scene, Sequence *seq, float cfra, float UNUSED(facf0), float UNUSED(facf1), int x, int y, int preview_render_size, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3) + struct ImBuf *UNUSED(ibuf1), struct ImBuf *UNUSED(ibuf2), + struct ImBuf *UNUSED(ibuf3)) { struct ImBuf * i; struct ImBuf * out; @@ -2914,7 +2914,7 @@ static int early_out_speed(struct Sequence *UNUSED(seq), } static void store_icu_yrange_speed(struct Sequence * seq, - short adrcode, float * ymin, float * ymax) + short UNUSED(adrcode), float * ymin, float * ymax) { SpeedControlVars * v = (SpeedControlVars *)seq->effectdata; @@ -3091,7 +3091,7 @@ static int early_out_mul_input2(struct Sequence *UNUSED(seq), } static void store_icu_yrange_noop(struct Sequence * UNUSED(seq), - short adrcode, float * ymin, float * ymax) + short UNUSED(adrcode), float *UNUSED(ymin), float *UNUSED(ymax)) { /* defaults are fine */ } diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 58aa171e97b..978b3c9864f 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -678,7 +678,7 @@ static void add_mesh_quad_diag_springs(Object *ob) } } -static void add_2nd_order_roller(Object *ob,float stiffness,int *counter, int addsprings) +static void add_2nd_order_roller(Object *ob,float UNUSED(stiffness), int *counter, int addsprings) { /*assume we have a softbody*/ SoftBody *sb= ob->soft; /* is supposed to be there */ @@ -1029,7 +1029,7 @@ static int query_external_colliders(Scene *scene, Object *me) /* +++ the aabb "force" section*/ -static int sb_detect_aabb_collisionCached( float force[3], unsigned int par_layer,struct Object *vertexowner,float UNUSED(time)) +static int sb_detect_aabb_collisionCached( float UNUSED(force[3]), unsigned int UNUSED(par_layer),struct Object *vertexowner,float UNUSED(time)) { Object *ob; SoftBody *sb=vertexowner->soft; @@ -1094,7 +1094,7 @@ static int sb_detect_aabb_collisionCached( float force[3], unsigned int par_laye /* +++ the face external section*/ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp, - float force[3], unsigned int par_layer,struct Object *vertexowner,float time) + float force[3], unsigned int UNUSED(par_layer),struct Object *vertexowner,float time) { Object *ob; GHash *hash; @@ -1192,7 +1192,7 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp, - float force[3], unsigned int par_layer,struct Object *vertexowner,float time) + float force[3], unsigned int UNUSED(par_layer),struct Object *vertexowner,float time) { Object *ob; GHash *hash; @@ -1418,7 +1418,7 @@ static void scan_for_ext_face_forces(Object *ob,float timenow) /* +++ the spring external section*/ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],float *damp, - float force[3], unsigned int par_layer,struct Object *vertexowner,float time) + float force[3], unsigned int UNUSED(par_layer),struct Object *vertexowner,float time) { Object *ob; GHash *hash; @@ -1659,7 +1659,7 @@ static void *exec_scan_for_ext_spring_forces(void *data) return 0; } -static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,int totsprings,int *ptr_to_break_func()) +static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,int totsprings,int *UNUSED(ptr_to_break_func())) { ListBase *do_effector = NULL; ListBase threads; @@ -1749,7 +1749,7 @@ static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,fl static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], float *damp, - float force[3], unsigned int par_layer,struct Object *vertexowner, + float force[3], unsigned int UNUSED(par_layer), struct Object *vertexowner, float time,float vel[3], float *intrusion) { Object *ob= NULL; @@ -2084,7 +2084,7 @@ static void dfdv_goal(int ia, int ic,float factor) for(i=0;i<3;i++) nlMatrixAdd(ia+i,ic+i,factor); } */ -static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags) +static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float UNUSED(forcetime), int nl_flags) { SoftBody *sb= ob->soft; /* is supposed to be there */ BodyPoint *bp1,*bp2; @@ -2175,7 +2175,7 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float fo /* since this is definitely the most CPU consuming task here .. try to spread it */ /* core function _softbody_calc_forces_slice_in_a_thread */ /* result is int to be able to flag user break */ -static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, float forcetime, float timenow,int ifirst,int ilast,int *ptr_to_break_func(),ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor) +static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, float forcetime, float timenow,int ifirst,int ilast,int *UNUSED(ptr_to_break_func()),ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor) { float iks; int bb,do_selfcollision,do_springcollision,do_aero; @@ -2386,7 +2386,7 @@ static void *exec_softbody_calc_forces(void *data) return 0; } -static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float timenow,int totpoint,int *ptr_to_break_func(),struct ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor) +static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float timenow,int totpoint,int *UNUSED(ptr_to_break_func()),struct ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor) { ListBase threads; SB_thread_context *sb_threads; @@ -2444,7 +2444,7 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t MEM_freeN(sb_threads); } -static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, float timenow, int nl_flags) +static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, float timenow, int UNUSED(nl_flags)) { /* rule we never alter free variables :bp->vec bp->pos in here ! * this will ruin adaptive stepsize AKA heun! (BM) diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index ca1fd80b406..b2e5209a4fc 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -110,6 +110,8 @@ void sound_init(struct Main *bmain) #ifdef WITH_JACK AUD_setSyncCallback(sound_sync_callback, bmain); +#else + (void)bmain; /* unused */ #endif } diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 6323e1e3c79..26bd981db4a 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -83,13 +83,13 @@ static void *arena_realloc(CCGAllocatorHDL a, void *ptr, int newSize, int oldSiz } return p2; } -static void arena_free(CCGAllocatorHDL a, void *ptr) { +static void arena_free(CCGAllocatorHDL UNUSED(a), void *UNUSED(ptr)) { } static void arena_release(CCGAllocatorHDL a) { BLI_memarena_free(a); } -static CCGSubSurf *_getSubSurf(CCGSubSurf *prevSS, int subdivLevels, int useAging, int useArena, int useFlatSubdiv) { +static CCGSubSurf *_getSubSurf(CCGSubSurf *prevSS, int subdivLevels, int useAging, int useArena, int UNUSED(useFlatSubdiv)) { CCGMeshIFC ifc; CCGSubSurf *ccgSS; @@ -1146,7 +1146,7 @@ static void ccgDM_drawVerts(DerivedMesh *dm) { ccgFaceIterator_free(fi); glEnd(); } -static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges) { +static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int UNUSED(drawAllEdges)) { CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm; CCGSubSurf *ss = ccgdm->ss; CCGEdgeIterator *ei = ccgSubSurf_getEdgeIterator(ss); @@ -1514,7 +1514,7 @@ static void ccgDM_drawFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *a dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL); } -static void ccgDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned char *col1, unsigned char *col2) { +static void ccgDM_drawFacesColored(DerivedMesh *dm, int UNUSED(useTwoSided), unsigned char *col1, unsigned char *col2) { CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm; CCGSubSurf *ss = ccgdm->ss; CCGFaceIterator *fi = ccgSubSurf_getFaceIterator(ss); diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index 590d609ce02..0958b4870b5 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -541,7 +541,7 @@ static short ok_bezier_framerange(KeyframeEditData *ked, BezTriple *bezt) return ok; } -static short ok_bezier_selected(KeyframeEditData *ked, BezTriple *bezt) +static short ok_bezier_selected(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { /* this macro checks all beztriple handles for selection... * only one of the verts has to be selected for this to be ok... @@ -677,7 +677,7 @@ void bezt_remap_times(KeyframeEditData *ked, BezTriple *bezt) /* Transform */ /* snaps the keyframe to the nearest frame */ -static short snap_bezier_nearest(KeyframeEditData *ked, BezTriple *bezt) +static short snap_bezier_nearest(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if (bezt->f2 & SELECT) bezt->vec[1][0]= (float)(floor(bezt->vec[1][0]+0.5)); @@ -713,7 +713,7 @@ static short snap_bezier_nearmarker(KeyframeEditData *ked, BezTriple *bezt) } /* make the handles have the same value as the key */ -static short snap_bezier_horizontal(KeyframeEditData *ked, BezTriple *bezt) +static short snap_bezier_horizontal(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if (bezt->f2 & SELECT) { bezt->vec[0][1]= bezt->vec[2][1]= bezt->vec[1][1]; @@ -768,7 +768,7 @@ static short mirror_bezier_cframe(KeyframeEditData *ked, BezTriple *bezt) return 0; } -static short mirror_bezier_yaxis(KeyframeEditData *ked, BezTriple *bezt) +static short mirror_bezier_yaxis(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { float diff; @@ -780,7 +780,7 @@ static short mirror_bezier_yaxis(KeyframeEditData *ked, BezTriple *bezt) return 0; } -static short mirror_bezier_xaxis(KeyframeEditData *ked, BezTriple *bezt) +static short mirror_bezier_xaxis(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { float diff; @@ -841,7 +841,7 @@ KeyframeEditFunc ANIM_editkeyframes_mirror(short type) /* Settings */ /* Sets the selected bezier handles to type 'auto' */ -static short set_bezier_auto(KeyframeEditData *ked, BezTriple *bezt) +static short set_bezier_auto(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) { if (bezt->f1 & SELECT) bezt->h1= HD_AUTO; /* the secret code for auto */ @@ -859,7 +859,7 @@ static short set_bezier_auto(KeyframeEditData *ked, BezTriple *bezt) } /* Sets the selected bezier handles to type 'vector' */ -static short set_bezier_vector(KeyframeEditData *ked, BezTriple *bezt) +static short set_bezier_vector(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if ((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) { if (bezt->f1 & SELECT) bezt->h1= HD_VECT; @@ -879,7 +879,7 @@ static short set_bezier_vector(KeyframeEditData *ked, BezTriple *bezt) /* Queries if the handle should be set to 'free' or 'align' */ // NOTE: this was used for the 'toggle free/align' option // currently this isn't used, but may be restored later -static short bezier_isfree(KeyframeEditData *ked, BezTriple *bezt) +static short bezier_isfree(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if ((bezt->f1 & SELECT) && (bezt->h1)) return 1; if ((bezt->f3 & SELECT) && (bezt->h2)) return 1; @@ -887,7 +887,7 @@ static short bezier_isfree(KeyframeEditData *ked, BezTriple *bezt) } /* Sets selected bezier handles to type 'align' */ -static short set_bezier_align(KeyframeEditData *ked, BezTriple *bezt) +static short set_bezier_align(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if (bezt->f1 & SELECT) bezt->h1= HD_ALIGN; if (bezt->f3 & SELECT) bezt->h2= HD_ALIGN; @@ -895,7 +895,7 @@ static short set_bezier_align(KeyframeEditData *ked, BezTriple *bezt) } /* Sets selected bezier handles to type 'free' */ -static short set_bezier_free(KeyframeEditData *ked, BezTriple *bezt) +static short set_bezier_free(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if (bezt->f1 & SELECT) bezt->h1= HD_FREE; if (bezt->f3 & SELECT) bezt->h2= HD_FREE; @@ -925,21 +925,21 @@ KeyframeEditFunc ANIM_editkeyframes_handles(short code) /* ------- */ -static short set_bezt_constant(KeyframeEditData *ked, BezTriple *bezt) +static short set_bezt_constant(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if (bezt->f2 & SELECT) bezt->ipo= BEZT_IPO_CONST; return 0; } -static short set_bezt_linear(KeyframeEditData *ked, BezTriple *bezt) +static short set_bezt_linear(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if (bezt->f2 & SELECT) bezt->ipo= BEZT_IPO_LIN; return 0; } -static short set_bezt_bezier(KeyframeEditData *ked, BezTriple *bezt) +static short set_bezt_bezier(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if (bezt->f2 & SELECT) bezt->ipo= BEZT_IPO_BEZ; @@ -962,21 +962,21 @@ KeyframeEditFunc ANIM_editkeyframes_ipo(short code) /* ------- */ -static short set_keytype_keyframe(KeyframeEditData *ked, BezTriple *bezt) +static short set_keytype_keyframe(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if (bezt->f2 & SELECT) BEZKEYTYPE(bezt)= BEZT_KEYTYPE_KEYFRAME; return 0; } -static short set_keytype_breakdown(KeyframeEditData *ked, BezTriple *bezt) +static short set_keytype_breakdown(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if (bezt->f2 & SELECT) BEZKEYTYPE(bezt)= BEZT_KEYTYPE_BREAKDOWN; return 0; } -static short set_keytype_extreme(KeyframeEditData *ked, BezTriple *bezt) +static short set_keytype_extreme(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { if (bezt->f2 & SELECT) BEZKEYTYPE(bezt)= BEZT_KEYTYPE_EXTREME; @@ -1038,7 +1038,7 @@ static short select_bezier_subtract(KeyframeEditData *ked, BezTriple *bezt) return 0; } -static short select_bezier_invert(KeyframeEditData *ked, BezTriple *bezt) +static short select_bezier_invert(KeyframeEditData *UNUSED(ked), BezTriple *bezt) { /* Invert the selection for the whole bezier triple */ bezt->f2 ^= SELECT; diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 10627f95aa7..f193defc129 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -61,7 +61,7 @@ /* ************* XXX *************** */ -static void waitcursor(int val) {} +static void waitcursor(int UNUSED(val)) {} static void progress_bar(int UNUSED(dummy_val), const char *UNUSED(dummy)) {} static void start_progress_bar() {} static void end_progress_bar() {} @@ -398,7 +398,7 @@ typedef struct BVHCallbackUserData { LaplacianSystem *sys; } BVHCallbackUserData; -static void bvh_callback(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) +static void bvh_callback(void *userdata, int index, const BVHTreeRay *UNUSED(ray), BVHTreeRayHit *hit) { BVHCallbackUserData *data = (struct BVHCallbackUserData*)userdata; MFace *mf = data->sys->heat.mface + index; @@ -1401,7 +1401,7 @@ static void meshdeform_bind_floodfill(MeshDeformBind *mdb) MEM_freeN(stack); } -static float meshdeform_boundary_phi(MeshDeformBind *mdb, MDefBoundIsect *isect, int cagevert) +static float meshdeform_boundary_phi(MeshDeformBind *UNUSED(mdb), MDefBoundIsect *isect, int cagevert) { int a; @@ -1412,7 +1412,7 @@ static float meshdeform_boundary_phi(MeshDeformBind *mdb, MDefBoundIsect *isect, return 0.0f; } -static float meshdeform_interp_w(MeshDeformBind *mdb, float *gridvec, float *vec, int cagevert) +static float meshdeform_interp_w(MeshDeformBind *mdb, float *gridvec, float *UNUSED(vec), int UNUSED(cagevert)) { float dvec[3], ivec[3], wx, wy, wz, result=0.0f; float weight, totweight= 0.0f; @@ -1563,7 +1563,7 @@ static void meshdeform_matrix_add_semibound_phi(MeshDeformBind *mdb, int x, int } } -static void meshdeform_matrix_add_exterior_phi(MeshDeformBind *mdb, int x, int y, int z, int cagevert) +static void meshdeform_matrix_add_exterior_phi(MeshDeformBind *mdb, int x, int y, int z, int UNUSED(cagevert)) { float phi, totweight; int i, a, acenter; diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 32362afca2b..5af1658a83f 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -442,7 +442,7 @@ void flipArc(ReebArc *arc) } #ifdef DEBUG_REEB_NODE -void NodeDegreeDecrement(ReebGraph *rg, ReebNode *node) +void NodeDegreeDecrement(ReebGraph *UNUSED(rg), ReebNode *node) { node->degree--; @@ -452,7 +452,7 @@ void NodeDegreeDecrement(ReebGraph *rg, ReebNode *node) // } } -void NodeDegreeIncrement(ReebGraph *rg, ReebNode *node) +void NodeDegreeIncrement(ReebGraph *UNUSED(rg), ReebNode *node) { // if (node->degree == 0) // { @@ -523,7 +523,7 @@ void verifyNodeDegree(ReebGraph *rg) #endif } -void verifyBucketsArc(ReebGraph *rg, ReebArc *arc) +void verifyBucketsArc(ReebGraph *UNUSED(rg), ReebArc *arc) { ReebNode *head = (ReebNode*)arc->head; ReebNode *tail = (ReebNode*)arc->tail; @@ -1723,7 +1723,7 @@ int filterCyclesReebGraph(ReebGraph *rg, float UNUSED(distance_threshold)) return filtered; } -int filterSmartReebGraph(ReebGraph *rg, float UNUSED(threshold)) +int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold)) { int value = 0; #if 0 //XXX @@ -2180,7 +2180,7 @@ void addFacetoArc(ReebArc *arc, EditFace *efa) BLI_ghash_insert(arc->faces, efa, efa); } -void mergeArcFaces(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc) +void mergeArcFaces(ReebGraph *UNUSED(rg), ReebArc *aDst, ReebArc *aSrc) { GHashIterator ghi; diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 03f2bb42b51..080151a8dca 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -288,7 +288,6 @@ static int layers_poll(bContext *C) static int uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op)) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Mesh *me= ob->data; diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 796314ba2e3..57867fdc441 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -1125,7 +1125,7 @@ static void update_world_cos(Object *ob, PTCacheEdit *edit) } } } -static void update_velocities(Object *ob, PTCacheEdit *edit) +static void update_velocities(PTCacheEdit *edit) { /*TODO: get frs_sec properly */ float vec1[3], vec2[3], frs_sec, dfra; @@ -1208,7 +1208,7 @@ void PE_update_object(Scene *scene, Object *ob, int useflag) if(edit->psys) update_world_cos(ob, edit); if(pset->flag & PE_AUTO_VELOCITY) - update_velocities(ob, edit); + update_velocities(edit); PE_hide_keys_time(scene, edit, CFRA); /* regenerate path caches */ @@ -1243,7 +1243,7 @@ static void select_key(PEData *data, int point_index, int key_index) point->flag |= PEP_EDIT_RECALC; } -static void select_keys(PEData *data, int point_index, int key_index) +static void select_keys(PEData *data, int point_index, int UNUSED(key_index)) { PTCacheEdit *edit = data->edit; PTCacheEditPoint *point = edit->points + point_index; @@ -3034,7 +3034,7 @@ static void brush_puff(PEData *data, int point_index) } -static void brush_weight(PEData *data, float UNUSED(mat[][4]), float imat[][4], int point_index, int key_index, PTCacheEditKey *key) +static void brush_weight(PEData *data, float UNUSED(mat[][4]), float UNUSED(imat[][4]), int point_index, int key_index, PTCacheEditKey *UNUSED(key)) { /* roots have full weight allways */ if(key_index) { @@ -3048,7 +3048,7 @@ static void brush_weight(PEData *data, float UNUSED(mat[][4]), float imat[][4], } } -static void brush_smooth_get(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key) +static void brush_smooth_get(PEData *data, float mat[][4], float UNUSED(imat[][4]), int UNUSED(point_index), int key_index, PTCacheEditKey *key) { if(key_index) { float dvec[3]; diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index e4934269173..6dc4684d815 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -342,7 +342,7 @@ static void free_all_fluidobject_channels(ListBase *fobjects) } } -static void fluid_init_all_channels(bContext *C, Object *fsDomain, FluidsimSettings *domainSettings, FluidAnimChannels *channels, ListBase *fobjects) +static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), FluidsimSettings *domainSettings, FluidAnimChannels *channels, ListBase *fobjects) { Scene *scene = CTX_data_scene(C); Base *base; diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c index c21bbadc242..643e2cd6915 100644 --- a/source/blender/editors/sculpt_paint/paint_undo.c +++ b/source/blender/editors/sculpt_paint/paint_undo.c @@ -31,6 +31,7 @@ #include "BLI_listbase.h" +#include "BKE_utildefines.h" #include "BKE_context.h" #include "BKE_global.h" diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index a3252ca7621..505e37d95f6 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -867,6 +867,8 @@ static void calc_area_normal(Sculpt *sd, SculptSession *ss, float an[3], PBVHNod float out_flip[3] = {0.0f, 0.0f, 0.0f}; + (void)sd; /* unused w/o openmp */ + zero_v3(an); #pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP) @@ -1667,6 +1669,8 @@ static void calc_flatten_center(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, float count = 0; + (void)sd; /* unused w/o openmp */ + zero_v3(fc); #pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP) @@ -1721,6 +1725,8 @@ static void calc_area_normal_and_flatten_center(Sculpt *sd, SculptSession *ss, P // fc float count = 0; + (void)sd; /* unused w/o openmp */ + // an zero_v3(an); @@ -2536,6 +2542,8 @@ static void sculpt_combine_proxies(Sculpt *sd, SculptSession *ss) calculate multiple modifications to the mesh when symmetry is enabled. */ static void calc_brushdata_symm(Sculpt *sd, StrokeCache *cache, const char symm, const char axis, const float angle, const float UNUSED(feather)) { + (void)sd; /* unused */ + flip_coord(cache->location, cache->true_location, symm); flip_coord(cache->grab_delta_symmetry, cache->grab_delta, symm); flip_coord(cache->view_normal, cache->true_view_normal, symm); diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c index 57d65bc6761..8df0d69bcfa 100644 --- a/source/blender/imbuf/intern/anim.c +++ b/source/blender/imbuf/intern/anim.c @@ -63,6 +63,7 @@ #include "MEM_guardedalloc.h" #include "DNA_userdef_types.h" +#include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_depsgraph.h" @@ -214,14 +215,14 @@ int ismovie(char *name) { #else -int ismovie(char *name) { +int ismovie(char *UNUSED(name)) { return 0; } /* never called, just keep the linker happy */ -static int startmovie(struct anim * anim) { return 1; } -static ImBuf * movie_fetchibuf(struct anim * anim, int position) { return NULL; } -static void free_anim_movie(struct anim * anim) { ; } +static int startmovie(struct anim *UNUSED(anim)) { return 1; } +static ImBuf * movie_fetchibuf(struct anim *UNUSED(anim), int UNUSED(position)) { return NULL; } +static void free_anim_movie(struct anim *UNUSED(anim)) { ; } #endif diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c index 4c7cf669d18..10dc23b1ad2 100644 --- a/source/blender/imbuf/intern/bmp.c +++ b/source/blender/imbuf/intern/bmp.c @@ -108,6 +108,8 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags) int x, y, depth, skip, i; unsigned char *bmp, *rect; unsigned short col; + + (void)size; /* unused */ if (checkbmp(mem) == 0) return(0); @@ -199,6 +201,8 @@ int imb_savebmp(struct ImBuf *ibuf, char *name, int flags) { int bytesize, extrabytes, x, y, t, ptr; uchar *data; FILE *ofile; + + (void)flags; /* unused */ extrabytes = (4 - ibuf->x*3 % 4) % 4; bytesize = (ibuf->x * 3 + extrabytes) * ibuf->y; diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c index 0eee1bd082a..7a5a3fb011b 100644 --- a/source/blender/imbuf/intern/cineon/cineon_dpx.c +++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c @@ -125,6 +125,8 @@ static int imb_save_dpx_cineon(ImBuf *buf, char *filename, int use_cineon, int f int i, j; int index; float *fline; + + (void)flags; /* unused */ cineon_conversion_parameters(&conversion); diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c index 9c9156a4dd9..a2a0fae526d 100644 --- a/source/blender/imbuf/intern/cineon/cineonlib.c +++ b/source/blender/imbuf/intern/cineon/cineonlib.c @@ -185,6 +185,8 @@ dumpCineonImageInfo(CineonImageInformation* imageInfo) { static void fillCineonFormatInfo(CineonFile* cineon, CineonFormatInformation* formatInfo) { + (void)cineon; /* unused */ + formatInfo->interleave = 0; formatInfo->packing = 5; formatInfo->signage = 0; @@ -238,6 +240,8 @@ dumpCineonFormatInfo(CineonFormatInformation* formatInfo) { static void fillCineonOriginationInfo(CineonFile* cineon, CineonOriginationInformation* originInfo, CineonFileInformation* fileInfo) { + + (void)cineon; /* unused */ originInfo->x_offset = htonl(0); originInfo->y_offset = htonl(0); diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c index 365d56939ed..ade69b4d7c0 100644 --- a/source/blender/imbuf/intern/cineon/dpxlib.c +++ b/source/blender/imbuf/intern/cineon/dpxlib.c @@ -39,6 +39,8 @@ static void fillDpxChannelInfo(DpxFile* dpx, DpxChannelInformation* chan, int des) { + (void)dpx; /* unused */ + chan->signage = 0; chan->ref_low_data = htonl(0); chan->ref_low_quantity = htonf(0.0); @@ -160,7 +162,12 @@ dumpDpxImageInfo(DpxImageInformation* imageInfo) { static void fillDpxOriginationInfo( - DpxFile* dpx, DpxOriginationInformation* originInfo, DpxFileInformation* fileInfo) { + DpxFile* dpx, DpxOriginationInformation* originInfo, DpxFileInformation* fileInfo) +{ + /* unused */ + (void)dpx; + (void)originInfo; + (void)fileInfo; } static void diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c index fb5d2f2e4d7..0702fbe3907 100644 --- a/source/blender/imbuf/intern/filetype.c +++ b/source/blender/imbuf/intern/filetype.c @@ -45,7 +45,7 @@ static int imb_ftype_default(ImFileType *type, ImBuf *ibuf) { return (ibuf->ftyp #if defined(__APPLE__) && defined(IMBUF_COCOA) static int imb_ftype_cocoa(ImFileType *type, ImBuf *ibuf) { return (ibuf->ftype & TIF); } #endif -static int imb_ftype_iris(ImFileType *type, ImBuf *ibuf) { return (ibuf->ftype == IMAGIC); } +static int imb_ftype_iris(ImFileType *type, ImBuf *ibuf) { (void)type; return (ibuf->ftype == IMAGIC); } #ifdef WITH_QUICKTIME static int imb_ftype_quicktime(ImFileType *type, ImBuf *ibuf) { return 0; } // XXX #endif diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c index 9037285a1c5..71ba9b06cad 100644 --- a/source/blender/imbuf/intern/iris.c +++ b/source/blender/imbuf/intern/iris.c @@ -123,7 +123,8 @@ static int file_offset; static unsigned short getshort(FILE *inf) { unsigned char * buf; - + (void)inf; /* unused */ + buf = file_data + file_offset; file_offset += 2; @@ -133,6 +134,7 @@ static unsigned short getshort(FILE *inf) static unsigned int getlong(FILE *inf) { unsigned char * buf; + (void)inf; /* unused */ buf = file_data + file_offset; file_offset += 4; @@ -258,6 +260,8 @@ struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags) int bpp, rle, cur, badorder; ImBuf * ibuf; + (void)size; /* unused */ + if(!imb_is_a_iris(mem)) return NULL; /*printf("new iris\n");*/ diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index 5e7ef199500..0403d0044f5 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -670,6 +670,8 @@ int imb_savejp2(struct ImBuf *ibuf, char *name, int flags) { opj_event_mgr_t event_mgr; /* event manager */ opj_image_t *image = NULL; + (void)flags; /* unused */ + /* configure the event callbacks (not required) setting of each callback is optionnal diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index e020a5fa8fd..e7737e68fce 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -132,6 +132,7 @@ typedef my_source_mgr * my_src_ptr; static void init_source(j_decompress_ptr cinfo) { + (void)cinfo; /* unused */ } @@ -165,6 +166,7 @@ static void skip_input_data(j_decompress_ptr cinfo, long num_bytes) static void term_source(j_decompress_ptr cinfo) { + (void)cinfo; /* unused */ } static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t size) diff --git a/source/blender/imbuf/intern/openexr/openexr_multi.h b/source/blender/imbuf/intern/openexr/openexr_multi.h index 3f80e5577a8..e96b52e121d 100644 --- a/source/blender/imbuf/intern/openexr/openexr_multi.h +++ b/source/blender/imbuf/intern/openexr/openexr_multi.h @@ -67,24 +67,27 @@ void IMB_exr_close (void *handle); /* ugly... but we only use it on pipeline.c, render module, now */ void * IMB_exr_get_handle (void) {return NULL;} -void IMB_exr_add_channel (void *handle, const char *layname, const char *channame, int xstride, int ystride, float *rect) {} +void IMB_exr_add_channel (void *handle, const char *layname, const char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; } -int IMB_exr_begin_read (void *handle, char *filename, int *width, int *height) {return 0;} +int IMB_exr_begin_read (void *handle, char *filename, int *width, int *height) { (void)handle; (void)filename; (void)width; (void)height; return 0;} void IMB_exr_begin_write (void *handle, char *filename, int width, int height, int compress) { (void)handle; (void)filename; (void)width; (void)height; (void)compress; } -void IMB_exrtile_begin_write (void *handle, char *filename, int mipmap, int width, int height, int tilex, int tiley) {} +void IMB_exrtile_begin_write (void *handle, char *filename, int mipmap, int width, int height, int tilex, int tiley) { (void)handle; (void)filename; (void)mipmap; (void)width; (void)height; (void)tilex; (void)tiley; } -void IMB_exr_set_channel (void *handle, char *layname, char *channame, int xstride, int ystride, float *rect) {} +void IMB_exr_set_channel (void *handle, char *layname, char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; } -void IMB_exr_read_channels (void *handle) {} -void IMB_exr_write_channels (void *handle) {} -void IMB_exrtile_write_channels (void *handle, int partx, int party, int level) {} -void IMB_exrtile_clear_channels (void *handle) {} +void IMB_exr_read_channels (void *handle) { (void)handle; } +void IMB_exr_write_channels (void *handle) { (void)handle; } +void IMB_exrtile_write_channels (void *handle, int partx, int party, int level) { (void)handle; (void)partx; (void)party; (void)level; } +void IMB_exrtile_clear_channels (void *handle) { (void)handle; } void IMB_exr_multilayer_convert (void *handle, void *base, void * (*addlayer)(void *base, char *str), - void (*addpass)(void *base, void *lay, char *str, float *rect, int totchan, char *chan_id)) {} + void (*addpass)(void *base, void *lay, char *str, float *rect, int totchan, char *chan_id)) + { + (void)handle; (void)base; (void)addlayer; (void)addpass; + } -void IMB_exr_close (void *handle) {} +void IMB_exr_close (void *handle) { (void)handle; } #endif diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index 385124cd717..b356f56ab74 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -340,6 +340,8 @@ int imb_savehdr(struct ImBuf *ibuf, char *name, int flags) int y, width=ibuf->x, height=ibuf->y; unsigned char *cp= NULL; + (void)flags; /* unused */ + if (file==NULL) return 0; writeHeader(file, width, height); diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index e50e445034e..89a69242a46 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -238,6 +238,8 @@ int imb_savetarga(struct ImBuf * ibuf, char *name, int flags) char buf[20]; FILE *fildes; short ok = 0; + + (void)flags; /* unused */ if (ibuf == 0) return (0); if (ibuf->rect == 0) return (0); diff --git a/source/blender/modifiers/intern/MOD_shapekey.c b/source/blender/modifiers/intern/MOD_shapekey.c index ff2f7c5e3b7..a43e19a5fc1 100644 --- a/source/blender/modifiers/intern/MOD_shapekey.c +++ b/source/blender/modifiers/intern/MOD_shapekey.c @@ -85,6 +85,8 @@ static void deformMatricesEM(ModifierData *UNUSED(md), Object *ob, KeyBlock *kb= ob_get_keyblock(ob); float scale[3][3]; int a; + + (void)vertexCos; /* unused */ if(kb && kb->totelem==numVerts && kb!=key->refkey) { scale_m3_fl(scale, kb->curval); diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt index 8e0dbb457e8..e6478098dad 100644 --- a/source/blender/render/CMakeLists.txt +++ b/source/blender/render/CMakeLists.txt @@ -24,6 +24,9 @@ # # ***** END GPL LICENSE BLOCK ***** +# remove warning until render branch merged. +STRING(REGEX REPLACE "-Wunused-parameter" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) + FILE(GLOB SRC intern/source/*.c intern/raytrace/*.cpp) SET(INC diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index ed390fe102a..a2f08d96251 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -861,7 +861,7 @@ static void *ml_addlayer_cb(void *base, char *str) BLI_strncpy(rl->name, str, EXR_LAY_MAXNAME); return rl; } -static void ml_addpass_cb(void *base, void *lay, char *str, float *rect, int totchan, char *chan_id) +static void ml_addpass_cb(void *UNUSED(base), void *lay, char *str, float *rect, int totchan, char *chan_id) { RenderLayer *rl= lay; RenderPass *rpass= MEM_callocN(sizeof(RenderPass), "loaded pass"); @@ -2677,7 +2677,7 @@ static int is_rendering_allowed(Render *re) return 1; } -static void update_physics_cache(Render *re, Scene *scene, int anim_init) +static void update_physics_cache(Render *re, Scene *scene, int UNUSED(anim_init)) { PTCacheBaker baker; diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 1ca1ea10273..d8156594085 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -253,7 +253,7 @@ static void cache_pointdensity(Render *re, Tex *tex) } } -static void free_pointdensity(Render *re, Tex *tex) +static void free_pointdensity(Render *UNUSED(re), Tex *tex) { PointDensity *pd = tex->pd; diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index d15ea0c792c..f3f31bf6b43 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -358,7 +358,7 @@ void vol_get_sigma_t(ShadeInput *shi, float *sigma_t, float *co) /* phase function - determines in which directions the light * is scattered in the volume relative to incoming direction * and view direction */ -float vol_get_phasefunc(ShadeInput *shi, float g, float *w, float *wp) +float vol_get_phasefunc(ShadeInput *UNUSED(shi), float g, float *w, float *wp) { const float normalize = 0.25f; // = 1.f/4.f = M_PI/(4.f*M_PI) -- cgit v1.2.3 From 7d10ad012d9307cc9db0f91111a14376790f1536 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Oct 2010 08:59:23 +0000 Subject: fix for bad use of UNUSED() with win32 & some other minor error checks. --- source/blender/editors/interface/interface_widgets.c | 7 +++++++ source/blender/render/intern/source/texture.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 7e15f9b1f74..ed7284bf264 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "DNA_screen_types.h" @@ -1773,6 +1774,12 @@ void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha) VECCOPY(col1[1], col1[2]); VECCOPY(col1[3], col1[2]); break; + default: + assert(!"invalid 'type' argument"); + hsv_to_rgb(1.0, 1.0, 1.0, &col1[2][0], &col1[2][1], &col1[2][2]); + VECCOPY(col1[0], col1[2]); + VECCOPY(col1[1], col1[2]); + VECCOPY(col1[3], col1[2]); } /* old below */ diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index be2c83a7edf..cdac27f352a 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -771,7 +771,7 @@ static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex if (pit->version < 6) { texres->tin = pit->result[0]; } else { - texres->tin = result[0]; + texres->tin = result[0]; /* XXX, assigning garbage value, fixme! */ } if(rgbnor & TEX_NOR) { -- cgit v1.2.3 From 856389eac7705b857ba50f0c3e3ee9d08639177e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Oct 2010 09:01:12 +0000 Subject: re-arrange icon_draw_rect, also use an assert() for odd icon sizes. this can happen in some cases but hard to find when. --- source/blender/editors/interface/interface_icons.c | 58 ++++++++-------------- 1 file changed, 22 insertions(+), 36 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 6d1a72fcd1a..39e062a13aa 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -28,6 +28,7 @@ #include #include #include +#include #ifndef WIN32 #include @@ -845,6 +846,15 @@ static void icon_set_image(bContext *C, ID *id, PreviewImage* prv_img, int miple static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh, unsigned int *rect, float alpha, float *rgb, short is_preview) { + ImBuf *ima= NULL; + + /* sanity check */ + if(w<=0 || h<=0 || w>2000 || h>2000) { + printf("icon_draw_rect: icons are %i x %i pixels?\n", w, h); + assert(!"invalid icon size"); + return; + } + /* modulate color */ if(alpha != 1.0f) glPixelTransferf(GL_ALPHA_SCALE, alpha); @@ -861,45 +871,21 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), } /* draw */ - if((w<1 || h<1)) { - // XXX - TODO 2.5 verify whether this case can happen - if (G.f & G_DEBUG) - printf("what the heck! - icons are %i x %i pixels?\n", w, h); - } - /* rect contains image in 'rendersize', we only scale if needed */ - else if(rw!=w && rh!=h) { - if(w>2000 || h>2000) { /* something has gone wrong! */ - if (G.f & G_DEBUG) - printf("insane icon size w=%d h=%d\n",w,h); - } - else { - ImBuf *ima; - /* first allocate imbuf for scaling and copy preview into it */ - ima = IMB_allocImBuf(rw, rh, 32, IB_rect); - memcpy(ima->rect, rect, rw*rh*sizeof(unsigned int)); - - /* scale it */ - IMB_scaleImBuf(ima, w, h); + /* rect contains image in 'rendersize', we only scale if needed */ + if(rw!=w && rh!=h) { + /* first allocate imbuf for scaling and copy preview into it */ + ima = IMB_allocImBuf(rw, rh, 32, IB_rect); + memcpy(ima->rect, rect, rw*rh*sizeof(unsigned int)); + IMB_scaleImBuf(ima, w, h); /* scale it */ + rect= ima->rect; + } - if(is_preview) { - glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, ima->rect); - } - else { - glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, ima->rect); - } + if(is_preview) glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect); + else glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect); - IMB_freeImBuf(ima); - } - } - else { - if(is_preview) { - glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect); - } - else { - glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect); - } - } + if(ima) + IMB_freeImBuf(ima); /* restore color */ if(alpha != 0.0f) -- cgit v1.2.3 From d6d1f3cb68f59566fbfa0f23ccaaa4b84a073247 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 17 Oct 2010 09:01:37 +0000 Subject: Reverting Cam's audio code changes from revision 32517. Part of it has been reverted by Nathan already. Cam: next time please check, why a parameter is unused before you remove it! --- source/blender/blenkernel/BKE_sound.h | 2 +- source/blender/blenkernel/intern/packedFile.c | 2 +- source/blender/blenkernel/intern/sound.c | 9 +++++---- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/editors/sound/sound_ops.c | 2 +- source/blender/makesrna/intern/rna_sound.c | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 09cea572deb..190b0400aff 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -62,7 +62,7 @@ void sound_cache(struct bSound* sound, int ignore); void sound_delete_cache(struct bSound* sound); -void sound_load(struct bSound* sound); +void sound_load(struct Main *main, struct bSound* sound); void sound_free(struct bSound* sound); diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 78340288836..5bbb3506a78 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -486,7 +486,7 @@ int unpackSound(ReportList *reports, bSound *sound, int how) freePackedFile(sound->packedfile); sound->packedfile = 0; - sound_load(sound); + sound_load(NULL, sound); ret_value = RET_OK; } diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index b2e5209a4fc..5c3047942f7 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -143,7 +143,7 @@ struct bSound* sound_new_file(struct Main *bmain, char* filename) BLI_strncpy(sound->name, filename, FILE_MAX); // XXX unused currently sound->type = SOUND_TYPE_FILE; - sound_load(sound); + sound_load(bmain, sound); if(!sound->playback_handle) { @@ -169,7 +169,7 @@ struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source) sound->child_sound = source; sound->type = SOUND_TYPE_BUFFER; - sound_load(sound); + sound_load(CTX_data_main(C), sound); if(!sound->playback_handle) { @@ -195,7 +195,7 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa sound->end = end; sound->type = SOUND_TYPE_LIMITER; - sound_load(sound); + sound_load(CTX_data_main(C), sound); if(!sound->playback_handle) { @@ -236,7 +236,7 @@ void sound_delete_cache(struct bSound* sound) } } -void sound_load(struct bSound* sound) +void sound_load(struct Main *UNUSED(bmain), struct bSound* sound) { if(sound) { @@ -266,6 +266,7 @@ void sound_load(struct bSound* sound) if(sound->id.lib) path = sound->id.lib->filepath; else + // XXX this should be fixed! path = /*bmain ? bmain->name :*/ G.sce; BLI_path_abs(fullpath, path); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7c8c7eb6e5d..ebd407e7e21 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5308,7 +5308,7 @@ static void lib_link_sound(FileData *fd, Main *main) sound->id.flag -= LIB_NEEDLINK; sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system - sound_load(sound); + sound_load(main, sound); if(sound->cache) sound_cache(sound, 1); diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 2be3a51869b..18f35502f8b 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -180,7 +180,7 @@ static int pack_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; sound->packedfile= newPackedFile(op->reports, sound->name); - sound_load(sound); + sound_load(CTX_data_main(C), sound); return OPERATOR_FINISHED; } diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 0c217837226..674fbbad9c6 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -38,7 +38,7 @@ static void rna_Sound_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - sound_load((bSound*)ptr->data); + sound_load(bmain, (bSound*)ptr->data); } static int rna_Sound_caching_get(PointerRNA *ptr) -- cgit v1.2.3 From 6f1783470e249c60b8a96956f2f0ed564efaf107 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 17 Oct 2010 10:46:06 +0000 Subject: Partial fix for #22409: Locked axis + auto IK = bad The "root" bone in an Auto-IK chain was never added properly if it didn't have a parent that it was connected to. This meant that if it had axis-locking (using transform locks), these would not get converted to temporary IK-locks. This also affects 2.49 The second part of the bug report though, is something more ingrained in the IK-solver internals (numeric error, which means that even locked axes aren't exactly untouched). --- .../editors/transform/transform_conversions.c | 28 +++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 22b83ee4c89..5de08d7832c 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -446,16 +446,21 @@ static short apply_targetless_ik(Object *ob) /* apply and decompose, doesn't work for constraints or non-uniform scale well */ { float rmat3[3][3], qrmat[3][3], imat[3][3], smat[3][3]; - + copy_m3_m4(rmat3, rmat); /* rotation */ - if (parchan->rotmode > 0) - mat3_to_eulO( parchan->eul, parchan->rotmode,rmat3); + /* [#22409] is partially caused by this, as slight numeric error introduced during + * the solving process leads to locked-axis values changing. However, we cannot modify + * the values here, or else there are huge discreptancies between IK-solver (interactive) + * and applied poses. + */ + if (parchan->rotmode > 0) + mat3_to_eulO(parchan->eul, parchan->rotmode,rmat3); else if (parchan->rotmode == ROT_MODE_AXISANGLE) - mat3_to_axis_angle( parchan->rotAxis, &pchan->rotAngle,rmat3); + mat3_to_axis_angle(parchan->rotAxis, &parchan->rotAngle,rmat3); else - mat3_to_quat( parchan->quat,rmat3); + mat3_to_quat(parchan->quat,rmat3); /* for size, remove rotation */ /* causes problems with some constraints (so apply only if needed) */ @@ -840,9 +845,9 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan) data->flag |= CONSTRAINT_IK_TEMP|CONSTRAINT_IK_AUTO; VECCOPY(data->grabtarget, pchan->pose_tail); data->rootbone= 1; - - /* we include only a connected chain */ - while ((pchan) && (pchan->bone->flag & BONE_CONNECTED)) { + + /* we only include bones that are part of a continual connected chain */ + while (pchan) { /* here, we set ik-settings for bone from pchan->protectflag */ if (pchan->protectflag & OB_LOCK_ROTX) pchan->ikflag |= BONE_IK_NO_XDOF_TEMP; if (pchan->protectflag & OB_LOCK_ROTY) pchan->ikflag |= BONE_IK_NO_YDOF_TEMP; @@ -850,7 +855,12 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan) /* now we count this pchan as being included */ data->rootbone++; - pchan= pchan->parent; + + /* continue to parent, but only if we're connected to it */ + if (pchan->bone->flag & BONE_CONNECTED) + pchan = pchan->parent; + else + pchan = NULL; } /* make a copy of maximum chain-length */ -- cgit v1.2.3 From 013ffe904176c113a7642aed95b4b691f213d042 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 17 Oct 2010 11:20:12 +0000 Subject: Bugfix #24296: AutoIK interactive chain length adjustment feature is missing In 2.49, you could adjust the maximum length of Auto-IK Chains by using scrollwheel up/down or page up/down while moving Auto-IK bones. Now this is possible again with those hotkeys, but you need to hold SHIFT to get this to work, otherwise we get a conflict with the hotkeys for proportional edit nowadays. Was broken when transform tools switched from using hardcoded key mappings to using a modal keymap. --- source/blender/editors/transform/transform.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 4a95d0ec081..ae0bce176c1 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -481,6 +481,8 @@ static void view_editmove(unsigned short UNUSED(event)) * */ #define TFM_MODAL_PROPSIZE_UP 20 #define TFM_MODAL_PROPSIZE_DOWN 21 +#define TFM_MODAL_AUTOIK_LEN_INC 22 +#define TFM_MODAL_AUTOIK_LEN_DEC 23 /* called in transform_ops.c, on each regeneration of keymaps */ wmKeyMap* transform_modal_keymap(wmKeyConfig *keyconf) @@ -507,6 +509,8 @@ wmKeyMap* transform_modal_keymap(wmKeyConfig *keyconf) {NUM_MODAL_INCREMENT_DOWN, "INCREMENT_DOWN", 0, "Numinput Increment Down", ""}, {TFM_MODAL_PROPSIZE_UP, "PROPORTIONAL_SIZE_UP", 0, "Increase Proportional Influence", ""}, {TFM_MODAL_PROPSIZE_DOWN, "PROPORTIONAL_SIZE_DOWN", 0, "Decrease Poportional Influence", ""}, + {TFM_MODAL_AUTOIK_LEN_INC, "AUTOIK_CHAIN_LEN_UP", 0, "Increase Max AutoIK Chain Length", ""}, + {TFM_MODAL_AUTOIK_LEN_DEC, "AUTOIK_CHAIN_LEN_DOWN", 0, "Decrease Max AutoIK Chain Length", ""}, {0, NULL, 0, NULL, NULL}}; wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Transform Modal Map"); @@ -541,7 +545,12 @@ wmKeyMap* transform_modal_keymap(wmKeyConfig *keyconf) WM_modalkeymap_add_item(keymap, PAGEDOWNKEY, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_DOWN); WM_modalkeymap_add_item(keymap, WHEELDOWNMOUSE, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_UP); WM_modalkeymap_add_item(keymap, WHEELUPMOUSE, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_DOWN); - + + WM_modalkeymap_add_item(keymap, PAGEUPKEY, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_AUTOIK_LEN_INC); + WM_modalkeymap_add_item(keymap, PAGEDOWNKEY, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_AUTOIK_LEN_DEC); + WM_modalkeymap_add_item(keymap, WHEELDOWNMOUSE, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_AUTOIK_LEN_INC); + WM_modalkeymap_add_item(keymap, WHEELUPMOUSE, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_AUTOIK_LEN_DEC); + return keymap; } @@ -735,6 +744,16 @@ int transformEvent(TransInfo *t, wmEvent *event) } t->redraw |= TREDRAW_HARD; break; + case TFM_MODAL_AUTOIK_LEN_INC: + if (t->flag & T_AUTOIK) + transform_autoik_update(t, 1); + t->redraw |= TREDRAW_HARD; + break; + case TFM_MODAL_AUTOIK_LEN_DEC: + if (t->flag & T_AUTOIK) + transform_autoik_update(t, -1); + t->redraw |= TREDRAW_HARD; + break; default: handled = 0; break; -- cgit v1.2.3 From 0069c521042766a75c6e5fefce9b4a7a1f0e8142 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 17 Oct 2010 11:21:53 +0000 Subject: Disabling menu entry for adding "Python" F-Modifier. This hasn't been coded yet, and I don't think I'll be adding it very soon yet, so disabling to avoid further confusion over this. --- source/blender/makesrna/intern/rna_fcurve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 31ba51a9b04..23f37f8db8e 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -53,7 +53,7 @@ EnumPropertyItem fmodifier_type_items[] = { {FMODIFIER_TYPE_CYCLES, "CYCLES", 0, "Cycles", ""}, {FMODIFIER_TYPE_NOISE, "NOISE", 0, "Noise", ""}, {FMODIFIER_TYPE_FILTER, "FILTER", 0, "Filter", ""}, - {FMODIFIER_TYPE_PYTHON, "PYTHON", 0, "Python", ""}, + //{FMODIFIER_TYPE_PYTHON, "PYTHON", 0, "Python", ""}, // FIXME: not implemented yet! {FMODIFIER_TYPE_LIMITS, "LIMITS", 0, "Limits", ""}, {FMODIFIER_TYPE_STEPPED, "STEPPED", 0, "Stepped Interpolation", ""}, {0, NULL, 0, NULL, NULL}}; -- cgit v1.2.3 From fec7585190187ba6c8509620b83addfcaa225be0 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sun, 17 Oct 2010 18:56:36 +0000 Subject: Fix [#24294] IMB_allocImBuf changes in r32517 missed a couple of files Reported and patched by Shane Ambler --- source/blender/imbuf/intern/imbuf_cocoa.m | 2 +- source/blender/quicktime/apple/quicktime_export.c | 4 ++-- source/blender/quicktime/apple/quicktime_import.c | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'source/blender') diff --git a/source/blender/imbuf/intern/imbuf_cocoa.m b/source/blender/imbuf/intern/imbuf_cocoa.m index 02c90c5bd09..9b627612d2a 100644 --- a/source/blender/imbuf/intern/imbuf_cocoa.m +++ b/source/blender/imbuf/intern/imbuf_cocoa.m @@ -93,7 +93,7 @@ struct ImBuf *imb_cocoaLoadImage(unsigned char *mem, int size, int flags) [bitmapImage setSize:bitmapSize]; /* allocate the image buffer */ - ibuf = IMB_allocImBuf(bitmapSize.width, bitmapSize.height, 32/*RGBA*/, 0, 0); + ibuf = IMB_allocImBuf(bitmapSize.width, bitmapSize.height, 32/*RGBA*/, 0); if (!ibuf) { fprintf(stderr, "imb_cocoaLoadImage: could not allocate memory for the " \ diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index c1291fc6949..9664a5b16f8 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -379,8 +379,8 @@ static void QT_StartAddVideoSamplesToMedia (const Rect *trackFrame, int rectx, i SCTemporalSettings gTemporalSettings; OSErr err = noErr; - qtexport->ibuf = IMB_allocImBuf (rectx, recty, 32, IB_rect, 0); - qtexport->ibuf2 = IMB_allocImBuf (rectx, recty, 32, IB_rect, 0); + qtexport->ibuf = IMB_allocImBuf (rectx, recty, 32, IB_rect); + qtexport->ibuf2 = IMB_allocImBuf (rectx, recty, 32, IB_rect); err = NewGWorldFromPtr( &qtexport->theGWorld, k32ARGBPixelFormat, diff --git a/source/blender/quicktime/apple/quicktime_import.c b/source/blender/quicktime/apple/quicktime_import.c index f9793f04b88..699b2c4f6e3 100644 --- a/source/blender/quicktime/apple/quicktime_import.c +++ b/source/blender/quicktime/apple/quicktime_import.c @@ -335,7 +335,7 @@ ImBuf * qtime_fetchibuf (struct anim *anim, int position) return (NULL); } - ibuf = IMB_allocImBuf (anim->x, anim->y, 32, IB_rect, 0); + ibuf = IMB_allocImBuf (anim->x, anim->y, 32, IB_rect); rect = ibuf->rect; SetMovieTimeValue(anim->qtime->movie, anim->qtime->frameIndex[position]); @@ -496,7 +496,7 @@ int startquicktime (struct anim *anim) return -1; } - anim->qtime->ibuf = IMB_allocImBuf (anim->x, anim->y, 32, IB_rect, 0); + anim->qtime->ibuf = IMB_allocImBuf (anim->x, anim->y, 32, IB_rect); #ifdef _WIN32 err = NewGWorldFromPtr(&anim->qtime->offscreenGWorld, @@ -676,7 +676,7 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags) depth = (**desc).depth; if (flags & IB_test) { - ibuf = IMB_allocImBuf(x, y, depth, 0, 0); + ibuf = IMB_allocImBuf(x, y, depth, 0); ibuf->ftype = QUICKTIME; DisposeHandle((Handle)dataref); if (gImporter != NULL) CloseComponent(gImporter); @@ -684,8 +684,8 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags) } #ifdef __APPLE__ - ibuf = IMB_allocImBuf (x, y, 32, IB_rect, 0); - wbuf = IMB_allocImBuf (x, y, 32, IB_rect, 0); + ibuf = IMB_allocImBuf (x, y, 32, IB_rect); + wbuf = IMB_allocImBuf (x, y, 32, IB_rect); err = NewGWorldFromPtr(&offGWorld, k32ARGBPixelFormat, @@ -693,7 +693,7 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags) (unsigned char *)wbuf->rect, x * 4); #else - ibuf = IMB_allocImBuf (x, y, 32, IB_rect, 0); + ibuf = IMB_allocImBuf (x, y, 32, IB_rect); err = NewGWorldFromPtr(&offGWorld, k32RGBAPixelFormat, -- cgit v1.2.3 From c1e1551ef148623c236048deeb30dc826c7ee0c3 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sun, 17 Oct 2010 23:08:05 +0000 Subject: Fix [#24288] Mesh Grid pointing towards the floor when first created Reported by Terry Wallwork --- source/blender/editors/mesh/editmesh_add.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index a33d64cad29..525867d74c0 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1053,15 +1053,13 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se /* one segment first: the X axis */ phi = (2*dia)/(float)(tot-1); phid = (2*dia)/(float)(seg-1); - for(a=0;a=0;a--) { vec[0] = (phi*a) - dia; vec[1]= - dia; vec[2]= 0.0f; eve= addvertlist(em, vec, NULL); eve->f= 1+2+4; - if (a) { - addedgelist(em, eve->prev, eve, NULL); - } + addedgelist(em, eve->prev, eve, NULL); } /* extrude and translate */ vec[0]= vec[2]= 0.0; -- cgit v1.2.3 From 433f871f0f6bc68fbb1fffbdac42ef1bb8b5d019 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Oct 2010 00:25:32 +0000 Subject: bugfix [#24302] Ctrl+Click Extrude gets old mouse events double click didnt check mouse distance moved so you could click twice in different areas of the screen very fast and generate a double click event which had old mouse coords copied into it but was sent to an operator set to run on single click (because the double click wasnt handled). Also added MEM_name_ptr function (included in debug mode only), prints the name of allocated memory. used for debugging where events came from. --- source/blender/editors/interface/interface_icons.c | 17 ++++++++--------- source/blender/editors/mesh/editmesh_add.c | 6 +----- .../blender/windowmanager/intern/wm_event_system.c | 21 +++++++++++++++++---- source/blender/windowmanager/wm_event_system.h | 1 - 4 files changed, 26 insertions(+), 19 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 39e062a13aa..0ade3e6199f 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -864,13 +864,6 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), glPixelTransferf(GL_GREEN_SCALE, rgb[1]); glPixelTransferf(GL_BLUE_SCALE, rgb[2]); } - - if(is_preview == 0) { - /* position */ - glRasterPos2f(x,y); - } - - /* draw */ /* rect contains image in 'rendersize', we only scale if needed */ if(rw!=w && rh!=h) { @@ -881,8 +874,14 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), rect= ima->rect; } - if(is_preview) glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect); - else glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect); + /* draw */ + if(is_preview) { + glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect); + } + else { + glRasterPos2f(x, y); + glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect); + } if(ima) IMB_freeImBuf(ima); diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 525867d74c0..89991015419 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -114,13 +114,9 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) float min[3], max[3]; int done= 0; short use_proj; - wmWindow *win= CTX_wm_window(C); - +printf("%d\n", event->val); em_setup_viewcontext(C, &vc); - printf("\n%d %d\n", event->x, event->y); - printf("%d %d\n", win->eventstate->x, win->eventstate->y); - use_proj= (vc.scene->toolsettings->snap_flag & SCE_SNAP) && (vc.scene->toolsettings->snap_mode==SCE_SNAP_MODE_FACE); invert_m4_m4(vc.obedit->imat, vc.obedit->obmat); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index f2b880bd0d5..47ca4314cc7 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1452,11 +1452,24 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) wmWindow *win = CTX_wm_window(C); if (win && win->eventstate->prevtype == event->type && win->eventstate->prevval == KM_PRESS) { - /* test for double click first */ - if ((PIL_check_seconds_timer() - win->eventstate->prevclicktime) * 1000 < U.dbl_click_time) { + /* test for double click first, + * note1: this can be problematic because single click operators can get the + * double click event but then with old mouse coords which is highly confusing, + * so check for mouse moves too. + * note2: the first click event will be handled but still used to create a + * double click event if clicking again quickly. + * If no double click events are found itwill fallback to a single click. + * So a double click event can result in 2 successive single click calls + * if its not handled by the keymap - campbell */ + if ( (ABS(event->x - win->eventstate->prevclickx)) <= 2 && + (ABS(event->y - win->eventstate->prevclicky)) <= 2 && + ((PIL_check_seconds_timer() - win->eventstate->prevclicktime) * 1000 < U.dbl_click_time) + ) { event->val = KM_DBL_CLICK; - event->x = win->eventstate->prevclickx; - event->y = win->eventstate->prevclicky; + /* removed this because in cases where we're this is used as a single click + * event, this will give old coords, since the distance is checked above, using new coords should be ok. */ + // event->x = win->eventstate->prevclickx; + // event->y = win->eventstate->prevclicky; action |= wm_handlers_do(C, event, handlers); } diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h index 8fd650fb184..4888f9aced3 100644 --- a/source/blender/windowmanager/wm_event_system.h +++ b/source/blender/windowmanager/wm_event_system.h @@ -84,7 +84,6 @@ enum { /* wm_event_system.c */ -void wm_event_add (wmWindow *win, wmEvent *event_to_add); void wm_event_free_all (wmWindow *win); void wm_event_free (wmEvent *event); void wm_event_free_handler (wmEventHandler *handler); -- cgit v1.2.3 From 03085d2caea837f17b6c330c8306ecff67888ac2 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 18 Oct 2010 00:46:41 +0000 Subject: Fix [#24200] COLLADA Exporter: Aspect ratio is not exported Reported by Wenzel Jakob, patch [#24235] by Phil Gosch --- source/blender/collada/CameraExporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/collada/CameraExporter.cpp b/source/blender/collada/CameraExporter.cpp index c3a6cda8b3c..d5e2a7e116c 100644 --- a/source/blender/collada/CameraExporter.cpp +++ b/source/blender/collada/CameraExporter.cpp @@ -68,7 +68,7 @@ void CamerasExporter::operator()(Object *ob, Scene *sce) if (cam->type == CAM_PERSP) { COLLADASW::PerspectiveOptic persp(mSW); persp.setXFov(lens_to_angle(cam->lens)*(180.0f/M_PI)); - persp.setAspectRatio(1.0); + persp.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch)); persp.setZFar(cam->clipend); persp.setZNear(cam->clipsta); COLLADASW::Camera ccam(mSW, &persp, cam_id, cam_name); @@ -77,7 +77,7 @@ void CamerasExporter::operator()(Object *ob, Scene *sce) else { COLLADASW::OrthographicOptic ortho(mSW); ortho.setXMag(cam->ortho_scale); - ortho.setAspectRatio(1.0); + ortho.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch)); ortho.setZFar(cam->clipend); ortho.setZNear(cam->clipsta); COLLADASW::Camera ccam(mSW, &ortho, cam_id, cam_name); -- cgit v1.2.3 From 7db9558cf6fc64545dcdb1c0291ec943a10600db Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Oct 2010 02:36:43 +0000 Subject: bugfix [#24291] Error parenting a child with any negative scaling coordinate the bug was in object_apply_mat4(), caused by applying a non-normalized matrix to the rotation. Blender 2.4x also had this problem, surprising nobody noticed!. --- source/blender/blenkernel/intern/object.c | 31 ++++++++++++++--------------- source/blender/blenlib/BLI_math_matrix.h | 2 ++ source/blender/blenlib/intern/math_matrix.c | 20 +++++++++++++++++++ 3 files changed, 37 insertions(+), 16 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 17e488c8353..79030e3adfa 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1698,29 +1698,28 @@ void object_mat3_to_rot(Object *ob, float mat[][3], int use_compat) /* see pchan_apply_mat4() for the equivalent 'pchan' function */ void object_apply_mat4(Object *ob, float mat[][4]) { - float mat3[3][3], tmat[3][3], imat[3][3]; + float mat3[3][3]; /* obmat -> 3x3 */ + float mat3_n[3][3]; /* obmat -> normalized, 3x3 */ + float imat3_n[3][3]; /* obmat -> normalized & inverted, 3x3 */ /* location */ copy_v3_v3(ob->loc, mat[3]); /* rotation */ copy_m3_m4(mat3, mat); - object_mat3_to_rot(ob, mat3, 0); - + /* so scale doesnt interfear with rotation [#24291] */ + normalize_m3_m3(mat3_n, mat3); + + object_mat3_to_rot(ob, mat3_n, 0); + /* scale */ -#if 0 - /* works fine except for neg scales */ - mat4_to_size(ob->size, mat); -#else - /* this is more complicated but works for negative scales */ - object_rot_to_mat3(ob, tmat); - invert_m3_m3(imat, tmat); - mul_m3_m3m3(tmat, imat, mat3); - - ob->size[0]= tmat[0][0]; - ob->size[1]= tmat[1][1]; - ob->size[2]= tmat[2][2]; -#endif + /* note: mat4_to_size(ob->size, mat) fails for negative scale */ + invert_m3_m3(imat3_n, mat3_n); + mul_m3_m3m3(mat3, imat3_n, mat3); + + ob->size[0]= mat3[0][0]; + ob->size[1]= mat3[1][1]; + ob->size[2]= mat3[2][2]; } void object_to_mat3(Object *ob, float mat[][3]) /* no parent */ diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h index 77ebcb24975..294546bb222 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -102,7 +102,9 @@ void transpose_m3(float R[3][3]); void transpose_m4(float R[4][4]); void normalize_m3(float R[3][3]); +void normalize_m3_m3(float R[3][3], float A[3][3]); void normalize_m4(float R[4][4]); +void normalize_m4_m4(float R[4][4], float A[4][4]); void orthogonalize_m3(float R[3][3], int axis); void orthogonalize_m4(float R[4][4], int axis); diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 3b5ffa2d442..197d3676367 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -750,6 +750,14 @@ void normalize_m3(float mat[][3]) normalize_v3(mat[2]); } +void normalize_m3_m3(float rmat[][3], float mat[][3]) +{ + normalize_v3_v3(rmat[0], mat[0]); + normalize_v3_v3(rmat[1], mat[1]); + normalize_v3_v3(rmat[2], mat[2]); +} + + void normalize_m4(float mat[][4]) { float len; @@ -762,6 +770,18 @@ void normalize_m4(float mat[][4]) if(len!=0.0) mat[2][3]/= len; } +void normalize_m4_m4(float rmat[][4], float mat[][4]) +{ + float len; + + len= normalize_v3_v3(rmat[0], mat[0]); + if(len!=0.0) rmat[0][3]= mat[0][3] / len; + len= normalize_v3_v3(rmat[1], mat[1]); + if(len!=0.0) rmat[1][3]= mat[1][3] / len; + len= normalize_v3_v3(rmat[2], mat[2]); + if(len!=0.0) rmat[2][3]= mat[2][3] / len;; +} + void adjoint_m3_m3(float m1[][3], float m[][3]) { m1[0][0]=m[1][1]*m[2][2]-m[1][2]*m[2][1]; -- cgit v1.2.3 From b3afc3618db09942f83d4a3ac62834e7b925d5d7 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 18 Oct 2010 06:34:02 +0000 Subject: Remove unused code. --- source/blender/verify/BLO_sign_verify_Header.h | 80 ----- source/blender/verify/BLO_signer_info.h | 45 --- source/blender/verify/BLO_verify.h | 76 ----- source/blender/verify/Makefile | 34 -- source/blender/verify/intern/BLO_verify.c | 420 ------------------------- source/blender/verify/intern/Makefile | 50 --- 6 files changed, 705 deletions(-) delete mode 100644 source/blender/verify/BLO_sign_verify_Header.h delete mode 100644 source/blender/verify/BLO_signer_info.h delete mode 100644 source/blender/verify/BLO_verify.h delete mode 100644 source/blender/verify/Makefile delete mode 100644 source/blender/verify/intern/BLO_verify.c delete mode 100644 source/blender/verify/intern/Makefile (limited to 'source/blender') diff --git a/source/blender/verify/BLO_sign_verify_Header.h b/source/blender/verify/BLO_sign_verify_Header.h deleted file mode 100644 index 9d73d9ba595..00000000000 --- a/source/blender/verify/BLO_sign_verify_Header.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * - */ - -#ifndef BLO_SIGN_VERIFY_H -#define BLO_SIGN_VERIFY_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef FREE_WINDOWS -typedef int int32_t; -#endif - -#include "BLO_sys_types.h" - -#define SIGNVERIFYHEADERSTRUCTSIZE sizeof(struct BLO_sign_verify_HeaderStruct) -/* TODO use reasonable sizes -Tests showed: pubKeyLen 64, cryptedKeyLen 64 bytes -So we pick 2*64 bytes + tail for now : */ - -#define MAXPUBKEYLEN 130 -#define MAXSIGNATURELEN 130 - -struct BLO_sign_verify_HeaderStruct { - uint8_t magic; /* poor mans header recognize check */ - uint32_t length; /* how much signed data is there */ - uint8_t pubKey[MAXPUBKEYLEN]; - uint32_t pubKeyLen; /* the actual pubKey length */ - uint8_t signature[MAXSIGNATURELEN]; - int32_t signatureLen; /* the actual signature length */ - uint32_t datacrc; /* data crc checksum */ - uint32_t headercrc; /* header minus crc itself checksum */ -}; - -#define SIGNERHEADERSTRUCTSIZE sizeof(struct BLO_SignerHeaderStruct) -#define MAXSIGNERLEN 100 - -struct BLO_SignerHeaderStruct { - uint8_t name[MAXSIGNERLEN]; /* the signers name (from the key) */ - uint8_t email[MAXSIGNERLEN]; /* the signers email (from the key) */ - uint8_t homeUrl[MAXSIGNERLEN]; /* the signers home page */ - uint8_t text[MAXSIGNERLEN]; /* optional additional user text */ - uint8_t pubKeyUrl1[MAXSIGNERLEN]; /* the signers pubKey store */ - uint8_t pubKeyUrl2[MAXSIGNERLEN]; /* the signers pubKey at NaN */ -}; - -#ifdef __cplusplus -} -#endif - -#endif /* BLO_SIGN_VERIFY_H */ - diff --git a/source/blender/verify/BLO_signer_info.h b/source/blender/verify/BLO_signer_info.h deleted file mode 100644 index 39059cf94a7..00000000000 --- a/source/blender/verify/BLO_signer_info.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * - */ - -#include "BLO_sign_verify_Header.h" - -/* external struct for signer info */ - -struct BLO_SignerInfo { - char name[MAXSIGNERLEN]; - char email[MAXSIGNERLEN]; - char homeUrl[MAXSIGNERLEN]; - /* more to come... */ -}; - -struct BLO_SignerInfo *BLO_getSignerInfo(void); -int BLO_isValidSignerInfo(struct BLO_SignerInfo *info); -void BLO_clrSignerInfo(struct BLO_SignerInfo *info); - diff --git a/source/blender/verify/BLO_verify.h b/source/blender/verify/BLO_verify.h deleted file mode 100644 index 5f7241c1cd5..00000000000 --- a/source/blender/verify/BLO_verify.h +++ /dev/null @@ -1,76 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef BLO_VERIFY_H -#define BLO_VERIFY_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define VERIFY_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name - -VERIFY_DECLARE_HANDLE(BLO_verifyStructHandle); - -/** - * openssl verify initializer - * @retval pointer to verify control structure - */ - BLO_verifyStructHandle -BLO_verify_begin( - void *endControl); - -/** - * openssl verify dataprocessor wrapper - * @param BLO_verify Pointer to verify control structure - * @param data Pointer to new data - * @param dataIn New data amount - * @retval streamGlueRead return value - */ - int -BLO_verify_process( - BLO_verifyStructHandle BLO_verifyHandle, - unsigned char *data, - unsigned int dataIn); - -/** - * openssl verify final call and cleanup - * @param BLO_verify Pointer to verify control structure - * @retval streamGlueRead return value - */ - int -BLO_verify_end( - BLO_verifyStructHandle BLO_verifyHandle); - -#ifdef __cplusplus -} -#endif - -#endif /* BLO_VERIFY_H */ - diff --git a/source/blender/verify/Makefile b/source/blender/verify/Makefile deleted file mode 100644 index 4451d5baf22..00000000000 --- a/source/blender/verify/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# Bounces make to subdirectories. - -SOURCEDIR = source/blender/verify -DIRS = intern - -include nan_subdirs.mk diff --git a/source/blender/verify/intern/BLO_verify.c b/source/blender/verify/intern/BLO_verify.c deleted file mode 100644 index ccdc8a7e916..00000000000 --- a/source/blender/verify/intern/BLO_verify.c +++ /dev/null @@ -1,420 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * openssl verify wrapper library - */ - -#include -#include -#include - -#include "openssl/rsa.h" -#include "openssl/ripemd.h" -#include "openssl/objects.h" -#include "zlib.h" - -#include "GEN_messaging.h" - -#include "BLO_readStreamGlue.h" -#include "BLO_verify.h" -#include "BLO_sign_verify_Header.h" /* used by verify and encrypt */ - -#include "BLO_signer_info.h" /* external signer info struct */ - -static struct BLO_SignerInfo g_SignerInfo = {"", "", ""}; - -struct verifyStructType { - struct readStreamGlueStruct *streamGlue; - unsigned int streamDone; - unsigned char headerbuffer[SIGNVERIFYHEADERSTRUCTSIZE]; - uint32_t datacrc; - struct BLO_sign_verify_HeaderStruct *streamHeader; - RIPEMD160_CTX ripemd160_ctx; - struct BLO_SignerHeaderStruct *signerHeader; - unsigned char signerHeaderBuffer[SIGNERHEADERSTRUCTSIZE]; - void *endControl; -}; - - BLO_verifyStructHandle -BLO_verify_begin( - void *endControl) -{ - struct verifyStructType *control; - control = malloc(sizeof(struct verifyStructType)); - if (!control) return NULL; - - control->streamGlue = NULL; - control->streamDone = 0; - memset(control->headerbuffer, 0, SIGNVERIFYHEADERSTRUCTSIZE); - control->datacrc = 0; - - control->streamHeader = malloc(SIGNVERIFYHEADERSTRUCTSIZE); - if (!control->streamHeader) { - free(control); - return NULL; - } - control->streamHeader->magic = 0; - control->streamHeader->length = 0; - strcpy(control->streamHeader->pubKey, ""); - control->streamHeader->pubKeyLen = 0; - strcpy(control->streamHeader->signature, ""); - control->streamHeader->signatureLen = 0; - control->streamHeader->datacrc = 0; - control->streamHeader->headercrc = 0; - - RIPEMD160_Init(&(control->ripemd160_ctx)); - - control->signerHeader = malloc(SIGNERHEADERSTRUCTSIZE); - if (!control->signerHeader) { - free(control->streamHeader); - free(control); - return NULL; - } - memset(control->signerHeader->name, 0, MAXSIGNERLEN); - memset(control->signerHeader->email, 0, MAXSIGNERLEN); - memset(control->signerHeader->homeUrl, 0, MAXSIGNERLEN); - memset(control->signerHeader->text, 0, MAXSIGNERLEN); - memset(control->signerHeader->pubKeyUrl1, 0, MAXSIGNERLEN); - memset(control->signerHeader->pubKeyUrl2, 0, MAXSIGNERLEN); - - control->endControl = endControl; - return((BLO_verifyStructHandle) control); -} - - int -BLO_verify_process( - BLO_verifyStructHandle BLO_verifyHandle, - unsigned char *data, - unsigned int dataIn) -{ - int err = 0; - struct verifyStructType *BLO_verify = - (struct verifyStructType *) BLO_verifyHandle; - - if (!BLO_verify) { - err = BRS_SETFUNCTION(BRS_VERIFY) | - BRS_SETGENERR(BRS_NULL); - return err; - } - - /* First check if we have our header filled in yet */ - if (BLO_verify->streamHeader->length == 0) { - unsigned int processed; - if (dataIn == 0) return err; /* really need data to do anything */ - processed = ((dataIn + BLO_verify->streamDone) <= - SIGNVERIFYHEADERSTRUCTSIZE) - ? dataIn : SIGNVERIFYHEADERSTRUCTSIZE; - memcpy(BLO_verify->headerbuffer + BLO_verify->streamDone, - data, processed); - BLO_verify->streamDone += processed; - dataIn -= processed; - data += processed; - if (BLO_verify->streamDone == SIGNVERIFYHEADERSTRUCTSIZE) { - /* we have the whole header, absorb it */ - struct BLO_sign_verify_HeaderStruct *header; - uint32_t crc; - - header = (struct BLO_sign_verify_HeaderStruct *) - BLO_verify->headerbuffer; - crc = crc32(0L, (const Bytef *) header, - SIGNVERIFYHEADERSTRUCTSIZE - 4); - - if (header->magic == 'A') { -#ifndef NDEBUG - fprintf(GEN_errorstream, - "BLO_sign_verify_HeaderStruct Magic confirmed\n"); -#endif - } else { -#ifndef NDEBUG - fprintf(GEN_errorstream, - "ERROR BLO_sign_verify_HeaderStruct Magic NOT confirmed\n"); -#endif - err = BRS_SETFUNCTION(BRS_VERIFY) | - BRS_SETGENERR(BRS_MAGIC); - if (BLO_verify->streamGlue) free(BLO_verify->streamGlue); - if (BLO_verify->streamHeader) free(BLO_verify->streamHeader); - if (BLO_verify->signerHeader) free(BLO_verify->signerHeader); - free(BLO_verify); - return err; - } - - if (crc == ntohl(header->headercrc)) { -#ifndef NDEBUG - fprintf(GEN_errorstream,"BLO_sign_verify_Header CRC correct\n"); -#endif - } else { -#ifndef NDEBUG - fprintf(GEN_errorstream,"ERROR BLO_sign_verify_Header CRC NOT correct\n"); -#endif - err = BRS_SETFUNCTION(BRS_VERIFY) | - BRS_SETGENERR(BRS_CRCHEADER); - if (BLO_verify->streamGlue) free(BLO_verify->streamGlue); - if (BLO_verify->streamHeader) free(BLO_verify->streamHeader); - if (BLO_verify->signerHeader) free(BLO_verify->signerHeader); - free(BLO_verify); - return err; - } - BLO_verify->streamHeader->length = ntohl(header->length); - BLO_verify->streamHeader->pubKeyLen = ntohl(header->pubKeyLen); - memcpy(BLO_verify->streamHeader->pubKey, header->pubKey, - BLO_verify->streamHeader->pubKeyLen); - BLO_verify->streamHeader->signatureLen = - ntohl(header->signatureLen); - memcpy(BLO_verify->streamHeader->signature, header->signature, - BLO_verify->streamHeader->signatureLen); - BLO_verify->streamHeader->datacrc = ntohl(header->datacrc); - -#ifndef NDEBUG - fprintf(GEN_errorstream, - "BLO_verify_process gets %u bytes\n", - (unsigned int) BLO_verify->streamHeader->length); -#endif - - } - } - - /* Is there really (still) new data available ? */ - if (dataIn > 0) { - /* BLO_SignerHeaderStruct */ - if (BLO_verify->signerHeader->name[0] == 0) { - /* we don't have our signerHeader complete yet */ - unsigned int processed; - processed = ((dataIn + BLO_verify->streamDone - - SIGNVERIFYHEADERSTRUCTSIZE) <= SIGNERHEADERSTRUCTSIZE) - ? dataIn : SIGNERHEADERSTRUCTSIZE; - memcpy(BLO_verify->signerHeaderBuffer + - BLO_verify->streamDone - SIGNVERIFYHEADERSTRUCTSIZE, - data, processed); - BLO_verify->streamDone += processed; - dataIn -= processed; - data += processed; - if (BLO_verify->streamDone == SIGNVERIFYHEADERSTRUCTSIZE + - SIGNERHEADERSTRUCTSIZE) { - /* we have the whole header, absorb it */ - struct BLO_SignerHeaderStruct *signerHeader; - signerHeader = (struct BLO_SignerHeaderStruct *) - BLO_verify->signerHeaderBuffer; - strncpy(BLO_verify->signerHeader->name, - signerHeader->name, MAXSIGNERLEN-1); - strncpy(BLO_verify->signerHeader->email, - signerHeader->email, MAXSIGNERLEN-1); - strncpy(BLO_verify->signerHeader->homeUrl, - signerHeader->homeUrl, MAXSIGNERLEN-1); - strncpy(BLO_verify->signerHeader->text, - signerHeader->text, MAXSIGNERLEN-1); - strncpy(BLO_verify->signerHeader->pubKeyUrl1, - signerHeader->pubKeyUrl1, MAXSIGNERLEN-1); - strncpy(BLO_verify->signerHeader->pubKeyUrl2, - signerHeader->pubKeyUrl2, MAXSIGNERLEN-1); - -#ifndef NDEBUG - fprintf(GEN_errorstream, - "name %s\nemail %s\nhomeUrl %s\ntext %s\n", - BLO_verify->signerHeader->name, - BLO_verify->signerHeader->email, - BLO_verify->signerHeader->homeUrl, - BLO_verify->signerHeader->text); - fprintf(GEN_errorstream, - "pubKeyUrl1 %s\npubKeyUrl2 %s\n", - BLO_verify->signerHeader->pubKeyUrl1, - BLO_verify->signerHeader->pubKeyUrl2); -#endif - /* also update the signature and crc checksum */ - RIPEMD160_Update(&(BLO_verify->ripemd160_ctx), - BLO_verify->signerHeaderBuffer, - SIGNERHEADERSTRUCTSIZE); - - /* update datacrc */ - BLO_verify->datacrc = crc32( - BLO_verify->datacrc, (const Bytef *) - BLO_verify->signerHeaderBuffer, - SIGNERHEADERSTRUCTSIZE); - } - } - } - - /* Is there really (still) new data available ? */ - if (dataIn > 0) { - RIPEMD160_Update(&(BLO_verify->ripemd160_ctx), data, dataIn); - - /* update datacrc */ - BLO_verify->datacrc = crc32( - BLO_verify->datacrc, (const Bytef *) data, dataIn); - - BLO_verify->streamDone += dataIn; - - /* give data to streamGlueRead, it will find out what to do next */ - err = readStreamGlue( - BLO_verify->endControl, - &(BLO_verify->streamGlue), - (unsigned char *) data, - dataIn); - } - return err; -} - -/** - * openssl verify final call and cleanup - * @param BLO_verify Pointer to verify control structure - * @retval streamGlueRead return value - */ - int -BLO_verify_end( - BLO_verifyStructHandle BLO_verifyHandle) -{ - int err = 0; - unsigned char *digest; - static unsigned char rsa_e[] = "\x01\x00\x01"; - RSA *rsa = NULL; - int verifySuccess; - struct verifyStructType *BLO_verify = - (struct verifyStructType *) BLO_verifyHandle; - - if (!BLO_verify) { - err = BRS_SETFUNCTION(BRS_VERIFY) | - BRS_SETGENERR(BRS_NULL); - return err; - } - - if (BLO_verify->streamDone == BLO_verify->streamHeader->length + - SIGNVERIFYHEADERSTRUCTSIZE) { -#ifndef NDEBUG - fprintf(GEN_errorstream, "Signed data length is correct\n"); -#endif - } else { -#ifndef NDEBUG - fprintf(GEN_errorstream, "Signed data length is NOT correct\n"); -#endif - err = BRS_SETFUNCTION(BRS_VERIFY) | - BRS_SETGENERR(BRS_DATALEN); - if (BLO_verify->streamGlue) free(BLO_verify->streamGlue); - if (BLO_verify->streamHeader) free(BLO_verify->streamHeader); - if (BLO_verify->signerHeader) free(BLO_verify->signerHeader); - free(BLO_verify); - return err; - } - - if (BLO_verify->datacrc == BLO_verify->streamHeader->datacrc) { -#ifndef NDEBUG - fprintf(GEN_errorstream, "Signed data CRC is correct\n"); -#endif - } else { -#ifndef NDEBUG - fprintf(GEN_errorstream, "Signed data CRC is NOT correct\n"); -#endif - err = BRS_SETFUNCTION(BRS_VERIFY) | - BRS_SETGENERR(BRS_CRCDATA); - if (BLO_verify->streamGlue) free(BLO_verify->streamGlue); - if (BLO_verify->streamHeader) free(BLO_verify->streamHeader); - if (BLO_verify->signerHeader) free(BLO_verify->signerHeader); - free(BLO_verify); - return err; - } - - digest = malloc(RIPEMD160_DIGEST_LENGTH); - if (!digest) { - err = BRS_SETFUNCTION(BRS_VERIFY) | - BRS_SETGENERR(BRS_MALLOC); - if (BLO_verify->streamGlue) free(BLO_verify->streamGlue); - if (BLO_verify->streamHeader) free(BLO_verify->streamHeader); - if (BLO_verify->signerHeader) free(BLO_verify->signerHeader); - free(BLO_verify); - return err; - } - - RIPEMD160_Final(digest, &(BLO_verify->ripemd160_ctx)); - - rsa = RSA_new(); - if (rsa == NULL) { -#ifndef NDEBUG - fprintf(GEN_errorstream, "Error in RSA_new\n"); -#endif - err = BRS_SETFUNCTION(BRS_VERIFY) | - BRS_SETSPECERR(BRS_RSANEWERROR); - free(digest); - if (BLO_verify->streamGlue) free(BLO_verify->streamGlue); - if (BLO_verify->streamHeader) free(BLO_verify->streamHeader); - if (BLO_verify->signerHeader) free(BLO_verify->signerHeader); - free(BLO_verify); - return err; - } - /* static exponent */ - rsa->e = BN_bin2bn(rsa_e, sizeof(rsa_e)-1, rsa->e); - - /* public part into rsa->n */ - rsa->n = BN_bin2bn(BLO_verify->streamHeader->pubKey, - BLO_verify->streamHeader->pubKeyLen, - rsa->n); - /*DEBUG RSA_print_fp(stdout, rsa, 0); */ - - /* verify the signature */ - verifySuccess = RSA_verify(NID_ripemd160, digest, RIPEMD160_DIGEST_LENGTH, - BLO_verify->streamHeader->signature, - BLO_verify->streamHeader->signatureLen, rsa); - if (verifySuccess == 1) { -#ifndef NDEBUG - fprintf(GEN_errorstream, - "Signature verified\n"); -#endif - } else { -#ifndef NDEBUG - fprintf(GEN_errorstream, - "Signature INCORRECT\n"); -#endif - err = BRS_SETFUNCTION(BRS_VERIFY) | - BRS_SETSPECERR(BRS_SIGFAILED); - } - -/* copy signer information to external struct */ - - strncpy(g_SignerInfo.name, BLO_verify->signerHeader->name, MAXSIGNERLEN-1); - strncpy(g_SignerInfo.email, BLO_verify->signerHeader->email, MAXSIGNERLEN-1); - strncpy(g_SignerInfo.homeUrl, BLO_verify->signerHeader->homeUrl, MAXSIGNERLEN-1); - - free(digest); - free(BLO_verify->streamGlue); - free(BLO_verify->streamHeader); - free(BLO_verify->signerHeader); - free(BLO_verify); - RSA_free(rsa); - - return err; -} - -struct BLO_SignerInfo *BLO_getSignerInfo(){ - return &g_SignerInfo; -} - -int BLO_isValidSignerInfo(struct BLO_SignerInfo *info){ - return info->name[0] != 0; -} - -void BLO_clrSignerInfo(struct BLO_SignerInfo *info) -{ - info->name[0] = 0; -} - diff --git a/source/blender/verify/intern/Makefile b/source/blender/verify/intern/Makefile deleted file mode 100644 index 009fd1c6e28..00000000000 --- a/source/blender/verify/intern/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# - -LIBNAME = verify -DIR = $(OCGDIR)/blender/$(LIBNAME) - -include nan_compile.mk - -CFLAGS += $(LEVEL_2_C_WARNINGS) - -# path to our own external headerfiles -CPPFLAGS += -I.. - -# external modules -CPPFLAGS += -I../../../kernel/gen_messaging -CPPFLAGS += -I../../readstreamglue - -CPPFLAGS += -I$(NAN_OPENSSL)/include - -ifeq ($(OS),$(findstring $(OS), "solaris windows")) - CPPFLAGS += -I$(NAN_ZLIB)/include -endif - -- cgit v1.2.3 From 4d37cf90b9d9d8ed2f0339c8ccd72481e29a4514 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Oct 2010 06:41:16 +0000 Subject: remove G.sce, use G.main->name instead. Both stored the filename of the blend file, but G.sce stored the last opened file. This will make blender act differently in some cases since a relative path to the last opened file will no longer resolve (which is correct IMHO since that file isnt open and the path might not even be valid anymore). Tested linking with durian files and rendering to relative paths when no files is loaded however we may need to have some operators give an error if they are used on the default startup.blend. --- source/blender/blenkernel/BKE_global.h | 4 ++-- source/blender/blenkernel/intern/blender.c | 13 +++++------- source/blender/blenkernel/intern/customdata.c | 3 ++- source/blender/blenkernel/intern/image.c | 16 +++++++-------- source/blender/blenkernel/intern/library.c | 2 +- source/blender/blenkernel/intern/packedFile.c | 6 +++--- source/blender/blenkernel/intern/particle_system.c | 3 ++- source/blender/blenkernel/intern/pointcache.c | 2 +- source/blender/blenkernel/intern/scene.c | 4 ++-- source/blender/blenkernel/intern/sequencer.c | 12 +++++------ source/blender/blenkernel/intern/sound.c | 4 ++-- source/blender/blenkernel/intern/text.c | 2 +- source/blender/blenkernel/intern/writeavi.c | 3 ++- source/blender/blenkernel/intern/writeffmpeg.c | 2 +- source/blender/blenlib/BLI_bpath.h | 2 +- source/blender/blenlib/intern/bpath.c | 2 +- source/blender/blenloader/intern/readfile.c | 12 +++++------ source/blender/blenloader/intern/writefile.c | 6 +++--- source/blender/collada/ImageExporter.cpp | 5 +++-- source/blender/editors/interface/interface_draw.c | 2 +- source/blender/editors/object/object_modifier.c | 2 +- source/blender/editors/physics/physics_fluid.c | 6 +++--- source/blender/editors/render/render_preview.c | 4 ++-- source/blender/editors/render/render_shading.c | 6 +++--- source/blender/editors/screen/screendump.c | 3 ++- source/blender/editors/space_buttons/buttons_ops.c | 3 ++- source/blender/editors/space_file/file_draw.c | 5 +++-- source/blender/editors/space_file/file_ops.c | 15 +++++++------- source/blender/editors/space_file/filelist.c | 8 ++++---- source/blender/editors/space_file/filesel.c | 7 ++++--- source/blender/editors/space_file/writeimage.c | 5 +++-- source/blender/editors/space_image/image_ops.c | 12 +++++------ source/blender/editors/space_info/info_ops.c | 8 ++++---- source/blender/editors/space_outliner/outliner.c | 2 +- .../editors/space_sequencer/sequencer_add.c | 4 ++-- .../editors/space_sequencer/sequencer_edit.c | 2 +- source/blender/editors/space_text/text_ops.c | 12 +++++------ source/blender/makesrna/intern/rna_image_api.c | 4 ++-- .../blender/modifiers/intern/MOD_fluidsim_util.c | 5 +++-- .../blender/python/generic/bpy_internal_import.c | 4 ++-- source/blender/quicktime/apple/quicktime_export.c | 2 +- source/blender/render/intern/source/pipeline.c | 4 ++-- source/blender/windowmanager/intern/wm_files.c | 23 +++++++--------------- source/blender/windowmanager/intern/wm_init_exit.c | 6 +++--- source/blender/windowmanager/intern/wm_operators.c | 10 +++++----- source/blender/windowmanager/intern/wm_window.c | 11 +++++------ 46 files changed, 138 insertions(+), 140 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 6a602339e11..76fb5605d77 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -52,9 +52,9 @@ typedef struct Global { struct Main *main; /* strings: lastsaved */ - char ima[256], sce[256], lib[256]; + char ima[256], lib[256]; - /* flag: if != 0 G.sce contains valid relative base path */ + /* flag: if != 0 G.main->name contains valid relative base path */ int relbase_valid; /* strings of recent opend files */ diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 5fcf3c77d3b..72d194e4d79 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -309,8 +309,8 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename) #endif /* these are the same at times, should never copy to the same location */ - if(G.sce != filename) - BLI_strncpy(G.sce, filename, FILE_MAX); + if(G.main->name != filename) + BLI_strncpy(G.main->name, filename, FILE_MAX); BLI_strncpy(G.main->name, filename, FILE_MAX); /* is guaranteed current file */ @@ -410,7 +410,7 @@ int BKE_read_file_from_memfile(bContext *C, MemFile *memfile, ReportList *report { BlendFileData *bfd; - bfd= BLO_read_from_memfile(CTX_data_main(C), G.sce, memfile, reports); + bfd= BLO_read_from_memfile(CTX_data_main(C), G.main->name, memfile, reports); if (bfd) setup_app_data(C, bfd, ""); else @@ -460,14 +460,12 @@ static UndoElem *curundo= NULL; static int read_undosave(bContext *C, UndoElem *uel) { - char scestr[FILE_MAXDIR+FILE_MAXFILE]; /* we should eventually just use G.main->name */ char mainstr[FILE_MAXDIR+FILE_MAXFILE]; int success=0, fileflags; /* This is needed so undoing/redoing doesnt crash with threaded previews going */ WM_jobs_stop_all(CTX_wm_manager(C)); - - strcpy(scestr, G.sce); /* temporal store */ + strcpy(mainstr, G.main->name); /* temporal store */ fileflags= G.fileflags; @@ -479,7 +477,6 @@ static int read_undosave(bContext *C, UndoElem *uel) success= BKE_read_file_from_memfile(C, &uel->memfile, NULL); /* restore */ - strcpy(G.sce, scestr); /* restore */ strcpy(G.main->name, mainstr); /* restore */ G.fileflags= fileflags; @@ -720,7 +717,7 @@ void BKE_undo_save_quit(void) Main *BKE_undo_get_main(Scene **scene) { Main *mainp= NULL; - BlendFileData *bfd= BLO_read_from_memfile(G.main, G.sce, &curundo->memfile, NULL); + BlendFileData *bfd= BLO_read_from_memfile(G.main, G.main->name, &curundo->memfile, NULL); if(bfd) { mainp= bfd->main; diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 7f91df3b281..9c4f0d790ca 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -48,6 +48,7 @@ #include "BKE_customdata.h" #include "BKE_customdata_file.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_utildefines.h" /* number of layers to add when growing a CustomData object */ @@ -2343,7 +2344,7 @@ int CustomData_verify_versions(struct CustomData *data, int index) static void customdata_external_filename(char filename[FILE_MAX], ID *id, CustomDataExternal *external) { - char *path = (id->lib)? id->lib->filepath: G.sce; + char *path = (id->lib)? id->lib->filepath: G.main->name; BLI_strncpy(filename, external->filename, FILE_MAX); BLI_path_abs(filename, path); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 8ba7cde519d..09622b2acfe 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -338,7 +338,7 @@ Image *BKE_add_image_file(const char *name) char str[FILE_MAX], strtest[FILE_MAX]; BLI_strncpy(str, name, sizeof(str)); - BLI_path_abs(str, G.sce); + BLI_path_abs(str, G.main->name); /* exists? */ file= open(str, O_BINARY|O_RDONLY); @@ -349,7 +349,7 @@ Image *BKE_add_image_file(const char *name) for(ima= G.main->image.first; ima; ima= ima->id.next) { if(ima->source!=IMA_SRC_VIEWER && ima->source!=IMA_SRC_GENERATED) { BLI_strncpy(strtest, ima->name, sizeof(ima->name)); - BLI_path_abs(strtest, G.sce); + BLI_path_abs(strtest, G.main->name); if( strcmp(strtest, str)==0 ) { if(ima->anim==NULL || ima->id.us==0) { @@ -861,8 +861,8 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix) if (scene->r.stamp & R_STAMP_FILENAME) { if (G.relbase_valid) { - if (do_prefix) sprintf(stamp_data->file, "File %s", G.sce); - else sprintf(stamp_data->file, "%s", G.sce); + if (do_prefix) sprintf(stamp_data->file, "File %s", G.main->name); + else sprintf(stamp_data->file, "%s", G.main->name); } else { if (do_prefix) strcpy(stamp_data->file, "File "); else strcpy(stamp_data->file, ""); @@ -1311,7 +1311,7 @@ void BKE_makepicstring(char *string, char *base, int frame, int imtype, int use_ { if (string==NULL) return; BLI_strncpy(string, base, FILE_MAX - 10); /* weak assumption */ - BLI_path_abs(string, G.sce); + BLI_path_abs(string, G.main->name); BLI_path_frame(string, frame, 4); if(use_ext) @@ -1609,7 +1609,7 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame) if(ima->id.lib) BLI_path_abs(name, ima->id.lib->filepath); else - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); flag= IB_rect|IB_multilayer; if(ima->flag & IMA_DO_PREMUL) @@ -1717,7 +1717,7 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame) if(ima->id.lib) BLI_path_abs(str, ima->id.lib->filepath); else - BLI_path_abs(str, G.sce); + BLI_path_abs(str, G.main->name); ima->anim = openanim(str, IB_rect); @@ -1778,7 +1778,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) if(ima->id.lib) BLI_path_abs(str, ima->id.lib->filepath); else - BLI_path_abs(str, G.sce); + BLI_path_abs(str, G.main->name); /* read ibuf */ ibuf = IMB_loadiffname(str, flag); diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 1e08432c271..dfc82152e8c 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1234,7 +1234,7 @@ static void image_fix_relative_path(Image *ima) if(ima->id.lib==NULL) return; if(strncmp(ima->name, "//", 2)==0) { BLI_path_abs(ima->name, ima->id.lib->filepath); - BLI_path_rel(ima->name, G.sce); + BLI_path_rel(ima->name, G.main->name); } } diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 5bbb3506a78..33f1949c5ac 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -179,7 +179,7 @@ PackedFile *newPackedFile(ReportList *reports, char *filename) // convert relative filenames to absolute filenames strcpy(name, filename); - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); // open the file // and create a PackedFile structure @@ -274,7 +274,7 @@ int writePackedFile(ReportList *reports, char *filename, PackedFile *pf, int gui if (guimode) {} //XXX waitcursor(1); strcpy(name, filename); - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); if (BLI_exists(name)) { for (number = 1; number <= 999; number++) { @@ -339,7 +339,7 @@ int checkPackedFile(char *filename, PackedFile *pf) char name[FILE_MAXDIR + FILE_MAXFILE]; strcpy(name, filename); - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); if (stat(name, &st)) { ret_val = PF_NOFILE; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 8ab4117c8a1..71ec1114848 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -63,6 +63,7 @@ #include "BLI_listbase.h" #include "BLI_threads.h" +#include "BKE_main.h" #include "BKE_animsys.h" #include "BKE_boids.h" #include "BKE_cdderivedmesh.h" @@ -3607,7 +3608,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra)) // ok, start loading strcpy(filename, fss->surfdataPath); strcat(filename, suffix); - BLI_path_abs(filename, G.sce); + BLI_path_abs(filename, G.main->name); BLI_path_frame(filename, curFrame, 0); // fixed #frame-no strcat(filename, suffix2); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 3896d523b11..37d2b103ef0 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1085,7 +1085,7 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup static int ptcache_path(PTCacheID *pid, char *filename) { Library *lib= (pid->ob)? pid->ob->id.lib: NULL; - const char *blendfilename= (lib && (pid->cache->flag & PTCACHE_IGNORE_LIBPATH)==0) ? lib->filepath: G.sce; + const char *blendfilename= (lib && (pid->cache->flag & PTCACHE_IGNORE_LIBPATH)==0) ? lib->filepath: G.main->name; size_t i; if(pid->cache->flag & PTCACHE_EXTERNAL) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index fde180cadc6..e399e0bb83d 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -566,11 +566,11 @@ Scene *set_scene_name(Main *bmain, char *name) Scene *sce= (Scene *)find_id("SC", name); if(sce) { set_scene_bg(bmain, sce); - printf("Scene switch: '%s' in file: '%s'\n", name, G.sce); + printf("Scene switch: '%s' in file: '%s'\n", name, G.main->name); return sce; } - printf("Can't find scene: '%s' in file: '%s'\n", name, G.sce); + printf("Can't find scene: '%s' in file: '%s'\n", name, G.main->name); return NULL; } diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 6d087837302..21b7cfd010c 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -579,7 +579,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range) if (seq->type != SEQ_SCENE && seq->type != SEQ_META && seq->type != SEQ_IMAGE) { BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name); - BLI_path_abs(str, G.sce); + BLI_path_abs(str, G.main->name); } if (seq->type == SEQ_IMAGE) { @@ -1044,7 +1044,7 @@ static int seq_proxy_get_fname(Scene *UNUSED(scene), Sequence * seq, int cfra, c if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { BLI_join_dirfile(name, dir, seq->strip->proxy->file); - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); return TRUE; } @@ -1071,7 +1071,7 @@ static int seq_proxy_get_fname(Scene *UNUSED(scene), Sequence * seq, int cfra, c render_size); } - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); BLI_path_frame(name, frameno, 0); @@ -2002,7 +2002,7 @@ static ImBuf * seq_render_strip(Main *bmain, Scene *scene, Sequence * seq, float if(ibuf == 0 && s_elem) { BLI_join_dirfile(name, seq->strip->dir, s_elem->name); - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); ibuf = seq_proxy_fetch(scene, seq, cfra, render_size); } @@ -2038,7 +2038,7 @@ static ImBuf * seq_render_strip(Main *bmain, Scene *scene, Sequence * seq, float BLI_join_dirfile(name, seq->strip->dir, seq->strip->stripdata->name); - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); seq->anim = openanim( name, IB_rect | @@ -3492,7 +3492,7 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo struct anim *an; BLI_strncpy(path, seq_load->path, sizeof(path)); - BLI_path_abs(path, G.sce); + BLI_path_abs(path, G.main->name); an = openanim(path, IB_rect); diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 5c3047942f7..cc941c81131 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -131,7 +131,7 @@ struct bSound* sound_new_file(struct Main *bmain, char* filename) strcpy(str, filename); - path = /*bmain ? bmain->name :*/ G.sce; + path = /*bmain ? bmain->name :*/ G.main->name; BLI_path_abs(str, path); @@ -267,7 +267,7 @@ void sound_load(struct Main *UNUSED(bmain), struct bSound* sound) path = sound->id.lib->filepath; else // XXX this should be fixed! - path = /*bmain ? bmain->name :*/ G.sce; + path = /*bmain ? bmain->name :*/ G.main->name; BLI_path_abs(fullpath, path); diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 19bc853276a..bb1a1a88a09 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -241,7 +241,7 @@ int reopen_text(Text *text) if (!text || !text->name) return 0; BLI_strncpy(str, text->name, FILE_MAXDIR+FILE_MAXFILE); - BLI_path_abs(str, G.sce); + BLI_path_abs(str, G.main->name); fp= fopen(str, "r"); if(fp==NULL) return 0; diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 8363ff13ef9..de708f216fd 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -40,6 +40,7 @@ #include "BLI_blenlib.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_report.h" #include "BKE_utildefines.h" #include "BKE_writeavi.h" @@ -119,7 +120,7 @@ static void filepath_avi (char *string, RenderData *rd) if (string==NULL) return; strcpy(string, rd->pic); - BLI_path_abs(string, G.sce); + BLI_path_abs(string, G.main->name); BLI_make_existing_file(string); diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 473c10d6ced..ec998e68e00 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -857,7 +857,7 @@ void filepath_ffmpeg(char* string, RenderData* rd) { if (!string || !exts) return; strcpy(string, rd->pic); - BLI_path_abs(string, G.sce); + BLI_path_abs(string, G.main->name); BLI_make_existing_file(string); diff --git a/source/blender/blenlib/BLI_bpath.h b/source/blender/blenlib/BLI_bpath.h index 72489a171b9..34b9e282061 100644 --- a/source/blender/blenlib/BLI_bpath.h +++ b/source/blender/blenlib/BLI_bpath.h @@ -50,7 +50,7 @@ struct BPathIterator { void (*setpath_callback)(struct BPathIterator *, char *); void (*getpath_callback)(struct BPathIterator *, char *); - char* base_path; /* base path, the directry the blend file is in - normally G.sce */ + char* base_path; /* base path, the directry the blend file is in - normally G.main->name */ /* only for seq data */ struct BPathIteratorSeqData seqdata; diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index cf7eb873409..862df4103a7 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -92,7 +92,7 @@ void BLI_bpathIterator_init( struct BPathIterator *bpi, char *base_path ) { bpi->seqdata.seqar = NULL; bpi->seqdata.scene = NULL; - bpi->base_path= base_path ? base_path : G.sce; + bpi->base_path= base_path ? base_path : G.main->name; BLI_bpathIterator_step(bpi); } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ebd407e7e21..b6515863c2b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9707,7 +9707,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) { char str[FILE_MAX]; BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name); - BLI_path_abs(str, G.sce); + BLI_path_abs(str, G.main->name); seq->sound = sound_new_file(main, str); } /* don't know, if anybody used that @@ -12369,7 +12369,7 @@ static Main* library_append_begin(const bContext *C, FileData **fd, char *dir) blo_split_main(&(*fd)->mainlist, mainvar); /* which one do we need? */ - mainl = blo_find_main(*fd, &(*fd)->mainlist, dir, G.sce); + mainl = blo_find_main(*fd, &(*fd)->mainlist, dir, G.main->name); /* needed for do_version */ mainl->versionfile= (*fd)->fileversion; @@ -12453,7 +12453,7 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in BLI_strncpy(curlib->name, curlib->filepath, sizeof(curlib->name)); /* uses current .blend file as reference */ - BLI_path_rel(curlib->name, G.sce); + BLI_path_rel(curlib->name, G.main->name); } blo_join_main(&(*fd)->mainlist); @@ -12462,7 +12462,7 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in lib_link_all(*fd, mainvar); lib_verify_nodetree(mainvar, FALSE); - fix_relpaths_library(G.sce, mainvar); /* make all relative paths, relative to the open blend file */ + fix_relpaths_library(G.main->name, mainvar); /* make all relative paths, relative to the open blend file */ /* give a base to loose objects. If group append, do it for objects too */ if(scene) { @@ -12578,7 +12578,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) while(fd==NULL) { char newlib_path[240] = { 0 }; printf("Missing library...'\n"); - printf(" current file: %s\n", G.sce); + printf(" current file: %s\n", G.main->name); printf(" absolute lib: %s\n", mainptr->curlib->filepath); printf(" relative lib: %s\n", mainptr->curlib->name); printf(" enter a new path:\n"); @@ -12586,7 +12586,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) if(scanf("%s", newlib_path) > 0) { strcpy(mainptr->curlib->name, newlib_path); strcpy(mainptr->curlib->filepath, newlib_path); - cleanup_path(G.sce, mainptr->curlib->filepath); + cleanup_path(G.main->name, mainptr->curlib->filepath); fd= blo_openblenderfile(mainptr->curlib->filepath, basefd->reports); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 440f1cc98a8..b5715353c6c 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2471,14 +2471,14 @@ int BLO_write_file(Main *mainvar, char *dir, int write_flags, ReportList *report if(strcmp(dir1, dir2)==0) write_flags &= ~G_FILE_RELATIVE_REMAP; else - makeFilesAbsolute(G.sce, NULL); + makeFilesAbsolute(G.main->name, NULL); } - BLI_make_file_string(G.sce, userfilename, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_STARTUP_FILE); + BLI_make_file_string(G.main->name, userfilename, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_STARTUP_FILE); write_user_block= BLI_streq(dir, userfilename); if(write_flags & G_FILE_RELATIVE_REMAP) - makeFilesRelative(dir, NULL); /* note, making relative to something OTHER then G.sce */ + makeFilesRelative(dir, NULL); /* note, making relative to something OTHER then G.main->name */ /* actual file writing */ err= write_file_handle(mainvar, file, NULL,NULL, write_user_block, write_flags, thumb); diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp index ce40846ba59..3194b2269ea 100644 --- a/source/blender/collada/ImageExporter.cpp +++ b/source/blender/collada/ImageExporter.cpp @@ -32,6 +32,7 @@ #include "DNA_texture_types.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_utildefines.h" #include "BLI_fileops.h" #include "BLI_path_util.h" @@ -66,13 +67,13 @@ void ImagesExporter::operator()(Material *ma, Object *ob) BLI_split_dirfile(mfilename, dir, NULL); - BKE_rebase_path(abs, sizeof(abs), rel, sizeof(rel), G.sce, image->name, dir); + BKE_rebase_path(abs, sizeof(abs), rel, sizeof(rel), G.main->name, image->name, dir); if (abs[0] != '\0') { // make absolute source path BLI_strncpy(src, image->name, sizeof(src)); - BLI_path_abs(src, G.sce); + BLI_path_abs(src, G.main->name); // make dest directory if it doesn't exist BLI_make_existing_file(abs); diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 855ca45f61a..81b04fea062 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -564,7 +564,7 @@ static void ui_draw_but_CHARTAB(uiBut *but) int err; strcpy(tmpStr, G.selfont->name); - BLI_path_abs(tmpStr, G.sce); + BLI_path_abs(tmpStr, G.main->name); err = FTF_SetFont((unsigned char *)tmpStr, 0, 14.0); } } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 3bdf202aca9..c273b375a06 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1058,7 +1058,7 @@ static int multires_external_save_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", path); if(relative) - BLI_path_rel(path, G.sce); + BLI_path_rel(path, G.main->name); CustomData_external_add(&me->fdata, &me->id, CD_MDISPS, me->totface, path); CustomData_external_write(&me->fdata, &me->id, CD_MASK_MESH, me->totface, 0); diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 6dc4684d815..b1c373e7a91 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -639,7 +639,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF // prepare names... strncpy(targetDir, domainSettings->surfdataPath, FILE_MAXDIR); strncpy(newSurfdataPath, domainSettings->surfdataPath, FILE_MAXDIR); - BLI_path_abs(targetDir, G.sce); // fixed #frame-no + BLI_path_abs(targetDir, G.main->name); // fixed #frame-no strcpy(targetFile, targetDir); strcat(targetFile, suffixConfig); @@ -663,7 +663,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF char blendFile[FILE_MAXDIR+FILE_MAXFILE]; // invalid dir, reset to current/previous - strcpy(blendDir, G.sce); + strcpy(blendDir, G.main->name); BLI_splitdirstring(blendDir, blendFile); if(strlen(blendFile)>6){ int len = strlen(blendFile); @@ -694,7 +694,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF if(selection<1) return 0; // 0 from menu, or -1 aborted strcpy(targetDir, newSurfdataPath); strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR); - BLI_path_abs(targetDir, G.sce); // fixed #frame-no + BLI_path_abs(targetDir, G.main->name); // fixed #frame-no } #endif return outStringsChanged; diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 21f10d936bf..0e8587e4642 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -111,7 +111,7 @@ ImBuf* get_brush_icon(Brush *brush) // first use the path directly to try and load the file BLI_strncpy(path, brush->icon_filepath, sizeof(brush->icon_filepath)); - BLI_path_abs(path, G.sce); + BLI_path_abs(path, G.main->name); brush->icon_imbuf= IMB_loadiffname(path, flags); @@ -121,7 +121,7 @@ ImBuf* get_brush_icon(Brush *brush) path[0]= 0; - BLI_make_file_string(G.sce, path, folder, brush->icon_filepath); + BLI_make_file_string(G.main->name, path, folder, brush->icon_filepath); if (path[0]) brush->icon_imbuf= IMB_loadiffname(path, flags); diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index bca8100a809..9db15ee43e5 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -852,7 +852,7 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int ibuf->profile = IB_PROFILE_LINEAR_RGB; /* to save, we first get absolute path */ - BLI_path_abs(str, G.sce); + BLI_path_abs(str, G.main->name); if (BKE_write_ibuf(scene, ibuf, str, imtype, scene->r.subimtype, scene->r.quality)) { retval = OPERATOR_FINISHED; @@ -863,7 +863,7 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int } /* in case we were saving with relative paths, change back again */ if(relative) - BLI_path_rel(str, G.sce); + BLI_path_rel(str, G.main->name); IMB_freeImBuf(ibuf); ibuf = NULL; @@ -908,7 +908,7 @@ static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event //RNA_enum_set(op->ptr, "file_type", scene->r.imtype); - RNA_string_set(op->ptr, "filepath", G.sce); + RNA_string_set(op->ptr, "filepath", G.main->name); WM_event_add_fileselect(C, op); return OPERATOR_RUNNING_MODAL; diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 937441a6e43..082c9f2f721 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -42,6 +42,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_image.h" #include "BKE_report.h" #include "BKE_writeavi.h" @@ -77,7 +78,7 @@ static int screenshot_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", path); strcpy(G.ima, path); - BLI_path_abs(path, G.sce); + BLI_path_abs(path, G.main->name); /* BKE_add_image_extension() checks for if extension was already set */ if(scene->r.scemode & R_EXTENSION) diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 2573470e8df..e72446366fe 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -39,6 +39,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_main.h" #include "WM_api.h" #include "WM_types.h" @@ -104,7 +105,7 @@ static int file_browse_exec(bContext *C, wmOperator *op) /* add slash for directories, important for some properties */ if(RNA_property_subtype(fbo->prop) == PROP_DIRPATH) { id = fbo->ptr.id.data; - base = (id && id->lib)? id->lib->filepath: G.sce; + base = (id && id->lib)? id->lib->filepath: G.main->name; BLI_strncpy(path, str, FILE_MAX); BLI_path_abs(path, base); diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 421b14e5bbe..65415d382ec 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -40,6 +40,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BLF_api.h" @@ -445,9 +446,9 @@ static void renamebutton_cb(bContext *C, void *UNUSED(arg1), char *oldname) struct direntry *file = (struct direntry *)arg1; #endif - BLI_make_file_string(G.sce, orgname, sfile->params->dir, oldname); + BLI_make_file_string(G.main->name, orgname, sfile->params->dir, oldname); BLI_strncpy(filename, sfile->params->renameedit, sizeof(filename)); - BLI_make_file_string(G.sce, newname, sfile->params->dir, filename); + BLI_make_file_string(G.main->name, newname, sfile->params->dir, filename); if( strcmp(orgname, newname) != 0 ) { if (!BLI_exists(newname)) { diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 6dfdcfd430a..1af8e9d14be 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -30,6 +30,7 @@ #include "BKE_screen.h" #include "BKE_global.h" #include "BKE_report.h" +#include "BKE_main.h" #include "BLI_blenlib.h" #include "BLI_storage_types.h" @@ -190,7 +191,7 @@ static FileSelect file_select(bContext* C, const rcti* rect, short selecting, sh /* avoids /../../ */ BLI_parent_dir(params->dir); } else { - BLI_cleanup_dir(G.sce, params->dir); + BLI_cleanup_dir(G.main->name, params->dir); strcat(params->dir, file->relname); BLI_add_slash(params->dir); } @@ -361,7 +362,7 @@ static int bookmark_select_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "dir", entry); BLI_strncpy(params->dir, entry, sizeof(params->dir)); - BLI_cleanup_dir(G.sce, params->dir); + BLI_cleanup_dir(G.main->name, params->dir); file_change_dir(C, 1); WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); @@ -544,7 +545,7 @@ void file_sfile_to_operator(wmOperator *op, SpaceFile *sfile, char *filepath) BLI_join_dirfile(filepath, sfile->params->dir, sfile->params->file); if(RNA_struct_find_property(op->ptr, "relative_path")) { if(RNA_boolean_get(op->ptr, "relative_path")) { - BLI_path_rel(filepath, G.sce); + BLI_path_rel(filepath, G.main->name); } } @@ -680,7 +681,7 @@ int file_exec(bContext *C, wmOperator *exec_op) file_sfile_to_operator(op, sfile, filepath); fsmenu_insert_entry(fsmenu_get(), FS_CATEGORY_RECENT, sfile->params->dir,0, 1); - BLI_make_file_string(G.sce, filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE); + BLI_make_file_string(G.main->name, filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE); fsmenu_write_file(fsmenu_get(), filepath); WM_event_fileselect_event(C, op, EVT_FILESELECT_EXEC); @@ -711,7 +712,7 @@ int file_parent_exec(bContext *C, wmOperator *UNUSED(unused)) if(sfile->params) { if (BLI_has_parent(sfile->params->dir)) { BLI_parent_dir(sfile->params->dir); - BLI_cleanup_dir(G.sce, sfile->params->dir); + BLI_cleanup_dir(G.main->name, sfile->params->dir); file_change_dir(C, 0); WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); } @@ -1010,7 +1011,7 @@ int file_directory_exec(bContext *C, wmOperator *UNUSED(unused)) if (sfile->params->dir[0] == '\0') get_default_root(sfile->params->dir); #endif - BLI_cleanup_dir(G.sce, sfile->params->dir); + BLI_cleanup_dir(G.main->name, sfile->params->dir); BLI_add_slash(sfile->params->dir); file_change_dir(C, 1); @@ -1240,7 +1241,7 @@ int file_delete_exec(bContext *C, wmOperator *UNUSED(op)) file = filelist_file(sfile->files, sfile->params->active_file); - BLI_make_file_string(G.sce, str, sfile->params->dir, file->relname); + BLI_make_file_string(G.main->name, str, sfile->params->dir, file->relname); BLI_delete(str, 0, 0); ED_fileselect_clear(C, sfile); WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 68a93d39062..43d5d54805d 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -730,7 +730,7 @@ static void filelist_read_dir(struct FileList* filelist) BLI_getwdN(wdir); - BLI_cleanup_dir(G.sce, filelist->dir); + BLI_cleanup_dir(G.main->name, filelist->dir); filelist->numfiles = BLI_getdir(filelist->dir, &(filelist->filelist)); if(!chdir(wdir)) {} /* fix warning about not checking return value */ @@ -747,7 +747,7 @@ static void filelist_read_main(struct FileList* filelist) static void filelist_read_library(struct FileList* filelist) { if (!filelist) return; - BLI_cleanup_dir(G.sce, filelist->dir); + BLI_cleanup_dir(G.main->name, filelist->dir); filelist_from_library(filelist); if(!filelist->libfiledata) { int num; @@ -912,7 +912,7 @@ void filelist_from_library(struct FileList* filelist) return; } - BLI_strncpy(filename, G.sce, sizeof(filename)); // G.sce = last file loaded, for UI + BLI_strncpy(filename, G.main->name, sizeof(filename)); /* there we go */ /* for the time being only read filedata when libfiledata==0 */ @@ -979,7 +979,7 @@ void filelist_from_library(struct FileList* filelist) filelist_sort(filelist, FILE_SORT_ALPHA); - BLI_strncpy(G.sce, filename, sizeof(filename)); // prevent G.sce to change + BLI_strncpy(G.main->name, filename, sizeof(filename)); // prevent G.main->name to change filelist->filter = 0; filelist_filter(filelist); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index b36cfe66a36..8ad3ef08e85 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -64,6 +64,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BLF_api.h" @@ -104,7 +105,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) if (!sfile->params) { sfile->params= MEM_callocN(sizeof(FileSelectParams), "fileselparams"); /* set path to most recently opened .blend */ - BLI_split_dirfile(G.sce, sfile->params->dir, sfile->params->file); + BLI_split_dirfile(G.main->name, sfile->params->dir, sfile->params->file); sfile->params->filter_glob[0] = '\0'; } @@ -142,8 +143,8 @@ short ED_fileselect_set_params(SpaceFile *sfile) } if(params->dir[0]) { - BLI_cleanup_dir(G.sce, params->dir); - BLI_path_abs(params->dir, G.sce); + BLI_cleanup_dir(G.main->name, params->dir); + BLI_path_abs(params->dir, G.main->name); } params->filter = 0; diff --git a/source/blender/editors/space_file/writeimage.c b/source/blender/editors/space_file/writeimage.c index f5ce5a818d7..750cf98727a 100644 --- a/source/blender/editors/space_file/writeimage.c +++ b/source/blender/editors/space_file/writeimage.c @@ -41,6 +41,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_image.h" #include "RE_pipeline.h" @@ -75,7 +76,7 @@ static void save_rendered_image_cb_real(char *name, int confirm) BKE_add_image_extension(name, scene->r.imtype); strcpy(str, name); - BLI_path_abs(str, G.sce); + BLI_path_abs(str, G.main->name); if (confirm) overwrite = saveover(str); @@ -218,7 +219,7 @@ void BIF_save_rendered_image_fs(Scene *scene) char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2]; if(G.ima[0]==0) { - strcpy(dir, G.sce); + strcpy(dir, G.main->name); BLI_splitdirstring(dir, str); strcpy(G.ima, dir); } diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index a44258351ce..429ba64ed0f 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -133,7 +133,7 @@ static int space_image_file_exists_poll(bContext *C) ibuf= ED_space_image_acquire_buffer(sima, &lock); if(ibuf) { BLI_strncpy(name, ibuf->name, FILE_MAX); - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); poll= (BLI_exists(name) && BLI_is_writable(name)); } ED_space_image_release_buffer(sima, lock); @@ -856,7 +856,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera int relative= (RNA_struct_find_property(op->ptr, "relative_path") && RNA_boolean_get(op->ptr, "relative_path")); int save_copy= (RNA_struct_find_property(op->ptr, "copy") && RNA_boolean_get(op->ptr, "copy")); - BLI_path_abs(path, G.sce); + BLI_path_abs(path, G.main->name); if(scene->r.scemode & R_EXTENSION) { BKE_add_image_extension(path, sima->imtypenr); @@ -876,7 +876,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera RE_WriteRenderResult(rr, path, scene->r.quality); if(relative) - BLI_path_rel(path, G.sce); /* only after saving */ + BLI_path_rel(path, G.main->name); /* only after saving */ if(!save_copy) { if(do_newpath) { @@ -896,7 +896,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera else if (BKE_write_ibuf(scene, ibuf, path, sima->imtypenr, scene->r.subimtype, scene->r.quality)) { if(relative) - BLI_path_rel(path, G.sce); /* only after saving */ + BLI_path_rel(path, G.main->name); /* only after saving */ if(!save_copy) { if(do_newpath) { @@ -1071,7 +1071,7 @@ static int save_exec(bContext *C, wmOperator *op) if(name[0]==0) BLI_strncpy(name, G.ima, FILE_MAX); else - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); if(BLI_exists(name) && BLI_is_writable(name)) { rr= BKE_image_acquire_renderresult(scene, ima); @@ -1157,7 +1157,7 @@ static int save_sequence_exec(bContext *C, wmOperator *op) char name[FILE_MAX]; BLI_strncpy(name, ibuf->name, sizeof(name)); - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); if(0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) { BKE_reportf(op->reports, RPT_ERROR, "Could not write image %s.", name); diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index c87b25877b4..aeb32cda6bd 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -191,7 +191,7 @@ static int make_paths_relative_exec(bContext *UNUSED(C), wmOperator *op) return OPERATOR_CANCELLED; } - makeFilesRelative(G.sce, op->reports); + makeFilesRelative(G.main->name, op->reports); return OPERATOR_FINISHED; } @@ -218,7 +218,7 @@ static int make_paths_absolute_exec(bContext *UNUSED(C), wmOperator *op) return OPERATOR_CANCELLED; } - makeFilesAbsolute(G.sce, op->reports); + makeFilesAbsolute(G.main->name, op->reports); return OPERATOR_FINISHED; } @@ -244,7 +244,7 @@ static int report_missing_files_exec(bContext *UNUSED(C), wmOperator *op) txtname[0] = '\0'; /* run the missing file check */ - checkMissingFiles(G.sce, op->reports); + checkMissingFiles(G.main->name, op->reports); return OPERATOR_FINISHED; } @@ -269,7 +269,7 @@ static int find_missing_files_exec(bContext *UNUSED(C), wmOperator *op) char *path; path= RNA_string_get_alloc(op->ptr, "filepath", NULL, 0); - findMissingFiles(path, G.sce); + findMissingFiles(path, G.main->name); MEM_freeN(path); return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 6040b755e30..1f0725c5458 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -5035,7 +5035,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname) if (te->idcode == ID_LI) { char expanded[FILE_MAXDIR + FILE_MAXFILE]; BLI_strncpy(expanded, ((Library *)tselem->id)->name, FILE_MAXDIR + FILE_MAXFILE); - BLI_path_abs(expanded, G.sce); + BLI_path_abs(expanded, G.main->name); if (!BLI_exists(expanded)) { error("This path does not exist, correct this before saving"); } diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index b9db18f7850..5f0693dc43c 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -101,7 +101,7 @@ static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op, if(last_seq && last_seq->strip && SEQ_HAS_PATH(last_seq)) { char path[sizeof(last_seq->strip->dir)]; BLI_strncpy(path, last_seq->strip->dir, sizeof(path)); - BLI_path_abs(path, G.sce); + BLI_path_abs(path, G.main->name); RNA_string_set(op->ptr, identifier, path); } } @@ -152,7 +152,7 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op) } if((is_file != -1) && relative) - BLI_path_rel(seq_load->path, G.sce); + BLI_path_rel(seq_load->path, G.main->name); if (RNA_struct_find_property(op->ptr, "frame_end")) { diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index bd53615feda..35f27953633 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -992,7 +992,7 @@ void touch_seq_files(Scene *scene) if(seq->flag & SELECT) { if(seq->type==SEQ_MOVIE) { if(seq->strip && seq->strip->stripdata) { - BLI_make_file_string(G.sce, str, seq->strip->dir, seq->strip->stripdata->name); + BLI_make_file_string(G.main->name, str, seq->strip->dir, seq->strip->stripdata->name); BLI_touch(seq->name); } } diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 90fab7b2902..8d4f3f87f66 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -221,7 +221,7 @@ static int open_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", str); - text= add_text(str, G.sce); + text= add_text(str, G.main->name); if(!text) { if(op->customdata) MEM_freeN(op->customdata); @@ -266,7 +266,7 @@ static int open_exec(bContext *C, wmOperator *op) static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { Text *text= CTX_data_edit_text(C); - char *path= (text && text->name)? text->name: G.sce; + char *path= (text && text->name)? text->name: G.main->name; if(RNA_property_is_set(op->ptr, "filepath")) return open_exec(C, op); @@ -438,7 +438,7 @@ static void txt_write_file(Text *text, ReportList *reports) char file[FILE_MAXDIR+FILE_MAXFILE]; BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE); - BLI_path_abs(file, G.sce); + BLI_path_abs(file, G.main->name); fp= fopen(file, "w"); if(fp==NULL) { @@ -524,7 +524,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) else if(text->flags & TXT_ISMEM) str= text->id.name+2; else - str= G.sce; + str= G.main->name; RNA_string_set(op->ptr, "filepath", str); WM_event_add_fileselect(C, op); @@ -2860,7 +2860,7 @@ int text_file_modified(Text *text) return 0; BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE); - BLI_path_abs(file, G.sce); + BLI_path_abs(file, G.main->name); if(!BLI_exists(file)) return 2; @@ -2888,7 +2888,7 @@ static void text_ignore_modified(Text *text) if(!text || !text->name) return; BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE); - BLI_path_abs(file, G.sce); + BLI_path_abs(file, G.main->name); if(!BLI_exists(file)) return; diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 70438ae3d8c..74d61101273 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -41,7 +41,7 @@ #include "BKE_packedFile.h" #include "BKE_main.h" #include "BKE_utildefines.h" -#include "BKE_global.h" /* grr: G.sce */ +#include "BKE_global.h" /* grr: G.main->name */ #include "IMB_imbuf.h" @@ -90,7 +90,7 @@ static void rna_Image_save(Image *image, ReportList *reports) if(ibuf) { char filename[FILE_MAXDIR + FILE_MAXFILE]; BLI_strncpy(filename, image->name, sizeof(filename)); - BLI_path_abs(filename, G.sce); + BLI_path_abs(filename, G.main->name); if(image->packedfile) { if (writePackedFile(reports, image->name, image->packedfile, 0) != RET_OK) { diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 176a52251e7..fb3eb74a919 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -43,10 +43,11 @@ #include "BLI_blenlib.h" #include "BLI_math.h" +#include "BKE_main.h" #include "BKE_cdderivedmesh.h" #include "BKE_mesh.h" #include "BKE_utildefines.h" -#include "BKE_global.h" /* G.sce only */ +#include "BKE_global.h" /* G.main->name only */ #include "MOD_modifiertypes.h" @@ -482,7 +483,7 @@ DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData *fluid strcat(targetDir,"fluidsurface_final_####"); } - BLI_path_abs(targetDir, G.sce); + BLI_path_abs(targetDir, G.main->name); BLI_path_frame(targetDir, curFrame, 0); // fixed #frame-no strcpy(targetFile,targetDir); diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index 568cef0f676..6d42c794583 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -33,7 +33,7 @@ #include "BKE_utildefines.h" /* UNUSED */ #include "BKE_text.h" /* txt_to_buf */ #include "BKE_main.h" -#include "BKE_global.h" /* grr, only for G.sce */ +#include "BKE_global.h" /* grr, only for G.main->name */ #include "BLI_listbase.h" #include "BLI_path_util.h" #include "BLI_string.h" @@ -62,7 +62,7 @@ void bpy_import_main_set(struct Main *maggie) /* returns a dummy filename for a textblock so we can tell what file a text block comes from */ void bpy_text_filename_get(char *fn, Text *text) { - sprintf(fn, "%s/%s", text->id.lib ? text->id.lib->filepath : G.sce, text->id.name+2); + sprintf(fn, "%s/%s", text->id.lib ? text->id.lib->filepath : G.main->name, text->id.name+2); /* XXX, this is a bug in python's Py_CompileString()! the string encoding should not be required to be utf-8 diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index 9664a5b16f8..de16fba9a30 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -494,7 +494,7 @@ void filepath_qt(char *string, RenderData *rd) { if (string==0) return; strcpy(string, rd->pic); - BLI_path_abs(string, G.sce); + BLI_path_abs(string, G.main->name); BLI_make_existing_file(string); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index a2f08d96251..7230e0b3909 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -452,7 +452,7 @@ static void render_unique_exr_name(Render *re, char *str, int sample) { char di[FILE_MAX], name[FILE_MAXFILE+MAX_ID_NAME+100], fi[FILE_MAXFILE]; - BLI_strncpy(di, G.sce, FILE_MAX); + BLI_strncpy(di, G.main->name, FILE_MAX); BLI_splitdirstring(di, fi); if(sample==0) @@ -2032,7 +2032,7 @@ static void load_backbuffer(Render *re) char name[256]; strcpy(name, re->r.backbuf); - BLI_path_abs(name, G.sce); + BLI_path_abs(name, G.main->name); BLI_path_frame(name, re->r.cfra, 0); if(re->backbuf) { diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 66d2a1efdea..00a686c0d74 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -335,13 +335,10 @@ void WM_read_file(bContext *C, char *name, ReportList *reports) /* called on startup, (context entirely filled with NULLs) */ /* or called for 'New File' */ /* op can be NULL */ -/* note: G.sce is used to store the last saved path so backup and restore after loading - * G.main->name is similar to G.sce but when loading from memory set the name to startup.blend - * ...this could be changed but seems better then setting to "" */ int WM_read_homefile(bContext *C, wmOperator *op) { ListBase wmbase; - char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAXDIR]; + char tstr[FILE_MAXDIR+FILE_MAXFILE]; int from_memory= op && strcmp(op->type->idname, "WM_OT_read_factory_settings")==0; int success; @@ -351,7 +348,7 @@ int WM_read_homefile(bContext *C, wmOperator *op) if (!from_memory) { char *cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL); if (cfgdir) { - BLI_make_file_string(G.sce, tstr, cfgdir, BLENDER_STARTUP_FILE); + BLI_make_file_string(G.main->name, tstr, cfgdir, BLENDER_STARTUP_FILE); } else { tstr[0] = '\0'; from_memory = 1; @@ -360,7 +357,6 @@ int WM_read_homefile(bContext *C, wmOperator *op) } } } - strcpy(scestr, G.sce); /* temporary store */ /* prevent loading no UI */ G.fileflags &= ~G_FILE_NO_UI; @@ -383,7 +379,6 @@ int WM_read_homefile(bContext *C, wmOperator *op) wm_window_match_do(C, &wmbase); WM_check(C); /* opens window(s), checks keymaps */ - strcpy(G.sce, scestr); /* restore */ G.main->name[0]= '\0'; wm_init_userdef(C); @@ -440,9 +435,6 @@ void read_history(void) for (l= lines, num= 0; l && (numnext) { line = l->link; if (line[0] && BLI_exists(line)) { - if (num==0) - strcpy(G.sce, line); /* note: this seems highly dodgy since the file isnt actually read. please explain. - campbell */ - recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile"); BLI_addtail(&(G.recent_files), recent); recent->filepath = (char*)MEM_mallocN(sizeof(char)*(strlen(line)+1), "name of file"); @@ -468,14 +460,14 @@ static void write_history(void) recent = G.recent_files.first; /* refresh recent-files.txt of recent opened files, when current file was changed */ - if(!(recent) || (strcmp(recent->filepath, G.sce)!=0)) { + if(!(recent) || (strcmp(recent->filepath, G.main->name)!=0)) { fp= fopen(name, "w"); if (fp) { /* add current file to the beginning of list */ recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile"); - recent->filepath = (char*)MEM_mallocN(sizeof(char)*(strlen(G.sce)+1), "name of file"); + recent->filepath = (char*)MEM_mallocN(sizeof(char)*(strlen(G.main->name)+1), "name of file"); recent->filepath[0] = '\0'; - strcpy(recent->filepath, G.sce); + strcpy(recent->filepath, G.main->name); BLI_addhead(&(G.recent_files), recent); /* write current file to recent-files.txt */ fprintf(fp, "%s\n", recent->filepath); @@ -484,7 +476,7 @@ static void write_history(void) /* write rest of recent opened files to recent-files.txt */ while((ifilepath, G.sce)!=0) { + if (strcmp(recent->filepath, G.main->name)!=0) { fprintf(fp, "%s\n", recent->filepath); recent = recent->next; } @@ -572,7 +564,7 @@ static ImBuf *blend_file_thumb(Scene *scene, int **thumb_pt) int write_crash_blend(void) { char path[FILE_MAX]; - BLI_strncpy(path, G.sce, sizeof(path)); + BLI_strncpy(path, G.main->name, sizeof(path)); BLI_replace_extension(path, sizeof(path), "_crash.blend"); if(BLO_write_file(G.main, path, G.fileflags, NULL, NULL)) { printf("written: %s\n", path); @@ -634,7 +626,6 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re if (BLO_write_file(CTX_data_main(C), di, fileflags, reports, thumb)) { if(!copy) { - strcpy(G.sce, di); G.relbase_valid = 1; strcpy(G.main->name, di); /* is guaranteed current file */ diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 983361f01ff..b319058ce5c 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -167,10 +167,10 @@ void WM_init(bContext *C, int argc, char **argv) read_history(); - if(G.sce[0] == 0) - BLI_make_file_string("/", G.sce, BLI_getDefaultDocumentFolder(), "untitled.blend"); + if(G.main->name[0] == 0) + BLI_make_file_string("/", G.main->name, BLI_getDefaultDocumentFolder(), "untitled.blend"); - BLI_strncpy(G.lib, G.sce, FILE_MAX); + BLI_strncpy(G.lib, G.main->name, FILE_MAX); } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index ef3c8fb789e..de08c209d06 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1440,7 +1440,7 @@ static void open_set_use_scripts(wmOperator *op) static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { - RNA_string_set(op->ptr, "filepath", G.sce); + RNA_string_set(op->ptr, "filepath", G.main->name); open_set_load_ui(op); open_set_use_scripts(op); @@ -1773,7 +1773,7 @@ static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUS save_set_compress(op); - BLI_strncpy(name, G.sce, FILE_MAX); + BLI_strncpy(name, G.main->name, FILE_MAX); untitled(name); RNA_string_set(op->ptr, "filepath", name); @@ -1794,7 +1794,7 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op) if(RNA_property_is_set(op->ptr, "filepath")) RNA_string_get(op->ptr, "filepath", path); else { - BLI_strncpy(path, G.sce, FILE_MAX); + BLI_strncpy(path, G.main->name, FILE_MAX); untitled(path); } @@ -1859,7 +1859,7 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED( save_set_compress(op); - BLI_strncpy(name, G.sce, FILE_MAX); + BLI_strncpy(name, G.main->name, FILE_MAX); untitled(name); RNA_string_set(op->ptr, "filepath", name); @@ -1905,7 +1905,7 @@ static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *event) { if(!RNA_property_is_set(op->ptr, "filepath")) { char filepath[FILE_MAX]; - BLI_strncpy(filepath, G.sce, sizeof(filepath)); + BLI_strncpy(filepath, G.main->name, sizeof(filepath)); BLI_replace_extension(filepath, sizeof(filepath), ".dae"); RNA_string_set(op->ptr, "filepath", filepath); } diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index fbc77d0d06d..69a29092058 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -45,6 +45,7 @@ #include "BKE_blender.h" #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_utildefines.h" #include "BIF_gl.h" @@ -260,17 +261,15 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win) else { /* this is set to 1 if you don't have startup.blend open */ - if(G.save_over) { - char *str= MEM_mallocN(strlen(G.sce) + 16, "title"); + if(G.save_over && G.main->name[0]) { + char str[sizeof(G.main->name) + 12]; if(wm->file_saved) - sprintf(str, "Blender [%s]", G.sce); + sprintf(str, "Blender [%s]", G.main->name); else - sprintf(str, "Blender* [%s]", G.sce); + sprintf(str, "Blender* [%s]", G.main->name); GHOST_SetTitle(win->ghostwin, str); - - MEM_freeN(str); } else GHOST_SetTitle(win->ghostwin, "Blender"); -- cgit v1.2.3 From a293f76cdf36220bf6f9027b5bbf75bc2cbb3def Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 18 Oct 2010 06:52:10 +0000 Subject: Use DEBUG instead of NDEBUG --- source/blender/blenlib/intern/path_util.c | 4 ++-- source/blender/readblenfile/stub/BLO_readblenfileSTUB.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 23972c64ee1..61b525d50af 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1607,7 +1607,7 @@ void BLI_where_am_i(char *fullname, const char *name) } while (temp); } } -#ifndef NDEBUG +#if defined(DEBUG) if (strcmp(name, fullname)) { printf("guessing '%s' == '%s'\n", name, fullname); } @@ -1620,7 +1620,7 @@ void BLI_where_am_i(char *fullname, const char *name) // with spawnv(P_WAIT, bprogname, argv) instead of system() but // that's even uglier GetShortPathName(fullname, fullname, FILE_MAXDIR+FILE_MAXFILE); -#ifndef NDEBUG +#if defined(DEBUG) printf("Shortname = '%s'\n", fullname); #endif #endif diff --git a/source/blender/readblenfile/stub/BLO_readblenfileSTUB.c b/source/blender/readblenfile/stub/BLO_readblenfileSTUB.c index 33e9bfec446..c5b523b106f 100644 --- a/source/blender/readblenfile/stub/BLO_readblenfileSTUB.c +++ b/source/blender/readblenfile/stub/BLO_readblenfileSTUB.c @@ -41,7 +41,7 @@ int BLO_read_runtime( char *file); BLO_readblenfilememory( char *fromBuffer, int fromBufferSize) { -#ifndef NDEBUG +#if defined(DEBUG) fprintf(GEN_errorstream, "Error BLO_readblenfilename is a stub\n"); #endif @@ -52,7 +52,7 @@ BLO_readblenfilememory( BLO_readblenfilename( char *fileName) { -#ifndef NDEBUG +#if defined(DEBUG) fprintf(GEN_errorstream, "Error BLO_readblenfilename is a stub\n"); #endif @@ -63,7 +63,7 @@ BLO_readblenfilename( BLO_readblenfilehandle( int fileHandle) { -#ifndef NDEBUG +#if defined(DEBUG) fprintf(GEN_errorstream, "Error BLO_readblenfilehandle is a stub\n"); #endif @@ -74,7 +74,7 @@ BLO_readblenfilehandle( BLO_is_a_runtime( char *file) { -#ifndef NDEBUG +#if defined(DEBUG) fprintf(GEN_errorstream, "Error BLO_is_a_runtime is a stub\n"); #endif @@ -85,7 +85,7 @@ BLO_is_a_runtime( BLO_read_runtime( char *file) { -#ifndef NDEBUG +#if defined(DEBUG) fprintf(GEN_errorstream, "Error BLO_read_runtime is a stub\n"); #endif -- cgit v1.2.3 From 8862afcb51c60ad0c5d0f077e25d8531728e2719 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Oct 2010 07:01:46 +0000 Subject: this should fix quicktime building from last commit. --- source/blender/quicktime/apple/quicktime_export.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender') diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index de16fba9a30..2623a598d5f 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -40,6 +40,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_report.h" #include "BKE_scene.h" -- cgit v1.2.3 From 9bd94eebc4d240203b89c7a0a3dfe800859ca636 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 18 Oct 2010 07:24:08 +0000 Subject: _DEBUG -> DEBUG --- source/blender/blenkernel/SConscript | 2 +- source/blender/blenkernel/intern/writeffmpeg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index bbc66ac14ea..954b7759b46 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -25,7 +25,7 @@ else: incs += ' ../python' incs += ' ' + env['BF_PYTHON_INC'] if env['BF_DEBUG']: - defs.append('_DEBUG') + defs.append('DEBUG') if env['WITH_BF_QUICKTIME']: incs += ' ../quicktime' diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index ec998e68e00..aae26da02dd 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -19,7 +19,7 @@ #include #include -#if defined(_WIN32) && defined(_DEBUG) && !defined(__MINGW32__) && !defined(__CYGWIN__) +#if defined(_WIN32) && defined(DEBUG) && !defined(__MINGW32__) && !defined(__CYGWIN__) /* This does not seem necessary or present on MSVC 8, but may be needed in earlier versions? */ #if _MSC_VER < 1400 #include -- cgit v1.2.3 From b7ad16983c8a105299d7fd3f17d4141b87d66f26 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Oct 2010 08:11:34 +0000 Subject: Camera object drawing now shows shift (not especially important but the tracker is being unusably slow) --- source/blender/editors/space_view3d/drawobject.c | 26 ++++++++++++++---------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index c9b8a086d22..e7a69642e9f 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1211,7 +1211,7 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob /* a standing up pyramid with (0,0,0) as top */ Camera *cam; World *wrld; - float nobmat[4][4], vec[8][4], fac, facx, facy, depth, aspx, aspy, caspx, caspy; + float nobmat[4][4], vec[8][4], fac, facx, facy, depth, aspx, aspy, caspx, caspy, shx, shy; int i; cam= ob->data; @@ -1233,6 +1233,8 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob if(rv3d->persp>=2 && cam->type==CAM_ORTHO && ob==v3d->camera) { facx= 0.5*cam->ortho_scale*caspx; facy= 0.5*cam->ortho_scale*caspy; + shx= cam->shiftx * cam->ortho_scale; + shy= cam->shifty * cam->ortho_scale; depth= -cam->clipsta-0.1; } else { @@ -1242,13 +1244,15 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob depth= - fac*cam->lens/16.0; facx= fac*caspx; facy= fac*caspy; + shx= cam->shiftx*fac*2; + shy= cam->shifty*fac*2; } vec[0][0]= 0.0; vec[0][1]= 0.0; vec[0][2]= 0.001; /* GLBUG: for picking at iris Entry (well thats old!) */ - vec[1][0]= facx; vec[1][1]= facy; vec[1][2]= depth; - vec[2][0]= facx; vec[2][1]= -facy; vec[2][2]= depth; - vec[3][0]= -facx; vec[3][1]= -facy; vec[3][2]= depth; - vec[4][0]= -facx; vec[4][1]= facy; vec[4][2]= depth; + vec[1][0]= shx + facx; vec[1][1]= shy + facy; vec[1][2]= depth; + vec[2][0]= shx + facx; vec[2][1]= shy - facy; vec[2][2]= depth; + vec[3][0]= shx - facx; vec[3][1]= shy - facy; vec[3][2]= depth; + vec[4][0]= shx - facx; vec[4][1]= shy + facy; vec[4][2]= depth; glBegin(GL_LINE_LOOP); glVertex3fv(vec[1]); @@ -1281,16 +1285,16 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob if (i==0) glBegin(GL_LINE_LOOP); else if (i==1 && (ob == v3d->camera)) glBegin(GL_TRIANGLES); else break; - - vec[0][0]= -0.7 * cam->drawsize; - vec[0][1]= cam->drawsize * (caspy + 0.1); + + vec[0][0]= shx + (-0.7 * cam->drawsize); + vec[0][1]= shy + (cam->drawsize * (caspy + 0.1)); glVertex3fv(vec[0]); /* left */ - vec[0][0] *= -1.0; + vec[0][0]= shx + (0.7 * cam->drawsize); glVertex3fv(vec[0]); /* right */ - vec[0][0]= 0.0; - vec[0][1]= 1.1 * cam->drawsize * (caspy + 0.7); + vec[0][0]= shx; + vec[0][1]= shy + (1.1 * cam->drawsize * (caspy + 0.7)); glVertex3fv(vec[0]); /* top */ glEnd(); -- cgit v1.2.3 From c092a18fcbfead6ed2936c74f504ece9f08e96d2 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Mon, 18 Oct 2010 08:17:04 +0000 Subject: [#24209] Texture Forcefields: Use Object Coordinates produces incorrect results (patch included) * Original patch provided by Alexander Beels and modified a bit by me. --- source/blender/blenkernel/intern/effect.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index f4fae3ed3c6..70e814ef956 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -264,6 +264,9 @@ static void add_object_to_effectors(ListBase **effectors, Scene *scene, Effector eff = new_effector_cache(scene, ob, NULL, ob->pd); + /* make sure imat is up to date */ + invert_m4_m4(ob->imat, ob->obmat); + BLI_addtail(*effectors, eff); } static void add_particles_to_effectors(ListBase **effectors, Scene *scene, EffectorWeights *weights, Object *ob, ParticleSystem *psys, ParticleSystem *psys_src) @@ -774,7 +777,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP } if(eff->pd->flag & PFIELD_TEX_OBJECT) { - mul_m4_v3(eff->ob->obmat, tex_co); + mul_m4_v3(eff->ob->imat, tex_co); } hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL,NULL, 0, result); -- cgit v1.2.3 From 9650667b3df2f39c35b7632720ff872265dfeaa5 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Mon, 18 Oct 2010 10:52:57 +0000 Subject: [#21475] Moving a Transform strip upwards moves its animation sidewards * F-Curve translation is now calculated from the difference of the strips original & resulting start time, instead of using the transform data directly. --- source/blender/editors/transform/transform_conversions.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 5de08d7832c..d723f77f537 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2284,11 +2284,10 @@ void flushTransNodes(TransInfo *t) } /* *** SEQUENCE EDITOR *** */ -#define XXX_DURIAN_ANIM_TX_HACK void flushTransSeq(TransInfo *t) { ListBase *seqbasep= seq_give_editing(t->scene, FALSE)->seqbasep; /* Editing null check already done */ - int a, new_frame; + int a, new_frame, old_start; TransData *td= NULL; TransData2D *td2d= NULL; TransDataSeq *tdsq= NULL; @@ -2305,16 +2304,11 @@ void flushTransSeq(TransInfo *t) for(a=0, td= t->data, td2d= t->data2d; atotal; a++, td++, td2d++) { tdsq= (TransDataSeq *)td->extra; seq= tdsq->seq; + old_start = seq->start; new_frame= (int)floor(td2d->loc[0] + 0.5f); switch (tdsq->sel_flag) { case SELECT: -#ifdef XXX_DURIAN_ANIM_TX_HACK - if (seq != seq_prev) { - int ofs = (new_frame - tdsq->start_offset) - seq->start; // breaks for single strips - color/image - seq_offset_animdata(t->scene, seq, ofs); - } -#endif if (seq->type != SEQ_META && (seq->depth != 0 || seq_tx_test(seq))) /* for meta's, their children move */ seq->start= new_frame - tdsq->start_offset; @@ -2345,6 +2339,9 @@ void flushTransSeq(TransInfo *t) else { calc_sequence_disp(t->scene, seq); } + + if(tdsq->sel_flag == SELECT) + seq_offset_animdata(t->scene, seq, seq->start - old_start); } seq_prev= seq; } @@ -3851,6 +3848,7 @@ static short constraints_list_needinv(TransInfo *t, ListBase *list) * seq->depth must be set before running this function so we know if the strips * are root level or not */ +#define XXX_DURIAN_ANIM_TX_HACK static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count, int *flag) { -- cgit v1.2.3 From 58683fa993e11d7bf888050e359b864f865d7c41 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Oct 2010 11:21:22 +0000 Subject: enable DEBUG define in CMake and scons, also change booleans debug option to BOP_DEBUG, which was used inconsistently, and had to add a define for superlu. --- source/blender/blenkernel/intern/object.c | 2 +- source/blender/blenlib/BLI_math_matrix.h | 4 ++-- source/blender/blenlib/intern/math_matrix.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 79030e3adfa..5237335e8ca 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1708,7 +1708,7 @@ void object_apply_mat4(Object *ob, float mat[][4]) /* rotation */ copy_m3_m4(mat3, mat); /* so scale doesnt interfear with rotation [#24291] */ - normalize_m3_m3(mat3_n, mat3); + normalize_m3_m3(mat3_n, (const float(*)[3])mat3); object_mat3_to_rot(ob, mat3_n, 0); diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h index 294546bb222..6b3d8bf9d0b 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -102,9 +102,9 @@ void transpose_m3(float R[3][3]); void transpose_m4(float R[4][4]); void normalize_m3(float R[3][3]); -void normalize_m3_m3(float R[3][3], float A[3][3]); +void normalize_m3_m3(float R[3][3], const float A[3][3]); void normalize_m4(float R[4][4]); -void normalize_m4_m4(float R[4][4], float A[4][4]); +void normalize_m4_m4(float R[4][4], const float A[4][4]); void orthogonalize_m3(float R[3][3], int axis); void orthogonalize_m4(float R[4][4], int axis); diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 197d3676367..9bbd0fc64ac 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -750,7 +750,7 @@ void normalize_m3(float mat[][3]) normalize_v3(mat[2]); } -void normalize_m3_m3(float rmat[][3], float mat[][3]) +void normalize_m3_m3(float rmat[][3], const float mat[][3]) { normalize_v3_v3(rmat[0], mat[0]); normalize_v3_v3(rmat[1], mat[1]); @@ -770,7 +770,7 @@ void normalize_m4(float mat[][4]) if(len!=0.0) mat[2][3]/= len; } -void normalize_m4_m4(float rmat[][4], float mat[][4]) +void normalize_m4_m4(float rmat[][4], const float mat[][4]) { float len; -- cgit v1.2.3 From afc8d8b3e3955d809615d9cd82541e5c7f8713ea Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Oct 2010 11:37:53 +0000 Subject: bugfix [#24306] Python : relative import error --- source/blender/python/generic/bpy_internal_import.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender') diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index 6d42c794583..3ee0c76a44a 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -198,18 +198,18 @@ static PyObject *blender_import(PyObject *UNUSED(self), PyObject *args, PyObjec char *name; int found= 0; PyObject *globals = NULL, *locals = NULL, *fromlist = NULL; - PyObject *newmodule; + int level= -1; /* relative imports */ + PyObject *newmodule; //PyObject_Print(args, stderr, 0); - int dummy_val; /* what does this do?*/ static char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", 0}; if( !PyArg_ParseTupleAndKeywords( args, kw, "s|OOOi:bpy_import_meth", kwlist, - &name, &globals, &locals, &fromlist, &dummy_val) ) + &name, &globals, &locals, &fromlist, &level) ) return NULL; /* import existing builtin modules or modules that have been imported already */ - newmodule = PyImport_ImportModuleEx( name, globals, locals, fromlist ); + newmodule= PyImport_ImportModuleLevel(name, globals, locals, fromlist, level); if(newmodule) return newmodule; -- cgit v1.2.3 From 799fc68234bbb8731439b8ecf3f782f69b11795c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Oct 2010 12:56:14 +0000 Subject: cflags, cxxflags & linkflags in buildinfo. --- source/blender/python/intern/bpy_app.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender') diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 46a3c93292b..39494678a12 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -39,6 +39,9 @@ extern char build_time[]; extern char build_rev[]; extern char build_platform[]; extern char build_type[]; +extern char build_cflags[]; +extern char build_cxxflags[]; +extern char build_linkflags[]; #endif static PyTypeObject BlenderAppType; @@ -55,6 +58,9 @@ static PyStructSequence_Field app_info_fields[] = { {"build_revision", "The subversion revision this blender instance was built with"}, {"build_platform", "The platform this blender instance was built for"}, {"build_type", "The type of build (Release, Debug)"}, + {"build_cflags", ""}, + {"build_cxxflags", ""}, + {"build_linkflags", ""}, {0} }; @@ -96,12 +102,18 @@ static PyObject *make_app_info(void) SetStrItem(build_rev); SetStrItem(build_platform); SetStrItem(build_type); + SetStrItem(build_cflags); + SetStrItem(build_cxxflags); + SetStrItem(build_linkflags); #else SetStrItem("Unknown"); SetStrItem("Unknown"); SetStrItem("Unknown"); SetStrItem("Unknown"); SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); + SetStrItem("Unknown"); #endif #undef SetIntItem -- cgit v1.2.3 From bf09c851a97aba67b19a5fc85a91d874e28d1df1 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Mon, 18 Oct 2010 17:55:11 +0000 Subject: quick commit for forgotten file in the G.sce -> G.main->name refactoring. Patch by Jens Verwiebe, many thanks. --- source/blender/quicktime/apple/qtkit_export.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m index 73e23ea8abd..14a1163ee9a 100644 --- a/source/blender/quicktime/apple/qtkit_export.m +++ b/source/blender/quicktime/apple/qtkit_export.m @@ -41,6 +41,7 @@ #include "AUD_C-API.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_scene.h" #include "BKE_report.h" @@ -208,7 +209,7 @@ void makeqtstring (RenderData *rd, char *string) { char txt[64]; strcpy(string, rd->pic); - BLI_path_abs(string, G.sce); + BLI_path_abs(string, G.main->name); BLI_make_existing_file(string); @@ -222,7 +223,7 @@ void filepath_qt(char *string, RenderData *rd) { if (string==NULL) return; strcpy(string, rd->pic); - BLI_path_abs(string, G.sce); + BLI_path_abs(string, G.main->name); BLI_make_existing_file(string); -- cgit v1.2.3