for bug [#27358] Transform bug when transform > 500

mouse coords would with cont. grab would wrap at short.
use mouse coords as int rather then short.

this problem still happens on linux because of XTranslateCoordinates
This commit is contained in:
Campbell Barton 2011-05-12 16:47:36 +00:00
parent 2ca7ded51d
commit 5f5cdf9d00
58 changed files with 330 additions and 329 deletions

@ -73,8 +73,8 @@ typedef struct SK_Overdraw
typedef struct SK_DrawData typedef struct SK_DrawData
{ {
short mval[2]; int mval[2];
short previous_mval[2]; int previous_mval[2];
SK_PType type; SK_PType type;
} SK_DrawData; } SK_DrawData;
@ -152,7 +152,7 @@ void sk_endContinuousStroke(SK_Stroke *stk);
void sk_updateNextPoint(SK_Sketch *sketch, 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_deleteSelectedStrokes(SK_Sketch *sketch);
void sk_selectAllSketch(SK_Sketch *sketch, int mode); void sk_selectAllSketch(SK_Sketch *sketch, int mode);

@ -543,7 +543,7 @@ int sk_stroke_filtermval(SK_DrawData *dd)
return retval; 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[0] = mval[0];
dd->mval[1] = mval[1]; dd->mval[1] = mval[1];

@ -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 #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(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]); 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 /* Returns the number of point of interests

@ -239,7 +239,7 @@ float dist_to_line_segment_v3(const float v1[3], const float v2[3], const float
/******************************* Intersection ********************************/ /******************************* Intersection ********************************/
/* intersect Line-Line, shorts */ /* 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; float div, labda, mu;

@ -206,7 +206,7 @@ void POSE_OT_propagate(struct wmOperatorType *ot);
/* editarmature.c */ /* editarmature.c */
EditBone *make_boneList(struct ListBase *edbo, struct ListBase *bones, struct EditBone *parent, struct Bone *actBone); 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 */ /* duplicate method */
void preEditBoneDuplicate(struct ListBase *editbones); void preEditBoneDuplicate(struct ListBase *editbones);

@ -1698,7 +1698,7 @@ void ARMATURE_OT_select_linked(wmOperatorType *ot)
/* does bones and points */ /* does bones and points */
/* note that BONE ROOT only gets drawn for root bones (or without IK) */ /* 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; EditBone *ebone;
rcti rect; rcti rect;
@ -1958,7 +1958,7 @@ static int ebone_select_flag(EditBone *ebone)
} }
/* context: editmode armature in view3d */ /* 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); Object *obedit= CTX_data_edit_object(C);
bArmature *arm= obedit->data; bArmature *arm= obedit->data;
@ -2499,7 +2499,7 @@ static int armature_click_extrude_invoke(bContext *C, wmOperator *op, wmEvent *e
View3D *v3d; View3D *v3d;
RegionView3D *rv3d; RegionView3D *rv3d;
float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3]; float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3];
short mx, my, mval[2]; int mx, my, mval[2];
int retv; int retv;
scene= CTX_data_scene(C); 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; mx= event->x - ar->winrct.xmin;
my= event->y - ar->winrct.ymin; 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]); initgrabz(rv3d, fp[0], fp[1], fp[2]);

@ -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); ARegion *ar = CTX_wm_region(C);
SK_Point *pt = NULL; 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 */ #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); ARegion *ar = CTX_wm_region(C);
SK_Point *pt = NULL; 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; ViewContext vc;
rcti rect; rcti rect;
@ -2473,7 +2473,7 @@ static int sketch_delete(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(ev
return OPERATOR_FINISHED; 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); ToolSettings *ts = CTX_data_tool_settings(C);
SK_Sketch *sketch = contextSketch(C, 0); SK_Sketch *sketch = contextSketch(C, 0);

@ -4169,7 +4169,7 @@ void CURVE_OT_make_segment(wmOperatorType *ot)
/***************** pick select from 3d view **********************/ /***************** 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); Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data; Curve *cu= obedit->data;
@ -4666,7 +4666,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event)
Curve *cu; Curve *cu;
ViewContext vc; ViewContext vc;
float location[3]; float location[3];
short mval[2]; int mval[2];
Nurb *nu; Nurb *nu;
BezTriple *bezt; BezTriple *bezt;

@ -378,7 +378,7 @@ static void gp_strokepoint_convertcoords (bContext *C, bGPDstroke *gps, bGPDspoi
else { else {
float *fp= give_cursor(scene, v3d); float *fp= give_cursor(scene, v3d);
float dvec[3]; float dvec[3];
short mval[2]; int mval[2];
int mx, my; int mx, my;
/* get screen coordinate */ /* get screen coordinate */
@ -390,13 +390,13 @@ static void gp_strokepoint_convertcoords (bContext *C, bGPDstroke *gps, bGPDspoi
mx= (int)(pt->x / 100 * ar->winx); mx= (int)(pt->x / 100 * ar->winx);
my= (int)(pt->y / 100 * ar->winy); my= (int)(pt->y / 100 * ar->winy);
} }
mval[0]= (short)mx; mval[0]= mx;
mval[1]= (short)my; mval[1]= my;
/* convert screen coordinate to 3d coordinates /* convert screen coordinate to 3d coordinates
* - method taken from editview.c - mouse_cursor() * - 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); window_to_3d(ar, dvec, mval[0]-mx, mval[1]-my);
sub_v3_v3v3(p3d, fp, dvec); sub_v3_v3v3(p3d, fp, dvec);
} }

@ -239,7 +239,7 @@ static short gp_stroke_filtermval (tGPsdata *p, int mval[2], int pmval[2])
/* convert screen-coordinates to buffer-coordinates */ /* convert screen-coordinates to buffer-coordinates */
// XXX this method needs a total overhaul! // 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; bGPdata *gpd= p->gpd;
@ -251,7 +251,7 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[2], float out[3], f
*/ */
} }
else { else {
const short mx=mval[0], my=mval[1]; const int mx=mval[0], my=mval[1];
float rvec[3], dvec[3]; float rvec[3], dvec[3];
/* Current method just converts each point in screen-coordinates to /* 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); gp_get_3d_reference(p, rvec);
/* method taken from editview.c - mouse_cursor() */ /* 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); window_to_3d_delta(p->ar, dvec, mval[0]-mx, mval[1]-my);
sub_v3_v3v3(out, rvec, dvec); 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() */ /* temp struct for gp_stroke_smooth() */
typedef struct tGpSmoothCo { typedef struct tGpSmoothCo {
short x; int x;
short y; int y;
} tGpSmoothCo; } tGpSmoothCo;
/* smooth a stroke (in buffer) before storing it */ /* 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 *pd= (i+1 < cmx)?(pc+1):(pc);
const tGPspoint *pe= (i+2 < cmx)?(pc+2):(pd); 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->x= (int)(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->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 */ /* 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 */ /* get an array of depths, far depths are blended */
if (gpencil_project_check(p)) { if (gpencil_project_check(p)) {
short mval[2], mval_prev[2]= {0}; int mval[2], mval_prev[2]= {0};
int interp_depth = 0; int interp_depth = 0;
int found_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; bGPDspoint *pt1, *pt2;
int x0=0, y0=0, x1=0, y1=0; int x0=0, y0=0, x1=0, y1=0;
short xyval[2]; int xyval[2];
int i; int i;
if (gps->totpoints == 0) { 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) { else if (gps->totpoints == 1) {
/* get coordinates */ /* get coordinates */
if (gps->flag & GP_STROKE_3DSPACE) { 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]; x0= xyval[0];
y0= xyval[1]; y0= xyval[1];
} }
@ -804,11 +804,11 @@ static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], sho
/* get coordinates */ /* get coordinates */
if (gps->flag & GP_STROKE_3DSPACE) { if (gps->flag & GP_STROKE_3DSPACE) {
project_short(p->ar, &pt1->x, xyval); project_int(p->ar, &pt1->x, xyval);
x0= xyval[0]; x0= xyval[0];
y0= xyval[1]; y0= xyval[1];
project_short(p->ar, &pt2->x, xyval); project_int(p->ar, &pt2->x, xyval);
x1= xyval[0]; x1= xyval[0];
y1= xyval[1]; y1= xyval[1];
} }
@ -1501,8 +1501,8 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op)
/* get relevant data for this point from stroke */ /* get relevant data for this point from stroke */
RNA_float_get_array(&itemptr, "mouse", mousef); RNA_float_get_array(&itemptr, "mouse", mousef);
p->mval[0] = (short)mousef[0]; p->mval[0] = (int)mousef[0];
p->mval[1] = (short)mousef[1]; p->mval[1] = (int)mousef[1];
p->pressure= RNA_float_get(&itemptr, "pressure"); p->pressure= RNA_float_get(&itemptr, "pressure");
if (RNA_boolean_get(&itemptr, "is_start")) { if (RNA_boolean_get(&itemptr, "is_start")) {

@ -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, int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer,
short hits, short extend); 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); int join_armature_exec(struct bContext *C, struct wmOperator *op);
struct Bone *get_indexed_bone (struct Object *ob, int index); 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); float ED_rollBoneToVector(EditBone *bone, const float new_up_axis[3], const short axis_only);

@ -66,7 +66,7 @@ void free_editNurb (struct Object *obedit);
void free_curve_editNurb (struct Curve *cu); 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); struct Nurb *add_nurbs_primitive(struct bContext *C, float mat[4][4], int type, int newob);

@ -56,7 +56,7 @@ struct wmKeyConfig;
* Used as part of the 'stroke cache' used during drawing of new strokes * Used as part of the 'stroke cache' used during drawing of new strokes
*/ */
typedef struct tGPspoint { 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 */ float pressure; /* pressure of tablet at this point */
} tGPspoint; } tGPspoint;

