I'm trying to set up an 8bit palette and it's being fussy
Code in question - crap trimmed out
Code:
// 3 - 3 - 2 bit layout for palette
for(unsigned char color = 0; color < 255; color++)
{
int greenzone = color & 0xE0; // 11100000
int redzone = color & 0x1C; // 00011100
int bluezone = color & 0x03; // 00000011
bitset<3> b(greenzone); cout << b << " ";
bitset<3> c(redzone); cout << c << " ";
bitset<2> d(bluezone); cout << d << " ";
bits << "\t" << bitset<8>(color) << std::endl;
}
Yielding - note my markup, information loss, confuzion, blergh
Code:
000 000 00 00000000
000 000 01 00000001
000 000 10 00000010
000 000 11 00000011
000 100 00 00000100 * // Why on the left
000 100 01 00000101
000 100 10 00000110
000 100 11 00000111
000 000 00 00001000 * // Why
000 000 01 00001001
000 000 10 00001010
000 000 11 00001011
000 100 00 00001100
000 100 01 00001101
000 100 10 00001110
000 100 11 00001111
000 000 00 00010000
000 000 01 00010001
Why are the two columns different (no not the spacing, the data)