This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/bmesh/intern/bmesh_inline.c
Campbell Barton 85e0609c54 use char for BMHeader type and flag (saves 2 bytes per edge/loop/vertex/face)
also found mouse_mesh_shortest_path was casting edit selecton to the wrong type.
2011-11-01 14:36:23 +00:00

45 lines
961 B
C

#ifndef BM_INLINE_C
#define BM_INLINE_C
#include "bmesh.h"
BM_INLINE char BM_TestHFlag(const void *element, const char hflag)
{
return ((const BMHeader *)element)->hflag & hflag;
}
BM_INLINE void BM_SetHFlag(void *element, const char hflag)
{
((BMHeader *)element)->hflag |= hflag;
}
BM_INLINE void BM_ClearHFlag(void *element, const char hflag)
{
((BMHeader *)element)->hflag &= ~hflag;
}
BM_INLINE void BM_ToggleHFlag(void *element, const char hflag)
{
((BMHeader *)element)->hflag ^= hflag;
}
BM_INLINE void BM_MergeHFlag(void *element_a, void *element_b)
{
((BMHeader *)element_a)->hflag =
((BMHeader *)element_b)->hflag = (((BMHeader *)element_a)->hflag |
((BMHeader *)element_b)->hflag);
}
BM_INLINE void BM_SetIndex(void *element, const int index)
{
((BMHeader *)element)->index = index;
}
BM_INLINE int BM_GetIndex(const void *element)
{
return ((BMHeader *)element)->index;
}
#endif /*BM_INLINE_C*/