Draw Manager: Small cleanup on bool and bitwise
We should avoid casting from an int to a flag. In this case it is probably fine, but if the OB_MODE_SCULPT was too high it can overflow the bool. (also adding explicit parenthesis to a flag check)
This commit is contained in:
@@ -726,7 +726,7 @@ static void CLAY_cache_populate(void *vedata, Object *ob)
|
||||
if (!DRW_object_is_renderable(ob))
|
||||
return;
|
||||
|
||||
bool sculpt_mode = ob->mode & OB_MODE_SCULPT;
|
||||
bool sculpt_mode = (ob->mode & OB_MODE_SCULPT) != 0;
|
||||
|
||||
struct Batch *geom = DRW_cache_object_surface_get(ob);
|
||||
if (geom) {
|
||||
|
||||
@@ -1192,7 +1192,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
|
||||
|
||||
if (do_outlines) {
|
||||
Object *obedit = scene->obedit;
|
||||
if (ob != obedit && !(OBACT_NEW == ob && ob->mode & OB_MODE_ALL_PAINT)) {
|
||||
if (ob != obedit && !(OBACT_NEW == ob && (ob->mode & OB_MODE_ALL_PAINT))) {
|
||||
struct Batch *geom = DRW_cache_object_surface_get(ob);
|
||||
if (geom) {
|
||||
theme_id = DRW_object_wire_theme_get(ob, sl, NULL);
|
||||
|
||||
Reference in New Issue
Block a user