ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


new:bits

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
new:bits [2018/02/18 19:15] korshunnew:bits [2018/02/19 12:25] korshun
Line 5: Line 5:
 These functions allow you to work with variables as if they were arrays of bits: These functions allow you to work with variables as if they were arrays of bits:
  
-  * ''bool getbit(int a, int i)'' -- returns bit ''a[i]'' +  * ''bool getbit(int a, int i)'' -- returns bit ''a[i]''. 
-  * ''void setbit(int a, int i)'' -- performs ''a[i] = 1'' +  * ''int setbit(int a, int i)'' -- performs ''a[i] = 1'' and returns the result. 
-  * ''void clrbit(int a, int i)'' -- performs ''a[i] = 0'' +  * ''int clrbit(int a, int i)'' -- performs ''a[i] = 0'' and returns the result. 
-  * ''void tglbit(int a, int i)'' -- performs ''a[i] = !a[i]''+  * ''int tglbit(int a, int i)'' -- performs ''a[i] = !a[i]'' and returns the result.
  
 ===== Unsetting bit flags ===== ===== Unsetting bit flags =====
new/bits.txt · Last modified: 2018/02/19 12:29 by korshun