diff options
Diffstat (limited to 'source')
58 files changed, 330 insertions, 329 deletions
diff --git a/source/blender/blenkernel/BKE_sketch.h b/source/blender/blenkernel/BKE_sketch.h index 360a95bfb24..087cabc5c3d 100644 --- a/source/blender/blenkernel/BKE_sketch.h +++ b/source/blender/blenkernel/BKE_sketch.h @@ -73,8 +73,8 @@ typedef struct SK_Overdraw typedef struct SK_DrawData { - short mval[2]; - short previous_mval[2]; + int mval[2]; + int previous_mval[2]; SK_PType type; } SK_DrawData; @@ -152,7 +152,7 @@ void sk_endContinuousStroke(SK_Stroke *stk); void sk_updateNextPoint(SK_Sketch *sketch, SK_Stroke *stk); -void sk_initDrawData(SK_DrawData *dd, const short mval[2]); +void sk_initDrawData(SK_DrawData *dd, const int mval[2]); void sk_deleteSelectedStrokes(SK_Sketch *sketch); void sk_selectAllSketch(SK_Sketch *sketch, int mode); diff --git a/source/blender/blenkernel/intern/sketch.c b/source/blender/blenkernel/intern/sketch.c index ec0f5d1316b..4cc5a880625 100644 --- a/source/blender/blenkernel/intern/sketch.c +++ b/source/blender/blenkernel/intern/sketch.c @@ -543,7 +543,7 @@ int sk_stroke_filtermval(SK_DrawData *dd) return retval; } -void sk_initDrawData(SK_DrawData *dd, const short mval[2]) +void sk_initDrawData(SK_DrawData *dd, const int mval[2]) { dd->mval[0] = mval[0]; dd->mval[1] = mval[1]; diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 756d1501536..4a7d749842d 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -77,7 +77,7 @@ void closest_to_line_segment_v3(float r[3], const float p[3], const float l1[3], #define ISECT_LINE_LINE_CROSS 2 int isect_line_line_v2(const float a1[2], const float a2[2], const float b1[2], const float b2[2]); -int isect_line_line_v2_short(const short a1[2], const short a2[2], const short b1[2], const short b2[2]); +int isect_line_line_v2_int(const int a1[2], const int a2[2], const int b1[2], const int b2[2]); int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[2], const float v4[2], float vi[2]); /* Returns the number of point of interests diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index be7f2d95d04..8785415c6a1 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -239,7 +239,7 @@ float dist_to_line_segment_v3(const float v1[3], const float v2[3], const float /******************************* Intersection ********************************/ /* intersect Line-Line, shorts */ -int isect_line_line_v2_short(const short v1[2], const short v2[2], const short v3[2], const short v4[2]) +int isect_line_line_v2_int(const int v1[2], const int v2[2], const int v3[2], const int v4[2]) { float div, labda, mu; diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h index 86dc2182e03..82decf8d1cf 100644 --- a/source/blender/editors/armature/armature_intern.h +++ b/source/blender/editors/armature/armature_intern.h @@ -206,7 +206,7 @@ void POSE_OT_propagate(struct wmOperatorType *ot); /* editarmature.c */ EditBone *make_boneList(struct ListBase *edbo, struct ListBase *bones, struct EditBone *parent, struct Bone *actBone); -void BIF_sk_selectStroke(struct bContext *C, const short mval[2], short extend); +void BIF_sk_selectStroke(struct bContext *C, const int mval[2], short extend); /* duplicate method */ void preEditBoneDuplicate(struct ListBase *editbones); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index f4e9c7c5d3e..7d741d31afe 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1698,7 +1698,7 @@ void ARMATURE_OT_select_linked(wmOperatorType *ot) /* does bones and points */ /* note that BONE ROOT only gets drawn for root bones (or without IK) */ -static EditBone *get_nearest_editbonepoint (ViewContext *vc, const short mval[2], ListBase *edbo, int findunsel, int *selmask) +static EditBone *get_nearest_editbonepoint (ViewContext *vc, const int mval[2], ListBase *edbo, int findunsel, int *selmask) { EditBone *ebone; rcti rect; @@ -1958,7 +1958,7 @@ static int ebone_select_flag(EditBone *ebone) } /* context: editmode armature in view3d */ -int mouse_armature(bContext *C, const short mval[2], int extend) +int mouse_armature(bContext *C, const int mval[2], int extend) { Object *obedit= CTX_data_edit_object(C); bArmature *arm= obedit->data; @@ -2499,7 +2499,7 @@ static int armature_click_extrude_invoke(bContext *C, wmOperator *op, wmEvent *e View3D *v3d; RegionView3D *rv3d; float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3]; - short mx, my, mval[2]; + int mx, my, mval[2]; int retv; scene= CTX_data_scene(C); @@ -2513,7 +2513,7 @@ static int armature_click_extrude_invoke(bContext *C, wmOperator *op, wmEvent *e mx= event->x - ar->winrct.xmin; my= event->y - ar->winrct.ymin; - project_short_noclip(ar, fp, mval); + project_int_noclip(ar, fp, mval); initgrabz(rv3d, fp[0], fp[1], fp[2]); diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 158c0d23ddc..1fa6a88c9f3 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -702,7 +702,7 @@ static void sk_drawStrokeSubdivision(ToolSettings *toolsettings, SK_Stroke *stk) } } -static SK_Point *sk_snapPointStroke(bContext *C, SK_Stroke *stk, short mval[2], int *dist, int *index, int all_pts) +static SK_Point *sk_snapPointStroke(bContext *C, SK_Stroke *stk, int mval[2], int *dist, int *index, int all_pts) { ARegion *ar = CTX_wm_region(C); SK_Point *pt = NULL; @@ -736,7 +736,7 @@ static SK_Point *sk_snapPointStroke(bContext *C, SK_Stroke *stk, short mval[2], } #if 0 /* UNUSED 2.5 */ -static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones, short mval[2], int *dist) +static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones, int mval[2], int *dist) { ARegion *ar = CTX_wm_region(C); SK_Point *pt = NULL; @@ -2157,7 +2157,7 @@ static void sk_applyGesture(bContext *C, SK_Sketch *sketch) /********************************************/ -static int sk_selectStroke(bContext *C, SK_Sketch *sketch, const short mval[2], int extend) +static int sk_selectStroke(bContext *C, SK_Sketch *sketch, const int mval[2], int extend) { ViewContext vc; rcti rect; @@ -2473,7 +2473,7 @@ static int sketch_delete(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(ev return OPERATOR_FINISHED; } -void BIF_sk_selectStroke(bContext *C, const short mval[2], short extend) +void BIF_sk_selectStroke(bContext *C, const int mval[2], short extend) { ToolSettings *ts = CTX_data_tool_settings(C); SK_Sketch *sketch = contextSketch(C, 0); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 01a39cf208c..1bfd910523e 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -4169,7 +4169,7 @@ void CURVE_OT_make_segment(wmOperatorType *ot) /***************** pick select from 3d view **********************/ -int mouse_nurb(bContext *C, const short mval[2], int extend) +int mouse_nurb(bContext *C, const int mval[2], int extend) { Object *obedit= CTX_data_edit_object(C); Curve *cu= obedit->data; @@ -4666,7 +4666,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event) Curve *cu; ViewContext vc; float location[3]; - short mval[2]; + int mval[2]; Nurb *nu; BezTriple *bezt; diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 2baefc2de8e..c552657df96 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -378,7 +378,7 @@ static void gp_strokepoint_convertcoords (bContext *C, bGPDstroke *gps, bGPDspoi else { float *fp= give_cursor(scene, v3d); float dvec[3]; - short mval[2]; + int mval[2]; int mx, my; /* get screen coordinate */ @@ -390,13 +390,13 @@ static void gp_strokepoint_convertcoords (bContext *C, bGPDstroke *gps, bGPDspoi mx= (int)(pt->x / 100 * ar->winx); my= (int)(pt->y / 100 * ar->winy); } - mval[0]= (short)mx; - mval[1]= (short)my; + mval[0]= mx; + mval[1]= my; /* convert screen coordinate to 3d coordinates * - method taken from editview.c - mouse_cursor() */ - project_short_noclip(ar, fp, mval); + project_int_noclip(ar, fp, mval); window_to_3d(ar, dvec, mval[0]-mx, mval[1]-my); sub_v3_v3v3(p3d, fp, dvec); } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 5763fcde705..7db18eaedf4 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -239,7 +239,7 @@ static short gp_stroke_filtermval (tGPsdata *p, int mval[2], int pmval[2]) /* convert screen-coordinates to buffer-coordinates */ // XXX this method needs a total overhaul! -static void gp_stroke_convertcoords (tGPsdata *p, short mval[2], float out[3], float *depth) +static void gp_stroke_convertcoords (tGPsdata *p, int mval[2], float out[3], float *depth) { bGPdata *gpd= p->gpd; @@ -251,7 +251,7 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[2], float out[3], f */ } else { - const short mx=mval[0], my=mval[1]; + const int mx=mval[0], my=mval[1]; float rvec[3], dvec[3]; /* Current method just converts each point in screen-coordinates to @@ -266,7 +266,7 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[2], float out[3], f gp_get_3d_reference(p, rvec); /* method taken from editview.c - mouse_cursor() */ - project_short_noclip(p->ar, rvec, mval); + project_int_noclip(p->ar, rvec, mval); window_to_3d_delta(p->ar, dvec, mval[0]-mx, mval[1]-my); sub_v3_v3v3(out, rvec, dvec); } @@ -387,8 +387,8 @@ static short gp_stroke_addpoint (tGPsdata *p, int mval[2], float pressure) /* temp struct for gp_stroke_smooth() */ typedef struct tGpSmoothCo { - short x; - short y; + int x; + int y; } tGpSmoothCo; /* smooth a stroke (in buffer) before storing it */ @@ -417,8 +417,8 @@ static void gp_stroke_smooth (tGPsdata *p) const tGPspoint *pd= (i+1 < cmx)?(pc+1):(pc); const tGPspoint *pe= (i+2 < cmx)?(pc+2):(pd); - spc->x= (short)(0.1*pa->x + 0.2*pb->x + 0.4*pc->x + 0.2*pd->x + 0.1*pe->x); - spc->y= (short)(0.1*pa->y + 0.2*pb->y + 0.4*pc->y + 0.2*pd->y + 0.1*pe->y); + spc->x= (int)(0.1*pa->x + 0.2*pb->x + 0.4*pc->x + 0.2*pd->x + 0.1*pe->x); + spc->y= (int)(0.1*pa->y + 0.2*pb->y + 0.4*pc->y + 0.2*pd->y + 0.1*pe->y); } /* second pass: apply smoothed coordinates */ @@ -574,7 +574,7 @@ static void gp_stroke_newfrombuffer (tGPsdata *p) /* get an array of depths, far depths are blended */ if (gpencil_project_check(p)) { - short mval[2], mval_prev[2]= {0}; + int mval[2], mval_prev[2]= {0}; int interp_depth = 0; int found_depth = 0; @@ -738,7 +738,7 @@ static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], sho { bGPDspoint *pt1, *pt2; int x0=0, y0=0, x1=0, y1=0; - short xyval[2]; + int xyval[2]; int i; if (gps->totpoints == 0) { @@ -750,7 +750,7 @@ static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], sho else if (gps->totpoints == 1) { /* get coordinates */ if (gps->flag & GP_STROKE_3DSPACE) { - project_short(p->ar, &gps->points->x, xyval); + project_int(p->ar, &gps->points->x, xyval); x0= xyval[0]; y0= xyval[1]; } @@ -804,11 +804,11 @@ static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], sho /* get coordinates */ if (gps->flag & GP_STROKE_3DSPACE) { - project_short(p->ar, &pt1->x, xyval); + project_int(p->ar, &pt1->x, xyval); x0= xyval[0]; y0= xyval[1]; - project_short(p->ar, &pt2->x, xyval); + project_int(p->ar, &pt2->x, xyval); x1= xyval[0]; y1= xyval[1]; } @@ -1501,8 +1501,8 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op) /* get relevant data for this point from stroke */ RNA_float_get_array(&itemptr, "mouse", mousef); - p->mval[0] = (short)mousef[0]; - p->mval[1] = (short)mousef[1]; + p->mval[0] = (int)mousef[0]; + p->mval[1] = (int)mousef[1]; p->pressure= RNA_float_get(&itemptr, "pressure"); if (RNA_boolean_get(&itemptr, "is_start")) { diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 36923736068..a029c5c1f12 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -117,7 +117,7 @@ void ED_armature_deselect_all_visible(struct Object *obedit); int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer, short hits, short extend); -int mouse_armature(struct bContext *C, const short mval[2], int extend); +int mouse_armature(struct bContext *C, const int mval[2], int extend); int join_armature_exec(struct bContext *C, struct wmOperator *op); struct Bone *get_indexed_bone (struct Object *ob, int index); float ED_rollBoneToVector(EditBone *bone, const float new_up_axis[3], const short axis_only); diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index cfafd38ed15..6a92ee2e056 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -66,7 +66,7 @@ void free_editNurb (struct Object *obedit); void free_curve_editNurb (struct Curve *cu); -int mouse_nurb (struct bContext *C, const short mval[2], int extend); +int mouse_nurb (struct bContext *C, const int mval[2], int extend); struct Nurb *add_nurbs_primitive(struct bContext *C, float mat[4][4], int type, int newob); diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index d06b0d6c4ee..e5715316a31 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -56,7 +56,7 @@ struct wmKeyConfig; * Used as part of the 'stroke cache' used during drawing of new strokes */ typedef struct tGPspoint { - short x, y; /* x and y coordinates of cursor (in relative to area) */ + int x, y; /* x and y coordinates of cursor (in relative to area) */ float pressure; /* pressure of tablet at this point */ } tGPspoint; diff --git a/source/blender/editors/include/ED_mball.h b/source/blender/editors/include/ED_mball.h index a742be7337c..2afc3155398 100644 --- a/source/blender/editors/include/ED_mball.h +++ b/source/blender/editors/include/ED_mball.h @@ -42,7 +42,7 @@ void ED_keymap_metaball(struct wmKeyConfig *keyconf); struct MetaElem *add_metaball_primitive(struct bContext *C, float mat[4][4], int type, int newname); -int mouse_mball(struct bContext *C, const short mval[2], int extend); +int mouse_mball(struct bContext *C, const int mval[2], int extend); void free_editMball(struct Object *obedit); void make_editMball(struct Object *obedit); diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index c3c843154e5..5c4dfc6ba3d 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -169,9 +169,9 @@ void EM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct Object extern unsigned int em_vertoffs, em_solidoffs, em_wireoffs; void EM_cache_x_mirror_vert(struct Object *ob, struct EditMesh *em); -int mouse_mesh(struct bContext *C, const short mval[2], short extend); +int mouse_mesh(struct bContext *C, const int mval[2], short extend); int EM_check_backbuf(unsigned int index); -int EM_mask_init_backbuf_border(struct ViewContext *vc, short mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax); +int EM_mask_init_backbuf_border(struct ViewContext *vc, int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax); void EM_free_backbuf(void); int EM_init_backbuf_border(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax); int EM_init_backbuf_circle(struct ViewContext *vc, short xs, short ys, short rads); @@ -187,10 +187,10 @@ void EM_automerge(struct Scene *scene, struct Object *obedit, int update); /* editface.c */ void paintface_flush_flags(struct Object *ob); struct MTFace *EM_get_active_mtface(struct EditMesh *em, struct EditFace **act_efa, struct MCol **mcol, int sloppy); -int paintface_mouse_select(struct bContext *C, struct Object *ob, const short mval[2], int extend); +int paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], int extend); int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, int select, int extend); void paintface_deselect_all_visible(struct Object *ob, int action, short flush_flags); -void paintface_select_linked(struct bContext *C, struct Object *ob, short mval[2], int mode); +void paintface_select_linked(struct bContext *C, struct Object *ob, int mval[2], int mode); int paintface_minmax(struct Object *ob, float *min, float *max); void paintface_hide(struct Object *ob, const int unselected); diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 3b27fb45f5d..28d0a9520b2 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -126,7 +126,7 @@ void ED_object_constraint_update(struct Object *ob); void ED_object_constraint_dependency_update(struct Main *bmain, struct Scene *scene, struct Object *ob); /* object_lattice.c */ -int mouse_lattice(struct bContext *C, const short mval[2], int extend); +int mouse_lattice(struct bContext *C, const int mval[2], int extend); void undo_push_lattice(struct bContext *C, const char *name); /* object_lattice.c */ diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index f29284fe64d..23997e06aef 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -60,10 +60,10 @@ void PE_hide_keys_time(struct Scene *scene, struct PTCacheEdit *edit, float cfra void PE_update_object(struct Scene *scene, struct Object *ob, int useflag); /* selection tools */ -int PE_mouse_particles(struct bContext *C, const short mval[2], int extend); +int PE_mouse_particles(struct bContext *C, const int mval[2], int extend); int PE_border_select(struct bContext *C, struct rcti *rect, int select, int extend); -int PE_circle_select(struct bContext *C, int selecting, const short mval[2], float rad); -int PE_lasso_select(struct bContext *C, short mcords[][2], short moves, short extend, short select); +int PE_circle_select(struct bContext *C, int selecting, const int mval[2], float rad); +int PE_lasso_select(struct bContext *C, int mcords[][2], short moves, short extend, short select); void PE_deselect_all_visible(struct PTCacheEdit *edit); /* undo */ diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 297bd234edd..16570ccd7a1 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -64,7 +64,7 @@ typedef struct ViewContext { struct View3D *v3d; struct RegionView3D *rv3d; struct EditMesh *em; - short mval[2]; + int mval[2]; } ViewContext; typedef struct ViewDepths { @@ -80,9 +80,9 @@ typedef struct ViewDepths { float *give_cursor(struct Scene *scene, struct View3D *v3d); int initgrabz(struct RegionView3D *rv3d, float x, float y, float z); -void window_to_3d(struct ARegion *ar, float out[3], short mx, short my); -void window_to_3d_delta(struct ARegion *ar, float out[3], short mx, short my); -void window_to_3d_vector(struct ARegion *ar, float out[3], short mx, short my); +void window_to_3d(struct ARegion *ar, float out[3], const int mx, const int my); +void window_to_3d_delta(struct ARegion *ar, float out[3], const int mx, const int my); +void window_to_3d_vector(struct ARegion *ar, float out[3], const int mx, const int my); void view3d_unproject(struct bglMats *mats, float out[3], const short x, const short y, const float z); /* Depth buffer */ @@ -133,18 +133,18 @@ void drawcircball(int mode, const float cent[3], float rad, float tmat[][4]); /* backbuffer select and draw support */ void view3d_validate_backbuf(struct ViewContext *vc); struct ImBuf *view3d_read_backbuf(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax); -unsigned int view3d_sample_backbuf_rect(struct ViewContext *vc, const short mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, +unsigned int view3d_sample_backbuf_rect(struct ViewContext *vc, const int mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, void *handle, unsigned int (*indextest)(void *handle, unsigned int index)); unsigned int view3d_sample_backbuf(struct ViewContext *vc, int x, int y); /* draws and does a 4x4 sample */ -int view_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, const short mval[2], float mouse_worldloc[3]); +int view_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, const int mval[2], float mouse_worldloc[3]); /* only draw so view_autodist_simple can be called many times after */ int view_autodist_init(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, int mode); -int view_autodist_simple(struct ARegion *ar, const short mval[2], float mouse_worldloc[3], int margin, float *force_depth); -int view_autodist_depth(struct ARegion *ar, const short mval[2], int margin, float *depth); -int view_autodist_depth_segment(struct ARegion *ar, const short mval_sta[2], const short mval_end[2], int margin, float *depth); +int view_autodist_simple(struct ARegion *ar, const int mval[2], float mouse_worldloc[3], int margin, float *force_depth); +int view_autodist_depth(struct ARegion *ar, const int mval[2], int margin, float *depth); +int view_autodist_depth_segment(struct ARegion *ar, const int mval_sta[2], const int mval_end[2], int margin, float *depth); /* select */ #define MAXPICKBUF 10000 @@ -153,13 +153,13 @@ short view3d_opengl_select(struct ViewContext *vc, unsigned int *buffer, unsigne void view3d_set_viewcontext(struct bContext *C, struct ViewContext *vc); void view3d_operator_needs_opengl(const struct bContext *C); void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *ar); -int view3d_get_view_aligned_coordinate(struct ViewContext *vc, float fp[3], const short mval[2], const short do_fallback); +int view3d_get_view_aligned_coordinate(struct ViewContext *vc, float fp[3], const int mval[2], const short do_fallback); void view3d_get_transformation(struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats); /* XXX should move to BLI_math */ int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2); -int lasso_inside(short mcords[][2], short moves, short sx, short sy); -int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1); +int lasso_inside(int mcords[][2], short moves, int sx, int sy); +int lasso_inside_edge(int mcords[][2], short moves, int x0, int y0, int x1, int y1); /* get 3d region from context, also if mouse is in header or toolbar */ struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C); @@ -178,7 +178,7 @@ struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, struct Object *camera, int width, int height, unsigned int flag, int drawtype, char err_out[256]); -Base *ED_view3d_give_base_under_cursor(struct bContext *C, const short mval[2]); +Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]); void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, short do_clip); int ED_view3d_lock(struct RegionView3D *rv3d); diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 12506d28593..e9fad382beb 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -97,7 +97,7 @@ static int eyedropper_cancel(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static void eyedropper_sample(bContext *C, Eyedropper *eye, short mx, short my) +static void eyedropper_sample(bContext *C, Eyedropper *eye, int mx, int my) { if(RNA_property_type(eye->prop) == PROP_FLOAT) { const int color_manage = CTX_data_scene(C)->r.color_mgt_flag & R_COLOR_MANAGEMENT; diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index a4c2dbb9943..624f06db3c1 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1625,7 +1625,7 @@ void ui_block_func_ICONTEXTROW(bContext *UNUSED(C), uiLayout *layout, void *arg_ } #if 0 -static void ui_warp_pointer(short x, short y) +static void ui_warp_pointer(int x, int y) { /* XXX 2.50 which function to use for this? */ /* OSX has very poor mousewarp support, it sends events; diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 32301dd6423..84cf5af5414 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -2028,7 +2028,7 @@ typedef struct View2DString { unsigned char ub[4]; int pack; } col; - short mval[2]; + int mval[2]; rcti rect; } View2DString; diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index 9cec034af28..ab62c88deaa 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -98,7 +98,7 @@ void paintface_flush_flags(Object *ob) } /* returns 0 if not found, otherwise 1 */ -static int facesel_face_pick(struct bContext *C, Mesh *me, const short mval[2], unsigned int *index, short rect) +static int facesel_face_pick(struct bContext *C, Mesh *me, const int mval[2], unsigned int *index, short rect) { ViewContext vc; view3d_set_viewcontext(C, &vc); @@ -327,7 +327,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind MEM_freeN(linkflag); } -void paintface_select_linked(bContext *UNUSED(C), Object *ob, short UNUSED(mval[2]), int mode) +void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]), int mode) { Mesh *me; unsigned int index=0; @@ -716,7 +716,7 @@ void seam_mark_clear_tface(Scene *scene, short mode) } #endif -int paintface_mouse_select(struct bContext *C, Object *ob, const short mval[2], int extend) +int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], int extend) { Mesh *me; MFace *mface, *msel; diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c index 72e9e3b6d9e..d7e59e0a68f 100644 --- a/source/blender/editors/mesh/editmesh_loop.c +++ b/source/blender/editors/mesh/editmesh_loop.c @@ -199,7 +199,7 @@ static void CutEdgeloop(Object *obedit, wmOperator *op, EditMesh *em, int numcut EditEdge *nearest=NULL, *eed; float fac; int keys = 0, holdnum=0, selectmode, dist; - short mvalo[2] = {0, 0}, mval[2] = {0, 0}; + int mvalo[2] = {0, 0}, mval[2] = {0, 0}; short event=0, val, choosing=1, cancel=0, cuthalf = 0, smooth=0; short hasHidden = 0; char msg[128]; diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 8cdbe6707a3..bd49fab1de1 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -162,7 +162,7 @@ unsigned int em_solidoffs=0, em_wireoffs=0, em_vertoffs=0; /* set in drawobject. static char *selbuf= NULL; /* opengl doesn't support concave... */ -static void draw_triangulated(short mcords[][2], short tot) +static void draw_triangulated(int mcords[][2], short tot) { ListBase lb={NULL, NULL}; DispList *dl; @@ -256,7 +256,7 @@ void EM_free_backbuf(void) - grab again and compare returns 'OK' */ -int EM_mask_init_backbuf_border(ViewContext *vc, short mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax) +int EM_mask_init_backbuf_border(ViewContext *vc, int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax) { unsigned int *dr, *drm; struct ImBuf *buf, *bufmask; @@ -290,7 +290,7 @@ int EM_mask_init_backbuf_border(ViewContext *vc, short mcords[][2], short tot, s draw_triangulated(mcords, tot); glBegin(GL_LINE_LOOP); /* for zero sized masks, lines */ - for(a=0; a<tot; a++) glVertex2s(mcords[a][0], mcords[a][1]); + for(a=0; a<tot; a++) glVertex2iv(mcords[a]); glEnd(); glFinish(); /* to be sure readpixels sees mask */ @@ -358,7 +358,7 @@ int EM_init_backbuf_circle(ViewContext *vc, short xs, short ys, short rads) static void findnearestvert__doClosest(void *userData, EditVert *eve, int x, int y, int index) { - struct { short mval[2], pass, select, strict; int dist, lastIndex, closestIndex; EditVert *closest; } *data = userData; + struct { int mval[2]; short pass, select, strict; int dist, lastIndex, closestIndex; EditVert *closest; } *data = userData; if (data->pass==0) { if (index<=data->lastIndex) @@ -426,7 +426,7 @@ EditVert *findnearestvert(ViewContext *vc, int *dist, short sel, short strict) } else { - struct { short mval[2], pass, select, strict; int dist, lastIndex, closestIndex; EditVert *closest; } data; + struct { int mval[2]; short pass, select, strict; int dist, lastIndex, closestIndex; EditVert *closest; } data; static int lastSelectedIndex=0; static EditVert *lastSelected=NULL; @@ -549,7 +549,7 @@ EditEdge *findnearestedge(ViewContext *vc, int *dist) 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; + struct { int mval[2]; int dist; EditFace *toFace; } *data = userData; if (efa==data->toFace) { int temp = abs(data->mval[0]-x) + abs(data->mval[1]-y); @@ -560,7 +560,7 @@ static void findnearestface__getDistance(void *userData, EditFace *efa, int x, i } static void findnearestface__doClosest(void *userData, EditFace *efa, int x, int y, int index) { - struct { short mval[2], pass; int dist, lastIndex, closestIndex; EditFace *closest; } *data = userData; + struct { int mval[2]; short pass; int dist, lastIndex, closestIndex; EditFace *closest; } *data = userData; if (data->pass==0) { if (index<=data->lastIndex) @@ -588,7 +588,7 @@ static EditFace *findnearestface(ViewContext *vc, int *dist) EditFace *efa = BLI_findlink(&vc->em->faces, index-1); if (efa) { - struct { short mval[2]; int dist; EditFace *toFace; } data; + struct { int mval[2]; int dist; EditFace *toFace; } data; data.mval[0] = vc->mval[0]; data.mval[1] = vc->mval[1]; @@ -607,7 +607,7 @@ static EditFace *findnearestface(ViewContext *vc, int *dist) return NULL; } else { - struct { short mval[2], pass; int dist, lastIndex, closestIndex; EditFace *closest; } data; + struct { int mval[2]; short pass; int dist, lastIndex, closestIndex; EditFace *closest; } data; static int lastSelectedIndex=0; static EditFace *lastSelected=NULL; @@ -2061,7 +2061,7 @@ void MESH_OT_loop_multi_select(wmOperatorType *ot) /* ***************** loop select (non modal) ************** */ -static void mouse_mesh_loop(bContext *C, const short mval[2], short extend, short ring) +static void mouse_mesh_loop(bContext *C, const int mval[2], short extend, short ring) { ViewContext vc; EditMesh *em; @@ -2149,7 +2149,7 @@ void MESH_OT_loop_select(wmOperatorType *ot) /* ******************* mesh shortest path select, uses prev-selected edge ****************** */ /* since you want to create paths with multiple selects, it doesn't have extend option */ -static void mouse_mesh_shortest_path(bContext *C, const short mval[2]) +static void mouse_mesh_shortest_path(bContext *C, const int mval[2]) { ViewContext vc; EditMesh *em; @@ -2282,7 +2282,7 @@ void MESH_OT_select_shortest_path(wmOperatorType *ot) /* here actual select happens */ /* gets called via generic mouse select operator */ -int mouse_mesh(bContext *C, const short mval[2], short extend) +int mouse_mesh(bContext *C, const int mval[2], short extend) { ViewContext vc; EditVert *eve; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index a78029da079..11e7d64c667 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -4011,7 +4011,7 @@ useless: LinkNode *fuv_link; short event, draw=1; - short mval[2], mvalo[2]; + int mval[2], mvalo[2]; char str[128]; float labda = 0.0f; @@ -4416,7 +4416,7 @@ useless: percp = -1; while(draw) { /* For the % calculation */ - short mval[2]; + int mval[2]; float rc[2]; float v2[2], v3[2]; EditVert *centerVert, *upVert, *downVert; @@ -4867,7 +4867,7 @@ void mesh_set_face_flags(EditMesh *em, short mode) /********************** Rip Operator *************************/ /* helper to find edge for edge_rip */ -static float mesh_rip_edgedist(ARegion *ar, float mat[][4], float *co1, float *co2, const short mval[2]) +static float mesh_rip_edgedist(ARegion *ar, float mat[][4], float *co1, float *co2, const int mval[2]) { float vec1[3], vec2[3], mvalf[2]; @@ -4910,7 +4910,8 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) EditEdge *eed, *seed= NULL; EditFace *efa, *sefa= NULL; float projectMat[4][4], vec[3], dist, mindist; - short doit= 1, *mval= event->mval; + short doit= 1; + int *mval= event->mval; /* select flush... vertices are important */ EM_selectmode_set(em); diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index b67f9d6de29..b007e30422d 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -455,7 +455,7 @@ void MBALL_OT_reveal_metaelems(wmOperatorType *ot) /* Select MetaElement with mouse click (user can select radius circle or * stiffness circle) */ -int mouse_mball(bContext *C, const short mval[2], int extend) +int mouse_mball(bContext *C, const int mval[2], int extend) { static MetaElem *startelem=NULL; Object *obedit= CTX_data_edit_object(C); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index eb04a2743e3..ab6fd7a6a6a 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -607,7 +607,7 @@ static void spot_interactive(Object *ob, int mode) Lamp *la= ob->data; float transfac, dx, dy, ratio, origval; int keep_running= 1, center2d[2]; - short mval[2], mvalo[2]; + int mval[2], mvalo[2]; // getmouseco_areawin(mval); // getmouseco_areawin(mvalo); diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c index 198c8cab7fa..14ce223db5e 100644 --- a/source/blender/editors/object/object_lattice.c +++ b/source/blender/editors/object/object_lattice.c @@ -305,7 +305,7 @@ void LATTICE_OT_make_regular(wmOperatorType *ot) static void findnearestLattvert__doClosest(void *userData, BPoint *bp, int x, int y) { - struct { BPoint *bp; short dist, select, mval[2]; } *data = userData; + struct { BPoint *bp; short dist, select; int mval[2]; } *data = userData; float temp = abs(data->mval[0]-x) + abs(data->mval[1]-y); if((bp->f1 & SELECT)==data->select) @@ -318,12 +318,12 @@ static void findnearestLattvert__doClosest(void *userData, BPoint *bp, int x, in } } -static BPoint *findnearestLattvert(ViewContext *vc, const short mval[2], int sel) +static BPoint *findnearestLattvert(ViewContext *vc, const int mval[2], int sel) { /* sel==1: selected gets a disadvantage */ /* in nurb and bezt or bp the nearest is written */ /* return 0 1 2: handlepunt */ - struct { BPoint *bp; short dist, select, mval[2]; } data = {NULL}; + struct { BPoint *bp; short dist, select; int mval[2]; } data = {NULL}; data.dist = 100; data.select = sel; @@ -336,7 +336,7 @@ static BPoint *findnearestLattvert(ViewContext *vc, const short mval[2], int sel return data.bp; } -int mouse_lattice(bContext *C, const short mval[2], int extend) +int mouse_lattice(bContext *C, const int mval[2], int extend) { ViewContext vc; BPoint *bp= NULL; diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 733919ff166..f4f66c17459 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -338,7 +338,7 @@ typedef struct PEData { DerivedMesh *dm; PTCacheEdit *edit; - const short *mval; + const int *mval; rcti *rect; float rad; float dist; @@ -439,9 +439,9 @@ static int key_test_depth(PEData *data, float co[3]) static int key_inside_circle(PEData *data, float rad, float co[3], float *distance) { float dx, dy, dist; - short sco[2]; + int sco[2]; - project_short(data->vc.ar, co, sco); + project_int(data->vc.ar, co, sco); if(sco[0] == IS_CLIPPED) return 0; @@ -465,9 +465,9 @@ static int key_inside_circle(PEData *data, float rad, float co[3], float *distan static int key_inside_rect(PEData *data, float co[3]) { - short sco[2]; + int sco[2]; - project_short(data->vc.ar, co,sco); + project_int(data->vc.ar, co,sco); if(sco[0] == IS_CLIPPED) return 0; @@ -1369,7 +1369,7 @@ void PARTICLE_OT_select_all(wmOperatorType *ot) /************************ pick select operator ************************/ -int PE_mouse_particles(bContext *C, const short mval[2], int extend) +int PE_mouse_particles(bContext *C, const int mval[2], int extend) { PEData data; Scene *scene= CTX_data_scene(C); @@ -1484,7 +1484,7 @@ void PARTICLE_OT_select_tips(wmOperatorType *ot) static int select_linked_exec(bContext *C, wmOperator *op) { PEData data; - short mval[2]; + int mval[2]; int location[2]; RNA_int_get_array(op->ptr, "location", location); @@ -1574,7 +1574,7 @@ int PE_border_select(bContext *C, rcti *rect, int select, int extend) /************************ circle select operator ************************/ -int PE_circle_select(bContext *C, int selecting, const short mval[2], float rad) +int PE_circle_select(bContext *C, int selecting, const int mval[2], float rad) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); @@ -1599,7 +1599,7 @@ int PE_circle_select(bContext *C, int selecting, const short mval[2], float rad) /************************ lasso select operator ************************/ -int PE_lasso_select(bContext *C, short mcords[][2], short moves, short extend, short select) +int PE_lasso_select(bContext *C, int mcords[][2], short moves, short extend, short select) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); @@ -1610,7 +1610,7 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short extend, s ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys); POINT_P; KEY_K; float co[3], mat[4][4]= MAT4_UNITY; - short vertco[2]; + int vertco[2]; PEData data; @@ -1631,7 +1631,7 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short extend, s LOOP_KEYS { VECCOPY(co, key->co); mul_m4_v3(mat, co); - project_short(ar, co, vertco); + project_int(ar, co, vertco); if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1]) && key_test_depth(&data, co)) { if(select && !(key->flag & PEK_SELECT)) { key->flag |= PEK_SELECT; @@ -1649,7 +1649,7 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short extend, s VECCOPY(co, key->co); mul_m4_v3(mat, co); - project_short(ar, co,vertco); + project_int(ar, co,vertco); if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1]) && key_test_depth(&data, co)) { if(select && !(key->flag & PEK_SELECT)) { key->flag |= PEK_SELECT; @@ -2771,7 +2771,7 @@ static void brush_cut(PEData *data, int pa_index) float rad2, cut_time= 1.0; float x0, x1, v0, v1, o0, o1, xo0, xo1, d, dv; int k, cut, keys= (int)pow(2.0, (double)pset->draw_step); - short vertco[2]; + int vertco[2]; /* blunt scissors */ if(BLI_frand() > data->cutfac) return; @@ -2784,7 +2784,7 @@ static void brush_cut(PEData *data, int pa_index) cut=0; - project_short_noclip(ar, key->co, vertco); + project_int_noclip(ar, key->co, vertco); x0= (float)vertco[0]; x1= (float)vertco[1]; @@ -2802,7 +2802,7 @@ static void brush_cut(PEData *data, int pa_index) else { /* calculate path time closest to root that was inside the circle */ for(k=1, key++; k<=keys; k++, key++) { - project_short_noclip(ar, key->co, vertco); + project_int_noclip(ar, key->co, vertco); if(key_test_depth(data, key->co) == 0) { x0= (float)vertco[0]; @@ -3466,7 +3466,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) ParticleBrushData *brush= &pset->brush[pset->brushtype]; ARegion *ar= CTX_wm_region(C); float vec[3], mousef[2]; - short mval[2], mvalo[2]; + int mval[2], mvalo[2]; int flip, mouse[2], dx, dy, removed= 0, added=0, selected= 0; int lock_root = pset->flag & PE_LOCK_FIRST; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 66a0044d55e..db575907b49 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5284,7 +5284,7 @@ static int set_clone_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event) View3D *v3d= CTX_wm_view3d(C); ARegion *ar= CTX_wm_region(C); float location[3]; - short mval[2]; + int mval[2]; mval[0]= event->x - ar->winrct.xmin; mval[1]= event->y - ar->winrct.ymin; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 90cfdda78a8..f4fc004f413 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -736,10 +736,10 @@ static float calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, float vpimat[][3], fl Brush *brush = paint_brush(&vp->paint); float fac, fac_2, size, dx, dy; float alpha; - short vertco[2]; + int vertco[2]; const int radius= brush_size(brush); - project_short_noclip(vc->ar, vert_nor, vertco); + project_int_noclip(vc->ar, vert_nor, vertco); dx= mval[0]-vertco[0]; dy= mval[1]-vertco[1]; @@ -868,7 +868,7 @@ static void sample_wpaint(Scene *scene, ARegion *ar, View3D *UNUSED(v3d), int mo Object *ob= OBACT; Mesh *me= get_mesh(ob); int index; - short mval[2] = {0, 0}, sco[2]; + int mval[2] = {0, 0}, sco[2]; int vgroup= ob->actdef-1; if (!me) return; @@ -953,20 +953,20 @@ static void sample_wpaint(Scene *scene, ARegion *ar, View3D *UNUSED(v3d), int mo else { /* calc 3 or 4 corner weights */ dm->getVertCo(dm, mface->v1, co); - project_short_noclip(ar, co, sco); + project_int_noclip(ar, co, sco); w1= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1])); dm->getVertCo(dm, mface->v2, co); - project_short_noclip(ar, co, sco); + project_int_noclip(ar, co, sco); w2= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1])); dm->getVertCo(dm, mface->v3, co); - project_short_noclip(ar, co, sco); + project_int_noclip(ar, co, sco); w3= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1])); if(mface->v4) { dm->getVertCo(dm, mface->v4, co); - project_short_noclip(ar, co, sco); + project_int_noclip(ar, co, sco); w4= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1])); } else w4= 1.0e10; diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 6c713d6e469..47b3a71a9ea 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -818,7 +818,7 @@ static int graphkeys_select_leftright_invoke (bContext *C, wmOperator *op, wmEve ARegion *ar= ac.ar; View2D *v2d= &ar->v2d; - short mval[2]; + int mval[2]; float x; /* get mouse coordinates (in region coordinates) */ diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 60c55375262..7e881e7e62f 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -268,7 +268,7 @@ static void preview_cb(struct ScrArea *sa, struct uiBlock *block) rcti *disprect= &G.scene->r.disprect; int winx= (G.scene->r.size*G.scene->r.xsch)/100; int winy= (G.scene->r.size*G.scene->r.ysch)/100; - short mval[2]; + int mval[2]; if(G.scene->r.mode & R_BORDER) { winx*= (G.scene->r.border.xmax - G.scene->r.border.xmin); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 0f361b43de6..4cdac361bf3 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -702,7 +702,7 @@ static void draw_image_view_tool(Scene *scene) { ToolSettings *settings= scene->toolsettings; Brush *brush= settings->imapaint.brush; - short mval[2]; + int mval[2]; float radius; int draw= 0; diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c index 67f02ce4f8e..937b683e880 100644 --- a/source/blender/editors/space_info/info_report.c +++ b/source/blender/editors/space_info/info_report.c @@ -230,7 +230,7 @@ static int borderselect_exec(bContext *C, wmOperator *op) rcti rect; //rctf rectf, rq; short selecting= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); - //short mval[2]; + //int mval[2]; rect.xmin= RNA_int_get(op->ptr, "xmin"); rect.ymin= RNA_int_get(op->ptr, "ymin"); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 01f32b49888..19a9bfb224b 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1010,7 +1010,7 @@ static bNode *visible_node(SpaceNode *snode, rctf *rct) /* **************************** */ typedef struct NodeViewMove { - short mvalo[2]; + int mvalo[2]; int xmin, ymin, xmax, ymax; } NodeViewMove; @@ -1615,7 +1615,7 @@ static int node_mouse_groupheader(SpaceNode *snode) { bNode *gnode; float mx=0, my=0; -// XXX short mval[2]; +// XXX int mval[2]; gnode= node_tree_get_editgroup(snode->nodetree); if(gnode==NULL) return 0; diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 78368d91378..6bda47e5c8f 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -70,7 +70,7 @@ static bNode *node_under_mouse(bNodeTree *ntree, int mx, int my) /* ****** Click Select ****** */ -static bNode *node_mouse_select(SpaceNode *snode, ARegion *ar, const short mval[2], short extend) +static bNode *node_mouse_select(SpaceNode *snode, ARegion *ar, const int mval[2], short extend) { bNode *node; float mx, my; @@ -102,7 +102,7 @@ static int node_select_exec(bContext *C, wmOperator *op) { SpaceNode *snode= CTX_wm_space_node(C); ARegion *ar= CTX_wm_region(C); - short mval[2]; + int mval[2]; short extend; bNode *node= NULL; @@ -125,7 +125,7 @@ static int node_select_exec(bContext *C, wmOperator *op) static int node_select_invoke(bContext *C, wmOperator *op, wmEvent *event) { ARegion *ar= CTX_wm_region(C); - short mval[2]; + int mval[2]; mval[0]= event->x - ar->winrct.xmin; mval[1]= event->y - ar->winrct.ymin; @@ -199,7 +199,7 @@ static int node_border_select_invoke(bContext *C, wmOperator *op, wmEvent *event /* this allows border select on empty space, but drag-translate on nodes */ SpaceNode *snode= CTX_wm_space_node(C); ARegion *ar= CTX_wm_region(C); - short mval[2]; + int mval[2]; float mx, my; mval[0]= event->x - ar->winrct.xmin; diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c index 1ae36b077af..9665a152970 100644 --- a/source/blender/editors/space_node/node_state.c +++ b/source/blender/editors/space_node/node_state.c @@ -158,7 +158,7 @@ static int do_header_hidden_node(bNode *node, float mx, float my) return 0; } -static int node_toggle_visibility(SpaceNode *snode, ARegion *ar, const short mval[2]) +static int node_toggle_visibility(SpaceNode *snode, ARegion *ar, const int mval[2]) { bNode *node; float mx, my; @@ -189,7 +189,7 @@ static int node_toggle_visibility_exec(bContext *C, wmOperator *op) { SpaceNode *snode= CTX_wm_space_node(C); ARegion *ar= CTX_wm_region(C); - short mval[2]; + int mval[2]; mval[0] = RNA_int_get(op->ptr, "mouse_x"); mval[1] = RNA_int_get(op->ptr, "mouse_y"); @@ -202,7 +202,7 @@ static int node_toggle_visibility_exec(bContext *C, wmOperator *op) static int node_toggle_visibility_invoke(bContext *C, wmOperator *op, wmEvent *event) { ARegion *ar= CTX_wm_region(C); - short mval[2]; + int mval[2]; mval[0]= event->x - ar->winrct.xmin; mval[1]= event->y - ar->winrct.ymin; diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 2ef8fb12965..77901f7fd29 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -120,7 +120,7 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, w ARegion *ar= CTX_wm_region(C); View2D *v2d= UI_view2d_fromcontext(C); - short mval[2]; + int mval[2]; float mval_v2d[2]; diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 92fae3d4820..6d74ba07005 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -191,7 +191,7 @@ void boundbox_seq(Scene *scene, rctf *rect) static int mouse_frame_side(View2D *v2d, short mouse_x, int frame ) { - short mval[2]; + int mval[2]; float mouseloc[2]; mval[0]= mouse_x; @@ -284,7 +284,7 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i } -Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const short mval[2]) +Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[2]) { Sequence *seq; Editing *ed= seq_give_editing(scene, FALSE); @@ -1084,7 +1084,7 @@ static int seq_get_snaplimit(View2D *v2d) /* fake mouse coords to get the snap value a bit lazy but its only done once pre transform */ float xmouse, ymouse, x; - short mval[2] = {24, 0}; /* 24 screen px snap */ + int mval[2] = {24, 0}; /* 24 screen px snap */ UI_view2d_region_to_view(v2d, mval[0], mval[1], &xmouse, &ymouse); x = xmouse; diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index 9a4796ced5e..209b39662aa 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -61,7 +61,7 @@ void seq_reset_imageofs(struct SpaceSeq *sseq); struct View2D; void seq_rectf(struct Sequence *seq, struct rctf *rectf); void boundbox_seq(struct Scene *scene, struct rctf *rect); -struct Sequence *find_nearest_seq(struct Scene *scene, struct View2D *v2d, int *hand, const short mval[2]); +struct Sequence *find_nearest_seq(struct Scene *scene, struct View2D *v2d, int *hand, const int mval[2]); struct Sequence *find_neighboring_sequence(struct Scene *scene, struct Sequence *test, int lr, int sel); void deselect_all_seq(struct Scene *scene); void recurs_sel_seq(struct Sequence *seqm); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index b2d6ab6f8ca..2cae2d17a33 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -307,7 +307,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) short left_right= RNA_boolean_get(op->ptr, "left_right"); short linked_time= RNA_boolean_get(op->ptr, "linked_time"); - short mval[2]; + int mval[2]; Sequence *seq,*neighbor, *act_orig; int hand,sel_side; @@ -489,7 +489,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) /* marker transform */ #if 0 // XXX probably need to redo this differently for 2.5 if (marker) { - short mval[2], xo, yo; + int mval[2], xo, yo; // getmouseco_areawin(mval); xo= mval[0]; yo= mval[1]; @@ -656,7 +656,7 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEv View2D *v2d= UI_view2d_fromcontext(C); short extend= RNA_boolean_get(op->ptr, "extend"); - short mval[2]; + int mval[2]; Sequence *mouse_seq; int selected, hand; @@ -837,7 +837,7 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op) rcti rect; rctf rectf, rq; short selecting = (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); - short mval[2]; + int mval[2]; if(ed==NULL) return OPERATOR_CANCELLED; diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index e87719084ce..635e922cd65 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2109,7 +2109,7 @@ 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[2]= {event->x, event->y}; + int mval[2]= {event->x, event->y}; short txtdelta[2] = {0, 0}; text_update_character_width(st); @@ -2283,7 +2283,7 @@ static int scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event) SpaceText *st= CTX_wm_space_text(C); ARegion *ar= CTX_wm_region(C); TextScroll *tsc; - const short *mval= event->mval; + const int *mval= event->mval; int zone= -1; if(RNA_property_is_set(op->ptr, "lines")) @@ -2694,7 +2694,7 @@ static int line_number_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *even SpaceText *st= CTX_wm_space_text(C); Text *text= CTX_data_edit_text(C); ARegion *ar= CTX_wm_region(C); - const short *mval= event->mval; + const int *mval= event->mval; double time; static int jump_to= 0; static double last_jump= 0; diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c index bd8710ec120..6e6f131655b 100644 --- a/source/blender/editors/space_text/text_python.c +++ b/source/blender/editors/space_text/text_python.c @@ -54,7 +54,7 @@ int text_do_suggest_select(SpaceText *st, ARegion *ar) TextLine *tmp; int l, x, y, w, h, i; int tgti, *top; - short mval[2] = {0, 0}; + int mval[2] = {0, 0}; if(!st || !st->text) return 0; if(!texttool_text_is_active(st->text)) return 0; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index ba30aecc9ab..e88ee7dd69a 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -666,7 +666,7 @@ typedef struct ViewCachedString { unsigned char ub[4]; int pack; } col; - short mval[2]; + short sco[2]; short xoffs; short flag; int str_len, pad; @@ -708,8 +708,8 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa for(vos= strings->first; vos; vos= vos->next) { if(mat && !(vos->flag & V3D_CACHE_TEXT_WORLDSPACE)) mul_m4_v3(mat, vos->vec); - view3d_project_short_clip(ar, vos->vec, vos->mval, 0); - if(vos->mval[0]!=IS_CLIPPED) + view3d_project_short_clip(ar, vos->vec, vos->sco, 0); + if(vos->sco[0]!=IS_CLIPPED) tot++; } @@ -749,7 +749,7 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa continue; } #endif - if(vos->mval[0]!=IS_CLIPPED) { + if(vos->sco[0]!=IS_CLIPPED) { const char *str= (char *)(vos+1); if(col_pack_prev != vos->col.pack) { @@ -757,10 +757,10 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa col_pack_prev= vos->col.pack; } if(vos->flag & V3D_CACHE_TEXT_ASCII) { - BLF_draw_default_ascii((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); + BLF_draw_default_ascii((float)vos->sco[0]+vos->xoffs, (float)vos->sco[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); } else { - BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); + BLF_draw_default((float)vos->sco[0]+vos->xoffs, (float)vos->sco[1], (depth_write)? 0.0f: 2.0f, str, vos->str_len); } } } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 66f5ac18fbf..6f5960f5ed3 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -564,13 +564,13 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d) { - short mx,my,co[2]; + int mx, my, co[2]; int flag; /* we dont want the clipping for cursor */ flag= v3d->flag; v3d->flag= 0; - project_short(ar, give_cursor(scene, v3d), co); + project_int(ar, give_cursor(scene, v3d), co); v3d->flag= flag; mx = co[0]; @@ -1279,7 +1279,7 @@ ImBuf *view3d_read_backbuf(ViewContext *vc, short xmin, short ymin, short xmax, } /* smart function to sample a rect spiralling outside, nice for backbuf selection */ -unsigned int view3d_sample_backbuf_rect(ViewContext *vc, const short mval[2], int size, +unsigned int view3d_sample_backbuf_rect(ViewContext *vc, const int mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, void *handle, unsigned int (*indextest)(void *handle, unsigned int index)) { diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index fb0a33674f7..53d2bed996e 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2735,7 +2735,7 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3]; - short mx, my, mval[2]; + int mx, my, mval[2]; // short ctrl= 0; // XXX int flip; fp= give_cursor(scene, v3d); @@ -2746,7 +2746,7 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve mx= event->x - ar->winrct.xmin; my= event->y - ar->winrct.ymin; - project_short_noclip(ar, fp, mval); + project_int_noclip(ar, fp, mval); flip= initgrabz(rv3d, fp[0], fp[1], fp[2]); /* reset the depth based on the view offset */ @@ -2754,7 +2754,7 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve negate_v3_v3(fp, rv3d->ofs); /* re initialize */ - project_short_noclip(ar, fp, mval); + project_int_noclip(ar, fp, mval); flip= initgrabz(rv3d, fp[0], fp[1], fp[2]); } @@ -2762,7 +2762,7 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve short depth_used = 0; if (U.uiflag & USER_ORBIT_ZBUF) { /* maybe this should be accessed some other way */ - short mval_depth[2]; + int mval_depth[2]; mval_depth[0]= mx; mval_depth[1]= my; view3d_operator_needs_opengl(C); @@ -2893,7 +2893,7 @@ void VIEW3D_OT_enable_manipulator(wmOperatorType *ot) /* ************************* below the line! *********************** */ -static float view_autodist_depth_margin(ARegion *ar, const short mval[2], int margin) +static float view_autodist_depth_margin(ARegion *ar, const int mval[2], int margin) { ViewDepths depth_temp= {0}; rcti rect; @@ -2921,7 +2921,7 @@ static float view_autodist_depth_margin(ARegion *ar, const short mval[2], int ma } /* XXX todo Zooms in on a border drawn by the user */ -int view_autodist(Scene *scene, ARegion *ar, View3D *v3d, const short mval[2], float mouse_worldloc[3] ) //, float *autodist ) +int view_autodist(Scene *scene, ARegion *ar, View3D *v3d, const int mval[2], float mouse_worldloc[3] ) //, float *autodist ) { bglMats mats; /* ZBuffer depth vars */ float depth_close= FLT_MAX; @@ -2964,7 +2964,7 @@ int view_autodist_init(Scene *scene, ARegion *ar, View3D *v3d, int mode) //, flo } // no 4x4 sampling, run view_autodist_init first -int view_autodist_simple(ARegion *ar, const short mval[2], float mouse_worldloc[3], int margin, float *force_depth) //, float *autodist ) +int view_autodist_simple(ARegion *ar, const int mval[2], float mouse_worldloc[3], int margin, float *force_depth) //, float *autodist ) { bglMats mats; /* ZBuffer depth vars, could cache? */ float depth; @@ -2992,7 +2992,7 @@ int view_autodist_simple(ARegion *ar, const short mval[2], float mouse_worldloc[ return 1; } -int view_autodist_depth(struct ARegion *ar, const short mval[2], int margin, float *depth) +int view_autodist_depth(struct ARegion *ar, const int mval[2], int margin, float *depth) { *depth= view_autodist_depth_margin(ar, mval, margin); @@ -3002,11 +3002,11 @@ int view_autodist_depth(struct ARegion *ar, const short mval[2], int margin, flo static int depth_segment_cb(int x, int y, void *userData) { struct { struct ARegion *ar; int margin; float depth; } *data = userData; - short mval[2]; + int mval[2]; float depth; - mval[0]= (short)x; - mval[1]= (short)y; + mval[0]= x; + mval[1]= y; depth= view_autodist_depth_margin(data->ar, mval, data->margin); @@ -3019,7 +3019,7 @@ static int depth_segment_cb(int x, int y, void *userData) } } -int view_autodist_depth_segment(struct ARegion *ar, const short mval_sta[2], const short mval_end[2], int margin, float *depth) +int view_autodist_depth_segment(struct ARegion *ar, const int mval_sta[2], const int mval_end[2], int margin, float *depth) { struct { struct ARegion *ar; int margin; float depth; } data = {NULL}; int p1[2]; diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 32deee50fb2..e37361fbc54 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -158,7 +158,7 @@ typedef struct FlyInfo { short state; short use_precision; short redraw; - short mval[2]; + int mval[2]; /* fly state state */ float speed; /* the speed the view is moving per redraw */ diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index f51a780787e..c4999b961f0 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -93,15 +93,15 @@ void view3d_set_viewcontext(bContext *C, ViewContext *vc) vc->obedit= CTX_data_edit_object(C); } -int view3d_get_view_aligned_coordinate(ViewContext *vc, float fp[3], const short mval[2], const short do_fallback) +int view3d_get_view_aligned_coordinate(ViewContext *vc, float fp[3], const int mval[2], const short do_fallback) { float dvec[3]; - short mval_cpy[2]; + int mval_cpy[2]; mval_cpy[0]= mval[0]; mval_cpy[1]= mval[1]; - project_short_noclip(vc->ar, fp, mval_cpy); + project_int_noclip(vc->ar, fp, mval_cpy); initgrabz(vc->rv3d, fp[0], fp[1], fp[2]); @@ -274,12 +274,12 @@ static int edge_inside_rect(rcti *rect, short x1, short y1, short x2, short y2) #define MOVES_GESTURE 50 #define MOVES_LASSO 500 -int lasso_inside(short mcords[][2], short moves, short sx, short sy) +int lasso_inside(int mcords[][2], short moves, int sx, int sy) { /* we do the angle rule, define that all added angles should be about zero or 2*PI */ float angletot=0.0, len, dot, ang, cross, fp1[2], fp2[2]; int a; - short *p1, *p2; + int *p1, *p2; if(sx==IS_CLIPPED) return 0; @@ -322,9 +322,9 @@ int lasso_inside(short mcords[][2], short moves, short sx, short sy) } /* edge version for lasso select. we assume boundbox check was done */ -int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1) +int lasso_inside_edge(int mcords[][2], short moves, int x0, int y0, int x1, int y1) { - short v1[2], v2[2]; + int v1[2], v2[2]; int a; if(x0==IS_CLIPPED || x1==IS_CLIPPED) @@ -339,9 +339,9 @@ int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, in /* no points in lasso, so we have to intersect with lasso edge */ - if( isect_line_line_v2_short(mcords[0], mcords[moves-1], v1, v2) > 0) return 1; + if( isect_line_line_v2_int(mcords[0], mcords[moves-1], v1, v2) > 0) return 1; for(a=0; a<moves-1; a++) { - if( isect_line_line_v2_short(mcords[a], mcords[a+1], v1, v2) > 0) return 1; + if( isect_line_line_v2_int(mcords[a], mcords[a+1], v1, v2) > 0) return 1; } return 0; @@ -351,11 +351,11 @@ int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, in /* warning; lasso select with backbuffer-check draws in backbuf with persp(PERSP_WIN) and returns with persp(PERSP_VIEW). After lasso select backbuf is not OK */ -static void do_lasso_select_pose(ViewContext *vc, Object *ob, short mcords[][2], short moves, short select) +static void do_lasso_select_pose(ViewContext *vc, Object *ob, int mcords[][2], short moves, short select) { bPoseChannel *pchan; float vec[3]; - short sco1[2], sco2[2]; + int sco1[2], sco2[2]; bArmature *arm= ob->data; if(ob->type!=OB_ARMATURE || ob->pose==NULL) return; @@ -363,9 +363,9 @@ static void do_lasso_select_pose(ViewContext *vc, Object *ob, short mcords[][2], for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { if (PBONE_VISIBLE(arm, pchan->bone) && (pchan->bone->flag & BONE_UNSELECTABLE)==0) { mul_v3_m4v3(vec, ob->obmat, pchan->pose_head); - project_short(vc->ar, vec, sco1); + project_int(vc->ar, vec, sco1); mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail); - project_short(vc->ar, vec, sco2); + project_int(vc->ar, vec, sco2); if(lasso_inside_edge(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1])) { if(select) pchan->bone->flag |= BONE_SELECTED; @@ -386,7 +386,7 @@ static void object_deselect_all_visible(Scene *scene, View3D *v3d) } } -static void do_lasso_select_objects(ViewContext *vc, short mcords[][2], short moves, short extend, short select) +static void do_lasso_select_objects(ViewContext *vc, int mcords[][2], short moves, short extend, short select) { Base *base; @@ -409,7 +409,7 @@ static void do_lasso_select_objects(ViewContext *vc, short mcords[][2], short mo } } -static void lasso_select_boundbox(rcti *rect, short mcords[][2], short moves) +static void lasso_select_boundbox(rcti *rect, int mcords[][2], short moves) { short a; @@ -426,7 +426,7 @@ static 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 UNUSED(index)) { - struct { ViewContext vc; rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData; + struct { ViewContext vc; rcti *rect; int (*mcords)[2], moves, select, pass, done; } *data = userData; if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) { eve->f = data->select?(eve->f|1):(eve->f&~1); @@ -434,7 +434,7 @@ static void do_lasso_select_mesh__doSelectVert(void *userData, EditVert *eve, in } static void do_lasso_select_mesh__doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index) { - struct { ViewContext vc; rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData; + struct { ViewContext vc; rcti *rect; int (*mcords)[2], moves, select, pass, done; } *data = userData; if (EM_check_backbuf(em_solidoffs+index)) { if (data->pass==0) { @@ -453,16 +453,16 @@ 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 UNUSED(index)) { - struct { ViewContext vc; rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData; + struct { ViewContext vc; rcti *rect; int (*mcords)[2], moves, select, pass, done; } *data = userData; if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) { EM_select_face_fgon(data->vc.em, efa, data->select); } } -static void do_lasso_select_mesh(ViewContext *vc, short mcords[][2], short moves, short extend, short select) +static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves, short extend, short select) { - struct { ViewContext vc; rcti *rect; short (*mcords)[2], moves, select, pass, done; } data; + struct { ViewContext vc; rcti *rect; int (*mcords)[2], moves, select, pass, done; } data; ToolSettings *ts= vc->scene->toolsettings; rcti rect; int bbsel; @@ -528,7 +528,7 @@ static void do_lasso_select_mesh(ViewContext *vc, short mcords[][2], short moves #if 0 /* this is an exception in that its the only lasso that dosnt use the 3d view (uses space image view) */ -static void do_lasso_select_mesh_uv(short mcords[][2], short moves, short select) +static void do_lasso_select_mesh_uv(int mcords[][2], short moves, short select) { EditFace *efa; MTFace *tf; @@ -585,7 +585,7 @@ static void do_lasso_select_mesh_uv(short mcords[][2], short moves, short select 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; + struct { ViewContext *vc; int (*mcords)[2]; short moves; short select; } *data = userData; Object *obedit= data->vc->obedit; Curve *cu= (Curve*)obedit->data; @@ -612,9 +612,9 @@ static void do_lasso_select_curve__doSelect(void *userData, Nurb *UNUSED(nu), BP } } -static void do_lasso_select_curve(ViewContext *vc, short mcords[][2], short moves, short extend, short select) +static void do_lasso_select_curve(ViewContext *vc, int mcords[][2], short moves, short extend, short select) { - struct { ViewContext *vc; short (*mcords)[2]; short moves; short select; } data; + struct { ViewContext *vc; int (*mcords)[2]; short moves; short select; } data; /* set vc->editnurb */ data.vc = vc; @@ -631,15 +631,15 @@ static void do_lasso_select_curve(ViewContext *vc, short mcords[][2], short move static void do_lasso_select_lattice__doSelect(void *userData, BPoint *bp, int x, int y) { - struct { short (*mcords)[2]; short moves; short select; } *data = userData; + struct { int (*mcords)[2]; short moves; short select; } *data = userData; if (lasso_inside(data->mcords, data->moves, x, y)) { bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT); } } -static void do_lasso_select_lattice(ViewContext *vc, short mcords[][2], short moves, short extend, short select) +static void do_lasso_select_lattice(ViewContext *vc, int mcords[][2], short moves, short extend, short select) { - struct { short (*mcords)[2]; short moves; short select; } data; + struct { int (*mcords)[2]; short moves; short select; } data; /* set editdata in vc */ data.mcords = mcords; @@ -653,7 +653,7 @@ static void do_lasso_select_lattice(ViewContext *vc, short mcords[][2], short mo lattice_foreachScreenVert(vc, do_lasso_select_lattice__doSelect, &data); } -static void do_lasso_select_armature(ViewContext *vc, short mcords[][2], short moves, short extend, short select) +static void do_lasso_select_armature(ViewContext *vc, int mcords[][2], short moves, short extend, short select) { bArmature *arm= vc->obedit->data; EditBone *ebone; @@ -705,7 +705,7 @@ static void do_lasso_select_armature(ViewContext *vc, short mcords[][2], short m -static void do_lasso_select_meta(ViewContext *vc, short mcords[][2], short moves, short extend, short select) +static void do_lasso_select_meta(ViewContext *vc, int mcords[][2], short moves, short extend, short select) { MetaBall *mb = (MetaBall*)vc->obedit->data; MetaElem *ml; @@ -730,7 +730,7 @@ static void do_lasso_select_meta(ViewContext *vc, short mcords[][2], short moves } } -static void do_lasso_select_paintface(ViewContext *vc, short mcords[][2], short moves, short extend, short select) +static void do_lasso_select_paintface(ViewContext *vc, int mcords[][2], short moves, short extend, short select) { Object *ob= vc->obact; Mesh *me= ob?ob->data:NULL; @@ -755,7 +755,7 @@ static void do_lasso_select_paintface(ViewContext *vc, short mcords[][2], short } #if 0 -static void do_lasso_select_node(short mcords[][2], short moves, short select) +static void do_lasso_select_node(int mcords[][2], short moves, short select) { SpaceNode *snode = sa->spacedata.first; @@ -785,7 +785,7 @@ static void do_lasso_select_node(short mcords[][2], short moves, short select) } #endif -static void view3d_lasso_select(bContext *C, ViewContext *vc, short mcords[][2], short moves, short extend, short select) +static void view3d_lasso_select(bContext *C, ViewContext *vc, int mcords[][2], short moves, short extend, short select) { Object *ob = CTX_data_active_object(C); @@ -834,14 +834,14 @@ static int view3d_lasso_select_exec(bContext *C, wmOperator *op) { ViewContext vc; int i= 0; - short mcords[1024][2]; + int mcords[1024][2]; RNA_BEGIN(op->ptr, itemptr, "path") { float loc[2]; RNA_float_get_array(&itemptr, "loc", loc); - mcords[i][0]= (short)loc[0]; - mcords[i][1]= (short)loc[1]; + mcords[i][0]= (int)loc[0]; + mcords[i][1]= (int)loc[1]; i++; if(i>=1024) break; } @@ -953,7 +953,7 @@ static void deselectall_except(Scene *scene, Base *b) /* deselect all except b } } -static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffer, int hits, const short mval[2], short extend) +static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffer, int hits, const int mval[2], short extend) { short baseCount = 0; short ok; @@ -1039,7 +1039,7 @@ static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffe /* we want a select buffer with bones, if there are... */ /* so check three selection levels and compare */ -static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buffer, const short mval[2]) +static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buffer, const int mval[2]) { rcti rect; int offs; @@ -1096,12 +1096,12 @@ static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buff } /* returns basact */ -static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int hits, const short mval[2], Base *startbase, int has_bones) +static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int hits, const int mval[2], Base *startbase, int has_bones) { Scene *scene= vc->scene; View3D *v3d= vc->v3d; Base *base, *basact= NULL; - static short lastmval[2]={-100, -100}; + static int lastmval[2]={-100, -100}; int a, donearest= 0; /* define if we use solid nearest select or not */ @@ -1189,7 +1189,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int } /* mval comes from event->mval, only use within region handlers */ -Base *ED_view3d_give_base_under_cursor(bContext *C, const short mval[2]) +Base *ED_view3d_give_base_under_cursor(bContext *C, const int mval[2]) { ViewContext vc; Base *basact= NULL; @@ -1214,7 +1214,7 @@ Base *ED_view3d_give_base_under_cursor(bContext *C, const short mval[2]) } /* mval is region coords */ -static int mouse_select(bContext *C, const short mval[2], short extend, short obcenter, short enumerate) +static int mouse_select(bContext *C, const int mval[2], short extend, short obcenter, short enumerate) { ViewContext vc; ARegion *ar= CTX_wm_region(C); @@ -1905,7 +1905,7 @@ void VIEW3D_OT_select(wmOperatorType *ot) 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; + struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData; int mx = x - data->mval[0], my = y - data->mval[1]; float r = sqrt(mx*mx + my*my); @@ -1915,7 +1915,7 @@ static void mesh_circle_doSelectVert(void *userData, EditVert *eve, int x, int y } 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; + struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData; if (edge_inside_circle(data->mval[0], data->mval[1], (short) data->radius, x0, y0, x1, y1)) { EM_select_edge(eed, data->select); @@ -1923,7 +1923,7 @@ static void mesh_circle_doSelectEdge(void *userData, EditEdge *eed, int x0, int } 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; + struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData; int mx = x - data->mval[0], my = y - data->mval[1]; float r = sqrt(mx*mx + my*my); @@ -1932,11 +1932,11 @@ static void mesh_circle_doSelectFace(void *userData, EditFace *efa, int x, int y } } -static void mesh_circle_select(ViewContext *vc, int select, const short mval[2], float rad) +static void mesh_circle_select(ViewContext *vc, int select, const int mval[2], float rad) { ToolSettings *ts= vc->scene->toolsettings; int bbsel; - struct {ViewContext *vc; short select, mval[2]; float radius; } data; + struct {ViewContext *vc; short select; int mval[2]; float radius; } data; bbsel= EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f)); ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */ @@ -1977,7 +1977,7 @@ static void mesh_circle_select(ViewContext *vc, int select, const short mval[2], EM_selectmode_flush(vc->em); } -static void paint_facesel_circle_select(ViewContext *vc, int select, const short mval[2], float rad) +static void paint_facesel_circle_select(ViewContext *vc, int select, const int mval[2], float rad) { Object *ob= vc->obact; Mesh *me = ob?ob->data:NULL; @@ -1995,7 +1995,7 @@ static void paint_facesel_circle_select(ViewContext *vc, int select, const short 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; + struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData; int mx = x - data->mval[0], my = y - data->mval[1]; float r = sqrt(mx*mx + my*my); Object *obedit= data->vc->obedit; @@ -2024,9 +2024,9 @@ static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint } } } -static void nurbscurve_circle_select(ViewContext *vc, int select, const short mval[2], float rad) +static void nurbscurve_circle_select(ViewContext *vc, int select, const int mval[2], float rad) { - struct {ViewContext *vc; short select, mval[2]; float radius; } data; + struct {ViewContext *vc; short select; int mval[2]; float radius; } data; /* set vc-> edit data */ @@ -2043,7 +2043,7 @@ static void nurbscurve_circle_select(ViewContext *vc, int select, const short mv static void latticecurve_circle_doSelect(void *userData, BPoint *bp, int x, int y) { - struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData; + struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData; int mx = x - data->mval[0], my = y - data->mval[1]; float r = sqrt(mx*mx + my*my); @@ -2051,9 +2051,9 @@ static void latticecurve_circle_doSelect(void *userData, BPoint *bp, int x, int bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT); } } -static void lattice_circle_select(ViewContext *vc, int select, const short mval[2], float rad) +static void lattice_circle_select(ViewContext *vc, int select, const int mval[2], float rad) { - struct {ViewContext *vc; short select, mval[2]; float radius; } data; + struct {ViewContext *vc; short select; int mval[2]; float radius; } data; /* set vc-> edit data */ @@ -2070,7 +2070,7 @@ static void lattice_circle_select(ViewContext *vc, int select, const short mval[ // NOTE: pose-bone case is copied from editbone case... static short pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, int x, int y) { - struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData; + struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData; int mx = x - data->mval[0], my = y - data->mval[1]; float r = sqrt(mx*mx + my*my); @@ -2083,9 +2083,9 @@ static short pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, int } return 0; } -static void pose_circle_select(ViewContext *vc, int select, const short mval[2], float rad) +static void pose_circle_select(ViewContext *vc, int select, const int mval[2], float rad) { - struct {ViewContext *vc; short select, mval[2]; float radius; } data; + struct {ViewContext *vc; short select; int mval[2]; float radius; } data; bPose *pose = vc->obact->pose; bPoseChannel *pchan; int change= FALSE; @@ -2130,7 +2130,7 @@ static void pose_circle_select(ViewContext *vc, int select, const short mval[2], static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, int x, int y, short head) { - struct {ViewContext *vc; short select, mval[2]; float radius; } *data = userData; + struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData; int mx = x - data->mval[0], my = y - data->mval[1]; float r = sqrt(mx*mx + my*my); @@ -2151,7 +2151,7 @@ static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, int } return 0; } -static void armature_circle_select(ViewContext *vc, int select, const short mval[2], float rad) +static void armature_circle_select(ViewContext *vc, int select, const int mval[2], float rad) { struct {ViewContext *vc; short select, mval[2]; float radius; } data; bArmature *arm= vc->obedit->data; @@ -2210,7 +2210,7 @@ static void armature_circle_select(ViewContext *vc, int select, const short mval /** Callbacks for circle selection in Editmode */ -static void obedit_circle_select(ViewContext *vc, short select, const short mval[2], float rad) +static void obedit_circle_select(ViewContext *vc, short select, const int mval[2], float rad) { switch(vc->obedit->type) { case OB_MESH: @@ -2251,7 +2251,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) (obact && (obact->mode & (OB_MODE_PARTICLE_EDIT|OB_MODE_POSE))) ) { ViewContext vc; - short mval[2]; + int mval[2]; view3d_operator_needs_opengl(C); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index f8a5a5ad78a..39169318ace 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -647,7 +647,7 @@ int initgrabz(RegionView3D *rv3d, float x, float y, float z) } /* always call initgrabz */ -void window_to_3d(ARegion *ar, float out[3], short mx, short my) +void window_to_3d(ARegion *ar, float out[3], const int mx, const int my) { RegionView3D *rv3d= ar->regiondata; @@ -665,7 +665,7 @@ void window_to_3d(ARegion *ar, float out[3], short mx, short my) /* always call initgrabz */ /* only to detect delta motion */ -void window_to_3d_delta(ARegion *ar, float out[3], short mx, short my) +void window_to_3d_delta(ARegion *ar, float out[3], const int mx, const int my) { RegionView3D *rv3d= ar->regiondata; float dx, dy; @@ -681,7 +681,7 @@ void window_to_3d_delta(ARegion *ar, float out[3], short mx, short my) /* doesn't rely on initgrabz */ /* for perspective view, get the vector direction to * the mouse cursor as a normalized vector */ -void window_to_3d_vector(ARegion *ar, float out[3], short mx, short my) +void window_to_3d_vector(ARegion *ar, float out[3], const int mx, const int my) { RegionView3D *rv3d= ar->regiondata; float dx, dy; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 614b048e0b8..4ea1e8742f5 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -120,7 +120,7 @@ void setTransformViewMatrices(TransInfo *t) calculateCenter2D(t); } -void convertViewVec(TransInfo *t, float *vec, short dx, short dy) +void convertViewVec(TransInfo *t, float *vec, int dx, int dy) { if (t->spacetype==SPACE_VIEW3D) { if (t->ar->regiontype == RGN_TYPE_WINDOW) @@ -783,7 +783,7 @@ int transformEvent(TransInfo *t, wmEvent *event) case SPACEKEY: if ((t->spacetype==SPACE_VIEW3D) && event->alt) { #if 0 // TRANSFORM_FIX_ME - short mval[2]; + int mval[2]; getmouseco_sc(mval); BIF_selectOrientation(); @@ -1270,7 +1270,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata) setlinestyle(3); glBegin(GL_LINE_STRIP); - glVertex2sv(t->mval); + glVertex2iv(t->mval); glVertex2fv(cent); glEnd(); @@ -1315,7 +1315,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata) setlinestyle(3); glBegin(GL_LINE_STRIP); - glVertex2sv(t->mval); + glVertex2iv(t->mval); glVertex2fv(cent); glEnd(); @@ -2286,7 +2286,7 @@ int handleEventWarp(TransInfo *t, wmEvent *event) return status; } -int Warp(TransInfo *t, const short UNUSED(mval[2])) +int Warp(TransInfo *t, const int UNUSED(mval[2])) { TransData *td = t->data; float vec[3], circumfac, dist, phi0, co, si, *curs, cursor[3], gcursor[3]; @@ -2434,7 +2434,7 @@ int handleEventShear(TransInfo *t, wmEvent *event) } -int Shear(TransInfo *t, const short UNUSED(mval[2])) +int Shear(TransInfo *t, const int UNUSED(mval[2])) { TransData *td = t->data; float vec[3]; @@ -2700,7 +2700,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { constraintTransLim(t, td); } -int Resize(TransInfo *t, const short mval[2]) +int Resize(TransInfo *t, const int mval[2]) { TransData *td; float size[3], mat[3][3]; @@ -2805,7 +2805,7 @@ void initToSphere(TransInfo *t) t->val /= (float)t->total; } -int ToSphere(TransInfo *t, const short UNUSED(mval[2])) +int ToSphere(TransInfo *t, const int UNUSED(mval[2])) { float vec[3]; float ratio, radius; @@ -3152,7 +3152,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) } } -int Rotation(TransInfo *t, const short UNUSED(mval[2])) +int Rotation(TransInfo *t, const int UNUSED(mval[2])) { char str[128], *spos= str; @@ -3260,7 +3260,7 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a } } -int Trackball(TransInfo *t, const short UNUSED(mval[2])) +int Trackball(TransInfo *t, const int UNUSED(mval[2])) { char str[128], *spos= str; float axis1[3], axis2[3]; @@ -3490,7 +3490,7 @@ static void applyTranslation(TransInfo *t, float vec[3]) { } /* uses t->vec to store actual translation in */ -int Translation(TransInfo *t, const short UNUSED(mval[2])) +int Translation(TransInfo *t, const int UNUSED(mval[2])) { char str[250]; @@ -3557,7 +3557,7 @@ void initShrinkFatten(TransInfo *t) -int ShrinkFatten(TransInfo *t, const short UNUSED(mval[2])) +int ShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) { float vec[3]; float distance; @@ -3632,7 +3632,7 @@ void initTilt(TransInfo *t) -int Tilt(TransInfo *t, const short UNUSED(mval[2])) +int Tilt(TransInfo *t, const int UNUSED(mval[2])) { TransData *td = t->data; int i; @@ -3704,7 +3704,7 @@ void initCurveShrinkFatten(TransInfo *t) t->flag |= T_NO_CONSTRAINT; } -int CurveShrinkFatten(TransInfo *t, const short UNUSED(mval[2])) +int CurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) { TransData *td = t->data; float ratio; @@ -3772,7 +3772,7 @@ void initPushPull(TransInfo *t) } -int PushPull(TransInfo *t, const short UNUSED(mval[2])) +int PushPull(TransInfo *t, const int UNUSED(mval[2])) { float vec[3], axis[3]; float distance; @@ -3905,7 +3905,7 @@ int handleEventBevel(TransInfo *t, wmEvent *event) return 0; } -int Bevel(TransInfo *t, const short UNUSED(mval[2])) +int Bevel(TransInfo *t, const int UNUSED(mval[2])) { float distance,d; int i; @@ -3973,7 +3973,7 @@ void initBevelWeight(TransInfo *t) t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; } -int BevelWeight(TransInfo *t, const short UNUSED(mval[2])) +int BevelWeight(TransInfo *t, const int UNUSED(mval[2])) { TransData *td = t->data; float weight; @@ -4046,7 +4046,7 @@ void initCrease(TransInfo *t) t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; } -int Crease(TransInfo *t, const short UNUSED(mval[2])) +int Crease(TransInfo *t, const int UNUSED(mval[2])) { TransData *td = t->data; float crease; @@ -4165,7 +4165,7 @@ static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3]) td->loc[1]= oldy; } -int BoneSize(TransInfo *t, const short mval[2]) +int BoneSize(TransInfo *t, const int mval[2]) { TransData *td = t->data; float size[3], mat[3][3]; @@ -4241,7 +4241,7 @@ void initBoneEnvelope(TransInfo *t) t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; } -int BoneEnvelope(TransInfo *t, const short UNUSED(mval[2])) +int BoneEnvelope(TransInfo *t, const int UNUSED(mval[2])) { TransData *td = t->data; float ratio; @@ -4672,10 +4672,10 @@ static int createSlideVerts(TransInfo *t) #undef EDGE_SLIDE_MIN - sld->start[0] = (short) start[0]; - sld->start[1] = (short) start[1]; - sld->end[0] = (short) end[0]; - sld->end[1] = (short) end[1]; + sld->start[0] = (int) start[0]; + sld->start[1] = (int) start[1]; + sld->end[0] = (int) end[0]; + sld->end[1] = (int) end[1]; if (uvlay_tot) { // XXX && (scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) { int maxnum = 0; @@ -4975,7 +4975,7 @@ int doEdgeSlide(TransInfo *t, float perc) return 1; } -int EdgeSlide(TransInfo *t, const short UNUSED(mval[2])) +int EdgeSlide(TransInfo *t, const int UNUSED(mval[2])) { char str[50]; float final; @@ -5034,7 +5034,7 @@ void initBoneRoll(TransInfo *t) t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; } -int BoneRoll(TransInfo *t, const short UNUSED(mval[2])) +int BoneRoll(TransInfo *t, const int UNUSED(mval[2])) { TransData *td = t->data; int i; @@ -5095,7 +5095,7 @@ void initBakeTime(TransInfo *t) t->num.increment = t->snap[1]; } -int BakeTime(TransInfo *t, const short mval[2]) +int BakeTime(TransInfo *t, const int mval[2]) { TransData *td = t->data; float time; @@ -5170,7 +5170,7 @@ void initMirror(TransInfo *t) } } -int Mirror(TransInfo *t, const short UNUSED(mval[2])) +int Mirror(TransInfo *t, const int UNUSED(mval[2])) { TransData *td; float size[3], mat[3][3]; @@ -5247,7 +5247,7 @@ void initAlign(TransInfo *t) initMouseInputMode(t, &t->mouse, INPUT_NONE); } -int Align(TransInfo *t, const short UNUSED(mval[2])) +int Align(TransInfo *t, const int UNUSED(mval[2])) { TransData *td = t->data; float center[3]; @@ -5350,7 +5350,7 @@ static void applySeqSlide(TransInfo *t, float val[2]) { } } -int SeqSlide(TransInfo *t, const short UNUSED(mval[2])) +int SeqSlide(TransInfo *t, const int UNUSED(mval[2])) { char str[200]; @@ -5640,7 +5640,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) } } -int TimeTranslate(TransInfo *t, const short mval[2]) +int TimeTranslate(TransInfo *t, const int mval[2]) { View2D *v2d = (View2D *)t->view; float cval[2], sval[2]; @@ -5770,7 +5770,7 @@ static void applyTimeSlide(TransInfo *t, float sval) } } -int TimeSlide(TransInfo *t, const short mval[2]) +int TimeSlide(TransInfo *t, const int mval[2]) { View2D *v2d = (View2D *)t->view; float cval[2], sval[2]; @@ -5895,7 +5895,7 @@ static void applyTimeScale(TransInfo *t) { } } -int TimeScale(TransInfo *t, const short UNUSED(mval[2])) +int TimeScale(TransInfo *t, const int UNUSED(mval[2])) { char str[200]; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index b94f2cc525a..b55435fd0cf 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -119,7 +119,7 @@ typedef struct TransCon { float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */ float center[3]; /* transformation center to define where to draw the view widget ALWAYS in global space. Unlike the transformation center */ - short imval[2]; /* initial mouse value for visual calculation */ + int imval[2]; /* initial mouse value for visual calculation */ /* the one in TransInfo is not garanty to stay the same (Rotates change it) */ int mode; /* Mode flags of the Constraint */ void (*drawExtra)(struct TransInfo *); @@ -217,7 +217,7 @@ typedef struct SlideData { struct GHash *vhash, **uvhash; struct EditVert *nearest; struct LinkNode *edgelist, *vertlist; - short start[2], end[2]; + int start[2], end[2]; } SlideData; typedef struct TransData { @@ -242,12 +242,12 @@ typedef struct TransData { } TransData; typedef struct MouseInput { - void (*apply)(struct TransInfo *, struct MouseInput *, const short [2], float [3]); + void (*apply)(struct TransInfo *, struct MouseInput *, const int [2], float [3]); void (*post)(struct TransInfo *, float [3]); - short imval[2]; /* initial mouse position */ + int imval[2]; /* initial mouse position */ char precision; - short precision_mval[2]; /* mouse position when precision key was pressed */ + int precision_mval[2]; /* mouse position when precision key was pressed */ int center[2]; float factor; void *data; /* additional data, if needed by the particular function */ @@ -261,7 +261,7 @@ typedef struct TransInfo { int options; /* current context/options for transform */ float val; /* init value for some transformations (and rotation angle) */ float fac; /* factor for distance based transform */ - int (*transform)(struct TransInfo *, const short *); + int (*transform)(struct TransInfo *, const int *); /* transform function pointer */ int (*handleEvent)(struct TransInfo *, struct wmEvent *); /* event handler function pointer RETURN 1 if redraw is needed */ @@ -279,7 +279,7 @@ typedef struct TransInfo { char proptext[20]; /* proportional falloff text */ float center[3]; /* center of transformation */ int center2d[2]; /* center in screen coordinates */ - short imval[2]; /* initial mouse position */ + int imval[2]; /* initial mouse position */ short event_type; /* event->type used to invoke transform */ short idx_max; /* maximum index on the input vector */ float snap[3]; /* Snapping Gears */ @@ -328,7 +328,7 @@ typedef struct TransInfo { struct Scene *scene; struct ToolSettings *settings; struct wmTimer *animtimer; - short mval[2]; /* current mouse position */ + int mval[2]; /* current mouse position */ struct Object *obedit; void *draw_handle_apply; void *draw_handle_view; @@ -458,7 +458,7 @@ void transformApply(struct bContext *C, TransInfo *t); int transformEnd(struct bContext *C, TransInfo *t); void setTransformViewMatrices(TransInfo *t); -void convertViewVec(TransInfo *t, float *vec, short dx, short dy); +void convertViewVec(TransInfo *t, float *vec, int dx, int dy); void projectIntView(TransInfo *t, float *vec, int *adr); void projectFloatView(TransInfo *t, float *vec, float *adr); @@ -467,81 +467,81 @@ void removeAspectRatio(TransInfo *t, float *vec); void initWarp(TransInfo *t); int handleEventWarp(TransInfo *t, struct wmEvent *event); -int Warp(TransInfo *t, const short mval[2]); +int Warp(TransInfo *t, const int mval[2]); void initShear(TransInfo *t); int handleEventShear(TransInfo *t, struct wmEvent *event); -int Shear(TransInfo *t, const short mval[2]); +int Shear(TransInfo *t, const int mval[2]); void initResize(TransInfo *t); -int Resize(TransInfo *t, const short mval[2]); +int Resize(TransInfo *t, const int mval[2]); void initTranslation(TransInfo *t); -int Translation(TransInfo *t, const short mval[2]); +int Translation(TransInfo *t, const int mval[2]); void initToSphere(TransInfo *t); -int ToSphere(TransInfo *t, const short mval[2]); +int ToSphere(TransInfo *t, const int mval[2]); void initRotation(TransInfo *t); -int Rotation(TransInfo *t, const short mval[2]); +int Rotation(TransInfo *t, const int mval[2]); void initShrinkFatten(TransInfo *t); -int ShrinkFatten(TransInfo *t, const short mval[2]); +int ShrinkFatten(TransInfo *t, const int mval[2]); void initTilt(TransInfo *t); -int Tilt(TransInfo *t, const short mval[2]); +int Tilt(TransInfo *t, const int mval[2]); void initCurveShrinkFatten(TransInfo *t); -int CurveShrinkFatten(TransInfo *t, const short mval[2]); +int CurveShrinkFatten(TransInfo *t, const int mval[2]); void initTrackball(TransInfo *t); -int Trackball(TransInfo *t, const short mval[2]); +int Trackball(TransInfo *t, const int mval[2]); void initPushPull(TransInfo *t); -int PushPull(TransInfo *t, const short mval[2]); +int PushPull(TransInfo *t, const int mval[2]); void initBevel(TransInfo *t); int handleEventBevel(TransInfo *t, struct wmEvent *event); -int Bevel(TransInfo *t, const short mval[2]); +int Bevel(TransInfo *t, const int mval[2]); void initBevelWeight(TransInfo *t); -int BevelWeight(TransInfo *t, const short mval[2]); +int BevelWeight(TransInfo *t, const int mval[2]); void initCrease(TransInfo *t); -int Crease(TransInfo *t, const short mval[2]); +int Crease(TransInfo *t, const int mval[2]); void initBoneSize(TransInfo *t); -int BoneSize(TransInfo *t, const short mval[2]); +int BoneSize(TransInfo *t, const int mval[2]); void initBoneEnvelope(TransInfo *t); -int BoneEnvelope(TransInfo *t, const short mval[2]); +int BoneEnvelope(TransInfo *t, const int mval[2]); void initBoneRoll(TransInfo *t); -int BoneRoll(TransInfo *t, const short mval[2]); +int BoneRoll(TransInfo *t, const int mval[2]); void initEdgeSlide(TransInfo *t); -int EdgeSlide(TransInfo *t, const short mval[2]); +int EdgeSlide(TransInfo *t, const int mval[2]); void initTimeTranslate(TransInfo *t); -int TimeTranslate(TransInfo *t, const short mval[2]); +int TimeTranslate(TransInfo *t, const int mval[2]); void initTimeSlide(TransInfo *t); -int TimeSlide(TransInfo *t, const short mval[2]); +int TimeSlide(TransInfo *t, const int mval[2]); void initTimeScale(TransInfo *t); -int TimeScale(TransInfo *t, const short mval[2]); +int TimeScale(TransInfo *t, const int mval[2]); void initBakeTime(TransInfo *t); -int BakeTime(TransInfo *t, const short mval[2]); +int BakeTime(TransInfo *t, const int mval[2]); void initMirror(TransInfo *t); -int Mirror(TransInfo *t, const short mval[2]); +int Mirror(TransInfo *t, const int mval[2]); void initAlign(TransInfo *t); -int Align(TransInfo *t, const short mval[2]); +int Align(TransInfo *t, const int mval[2]); void initSeqSlide(TransInfo *t); -int SeqSlide(TransInfo *t, const short mval[2]); +int SeqSlide(TransInfo *t, const int mval[2]); void drawPropCircle(const struct bContext *C, TransInfo *t); @@ -645,12 +645,12 @@ typedef enum { INPUT_CUSTOM_RATIO } MouseInputMode; -void initMouseInput(TransInfo *t, MouseInput *mi, int center[2], short mval[2]); +void initMouseInput(TransInfo *t, MouseInput *mi, int center[2], int mval[2]); void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode); int handleMouseInput(struct TransInfo *t, struct MouseInput *mi, struct wmEvent *event); -void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, short mval[2], float output[3]); +void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, int mval[2], float output[3]); -void setCustomPoints(TransInfo *t, MouseInput *mi, short start[2], short end[2]); +void setCustomPoints(TransInfo *t, MouseInput *mi, int start[2], int end[2]); void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *, float [3])); /*********************** Generics ********************************/ diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 16a943baabe..0ca0812f050 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -665,7 +665,7 @@ void drawConstraint(TransInfo *t) char col2[3] = {255,255,255}; int depth_test_enabled; - convertViewVec(t, vec, (short)(t->mval[0] - t->con.imval[0]), (short)(t->mval[1] - t->con.imval[1])); + convertViewVec(t, vec, (t->mval[0] - t->con.imval[0]), (t->mval[1] - t->con.imval[1])); add_v3_v3(vec, tc->center); drawLine(t, tc->center, tc->mtx[0], 'X', 0); diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index b6c4deffe0a..7a16e25302c 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -43,25 +43,25 @@ /* ************************** INPUT FROM MOUSE *************************** */ -static void InputVector(TransInfo *t, MouseInput *mi, const short mval[2], float output[3]) +static void InputVector(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) { float vec[3], dvec[3]; if(mi->precision) { /* calculate the main translation and the precise one separate */ - convertViewVec(t, dvec, (short)(mval[0] - mi->precision_mval[0]), (short)(mval[1] - mi->precision_mval[1])); + convertViewVec(t, dvec, (mval[0] - mi->precision_mval[0]), (mval[1] - mi->precision_mval[1])); mul_v3_fl(dvec, 0.1f); - convertViewVec(t, vec, (short)(mi->precision_mval[0] - t->imval[0]), (short)(mi->precision_mval[1] - t->imval[1])); + convertViewVec(t, vec, (mi->precision_mval[0] - t->imval[0]), (mi->precision_mval[1] - t->imval[1])); add_v3_v3v3(output, vec, dvec); } else { - convertViewVec(t, output, (short)(mval[0] - t->imval[0]), (short)(mval[1] - t->imval[1])); + convertViewVec(t, output, (mval[0] - t->imval[0]), (mval[1] - t->imval[1])); } } -static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const short mval[2], float output[3]) +static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3]) { float ratio, precise_ratio, dx, dy; if(mi->precision) @@ -87,7 +87,7 @@ static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const short mval[2 output[0] = ratio; } -static void InputSpringFlip(TransInfo *t, MouseInput *mi, const short mval[2], float output[3]) +static void InputSpringFlip(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) { InputSpring(t, mi, mval, output); @@ -100,7 +100,7 @@ static void InputSpringFlip(TransInfo *t, MouseInput *mi, const short mval[2], f } } -static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const short mval[2], float output[3]) +static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3]) { if(mi->precision) @@ -118,7 +118,7 @@ static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const short mva output[1] *= mi->factor; } -static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const short mval[2], float output[3]) { +static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) { float x, pad; pad = t->ar->winx / 10; @@ -135,7 +135,7 @@ static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const short mval[ output[0] = (x - pad) / (t->ar->winx - 2 * pad); } -static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const short mval[2], float output[3]) { +static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) { float vec[3]; InputVector(t, mi, mval, vec); @@ -144,7 +144,7 @@ static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const short mv output[0] = dot_v3v3(t->viewinv[0], vec) * 2.0f; } -static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const short mval[2], float output[3]) { +static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) { float y, pad; pad = t->ar->winy / 10; @@ -160,7 +160,7 @@ static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const short mval[2] output[0] = (y - pad) / (t->ar->winy - 2 * pad); } -static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const short mval[2], float output[3]) { +static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) { float vec[3]; InputVector(t, mi, mval, vec); @@ -169,12 +169,12 @@ static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const short mval output[0] = dot_v3v3(t->viewinv[1], vec) * 2.0f; } -void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, short start[2], short end[2]) +void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, int start[2], int end[2]) { - short *data; + int *data; if (mi->data == NULL) { - mi->data = MEM_callocN(sizeof(short) * 4, "custom points"); + mi->data = MEM_callocN(sizeof(int) * 4, "custom points"); } data = mi->data; @@ -185,12 +185,12 @@ void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, short start[2], short data[3] = end[1]; } -static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const short mval[2], float output[3]) +static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3]) { float length; float distance; - short *data = mi->data; - short dx, dy; + int *data = mi->data; + int dx, dy; if (data) { dx = data[2] - data[0]; @@ -200,14 +200,14 @@ static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const short m if (mi->precision) { /* deal with Shift key by adding motion / 10 to motion before shift press */ - short mdx, mdy; + int mdx, mdy; mdx = (mi->precision_mval[0] + (float)(mval[0] - mi->precision_mval[0]) / 10.0f) - data[2]; mdy = (mi->precision_mval[1] + (float)(mval[1] - mi->precision_mval[1]) / 10.0f) - data[3]; distance = (length != 0.0f)? (mdx*dx + mdy*dy) / length: 0.0f; } else { - short mdx, mdy; + int mdx, mdy; mdx = mval[0] - data[2]; mdy = mval[1] - data[3]; @@ -218,7 +218,7 @@ static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const short m } } -static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const short mval[2], float output[3]) +static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3]) { double dx2 = mval[0] - mi->center[0]; double dy2 = mval[1] - mi->center[1]; @@ -279,7 +279,7 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const short mval[2] output[0] = *angle; } -void initMouseInput(TransInfo *UNUSED(t), MouseInput *mi, int center[2], short mval[2]) +void initMouseInput(TransInfo *UNUSED(t), MouseInput *mi, int center[2], int mval[2]) { mi->factor = 0; mi->precision = 0; @@ -372,7 +372,7 @@ void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *, float [3]) mi->post = post; } -void applyMouseInput(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) +void applyMouseInput(TransInfo *t, MouseInput *mi, int mval[2], float output[3]) { if (mi->apply != NULL) { diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 2fa094c6b8b..1933b11b308 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1487,7 +1487,7 @@ void BIF_draw_manipulator(const bContext *C) } } -static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const short mval[2], float hotspot) +static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const int mval[2], float hotspot) { View3D *v3d= sa->spacedata.first; RegionView3D *rv3d= ar->regiondata; diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 8748703ad8e..ab68c6ef4d4 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -335,8 +335,8 @@ typedef struct wmEvent { short type; /* event code itself (short, is also in keymap) */ short val; /* press, release, scrollvalue */ - short x, y; /* mouse pointer position, screen coord */ - short mval[2]; /* region mouse position, name convention pre 2.5 :) */ + int x, y; /* mouse pointer position, screen coord */ + int mval[2]; /* region mouse position, name convention pre 2.5 :) */ short unicode; /* future, ghost? */ char ascii; /* from ghost */ char pad; @@ -344,9 +344,9 @@ typedef struct wmEvent { /* previous state */ short prevtype; short prevval; - short prevx, prevy; + int prevx, prevy; double prevclicktime; - short prevclickx, prevclicky; + int prevclickx, prevclicky; /* modifier states */ short shift, ctrl, alt, oskey; /* oskey is apple or windowskey, value denotes order of pressed */ @@ -494,7 +494,7 @@ typedef struct wmDrag { struct ImBuf *imb; /* if no icon but imbuf should be drawn around cursor */ float scale; - short sx, sy; + int sx, sy; char opname[240]; /* FILE_MAX */ /* if set, draws operator name*/ } wmDrag; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index feff0393b88..440ade914f0 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2293,7 +2293,7 @@ static void update_tablet_data(wmWindow *win, wmEvent *event) /* imperfect but probably usable... draw/enable drags to other windows */ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *win, wmEvent *evt) { - short mx= evt->x, my= evt->y; + int mx= evt->x, my= evt->y; if(wm->windows.first== wm->windows.last) return NULL; @@ -2310,8 +2310,8 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi return NULL; /* to desktop space */ - mx+= win->posx; - my+= win->posy; + mx += (int)win->posx; + my += (int)win->posy; /* check other windows to see if it has mouse inside */ for(owin= wm->windows.first; owin; owin= owin->next) { @@ -2319,8 +2319,8 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi if(owin!=win) { if(mx-owin->posx >= 0 && my-owin->posy >= 0 && mx-owin->posx <= owin->sizex && my-owin->posy <= owin->sizey) { - evt->x= mx-owin->posx; - evt->y= my-owin->posy; + evt->x= mx - (int)owin->posx; + evt->y= my - (int)owin->posy; return owin; } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index fa693752ff7..e624768c86e 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2492,7 +2492,7 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event) } { - short x, y; + int x, y; short *lasso= gesture->customdata; lasso += (2 * gesture->points - 2); |