[Bf-committers] Expanding the number of layers in Blender

Stephen Swaney sswaney at centurytel.net
Mon Dec 17 15:18:55 CET 2007


On Mon, Dec 17, 2007 at 02:52:44AM -0500, David Bryant wrote:
> Can anyone 
> tell me why bit shifts are used to indicate and access layers in the Blender 
> codebase? It makes the code inflexible. 

These are called bit fields.  It is a packed representation that uses
the individual bits in a word as boolean flags.  The term bit shift
refers to re-arranging the bits by moving them right or left in the word.

Bit fields provide a compact representation for data.  In the C
language, it is quick and efficient to access and manipulate the data with
logical masking and shifting operations.

As with any packed data representation, when the requirements change,
it can be necessary to do some re-architecting.

-- 
Stephen Swaney			
sswaney at centurytel.net


More information about the Bf-committers mailing list