#82989 - silent_code - Thu May 11, 2006 6:47 pm
hi!
i hope someone can help me with a sprites issue. as the subject says i use mode 5 8bit rotation sprites. but somehow they shear oddly. anyone had the same problem and solved it?
it's strange cuz it doesn't happen to all sprites... looks like something overwrites certain bits or whatever. the rotation attribute in the following pic should be 0!?
[Images not permitted - Click here to view it]
i will post some sources as necessary.
maybe i screw up the values while writing them in? my sprites have floats for coordinates (i know that floats suck and i'll change that as soon as i have fixed a few other things). when updating oam i do it like (just and example)
...
x = (int16)((int)(player.x - 29.0f));
...
spriteEntry->attribute[1] &= 0xFE00;
spriteEntry->attribute[1] |= (x & 0x01FF);
...
for each coordinate, where player is a float and x an int16... casting is sh*t, i know, but it's just a first implementation. ;) the double int casting is the result of trieing ANYTHING the syntax won't forbid to use...
please don't tell me to read up on sprites, cuz i have done that already, but if you have some good resource (that isn't already like ten times on the forum) it was nice of you to post it.
thanks in advance!
i hope someone can help me with a sprites issue. as the subject says i use mode 5 8bit rotation sprites. but somehow they shear oddly. anyone had the same problem and solved it?
it's strange cuz it doesn't happen to all sprites... looks like something overwrites certain bits or whatever. the rotation attribute in the following pic should be 0!?
[Images not permitted - Click here to view it]
i will post some sources as necessary.
maybe i screw up the values while writing them in? my sprites have floats for coordinates (i know that floats suck and i'll change that as soon as i have fixed a few other things). when updating oam i do it like (just and example)
...
x = (int16)((int)(player.x - 29.0f));
...
spriteEntry->attribute[1] &= 0xFE00;
spriteEntry->attribute[1] |= (x & 0x01FF);
...
for each coordinate, where player is a float and x an int16... casting is sh*t, i know, but it's just a first implementation. ;) the double int casting is the result of trieing ANYTHING the syntax won't forbid to use...
please don't tell me to read up on sprites, cuz i have done that already, but if you have some good resource (that isn't already like ten times on the forum) it was nice of you to post it.
thanks in advance!