@ -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); 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 free_editMball(struct Object *obedit);
void make_editMball(struct Object *obedit); void make_editMball(struct Object *obedit);

@ -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; extern unsigned int em_vertoffs, em_solidoffs, em_wireoffs;
void EM_cache_x_mirror_vert(struct Object *ob, struct EditMesh *em); 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_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); 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_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); 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 */ /* editface.c */
void paintface_flush_flags(struct Object *ob); 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); 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); 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_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); int paintface_minmax(struct Object *ob, float *min, float *max);
void paintface_hide(struct Object *ob, const int unselected); void paintface_hide(struct Object *ob, const int unselected);

@ -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); void ED_object_constraint_dependency_update(struct Main *bmain, struct Scene *scene, struct Object *ob);
/* object_lattice.c */ /* 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); void undo_push_lattice(struct bContext *C, const char *name);
/* object_lattice.c */ /* object_lattice.c */

@ -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); void PE_update_object(struct Scene *scene, struct Object *ob, int useflag);
/* selection tools */ /* 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_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_circle_select(struct bContext *C, int selecting, const int mval[2], float rad);
int PE_lasso_select(struct bContext *C, short mcords[][2], short moves, short extend, short select); int PE_lasso_select(struct bContext *C, int mcords[][2], short moves, short extend, short select);
void PE_deselect_all_visible(struct PTCacheEdit *edit); void PE_deselect_all_visible(struct PTCacheEdit *edit);
/* undo */ /* undo */

@ -64,7 +64,7 @@ typedef struct ViewContext {
struct View3D *v3d; struct View3D *v3d;
struct RegionView3D *rv3d; struct RegionView3D *rv3d;
struct EditMesh *em; struct EditMesh *em;
short mval[2]; int mval[2];
} ViewContext; } ViewContext;
typedef struct ViewDepths { typedef struct ViewDepths {
@ -80,9 +80,9 @@ typedef struct ViewDepths {
float *give_cursor(struct Scene *scene, struct View3D *v3d); float *give_cursor(struct Scene *scene, struct View3D *v3d);
int initgrabz(struct RegionView3D *rv3d, float x, float y, float z); 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(struct ARegion *ar, float out[3], const int mx, const int my);
void window_to_3d_delta(struct ARegion *ar, float out[3], short mx, short 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], short mx, short 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); void view3d_unproject(struct bglMats *mats, float out[3], const short x, const short y, const float z);
/* Depth buffer */ /* Depth buffer */
@ -133,18 +133,18 @@ void drawcircball(int mode, const float cent[3], float rad, float tmat[][4]);
/* backbuffer select and draw support */ /* backbuffer select and draw support */
void view3d_validate_backbuf(struct ViewContext *vc); void view3d_validate_backbuf(struct ViewContext *vc);
struct ImBuf *view3d_read_backbuf(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax); 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)); void *handle, unsigned int (*indextest)(void *handle, unsigned int index));
unsigned int view3d_sample_backbuf(struct ViewContext *vc, int x, int y); unsigned int view3d_sample_backbuf(struct ViewContext *vc, int x, int y);
/* draws and does a 4x4 sample */ /* 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 */ /* 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_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_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 short mval[2], int margin, float *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 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);
/* select */ /* select */
#define MAXPICKBUF 10000 #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_set_viewcontext(struct bContext *C, struct ViewContext *vc);
void view3d_operator_needs_opengl(const struct bContext *C); void view3d_operator_needs_opengl(const struct bContext *C);
void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *ar); 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); void view3d_get_transformation(struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats);
/* XXX should move to BLI_math */ /* 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 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(int mcords[][2], short moves, int sx, int sy);
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);
/* get 3d region from context, also if mouse is in header or toolbar */ /* get 3d region from context, also if mouse is in header or toolbar */
struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C); 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]); 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); void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, short do_clip);
int ED_view3d_lock(struct RegionView3D *rv3d); int ED_view3d_lock(struct RegionView3D *rv3d);

