Bitmask - Help

BlitzMax Forums/BlitzMax Programming/Bitmask - Help

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

If there is anybody familiar with C# who could help me translate the below code into BlitzMax code, I would eternally grateful.. I’m kind of lost!!


public struct Bitmask
{
public int mask;

public void clear() { mask = 0x00; }
public void setOn(int bit)
{
mask |= (0x01 << ((bit > 0) ? (bit - 1) : 0));
}
public void setOff(int bit)
{
mask &= ~(0x01 << ((bit > 0) ? (bit - 1) : 0));
}
}