diff options
author | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:15:01 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:27:46 +0300 |
commit | d138cbfb47e379edc1ee915a8c6ff65b01f000d6 (patch) | |
tree | f4773ecce897c32eaf75295dd5f6a8e730d471ed /source/blender/draw/engines/gpencil | |
parent | b0c1184875d39abac4a65a5d20e263ea6d841009 (diff) |
Code Quality: Replace for loops with LISTBASE_FOREACH
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
Diffstat (limited to 'source/blender/draw/engines/gpencil')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_engine.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 4963221743f..50e4e8d2ec4 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -744,8 +744,8 @@ static void GPENCIL_draw_scene_depth_only(void *ved) GPU_framebuffer_bind(dfbl->depth_only_fb); } - for (GPENCIL_tObject *ob = pd->tobjects.first; ob; ob = ob->next) { - for (GPENCIL_tLayer *layer = ob->layers.first; layer; layer = layer->next) { + LISTBASE_FOREACH (GPENCIL_tObject *, ob, &pd->tobjects) { + LISTBASE_FOREACH (GPENCIL_tLayer *, layer, &ob->layers) { DRW_draw_pass(layer->geom_ps); } } @@ -826,7 +826,7 @@ static void GPENCIL_draw_object(GPENCIL_Data *vedata, GPENCIL_tObject *ob) GPU_framebuffer_multi_clear(fb_object, clear_cols); } - for (GPENCIL_tLayer *layer = ob->layers.first; layer; layer = layer->next) { + LISTBASE_FOREACH (GPENCIL_tLayer *, layer, &ob->layers) { if (layer->mask_bits) { gpencil_draw_mask(vedata, ob, layer); } @@ -847,7 +847,7 @@ static void GPENCIL_draw_object(GPENCIL_Data *vedata, GPENCIL_tObject *ob) } } - for (GPENCIL_tVfx *vfx = ob->vfx.first; vfx; vfx = vfx->next) { + LISTBASE_FOREACH (GPENCIL_tVfx *, vfx, &ob->vfx) { GPU_framebuffer_bind(*(vfx->target_fb)); DRW_draw_pass(vfx->vfx_ps); } @@ -893,7 +893,7 @@ static void GPENCIL_fast_draw_end(GPENCIL_Data *vedata) pd->snapshot_buffer_dirty = false; } /* Draw the sbuffer stroke(s). */ - for (GPENCIL_tObject *ob = pd->sbuffer_tobjects.first; ob; ob = ob->next) { + LISTBASE_FOREACH (GPENCIL_tObject *, ob, &pd->sbuffer_tobjects) { GPENCIL_draw_object(vedata, ob); } } @@ -934,7 +934,7 @@ void GPENCIL_draw_scene(void *ved) GPU_framebuffer_multi_clear(fbl->gpencil_fb, clear_cols); } - for (GPENCIL_tObject *ob = pd->tobjects.first; ob; ob = ob->next) { + LISTBASE_FOREACH (GPENCIL_tObject *, ob, &pd->tobjects) { GPENCIL_draw_object(vedata, ob); } |