diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2018-08-12 14:52:49 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2018-08-12 14:52:49 +0300 |
commit | dc2d841b7c50565302af2986d62ddbd29c332acd (patch) | |
tree | 324f234e56fde77fb80dfdef0c7c21f01968f71b /source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c | |
parent | 27b28e437d974ebbafa234205941c07aa0ab546c (diff) | |
parent | 4b6fa4d897a0bb3252b16383492b526d2cef3920 (diff) |
Merge branch 'blender2.8' into hair_guideshair_guides
Diffstat (limited to 'source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c')
-rw-r--r-- | source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c index ff02517dafa..6443a6bf038 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c @@ -77,83 +77,83 @@ static void gizmo_primitive_draw_geom( } if (vert_count > 0) { - uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); - wm_gizmo_vec_draw(col_inner, verts, vert_count, pos, GWN_PRIM_TRI_FAN); - wm_gizmo_vec_draw(col_outer, verts, vert_count, pos, GWN_PRIM_LINE_LOOP); + wm_gizmo_vec_draw(col_inner, verts, vert_count, pos, GPU_PRIM_TRI_FAN); + wm_gizmo_vec_draw(col_outer, verts, vert_count, pos, GPU_PRIM_LINE_LOOP); immUnbindProgram(); } } static void gizmo_primitive_draw_intern( - wmGizmo *mpr, const bool UNUSED(select), + wmGizmo *gz, const bool UNUSED(select), const bool highlight) { float color_inner[4], color_outer[4]; float matrix_final[4][4]; - const int draw_style = RNA_enum_get(mpr->ptr, "draw_style"); + const int draw_style = RNA_enum_get(gz->ptr, "draw_style"); - gizmo_color_get(mpr, highlight, color_outer); + gizmo_color_get(gz, highlight, color_outer); copy_v4_v4(color_inner, color_outer); color_inner[3] *= 0.5f; - WM_gizmo_calc_matrix_final(mpr, matrix_final); + WM_gizmo_calc_matrix_final(gz, matrix_final); - gpuPushMatrix(); - gpuMultMatrix(matrix_final); + GPU_matrix_push(); + GPU_matrix_mul(matrix_final); GPU_blend(true); gizmo_primitive_draw_geom(color_inner, color_outer, draw_style); GPU_blend(false); - gpuPopMatrix(); + GPU_matrix_pop(); - if (mpr->interaction_data) { - GizmoInteraction *inter = mpr->interaction_data; + if (gz->interaction_data) { + GizmoInteraction *inter = gz->interaction_data; copy_v4_fl(color_inner, 0.5f); copy_v3_fl(color_outer, 0.5f); color_outer[3] = 0.8f; - gpuPushMatrix(); - gpuMultMatrix(inter->init_matrix_final); + GPU_matrix_push(); + GPU_matrix_mul(inter->init_matrix_final); GPU_blend(true); gizmo_primitive_draw_geom(color_inner, color_outer, draw_style); GPU_blend(false); - gpuPopMatrix(); + GPU_matrix_pop(); } } static void gizmo_primitive_draw_select( - const bContext *UNUSED(C), wmGizmo *mpr, + const bContext *UNUSED(C), wmGizmo *gz, int select_id) { GPU_select_load_id(select_id); - gizmo_primitive_draw_intern(mpr, true, false); + gizmo_primitive_draw_intern(gz, true, false); } -static void gizmo_primitive_draw(const bContext *UNUSED(C), wmGizmo *mpr) +static void gizmo_primitive_draw(const bContext *UNUSED(C), wmGizmo *gz) { gizmo_primitive_draw_intern( - mpr, false, - (mpr->state & WM_GIZMO_STATE_HIGHLIGHT)); + gz, false, + (gz->state & WM_GIZMO_STATE_HIGHLIGHT)); } -static void gizmo_primitive_setup(wmGizmo *mpr) +static void gizmo_primitive_setup(wmGizmo *gz) { - mpr->flag |= WM_GIZMO_DRAW_MODAL; + gz->flag |= WM_GIZMO_DRAW_MODAL; } static int gizmo_primitive_invoke( - bContext *UNUSED(C), wmGizmo *mpr, const wmEvent *UNUSED(event)) + bContext *UNUSED(C), wmGizmo *gz, const wmEvent *UNUSED(event)) { GizmoInteraction *inter = MEM_callocN(sizeof(GizmoInteraction), __func__); - WM_gizmo_calc_matrix_final(mpr, inter->init_matrix_final); + WM_gizmo_calc_matrix_final(gz, inter->init_matrix_final); - mpr->interaction_data = inter; + gz->interaction_data = inter; return OPERATOR_RUNNING_MODAL; } @@ -163,29 +163,29 @@ static int gizmo_primitive_invoke( * * \{ */ -static void GIZMO_WT_primitive_3d(wmGizmoType *wt) +static void GIZMO_GT_primitive_3d(wmGizmoType *gzt) { /* identifiers */ - wt->idname = "GIZMO_WT_primitive_3d"; + gzt->idname = "GIZMO_GT_primitive_3d"; /* api callbacks */ - wt->draw = gizmo_primitive_draw; - wt->draw_select = gizmo_primitive_draw_select; - wt->setup = gizmo_primitive_setup; - wt->invoke = gizmo_primitive_invoke; + gzt->draw = gizmo_primitive_draw; + gzt->draw_select = gizmo_primitive_draw_select; + gzt->setup = gizmo_primitive_setup; + gzt->invoke = gizmo_primitive_invoke; - wt->struct_size = sizeof(wmGizmo); + gzt->struct_size = sizeof(wmGizmo); static EnumPropertyItem rna_enum_draw_style[] = { {ED_GIZMO_PRIMITIVE_STYLE_PLANE, "PLANE", 0, "Plane", ""}, {0, NULL, 0, NULL, NULL} }; - RNA_def_enum(wt->srna, "draw_style", rna_enum_draw_style, ED_GIZMO_PRIMITIVE_STYLE_PLANE, "Draw Style", ""); + RNA_def_enum(gzt->srna, "draw_style", rna_enum_draw_style, ED_GIZMO_PRIMITIVE_STYLE_PLANE, "Draw Style", ""); } void ED_gizmotypes_primitive_3d(void) { - WM_gizmotype_append(GIZMO_WT_primitive_3d); + WM_gizmotype_append(GIZMO_GT_primitive_3d); } /** \} */ |