Bitfield: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Created page with 'A '''bitfield''' is an integer value treated as a sequence of bits (binary digits) which can be toggled individually as flags. In conventional decimal math, each flag is represe...'
 
Fox (talk | contribs)
No edit summary
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
A '''bitfield''' is an integer value treated as a sequence of bits (binary digits) which can be toggled individually as flags. In conventional decimal math, each flag is represented a a power of two number: 1, 2, 4, 8, 16, 32, etc. To toggle each flag, you add them together. The resulting sum is what appears in a variable or structure member.
A '''bitfield''' is an integer value treated as a sequence of bits (binary digits) which can be toggled individually as flags. In conventional decimal math, each flag is represented a a power of two number: 1, 2, 4, 8, 16, 32, etc. To toggle each flag, you add them together. The resulting sum is what appears in a variable or structure member.
 
If it is not apparent already, setting a bitfield to '''0''' disables all flags.


Notable bitfields include:
Notable bitfields include:
*[[cstat]]
*[[cstat (sprite)|cstat]]
*[[cstat(wall)|cstat (wall)]]
*[[cstat(wall)|cstat (wall)]]
*[[ceilingstat]]
*[[ceilingstat]]
Line 15: Line 17:
*[[extbits]]
*[[extbits]]
*[[LOGO_FLAGS]]
*[[LOGO_FLAGS]]
See the [[:Category:Bitfields|complete list of bitfields]].
[[Category:Scripting documentation]]

Latest revision as of 18:01, 20 February 2020

A bitfield is an integer value treated as a sequence of bits (binary digits) which can be toggled individually as flags. In conventional decimal math, each flag is represented a a power of two number: 1, 2, 4, 8, 16, 32, etc. To toggle each flag, you add them together. The resulting sum is what appears in a variable or structure member.

If it is not apparent already, setting a bitfield to 0 disables all flags.

Notable bitfields include:

See the complete list of bitfields.