diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-10-07 07:57:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-10-07 07:57:14 +0300 |
commit | adfbf276a15346c38cc6b7652191c005b9a3ae9b (patch) | |
tree | 6f7d27e9adb8c15d3021c8276d6c577a0e5746ba /source/blender/editors/space_view3d | |
parent | 37b457221ec77b485b6e65537ac2db7fd8107e6d (diff) |
Cleanup: style, duplicate includes
Diffstat (limited to 'source/blender/editors/space_view3d')
5 files changed, 18 insertions, 20 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 11aa3476ee1..b4bd425b038 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -439,7 +439,7 @@ static void drawcube_size(float xsize, float ysize, float zsize) /* Elements */ GWN_indexbuf_init(&elb, GWN_PRIM_LINES, 12, 8); for (int i = 0; i < 12; ++i) { - GWN_indexbuf_add_line_verts(&elb, cube_wire[i*2], cube_wire[i*2+1]); + GWN_indexbuf_add_line_verts(&elb, cube_wire[i * 2], cube_wire[i * 2 + 1]); } GWN_indexbuf_build_in_place(&elb, &el); @@ -591,7 +591,7 @@ static void draw_bone_octahedral(void) /* Elements */ GWN_indexbuf_init(&elb, GWN_PRIM_LINES, 12, 6); for (int i = 0; i < 12; ++i) { - GWN_indexbuf_add_line_verts(&elb, bone_octahedral_wire[i*2], bone_octahedral_wire[i*2+1]); + GWN_indexbuf_add_line_verts(&elb, bone_octahedral_wire[i * 2], bone_octahedral_wire[i * 2 + 1]); } GWN_indexbuf_build_in_place(&elb, &el); @@ -938,7 +938,7 @@ static void draw_sphere_bone_wire(float smat[4][4], float imat[4][4], /* base */ if (armflag & ARM_EDITMODE) { - if (boneflag & BONE_SELECTED){ + if (boneflag & BONE_SELECTED) { UI_GetThemeColor4fv(TH_SELECT, fcolor); } else { @@ -1738,7 +1738,7 @@ static void imm_sphere_project(unsigned int pos, float ax, float az) static void draw_dof_ellipse(unsigned int pos, float ax, float az) { const int n = 16; - const int tri = n*n - 2*n + 1; /* Yay fancy math ! */ + const int tri = n * n - 2 * n + 1; /* Yay fancy math ! */ const float staticSine[16] = { 0.0f, 0.104528463268f, 0.207911690818f, 0.309016994375f, 0.406736643076f, 0.5f, 0.587785252292f, 0.669130606359f, @@ -1755,7 +1755,7 @@ static void draw_dof_ellipse(unsigned int pos, float ax, float az) immUniformColor4ub(70, 70, 70, 50); - immBegin(GWN_PRIM_TRIS, tri*3); + immBegin(GWN_PRIM_TRIS, tri * 3); pz = 0.0f; for (i = 1; i < n; i++) { z = staticSine[i]; @@ -2245,8 +2245,11 @@ static void draw_pose_bones( if (arm->flag & ARM_POSEMODE) { if (constflag & PCHAN_HAS_IK) { if (bone->flag & BONE_SELECTED) { - if (constflag & PCHAN_HAS_TARGET) rgba_float_args_set(fcolor, 200.f/255.f, 120.f/255.f, 0.f/255.f, 1.0f); - else rgba_float_args_set(fcolor, 200.f/255.f, 200.f/255.f, 50.f/255.f, 1.0f); /* add theme! */ + if (constflag & PCHAN_HAS_TARGET) { + rgba_float_args_set(fcolor, 200.f / 255.f, 120.f / 255.f, 0.f / 255.f, 1.0f); + } + /* add theme! */ + else rgba_float_args_set(fcolor, 200.f / 255.f, 200.f / 255.f, 50.f / 255.f, 1.0f); GPU_select_load_id(index & 0xFFFF); pchan_draw_IK_root_lines(pchan, !(do_dashed & DASH_HELP_LINES)); @@ -2254,8 +2257,9 @@ static void draw_pose_bones( } else if (constflag & PCHAN_HAS_SPLINEIK) { if (bone->flag & BONE_SELECTED) { - rgba_float_args_set(fcolor, 150.f/255.f, 200.f/255.f, 50.f/255.f, 1.0f); /* add theme! */ - + /* add theme! */ + rgba_float_args_set(fcolor, 150.f / 255.f, 200.f / 255.f, 50.f / 255.f, 1.0f); + GPU_select_load_id(index & 0xFFFF); pchan_draw_IK_root_lines(pchan, !(do_dashed & DASH_HELP_LINES)); } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index fa88d63ae1c..07d072f0156 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -823,7 +823,7 @@ static void drawcentercircle(View3D *v3d, RegionView3D *UNUSED(rv3d), const floa const float outlineWidth = 1.0f * U.pixelsize; const float size = U.obcenter_dia * U.pixelsize + outlineWidth; - if (v3d->zbuf) { + if (v3d->zbuf) { glDisable(GL_DEPTH_TEST); /* TODO(merwin): fit things like this into plates/buffers design */ } @@ -860,7 +860,7 @@ static void drawcentercircle(View3D *v3d, RegionView3D *UNUSED(rv3d), const floa GPU_disable_program_point_size(); glDisable(GL_BLEND); - if (v3d->zbuf) { + if (v3d->zbuf) { glEnable(GL_DEPTH_TEST); } } @@ -8760,7 +8760,7 @@ void draw_object( if ((dflag & DRAW_PICKING) == 0) { if ((dt == OB_BOUNDBOX) || ELEM(ob->type, OB_EMPTY, OB_LAMP, OB_CAMERA, OB_SPEAKER)) { goto afterdraw; - } + } } switch (ob->type) { diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index b01c8a7ac8a..ed4d7861d6d 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -64,13 +64,11 @@ #include "DRW_engine.h" -#include "ED_keyframing.h" #include "ED_armature.h" #include "ED_keyframing.h" #include "ED_gpencil.h" #include "ED_screen.h" #include "ED_transform.h" -#include "ED_gpencil.h" #include "DEG_depsgraph_query.h" diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c index b3b5beb54fe..d24c8241855 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -72,8 +72,6 @@ #include "DEG_depsgraph.h" -#include "RE_engine.h" - #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" #include "IMB_colormanagement.h" diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index d50133e406c..b54d1254293 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -3676,8 +3676,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) new_dist = rv3d->dist; /* convert the drawn rectangle into 3d space */ - if (depth_close != FLT_MAX && ED_view3d_unproject(ar, centx, centy, depth_close, p)) - { + if (depth_close != FLT_MAX && ED_view3d_unproject(ar, centx, centy, depth_close, p)) { negate_v3_v3(new_ofs, p); } else { @@ -4940,8 +4939,7 @@ bool ED_view3d_autodist( float centx = (float)mval[0] + 0.5f; float centy = (float)mval[1] + 0.5f; - if (ED_view3d_unproject(ar, centx, centy, depth_close, mouse_worldloc)) - { + if (ED_view3d_unproject(ar, centx, centy, depth_close, mouse_worldloc)) { return true; } } |