From f0b5a9da017a00c094cb7ab8bd0aa289c921a117 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 20 Nov 2018 08:53:00 +1100 Subject: Cleanup: style, unused --- source/blender/blenkernel/intern/studiolight.c | 2 +- .../draw/engines/workbench/workbench_studiolight.c | 16 +++++++++------- source/blender/python/gpu/gpu_py_offscreen.c | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c index 736a06a3148..ce7372dc0b9 100644 --- a/source/blender/blenkernel/intern/studiolight.c +++ b/source/blender/blenkernel/intern/studiolight.c @@ -200,7 +200,7 @@ static void equirect_to_direction(float r[3], float u, float v) r[2] = cosf(theta); } -static void direction_to_cube_face_uv(float r_uv[2], int *r_face, const float dir[3]) +static void UNUSED_FUNCTION(direction_to_cube_face_uv)(float r_uv[2], int *r_face, const float dir[3]) { if (fabsf(dir[0]) > fabsf(dir[1]) && fabsf(dir[0]) > fabsf(dir[2])) { bool is_pos = (dir[0] > 0.0f); diff --git a/source/blender/draw/engines/workbench/workbench_studiolight.c b/source/blender/draw/engines/workbench/workbench_studiolight.c index 65732b52471..901260d0660 100644 --- a/source/blender/draw/engines/workbench/workbench_studiolight.c +++ b/source/blender/draw/engines/workbench/workbench_studiolight.c @@ -41,18 +41,20 @@ void studiolight_update_world(StudioLight *sl, WORKBENCH_UBO_World *wd) mul_v3_v3fl(wd->spherical_harmonics_coefs[0], sl->spherical_harmonics_coefs[0], M_1_PI); /* Swizzle to make shader code simpler. */ for (int i = 0; i < 3; ++i) { - copy_v3_fl3(wd->spherical_harmonics_coefs[i+1], -sl->spherical_harmonics_coefs[3][i], - sl->spherical_harmonics_coefs[2][i], - -sl->spherical_harmonics_coefs[1][i]); - mul_v3_fl(wd->spherical_harmonics_coefs[i+1], M_1_PI * 1.5f); /* 1.5f is to improve the contrast a bit. */ + copy_v3_fl3( + wd->spherical_harmonics_coefs[i + 1], + -sl->spherical_harmonics_coefs[3][i], + sl->spherical_harmonics_coefs[2][i], + -sl->spherical_harmonics_coefs[1][i]); + mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], M_1_PI * 1.5f); /* 1.5f is to improve the contrast a bit. */ } /* Precompute as much as we can. See shader code for derivation. */ float len_r1[3], lr1_r0[3], p[3], a[3]; for (int i = 0; i < 3; ++i) { - mul_v3_fl(wd->spherical_harmonics_coefs[i+1], 0.5f); - len_r1[i] = len_v3(wd->spherical_harmonics_coefs[i+1]); - mul_v3_fl(wd->spherical_harmonics_coefs[i+1], 1.0f / len_r1[i]); + mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], 0.5f); + len_r1[i] = len_v3(wd->spherical_harmonics_coefs[i + 1]); + mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], 1.0f / len_r1[i]); } /* lr1_r0 = lenR1 / R0; */ copy_v3_v3(lr1_r0, wd->spherical_harmonics_coefs[0]); diff --git a/source/blender/python/gpu/gpu_py_offscreen.c b/source/blender/python/gpu/gpu_py_offscreen.c index 5fff75dec6b..c51a356d900 100644 --- a/source/blender/python/gpu/gpu_py_offscreen.c +++ b/source/blender/python/gpu/gpu_py_offscreen.c @@ -289,7 +289,7 @@ static PyObject *bpygpu_offscreen_free(BPyGPUOffScreen *self) Py_RETURN_NONE; } -static PyObject *bpygpu_offscreen_bind_context_enter(BPyGPUOffScreen *self) +static PyObject *bpygpu_offscreen_bind_context_enter(BPyGPUOffScreen *UNUSED(self)) { Py_RETURN_NONE; } -- cgit v1.2.3