From 20a97122193b570b310bfcddba8375c7fa6f0f08 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Wed, 14 Feb 2007 19:40:17 +0000 Subject: [PATCH] === bugfix === - possible fix for crash mentioned in [ #5781 ] Sculpt Brush Tool not working correctly - workaround for possible compiler glitch with floating point conversion. --- source/blender/src/sculptmode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c index fedf1d89392..ac03d36e1cb 100644 --- a/source/blender/src/sculptmode.c +++ b/source/blender/src/sculptmode.c @@ -1074,8 +1074,8 @@ float tex_strength(EditData *e, float *point, const float len,const unsigned vin /* For Tile and Drag modes, get the 2D screen coordinates of the and scale them up or down to the texture size. */ if(sd->texrept==SCULPTREPT_TILE) { - const float sx= sd->mtex[sd->texact]->size[0]; - const float sy= sd->texsep ? sd->mtex[sd->texact]->size[1] : sx; + const int sx= (const int)sd->mtex[sd->texact]->size[0]; + const int sy= (const int)sd->texsep ? sd->mtex[sd->texact]->size[1] : sx; float fx= pv.co[0]; float fy= pv.co[1]; @@ -1090,8 +1090,8 @@ float tex_strength(EditData *e, float *point, const float len,const unsigned vin px= len * cos(angle) + 2000; py= len * sin(angle) + 2000; } - px%= (int)sx; - py%= (int)sy; + px %= sx; + py %= sy; p= get_ri_pixel(ri, ri->pr_rectx*px/sx, ri->pr_recty*py/sy); } else { float fx= (pv.co[0] - e->mouse[0] + half) * (ri->pr_rectx*1.0f/bsize) - ri->pr_rectx/2;