Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_edit_curve.cc
- This file was moved from source/blender/draw/engines/overlay/overlay_edit_curve.c.
| /* SPDX-License-Identifier: GPL-2.0-or-later | /* SPDX-License-Identifier: GPL-2.0-or-later | ||||
| * Copyright 2019 Blender Foundation. */ | * Copyright 2019 Blender Foundation. */ | ||||
| /** \file | /** \file | ||||
| * \ingroup draw_engine | * \ingroup draw_engine | ||||
| */ | */ | ||||
| #include "DRW_render.h" | #include "DRW_render.h" | ||||
| #include "DNA_curve_types.h" | #include "DNA_curve_types.h" | ||||
| #include "overlay_private.h" | #include "overlay_private.hh" | ||||
| void OVERLAY_edit_curve_cache_init(OVERLAY_Data *vedata) | void OVERLAY_edit_curve_cache_init(OVERLAY_Data *vedata) | ||||
| { | { | ||||
| OVERLAY_PassList *psl = vedata->psl; | OVERLAY_PassList *psl = vedata->psl; | ||||
| OVERLAY_PrivateData *pd = vedata->stl->pd; | OVERLAY_PrivateData *pd = vedata->stl->pd; | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| View3D *v3d = draw_ctx->v3d; | View3D *v3d = draw_ctx->v3d; | ||||
| DRWShadingGroup *grp; | DRWShadingGroup *grp; | ||||
| Show All 39 Lines | |||||
| } | } | ||||
| void OVERLAY_edit_curve_cache_populate(OVERLAY_Data *vedata, Object *ob) | void OVERLAY_edit_curve_cache_populate(OVERLAY_Data *vedata, Object *ob) | ||||
| { | { | ||||
| OVERLAY_PrivateData *pd = vedata->stl->pd; | OVERLAY_PrivateData *pd = vedata->stl->pd; | ||||
| bool draw_normals = (pd->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_NORMALS) != 0; | bool draw_normals = (pd->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_NORMALS) != 0; | ||||
| bool do_xray = (ob->dtx & OB_DRAW_IN_FRONT) != 0; | bool do_xray = (ob->dtx & OB_DRAW_IN_FRONT) != 0; | ||||
| Curve *cu = ob->data; | Curve *cu = static_cast<Curve *>(ob->data); | ||||
| struct GPUBatch *geom; | struct GPUBatch *geom; | ||||
| geom = DRW_cache_curve_edge_wire_get(ob); | geom = DRW_cache_curve_edge_wire_get(ob); | ||||
| if (geom) { | if (geom) { | ||||
| DRW_shgroup_call_no_cull(pd->edit_curve_wire_grp[do_xray], geom, ob); | DRW_shgroup_call_no_cull(pd->edit_curve_wire_grp[do_xray], geom, ob); | ||||
| } | } | ||||
| if ((cu->flag & CU_3D) && draw_normals) { | if ((cu->flag & CU_3D) && draw_normals) { | ||||
| ▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines | |||||