Need some help on ATTR1_FLIP_X for sprites
Posted: Tue Feb 10, 2009 9:51 am
Hi,
I'm fiddling with the sprite attributes so that I can save some time on mirroring my sprite images. However, I'm unable to get the ATTR1_FLIP_X to take effect. (Below is the code fragment inside the routine I'm working on, "pc" is a global variable).
The code works fine for everything except that the flipping doesn't happen. I also tried moving the oamUpdate statement after the "oamMain.oamMemory[0].attribute" blocks but it doesn't helop either
Some advice from anybody please? Many thanks!
Regards,
Diuleeah
I'm fiddling with the sprite attributes so that I can save some time on mirroring my sprite images. However, I'm unable to get the ATTR1_FLIP_X to take effect. (Below is the code fragment inside the routine I'm working on, "pc" is a global variable).
Code: Select all
void animateActor() {
static int delay = 0;
const int interval = 15;
dmaCopy(&rasterData[pc.frames.current * 32 * 32], gfx, 32 * 32);
oamSet(
&oamMain,
0,
pc.x, pc.y,
0,
0,
pc.size,
pc.format,
pc.gfx,
-1,
false,
false);
oamUpdate(&oamMain);
if (pc.status == mRight) {
oamMain.oamMemory[0].attribute[0] = ATTR0_COLOR_256 | ATTR0_NORMAL;
oamMain.oamMemory[0].attribute[1] = ATTR1_FLIP_X | ATTR1_SIZE_32;
}
else {
oamMain.oamMemory[0].attribute[0] = ATTR0_COLOR_256 | ATTR0_NORMAL;
oamMain.oamMemory[0].attribute[1] = ATTR1_SIZE_32;
}
if (delay >= interval) {
if (advFrame(&pc.frames)) {
resetFrameSet(&pc.frames);
}
delay = 0;
}
else {
delay++;
}
}
Some advice from anybody please? Many thanks!
Regards,
Diuleeah