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/paint_texture_mode.c | |
parent | 522ca1828177e8161f60f4693b523bbeeeb8cafa (diff) |
Draw Manager: Make Viewport Data passed by the manager call.
Diffstat (limited to 'source/blender/draw/modes/paint_texture_mode.c')
-rw-r--r-- | source/blender/draw/modes/paint_texture_mode.c | 31 |
1 files changed, 15 insertions, 16 deletions
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(); |