#8136 - Foz - Wed Jul 02, 2003 6:33 pm
I recently created a 256 color sprite in Photoshop and saved it as a .PCX file. I then used Dovoto's pcx2gba to create the header. The output read a 64x64 sprite with 8 bits per pixel which was correct. I then used this file in a test program:
Most of the code is gbajunkie's with some changes. Anyway, when I run Mappy VM the sprite appears 64x64 but it is all rearranged beyond recognition. Here is the CopyOAM function:
I'm not sure if the problem is here or in the translation of the graphic with the pcx2gba program.[/code]
Code: |
int main() { u16 loop; u16* temp; SetMode(MODE_1 | OBJ_ENABLE | OBJ_MAP_1D); for(loop = 0; loop < 256; loop++) OBJPaletteMem[loop] = playerPalette[loop]; InitializeSprites(); sprites[0].attribute0 = COLOR_256 | SQUARE | ROTATION_FLAG | 50; sprites[0].attribute1 = SIZE_64 | ROTDATA(0) | 120; sprites[0].attribute2 = 0; for(loop = 0; loop < 2048; loop++) // 64x64 / 2 pixels at a time { OAMData[loop] = playerData[loop]; } while(1) //the main game loop { GetInput(); RotateSprite(0, angle, zoom, zoom); WaitForVsync(); CopyOAM(); } } |
Most of the code is gbajunkie's with some changes. Anyway, when I run Mappy VM the sprite appears 64x64 but it is all rearranged beyond recognition. Here is the CopyOAM function:
Code: |
void CopyOAM() { u16 loop; u16* temp; temp = (u16*)sprites; for(loop = 0; loop < 128*4; loop++) { OAM[loop] = temp[loop]; } } |
I'm not sure if the problem is here or in the translation of the graphic with the pcx2gba program.[/code]