@ -97,7 +97,7 @@ static int eyedropper_cancel(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; 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) { if(RNA_property_type(eye->prop) == PROP_FLOAT) {
const int color_manage = CTX_data_scene(C)->r.color_mgt_flag & R_COLOR_MANAGEMENT; const int color_manage = CTX_data_scene(C)->r.color_mgt_flag & R_COLOR_MANAGEMENT;

@ -1625,7 +1625,7 @@ void ui_block_func_ICONTEXTROW(bContext *UNUSED(C), uiLayout *layout, void *arg_
} }
#if 0 #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? */ /* XXX 2.50 which function to use for this? */
/* OSX has very poor mousewarp support, it sends events; /* OSX has very poor mousewarp support, it sends events;

@ -2028,7 +2028,7 @@ typedef struct View2DString {
unsigned char ub[4]; unsigned char ub[4];
int pack; int pack;
} col; } col;
short mval[2]; int mval[2];
rcti rect; rcti rect;
} View2DString; } View2DString;

@ -98,7 +98,7 @@ void paintface_flush_flags(Object *ob)
} }
/* returns 0 if not found, otherwise 1 */ /* 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; ViewContext vc;
view3d_set_viewcontext(C, &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); 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; Mesh *me;
unsigned int index=0; unsigned int index=0;
@ -716,7 +716,7 @@ void seam_mark_clear_tface(Scene *scene, short mode)
} }
#endif #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; Mesh *me;
MFace *mface, *msel; MFace *mface, *msel;

@ -199,7 +199,7 @@ static void CutEdgeloop(Object *obedit, wmOperator *op, EditMesh *em, int numcut
EditEdge *nearest=NULL, *eed; EditEdge *nearest=NULL, *eed;
float fac; float fac;
int keys = 0, holdnum=0, selectmode, dist; 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 event=0, val, choosing=1, cancel=0, cuthalf = 0, smooth=0;
short hasHidden = 0; short hasHidden = 0;
char msg[128]; char msg[128];

@ -162,7 +162,7 @@ unsigned int em_solidoffs=0, em_wireoffs=0, em_vertoffs=0; /* set in drawobject.
static char *selbuf= NULL; static char *selbuf= NULL;
/* opengl doesn't support concave... */ /* 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}; ListBase lb={NULL, NULL};
DispList *dl; DispList *dl;
@ -256,7 +256,7 @@ void EM_free_backbuf(void)
- grab again and compare - grab again and compare
returns 'OK' 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; unsigned int *dr, *drm;
struct ImBuf *buf, *bufmask; 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); draw_triangulated(mcords, tot);
glBegin(GL_LINE_LOOP); /* for zero sized masks, lines */ 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(); glEnd();
glFinish(); /* to be sure readpixels sees mask */ 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) 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 (data->pass==0) {
if (index<=data->lastIndex) if (index<=data->lastIndex)
@ -426,7 +426,7 @@ EditVert *findnearestvert(ViewContext *vc, int *dist, short sel, short strict)
} }
else { 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 int lastSelectedIndex=0;
static EditVert *lastSelected=NULL; 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)) 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) { if (efa==data->toFace) {
int temp = abs(data->mval[0]-x) + abs(data->mval[1]-y); 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) 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 (data->pass==0) {
if (index<=data->lastIndex) if (index<=data->lastIndex)
@ -588,7 +588,7 @@ static EditFace *findnearestface(ViewContext *vc, int *dist)
EditFace *efa = BLI_findlink(&vc->em->faces, index-1); EditFace *efa = BLI_findlink(&vc->em->faces, index-1);
if (efa) { 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[0] = vc->mval[0];
data.mval[1] = vc->mval[1]; data.mval[1] = vc->mval[1];
@ -607,7 +607,7 @@ static EditFace *findnearestface(ViewContext *vc, int *dist)
return NULL; return NULL;
} }
else { 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 int lastSelectedIndex=0;
static EditFace *lastSelected=NULL; static EditFace *lastSelected=NULL;
@ -2061,7 +2061,7 @@ void MESH_OT_loop_multi_select(wmOperatorType *ot)
/* ***************** loop select (non modal) ************** */ /* ***************** 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; ViewContext vc;
EditMesh *em; EditMesh *em;
@ -2149,7 +2149,7 @@ void MESH_OT_loop_select(wmOperatorType *ot)
/* ******************* mesh shortest path select, uses prev-selected edge ****************** */ /* ******************* mesh shortest path select, uses prev-selected edge ****************** */
/* since you want to create paths with multiple selects, it doesn't have extend option */ /* 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; ViewContext vc;
EditMesh *em; EditMesh *em;
@ -2282,7 +2282,7 @@ void MESH_OT_select_shortest_path(wmOperatorType *ot)
/* here actual select happens */ /* here actual select happens */
/* gets called via generic mouse select operator */ /* 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; ViewContext vc;
EditVert *eve; EditVert *eve;

@ -4011,7 +4011,7 @@ useless:
LinkNode *fuv_link; LinkNode *fuv_link;
short event, draw=1; short event, draw=1;
short mval[2], mvalo[2]; int mval[2], mvalo[2];
char str[128]; char str[128];
float labda = 0.0f; float labda = 0.0f;
@ -4416,7 +4416,7 @@ useless:
percp = -1; percp = -1;
while(draw) { while(draw) {
/* For the % calculation */ /* For the % calculation */
short mval[2]; int mval[2];
float rc[2]; float rc[2];
float v2[2], v3[2]; float v2[2], v3[2];
EditVert *centerVert, *upVert, *downVert; EditVert *centerVert, *upVert, *downVert;
@ -4867,7 +4867,7 @@ void mesh_set_face_flags(EditMesh *em, short mode)
/********************** Rip Operator *************************/ /********************** Rip Operator *************************/
/* helper to find edge for edge_rip */ /* 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]; 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; EditEdge *eed, *seed= NULL;
EditFace *efa, *sefa= NULL; EditFace *efa, *sefa= NULL;
float projectMat[4][4], vec[3], dist, mindist; 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 */ /* select flush... vertices are important */
EM_selectmode_set(em); EM_selectmode_set(em);

@ -455,7 +455,7 @@ void MBALL_OT_reveal_metaelems(wmOperatorType *ot)
/* Select MetaElement with mouse click (user can select radius circle or /* Select MetaElement with mouse click (user can select radius circle or
* stiffness circle) */ * 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; static MetaElem *startelem=NULL;
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);

@ -607,7 +607,7 @@ static void spot_interactive(Object *ob, int mode)
Lamp *la= ob->data; Lamp *la= ob->data;
float transfac, dx, dy, ratio, origval; float transfac, dx, dy, ratio, origval;
int keep_running= 1, center2d[2]; int keep_running= 1, center2d[2];
short mval[2], mvalo[2]; int mval[2], mvalo[2];
// getmouseco_areawin(mval); // getmouseco_areawin(mval);
// getmouseco_areawin(mvalo); // getmouseco_areawin(mvalo);

@ -305,7 +305,7 @@ void LATTICE_OT_make_regular(wmOperatorType *ot)
static void findnearestLattvert__doClosest(void *userData, BPoint *bp, int x, int y) 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); float temp = abs(data->mval[0]-x) + abs(data->mval[1]-y);
if((bp->f1 & SELECT)==data->select) 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 */ /* sel==1: selected gets a disadvantage */
/* in nurb and bezt or bp the nearest is written */ /* in nurb and bezt or bp the nearest is written */
/* return 0 1 2: handlepunt */ /* 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.dist = 100;
data.select = sel; data.select = sel;
@ -336,7 +336,7 @@ static BPoint *findnearestLattvert(ViewContext *vc, const short mval[2], int sel
return data.bp; 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; ViewContext vc;
BPoint *bp= NULL; BPoint *bp= NULL;

@ -338,7 +338,7 @@ typedef struct PEData {
DerivedMesh *dm; DerivedMesh *dm;
PTCacheEdit *edit; PTCacheEdit *edit;
const short *mval; const int *mval;
rcti *rect; rcti *rect;
float rad; float rad;
float dist; 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) static int key_inside_circle(PEData *data, float rad, float co[3], float *distance)
{ {
float dx, dy, dist; 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) if(sco[0] == IS_CLIPPED)
return 0; 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]) 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) if(sco[0] == IS_CLIPPED)
return 0; return 0;
@ -1369,7 +1369,7 @@ void PARTICLE_OT_select_all(wmOperatorType *ot)
/************************ pick select operator ************************/ /************************ 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; PEData data;
Scene *scene= CTX_data_scene(C); 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) static int select_linked_exec(bContext *C, wmOperator *op)
{ {
PEData data; PEData data;
short mval[2]; int mval[2];
int location[2]; int location[2];
RNA_int_get_array(op->ptr, "location", location); 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 ************************/ /************************ 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); Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(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 ************************/ /************************ 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); Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(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); ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
POINT_P; KEY_K; POINT_P; KEY_K;
float co[3], mat[4][4]= MAT4_UNITY; float co[3], mat[4][4]= MAT4_UNITY;
short vertco[2]; int vertco[2];
PEData data; PEData data;
@ -1631,7 +1631,7 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short extend, s
LOOP_KEYS { LOOP_KEYS {
VECCOPY(co, key->co); VECCOPY(co, key->co);
mul_m4_v3(mat, 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((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1]) && key_test_depth(&data, co)) {
if(select && !(key->flag & PEK_SELECT)) { if(select && !(key->flag & PEK_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); VECCOPY(co, key->co);
mul_m4_v3(mat, 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((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1]) && key_test_depth(&data, co)) {
if(select && !(key->flag & PEK_SELECT)) { if(select && !(key->flag & PEK_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 rad2, cut_time= 1.0;
float x0, x1, v0, v1, o0, o1, xo0, xo1, d, dv; float x0, x1, v0, v1, o0, o1, xo0, xo1, d, dv;
int k, cut, keys= (int)pow(2.0, (double)pset->draw_step); int k, cut, keys= (int)pow(2.0, (double)pset->draw_step);
short vertco[2]; int vertco[2];
/* blunt scissors */ /* blunt scissors */
if(BLI_frand() > data->cutfac) return; if(BLI_frand() > data->cutfac) return;
@ -2784,7 +2784,7 @@ static void brush_cut(PEData *data, int pa_index)
cut=0; cut=0;
project_short_noclip(ar, key->co, vertco); project_int_noclip(ar, key->co, vertco);
x0= (float)vertco[0]; x0= (float)vertco[0];
x1= (float)vertco[1]; x1= (float)vertco[1];
@ -2802,7 +2802,7 @@ static void brush_cut(PEData *data, int pa_index)
else { else {
/* calculate path time closest to root that was inside the circle */ /* calculate path time closest to root that was inside the circle */
for(k=1, key++; k<=keys; k++, key++) { 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) { if(key_test_depth(data, key->co) == 0) {
x0= (float)vertco[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]; ParticleBrushData *brush= &pset->brush[pset->brushtype];
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
float vec[3], mousef[2]; 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 flip, mouse[2], dx, dy, removed= 0, added=0, selected= 0;
int lock_root = pset->flag & PE_LOCK_FIRST; int lock_root = pset->flag & PE_LOCK_FIRST;

@ -5284,7 +5284,7 @@ static int set_clone_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event)
View3D *v3d= CTX_wm_view3d(C); View3D *v3d= CTX_wm_view3d(C);
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
float location[3]; float location[3];
short mval[2]; int mval[2];
mval[0]= event->x - ar->winrct.xmin; mval[0]= event->x - ar->winrct.xmin;
mval[1]= event->y - ar->winrct.ymin; mval[1]= event->y - ar->winrct.ymin;

@ -736,10 +736,10 @@ static float calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, float vpimat[][3], fl
Brush *brush = paint_brush(&vp->paint); Brush *brush = paint_brush(&vp->paint);
float fac, fac_2, size, dx, dy; float fac, fac_2, size, dx, dy;
float alpha; float alpha;
short vertco[2]; int vertco[2];
const int radius= brush_size(brush); 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]; dx= mval[0]-vertco[0];
dy= mval[1]-vertco[1]; 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; Object *ob= OBACT;
Mesh *me= get_mesh(ob); Mesh *me= get_mesh(ob);
int index; int index;
short mval[2] = {0, 0}, sco[2]; int mval[2] = {0, 0}, sco[2];
int vgroup= ob->actdef-1; int vgroup= ob->actdef-1;
if (!me) return; if (!me) return;
@ -953,20 +953,20 @@ static void sample_wpaint(Scene *scene, ARegion *ar, View3D *UNUSED(v3d), int mo
else { else {
/* calc 3 or 4 corner weights */ /* calc 3 or 4 corner weights */
dm->getVertCo(dm, mface->v1, co); 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])); w1= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1]));
dm->getVertCo(dm, mface->v2, co); 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])); w2= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1]));
dm->getVertCo(dm, mface->v3, co); 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])); w3= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1]));
if(mface->v4) { if(mface->v4) {
dm->getVertCo(dm, mface->v4, co); 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])); w4= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1]));
} }
else w4= 1.0e10; else w4= 1.0e10;

