diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-04 19:21:34 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-04 19:21:34 +0400 |
commit | 209ceb6969cf2398aa38a7a292e64ef130d5e8db (patch) | |
tree | 4fdd393c40031e1cb296e076cb0a1cbcd78f6d00 /source/blender | |
parent | 4ea816837de646af124ffc82758cae37950a0a51 (diff) |
correct some warnings, also sensor_x was being paassed to object_camera_matrix(...) for x and y args, looks like an accident
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 18 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 4 |
4 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index cec2f0f6895..9a0dbd2a2eb 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -3045,7 +3045,7 @@ void object_camera_matrix( else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) { viewfac= winx; } - else { + else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */ viewfac= (*ycor) * winy; } @@ -3060,7 +3060,7 @@ void object_camera_matrix( else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) { viewfac= ((*lens) * winx) / (*sensor_x); } - else if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { + else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */ viewfac= ((*lens) * winy) / (*sensor_y); } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 0f230df049e..b77f3977355 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3408,20 +3408,20 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND { float *hsv= ui_block_hsv_get(but->block); float rgb[3]; - float phi, r, sqr, v[2]; - float sensitivity = (shift?0.15:0.3) * ndof->dt; + float phi, r /*, sqr */ /* UNUSED */, v[2]; + float sensitivity = (shift ? 0.15f : 0.3f) * ndof->dt; ui_get_but_vectorf(but, rgb); rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); /* Convert current colour on hue/sat disc to circular coordinates phi, r */ - phi = fmodf(hsv[0]+0.25, 1.0f) * -2.0f*M_PI; + phi = fmodf(hsv[0]+0.25f, 1.0f) * -2.0f*M_PI; r = hsv[1]; - sqr = r>0.f?sqrtf(r):1; + /* sqr= r>0.f?sqrtf(r):1; */ /* UNUSED */ /* Convert to 2d vectors */ - v[0] = r * cos(phi); - v[1] = r * sin(phi); + v[0] = r * cosf(phi); + v[1] = r * sinf(phi); /* Use ndof device y and x rotation to move the vector in 2d space */ v[0] += ndof->ry * sensitivity; @@ -3431,19 +3431,19 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND phi = atan2(v[0], v[1])/(2.0f*(float)M_PI) + 0.5f; /* use ndof z rotation to additionally rotate hue */ - phi -= ndof->rz * sensitivity * 0.5; + phi -= ndof->rz * sensitivity * 0.5f; r = len_v2(v); CLAMP(r, 0.0f, 1.0f); /* convert back to hsv values, in range [0,1] */ - hsv[0] = fmodf(phi, 1.0); + hsv[0] = fmodf(phi, 1.0f); hsv[1] = r; /* exception, when using color wheel in 'locked' value state: * allow choosing a hue for black values, by giving a tiny increment */ if (but->flag & UI_BUT_COLOR_LOCK) { // lock - if (hsv[2] == 0.f) hsv[2] = 0.0001f; + if (hsv[2] == 0.0f) hsv[2] = 0.0001f; } hsv_to_rgb(hsv[0], hsv[1], hsv[2], data->vec, data->vec+1, data->vec+2); diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 92544b2309c..6b6003fb098 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -3014,7 +3014,7 @@ static void project_paint_begin(ProjPaintState *ps) object_camera_mode(&ps->scene->r, camera); object_camera_matrix(&ps->scene->r, camera, ps->winx, ps->winy, 0, winmat, &_viewplane, &ps->clipsta, &ps->clipend, - &_lens, &_sensor_x, &_sensor_x, &_sensor_fit, &_ycor, &_viewdx, &_viewdy); + &_lens, &_sensor_x, &_sensor_y, &_sensor_fit, &_ycor, &_viewdx, &_viewdy); ps->is_ortho= (ps->scene->r.mode & R_ORTHO) ? 1 : 0; } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index a764ae77c9d..aa69e7121e0 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1228,7 +1228,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) if (ca && (ca->flag & CAM_SHOWSENSOR)) { /* assume fixed sensor width for now */ - float sensor_aspect = ca->sensor_x / ca->sensor_y; + /* float sensor_aspect = ca->sensor_x / ca->sensor_y; */ /* UNUSED */ float sensor_scale = (x2i-x1i) / ca->sensor_x; float sensor_height = sensor_scale * ca->sensor_y; @@ -1238,7 +1238,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) UI_ThemeColorShade(TH_WIRE, 100); - uiDrawBox(GL_LINE_LOOP, x1i, sy1, x2i, sy2, 2.0); + uiDrawBox(GL_LINE_LOOP, x1i, sy1, x2i, sy2, 2.0f); } } |