diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-07-21 21:05:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-07-21 21:06:10 +0300 |
commit | 1cc0ce58fd082a819431a766fa3e2f897dd46a4e (patch) | |
tree | 5317615ec8c4ced9cf5395d476eb556e576f4153 /source/blender/blenkernel | |
parent | 9279bee58302f70fed3549887835e1374a032bd7 (diff) |
Cleanup: warnings
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/camera.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 16 |
2 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c index b7e6e409999..4229b2a727e 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -78,8 +78,8 @@ void BKE_camera_init(Camera *cam) /* stereoscopy 3d */ cam->stereo.interocular_distance = 0.065f; cam->stereo.convergence_distance = 30.f * 0.065f; - cam->stereo.pole_merge_angle_from = DEG2RAD(60.0f); - cam->stereo.pole_merge_angle_to = DEG2RAD(75.0f); + cam->stereo.pole_merge_angle_from = DEG2RADF(60.0f); + cam->stereo.pole_merge_angle_to = DEG2RADF(75.0f); } void *BKE_camera_add(Main *bmain, const char *name) diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 2b097f31c59..d35de6fc5d3 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -4483,7 +4483,7 @@ static void dynamicPaint_doSmudge(DynamicPaintSurface *surface, DynamicPaintBrus CLAMP_MIN(max_velocity, vel); } - steps = (int)ceil(max_velocity / bData->average_dist * timescale); + steps = (int)ceil((double)max_velocity / bData->average_dist * (double)timescale); CLAMP(steps, 0, 12); eff_scale = brush->smudge_strength / (float)steps * timescale; @@ -4634,7 +4634,7 @@ static int dynamicPaint_prepareEffectStep( /* calculate average values (single thread) */ for (int index = 0; index < sData->total_points; index++) { - average_force += (*force)[index * 4 + 3]; + average_force += (double)(*force)[index * 4 + 3]; } average_force /= sData->total_points; } @@ -4651,7 +4651,7 @@ static int dynamicPaint_prepareEffectStep( shrink_speed = surface->shrink_speed; fastest_effect = max_fff(spread_speed, shrink_speed, average_force); - avg_dist = bData->average_dist * CANVAS_REL_SIZE / getSurfaceDimension(sData); + avg_dist = bData->average_dist * (double)CANVAS_REL_SIZE / (double)getSurfaceDimension(sData); steps = (int)ceilf(1.5f * EFF_MOVEMENT_PER_FRAME * fastest_effect / avg_dist * timescale); CLAMP(steps, 1, 20); @@ -5009,7 +5009,8 @@ static void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescal const float wave_scale = CANVAS_REL_SIZE / canvas_size; /* allocate memory */ - PaintWavePoint *prevPoint = MEM_mallocN(sData->total_points * sizeof(PaintWavePoint), "Temp previous points for wave simulation"); + PaintWavePoint *prevPoint = MEM_mallocN( + sData->total_points * sizeof(PaintWavePoint), __func__); if (!prevPoint) return; @@ -5019,13 +5020,14 @@ static void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescal int numOfNeighs = sData->adj_data->n_num[index]; for (i = 0; i < numOfNeighs; i++) { - average_dist += bNeighs[sData->adj_data->n_index[index] + i].dist; + average_dist += (double)bNeighs[sData->adj_data->n_index[index] + i].dist; } } - average_dist *= wave_scale / sData->adj_data->total_targets; + average_dist *= (double)wave_scale / sData->adj_data->total_targets; /* determine number of required steps */ - steps = (int)ceil((WAVE_TIME_FAC * timescale * surface->wave_timescale) / (average_dist / wave_speed / 3)); + steps = (int)ceil((double)(WAVE_TIME_FAC * timescale * surface->wave_timescale) / + (average_dist / (double)wave_speed / 3)); CLAMP(steps, 1, 20); timescale /= steps; |