@ -818,7 +818,7 @@ static int graphkeys_select_leftright_invoke (bContext *C, wmOperator *op, wmEve
ARegion *ar= ac.ar; ARegion *ar= ac.ar;
View2D *v2d= &ar->v2d; View2D *v2d= &ar->v2d;
short mval[2]; int mval[2];
float x; float x;
/* get mouse coordinates (in region coordinates) */ /* get mouse coordinates (in region coordinates) */

@ -268,7 +268,7 @@ static void preview_cb(struct ScrArea *sa, struct uiBlock *block)
rcti *disprect= &G.scene->r.disprect; rcti *disprect= &G.scene->r.disprect;
int winx= (G.scene->r.size*G.scene->r.xsch)/100; int winx= (G.scene->r.size*G.scene->r.xsch)/100;
int winy= (G.scene->r.size*G.scene->r.ysch)/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) { if(G.scene->r.mode & R_BORDER) {
winx*= (G.scene->r.border.xmax - G.scene->r.border.xmin); winx*= (G.scene->r.border.xmax - G.scene->r.border.xmin);

@ -702,7 +702,7 @@ static void draw_image_view_tool(Scene *scene)
{ {
ToolSettings *settings= scene->toolsettings; ToolSettings *settings= scene->toolsettings;
Brush *brush= settings->imapaint.brush; Brush *brush= settings->imapaint.brush;
short mval[2]; int mval[2];
float radius; float radius;
int draw= 0; int draw= 0;

@ -230,7 +230,7 @@ static int borderselect_exec(bContext *C, wmOperator *op)
rcti rect; rcti rect;
//rctf rectf, rq; //rctf rectf, rq;
short selecting= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); 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.xmin= RNA_int_get(op->ptr, "xmin");
rect.ymin= RNA_int_get(op->ptr, "ymin"); rect.ymin= RNA_int_get(op->ptr, "ymin");

@ -1010,7 +1010,7 @@ static bNode *visible_node(SpaceNode *snode, rctf *rct)
/* **************************** */ /* **************************** */
typedef struct NodeViewMove { typedef struct NodeViewMove {
short mvalo[2]; int mvalo[2];
int xmin, ymin, xmax, ymax; int xmin, ymin, xmax, ymax;
} NodeViewMove; } NodeViewMove;
@ -1615,7 +1615,7 @@ static int node_mouse_groupheader(SpaceNode *snode)
{ {
bNode *gnode; bNode *gnode;
float mx=0, my=0; float mx=0, my=0;
// XXX short mval[2]; // XXX int mval[2];
gnode= node_tree_get_editgroup(snode->nodetree); gnode= node_tree_get_editgroup(snode->nodetree);
if(gnode==NULL) return 0; if(gnode==NULL) return 0;

@ -70,7 +70,7 @@ static bNode *node_under_mouse(bNodeTree *ntree, int mx, int my)
/* ****** Click Select ****** */ /* ****** 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; bNode *node;
float mx, my; float mx, my;
@ -102,7 +102,7 @@ static int node_select_exec(bContext *C, wmOperator *op)
{ {
SpaceNode *snode= CTX_wm_space_node(C); SpaceNode *snode= CTX_wm_space_node(C);
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
short mval[2]; int mval[2];
short extend; short extend;
bNode *node= NULL; 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) static int node_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
{ {
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
short mval[2]; int mval[2];
mval[0]= event->x - ar->winrct.xmin; mval[0]= event->x - ar->winrct.xmin;
mval[1]= event->y - ar->winrct.ymin; 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 */ /* this allows border select on empty space, but drag-translate on nodes */
SpaceNode *snode= CTX_wm_space_node(C); SpaceNode *snode= CTX_wm_space_node(C);
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
short mval[2]; int mval[2];
float mx, my; float mx, my;
mval[0]= event->x - ar->winrct.xmin; mval[0]= event->x - ar->winrct.xmin;

@ -158,7 +158,7 @@ static int do_header_hidden_node(bNode *node, float mx, float my)
return 0; 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; bNode *node;
float mx, my; float mx, my;
@ -189,7 +189,7 @@ static int node_toggle_visibility_exec(bContext *C, wmOperator *op)
{ {
SpaceNode *snode= CTX_wm_space_node(C); SpaceNode *snode= CTX_wm_space_node(C);
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
short mval[2]; int mval[2];
mval[0] = RNA_int_get(op->ptr, "mouse_x"); mval[0] = RNA_int_get(op->ptr, "mouse_x");
mval[1] = RNA_int_get(op->ptr, "mouse_y"); 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) static int node_toggle_visibility_invoke(bContext *C, wmOperator *op, wmEvent *event)
{ {
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
short mval[2]; int mval[2];
mval[0]= event->x - ar->winrct.xmin; mval[0]= event->x - ar->winrct.xmin;
mval[1]= event->y - ar->winrct.ymin; mval[1]= event->y - ar->winrct.ymin;

@ -120,7 +120,7 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, w
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
View2D *v2d= UI_view2d_fromcontext(C); View2D *v2d= UI_view2d_fromcontext(C);
short mval[2]; int mval[2];
float mval_v2d[2]; float mval_v2d[2];

@ -191,7 +191,7 @@ void boundbox_seq(Scene *scene, rctf *rect)
static int mouse_frame_side(View2D *v2d, short mouse_x, int frame ) static int mouse_frame_side(View2D *v2d, short mouse_x, int frame )
{ {
short mval[2]; int mval[2];
float mouseloc[2]; float mouseloc[2];
mval[0]= mouse_x; 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; Sequence *seq;
Editing *ed= seq_give_editing(scene, FALSE); 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 /* fake mouse coords to get the snap value
a bit lazy but its only done once pre transform */ a bit lazy but its only done once pre transform */
float xmouse, ymouse, x; 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); UI_view2d_region_to_view(v2d, mval[0], mval[1], &xmouse, &ymouse);
x = xmouse; x = xmouse;

@ -61,7 +61,7 @@ void seq_reset_imageofs(struct SpaceSeq *sseq);
struct View2D; struct View2D;
void seq_rectf(struct Sequence *seq, struct rctf *rectf); void seq_rectf(struct Sequence *seq, struct rctf *rectf);
void boundbox_seq(struct Scene *scene, struct rctf *rect); 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); struct Sequence *find_neighboring_sequence(struct Scene *scene, struct Sequence *test, int lr, int sel);
void deselect_all_seq(struct Scene *scene); void deselect_all_seq(struct Scene *scene);
void recurs_sel_seq(struct Sequence *seqm); void recurs_sel_seq(struct Sequence *seqm);

@ -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 left_right= RNA_boolean_get(op->ptr, "left_right");
short linked_time= RNA_boolean_get(op->ptr, "linked_time"); short linked_time= RNA_boolean_get(op->ptr, "linked_time");
short mval[2]; int mval[2];
Sequence *seq,*neighbor, *act_orig; Sequence *seq,*neighbor, *act_orig;
int hand,sel_side; int hand,sel_side;
@ -489,7 +489,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* marker transform */ /* marker transform */
#if 0 // XXX probably need to redo this differently for 2.5 #if 0 // XXX probably need to redo this differently for 2.5
if (marker) { if (marker) {
short mval[2], xo, yo; int mval[2], xo, yo;
// getmouseco_areawin(mval); // getmouseco_areawin(mval);
xo= mval[0]; xo= mval[0];
yo= mval[1]; 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); View2D *v2d= UI_view2d_fromcontext(C);
short extend= RNA_boolean_get(op->ptr, "extend"); short extend= RNA_boolean_get(op->ptr, "extend");
short mval[2]; int mval[2];
Sequence *mouse_seq; Sequence *mouse_seq;
int selected, hand; int selected, hand;
@ -837,7 +837,7 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
rcti rect; rcti rect;
rctf rectf, rq; rctf rectf, rq;
short selecting = (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); short selecting = (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT);
short mval[2]; int mval[2];
if(ed==NULL) if(ed==NULL)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;

@ -2109,7 +2109,7 @@ static void scroll_apply(bContext *C, wmOperator *op, wmEvent *event)
SpaceText *st= CTX_wm_space_text(C); SpaceText *st= CTX_wm_space_text(C);
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
TextScroll *tsc= op->customdata; TextScroll *tsc= op->customdata;
short mval[2]= {event->x, event->y}; int mval[2]= {event->x, event->y};
short txtdelta[2] = {0, 0}; short txtdelta[2] = {0, 0};
text_update_character_width(st); 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); SpaceText *st= CTX_wm_space_text(C);
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
TextScroll *tsc; TextScroll *tsc;
const short *mval= event->mval; const int *mval= event->mval;
int zone= -1; int zone= -1;
if(RNA_property_is_set(op->ptr, "lines")) 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); SpaceText *st= CTX_wm_space_text(C);
Text *text= CTX_data_edit_text(C); Text *text= CTX_data_edit_text(C);
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
const short *mval= event->mval; const int *mval= event->mval;
double time; double time;
static int jump_to= 0; static int jump_to= 0;
static double last_jump= 0; static double last_jump= 0;

@ -54,7 +54,7 @@ int text_do_suggest_select(SpaceText *st, ARegion *ar)
TextLine *tmp; TextLine *tmp;
int l, x, y, w, h, i; int l, x, y, w, h, i;
int tgti, *top; int tgti, *top;
short mval[2] = {0, 0}; int mval[2] = {0, 0};
if(!st || !st->text) return 0; if(!st || !st->text) return 0;
if(!texttool_text_is_active(st->text)) return 0; if(!texttool_text_is_active(st->text)) return 0;

@ -666,7 +666,7 @@ typedef struct ViewCachedString {
unsigned char ub[4]; unsigned char ub[4];
int pack; int pack;
} col; } col;
short mval[2]; short sco[2];
short xoffs; short xoffs;
short flag; short flag;
int str_len, pad; 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) { for(vos= strings->first; vos; vos= vos->next) {
if(mat && !(vos->flag & V3D_CACHE_TEXT_WORLDSPACE)) if(mat && !(vos->flag & V3D_CACHE_TEXT_WORLDSPACE))
mul_m4_v3(mat, vos->vec); mul_m4_v3(mat, vos->vec);
view3d_project_short_clip(ar, vos->vec, vos->mval, 0); view3d_project_short_clip(ar, vos->vec, vos->sco, 0);
if(vos->mval[0]!=IS_CLIPPED) if(vos->sco[0]!=IS_CLIPPED)
tot++; tot++;
} }
@ -749,7 +749,7 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa
continue; continue;
} }
#endif #endif
if(vos->mval[0]!=IS_CLIPPED) { if(vos->sco[0]!=IS_CLIPPED) {
const char *str= (char *)(vos+1); const char *str= (char *)(vos+1);
if(col_pack_prev != vos->col.pack) { 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; col_pack_prev= vos->col.pack;
} }
if(vos->flag & V3D_CACHE_TEXT_ASCII) { 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 { 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);
} }
} }
} }

