GP32 Loading External Bitmaps


nerd of nerds

w00t!!!!
Joined
Feb 25, 2003
Messages
838
hello...

i starting work on my game... i'm not gonna tell anyone what it is incase i decide i don't have enuff time...

anyway, i woul like to have the ability to add gfx to it such as cars and people... how do i load external bitmaps so i don't have to convert them into c files then recompile my code with these new files added?

some example would be great!
 
wish i knew mate, im trying to do the same thing ;)

somebody lent me some code to load sound-effects which i haven't tried yet, but i guess you could easily change it to work with bitmaps..

/* global variables put these in your header */
unsigned short *SFX_Audio[5]; /* 5 elements so we can hold 5 sfx files */
ulong SFXSize[5];

void LoadSFX(char filenamenpath, int sfindex)
{
unsigned long readbytes;
F_HANDLE fh;
if (GpFileOpen(filenamenpath,OPEN_R, &fh)==SM_OK)
{
GpFileGetSize (filenamenpath, &SFXSize[sfindex]);
SFX_Audio[sfindex] = malloc(SFXSize[sfindex]);
GpFileRead(fh, SFX_Audio[sfindex],SFXSize[sfindex],&readbytes);
GpFileClose(fh);
}
}

cars and people huh? sounds like a certain grand theft game i used to play ;)
 
Back
Top