[Bf-blender-cvs] [c47c6a32ea6] greasepencil-object: Cleanup: Rename field and add comments
Antonio Vazquez
noreply at git.blender.org
Wed Mar 21 17:35:43 CET 2018
Commit: c47c6a32ea62d5eb7c894367bc72df827a492184
Author: Antonio Vazquez
Date: Wed Mar 21 17:35:31 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBc47c6a32ea62d5eb7c894367bc72df827a492184
Cleanup: Rename field and add comments
===================================================================
M source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M source/blender/draw/engines/gpencil/gpencil_engine.c
M source/blender/draw/engines/gpencil/gpencil_engine.h
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 3c2231e41a8..451478840bb 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -75,7 +75,7 @@ tGPencilObjectCache *gpencil_object_cache_allocate(tGPencilObjectCache *cache, i
}
/* add a gpencil object to cache to defer drawing */
-void gpencil_object_cache_add(tGPencilObjectCache *cache_array, Object *ob, bool temp, int *gp_cache_used)
+void gpencil_object_cache_add(tGPencilObjectCache *cache_array, Object *ob, bool is_temp, int *gp_cache_used)
{
const DRWContextState *draw_ctx = DRW_context_state_get();
tGPencilObjectCache *cache = &cache_array[*gp_cache_used];
@@ -86,7 +86,7 @@ void gpencil_object_cache_add(tGPencilObjectCache *cache_array, Object *ob, bool
/* save object */
cache->ob = ob;
- cache->temp = temp;
+ cache->temp_ob = is_temp;
cache->init_grp = 0;
cache->end_grp = -1;
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 5084400d17d..7f4f3d68d15 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -689,7 +689,7 @@ static void gpencil_free_obj_list(GPENCIL_StorageList *stl)
*/
for (int i = 0; i < stl->g_data->gp_cache_used; i++) {
Object *ob = stl->g_data->gp_object_cache[i].ob;
- if (stl->g_data->gp_object_cache[i].temp) {
+ if (stl->g_data->gp_object_cache[i].temp_ob) {
MEM_SAFE_FREE(ob);
}
}
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index fac838c876c..16b7d98dfe2 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -126,8 +126,8 @@ typedef struct tGPencilObjectCache {
DRWShadingGroup *vfx_flip_sh;
DRWShadingGroup *vfx_light_sh;
- float zdepth;
- bool temp;
+ float zdepth; /* z-depth value to sort gp object */
+ bool temp_ob; /* flag to tag temporary objects that must be removed after drawing loop */
} tGPencilObjectCache;
/* *********** LISTS *********** */
@@ -351,7 +351,7 @@ struct GPUTexture *DRW_gpencil_create_blank_texture(int width, int height);
bool gpencil_can_draw_stroke(const struct bGPDstroke *gps, const bool onion);
struct tGPencilObjectCache *gpencil_object_cache_allocate(struct tGPencilObjectCache *cache, int *gp_cache_size, int *gp_cache_used);
-void gpencil_object_cache_add(struct tGPencilObjectCache *cache, struct Object *ob, bool temp, int *gp_cache_used);
+void gpencil_object_cache_add(struct tGPencilObjectCache *cache, struct Object *ob, bool is_temp, int *gp_cache_used);
void gpencil_array_modifiers(struct GPENCIL_StorageList *stl, struct Object *ob);
More information about the Bf-blender-cvs
mailing list