diff options
Diffstat (limited to 'source/blender/draw/modes/paint_weight_mode.c')
-rw-r--r-- | source/blender/draw/modes/paint_weight_mode.c | 31 |
1 files changed, 15 insertions, 16 deletions
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(); |