Cleanup: add missing braces to draw manager
authorCampbell Barton <ideasman42@gmail.com>
Thu, 24 Jan 2019 20:10:13 +0000 (07:10 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 24 Jan 2019 20:12:13 +0000 (07:12 +1100)
47 files changed:
source/blender/draw/engines/eevee/eevee_lightcache.c
source/blender/draw/engines/eevee/eevee_lightprobes.c
source/blender/draw/engines/eevee/eevee_lights.c
source/blender/draw/engines/eevee/eevee_materials.c
source/blender/draw/engines/eevee/eevee_render.c
source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl
source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl
source/blender/draw/engines/eevee/shaders/lamps_lib.glsl
source/blender/draw/engines/eevee/shaders/lightprobe_cube_display_frag.glsl
source/blender/draw/engines/eevee/shaders/lightprobe_grid_display_frag.glsl
source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
source/blender/draw/engines/eevee/shaders/ltc_lib.glsl
source/blender/draw/engines/eevee/shaders/prepass_frag.glsl
source/blender/draw/engines/external/external_engine.c
source/blender/draw/engines/gpencil/gpencil_draw_utils.c
source/blender/draw/engines/gpencil/gpencil_shader_fx.c
source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_wave_frag.glsl
source/blender/draw/engines/gpencil/shaders/gpencil_blend_frag.glsl
source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
source/blender/draw/engines/gpencil/shaders/gpencil_zdepth_mix_frag.glsl
source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl
source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl
source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl
source/blender/draw/engines/workbench/workbench_data.c
source/blender/draw/engines/workbench/workbench_deferred.c
source/blender/draw/engines/workbench/workbench_forward.c
source/blender/draw/intern/draw_armature.c
source/blender/draw/intern/draw_cache.c
source/blender/draw/intern/draw_cache_impl_mesh.c
source/blender/draw/intern/draw_cache_impl_particles.c
source/blender/draw/intern/draw_instance_data.c
source/blender/draw/intern/draw_manager.c
source/blender/draw/intern/draw_manager_data.c
source/blender/draw/intern/draw_manager_exec.c
source/blender/draw/modes/edit_text_mode.c
source/blender/draw/modes/object_mode.c
source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl
source/blender/draw/modes/shaders/edit_curve_overlay_handle_geom.glsl
source/blender/draw/modes/shaders/edit_mesh_overlay_facedot_frag.glsl
source/blender/draw/modes/shaders/edit_mesh_overlay_facefill_vert.glsl
source/blender/draw/modes/shaders/edit_mesh_overlay_frag.glsl
source/blender/draw/modes/shaders/edit_mesh_overlay_geom_tri.glsl
source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl
source/blender/draw/modes/shaders/object_outline_prepass_geom.glsl
source/blender/draw/modes/shaders/object_particle_prim_vert.glsl
source/blender/draw/modes/shaders/paint_weight_frag.glsl

index 93162c6eae2e1ea683a4217f73bb85c3cf577172..0420e85ee706bc98da43af1d6879ded1fbbd93e4 100644 (file)
@@ -514,8 +514,9 @@ wmJob *EEVEE_lightbake_job_create(
        EEVEE_LightBake *lbake = NULL;
 
        /* only one render job at a time */
-       if (WM_jobs_test(wm, scene, WM_JOB_TYPE_RENDER))
+       if (WM_jobs_test(wm, scene, WM_JOB_TYPE_RENDER)) {
                return NULL;
+       }
 
        wmJob *wm_job = WM_jobs_get(wm, win, scene, "Bake Lighting",
                                    WM_JOB_EXCL_RENDER | WM_JOB_PRIORITY | WM_JOB_PROGRESS, WM_JOB_TYPE_LIGHT_BAKE);
index 3199fc430cf7f1499d5877ec46a6911a37bd8905..601073a7be2ab613b678fcf156806988f50bf60d 100644 (file)
@@ -78,15 +78,18 @@ bool EEVEE_lightprobes_obj_visibility_cb(bool vis_in, void *user_data)
        EEVEE_ObjectEngineData *oed = (EEVEE_ObjectEngineData *)user_data;
 
        /* test disabled if group is NULL */
-       if (oed->test_data->collection == NULL)
+       if (oed->test_data->collection == NULL) {
                return vis_in;
+       }
 
-       if (oed->test_data->cached == false)
+       if (oed->test_data->cached == false) {
                oed->ob_vis_dirty = true;
+       }
 
        /* early out, don't need to compute ob_vis yet. */
-       if (vis_in == false)
+       if (vis_in == false) {
                return vis_in;
+       }
 
        if (oed->ob_vis_dirty) {
                oed->ob_vis_dirty = false;
index af3531e9a6c3729c46f85670f3b663eedb380ef1..57a93a27ca00a6dfa9f703696eefbcdaa810f737 100644 (file)
@@ -457,8 +457,9 @@ void EEVEE_lights_cache_shcaster_material_add(
        DRW_shgroup_uniform_block(grp, "shadow_block", sldata->shadow_ubo);
        DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo);
 
-       if (alpha_threshold != NULL)
+       if (alpha_threshold != NULL) {
                DRW_shgroup_uniform_float(grp, "alphaThreshold", alpha_threshold, 1);
+       }
 
        DRW_shgroup_call_object_add(grp, geom, ob);
 }
@@ -599,8 +600,9 @@ void EEVEE_lights_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
 
 float light_attenuation_radius_get(Lamp *la, float light_threshold)
 {
-       if (la->mode & LA_CUSTOM_ATTENUATION)
+       if (la->mode & LA_CUSTOM_ATTENUATION) {
                return la->att_dist;
+       }
 
        /* Compute max light power. */
        float power = max_fff(la->r, la->g, la->b);
index 6786bf7e911013994e9222ba9cc4378335f88ce6..527fa515deb006327540d3750b9a35f495475b3d 100644 (file)
@@ -784,8 +784,9 @@ struct GPUMaterial *EEVEE_material_mesh_depth_get(
                options |= VAR_MAT_CLIP;
        }
 
-       if (is_shadow)
+       if (is_shadow) {
                options |= VAR_MAT_SHADOW;
+       }
 
        GPUMaterial *mat = DRW_shader_find_from_material(ma, engine, options, true);
        if (mat) {
@@ -1485,8 +1486,9 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sld
                        shgrp_depth_array[i] = NULL;
                        shgrp_depth_clip_array[i] = NULL;
 
-                       if (ma == NULL)
+                       if (ma == NULL) {
                                ma = &defmaterial;
+                       }
 
                        switch (ma->blend_method) {
                                case MA_BM_SOLID:
@@ -1536,8 +1538,9 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sld
                                        EEVEE_ObjectEngineData *oedata = NULL;
                                        Material *ma = give_current_material(ob, i + 1);
 
-                                       if (ma == NULL)
+                                       if (ma == NULL) {
                                                ma = &defmaterial;
+                                       }
 
                                        /* Do not render surface if we are rendering a volume object
                                         * and do not have a surface closure. */
index 373618102e5586f84bb69cf263d60273356081f0..6e2cac6dbce587c75fa70765e6ede99829334f7f 100644 (file)
@@ -288,8 +288,9 @@ static void eevee_render_result_normal(
        EEVEE_PrivateData *g_data = stl->g_data;
 
        /* Only read the center texel. */
-       if (stl->effects->taa_current_sample > 1)
+       if (stl->effects->taa_current_sample > 1) {
                return;
+       }
 
        if ((view_layer->passflag & SCE_PASS_NORMAL) != 0) {
                RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_NORMAL, viewname);
@@ -336,8 +337,9 @@ static void eevee_render_result_z(
        EEVEE_PrivateData *g_data = stl->g_data;
 
        /* Only read the center texel. */
-       if (stl->effects->taa_current_sample > 1)
+       if (stl->effects->taa_current_sample > 1) {
                return;
+       }
 
        if ((view_layer->passflag & SCE_PASS_Z) != 0) {
                RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_Z, viewname);
index a54cefc5b85599950f19156f76548dd0282a1a8f..28ffe37abf115cdec4d300e285b5cfe90bdb3622 100644 (file)
@@ -244,8 +244,9 @@ float line_unit_sphere_intersect_dist(vec3 lineorigin, vec3 linedirection)
 
        float dist = 1e15;
        float determinant = b * b - a * c;
-       if (determinant >= 0)
+       if (determinant >= 0) {
                dist = (sqrt(determinant) - b) / a;
+       }
 
        return dist;
 }
index 27517ebd86e1ac0b3ecf1d0525ae124166da70a5..067b0786e34c5f6a23c59cf36e18d8a24cb63b6b 100644 (file)
@@ -108,15 +108,17 @@ layout(location = 1) out float fragAlpha;
 void main(void)
 {
        /* Discard to avoid bleeding onto the next layer */
-       if (int(gl_FragCoord.x) * edge.x + edge.y > 0)
+       if (int(gl_FragCoord.x) * edge.x + edge.y > 0) {
                discard;
+       }
 
        /* Circle Dof */
        float dist = length(particlecoord);
 
        /* Ouside of bokeh shape */
-       if (dist > 1.0)
+       if (dist > 1.0) {
                discard;
+       }
 
        /* Regular Polygon Dof */
        if (bokeh_sides.x > 0.0) {
@@ -134,8 +136,9 @@ void main(void)
                dist /= r;
 
                /* Ouside of bokeh shape */
-               if (dist > 1.0)
+               if (dist > 1.0) {
                        discard;
+               }
        }
 
        fragColor = color;
index b8a86f8d742676fb2b456e52ee7362a1f49f1eef..d44cf5e35185e8b5348e6a376d6a7e30904db28e 100644 (file)
@@ -91,8 +91,9 @@ void main()
 
        /* Early out */
        /* We can't do discard because we don't clear the render target. */
-       if (depth == 1.0)
+       if (depth == 1.0) {
                return;
+       }
 
        vec2 uvs = vec2(fullres_texel) / vec2(textureSize(depthBuffer, 0));
 
@@ -105,16 +106,18 @@ void main()
        vec4 speccol_roughness = texelFetch(specroughBuffer, fullres_texel, 0).rgba;
 
        /* Early out */
-       if (dot(speccol_roughness.rgb, vec3(1.0)) == 0.0)
+       if (dot(speccol_roughness.rgb, vec3(1.0)) == 0.0) {
                return;
+       }
 
        float roughness = speccol_roughness.a;
        float roughnessSquared = max(1e-3, roughness * roughness);
        float a2 = roughnessSquared * roughnessSquared;
 
        /* Early out */
-       if (roughness > ssrMaxRoughness + 0.2)
+       if (roughness > ssrMaxRoughness + 0.2) {
                return;
+       }
 
        vec4 rand = texelFetch(utilTex, ivec3(halfres_texel % LUT_SIZE, 2), 0);
 
@@ -394,8 +397,9 @@ void main()
        float depth = textureLod(depthBuffer, uvs, 0.0).r;
 
        /* Early out */
-       if (depth == 1.0)
+       if (depth == 1.0) {
                discard;
+       }
 
        /* Using world space */
        vec3 viewPosition = get_view_space_from_depth(uvs, depth); /* Needed for viewCameraVec */
@@ -406,8 +410,9 @@ void main()
        vec4 speccol_roughness = texelFetch(specroughBuffer, fullres_texel, 0).rgba;
 
        /* Early out */
-       if (dot(speccol_roughness.rgb, vec3(1.0)) == 0.0)
+       if (dot(speccol_roughness.rgb, vec3(1.0)) == 0.0) {
                discard;
+       }
 
        float roughness = speccol_roughness.a;
        float roughnessSquared = max(1e-3, roughness * roughness);
index fb18af494b4ee6826c25f8c3baf16d1a400856ed..5a73950746dc8cc55f83c6ae6658f8656d5035a5 100644 (file)
@@ -52,8 +52,9 @@ float shadow_test(ShadowSample moments, float dist, ShadowData sd)
 {
        float p = 0.0;
 
-       if (dist <= moments.x)
+       if (dist <= moments.x) {
                p = 1.0;
+       }
 
        float variance = moments.y - (moments.x * moments.x);
        variance = max(variance, sd.sh_bias / 10.0);
index 5a72244cfbe226e136ba97644b14979ae607d334..bd51546eadf1a9c0beb15309b8fc1383d31c08aa 100644 (file)
@@ -9,8 +9,9 @@ void main()
        float dist_sqr = dot(quadCoord, quadCoord);
 
        /* Discard outside the circle. */
-       if (dist_sqr > 1.0)
+       if (dist_sqr > 1.0) {
                discard;
+       }
 
        vec3 view_nor = vec3(quadCoord, sqrt(max(0.0, 1.0 - dist_sqr)));
        vec3 world_ref = mat3(ViewMatrixInverse) * reflect(vec3(0.0, 0.0, -1.0), view_nor);
index fd8eb157aa5ecb391070c480ce655fd6b6b5fc33..fe0e173ba3d1a1f0e1f7d232af3306002ac80e6d 100644 (file)
@@ -9,8 +9,9 @@ void main()
        float dist_sqr = dot(quadCoord, quadCoord);
 
        /* Discard outside the circle. */
-       if (dist_sqr > 1.0)
+       if (dist_sqr > 1.0) {
                discard;
+       }
 
        vec3 view_nor = vec3(quadCoord, sqrt(max(0.0, 1.0 - dist_sqr)));
        vec3 world_nor = mat3(ViewMatrixInverse) * view_nor;
index 5631957ca313e1679395bb5916677b43458cb14a..6fb8ebc719e12e2b46943c0f64b0f7ccac2bd3a3 100644 (file)
@@ -217,8 +217,9 @@ void CLOSURE_NAME(
 
                float l_vis = light_visibility(ld, worldPosition, viewPosition, viewNormal, l_vector);
 
-               if (l_vis < 1e-8)
+               if (l_vis < 1e-8) {
                        continue;
+               }
 
                vec3 l_color_vis = ld.l_color * l_vis;
 
index 11c223a45d6c072c8be3ead82a9bcecd18066b8e..b042b7fab455875b4c9d5e3655260826e76071a5 100644 (file)
@@ -93,10 +93,12 @@ vec3 solve_cubic(vec4 coefs)
                float x_3d = 2.0 * sqrt(-C_d) * cos(theta + (2.0 / 3.0) * M_PI);
 
                float xs;
-               if (x_1d + x_3d < 2.0 * C)
+               if (x_1d + x_3d < 2.0 * C) {
                        xs = x_1d;
-               else
+               }
+               else {
                        xs = x_3d;
+               }
 
                xsc = vec2(-D, xs + C);
        }
@@ -279,8 +281,9 @@ float ltc_evaluate_disk(vec3 N, vec3 V, mat3 Minv, vec3 disk_points[3])
        /* Now find front facing ellipse with same solid angle. */
 
        vec3 V3 = normalize(cross(V1, V2));
-       if (dot(C, V3) < 0.0)
+       if (dot(C, V3) < 0.0) {
                V3 *= -1.0;
+       }
 
        float L  = dot(V3, C);
        float x0 = dot(V1, C) / L;
index 6b6ab0c0bccdfa5e5be4ceeab8785f2600692d71..bbc49fea6ba45699b2dff06a169c45361d44efe6 100644 (file)
@@ -75,12 +75,14 @@ void main()
 
 #if defined(USE_ALPHA_HASH)
        /* Hashed Alpha Testing */
-       if (cl.opacity < hashed_alpha_threshold(worldPosition))
+       if (cl.opacity < hashed_alpha_threshold(worldPosition)) {
                discard;
+       }
 #elif defined(USE_ALPHA_CLIP)
        /* Alpha clip */
-       if (cl.opacity <= alphaThreshold)
+       if (cl.opacity <= alphaThreshold) {
                discard;
+       }
 #endif
 #endif
 }
index f0a83b7c926827a63acbea5eb588917949a7a803..26586aef84dbe1be628ddfd396a62e972310b303 100644 (file)
@@ -128,8 +128,9 @@ static void external_cache_populate(void *vedata, Object *ob)
 {
        EXTERNAL_StorageList *stl = ((EXTERNAL_Data *)vedata)->stl;
 
-       if (!DRW_object_is_renderable(ob))
+       if (!DRW_object_is_renderable(ob)) {
                return;
+       }
 
        struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
        if (geom) {
index 59a8a5f73e1c3cfd9b8b2823dc2f1f0e757494d9..0cc835b8d4e8464ef8c193735b221bb458ff8d55 100644 (file)
@@ -156,8 +156,9 @@ static bool gpencil_can_draw_stroke(
         const bool onion, const bool is_mat_preview)
 {
        /* skip stroke if it doesn't have any valid data */
-       if ((gps->points == NULL) || (gps->totpoints < 1) || (gp_style == NULL))
+       if ((gps->points == NULL) || (gps->totpoints < 1) || (gp_style == NULL)) {
                return false;
+       }
 
        /* if mat preview render always visible */
        if (is_mat_preview) {
@@ -1130,8 +1131,9 @@ void DRW_gpencil_triangulate_stroke_fill(Object *ob, bGPDstroke *gps)
        }
        else {
                /* No triangles needed - Free anything allocated previously */
-               if (gps->triangles)
+               if (gps->triangles) {
                        MEM_freeN(gps->triangles);
+               }
 
                gps->triangles = NULL;
        }
@@ -1496,8 +1498,9 @@ void DRW_gpencil_populate_multiedit(
        /* draw strokes */
        for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
                /* don't draw layer if hidden */
-               if (gpl->flag & GP_LAYER_HIDE)
+               if (gpl->flag & GP_LAYER_HIDE) {
                        continue;
+               }
 
                /* list of frames to draw */
                if (!playing) {
@@ -1603,8 +1606,9 @@ void DRW_gpencil_populate_datablock(
                }
 
                gpf = BKE_gpencil_layer_getframe(gpl, remap_cfra, GP_GETFRAME_USE_PREV);
-               if (gpf == NULL)
+               if (gpf == NULL) {
                        continue;
+               }
 
                /* if solo mode, display only frames with keyframe in the current frame */
                if ((is_solomode) && (gpf->framenum != remap_cfra)) {
index 925eaebab1f8e91c5c31de30b2d17c081b356a86..1f47be0c34abb5a0966e3e499a6d56d08b74c415 100644 (file)
@@ -92,13 +92,15 @@ static bool effect_is_active(bGPdata *gpd, ShaderFxData *fx, bool is_render)
 static bool get_normal_vector(bGPdata *gpd, float r_point[3], float r_normal[3])
 {
        for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
-               if (gpl->flag & GP_LAYER_HIDE)
+               if (gpl->flag & GP_LAYER_HIDE) {
                        continue;
+               }
 
                /* get frame  */
                bGPDframe *gpf = gpl->actframe;
-               if (gpf == NULL)
+               if (gpf == NULL) {
                        continue;
+               }
                for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
                        if (gps->totpoints >= 3) {
                                bGPDspoint *pt = &gps->points[0];
index 3dbab0297c48e5398272bfd2ade4404bb0d5ddcf..04ab1557d07df4506ff00a05cefcaf455d1f7087 100644 (file)
@@ -38,6 +38,7 @@ void main()
        FragColor = outcolor;
        gl_FragDepth = stroke_depth;
 
-       if (outcolor.a < 0.02f)
+       if (outcolor.a < 0.02f) {
                discard;
+       }
 }
index f5696116eeab884f42e2b6bcfd335b96d67b45db..fdaad9890a0b76c70c838b42acbf6bdfabe6c861 100644 (file)
@@ -79,10 +79,12 @@ vec4 get_blend_color(int mode, vec4 src_color, vec4 blend_color)
 
 float linearrgb_to_srgb(float c)
 {
-       if (c < 0.0031308)
+       if (c < 0.0031308) {
                return (c < 0.0) ? 0.0 : c * 12.92;
-       else
+       }
+       else {
                return 1.055 * pow(c, 1.0 / 2.4) - 0.055;
+       }
 }
 
 vec4 tone(vec4 stroke_color)
index db97305611020c82568a8775e468aa45f1a384e5..a1285029e4c4bbda2c16a2ae0ea94ee0f7fd286c 100644 (file)
@@ -23,9 +23,10 @@ void main()
        float dist_squared = dot(centered, centered);
        const float rad_squared = 0.25;
 
-       // round point with jaggy edges
-       if ((mode != GPENCIL_MODE_BOX) && (dist_squared > rad_squared))
+        /* Round point with jaggy edges. */
+       if ((mode != GPENCIL_MODE_BOX) && (dist_squared > rad_squared)) {
                discard;
+       }
 
        vec4 tmp_color = texture2D(myTexture, mTexCoord);
 
index f4b6201e503b7d784fd233a73f8efef515715c5c..eb64947999ed998e8fae1bb6e1f69632b3091771 100644 (file)
@@ -8,18 +8,22 @@ uniform int tonemapping;
 
 float srgb_to_linearrgb(float c)
 {
-       if (c < 0.04045)
+       if (c < 0.04045) {
                return (c < 0.0) ? 0.0 : c * (1.0 / 12.92);
-       else
+       }
+       else {
                return pow((c + 0.055) * (1.0 / 1.055), 2.4);
+       }
 }
 
 float linearrgb_to_srgb(float c)
 {
-       if (c < 0.0031308)
+       if (c < 0.0031308) {
                return (c < 0.0) ? 0.0 : c * 12.92;
-       else
+       }
+       else {
                return 1.055 * pow(c, 1.0 / 2.4) - 0.055;
+       }
 }
 
 void main()
index 7b77139fb6c137fa6f23e48a7baebae80de85a30..998517e2e72479e0101d9b3103a6a0d946cc8a8a 100644 (file)
@@ -9,8 +9,9 @@ void ssao_factors(
 {
        cavities = edges = 0.0;
        /* early out if there is no need for SSAO */
-       if (ssao_factor_cavity == 0.0 && ssao_factor_edge == 0.0)
+       if (ssao_factor_cavity == 0.0 && ssao_factor_edge == 0.0) {
                return;
+       }
 
        /* take the normalized ray direction here */
        vec3 noise = texture(ssao_jitter, screenco.xy * jitter_tilling).rgb;
@@ -45,8 +46,9 @@ void ssao_factors(
 
                vec2 uvcoords = screenco.xy + dir_jittered * offset;
 
-               if (uvcoords.x > 1.0 || uvcoords.x < 0.0 || uvcoords.y > 1.0 || uvcoords.y < 0.0)
+               if (uvcoords.x > 1.0 || uvcoords.x < 0.0 || uvcoords.y > 1.0 || uvcoords.y < 0.0) {
                        continue;
+               }
 
                float depth_new = texture(depthBuffer, uvcoords).r;
 
@@ -56,8 +58,9 @@ void ssao_factors(
                /* This trick provide good edge effect even if no neighboor is found. */
                vec3 pos_new = get_view_space_from_depth(uvcoords, (is_background) ? depth : depth_new);
 
-               if (is_background)
+               if (is_background) {
                        pos_new.z -= ssao_distance;
+               }
 
                vec3 dir = pos_new - position;
                float len = length(dir);
@@ -68,11 +71,13 @@ void ssao_factors(
                float attenuation = 1.0 / (len * (1.0 + len * len * ssao_attenuation));
 
                /* use minor bias here to avoid self shadowing */
-               if (f_cavities > -f_bias)
+               if (f_cavities > -f_bias) {
                        cavities += f_cavities * attenuation;
+               }
 
-               if (f_edge > f_bias)
+               if (f_edge > f_bias) {
                        edges += f_edge * attenuation;
+               }
        }
 
        cavities /= ssao_samples_num;
index ce8988de4a52e1677a57d2d76f3a93087722a030..5f3dbd75b15b1118c2c01861f8b10a9681c1326d 100644 (file)
@@ -144,10 +144,12 @@ vec2 matcap_uv_compute(vec3 I, vec3 N, bool flipped)
 
 float srgb_to_linearrgb(float c)
 {
-       if (c < 0.04045)
+       if (c < 0.04045) {
                return (c < 0.0) ? 0.0 : c * (1.0 / 12.92);
-       else
+       }
+       else {
                return pow((c + 0.055) * (1.0 / 1.055), 2.4);
+       }
 }
 
 vec4 srgb_to_linearrgb(vec4 col_from)
index a2f23fbf3dcbe4901f70acee376a5ddaf1eae890..14f47556896e29a01386f368eb1892c8bdbdb2b6 100644 (file)
@@ -64,8 +64,9 @@ void main()
        bvec2 degen_faces = lessThan(abs(faces_area), vec2(DEGENERATE_THRESHOLD));
 
        /* Both triangles are degenerate, abort. */
-       if (all(degen_faces))
+       if (all(degen_faces)) {
                return;
+       }
 #endif
 
        vec2 facing = vec2(dot(n1, lightDirection),
@@ -92,8 +93,9 @@ void main()
 #endif
 
        /* If both faces face the same direction it's not an outline edge. */
-       if (backface.x == backface.y)
+       if (backface.x == backface.y) {
                return;
+       }
 
 #ifdef USE_INVOC_EXT
        if (gl_InvocationID == 0) {
index b5e55d157d0f286303b3d8ebb153b44e06b67889..2fdec4cf8fcca0618413dcee76c5f95d4edefcd1 100644 (file)
@@ -169,8 +169,9 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd)
                        /* normalized trick see:
                         * http://www.derschmale.com/2014/01/26/reconstructing-positions-from-the-depth-buffer */
                        mul_v3_fl(viewvecs[i], 1.0f / viewvecs[i][3]);
-                       if (is_persp)
+                       if (is_persp) {
                                mul_v3_fl(viewvecs[i], 1.0f / viewvecs[i][2]);
+                       }
                        viewvecs[i][3] = 1.0;
 
                        copy_v4_v4(wpd->viewvecs[i], viewvecs[i]);
index ac473dbdf7d23e0d459ac753650a94c243356058..b48e64293fab44ed31f6266dfc9e532b119e63d7 100644 (file)
@@ -813,8 +813,9 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
        const DRWContextState *draw_ctx = DRW_context_state_get();
        Scene *scene = draw_ctx->scene;
 
-       if (!DRW_object_is_renderable(ob))
+       if (!DRW_object_is_renderable(ob)) {
                return;
+       }
 
        if (ob->type == OB_MESH) {
                workbench_cache_populate_particles(vedata, ob);
index 66ee25c0d8281882e7f5f264665872d4feae40b8..80c35f3cfcd2996755cffcc7b87350b47f31fd05 100644 (file)
@@ -498,8 +498,9 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob)
        Scene *scene = draw_ctx->scene;
        const bool is_wire = (ob->dt == OB_WIRE);
 
-       if (!DRW_object_is_renderable(ob))
+       if (!DRW_object_is_renderable(ob)) {
                return;
+       }
 
        if (ob->type == OB_MESH) {
                workbench_forward_cache_populate_particles(vedata, ob);
index b4076b6c7e91203653498374bb8a7d216540f583..08abf85912b65e6e28008d0835d0caef80add43f 100644 (file)
@@ -516,8 +516,9 @@ static void set_pchan_colorset(Object *ob, bPoseChannel *pchan)
                 */
                if (pchan->agrp_index) {
                        grp = (bActionGroup *)BLI_findlink(&pose->agroups, (pchan->agrp_index - 1));
-                       if (grp)
+                       if (grp) {
                                color_index = grp->customCol;
+                       }
                }
        }
 
@@ -775,8 +776,9 @@ static const float *get_bone_solid_color(
         const EditBone *UNUSED(eBone), const bPoseChannel *pchan, const bArmature *arm,
         const int boneflag, const short constflag)
 {
-       if (g_theme.const_color)
+       if (g_theme.const_color) {
                return g_theme.bone_solid_color;
+       }
 
        if (arm->flag & ARM_POSEMODE) {
                static float disp_color[4];
@@ -792,8 +794,9 @@ static const float *get_bone_solid_with_consts_color(
         const EditBone *eBone, const bPoseChannel *pchan, const bArmature *arm,
         const int boneflag, const short constflag)
 {
-       if (g_theme.const_color)
+       if (g_theme.const_color) {
                return g_theme.bone_solid_color;
+       }
 
        const float *col = get_bone_solid_color(eBone, pchan, arm, boneflag, constflag);
 
@@ -809,12 +812,15 @@ static const float *get_bone_solid_with_consts_color(
 
 static float get_bone_wire_thickness(int boneflag)
 {
-       if (g_theme.const_color)
+       if (g_theme.const_color) {
                return g_theme.const_wire;
-       else if (boneflag & (BONE_DRAW_ACTIVE | BONE_SELECTED))
+       }
+       else if (boneflag & (BONE_DRAW_ACTIVE | BONE_SELECTED)) {
                return 2.0f;
-       else
+       }
+       else {
                return 1.0f;
+       }
 }
 
 static const float *get_bone_wire_color(
@@ -1576,8 +1582,9 @@ static void pchan_draw_ik_lines(bPoseChannel *pchan, const bool only_temp, const
        float *line_start = NULL, *line_end = NULL;
 
        for (con = pchan->constraints.first; con; con = con->next) {
-               if (con->enforce == 0.0f)
+               if (con->enforce == 0.0f) {
                        continue;
+               }
 
                switch (con->type) {
                        case CONSTRAINT_TYPE_KINEMATIC:
@@ -1586,8 +1593,9 @@ static void pchan_draw_ik_lines(bPoseChannel *pchan, const bool only_temp, const
                                int segcount = 0;
 
                                /* if only_temp, only draw if it is a temporary ik-chain */
-                               if (only_temp && !(data->flag & CONSTRAINT_IK_TEMP))
+                               if (only_temp && !(data->flag & CONSTRAINT_IK_TEMP)) {
                                        continue;
+                               }
 
                                /* exclude tip from chain? */
                                parchan = ((data->flag & CONSTRAINT_IK_TIP) == 0) ? pchan->parent : pchan;
@@ -1605,10 +1613,12 @@ static void pchan_draw_ik_lines(bPoseChannel *pchan, const bool only_temp, const
                                if (parchan) {
                                        line_end = parchan->pose_head;
 
-                                       if (constflag & PCHAN_HAS_TARGET)
+                                       if (constflag & PCHAN_HAS_TARGET) {
                                                drw_shgroup_bone_ik_lines(line_start, line_end);
-                                       else
+                                       }
+                                       else {
                                                drw_shgroup_bone_ik_no_target_lines(line_start, line_end);
+                                       }
                                }
                                break;
                        }
@@ -1618,8 +1628,9 @@ static void pchan_draw_ik_lines(bPoseChannel *pchan, const bool only_temp, const
                                int segcount = 0;
 
                                /* don't draw if only_temp, as Spline IK chains cannot be temporary */
-                               if (only_temp)
+                               if (only_temp) {
                                        continue;
+                               }
 
                                parchan = pchan;
                                line_start = parchan->pose_tail;
@@ -1826,8 +1837,9 @@ static void draw_armature_pose(Object *ob, const float const_color[4])
                                }
 
                                /* set temporary flag for drawing bone as active, but only if selected */
-                               if (bone == arm->act_bone)
+                               if (bone == arm->act_bone) {
                                        boneflag |= BONE_DRAW_ACTIVE;
+                               }
 
                                draw_bone_relations(NULL, pchan, arm, boneflag, constflag, show_relations);
 
index 45fca44772f9769decb16208ca75dc07bc8c9007..2bc73700462cd65d7001ad2111b71474da1d46e0 100644 (file)
@@ -3623,10 +3623,7 @@ GPUBatch *DRW_cache_cursor_get(bool crosshair_lines)
                        float x = f10 * cosf(angle);
                        float y = f10 * sinf(angle);
 
-                       if (i % 2 == 0)
-                               GPU_vertbuf_attr_set(vbo, attr_id.color, v, red);
-                       else
-                               GPU_vertbuf_attr_set(vbo, attr_id.color, v, white);
+                       GPU_vertbuf_attr_set(vbo, attr_id.color, v, (i % 2 == 0) ? red : white);
 
                        GPU_vertbuf_attr_set(vbo, attr_id.pos, v, (const float[2]){x, y});
                        GPU_indexbuf_add_generic_vert(&elb, v++);
index d4e5027dcb26656943897f8112698e17742fcdc6..af2539188ecf29ecf37c9fdb397eeaa150434562 100644 (file)
@@ -1491,11 +1491,13 @@ static uchar mesh_render_data_looptri_flag(MeshRenderData *rdata, const BMFace *
 {
        uchar fflag = 0;
 
-       if (efa == rdata->efa_act)
+       if (efa == rdata->efa_act) {
                fflag |= VFLAG_FACE_ACTIVE;
+       }
 
-       if (BM_elem_flag_test(efa, BM_ELEM_SELECT))
+       if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
                fflag |= VFLAG_FACE_SELECTED;
+       }
 
 #ifdef WITH_FREESTYLE
        if (rdata->cd.offset.freestyle_face != -1) {
@@ -1515,17 +1517,21 @@ static void mesh_render_data_edge_flag(
 {
        eattr->e_flag |= VFLAG_EDGE_EXISTS;
 
-       if (eed == rdata->eed_act)
+       if (eed == rdata->eed_act) {
                eattr->e_flag |= VFLAG_EDGE_ACTIVE;
+       }
 
-       if (BM_elem_flag_test(eed, BM_ELEM_SELECT))
+       if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
                eattr->e_flag |= VFLAG_EDGE_SELECTED;
+       }
 
-       if (BM_elem_flag_test(eed, BM_ELEM_SEAM))
+       if (BM_elem_flag_test(eed, BM_ELEM_SEAM)) {
                eattr->e_flag |= VFLAG_EDGE_SEAM;
+       }
 
-       if (!BM_elem_flag_test(eed, BM_ELEM_SMOOTH))
+       if (!BM_elem_flag_test(eed, BM_ELEM_SMOOTH)) {
                eattr->e_flag |= VFLAG_EDGE_SHARP;
+       }
 
        /* Use a byte for value range */
        if (rdata->cd.offset.crease != -1) {
@@ -1558,11 +1564,13 @@ static uchar mesh_render_data_vertex_flag(MeshRenderData *rdata, const BMVert *e
        uchar vflag = VFLAG_VERTEX_EXISTS;
 
        /* Current vertex */
-       if (eve == rdata->eve_act)
+       if (eve == rdata->eve_act) {
                vflag |= VFLAG_VERTEX_ACTIVE;
+       }
 
-       if (BM_elem_flag_test(eve, BM_ELEM_SELECT))
+       if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
                vflag |= VFLAG_VERTEX_SELECTED;
+       }
 
        return vflag;
 }
@@ -4803,8 +4811,9 @@ static void uvedit_fill_buffer_data(
                float (*av)[3], (*auv)[2];
                ushort area_stretch;
                /* Skip hidden faces. */
-               if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
+               if (!BM_elem_flag_test(efa, BM_ELEM_TAG)) {
                        continue;
+               }
 
                uchar face_flag = edit_uv_get_face_flag(efa, efa_act, cd_loop_uv_offset, &scene);
                /* Face preprocess */
index b383fcf4b92eb024fab2f596e0f59760c8b1f7d0..ef44d69424bc7ccc02771c0464e38be728812108 100644 (file)
@@ -1309,8 +1309,9 @@ static void particle_batch_cache_ensure_pos(
        if (psys->part->phystype == PART_PHYS_KEYED) {
                if (psys->flag & PSYS_KEYED) {
                        psys_count_keyed_targets(&sim);
-                       if (psys->totkeyed == 0)
+                       if (psys->totkeyed == 0) {
                                return;
+                       }
                }
        }
 
index 0fc4582ab443fe01dcbb92340ebe20db07ba1efc..be077126d1081f718cc62cf27792c418ae019895 100644 (file)
@@ -150,8 +150,9 @@ void DRW_batching_buffer_request(
        }
        int new_id = 0; /* Find insertion point. */
        for (; new_id < chunk->alloc_size; ++new_id) {
-               if (chunk->bbufs[new_id].format == NULL)
+               if (chunk->bbufs[new_id].format == NULL) {
                        break;
+               }
        }
        /* If there is no batch left. Allocate more. */
        if (new_id == chunk->alloc_size) {
@@ -191,8 +192,9 @@ void DRW_instancing_buffer_request(
        }
        int new_id = 0; /* Find insertion point. */
        for (; new_id < chunk->alloc_size; ++new_id) {
-               if (chunk->ibufs[new_id].format == NULL)
+               if (chunk->ibufs[new_id].format == NULL) {
                        break;
+               }
        }
        /* If there is no batch left. Allocate more. */
        if (new_id == chunk->alloc_size) {
index d311b3e8156088535bb48a8a8f217b85e6dde1a9..ad045e9ea1f81477f6da72bc99a8b9a1316512ea 100644 (file)
@@ -842,8 +842,9 @@ static bool id_type_can_have_drawdata(const short id_type)
 static bool id_can_have_drawdata(const ID *id)
 {
        /* sanity check */
-       if (id == NULL)
+       if (id == NULL) {
                return false;
+       }
 
        return id_type_can_have_drawdata(GS(id->name));
 }
@@ -861,16 +862,18 @@ DrawDataList *DRW_drawdatalist_from_id(ID *id)
                IdDdtTemplate *idt = (IdDdtTemplate *)id;
                return &idt->drawdata;
        }
-       else
+       else {
                return NULL;
+       }
 }
 
 DrawData *DRW_drawdata_get(ID *id, DrawEngineType *engine_type)
 {
        DrawDataList *drawdata = DRW_drawdatalist_from_id(id);
 
-       if (drawdata == NULL)
+       if (drawdata == NULL) {
                return NULL;
+       }
 
        LISTBASE_FOREACH(DrawData *, dd, drawdata) {
                if (dd->engine_type == engine_type) {
@@ -930,8 +933,9 @@ void DRW_drawdata_free(ID *id)
 {
        DrawDataList *drawdata = DRW_drawdatalist_from_id(id);
 
-       if (drawdata == NULL)
+       if (drawdata == NULL) {
                return;
+       }
 
        LISTBASE_FOREACH(DrawData *, dd, drawdata) {
                if (dd->free != NULL) {
@@ -948,8 +952,9 @@ static void drw_drawdata_unlink_dupli(ID *id)
        if ((GS(id->name) == ID_OB) && (((Object *)id)->base_flag & BASE_FROM_DUPLI) != 0) {
                DrawDataList *drawdata = DRW_drawdatalist_from_id(id);
 
-               if (drawdata == NULL)
+               if (drawdata == NULL) {
                        return;
+               }
 
                BLI_listbase_clear((ListBase *)drawdata);
        }
index 79a658829bed72374a537378a49efb57b5855260..204896c5132180be3866977141191eef6cd08739 100644 (file)
@@ -674,24 +674,33 @@ static void drw_shgroup_init(DRWShadingGroup *shgroup, GPUShader *shader)
        shgroup->callid = GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_CALLID);
 
        shgroup->matflag = 0;
-       if (shgroup->modelinverse > -1)
+       if (shgroup->modelinverse > -1) {
                shgroup->matflag |= DRW_CALL_MODELINVERSE;
-       if (shgroup->modelview > -1)
+       }
+       if (shgroup->modelview > -1) {
                shgroup->matflag |= DRW_CALL_MODELVIEW;
-       if (shgroup->modelviewinverse > -1)
+       }
+       if (shgroup->modelviewinverse > -1) {
                shgroup->matflag |= DRW_CALL_MODELVIEWINVERSE;
-       if (shgroup->modelviewprojection > -1)
+       }
+       if (shgroup->modelviewprojection > -1) {
                shgroup->matflag |= DRW_CALL_MODELVIEWPROJECTION;
-       if (shgroup->normalview > -1)
+       }
+       if (shgroup->normalview > -1) {
                shgroup->matflag |= DRW_CALL_NORMALVIEW;
-       if (shgroup->normalworld > -1)
+       }
+       if (shgroup->normalworld > -1) {
                shgroup->matflag |= DRW_CALL_NORMALWORLD;
-       if (shgroup->orcotexfac > -1)
+       }
+       if (shgroup->orcotexfac > -1) {
                shgroup->matflag |= DRW_CALL_ORCOTEXFAC;
-       if (shgroup->objectinfo > -1)
+       }
+       if (shgroup->objectinfo > -1) {
                shgroup->matflag |= DRW_CALL_OBJECTINFO;
-       if (shgroup->eye > -1)
+       }
+       if (shgroup->eye > -1) {
                shgroup->matflag |= DRW_CALL_EYEVEC;
+       }
 }
 
 static void drw_shgroup_instance_init(
index df2daa998fe4e53e5e46c017e2f9b41374ac69c6..787f4ee7b401f63d4fcac25e23181527d766f643 100644 (file)
@@ -521,8 +521,9 @@ static void draw_frustum_boundbox_calc(const float(*projmat)[4], BoundBox *r_bbo
 
 static void draw_clipping_setup_from_view(void)
 {
-       if (DST.clipping.updated)
+       if (DST.clipping.updated) {
                return;
+       }
 
        float (*viewinv)[4] = DST.view_data.matstate.mat[DRW_MAT_VIEWINV];
        float (*projmat)[4] = DST.view_data.matstate.mat[DRW_MAT_WIN];
@@ -684,14 +685,16 @@ bool DRW_culling_sphere_test(BoundSphere *bsphere)
        draw_clipping_setup_from_view();
 
        /* Bypass test if radius is negative. */
-       if (bsphere->radius < 0.0f)
+       if (bsphere->radius < 0.0f) {
                return true;
+       }
 
        /* Do a rough test first: Sphere VS Sphere intersect. */
        BoundSphere *frustum_bsphere = &DST.clipping.frustum_bsphere;
        float center_dist = len_squared_v3v3(bsphere->center, frustum_bsphere->center);
-       if (center_dist > SQUARE(bsphere->radius + frustum_bsphere->radius))
+       if (center_dist > SQUARE(bsphere->radius + frustum_bsphere->radius)) {
                return false;
+       }
 
        /* Test against the 6 frustum planes. */
        for (int p = 0; p < 6; p++) {
@@ -1012,8 +1015,9 @@ static void release_texture_slots(bool with_persist)
        }
        else {
                for (int i = 0; i < GPU_max_textures(); ++i) {
-                       if (DST.RST.bound_tex_slots[i] != BIND_PERSIST)
+                       if (DST.RST.bound_tex_slots[i] != BIND_PERSIST) {
                                DST.RST.bound_tex_slots[i] = BIND_NONE;
+                       }
                }
        }
 
@@ -1029,8 +1033,9 @@ static void release_ubo_slots(bool with_persist)
        }
        else {
                for (int i = 0; i < GPU_max_ubo_binds(); ++i) {
-                       if (DST.RST.bound_ubo_slots[i] != BIND_PERSIST)
+                       if (DST.RST.bound_ubo_slots[i] != BIND_PERSIST) {
                                DST.RST.bound_ubo_slots[i] = BIND_NONE;
+                       }
                }
        }
 
@@ -1317,8 +1322,9 @@ static void drw_update_view(void)
 
 static void drw_draw_pass_ex(DRWPass *pass, DRWShadingGroup *start_group, DRWShadingGroup *end_group)
 {
-       if (start_group == NULL)
+       if (start_group == NULL) {
                return;
+       }
 
        DST.shader = NULL;
 
index ff0e77b0df1925bf6eeb98b33e73a77ccbf7b18b..f287f7b1018bdb0772bfda342f46db98fb5c04f7 100644 (file)
@@ -219,10 +219,12 @@ static void edit_text_cache_populate_select(void *vedata, Object *ob)
 
                float selboxw;
                if (i + 1 != ef->selboxes_len) {
-                       if (ef->selboxes[i + 1].y == sb->y)
+                       if (ef->selboxes[i + 1].y == sb->y) {
                                selboxw = ef->selboxes[i + 1].x - sb->x;
-                       else
+                       }
+                       else {
                                selboxw = sb->w;
+                       }
                }
                else {
                        selboxw = sb->w;
index bd8a112f710bb94dc57b60808bafeb6b356872b1..0757403ad01b13cd7354fbab35cf346ef861df2d 100644 (file)
@@ -542,12 +542,15 @@ static void OBJECT_engine_init(void *vedata)
                        grid_res = fabsf(tanf(fov)) / grid_scale;
 
                        e_data.grid_flag = (1 << 4); /* XY plane */
-                       if (show_axis_x)
+                       if (show_axis_x) {
                                e_data.grid_flag |= SHOW_AXIS_X;
-                       if (show_axis_y)
+                       }
+                       if (show_axis_y) {
                                e_data.grid_flag |= SHOW_AXIS_Y;
-                       if (show_floor)
+                       }
+                       if (show_floor) {
                                e_data.grid_flag |= SHOW_GRID;
+                       }
 
                }
                else {
@@ -925,8 +928,9 @@ static void DRW_shgroup_empty_image(
 {
        /* TODO: 'StereoViews', see draw_empty_image. */
 
-       if (!BKE_object_empty_image_is_visible_in_view3d(ob, rv3d))
+       if (!BKE_object_empty_image_is_visible_in_view3d(ob, rv3d)) {
                return;
+       }
 
        /* Calling 'BKE_image_get_size' may free the texture. Get the size from 'tex' instead, see: T59347 */
        int size[2] = {0};
index bcfa097b27712e024c3a1faa7fa08c5487d1ea51..e12c48453a7cc37d83d116637401c4dd88800a13 100644 (file)
@@ -69,13 +69,15 @@ void main(void)
        if (abs(fac0) > 1e-5 && abs(fac3) > 1e-5) {
                /* If both adjacent verts are facing the camera the same way,
                 * then it isn't an outline edge. */
-               if (sign(fac0) == sign(fac3))
+               if (sign(fac0) == sign(fac3)) {
                        return;
+               }
        }
 
        /* Don't outline if concave edge. */
-       if (dot(n0, v13) > 0.0001)
+       if (dot(n0, v13) > 0.0001) {
                return;
+       }
 
        vec2 thick = vColSize[0].w * (lineThickness / viewportSize);
        vec2 edge_dir = compute_dir(ssPos[1], ssPos[2]);
index bf253d0121cb271c601915d59d3e3dc5e3579c6f..24df1923a661c6b745a7b68a06ee7ca82f709550 100644 (file)
@@ -37,8 +37,9 @@ void main()
        int color_id = (vertFlag[1] >> 4);
 
        /* Don't output any edges if we don't show handles */
-       if (!showCurveHandles && (color_id < 5))
+       if (!showCurveHandles && (color_id < 5)) {
                return;
+       }
 
        bool edge_selected = (((vertFlag[1] | vertFlag[0]) & VERTEX_SELECTED) != 0);
 
index 71cc1ccde8d20c86c5bb8d37b80d7b5132d3bb13..a4c911c56e33e1504d2259288f2323d68a470904 100644 (file)
@@ -8,10 +8,12 @@ out vec4 FragColor;
 
 void main()
 {
-       if (isSelected != 0)
+       if (isSelected != 0) {
                FragColor = colorFaceDot;
-       else
+       }
+       else {
                FragColor = colorVertex;
+       }
 
 #ifdef VERTEX_FACING
        FragColor.a *= 1.0 - abs(facing) * 0.4;
index 95630fc2e0f542a7ac77ec1bf33285103db2feb6..bc46b3fe0f46c28fa15d948d22d3e61ea2a558d9 100644 (file)
@@ -18,14 +18,18 @@ void main()
 
        ivec4 data_m = data & dataMask;
 
-       if ((data_m.x & FACE_ACTIVE) != 0)
+       if ((data_m.x & FACE_ACTIVE) != 0) {
                faceColor = colorFaceSelect;
-       else if ((data_m.x & FACE_SELECTED) != 0)
+       }
+       else if ((data_m.x & FACE_SELECTED) != 0) {
                faceColor = colorFaceSelect;
-       else if ((data_m.x & FACE_FREESTYLE) != 0)
+       }
+       else if ((data_m.x & FACE_FREESTYLE) != 0) {
                faceColor = colorFaceFreestyle;
-       else
+       }
+       else {
                faceColor = colorFace;
+       }
 
 #ifdef USE_WORLD_CLIP_PLANES
        world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz);
index 0d5c76ad790d0af2e7d025e50232aee898c4b54e..c6cbd712d405352c31f9cd731c3b7170ab95fcc2 100644 (file)
@@ -148,5 +148,7 @@ void main()
 #endif
 
        /* don't write depth if not opaque */
-       if (FragColor.a == 0.0) discard;
+       if (FragColor.a == 0.0) {
+               discard;
+       }
 }
index 1c88f1ff95981be33bb540a1bf2c2cb896677d71..e4baa57ac8f918306635daa3f7e0521b23106bf9 100644 (file)
@@ -150,14 +150,18 @@ void main()
 
        /* Face */
        vec4 fcol;
-       if ((vData[0].x & FACE_ACTIVE) != 0)
+       if ((vData[0].x & FACE_ACTIVE) != 0) {
                fcol = colorFaceSelect;
-       else if ((vData[0].x & FACE_SELECTED) != 0)
+       }
+       else if ((vData[0].x & FACE_SELECTED) != 0) {
                fcol = colorFaceSelect;
-       else if ((vData[0].x & FACE_FREESTYLE) != 0)
+       }
+       else if ((vData[0].x & FACE_FREESTYLE) != 0) {
                fcol = colorFaceFreestyle;
-       else
+       }
+       else {
                fcol = colorFace;
+       }
 
        /* Vertex */
        ssPos[0] = proj(pPos[0]);
index 13431168fb0bc5cac95431a730de7ab2305a22d0..8b9bcb33fae217ab195f7a3612204c4db5430844 100644 (file)
@@ -82,14 +82,18 @@ void main()
        }
 
        /* Face */
-       if ((vData[0].x & FACE_ACTIVE) != 0)
+       if ((vData[0].x & FACE_ACTIVE) != 0) {
                faceColor = colorFaceSelect;
-       else if ((vData[0].x & FACE_SELECTED) != 0)
+       }
+       else if ((vData[0].x & FACE_SELECTED) != 0) {
                faceColor = colorFaceSelect;
-       else if ((vData[0].x & FACE_FREESTYLE) != 0)
+       }
+       else if ((vData[0].x & FACE_FREESTYLE) != 0) {
                faceColor = colorFaceFreestyle;
-       else
+       }
+       else {
                faceColor = colorFace;
+       }
 
 #  ifdef VERTEX_SELECTION
        vertexColor = EDIT_MESH_vertex_color(data0.x).rgb;
index 85da0f256544b74df6d5ba038fa26b75c8062d58..36999267ef29270f97dca10810584114521b1228 100644 (file)
@@ -33,8 +33,9 @@ void main()
 
        /* If both adjacent verts are facing the camera the same way,
         * then it isn't an outline edge. */
-       if (sign(fac0) == sign(fac3))
+       if (sign(fac0) == sign(fac3)) {
                return;
+       }
 
        /* Don't outline if concave edge. */
        /* That would hide a lot of non useful edge but it flickers badly.
index 54ae319307a0ae3b3e2111f12b5e9fb2ba80d24c..3df5115db761a94431aec6e8e2720ae2bbef224e 100644 (file)
@@ -39,12 +39,15 @@ void main()
        }
 
 #ifdef USE_AXIS
-       if (axis == 0)
+       if (axis == 0) {
                finalColor = vec4(1.0, 0.0, 0.0, 1.0);
-       else if (axis == 1)
+       }
+       else if (axis == 1) {
                finalColor = vec4(0.0, 1.0, 0.0, 1.0);
-       else
+       }
+       else {
                finalColor = vec4(0.0, 0.0, 1.0, 1.0);
+       }
 #else
        if (val < 0.0) {
                finalColor = vec4(color, 1.0);
index faa36f5535ecd7b7e356f51029be8c3cfb19b84d..7460eabedbefe07b53d511680196621bdedd164b 100644 (file)
@@ -18,15 +18,17 @@ float contours(float value, float steps, float width_px, float max_rel_width, fl
        /* Don't draw lines at 0 or 1. */
        float rel_value = value * steps;
 
-       if (rel_value < 0.5 || rel_value > steps - 0.5)
+       if (rel_value < 0.5 || rel_value > steps - 0.5) {
                return 0.0;
+       }
 
        /* Check if completely invisible due to fade out. */
        float rel_gradient = gradient * steps;
        float rel_min_width = min_width_px * rel_gradient;
 
-       if (max_rel_width <= rel_min_width)
+       if (max_rel_width <= rel_min_width) {
                return 0.0;
+       }
 
        /* Main shape of the line, accounting for width bias and maximum weight space width. */
        float rel_width = width_px * rel_gradient;
@@ -48,8 +50,9 @@ vec4 contour_grid(float weight, float weight_gradient)
        /* Fade away when the gradient is too low to avoid big fills and noise. */
        float flt_eps = max(1e-8, 1e-6 * weight);
 
-       if (weight_gradient <= flt_eps)
+       if (weight_gradient <= flt_eps) {
                return vec4(0.0);
+       }
 
        /* Three levels of grid lines */
        float grid10 = contours(weight, 10.0, 5.0, 0.3, weight_gradient);