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.
This commit is contained in:
Campbell Barton 2013-04-20 17:24:40 +00:00
parent ef170c16be
commit 01f8b229c9
3 changed files with 32 additions and 14 deletions

@ -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__ */

@ -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;
}

@ -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);