diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-07 23:01:45 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-08 18:52:49 +0300 |
commit | 55173b1583a67308b053d57f960738b55fe81abb (patch) | |
tree | 5eabe552a7cde13a31e92ebae16694a2803145b7 /source | |
parent | aec717cd61d99afca538d752a8c51f2ae8dc0033 (diff) |
Cleanup: draw_common: Use switch instead of ifs
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_common.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index b4eb354ec59..e832b8bc742 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -1075,22 +1075,27 @@ int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color theme_id = (active) ? TH_ACTIVE : TH_SELECT; } else { - if (ob->type == OB_LAMP) { - theme_id = TH_LIGHT; - } - else if (ob->type == OB_SPEAKER) { - theme_id = TH_SPEAKER; - } - else if (ob->type == OB_CAMERA) { - theme_id = TH_CAMERA; - } - else if (ob->type == OB_EMPTY) { - theme_id = TH_EMPTY; + switch (ob->type) { + case OB_LAMP: + theme_id = TH_LIGHT; + break; + case OB_SPEAKER: + theme_id = TH_SPEAKER; + break; + case OB_CAMERA: + theme_id = TH_CAMERA; + break; + case OB_EMPTY: + theme_id = TH_EMPTY; + break; + case OB_LIGHTPROBE: + /* TODO add lightprobe color */ + theme_id = TH_EMPTY; + break; + default: + /* fallback to TH_WIRE */ + break; } - else if (ob->type == OB_LIGHTPROBE) { - theme_id = TH_EMPTY; - } /* TODO add lightprobe color */ - /* fallback to TH_WIRE */ } } |