Hello there!
SO, I'm making an sprite editor program, and I want help on the most criticalk code: Accessing bits.
Our PSrite system (on casio FXes), sprites are coded directly by bits:
Example with a sprite of 8*8
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111 //the 1 is to say "bit used"
and sprite of 9*9
1111111110000000// 0 are unused and must be
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000// see the bits lost
// Here, I I want to get for example the 10th bit, I must get the first 1 of the second line
And I must be able to access to any bit of size of sprite, If you understand.
I have already found some parts of code, but nothing that important
Code:
I don't know how to end my topic, but I'll thank any help from you!
See ya!
SO, I'm making an sprite editor program, and I want help on the most criticalk code: Accessing bits.
Our PSrite system (on casio FXes), sprites are coded directly by bits:
Example with a sprite of 8*8
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111 //the 1 is to say "bit used"
and sprite of 9*9
1111111110000000// 0 are unused and must be
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000
1111111110000000// see the bits lost
// Here, I I want to get for example the 10th bit, I must get the first 1 of the second line
And I must be able to access to any bit of size of sprite, If you understand.
I have already found some parts of code, but nothing that important
Code:
int w,h; //size
int x,y; //position
w/8+1; //would give me the number of bytes used by line, I
(x*y)/w; // would give me the line to edit
suppose
I don't know how to end my topic, but I'll thank any help from you!
See ya!