diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-20 21:24:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-20 21:24:40 +0400 |
commit | 01f8b229c94b823ba8745e421ee4c3a8712a7237 (patch) | |
tree | 45fffab96554c0356c15a65e643c528d6b7de9bf | |
parent | ef170c16be8a8a228f3e0a06bca17cd7766a7ac1 (diff) |
revert own change from 56177, game bounds can be useful to see in editmode,
also use gcc attributes for smallhash header and some style edits to recent commit.
-rw-r--r-- | source/blender/blenlib/BLI_smallhash.h | 30 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_group.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 8 |
3 files changed, 32 insertions, 14 deletions
diff --git a/source/blender/blenlib/BLI_smallhash.h b/source/blender/blenlib/BLI_smallhash.h index 09dd254c3fa..7b591c071c6 100644 --- a/source/blender/blenlib/BLI_smallhash.h +++ b/source/blender/blenlib/BLI_smallhash.h @@ -59,15 +59,27 @@ typedef struct { int i; } SmallHashIter; -void BLI_smallhash_init(SmallHash *hash); -void BLI_smallhash_release(SmallHash *hash); -void BLI_smallhash_insert(SmallHash *hash, uintptr_t key, void *item); -void BLI_smallhash_remove(SmallHash *hash, uintptr_t key); -void *BLI_smallhash_lookup(SmallHash *hash, uintptr_t key); -int BLI_smallhash_haskey(SmallHash *hash, uintptr_t key); -int BLI_smallhash_count(SmallHash *hash); -void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key); -void *BLI_smallhash_iternew(SmallHash *hash, SmallHashIter *iter, uintptr_t *key); +#ifdef __GNUC__ +# define ATTR_NONULL_FIRST __attribute__((nonnull(1))) +# define ATTR_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define ATTR_NONULL_FIRST +# define ATTR_UNUSED_RESULT +#endif + + +void BLI_smallhash_init(SmallHash *hash) ATTR_NONULL_FIRST; +void BLI_smallhash_release(SmallHash *hash) ATTR_NONULL_FIRST; +void BLI_smallhash_insert(SmallHash *hash, uintptr_t key, void *item) ATTR_NONULL_FIRST; +void BLI_smallhash_remove(SmallHash *hash, uintptr_t key) ATTR_NONULL_FIRST; +void *BLI_smallhash_lookup(SmallHash *hash, uintptr_t key) ATTR_NONULL_FIRST ATTR_UNUSED_RESULT; +int BLI_smallhash_haskey(SmallHash *hash, uintptr_t key) ATTR_NONULL_FIRST; +int BLI_smallhash_count(SmallHash *hash) ATTR_NONULL_FIRST; +void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key) ATTR_NONULL_FIRST ATTR_UNUSED_RESULT; +void *BLI_smallhash_iternew(SmallHash *hash, SmallHashIter *iter, uintptr_t *key) ATTR_NONULL_FIRST ATTR_UNUSED_RESULT; /* void BLI_smallhash_print(SmallHash *hash); */ /* UNUSED */ +#undef ATTR_NONULL_FIRST +#undef ATTR_UNUSED_RESULT + #endif /* __BLI_SMALLHASH_H__ */ diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c index 1fbb08996d2..64117627be4 100644 --- a/source/blender/editors/space_node/node_group.c +++ b/source/blender/editors/space_node/node_group.c @@ -78,10 +78,12 @@ static int node_group_operator_poll(bContext *C) * Disabled otherwise to allow pynodes define their own operators * with same keymap. */ - if (STREQ(snode->tree_idname, "ShaderNodeTree") - || STREQ(snode->tree_idname, "CompositorNodeTree") - || STREQ(snode->tree_idname, "TextureNodeTree")) + if (STREQ(snode->tree_idname, "ShaderNodeTree") || + STREQ(snode->tree_idname, "CompositorNodeTree") || + STREQ(snode->tree_idname, "TextureNodeTree")) + { return true; + } } return false; } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 28412a8f1c4..134b11a659d 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -6975,8 +6975,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short } if ((dt <= OB_SOLID) && - ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (ob->mode == OB_MODE_OBJECT)) + ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0)) { if (((ob->gameflag & OB_DYNAMIC) && !ELEM(ob->collision_boundtype, OB_BOUND_TRIANGLE_MESH, OB_BOUND_CONVEX_HULL)) || @@ -6988,6 +6987,11 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short invert_m4_m4(imat, rv3d->viewmatob); + if ((dflag & DRAW_CONSTCOLOR) == 0) { + /* prevent random colors being used */ + glColor3ubv(ob_wire_col); + } + setlinestyle(2); drawcircball(GL_LINE_LOOP, vec, ob->inertia, imat); setlinestyle(0); |