@ -564,13 +564,13 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit)
static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d) static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d)
{ {
short mx,my,co[2]; int mx, my, co[2];
int flag; int flag;
/* we dont want the clipping for cursor */ /* we dont want the clipping for cursor */
flag= v3d->flag; flag= v3d->flag;
v3d->flag= 0; v3d->flag= 0;
project_short(ar, give_cursor(scene, v3d), co); project_int(ar, give_cursor(scene, v3d), co);
v3d->flag= flag; v3d->flag= flag;
mx = co[0]; 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 */ /* 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, unsigned int min, unsigned int max, int *dist, short strict,
void *handle, unsigned int (*indextest)(void *handle, unsigned int index)) void *handle, unsigned int (*indextest)(void *handle, unsigned int index))
{ {

@ -2735,7 +2735,7 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve
View3D *v3d = CTX_wm_view3d(C); View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d= CTX_wm_region_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C);
float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3]; float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3];
short mx, my, mval[2]; int mx, my, mval[2];
// short ctrl= 0; // XXX // short ctrl= 0; // XXX
int flip; int flip;
fp= give_cursor(scene, v3d); 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; mx= event->x - ar->winrct.xmin;
my= event->y - ar->winrct.ymin; 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]); flip= initgrabz(rv3d, fp[0], fp[1], fp[2]);
/* reset the depth based on the view offset */ /* 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); negate_v3_v3(fp, rv3d->ofs);
/* re initialize */ /* re initialize */
project_short_noclip(ar, fp, mval); project_int_noclip(ar, fp, mval);
flip= initgrabz(rv3d, fp[0], fp[1], fp[2]); 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; short depth_used = 0;
if (U.uiflag & USER_ORBIT_ZBUF) { /* maybe this should be accessed some other way */ 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[0]= mx;
mval_depth[1]= my; mval_depth[1]= my;
view3d_operator_needs_opengl(C); view3d_operator_needs_opengl(C);
@ -2893,7 +2893,7 @@ void VIEW3D_OT_enable_manipulator(wmOperatorType *ot)
/* ************************* below the line! *********************** */ /* ************************* 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}; ViewDepths depth_temp= {0};
rcti rect; 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 */ /* 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 */ bglMats mats; /* ZBuffer depth vars */
float depth_close= FLT_MAX; 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 // 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? */ bglMats mats; /* ZBuffer depth vars, could cache? */
float depth; float depth;
@ -2992,7 +2992,7 @@ int view_autodist_simple(ARegion *ar, const short mval[2], float mouse_worldloc[
return 1; 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); *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) static int depth_segment_cb(int x, int y, void *userData)
{ {
struct { struct ARegion *ar; int margin; float depth; } *data = userData; struct { struct ARegion *ar; int margin; float depth; } *data = userData;
short mval[2]; int mval[2];
float depth; float depth;
mval[0]= (short)x; mval[0]= x;
mval[1]= (short)y; mval[1]= y;
depth= view_autodist_depth_margin(data->ar, mval, data->margin); 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}; struct { struct ARegion *ar; int margin; float depth; } data = {NULL};
int p1[2]; int p1[2];

@ -158,7 +158,7 @@ typedef struct FlyInfo {
short state; short state;
short use_precision; short use_precision;
short redraw; short redraw;
short mval[2]; int mval[2];
/* fly state state */ /* fly state state */
float speed; /* the speed the view is moving per redraw */ float speed; /* the speed the view is moving per redraw */

@ -93,15 +93,15 @@ void view3d_set_viewcontext(bContext *C, ViewContext *vc)
vc->obedit= CTX_data_edit_object(C); 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]; float dvec[3];
short mval_cpy[2]; int mval_cpy[2];
mval_cpy[0]= mval[0]; mval_cpy[0]= mval[0];
mval_cpy[1]= mval[1]; 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]); 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_GESTURE 50
#define MOVES_LASSO 500 #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 */ /* 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]; float angletot=0.0, len, dot, ang, cross, fp1[2], fp2[2];
int a; int a;
short *p1, *p2; int *p1, *p2;
if(sx==IS_CLIPPED) if(sx==IS_CLIPPED)
return 0; 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 */ /* 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; int a;
if(x0==IS_CLIPPED || x1==IS_CLIPPED) 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 */ /* 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++) { 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; 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) /* 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 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; bPoseChannel *pchan;
float vec[3]; float vec[3];
short sco1[2], sco2[2]; int sco1[2], sco2[2];
bArmature *arm= ob->data; bArmature *arm= ob->data;
if(ob->type!=OB_ARMATURE || ob->pose==NULL) return; 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) { for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if (PBONE_VISIBLE(arm, pchan->bone) && (pchan->bone->flag & BONE_UNSELECTABLE)==0) { if (PBONE_VISIBLE(arm, pchan->bone) && (pchan->bone->flag & BONE_UNSELECTABLE)==0) {
mul_v3_m4v3(vec, ob->obmat, pchan->pose_head); 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); 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(lasso_inside_edge(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1])) {
if(select) pchan->bone->flag |= BONE_SELECTED; 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; 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; 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)) 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)) { 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); 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) 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 (EM_check_backbuf(em_solidoffs+index)) {
if (data->pass==0) { 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)) 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)) { 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); 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; ToolSettings *ts= vc->scene->toolsettings;
rcti rect; rcti rect;
int bbsel; int bbsel;
@ -528,7 +528,7 @@ static void do_lasso_select_mesh(ViewContext *vc, short mcords[][2], short moves
#if 0 #if 0
/* this is an exception in that its the only lasso that dosnt use the 3d view (uses space image view) */ /* 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; EditFace *efa;
MTFace *tf; 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) 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; Object *obedit= data->vc->obedit;
Curve *cu= (Curve*)obedit->data; 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 */ /* set vc->editnurb */
data.vc = vc; 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) 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)) { if (lasso_inside(data->mcords, data->moves, x, y)) {
bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT); 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 */ /* set editdata in vc */
data.mcords = mcords; 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); 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; bArmature *arm= vc->obedit->data;
EditBone *ebone; 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; MetaBall *mb = (MetaBall*)vc->obedit->data;
MetaElem *ml; 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; Object *ob= vc->obact;
Mesh *me= ob?ob->data:NULL; Mesh *me= ob?ob->data:NULL;
@ -755,7 +755,7 @@ static void do_lasso_select_paintface(ViewContext *vc, short mcords[][2], short
} }
#if 0 #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; SpaceNode *snode = sa->spacedata.first;
@ -785,7 +785,7 @@ static void do_lasso_select_node(short mcords[][2], short moves, short select)
} }
#endif #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); Object *ob = CTX_data_active_object(C);
@ -834,14 +834,14 @@ static int view3d_lasso_select_exec(bContext *C, wmOperator *op)
{ {
ViewContext vc; ViewContext vc;
int i= 0; int i= 0;
short mcords[1024][2]; int mcords[1024][2];
RNA_BEGIN(op->ptr, itemptr, "path") { RNA_BEGIN(op->ptr, itemptr, "path") {
float loc[2]; float loc[2];
RNA_float_get_array(&itemptr, "loc", loc); RNA_float_get_array(&itemptr, "loc", loc);
mcords[i][0]= (short)loc[0]; mcords[i][0]= (int)loc[0];
mcords[i][1]= (short)loc[1]; mcords[i][1]= (int)loc[1];
i++; i++;
if(i>=1024) break; 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 baseCount = 0;
short ok; 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... */ /* we want a select buffer with bones, if there are... */
/* so check three selection levels and compare */ /* 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; rcti rect;
int offs; int offs;
@ -1096,12 +1096,12 @@ static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buff
} }
/* returns basact */ /* 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; Scene *scene= vc->scene;
View3D *v3d= vc->v3d; View3D *v3d= vc->v3d;
Base *base, *basact= NULL; Base *base, *basact= NULL;
static short lastmval[2]={-100, -100}; static int lastmval[2]={-100, -100};
int a, donearest= 0; int a, donearest= 0;
/* define if we use solid nearest select or not */ /* 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 */ /* 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; ViewContext vc;
Base *basact= NULL; Base *basact= NULL;
@ -1214,7 +1214,7 @@ Base *ED_view3d_give_base_under_cursor(bContext *C, const short mval[2])
} }
/* mval is region coords */ /* 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; ViewContext vc;
ARegion *ar= CTX_wm_region(C); 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)) 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]; int mx = x - data->mval[0], my = y - data->mval[1];
float r = sqrt(mx*mx + my*my); 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)) 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)) { if (edge_inside_circle(data->mval[0], data->mval[1], (short) data->radius, x0, y0, x1, y1)) {
EM_select_edge(eed, data->select); 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)) 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]; int mx = x - data->mval[0], my = y - data->mval[1];
float r = sqrt(mx*mx + my*my); 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; ToolSettings *ts= vc->scene->toolsettings;
int bbsel; 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)); 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 */ 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); 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; Object *ob= vc->obact;
Mesh *me = ob?ob->data:NULL; 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) 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]; int mx = x - data->mval[0], my = y - data->mval[1];
float r = sqrt(mx*mx + my*my); float r = sqrt(mx*mx + my*my);
Object *obedit= data->vc->obedit; 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 */ /* 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) 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]; int mx = x - data->mval[0], my = y - data->mval[1];
float r = sqrt(mx*mx + my*my); 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); 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 */ /* 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... // NOTE: pose-bone case is copied from editbone case...
static short pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, int x, int y) 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]; int mx = x - data->mval[0], my = y - data->mval[1];
float r = sqrt(mx*mx + my*my); float r = sqrt(mx*mx + my*my);
@ -2083,9 +2083,9 @@ static short pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, int
} }
return 0; 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; bPose *pose = vc->obact->pose;
bPoseChannel *pchan; bPoseChannel *pchan;
int change= FALSE; 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) 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]; int mx = x - data->mval[0], my = y - data->mval[1];
float r = sqrt(mx*mx + my*my); float r = sqrt(mx*mx + my*my);
@ -2151,7 +2151,7 @@ static short armature_circle_doSelectJoint(void *userData, EditBone *ebone, int
} }
return 0; 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; struct {ViewContext *vc; short select, mval[2]; float radius; } data;
bArmature *arm= vc->obedit->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 */ /** 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) { switch(vc->obedit->type) {
case OB_MESH: 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))) ) (obact && (obact->mode & (OB_MODE_PARTICLE_EDIT|OB_MODE_POSE))) )
{ {
ViewContext vc; ViewContext vc;
short mval[2]; int mval[2];
view3d_operator_needs_opengl(C); view3d_operator_needs_opengl(C);

@ -647,7 +647,7 @@ int initgrabz(RegionView3D *rv3d, float x, float y, float z)
} }
/* always call initgrabz */ /* 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; RegionView3D *rv3d= ar->regiondata;
@ -665,7 +665,7 @@ void window_to_3d(ARegion *ar, float out[3], short mx, short my)
/* always call initgrabz */ /* always call initgrabz */
/* only to detect delta motion */ /* 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; RegionView3D *rv3d= ar->regiondata;
float dx, dy; 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 */ /* doesn't rely on initgrabz */
/* for perspective view, get the vector direction to /* for perspective view, get the vector direction to
* the mouse cursor as a normalized vector */ * 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; RegionView3D *rv3d= ar->regiondata;
float dx, dy; float dx, dy;

@ -120,7 +120,7 @@ void setTransformViewMatrices(TransInfo *t)
calculateCenter2D(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->spacetype==SPACE_VIEW3D) {
if (t->ar->regiontype == RGN_TYPE_WINDOW) if (t->ar->regiontype == RGN_TYPE_WINDOW)
@ -783,7 +783,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
case SPACEKEY: case SPACEKEY:
if ((t->spacetype==SPACE_VIEW3D) && event->alt) { if ((t->spacetype==SPACE_VIEW3D) && event->alt) {
#if 0 // TRANSFORM_FIX_ME #if 0 // TRANSFORM_FIX_ME
short mval[2]; int mval[2];
getmouseco_sc(mval); getmouseco_sc(mval);
BIF_selectOrientation(); BIF_selectOrientation();
@ -1270,7 +1270,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
setlinestyle(3); setlinestyle(3);
glBegin(GL_LINE_STRIP); glBegin(GL_LINE_STRIP);
glVertex2sv(t->mval); glVertex2iv(t->mval);
glVertex2fv(cent); glVertex2fv(cent);
glEnd(); glEnd();
@ -1315,7 +1315,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
setlinestyle(3); setlinestyle(3);
glBegin(GL_LINE_STRIP); glBegin(GL_LINE_STRIP);
glVertex2sv(t->mval); glVertex2iv(t->mval);
glVertex2fv(cent); glVertex2fv(cent);
glEnd(); glEnd();
@ -2286,7 +2286,7 @@ int handleEventWarp(TransInfo *t, wmEvent *event)
return status; return status;
} }
int Warp(TransInfo *t, const short UNUSED(mval[2])) int Warp(TransInfo *t, const int UNUSED(mval[2]))
{ {
TransData *td = t->data; TransData *td = t->data;
float vec[3], circumfac, dist, phi0, co, si, *curs, cursor[3], gcursor[3]; 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; TransData *td = t->data;
float vec[3]; float vec[3];
@ -2700,7 +2700,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) {
constraintTransLim(t, td); constraintTransLim(t, td);
} }
int Resize(TransInfo *t, const short mval[2]) int Resize(TransInfo *t, const int mval[2])
{ {
TransData *td; TransData *td;
float size[3], mat[3][3]; float size[3], mat[3][3];
@ -2805,7 +2805,7 @@ void initToSphere(TransInfo *t)
t->val /= (float)t->total; 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 vec[3];
float ratio, radius; 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; 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; char str[128], *spos= str;
float axis1[3], axis2[3]; 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 */ /* 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]; 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 vec[3];
float distance; 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; TransData *td = t->data;
int i; int i;
@ -3704,7 +3704,7 @@ void initCurveShrinkFatten(TransInfo *t)
t->flag |= T_NO_CONSTRAINT; 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; TransData *td = t->data;
float ratio; 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 vec[3], axis[3];
float distance; float distance;
@ -3905,7 +3905,7 @@ int handleEventBevel(TransInfo *t, wmEvent *event)
return 0; return 0;
} }
int Bevel(TransInfo *t, const short UNUSED(mval[2])) int Bevel(TransInfo *t, const int UNUSED(mval[2]))
{ {
float distance,d; float distance,d;
int i; int i;
@ -3973,7 +3973,7 @@ void initBevelWeight(TransInfo *t)
t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; 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; TransData *td = t->data;
float weight; float weight;
@ -4046,7 +4046,7 @@ void initCrease(TransInfo *t)
t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; 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; TransData *td = t->data;
float crease; float crease;
@ -4165,7 +4165,7 @@ static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3])
td->loc[1]= oldy; td->loc[1]= oldy;
} }
int BoneSize(TransInfo *t, const short mval[2]) int BoneSize(TransInfo *t, const int mval[2])
{ {
TransData *td = t->data; TransData *td = t->data;
float size[3], mat[3][3]; float size[3], mat[3][3];
@ -4241,7 +4241,7 @@ void initBoneEnvelope(TransInfo *t)
t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; 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; TransData *td = t->data;
float ratio; float ratio;
@ -4672,10 +4672,10 @@ static int createSlideVerts(TransInfo *t)
#undef EDGE_SLIDE_MIN #undef EDGE_SLIDE_MIN
sld->start[0] = (short) start[0]; sld->start[0] = (int) start[0];
sld->start[1] = (short) start[1]; sld->start[1] = (int) start[1];
sld->end[0] = (short) end[0]; sld->end[0] = (int) end[0];
sld->end[1] = (short) end[1]; sld->end[1] = (int) end[1];
if (uvlay_tot) { // XXX && (scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) { if (uvlay_tot) { // XXX && (scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) {
int maxnum = 0; int maxnum = 0;
@ -4975,7 +4975,7 @@ int doEdgeSlide(TransInfo *t, float perc)
return 1; return 1;
} }
int EdgeSlide(TransInfo *t, const short UNUSED(mval[2])) int EdgeSlide(TransInfo *t, const int UNUSED(mval[2]))
{ {
char str[50]; char str[50];
float final; float final;
@ -5034,7 +5034,7 @@ void initBoneRoll(TransInfo *t)
t->flag |= T_NO_CONSTRAINT|T_NO_PROJECT; 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; TransData *td = t->data;
int i; int i;
@ -5095,7 +5095,7 @@ void initBakeTime(TransInfo *t)
t->num.increment = t->snap[1]; 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; TransData *td = t->data;
float time; 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; TransData *td;
float size[3], mat[3][3]; float size[3], mat[3][3];
@ -5247,7 +5247,7 @@ void initAlign(TransInfo *t)
initMouseInputMode(t, &t->mouse, INPUT_NONE); 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; TransData *td = t->data;
float center[3]; 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]; 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; View2D *v2d = (View2D *)t->view;
float cval[2], sval[2]; 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; View2D *v2d = (View2D *)t->view;
float cval[2], sval[2]; 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]; char str[200];

@ -119,7 +119,7 @@ typedef struct TransCon {
float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */ 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 float center[3]; /* transformation center to define where to draw the view widget
ALWAYS in global space. Unlike the transformation center */ 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) */ /* the one in TransInfo is not garanty to stay the same (Rotates change it) */
int mode; /* Mode flags of the Constraint */ int mode; /* Mode flags of the Constraint */
void (*drawExtra)(struct TransInfo *); void (*drawExtra)(struct TransInfo *);
@ -217,7 +217,7 @@ typedef struct SlideData {
struct GHash *vhash, **uvhash; struct GHash *vhash, **uvhash;
struct EditVert *nearest; struct EditVert *nearest;
struct LinkNode *edgelist, *vertlist; struct LinkNode *edgelist, *vertlist;
short start[2], end[2]; int start[2], end[2];
} SlideData; } SlideData;
typedef struct TransData { typedef struct TransData {
@ -242,12 +242,12 @@ typedef struct TransData {
} TransData; } TransData;
typedef struct MouseInput { 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]); void (*post)(struct TransInfo *, float [3]);
short imval[2]; /* initial mouse position */ int imval[2]; /* initial mouse position */
char precision; 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]; int center[2];
float factor; float factor;
void *data; /* additional data, if needed by the particular function */ void *data; /* additional data, if needed by the particular function */
@ -261,7 +261,7 @@ typedef struct TransInfo {
int options; /* current context/options for transform */ int options; /* current context/options for transform */
float val; /* init value for some transformations (and rotation angle) */ float val; /* init value for some transformations (and rotation angle) */
float fac; /* factor for distance based transform */ float fac; /* factor for distance based transform */
int (*transform)(struct TransInfo *, const short *); int (*transform)(struct TransInfo *, const int *);
/* transform function pointer */ /* transform function pointer */
int (*handleEvent)(struct TransInfo *, struct wmEvent *); int (*handleEvent)(struct TransInfo *, struct wmEvent *);
/* event handler function pointer RETURN 1 if redraw is needed */ /* event handler function pointer RETURN 1 if redraw is needed */
@ -279,7 +279,7 @@ typedef struct TransInfo {
char proptext[20]; /* proportional falloff text */ char proptext[20]; /* proportional falloff text */
float center[3]; /* center of transformation */ float center[3]; /* center of transformation */
int center2d[2]; /* center in screen coordinates */ 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 event_type; /* event->type used to invoke transform */
short idx_max; /* maximum index on the input vector */ short idx_max; /* maximum index on the input vector */
float snap[3]; /* Snapping Gears */ float snap[3]; /* Snapping Gears */
@ -328,7 +328,7 @@ typedef struct TransInfo {
struct Scene *scene; struct Scene *scene;
struct ToolSettings *settings; struct ToolSettings *settings;
struct wmTimer *animtimer; struct wmTimer *animtimer;
short mval[2]; /* current mouse position */ int mval[2]; /* current mouse position */
struct Object *obedit; struct Object *obedit;
void *draw_handle_apply; void *draw_handle_apply;
void *draw_handle_view; void *draw_handle_view;
@ -458,7 +458,7 @@ void transformApply(struct bContext *C, TransInfo *t);
int transformEnd(struct bContext *C, TransInfo *t); int transformEnd(struct bContext *C, TransInfo *t);
void setTransformViewMatrices(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 projectIntView(TransInfo *t, float *vec, int *adr);
void projectFloatView(TransInfo *t, float *vec, float *adr); void projectFloatView(TransInfo *t, float *vec, float *adr);
@ -467,81 +467,81 @@ void removeAspectRatio(TransInfo *t, float *vec);
void initWarp(TransInfo *t); void initWarp(TransInfo *t);
int handleEventWarp(TransInfo *t, struct wmEvent *event); 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); void initShear(TransInfo *t);
int handleEventShear(TransInfo *t, struct wmEvent *event); 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); void initResize(TransInfo *t);
int Resize(TransInfo *t, const short mval[2]); int Resize(TransInfo *t, const int mval[2]);
void initTranslation(TransInfo *t); void initTranslation(TransInfo *t);
int Translation(TransInfo *t, const short mval[2]); int Translation(TransInfo *t, const int mval[2]);
void initToSphere(TransInfo *t); void initToSphere(TransInfo *t);
int ToSphere(TransInfo *t, const short mval[2]); int ToSphere(TransInfo *t, const int mval[2]);
void initRotation(TransInfo *t); void initRotation(TransInfo *t);
int Rotation(TransInfo *t, const short mval[2]); int Rotation(TransInfo *t, const int mval[2]);
void initShrinkFatten(TransInfo *t); void initShrinkFatten(TransInfo *t);
int ShrinkFatten(TransInfo *t, const short mval[2]); int ShrinkFatten(TransInfo *t, const int mval[2]);
void initTilt(TransInfo *t); void initTilt(TransInfo *t);
int Tilt(TransInfo *t, const short mval[2]); int Tilt(TransInfo *t, const int mval[2]);
void initCurveShrinkFatten(TransInfo *t); void initCurveShrinkFatten(TransInfo *t);
int CurveShrinkFatten(TransInfo *t, const short mval[2]); int CurveShrinkFatten(TransInfo *t, const int mval[2]);
void initTrackball(TransInfo *t); void initTrackball(TransInfo *t);
int Trackball(TransInfo *t, const short mval[2]); int Trackball(TransInfo *t, const int mval[2]);
void initPushPull(TransInfo *t); void initPushPull(TransInfo *t);
int PushPull(TransInfo *t, const short mval[2]); int PushPull(TransInfo *t, const int mval[2]);
void initBevel(TransInfo *t); void initBevel(TransInfo *t);
int handleEventBevel(TransInfo *t, struct wmEvent *event); 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); void initBevelWeight(TransInfo *t);
int BevelWeight(TransInfo *t, const short mval[2]); int BevelWeight(TransInfo *t, const int mval[2]);
void initCrease(TransInfo *t); void initCrease(TransInfo *t);
int Crease(TransInfo *t, const short mval[2]); int Crease(TransInfo *t, const int mval[2]);
void initBoneSize(TransInfo *t); void initBoneSize(TransInfo *t);
int BoneSize(TransInfo *t, const short mval[2]); int BoneSize(TransInfo *t, const int mval[2]);
void initBoneEnvelope(TransInfo *t); void initBoneEnvelope(TransInfo *t);
int BoneEnvelope(TransInfo *t, const short mval[2]); int BoneEnvelope(TransInfo *t, const int mval[2]);
void initBoneRoll(TransInfo *t); void initBoneRoll(TransInfo *t);
int BoneRoll(TransInfo *t, const short mval[2]); int BoneRoll(TransInfo *t, const int mval[2]);
void initEdgeSlide(TransInfo *t); void initEdgeSlide(TransInfo *t);
int EdgeSlide(TransInfo *t, const short mval[2]); int EdgeSlide(TransInfo *t, const int mval[2]);
void initTimeTranslate(TransInfo *t); void initTimeTranslate(TransInfo *t);
int TimeTranslate(TransInfo *t, const short mval[2]); int TimeTranslate(TransInfo *t, const int mval[2]);
void initTimeSlide(TransInfo *t); void initTimeSlide(TransInfo *t);
int TimeSlide(TransInfo *t, const short mval[2]); int TimeSlide(TransInfo *t, const int mval[2]);
void initTimeScale(TransInfo *t); void initTimeScale(TransInfo *t);
int TimeScale(TransInfo *t, const short mval[2]); int TimeScale(TransInfo *t, const int mval[2]);
void initBakeTime(TransInfo *t); void initBakeTime(TransInfo *t);
int BakeTime(TransInfo *t, const short mval[2]); int BakeTime(TransInfo *t, const int mval[2]);
void initMirror(TransInfo *t); void initMirror(TransInfo *t);
int Mirror(TransInfo *t, const short mval[2]); int Mirror(TransInfo *t, const int mval[2]);
void initAlign(TransInfo *t); void initAlign(TransInfo *t);
int Align(TransInfo *t, const short mval[2]); int Align(TransInfo *t, const int mval[2]);
void initSeqSlide(TransInfo *t); 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); void drawPropCircle(const struct bContext *C, TransInfo *t);
@ -645,12 +645,12 @@ typedef enum {
INPUT_CUSTOM_RATIO INPUT_CUSTOM_RATIO
} MouseInputMode; } 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); void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode);
int handleMouseInput(struct TransInfo *t, struct MouseInput *mi, struct wmEvent *event); 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])); void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *, float [3]));
/*********************** Generics ********************************/ /*********************** Generics ********************************/

