Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-05-07 23:01:45 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-05-08 18:52:49 +0300
commit55173b1583a67308b053d57f960738b55fe81abb (patch)
tree5eabe552a7cde13a31e92ebae16694a2803145b7 /source/blender/draw/intern
parentaec717cd61d99afca538d752a8c51f2ae8dc0033 (diff)
Cleanup: draw_common: Use switch instead of ifs
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/draw_common.c35
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 */
}
}