GP: Cleanup style
authorAntonioya <blendergit@gmail.com>
Mon, 15 Oct 2018 06:35:11 +0000 (08:35 +0200)
committerAntonioya <blendergit@gmail.com>
Mon, 15 Oct 2018 06:42:47 +0000 (08:42 +0200)
source/blender/draw/engines/gpencil/gpencil_cache_utils.c
source/blender/draw/engines/gpencil/gpencil_engine.c

index fdf4f121d53e318e6b6799bc87512a09529666fa..e8f8254bb5bb57d241655baa4e2fedef81b859fe 100644 (file)
@@ -102,7 +102,7 @@ tGPencilObjectCache *gpencil_object_cache_add(
        memset(cache_elem, 0, sizeof(*cache_elem));
 
        cache_elem->is_dup_ob = gpencil_check_ob_duplicated(cache_array, *gp_cache_used, ob);
-
+       
        STRNCPY(cache_elem->ob_name, ob->id.name);
        cache_elem->gpd = (bGPdata *)ob->data;
 
@@ -156,7 +156,7 @@ tGPencilObjectCache *gpencil_object_cache_add(
 /* get current cache data */
 static GpencilBatchCache *gpencil_batch_get_element(Object *ob)
 {
-       bGPdata *gpd = ob->data;
+       bGPdata *gpd = (bGPdata *)ob->data;
        if (gpd->runtime.batch_cache_data == NULL) {
                gpd->runtime.batch_cache_data = BLI_ghash_str_new("GP batch cache data");
                return NULL;
index d854336cfd0c5b56d34dd7aafe9bc343d711e56b..b0e75b85c0bda8d18a7c14889a63579ab887cb85 100644 (file)
@@ -506,37 +506,24 @@ static void gpencil_add_draw_data(void *vedata, Object *ob)
        int i = stl->g_data->gp_cache_used - 1;
        tGPencilObjectCache *cache_ob = &stl->g_data->gp_object_cache[i];
 
-       if (cache_ob->is_dup_ob == false) {
-               /* save init shading group */
-               cache_ob->init_grp = stl->storage->shgroup_id;
+       /* save init shading group */
+       cache_ob->init_grp = stl->storage->shgroup_id;
 
-               /* fill shading groups */
-               if (!is_multiedit) {
-                       DRW_gpencil_populate_datablock(&e_data, vedata, scene, ob, cache_ob);
-               }
-               else {
-                       DRW_gpencil_populate_multiedit(&e_data, vedata, scene, ob, cache_ob);
-               }
-
-               /* save end shading group */
-               cache_ob->end_grp = stl->storage->shgroup_id - 1;
+       /* fill shading groups */
+       if ((!is_multiedit) || (cache_ob->is_dup_ob)) {
+               DRW_gpencil_populate_datablock(&e_data, vedata, scene, ob, cache_ob);
        }
        else {
-               /* save init shading group */
-               cache_ob->init_grp = stl->storage->shgroup_id;
-
-               DRW_gpencil_populate_datablock(
-                       &e_data, vedata, scene, ob,
-                       cache_ob);
-
-               /* save end shading group */
-               cache_ob->end_grp = stl->storage->shgroup_id - 1;
+               DRW_gpencil_populate_multiedit(&e_data, vedata, scene, ob, cache_ob);
        }
 
+       /* save end shading group */
+       cache_ob->end_grp = stl->storage->shgroup_id - 1;
+
        /* FX passses */
        cache_ob->has_fx = false;
        if ((!stl->storage->simplify_fx) &&
-           (BKE_shaderfx_has_gpencil(ob)))
+               (BKE_shaderfx_has_gpencil(ob)))
        {
                cache_ob->has_fx = true;
                if ((!stl->storage->simplify_fx) && (!is_multiedit)) {