@ -665,7 +665,7 @@ void drawConstraint(TransInfo *t)
char col2[3] = {255,255,255}; char col2[3] = {255,255,255};
int depth_test_enabled; 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); add_v3_v3(vec, tc->center);
drawLine(t, tc->center, tc->mtx[0], 'X', 0); drawLine(t, tc->center, tc->mtx[0], 'X', 0);

@ -43,25 +43,25 @@
/* ************************** INPUT FROM MOUSE *************************** */ /* ************************** 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]; float vec[3], dvec[3];
if(mi->precision) if(mi->precision)
{ {
/* calculate the main translation and the precise one separate */ /* 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); 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); add_v3_v3v3(output, vec, dvec);
} }
else 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; float ratio, precise_ratio, dx, dy;
if(mi->precision) if(mi->precision)
@ -87,7 +87,7 @@ static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const short mval[2
output[0] = ratio; 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); 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) if(mi->precision)
@ -118,7 +118,7 @@ static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const short mva
output[1] *= mi->factor; 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; float x, pad;
pad = t->ar->winx / 10; 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); 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]; float vec[3];
InputVector(t, mi, mval, vec); 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; 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; float y, pad;
pad = t->ar->winy / 10; 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); 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]; float vec[3];
InputVector(t, mi, mval, vec); 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; 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) { 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; data = mi->data;
@ -185,12 +185,12 @@ void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, short start[2], short
data[3] = end[1]; 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 length;
float distance; float distance;
short *data = mi->data; int *data = mi->data;
short dx, dy; int dx, dy;
if (data) { if (data) {
dx = data[2] - data[0]; dx = data[2] - data[0];
@ -200,14 +200,14 @@ static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const short m
if (mi->precision) { if (mi->precision) {
/* deal with Shift key by adding motion / 10 to motion before shift press */ /* 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]; 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]; 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; distance = (length != 0.0f)? (mdx*dx + mdy*dy) / length: 0.0f;
} }
else { else {
short mdx, mdy; int mdx, mdy;
mdx = mval[0] - data[2]; mdx = mval[0] - data[2];
mdy = mval[1] - data[3]; 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 dx2 = mval[0] - mi->center[0];
double dy2 = mval[1] - mi->center[1]; 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; 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->factor = 0;
mi->precision = 0; mi->precision = 0;
@ -372,7 +372,7 @@ void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *, float [3])
mi->post = post; 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) if (mi->apply != NULL)
{ {

@ -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; View3D *v3d= sa->spacedata.first;
RegionView3D *rv3d= ar->regiondata; RegionView3D *rv3d= ar->regiondata;

@ -335,8 +335,8 @@ typedef struct wmEvent {
short type; /* event code itself (short, is also in keymap) */ short type; /* event code itself (short, is also in keymap) */
short val; /* press, release, scrollvalue */ short val; /* press, release, scrollvalue */
short x, y; /* mouse pointer position, screen coord */ int x, y; /* mouse pointer position, screen coord */
short mval[2]; /* region mouse position, name convention pre 2.5 :) */ int mval[2]; /* region mouse position, name convention pre 2.5 :) */
short unicode; /* future, ghost? */ short unicode; /* future, ghost? */
char ascii; /* from ghost */ char ascii; /* from ghost */
char pad; char pad;
@ -344,9 +344,9 @@ typedef struct wmEvent {
/* previous state */ /* previous state */
short prevtype; short prevtype;
short prevval; short prevval;
short prevx, prevy; int prevx, prevy;
double prevclicktime; double prevclicktime;
short prevclickx, prevclicky; int prevclickx, prevclicky;
/* modifier states */ /* modifier states */
short shift, ctrl, alt, oskey; /* oskey is apple or windowskey, value denotes order of pressed */ 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 */ struct ImBuf *imb; /* if no icon but imbuf should be drawn around cursor */
float scale; float scale;
short sx, sy; int sx, sy;
char opname[240]; /* FILE_MAX */ /* if set, draws operator name*/ char opname[240]; /* FILE_MAX */ /* if set, draws operator name*/
} wmDrag; } wmDrag;

