diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-03-26 20:10:53 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-03-27 15:01:47 +0300 |
commit | e54d8eeab2eac9b98bb57a886eb334a812f6487a (patch) | |
tree | 01cc5675a4fd78d4fa7760cc0d7d05ed560185ca /source/blender/draw/modes | |
parent | 522ca1828177e8161f60f4693b523bbeeeb8cafa (diff) |
Draw Manager: Make Viewport Data passed by the manager call.
Diffstat (limited to 'source/blender/draw/modes')
-rw-r--r-- | source/blender/draw/modes/edit_armature_mode.c | 15 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_curve_mode.c | 37 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_lattice_mode.c | 37 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_mesh_mode.c | 21 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_metaball_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_surface_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_text_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 32 | ||||
-rw-r--r-- | source/blender/draw/modes/paint_texture_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/paint_vertex_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/paint_weight_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/particle_mode.c | 38 | ||||
-rw-r--r-- | source/blender/draw/modes/pose_mode.c | 38 | ||||
-rw-r--r-- | source/blender/draw/modes/sculpt_mode.c | 35 |
14 files changed, 213 insertions, 226 deletions
diff --git a/source/blender/draw/modes/edit_armature_mode.c b/source/blender/draw/modes/edit_armature_mode.c index c56bbe519da..a04ae608ce7 100644 --- a/source/blender/draw/modes/edit_armature_mode.c +++ b/source/blender/draw/modes/edit_armature_mode.c @@ -59,10 +59,10 @@ static struct { /* *********** FUNCTIONS *********** */ -static void EDIT_ARMATURE_cache_init(void) +static void EDIT_ARMATURE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditArmatureMode"); - EDIT_ARMATURE_PassList *psl = g_data.vedata->psl; + + EDIT_ARMATURE_PassList *psl = ((EDIT_ARMATURE_Data *)vedata)->psl; { /* Solid bones */ @@ -87,10 +87,10 @@ static void EDIT_ARMATURE_cache_init(void) } } -static void EDIT_ARMATURE_cache_populate(Object *ob) +static void EDIT_ARMATURE_cache_populate(void *vedata, Object *ob) { bArmature *arm = ob->data; - EDIT_ARMATURE_PassList *psl = g_data.vedata->psl; + EDIT_ARMATURE_PassList *psl = ((EDIT_ARMATURE_Data *)vedata)->psl; if (ob->type == OB_ARMATURE) { if (arm->edbo) { @@ -99,10 +99,9 @@ static void EDIT_ARMATURE_cache_populate(Object *ob) } } -static void EDIT_ARMATURE_draw_scene(void) +static void EDIT_ARMATURE_draw_scene(void *vedata) { - EDIT_ARMATURE_Data *ved = DRW_viewport_engine_data_get("EditArmatureMode"); - EDIT_ARMATURE_PassList *psl = ved->psl; + EDIT_ARMATURE_PassList *psl = ((EDIT_ARMATURE_Data *)vedata)->psl; DRW_draw_pass(psl->bone_solid); DRW_draw_pass(psl->bone_wire); diff --git a/source/blender/draw/modes/edit_curve_mode.c b/source/blender/draw/modes/edit_curve_mode.c index 745342a4f19..46030554fb6 100644 --- a/source/blender/draw/modes/edit_curve_mode.c +++ b/source/blender/draw/modes/edit_curve_mode.c @@ -115,12 +115,12 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void EDIT_CURVE_engine_init(void) +static void EDIT_CURVE_engine_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditCurveMode"); - EDIT_CURVE_TextureList *txl = g_data.vedata->txl; - EDIT_CURVE_FramebufferList *fbl = g_data.vedata->fbl; - EDIT_CURVE_StorageList *stl = g_data.vedata->stl; + + EDIT_CURVE_TextureList *txl = ((EDIT_CURVE_Data *)vedata)->txl; + EDIT_CURVE_FramebufferList *fbl = ((EDIT_CURVE_Data *)vedata)->fbl; + EDIT_CURVE_StorageList *stl = ((EDIT_CURVE_Data *)vedata)->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void EDIT_CURVE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void EDIT_CURVE_cache_init(void) +static void EDIT_CURVE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditCurveMode"); - EDIT_CURVE_PassList *psl = g_data.vedata->psl; - EDIT_CURVE_StorageList *stl = g_data.vedata->stl; + + EDIT_CURVE_PassList *psl = ((EDIT_CURVE_Data *)vedata)->psl; + EDIT_CURVE_StorageList *stl = ((EDIT_CURVE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void EDIT_CURVE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void EDIT_CURVE_cache_populate(Object *ob) +static void EDIT_CURVE_cache_populate(void *vedata, Object *ob) { - EDIT_CURVE_PassList *psl = g_data.vedata->psl; - EDIT_CURVE_StorageList *stl = g_data.vedata->stl; + EDIT_CURVE_PassList *psl = ((EDIT_CURVE_Data *)vedata)->psl; + EDIT_CURVE_StorageList *stl = ((EDIT_CURVE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void EDIT_CURVE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void EDIT_CURVE_cache_finish(void) +static void EDIT_CURVE_cache_finish(void *vedata) { - EDIT_CURVE_PassList *psl = g_data.vedata->psl; - EDIT_CURVE_StorageList *stl = g_data.vedata->stl; + EDIT_CURVE_PassList *psl = ((EDIT_CURVE_Data *)vedata)->psl; + EDIT_CURVE_StorageList *stl = ((EDIT_CURVE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void EDIT_CURVE_draw_scene(void) +static void EDIT_CURVE_draw_scene(void *vedata) { - EDIT_CURVE_Data *ved = DRW_viewport_engine_data_get("EditCurveMode"); - EDIT_CURVE_PassList *psl = ved->psl; - EDIT_CURVE_FramebufferList *fbl = ved->fbl; + EDIT_CURVE_PassList *psl = ((EDIT_CURVE_Data *)vedata)->psl; + EDIT_CURVE_FramebufferList *fbl = ((EDIT_CURVE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/edit_lattice_mode.c b/source/blender/draw/modes/edit_lattice_mode.c index 30603c2bfc3..32862ca444c 100644 --- a/source/blender/draw/modes/edit_lattice_mode.c +++ b/source/blender/draw/modes/edit_lattice_mode.c @@ -115,12 +115,12 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void EDIT_LATTICE_engine_init(void) +static void EDIT_LATTICE_engine_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditLatticeMode"); - EDIT_LATTICE_TextureList *txl = g_data.vedata->txl; - EDIT_LATTICE_FramebufferList *fbl = g_data.vedata->fbl; - EDIT_LATTICE_StorageList *stl = g_data.vedata->stl; + + EDIT_LATTICE_TextureList *txl = ((EDIT_LATTICE_Data *)vedata)->txl; + EDIT_LATTICE_FramebufferList *fbl = ((EDIT_LATTICE_Data *)vedata)->fbl; + EDIT_LATTICE_StorageList *stl = ((EDIT_LATTICE_Data *)vedata)->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void EDIT_LATTICE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void EDIT_LATTICE_cache_init(void) +static void EDIT_LATTICE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditLatticeMode"); - EDIT_LATTICE_PassList *psl = g_data.vedata->psl; - EDIT_LATTICE_StorageList *stl = g_data.vedata->stl; + + EDIT_LATTICE_PassList *psl = ((EDIT_LATTICE_Data *)vedata)->psl; + EDIT_LATTICE_StorageList *stl = ((EDIT_LATTICE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void EDIT_LATTICE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void EDIT_LATTICE_cache_populate(Object *ob) +static void EDIT_LATTICE_cache_populate(void *vedata, Object *ob) { - EDIT_LATTICE_PassList *psl = g_data.vedata->psl; - EDIT_LATTICE_StorageList *stl = g_data.vedata->stl; + EDIT_LATTICE_PassList *psl = ((EDIT_LATTICE_Data *)vedata)->psl; + EDIT_LATTICE_StorageList *stl = ((EDIT_LATTICE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void EDIT_LATTICE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void EDIT_LATTICE_cache_finish(void) +static void EDIT_LATTICE_cache_finish(void *vedata) { - EDIT_LATTICE_PassList *psl = g_data.vedata->psl; - EDIT_LATTICE_StorageList *stl = g_data.vedata->stl; + EDIT_LATTICE_PassList *psl = ((EDIT_LATTICE_Data *)vedata)->psl; + EDIT_LATTICE_StorageList *stl = ((EDIT_LATTICE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void EDIT_LATTICE_draw_scene(void) +static void EDIT_LATTICE_draw_scene(void *vedata) { - EDIT_LATTICE_Data *ved = DRW_viewport_engine_data_get("EditLatticeMode"); - EDIT_LATTICE_PassList *psl = ved->psl; - EDIT_LATTICE_FramebufferList *fbl = ved->fbl; + EDIT_LATTICE_PassList *psl = ((EDIT_LATTICE_Data *)vedata)->psl; + EDIT_LATTICE_FramebufferList *fbl = ((EDIT_LATTICE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c index 45d32d70bbc..b17d6288d05 100644 --- a/source/blender/draw/modes/edit_mesh_mode.c +++ b/source/blender/draw/modes/edit_mesh_mode.c @@ -124,11 +124,11 @@ static struct { /* *********** FUNCTIONS *********** */ -static void EDIT_MESH_engine_init(void) +static void EDIT_MESH_engine_init(void *vedata) { EDIT_MESH_Data *ved = DRW_viewport_engine_data_get("EditMeshMode"); EDIT_MESH_TextureList *txl = ved->txl; - EDIT_MESH_FramebufferList *fbl = ved->fbl; + EDIT_MESH_FramebufferList *fbl = ((EDIT_MESH_Data *)vedata)->fbl; float *viewport_size = DRW_viewport_size_get(); @@ -261,11 +261,11 @@ static float backwire_opacity; static float face_mod; static float size_normal; -static void EDIT_MESH_cache_init(void) +static void EDIT_MESH_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditMeshMode"); - EDIT_MESH_TextureList *txl = g_data.vedata->txl; - EDIT_MESH_PassList *psl = g_data.vedata->psl; + + EDIT_MESH_TextureList *txl = ((EDIT_MESH_Data *)vedata)->txl; + EDIT_MESH_PassList *psl = ((EDIT_MESH_Data *)vedata)->psl; DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); const struct bContext *C = DRW_get_context(); @@ -348,7 +348,7 @@ static void edit_mesh_add_ob_to_pass(Scene *scene, Object *ob, DRWShadingGroup * } } -static void EDIT_MESH_cache_populate(Object *ob) +static void EDIT_MESH_cache_populate(void *UNUSED(vedata), Object *ob) { const struct bContext *C = DRW_get_context(); View3D *v3d = CTX_wm_view3d(C); @@ -401,11 +401,10 @@ static void EDIT_MESH_cache_populate(Object *ob) } } -static void EDIT_MESH_draw_scene(void) +static void EDIT_MESH_draw_scene(void *vedata) { - EDIT_MESH_Data *ved = DRW_viewport_engine_data_get("EditMeshMode"); - EDIT_MESH_PassList *psl = ved->psl; - EDIT_MESH_FramebufferList *fbl = ved->fbl; + EDIT_MESH_PassList *psl = ((EDIT_MESH_Data *)vedata)->psl; + EDIT_MESH_FramebufferList *fbl = ((EDIT_MESH_Data *)vedata)->fbl; DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); diff --git a/source/blender/draw/modes/edit_metaball_mode.c b/source/blender/draw/modes/edit_metaball_mode.c index 6f3e11be4a7..5f0ca3f1566 100644 --- a/source/blender/draw/modes/edit_metaball_mode.c +++ b/source/blender/draw/modes/edit_metaball_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void EDIT_METABALL_engine_init(void) +static void EDIT_METABALL_engine_init(void *vedata) { EDIT_METABALL_Data *ved = DRW_viewport_engine_data_get("EditMetaballMode"); EDIT_METABALL_TextureList *txl = ved->txl; - EDIT_METABALL_FramebufferList *fbl = ved->fbl; + EDIT_METABALL_FramebufferList *fbl = ((EDIT_METABALL_Data *)vedata)->fbl; EDIT_METABALL_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void EDIT_METABALL_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void EDIT_METABALL_cache_init(void) +static void EDIT_METABALL_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditMetaballMode"); - EDIT_METABALL_PassList *psl = g_data.vedata->psl; - EDIT_METABALL_StorageList *stl = g_data.vedata->stl; + + EDIT_METABALL_PassList *psl = ((EDIT_METABALL_Data *)vedata)->psl; + EDIT_METABALL_StorageList *stl = ((EDIT_METABALL_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void EDIT_METABALL_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void EDIT_METABALL_cache_populate(Object *ob) +static void EDIT_METABALL_cache_populate(void *vedata, Object *ob) { - EDIT_METABALL_PassList *psl = g_data.vedata->psl; - EDIT_METABALL_StorageList *stl = g_data.vedata->stl; + EDIT_METABALL_PassList *psl = ((EDIT_METABALL_Data *)vedata)->psl; + EDIT_METABALL_StorageList *stl = ((EDIT_METABALL_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void EDIT_METABALL_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void EDIT_METABALL_cache_finish(void) +static void EDIT_METABALL_cache_finish(void *vedata) { - EDIT_METABALL_PassList *psl = g_data.vedata->psl; - EDIT_METABALL_StorageList *stl = g_data.vedata->stl; + EDIT_METABALL_PassList *psl = ((EDIT_METABALL_Data *)vedata)->psl; + EDIT_METABALL_StorageList *stl = ((EDIT_METABALL_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void EDIT_METABALL_draw_scene(void) +static void EDIT_METABALL_draw_scene(void *vedata) { - EDIT_METABALL_Data *ved = DRW_viewport_engine_data_get("EditMetaballMode"); - EDIT_METABALL_PassList *psl = ved->psl; - EDIT_METABALL_FramebufferList *fbl = ved->fbl; + EDIT_METABALL_PassList *psl = ((EDIT_METABALL_Data *)vedata)->psl; + EDIT_METABALL_FramebufferList *fbl = ((EDIT_METABALL_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/edit_surface_mode.c b/source/blender/draw/modes/edit_surface_mode.c index 286ba7f9818..b5e0d09fb23 100644 --- a/source/blender/draw/modes/edit_surface_mode.c +++ b/source/blender/draw/modes/edit_surface_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void EDIT_SURFACE_engine_init(void) +static void EDIT_SURFACE_engine_init(void *vedata) { EDIT_SURFACE_Data *ved = DRW_viewport_engine_data_get("EditSurfaceMode"); EDIT_SURFACE_TextureList *txl = ved->txl; - EDIT_SURFACE_FramebufferList *fbl = ved->fbl; + EDIT_SURFACE_FramebufferList *fbl = ((EDIT_SURFACE_Data *)vedata)->fbl; EDIT_SURFACE_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void EDIT_SURFACE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void EDIT_SURFACE_cache_init(void) +static void EDIT_SURFACE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditSurfaceMode"); - EDIT_SURFACE_PassList *psl = g_data.vedata->psl; - EDIT_SURFACE_StorageList *stl = g_data.vedata->stl; + + EDIT_SURFACE_PassList *psl = ((EDIT_SURFACE_Data *)vedata)->psl; + EDIT_SURFACE_StorageList *stl = ((EDIT_SURFACE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void EDIT_SURFACE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void EDIT_SURFACE_cache_populate(Object *ob) +static void EDIT_SURFACE_cache_populate(void *vedata, Object *ob) { - EDIT_SURFACE_PassList *psl = g_data.vedata->psl; - EDIT_SURFACE_StorageList *stl = g_data.vedata->stl; + EDIT_SURFACE_PassList *psl = ((EDIT_SURFACE_Data *)vedata)->psl; + EDIT_SURFACE_StorageList *stl = ((EDIT_SURFACE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void EDIT_SURFACE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void EDIT_SURFACE_cache_finish(void) +static void EDIT_SURFACE_cache_finish(void *vedata) { - EDIT_SURFACE_PassList *psl = g_data.vedata->psl; - EDIT_SURFACE_StorageList *stl = g_data.vedata->stl; + EDIT_SURFACE_PassList *psl = ((EDIT_SURFACE_Data *)vedata)->psl; + EDIT_SURFACE_StorageList *stl = ((EDIT_SURFACE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void EDIT_SURFACE_draw_scene(void) +static void EDIT_SURFACE_draw_scene(void *vedata) { - EDIT_SURFACE_Data *ved = DRW_viewport_engine_data_get("EditSurfaceMode"); - EDIT_SURFACE_PassList *psl = ved->psl; - EDIT_SURFACE_FramebufferList *fbl = ved->fbl; + EDIT_SURFACE_PassList *psl = ((EDIT_SURFACE_Data *)vedata)->psl; + EDIT_SURFACE_FramebufferList *fbl = ((EDIT_SURFACE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/edit_text_mode.c b/source/blender/draw/modes/edit_text_mode.c index dfe91daea9f..46ab36efbb5 100644 --- a/source/blender/draw/modes/edit_text_mode.c +++ b/source/blender/draw/modes/edit_text_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void EDIT_TEXT_engine_init(void) +static void EDIT_TEXT_engine_init(void *vedata) { EDIT_TEXT_Data *ved = DRW_viewport_engine_data_get("EditTextMode"); EDIT_TEXT_TextureList *txl = ved->txl; - EDIT_TEXT_FramebufferList *fbl = ved->fbl; + EDIT_TEXT_FramebufferList *fbl = ((EDIT_TEXT_Data *)vedata)->fbl; EDIT_TEXT_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void EDIT_TEXT_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void EDIT_TEXT_cache_init(void) +static void EDIT_TEXT_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditTextMode"); - EDIT_TEXT_PassList *psl = g_data.vedata->psl; - EDIT_TEXT_StorageList *stl = g_data.vedata->stl; + + EDIT_TEXT_PassList *psl = ((EDIT_TEXT_Data *)vedata)->psl; + EDIT_TEXT_StorageList *stl = ((EDIT_TEXT_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void EDIT_TEXT_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void EDIT_TEXT_cache_populate(Object *ob) +static void EDIT_TEXT_cache_populate(void *vedata, Object *ob) { - EDIT_TEXT_PassList *psl = g_data.vedata->psl; - EDIT_TEXT_StorageList *stl = g_data.vedata->stl; + EDIT_TEXT_PassList *psl = ((EDIT_TEXT_Data *)vedata)->psl; + EDIT_TEXT_StorageList *stl = ((EDIT_TEXT_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void EDIT_TEXT_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void EDIT_TEXT_cache_finish(void) +static void EDIT_TEXT_cache_finish(void *vedata) { - EDIT_TEXT_PassList *psl = g_data.vedata->psl; - EDIT_TEXT_StorageList *stl = g_data.vedata->stl; + EDIT_TEXT_PassList *psl = ((EDIT_TEXT_Data *)vedata)->psl; + EDIT_TEXT_StorageList *stl = ((EDIT_TEXT_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void EDIT_TEXT_draw_scene(void) +static void EDIT_TEXT_draw_scene(void *vedata) { - EDIT_TEXT_Data *ved = DRW_viewport_engine_data_get("EditTextMode"); - EDIT_TEXT_PassList *psl = ved->psl; - EDIT_TEXT_FramebufferList *fbl = ved->fbl; + EDIT_TEXT_PassList *psl = ((EDIT_TEXT_Data *)vedata)->psl; + EDIT_TEXT_FramebufferList *fbl = ((EDIT_TEXT_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index b7bb489ca2b..706f73005d5 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -185,11 +185,11 @@ enum { /* *********** FUNCTIONS *********** */ -static void OBJECT_engine_init(void) +static void OBJECT_engine_init(void *vedata) { - OBJECT_Data *ved = DRW_viewport_engine_data_get("ObjectMode"); - OBJECT_TextureList *txl = ved->txl; - OBJECT_FramebufferList *fbl = ved->fbl; + + OBJECT_TextureList *txl = ((OBJECT_Data *)vedata)->txl; + OBJECT_FramebufferList *fbl = ((OBJECT_Data *)vedata)->fbl; float *viewport_size = DRW_viewport_size_get(); @@ -374,12 +374,12 @@ static DRWShadingGroup *shgroup_outline(DRWPass *pass, const float col[4], struc return grp; } -static void OBJECT_cache_init(void) +static void OBJECT_cache_init(void *vedata) { /* DRW_viewport_engine_data_get is rather slow, better not do it on every objects */ - g_data.vedata = DRW_viewport_engine_data_get("ObjectMode"); - OBJECT_PassList *psl = g_data.vedata->psl; - OBJECT_TextureList *txl = g_data.vedata->txl; + + OBJECT_PassList *psl = ((OBJECT_Data *)vedata)->psl; + OBJECT_TextureList *txl = ((OBJECT_Data *)vedata)->txl; DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); { @@ -897,7 +897,7 @@ static void DRW_shgroup_object_center(Object *ob) } } -static void OBJECT_cache_populate(Object *ob) +static void OBJECT_cache_populate(void *vedata, Object *ob) { const struct bContext *C = DRW_get_context(); Scene *scene = CTX_data_scene(C); @@ -950,8 +950,8 @@ static void OBJECT_cache_populate(Object *ob) { bArmature *arm = ob->data; if (arm->edbo == NULL) { - DRW_shgroup_armature_object(ob, sl, g_data.vedata->psl->bone_solid, - g_data.vedata->psl->bone_wire, + DRW_shgroup_armature_object(ob, sl, ((OBJECT_Data *)vedata)->psl->bone_solid, + ((OBJECT_Data *)vedata)->psl->bone_wire, g_data.relationship_lines); } } @@ -964,12 +964,12 @@ static void OBJECT_cache_populate(Object *ob) DRW_shgroup_relationship_lines(ob); } -static void OBJECT_draw_scene(void) +static void OBJECT_draw_scene(void *vedata) { - OBJECT_Data *ved = DRW_viewport_engine_data_get("ObjectMode"); - OBJECT_PassList *psl = ved->psl; - OBJECT_FramebufferList *fbl = ved->fbl; - OBJECT_TextureList *txl = ved->txl; + + OBJECT_PassList *psl = ((OBJECT_Data *)vedata)->psl; + OBJECT_FramebufferList *fbl = ((OBJECT_Data *)vedata)->fbl; + OBJECT_TextureList *txl = ((OBJECT_Data *)vedata)->txl; DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); float clearcol[4] = {0.0f, 0.0f, 0.0f, 0.0f}; diff --git a/source/blender/draw/modes/paint_texture_mode.c b/source/blender/draw/modes/paint_texture_mode.c index 3ec60e93a1b..f1617a29133 100644 --- a/source/blender/draw/modes/paint_texture_mode.c +++ b/source/blender/draw/modes/paint_texture_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void PAINT_TEXTURE_engine_init(void) +static void PAINT_TEXTURE_engine_init(void *vedata) { PAINT_TEXTURE_Data *ved = DRW_viewport_engine_data_get("PaintTextureMode"); PAINT_TEXTURE_TextureList *txl = ved->txl; - PAINT_TEXTURE_FramebufferList *fbl = ved->fbl; + PAINT_TEXTURE_FramebufferList *fbl = ((PAINT_TEXTURE_Data *)vedata)->fbl; PAINT_TEXTURE_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void PAINT_TEXTURE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void PAINT_TEXTURE_cache_init(void) +static void PAINT_TEXTURE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("PaintTextureMode"); - PAINT_TEXTURE_PassList *psl = g_data.vedata->psl; - PAINT_TEXTURE_StorageList *stl = g_data.vedata->stl; + + PAINT_TEXTURE_PassList *psl = ((PAINT_TEXTURE_Data *)vedata)->psl; + PAINT_TEXTURE_StorageList *stl = ((PAINT_TEXTURE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void PAINT_TEXTURE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void PAINT_TEXTURE_cache_populate(Object *ob) +static void PAINT_TEXTURE_cache_populate(void *vedata, Object *ob) { - PAINT_TEXTURE_PassList *psl = g_data.vedata->psl; - PAINT_TEXTURE_StorageList *stl = g_data.vedata->stl; + PAINT_TEXTURE_PassList *psl = ((PAINT_TEXTURE_Data *)vedata)->psl; + PAINT_TEXTURE_StorageList *stl = ((PAINT_TEXTURE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void PAINT_TEXTURE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void PAINT_TEXTURE_cache_finish(void) +static void PAINT_TEXTURE_cache_finish(void *vedata) { - PAINT_TEXTURE_PassList *psl = g_data.vedata->psl; - PAINT_TEXTURE_StorageList *stl = g_data.vedata->stl; + PAINT_TEXTURE_PassList *psl = ((PAINT_TEXTURE_Data *)vedata)->psl; + PAINT_TEXTURE_StorageList *stl = ((PAINT_TEXTURE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void PAINT_TEXTURE_draw_scene(void) +static void PAINT_TEXTURE_draw_scene(void *vedata) { - PAINT_TEXTURE_Data *ved = DRW_viewport_engine_data_get("PaintTextureMode"); - PAINT_TEXTURE_PassList *psl = ved->psl; - PAINT_TEXTURE_FramebufferList *fbl = ved->fbl; + PAINT_TEXTURE_PassList *psl = ((PAINT_TEXTURE_Data *)vedata)->psl; + PAINT_TEXTURE_FramebufferList *fbl = ((PAINT_TEXTURE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/paint_vertex_mode.c b/source/blender/draw/modes/paint_vertex_mode.c index bac81c9b81c..0d8ccff23aa 100644 --- a/source/blender/draw/modes/paint_vertex_mode.c +++ b/source/blender/draw/modes/paint_vertex_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void PAINT_VERTEX_engine_init(void) +static void PAINT_VERTEX_engine_init(void *vedata) { PAINT_VERTEX_Data *ved = DRW_viewport_engine_data_get("PaintVertexMode"); PAINT_VERTEX_TextureList *txl = ved->txl; - PAINT_VERTEX_FramebufferList *fbl = ved->fbl; + PAINT_VERTEX_FramebufferList *fbl = ((PAINT_VERTEX_Data *)vedata)->fbl; PAINT_VERTEX_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void PAINT_VERTEX_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void PAINT_VERTEX_cache_init(void) +static void PAINT_VERTEX_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("PaintVertexMode"); - PAINT_VERTEX_PassList *psl = g_data.vedata->psl; - PAINT_VERTEX_StorageList *stl = g_data.vedata->stl; + + PAINT_VERTEX_PassList *psl = ((PAINT_VERTEX_Data *)vedata)->psl; + PAINT_VERTEX_StorageList *stl = ((PAINT_VERTEX_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void PAINT_VERTEX_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void PAINT_VERTEX_cache_populate(Object *ob) +static void PAINT_VERTEX_cache_populate(void *vedata, Object *ob) { - PAINT_VERTEX_PassList *psl = g_data.vedata->psl; - PAINT_VERTEX_StorageList *stl = g_data.vedata->stl; + PAINT_VERTEX_PassList *psl = ((PAINT_VERTEX_Data *)vedata)->psl; + PAINT_VERTEX_StorageList *stl = ((PAINT_VERTEX_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void PAINT_VERTEX_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void PAINT_VERTEX_cache_finish(void) +static void PAINT_VERTEX_cache_finish(void *vedata) { - PAINT_VERTEX_PassList *psl = g_data.vedata->psl; - PAINT_VERTEX_StorageList *stl = g_data.vedata->stl; + PAINT_VERTEX_PassList *psl = ((PAINT_VERTEX_Data *)vedata)->psl; + PAINT_VERTEX_StorageList *stl = ((PAINT_VERTEX_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void PAINT_VERTEX_draw_scene(void) +static void PAINT_VERTEX_draw_scene(void *vedata) { - PAINT_VERTEX_Data *ved = DRW_viewport_engine_data_get("PaintVertexMode"); - PAINT_VERTEX_PassList *psl = ved->psl; - PAINT_VERTEX_FramebufferList *fbl = ved->fbl; + PAINT_VERTEX_PassList *psl = ((PAINT_VERTEX_Data *)vedata)->psl; + PAINT_VERTEX_FramebufferList *fbl = ((PAINT_VERTEX_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/paint_weight_mode.c b/source/blender/draw/modes/paint_weight_mode.c index 06f73436760..00a034a87c0 100644 --- a/source/blender/draw/modes/paint_weight_mode.c +++ b/source/blender/draw/modes/paint_weight_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void PAINT_WEIGHT_engine_init(void) +static void PAINT_WEIGHT_engine_init(void *vedata) { PAINT_WEIGHT_Data *ved = DRW_viewport_engine_data_get("PaintWeightMode"); PAINT_WEIGHT_TextureList *txl = ved->txl; - PAINT_WEIGHT_FramebufferList *fbl = ved->fbl; + PAINT_WEIGHT_FramebufferList *fbl = ((PAINT_WEIGHT_Data *)vedata)->fbl; PAINT_WEIGHT_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void PAINT_WEIGHT_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void PAINT_WEIGHT_cache_init(void) +static void PAINT_WEIGHT_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("PaintWeightMode"); - PAINT_WEIGHT_PassList *psl = g_data.vedata->psl; - PAINT_WEIGHT_StorageList *stl = g_data.vedata->stl; + + PAINT_WEIGHT_PassList *psl = ((PAINT_WEIGHT_Data *)vedata)->psl; + PAINT_WEIGHT_StorageList *stl = ((PAINT_WEIGHT_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void PAINT_WEIGHT_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void PAINT_WEIGHT_cache_populate(Object *ob) +static void PAINT_WEIGHT_cache_populate(void *vedata, Object *ob) { - PAINT_WEIGHT_PassList *psl = g_data.vedata->psl; - PAINT_WEIGHT_StorageList *stl = g_data.vedata->stl; + PAINT_WEIGHT_PassList *psl = ((PAINT_WEIGHT_Data *)vedata)->psl; + PAINT_WEIGHT_StorageList *stl = ((PAINT_WEIGHT_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void PAINT_WEIGHT_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void PAINT_WEIGHT_cache_finish(void) +static void PAINT_WEIGHT_cache_finish(void *vedata) { - PAINT_WEIGHT_PassList *psl = g_data.vedata->psl; - PAINT_WEIGHT_StorageList *stl = g_data.vedata->stl; + PAINT_WEIGHT_PassList *psl = ((PAINT_WEIGHT_Data *)vedata)->psl; + PAINT_WEIGHT_StorageList *stl = ((PAINT_WEIGHT_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void PAINT_WEIGHT_draw_scene(void) +static void PAINT_WEIGHT_draw_scene(void *vedata) { - PAINT_WEIGHT_Data *ved = DRW_viewport_engine_data_get("PaintWeightMode"); - PAINT_WEIGHT_PassList *psl = ved->psl; - PAINT_WEIGHT_FramebufferList *fbl = ved->fbl; + PAINT_WEIGHT_PassList *psl = ((PAINT_WEIGHT_Data *)vedata)->psl; + PAINT_WEIGHT_FramebufferList *fbl = ((PAINT_WEIGHT_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/particle_mode.c b/source/blender/draw/modes/particle_mode.c index 393268f81c2..b2d9d39281b 100644 --- a/source/blender/draw/modes/particle_mode.c +++ b/source/blender/draw/modes/particle_mode.c @@ -109,12 +109,12 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void PARTICLE_engine_init(void) +static void PARTICLE_engine_init(void *vedata) { - PARTICLE_Data *ved = DRW_viewport_engine_data_get("ParticleMode"); - PARTICLE_TextureList *txl = ved->txl; - PARTICLE_FramebufferList *fbl = ved->fbl; - PARTICLE_StorageList *stl = ved->stl; + + PARTICLE_TextureList *txl = ((PARTICLE_Data *)vedata)->txl; + PARTICLE_FramebufferList *fbl = ((PARTICLE_Data *)vedata)->fbl; + PARTICLE_StorageList *stl = ((PARTICLE_Data *)vedata)->stl; UNUSED_VARS(txl, fbl, stl); @@ -140,11 +140,11 @@ static void PARTICLE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void PARTICLE_cache_init(void) +static void PARTICLE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("ParticleMode"); - PARTICLE_PassList *psl = g_data.vedata->psl; - PARTICLE_StorageList *stl = g_data.vedata->stl; + + PARTICLE_PassList *psl = ((PARTICLE_Data *)vedata)->psl; + PARTICLE_StorageList *stl = ((PARTICLE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -170,10 +170,10 @@ static void PARTICLE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void PARTICLE_cache_populate(Object *ob) +static void PARTICLE_cache_populate(void *vedata, Object *ob) { - PARTICLE_PassList *psl = g_data.vedata->psl; - PARTICLE_StorageList *stl = g_data.vedata->stl; + PARTICLE_PassList *psl = ((PARTICLE_Data *)vedata)->psl; + PARTICLE_StorageList *stl = ((PARTICLE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -187,21 +187,21 @@ static void PARTICLE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void PARTICLE_cache_finish(void) +static void PARTICLE_cache_finish(void *vedata) { - PARTICLE_PassList *psl = g_data.vedata->psl; - PARTICLE_StorageList *stl = g_data.vedata->stl; + PARTICLE_PassList *psl = ((PARTICLE_Data *)vedata)->psl; + PARTICLE_StorageList *stl = ((PARTICLE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void PARTICLE_draw_scene(void) +static void PARTICLE_draw_scene(void *vedata) { - PARTICLE_Data *ved = DRW_viewport_engine_data_get("ParticleMode"); - PARTICLE_PassList *psl = ved->psl; - PARTICLE_FramebufferList *fbl = ved->fbl; + + PARTICLE_PassList *psl = ((PARTICLE_Data *)vedata)->psl; + PARTICLE_FramebufferList *fbl = ((PARTICLE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/pose_mode.c b/source/blender/draw/modes/pose_mode.c index 184d8ae85e5..ec08650b866 100644 --- a/source/blender/draw/modes/pose_mode.c +++ b/source/blender/draw/modes/pose_mode.c @@ -109,12 +109,12 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void POSE_engine_init(void) +static void POSE_engine_init(void *vedata) { - POSE_Data *ved = DRW_viewport_engine_data_get("PoseMode"); - POSE_TextureList *txl = ved->txl; - POSE_FramebufferList *fbl = ved->fbl; - POSE_StorageList *stl = ved->stl; + + POSE_TextureList *txl = ((POSE_Data *)vedata)->txl; + POSE_FramebufferList *fbl = ((POSE_Data *)vedata)->fbl; + POSE_StorageList *stl = ((POSE_Data *)vedata)->stl; UNUSED_VARS(txl, fbl, stl); @@ -140,11 +140,11 @@ static void POSE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void POSE_cache_init(void) +static void POSE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("PoseMode"); - POSE_PassList *psl = g_data.vedata->psl; - POSE_StorageList *stl = g_data.vedata->stl; + + POSE_PassList *psl = ((POSE_Data *)vedata)->psl; + POSE_StorageList *stl = ((POSE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -170,10 +170,10 @@ static void POSE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void POSE_cache_populate(Object *ob) +static void POSE_cache_populate(void *vedata, Object *ob) { - POSE_PassList *psl = g_data.vedata->psl; - POSE_StorageList *stl = g_data.vedata->stl; + POSE_PassList *psl = ((POSE_Data *)vedata)->psl; + POSE_StorageList *stl = ((POSE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -187,21 +187,21 @@ static void POSE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void POSE_cache_finish(void) +static void POSE_cache_finish(void *vedata) { - POSE_PassList *psl = g_data.vedata->psl; - POSE_StorageList *stl = g_data.vedata->stl; + POSE_PassList *psl = ((POSE_Data *)vedata)->psl; + POSE_StorageList *stl = ((POSE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void POSE_draw_scene(void) +static void POSE_draw_scene(void *vedata) { - POSE_Data *ved = DRW_viewport_engine_data_get("PoseMode"); - POSE_PassList *psl = ved->psl; - POSE_FramebufferList *fbl = ved->fbl; + + POSE_PassList *psl = ((POSE_Data *)vedata)->psl; + POSE_FramebufferList *fbl = ((POSE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/sculpt_mode.c b/source/blender/draw/modes/sculpt_mode.c index f25f21bfbda..49cc324869c 100644 --- a/source/blender/draw/modes/sculpt_mode.c +++ b/source/blender/draw/modes/sculpt_mode.c @@ -109,12 +109,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void SCULPT_engine_init(void) +static void SCULPT_engine_init(void *vedata) { - SCULPT_Data *ved = DRW_viewport_engine_data_get("SculptMode"); - SCULPT_TextureList *txl = ved->txl; - SCULPT_FramebufferList *fbl = ved->fbl; - SCULPT_StorageList *stl = ved->stl; + SCULPT_TextureList *txl = ((SCULPT_Data *)vedata)->txl; + SCULPT_FramebufferList *fbl = ((SCULPT_Data *)vedata)->fbl; + SCULPT_StorageList *stl = ((SCULPT_Data *)vedata)->stl; UNUSED_VARS(txl, fbl, stl); @@ -140,11 +139,10 @@ static void SCULPT_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void SCULPT_cache_init(void) +static void SCULPT_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("SculptMode"); - SCULPT_PassList *psl = g_data.vedata->psl; - SCULPT_StorageList *stl = g_data.vedata->stl; + SCULPT_PassList *psl = ((SCULPT_Data *)vedata)->psl; + SCULPT_StorageList *stl = ((SCULPT_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -170,10 +168,10 @@ static void SCULPT_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void SCULPT_cache_populate(Object *ob) +static void SCULPT_cache_populate(void *vedata, Object *ob) { - SCULPT_PassList *psl = g_data.vedata->psl; - SCULPT_StorageList *stl = g_data.vedata->stl; + SCULPT_PassList *psl = ((SCULPT_Data *)vedata)->psl; + SCULPT_StorageList *stl = ((SCULPT_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -187,21 +185,20 @@ static void SCULPT_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void SCULPT_cache_finish(void) +static void SCULPT_cache_finish(void *vedata) { - SCULPT_PassList *psl = g_data.vedata->psl; - SCULPT_StorageList *stl = g_data.vedata->stl; + SCULPT_PassList *psl = ((SCULPT_Data *)vedata)->psl; + SCULPT_StorageList *stl = ((SCULPT_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void SCULPT_draw_scene(void) +static void SCULPT_draw_scene(void *vedata) { - SCULPT_Data *ved = DRW_viewport_engine_data_get("SculptMode"); - SCULPT_PassList *psl = ved->psl; - SCULPT_FramebufferList *fbl = ved->fbl; + SCULPT_PassList *psl = ((SCULPT_Data *)vedata)->psl; + SCULPT_FramebufferList *fbl = ((SCULPT_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); |