diff options
Diffstat (limited to 'source/blender/draw/engines/gpencil')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_cache_utils.c | 9 | ||||
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_draw_data.c | 7 |
2 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c index 8a4134ec8ea..41a7196cb90 100644 --- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c @@ -132,12 +132,11 @@ static int gpencil_tobject_dist_sort(const void *a, const void *b) if (ob_a->camera_z > ob_b->camera_z) { return 1; } - else if (ob_a->camera_z < ob_b->camera_z) { + if (ob_a->camera_z < ob_b->camera_z) { return -1; } - else { - return 0; - } + + return 0; } void gpencil_object_cache_sort(GPENCIL_PrivateData *pd) @@ -193,7 +192,7 @@ static float gpencil_layer_final_opacity_get(const GPENCIL_PrivateData *pd, if (is_obact && is_fade) { return gpl->opacity * pd->fade_layer_opacity; } - else if (!is_obact && (pd->fade_gp_object_opacity > -1.0f)) { + if (!is_obact && (pd->fade_gp_object_opacity > -1.0f)) { return gpl->opacity * pd->fade_gp_object_opacity; } } diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_data.c b/source/blender/draw/engines/gpencil/gpencil_draw_data.c index ed443b2c73f..51152475a06 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_data.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_data.c @@ -359,12 +359,11 @@ static float light_power_get(const Light *la) if (la->type == LA_AREA) { return 1.0f / (4.0f * M_PI); } - else if (la->type == LA_SPOT || la->type == LA_LOCAL) { + if (la->type == LA_SPOT || la->type == LA_LOCAL) { return 1.0f / (4.0f * M_PI * M_PI); } - else { - return 1.0f / M_PI; - } + + return 1.0f / M_PI; } void gpencil_light_pool_populate(GPENCIL_LightPool *lightpool, Object *ob) |