@ -2293,7 +2293,7 @@ static void update_tablet_data(wmWindow *win, wmEvent *event)
/* imperfect but probably usable... draw/enable drags to other windows */ /* imperfect but probably usable... draw/enable drags to other windows */
static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *win, wmEvent *evt) 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) if(wm->windows.first== wm->windows.last)
return NULL; return NULL;
@ -2310,8 +2310,8 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi
return NULL; return NULL;
/* to desktop space */ /* to desktop space */
mx+= win->posx; mx += (int)win->posx;
my+= win->posy; my += (int)win->posy;
/* check other windows to see if it has mouse inside */ /* check other windows to see if it has mouse inside */
for(owin= wm->windows.first; owin; owin= owin->next) { 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(owin!=win) {
if(mx-owin->posx >= 0 && my-owin->posy >= 0 && if(mx-owin->posx >= 0 && my-owin->posy >= 0 &&
mx-owin->posx <= owin->sizex && my-owin->posy <= owin->sizey) { mx-owin->posx <= owin->sizex && my-owin->posy <= owin->sizey) {
evt->x= mx-owin->posx; evt->x= mx - (int)owin->posx;
evt->y= my-owin->posy; evt->y= my - (int)owin->posy;
return owin; return owin;
} }

@ -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; short *lasso= gesture->customdata;
lasso += (2 * gesture->points - 2); lasso += (2 * gesture->points - 2);