Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-01-04 06:02:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-01-04 09:38:11 +0300
commita5081896bc0416f9b64ae8e488bfe1cc2042ca7e (patch)
tree3d5a1c29a845adef18d05b623eeee5f9aacefae9 /source/blender/blenkernel/intern/studiolight.c
parentb5c2a75d26dbd5725ee5c8f361db35aedb45efdf (diff)
Cleanup: redundant code, minor inconsistencies
- Remove ternary operators when both values are the same. - Remove break after return. - Remove redundant NULL checks for code which handles those cases immediately beforehand.
Diffstat (limited to 'source/blender/blenkernel/intern/studiolight.c')
-rw-r--r--source/blender/blenkernel/intern/studiolight.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c
index 95186d2311a..b7b5b6997c2 100644
--- a/source/blender/blenkernel/intern/studiolight.c
+++ b/source/blender/blenkernel/intern/studiolight.c
@@ -306,19 +306,19 @@ static void UNUSED_FUNCTION(direction_to_cube_face_uv)(float r_uv[2],
bool is_pos = (dir[0] > 0.0f);
*r_face = is_pos ? STUDIOLIGHT_X_POS : STUDIOLIGHT_X_NEG;
r_uv[0] = dir[2] / fabsf(dir[0]) * (is_pos ? 1 : -1);
- r_uv[1] = dir[1] / fabsf(dir[0]) * (is_pos ? -1 : -1);
+ r_uv[1] = dir[1] / fabsf(dir[0]) * -1;
}
else if (fabsf(dir[1]) > fabsf(dir[0]) && fabsf(dir[1]) > fabsf(dir[2])) {
bool is_pos = (dir[1] > 0.0f);
*r_face = is_pos ? STUDIOLIGHT_Y_POS : STUDIOLIGHT_Y_NEG;
- r_uv[0] = dir[0] / fabsf(dir[1]) * (is_pos ? 1 : 1);
+ r_uv[0] = dir[0] / fabsf(dir[1]) * 1;
r_uv[1] = dir[2] / fabsf(dir[1]) * (is_pos ? -1 : 1);
}
else {
bool is_pos = (dir[2] > 0.0f);
*r_face = is_pos ? STUDIOLIGHT_Z_NEG : STUDIOLIGHT_Z_POS;
r_uv[0] = dir[0] / fabsf(dir[2]) * (is_pos ? -1 : 1);
- r_uv[1] = dir[1] / fabsf(dir[2]) * (is_pos ? -1 : -1);
+ r_uv[1] = dir[1] / fabsf(dir[2]) * -1;
}
r_uv[0] = r_uv[0] * 0.5f + 0.5f;
r_uv[1] = r_uv[1] * 0.5f + 0.5f;