diff options
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightprobes.c | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_armature.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_common.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_common.h | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 14 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_view.c | 10 | ||||
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 56 |
7 files changed, 47 insertions, 47 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index 7913689d299..6274aa8a6e8 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -125,7 +125,7 @@ static void planar_pool_ensure_alloc(EEVEE_Data *vedata, int num_planar_ref) /* TODO get screen percentage from layer setting */ // const DRWContextState *draw_ctx = DRW_context_state_get(); - // SceneLayer *sl = draw_ctx->sl; + // SceneLayer *scene_layer = draw_ctx->scene_layer; float screen_percentage = 1.0f; int width = (int)(viewport_size[0] * screen_percentage); diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c index e31fbeb054c..90a50110698 100644 --- a/source/blender/draw/intern/draw_armature.c +++ b/source/blender/draw/intern/draw_armature.c @@ -1413,11 +1413,11 @@ static void DRW_shgroup_armature( } void DRW_shgroup_armature_object( - Object *ob, SceneLayer *sl, DRWPass *pass_bone_solid, DRWPass *pass_bone_wire, DRWPass *UNUSED(pass_bone_envelope), + Object *ob, SceneLayer *scene_layer, DRWPass *pass_bone_solid, DRWPass *pass_bone_wire, DRWPass *UNUSED(pass_bone_envelope), DRWShadingGroup *shgrp_relationship_lines) { float *color; - DRW_object_wire_theme_get(ob, sl, &color); + DRW_object_wire_theme_get(ob, scene_layer, &color); DRW_shgroup_armature(ob, pass_bone_solid, pass_bone_wire, NULL, shgrp_relationship_lines); draw_armature_pose(ob, color); diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index 1050594318f..125edcbc5d2 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -360,10 +360,10 @@ DRWShadingGroup *shgroup_instance_bone_envelope_solid(DRWPass *pass, struct Gwn_ * Get the wire color theme_id of an object based on it's state * \a r_color is a way to get a pointer to the static color var associated */ -int DRW_object_wire_theme_get(Object *ob, SceneLayer *sl, float **r_color) +int DRW_object_wire_theme_get(Object *ob, SceneLayer *scene_layer, float **r_color) { const bool is_edit = (ob->mode & OB_MODE_EDIT) != 0; - const bool active = (sl->basact && sl->basact->object == ob); + const bool active = (scene_layer->basact && scene_layer->basact->object == ob); /* confusing logic here, there are 2 methods of setting the color * 'colortab[colindex]' and 'theme_id', colindex overrides theme_id. * diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h index a6c9b24af7d..41f5abfcb65 100644 --- a/source/blender/draw/intern/draw_common.h +++ b/source/blender/draw/intern/draw_common.h @@ -105,12 +105,12 @@ struct DRWShadingGroup *shgroup_spot_instance(struct DRWPass *pass, struct Gwn_B struct DRWShadingGroup *shgroup_instance_bone_envelope_wire(struct DRWPass *pass, struct Gwn_Batch *geom, float (*obmat)[4]); struct DRWShadingGroup *shgroup_instance_bone_envelope_solid(struct DRWPass *pass, struct Gwn_Batch *geom, float (*obmat)[4]); -int DRW_object_wire_theme_get(struct Object *ob, struct SceneLayer *sl, float **r_color); +int DRW_object_wire_theme_get(struct Object *ob, struct SceneLayer *scene_layer, float **r_color); float *DRW_color_background_blend_get(int theme_id); /* draw_armature.c */ void DRW_shgroup_armature_object( - struct Object *ob, struct SceneLayer *sl, + struct Object *ob, struct SceneLayer *scene_layer, struct DRWPass *pass_bone_solid, struct DRWPass *pass_bone_wire, struct DRWPass *pass_bone_envelope, struct DRWShadingGroup *shgrp_relationship_lines); diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 62f343a0679..5fc7b512826 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -3047,9 +3047,9 @@ static void DRW_engines_enable_external(void) use_drw_engine(DRW_engine_viewport_external_type.draw_engine); } -static void DRW_engines_enable(const Scene *scene, SceneLayer *sl, RenderEngineType *engine) +static void DRW_engines_enable(const Scene *scene, SceneLayer *scene_layer, RenderEngineType *engine) { - Object *obact = OBACT_NEW(sl); + Object *obact = OBACT_NEW(scene_layer); const int mode = CTX_data_mode_enum_ex(scene->obedit, obact); DRW_engines_enable_from_engine(engine); @@ -3451,9 +3451,9 @@ void DRW_draw_select_loop( { Scene *scene = DEG_get_evaluated_scene(graph); RenderEngineType *engine = RE_engines_find(scene->view_render.engine_id); - SceneLayer *sl = DEG_get_evaluated_scene_layer(graph); + SceneLayer *scene_layer = DEG_get_evaluated_scene_layer(graph); #ifndef USE_GPU_SELECT - UNUSED_VARS(vc, scene, sl, v3d, ar, rect); + UNUSED_VARS(vc, scene, scene_layer, v3d, ar, rect); #else RegionView3D *rv3d = ar->regiondata; @@ -3503,7 +3503,7 @@ void DRW_draw_select_loop( /* Instead of 'DRW_context_state_init(C, &DST.draw_ctx)', assign from args */ DST.draw_ctx = (DRWContextState){ - ar, rv3d, v3d, scene, sl, OBACT_NEW(sl), engine, (bContext *)NULL, + ar, rv3d, v3d, scene, scene_layer, OBACT_NEW(scene_layer), engine, (bContext *)NULL, }; DRW_viewport_var_init(); @@ -3570,7 +3570,7 @@ void DRW_draw_depth_loop( { Scene *scene = DEG_get_evaluated_scene(graph); RenderEngineType *engine = RE_engines_find(scene->view_render.engine_id); - SceneLayer *sl = DEG_get_evaluated_scene_layer(graph); + SceneLayer *scene_layer = DEG_get_evaluated_scene_layer(graph); RegionView3D *rv3d = ar->regiondata; /* backup (_never_ use rv3d->viewport) */ @@ -3600,7 +3600,7 @@ void DRW_draw_depth_loop( /* Instead of 'DRW_context_state_init(C, &DST.draw_ctx)', assign from args */ DST.draw_ctx = (DRWContextState){ - ar, rv3d, v3d, scene, sl, OBACT_NEW(sl), engine, (bContext *)NULL, + ar, rv3d, v3d, scene, scene_layer, OBACT_NEW(scene_layer), engine, (bContext *)NULL, }; DRW_viewport_var_init(); diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index ea1d93a6a85..02a07688f17 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -611,9 +611,9 @@ void DRW_draw_background(void) /* **************************** 3D Cursor ******************************** */ -static bool is_cursor_visible(Scene *scene, SceneLayer *sl) +static bool is_cursor_visible(Scene *scene, SceneLayer *scene_layer) { - Object *ob = OBACT_NEW(sl); + Object *ob = OBACT_NEW(scene_layer); /* don't draw cursor in paint modes, but with a few exceptions */ if (ob && ob->mode & OB_MODE_ALL_PAINT) { @@ -625,7 +625,7 @@ static bool is_cursor_visible(Scene *scene, SceneLayer *sl) } /* exception: object in texture paint mode, clone brush, use_clone_layer disabled */ else if (ob->mode & OB_MODE_TEXTURE_PAINT) { - const Paint *p = BKE_paint_get_active(scene, sl); + const Paint *p = BKE_paint_get_active(scene, scene_layer); if (p && p->brush && p->brush->imagepaint_tool == PAINT_TOOL_CLONE) { if ((scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_CLONE) == 0) { @@ -647,14 +647,14 @@ void DRW_draw_cursor(void) View3D *v3d = draw_ctx->v3d; RegionView3D *rv3d = draw_ctx->rv3d; Scene *scene = draw_ctx->scene; - SceneLayer *sl = draw_ctx->scene_layer; + SceneLayer *scene_layer = draw_ctx->scene_layer; glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glDepthMask(GL_FALSE); glDisable(GL_DEPTH_TEST); glLineWidth(1.0f); - if (is_cursor_visible(scene, sl)) { + if (is_cursor_visible(scene, scene_layer)) { float *co = ED_view3d_cursor3d_get(scene, v3d); unsigned char crosshair_color[3]; diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index ee2e8d6d236..d5a6db9abf8 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -1077,11 +1077,11 @@ static void OBJECT_cache_init(void *vedata) } } -static void DRW_shgroup_lamp(OBJECT_StorageList *stl, Object *ob, SceneLayer *sl) +static void DRW_shgroup_lamp(OBJECT_StorageList *stl, Object *ob, SceneLayer *scene_layer) { Lamp *la = ob->data; float *color; - int theme_id = DRW_object_wire_theme_get(ob, sl, &color); + int theme_id = DRW_object_wire_theme_get(ob, scene_layer, &color); static float zero = 0.0f; float **la_mats = (float **)DRW_object_engine_data_get(ob, &draw_engine_object_type, NULL); @@ -1182,7 +1182,7 @@ static void DRW_shgroup_lamp(OBJECT_StorageList *stl, Object *ob, SceneLayer *sl DRW_shgroup_call_dynamic_add(stl->g_data->lamp_groundpoint, ob->obmat[3]); } -static void DRW_shgroup_camera(OBJECT_StorageList *stl, Object *ob, SceneLayer *sl) +static void DRW_shgroup_camera(OBJECT_StorageList *stl, Object *ob, SceneLayer *scene_layer) { const DRWContextState *draw_ctx = DRW_context_state_get(); View3D *v3d = draw_ctx->v3d; @@ -1191,7 +1191,7 @@ static void DRW_shgroup_camera(OBJECT_StorageList *stl, Object *ob, SceneLayer * Camera *cam = ob->data; const bool is_active = (ob == v3d->camera); float *color; - DRW_object_wire_theme_get(ob, sl, &color); + DRW_object_wire_theme_get(ob, scene_layer, &color); float vec[4][3], asp[2], shift[2], scale[3], drawsize; @@ -1268,10 +1268,10 @@ static void DRW_shgroup_camera(OBJECT_StorageList *stl, Object *ob, SceneLayer * } } -static void DRW_shgroup_empty(OBJECT_StorageList *stl, OBJECT_PassList *psl, Object *ob, SceneLayer *sl) +static void DRW_shgroup_empty(OBJECT_StorageList *stl, OBJECT_PassList *psl, Object *ob, SceneLayer *scene_layer) { float *color; - DRW_object_wire_theme_get(ob, sl, &color); + DRW_object_wire_theme_get(ob, scene_layer, &color); switch (ob->empty_drawtype) { case OB_PLAINAXES: @@ -1303,9 +1303,9 @@ static void DRW_shgroup_empty(OBJECT_StorageList *stl, OBJECT_PassList *psl, Obj } } -static void DRW_shgroup_forcefield(OBJECT_StorageList *stl, Object *ob, SceneLayer *sl) +static void DRW_shgroup_forcefield(OBJECT_StorageList *stl, Object *ob, SceneLayer *scene_layer) { - int theme_id = DRW_object_wire_theme_get(ob, sl, NULL); + int theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); float *color = DRW_color_background_blend_get(theme_id); PartDeflect *pd = ob->pd; Curve *cu = (ob->type == OB_CURVE) ? ob->data : NULL; @@ -1402,11 +1402,11 @@ static void DRW_shgroup_forcefield(OBJECT_StorageList *stl, Object *ob, SceneLay } } -static void DRW_shgroup_speaker(OBJECT_StorageList *stl, Object *ob, SceneLayer *sl) +static void DRW_shgroup_speaker(OBJECT_StorageList *stl, Object *ob, SceneLayer *scene_layer) { float *color; static float one = 1.0f; - DRW_object_wire_theme_get(ob, sl, &color); + DRW_object_wire_theme_get(ob, scene_layer, &color); DRW_shgroup_call_dynamic_add(stl->g_data->speaker, color, &one, ob->obmat); } @@ -1421,13 +1421,13 @@ typedef struct OBJECT_LightProbeEngineData { float corner[3]; } OBJECT_LightProbeEngineData; -static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl, Object *ob, SceneLayer *sl) +static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl, Object *ob, SceneLayer *scene_layer) { float *color; static float one = 1.0f; LightProbe *prb = (LightProbe *)ob->data; bool do_outlines = ((ob->base_flag & BASE_SELECTED) != 0); - DRW_object_wire_theme_get(ob, sl, &color); + DRW_object_wire_theme_get(ob, scene_layer, &color); OBJECT_LightProbeEngineData *prb_data; OBJECT_LightProbeEngineData **prb_data_pt = (OBJECT_LightProbeEngineData **)DRW_object_engine_data_get(ob, &draw_engine_object_type, NULL); @@ -1628,12 +1628,12 @@ static void DRW_shgroup_relationship_lines(OBJECT_StorageList *stl, Object *ob) } } -static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob, SceneLayer *sl, View3D *v3d) +static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob, SceneLayer *scene_layer, View3D *v3d) { const bool is_library = ob->id.us > 1 || ID_IS_LINKED(ob); DRWShadingGroup *shgroup; - if (ob == OBACT_NEW(sl)) { + if (ob == OBACT_NEW(scene_layer)) { shgroup = stl->g_data->center_active; } else if (ob->base_flag & BASE_SELECTED) { @@ -1733,7 +1733,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) OBJECT_StorageList *stl = ((OBJECT_Data *)vedata)->stl; const DRWContextState *draw_ctx = DRW_context_state_get(); Scene *scene = draw_ctx->scene; - SceneLayer *sl = draw_ctx->scene_layer; + SceneLayer *scene_layer = draw_ctx->scene_layer; View3D *v3d = draw_ctx->v3d; int theme_id = TH_UNDEFINED; @@ -1751,7 +1751,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) if (ob != obedit && !((ob == draw_ctx->obact) && (ob->mode & OB_MODE_ALL_PAINT))) { struct Gwn_Batch *geom = DRW_cache_object_surface_get(ob); if (geom) { - theme_id = DRW_object_wire_theme_get(ob, sl, NULL); + theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); DRWShadingGroup *shgroup = shgroup_theme_id_to_outline_or(stl, theme_id, NULL); if (shgroup != NULL) { DRW_shgroup_call_add(shgroup, geom, ob->obmat); @@ -1770,7 +1770,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) struct Gwn_Batch *geom = DRW_cache_mesh_edges_get(ob); if (geom) { if (theme_id == TH_UNDEFINED) { - theme_id = DRW_object_wire_theme_get(ob, sl, NULL); + theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); } DRWShadingGroup *shgroup = shgroup_theme_id_to_wire_or(stl, theme_id, stl->g_data->wire); @@ -1790,7 +1790,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) if (ob != obedit) { struct Gwn_Batch *geom = DRW_cache_lattice_wire_get(ob, false); if (theme_id == TH_UNDEFINED) { - theme_id = DRW_object_wire_theme_get(ob, sl, NULL); + theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); } DRWShadingGroup *shgroup = shgroup_theme_id_to_wire_or(stl, theme_id, stl->g_data->wire); @@ -1805,7 +1805,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) if (ob != obedit) { struct Gwn_Batch *geom = DRW_cache_curve_edge_wire_get(ob); if (theme_id == TH_UNDEFINED) { - theme_id = DRW_object_wire_theme_get(ob, sl, NULL); + theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); } DRWShadingGroup *shgroup = shgroup_theme_id_to_wire_or(stl, theme_id, stl->g_data->wire); DRW_shgroup_call_add(shgroup, geom, ob->obmat); @@ -1813,19 +1813,19 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) break; } case OB_LAMP: - DRW_shgroup_lamp(stl, ob, sl); + DRW_shgroup_lamp(stl, ob, scene_layer); break; case OB_CAMERA: - DRW_shgroup_camera(stl, ob, sl); + DRW_shgroup_camera(stl, ob, scene_layer); break; case OB_EMPTY: - DRW_shgroup_empty(stl, psl, ob, sl); + DRW_shgroup_empty(stl, psl, ob, scene_layer); break; case OB_SPEAKER: - DRW_shgroup_speaker(stl, ob, sl); + DRW_shgroup_speaker(stl, ob, scene_layer); break; case OB_LIGHTPROBE: - DRW_shgroup_lightprobe(stl, psl, ob, sl); + DRW_shgroup_lightprobe(stl, psl, ob, scene_layer); break; case OB_ARMATURE: { @@ -1833,7 +1833,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) if (arm->edbo == NULL) { if (DRW_state_is_select() || !DRW_pose_mode_armature(ob, draw_ctx->obact)) { DRW_shgroup_armature_object( - ob, sl, psl->bone_solid, psl->bone_wire, psl->bone_envelope, + ob, scene_layer, psl->bone_solid, psl->bone_wire, psl->bone_envelope, stl->g_data->relationship_lines); } } @@ -1844,20 +1844,20 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) } if (ob->pd && ob->pd->forcefield) { - DRW_shgroup_forcefield(stl, ob, sl); + DRW_shgroup_forcefield(stl, ob, scene_layer); } /* don't show object extras in set's */ if ((ob->base_flag & (BASE_FROM_SET | BASE_FROMDUPLI)) == 0) { - DRW_shgroup_object_center(stl, ob, sl, v3d); + DRW_shgroup_object_center(stl, ob, scene_layer, v3d); DRW_shgroup_relationship_lines(stl, ob); if ((ob->dtx & OB_DRAWNAME) && DRW_state_show_text()) { struct DRWTextStore *dt = DRW_text_cache_ensure(); if (theme_id == TH_UNDEFINED) { - theme_id = DRW_object_wire_theme_get(ob, sl, NULL); + theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); } unsigned char color[4]; |