diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 09:24:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 09:24:14 +0300 |
commit | 41d4a1986548e66a652221e4a68c52900474eeff (patch) | |
tree | 26acf937ea0b762977f89adcc4e74a3ec9ecee62 /source/blender/draw/intern | |
parent | 108045faa01849115c54190ebed788faf36dcb56 (diff) |
ClangFormat: format '#if 0' code in source/
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r-- | source/blender/draw/intern/draw_cache.c | 112 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_mesh.c | 9 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 3 |
3 files changed, 67 insertions, 57 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 74c87162afd..7099f6ca573 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -161,9 +161,13 @@ static void UNUSED_FUNCTION(add_fancy_edge)(GPUVertBuf *vbo, } #if 0 /* UNUSED */ -static void add_lat_lon_vert( - GPUVertBuf *vbo, uint pos_id, uint nor_id, - uint *v_idx, const float rad, const float lat, const float lon) +static void add_lat_lon_vert(GPUVertBuf *vbo, + uint pos_id, + uint nor_id, + uint *v_idx, + const float rad, + const float lat, + const float lon) { float pos[3], nor[3]; nor[0] = sinf(lat) * cosf(lon); @@ -178,8 +182,10 @@ static void add_lat_lon_vert( static GPUVertBuf *fill_arrows_vbo(const float scale) { /* Position Only 3D format */ - static GPUVertFormat format = { 0 }; - static struct { uint pos; } attr_id; + static GPUVertFormat format = {0}; + static struct { + uint pos; + } attr_id; if (format.attr_len == 0) { attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); } @@ -2039,10 +2045,10 @@ static const float bone_octahedral_verts[6][3] = { static const float bone_octahedral_smooth_normals[6][3] = { {0.0f, -1.0f, 0.0f}, #if 0 /* creates problems for outlines when scaled */ - { 0.943608f * M_SQRT1_2, -0.331048f, 0.943608f * M_SQRT1_2}, - { 0.943608f * M_SQRT1_2, -0.331048f, -0.943608f * M_SQRT1_2}, - {-0.943608f * M_SQRT1_2, -0.331048f, -0.943608f * M_SQRT1_2}, - {-0.943608f * M_SQRT1_2, -0.331048f, 0.943608f * M_SQRT1_2}, + {0.943608f * M_SQRT1_2, -0.331048f, 0.943608f * M_SQRT1_2}, + {0.943608f * M_SQRT1_2, -0.331048f, -0.943608f * M_SQRT1_2}, + {-0.943608f * M_SQRT1_2, -0.331048f, -0.943608f * M_SQRT1_2}, + {-0.943608f * M_SQRT1_2, -0.331048f, 0.943608f * M_SQRT1_2}, #else {M_SQRT1_2, 0.0f, M_SQRT1_2}, {M_SQRT1_2, 0.0f, -M_SQRT1_2}, @@ -2055,17 +2061,13 @@ static const float bone_octahedral_smooth_normals[6][3] = { #if 0 /* UNUSED */ static const uint bone_octahedral_wire[24] = { - 0, 1, 1, 5, 5, 3, 3, 0, - 0, 4, 4, 5, 5, 2, 2, 0, - 1, 2, 2, 3, 3, 4, 4, 1, + 0, 1, 1, 5, 5, 3, 3, 0, 0, 4, 4, 5, 5, 2, 2, 0, 1, 2, 2, 3, 3, 4, 4, 1, }; /* aligned with bone_octahedral_wire * Contains adjacent normal index */ static const uint bone_octahedral_wire_adjacent_face[24] = { - 0, 3, 4, 7, 5, 6, 1, 2, - 2, 3, 6, 7, 4, 5, 0, 1, - 0, 4, 1, 5, 2, 6, 3, 7, + 0, 3, 4, 7, 5, 6, 1, 2, 2, 3, 6, 7, 4, 5, 0, 1, 0, 4, 1, 5, 2, 6, 3, 7, }; #endif @@ -2109,15 +2111,15 @@ static const uint bone_octahedral_wire_lines_adjacency[12][4] = { #if 0 /* UNUSED */ static const uint bone_octahedral_solid_tris_adjacency[8][6] = { - { 0, 12, 1, 10, 2, 3}, - { 3, 15, 4, 1, 5, 6}, - { 6, 18, 7, 4, 8, 9}, - { 9, 21, 10, 7, 11, 0}, - - {12, 22, 13, 2, 14, 17}, - {15, 13, 16, 5, 17, 20}, - {18, 16, 19, 8, 20, 23}, - {21, 19, 22, 11, 23, 14}, + {0, 12, 1, 10, 2, 3}, + {3, 15, 4, 1, 5, 6}, + {6, 18, 7, 4, 8, 9}, + {9, 21, 10, 7, 11, 0}, + + {12, 22, 13, 2, 14, 17}, + {15, 13, 16, 5, 17, 20}, + {18, 16, 19, 8, 20, 23}, + {21, 19, 22, 11, 23, 14}, }; #endif @@ -2219,17 +2221,13 @@ static const float bone_box_smooth_normals[8][3] = { #if 0 /* UNUSED */ static const uint bone_box_wire[24] = { - 0, 1, 1, 2, 2, 3, 3, 0, - 4, 5, 5, 6, 6, 7, 7, 4, - 0, 4, 1, 5, 2, 6, 3, 7, + 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7, }; /* aligned with bone_octahedral_wire * Contains adjacent normal index */ static const uint bone_box_wire_adjacent_face[24] = { - 0, 2, 0, 4, 1, 6, 1, 8, - 3, 10, 5, 10, 7, 11, 9, 11, - 3, 8, 2, 5, 4, 7, 6, 9, + 0, 2, 0, 4, 1, 6, 1, 8, 3, 10, 5, 10, 7, 11, 9, 11, 3, 8, 2, 5, 4, 7, 6, 9, }; #endif @@ -2274,23 +2272,23 @@ static const uint bone_box_wire_lines_adjacency[12][4] = { #if 0 /* UNUSED */ static const uint bone_box_solid_tris_adjacency[12][6] = { - { 0, 5, 1, 14, 2, 8}, - { 3, 26, 4, 20, 5, 1}, + {0, 5, 1, 14, 2, 8}, + {3, 26, 4, 20, 5, 1}, - { 6, 2, 7, 16, 8, 11}, - { 9, 7, 10, 32, 11, 24}, + {6, 2, 7, 16, 8, 11}, + {9, 7, 10, 32, 11, 24}, - {12, 0, 13, 22, 14, 17}, - {15, 13, 16, 30, 17, 6}, + {12, 0, 13, 22, 14, 17}, + {15, 13, 16, 30, 17, 6}, - {18, 3, 19, 28, 20, 23}, - {21, 19, 22, 33, 23, 12}, + {18, 3, 19, 28, 20, 23}, + {21, 19, 22, 33, 23, 12}, - {24, 4, 25, 10, 26, 29}, - {27, 25, 28, 34, 29, 18}, + {24, 4, 25, 10, 26, 29}, + {27, 25, 28, 34, 29, 18}, - {30, 9, 31, 15, 32, 35}, - {33, 31, 34, 21, 35, 27}, + {30, 9, 31, 15, 32, 35}, + {33, 31, 34, 21, 35, 27}, }; #endif @@ -2499,8 +2497,10 @@ GPUBatch *DRW_cache_bone_point_get(void) const float lat_inc = M_PI / lat_res; uint v_idx = 0; - static GPUVertFormat format = { 0 }; - static struct { uint pos, nor; } attr_id; + static GPUVertFormat format = {0}; + static struct { + uint pos, nor; + } attr_id; if (format.attr_len == 0) { attr_id.pos = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); attr_id.nor = GPU_vertformat_attr_add(&format, "nor", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); @@ -2515,15 +2515,17 @@ GPUBatch *DRW_cache_bone_point_get(void) float lat = 0.0f; for (int j = 0; j < lat_res; j++, lat += lat_inc) { if (j != lat_res - 1) { /* Pole */ - add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc); + add_lat_lon_vert( + vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc); add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon); - add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon); + add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon); } if (j != 0) { /* Pole */ - add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon + lon_inc); - add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc); - add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon); + add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon + lon_inc); + add_lat_lon_vert( + vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat + lat_inc, lon + lon_inc); + add_lat_lon_vert(vbo, attr_id.pos, attr_id.nor, &v_idx, rad, lat, lon); } } } @@ -2755,10 +2757,14 @@ static float z_axis_name[10][2] = { #define S_Y 0.007f static float axis_marker[8][2] = { #if 0 /* square */ - {-1.0f * S_X, 1.0f * S_Y}, { 1.0f * S_X, 1.0f * S_Y}, - { 1.0f * S_X, 1.0f * S_Y}, { 1.0f * S_X, -1.0f * S_Y}, - { 1.0f * S_X, -1.0f * S_Y}, {-1.0f * S_X, -1.0f * S_Y}, - {-1.0f * S_X, -1.0f * S_Y}, {-1.0f * S_X, 1.0f * S_Y} + {-1.0f * S_X, 1.0f * S_Y}, + {1.0f * S_X, 1.0f * S_Y}, + {1.0f * S_X, 1.0f * S_Y}, + {1.0f * S_X, -1.0f * S_Y}, + {1.0f * S_X, -1.0f * S_Y}, + {-1.0f * S_X, -1.0f * S_Y}, + {-1.0f * S_X, -1.0f * S_Y}, + {-1.0f * S_X, 1.0f * S_Y} #else /* diamond */ {-S_X, 0.f}, {0.f, S_Y}, diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index ded9d0963b7..73c68d0d6b9 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -3128,7 +3128,8 @@ static void mesh_create_loop_uv_and_tan(MeshRenderData *rdata, GPUVertBuf *vbo) for (uint i = 0; i < uv_len; i++) { const char *attr_name = mesh_render_data_uv_layer_uuid_get(rdata, i); #if 0 /* these are clamped. Maybe use them as an option in the future */ - uv_id[i] = GPU_vertformat_attr_add(&format, attr_name, GPU_COMP_I16, 2, GPU_FETCH_INT_TO_FLOAT_UNIT); + uv_id[i] = GPU_vertformat_attr_add( + &format, attr_name, GPU_COMP_I16, 2, GPU_FETCH_INT_TO_FLOAT_UNIT); #else uv_id[i] = GPU_vertformat_attr_add(&format, attr_name, GPU_COMP_F32, 2, GPU_FETCH_FLOAT); #endif @@ -4433,8 +4434,10 @@ BLI_INLINE void edit_uv_preprocess_stretch_angle(float (*auv)[2], } #if 0 /* here for reference, this is done in shader now. */ -BLI_INLINE float edit_uv_get_loop_stretch_angle( - const float auv0[2], const float auv1[2], const float av0[3], const float av1[3]) +BLI_INLINE float edit_uv_get_loop_stretch_angle(const float auv0[2], + const float auv1[2], + const float av0[3], + const float av1[3]) { float uvang = angle_normalized_v2v2(auv0, auv1); float ang = angle_normalized_v3v3(av0, av1); diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index db675ee0210..79c1d77bbf1 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -498,7 +498,8 @@ static void draw_clipping_setup_from_view(void) /* Extract Clipping Planes */ BoundBox bbox; #if 0 /* It has accuracy problems. */ - BKE_boundbox_init_from_minmax(&bbox, (const float[3]){-1.0f, -1.0f, -1.0f}, (const float[3]){1.0f, 1.0f, 1.0f}); + BKE_boundbox_init_from_minmax( + &bbox, (const float[3]){-1.0f, -1.0f, -1.0f}, (const float[3]){1.0f, 1.0f, 1.0f}); for (int i = 0; i < 8; i++) { mul_project_m4_v3(projinv, bbox.vec[i]); } |