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>2018-10-03 01:10:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-10-03 01:10:48 +0300
commit4c22807e69c0c31f23e3fea8249035729577137c (patch)
treebace8f7c5287f43220c8b8ef473701fc1c4d9dd0 /source/blender/draw/intern
parent00c0e55227698f811617a0f415436b3f0b9c61c8 (diff)
Cleanup: style
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c2
-rw-r--r--source/blender/draw/intern/draw_common.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index ae842b7de6a..8a18d2adcbb 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -4779,7 +4779,7 @@ static void uvedit_fill_buffer_data(
BM_elem_flag_set(efa, BM_ELEM_TAG, uvedit_face_visible_test(scene, ob, ima, efa));
if ((state & UVEDIT_STRETCH_AREA) &&
- BM_elem_flag_test(efa, BM_ELEM_TAG))
+ BM_elem_flag_test(efa, BM_ELEM_TAG))
{
const int efa_len = efa->len;
float (*tf_uv)[2] = (float (*)[2])BLI_buffer_reinit_data(&vec2_buf, vec2f, efa_len);
diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c
index d4cac6fb549..de300201f1b 100644
--- a/source/blender/draw/intern/draw_common.c
+++ b/source/blender/draw/intern/draw_common.c
@@ -949,7 +949,7 @@ bool DRW_object_axis_orthogonal_to_view(Object *ob, int axis)
return false;
}
-static void DRW_evaluate_weight_to_color(float *result, float weight)
+static void DRW_evaluate_weight_to_color(const float weight, float result[4])
{
if (U.flag & USER_CUSTOM_RANGE) {
BKE_colorband_evaluate(&U.coba_weight, weight, result);
@@ -959,7 +959,7 @@ static void DRW_evaluate_weight_to_color(float *result, float weight)
* increasing widens yellow/cyan vs red/green/blue.
* Gamma 1.0 produces the original 2.79 color ramp. */
const float gamma = 1.5f;
- float hsv[3] = { (2.0f / 3.0f) * (1.0f - weight), 1.0f, pow(0.5f + 0.5f * weight, gamma) };
+ float hsv[3] = {(2.0f / 3.0f) * (1.0f - weight), 1.0f, pow(0.5f + 0.5f * weight, gamma)};
hsv_to_rgb_v(hsv, result);
@@ -972,11 +972,11 @@ static void DRW_evaluate_weight_to_color(float *result, float weight)
static GPUTexture *DRW_create_weight_colorramp_texture(void)
{
char error[256];
- float pixels[256 * 4];
+ float pixels[256][4];
for (int i = 0 ; i < 256 ; i ++) {
- DRW_evaluate_weight_to_color(&pixels[i*4], i / 255.0f);
- pixels[(i * 4) + 3] = 1.0f;
+ DRW_evaluate_weight_to_color(i / 255.0f, pixels[i]);
+ pixels[i][3] = 1.0f;
}
- return GPU_texture_create_1D(256, GPU_RGBA8, pixels, error);
+ return GPU_texture_create_1D(256, GPU_RGBA8, pixels[0], error);
}