Alessandro
Member
Hi,
first of all lemme say that the new version of the GP32iDE it's on the way
I've finally added the support for Mr.Mirko's SDK... B)
Now I have a HUGE problem that make me smash the head on the monitor...
I've noticed that if I call this function once, nothing happends, but if I call it twice or more, the GeePee emu crashes... Here's my code:
I use to call this as:
Where am I wrong?!?! I'm goin' crazy.. please helpme
))
Thanks to all
Later
Alessandro
first of all lemme say that the new version of the GP32iDE it's on the way
Now I have a HUGE problem that make me smash the head on the monitor...
I've noticed that if I call this function once, nothing happends, but if I call it twice or more, the GeePee emu crashes... Here's my code:
Code:
typedef struct IMAGE{
int width;
int height;
unsigned short *imageData;
}IMAGE;
typedef struct MYENTRY{
char name[255];
IMAGE myimage;
}MYENTRY;
int LoadBMP( char *filename, IMAGE *bitmap )
{
BMPHeader head;
BMPInfo infos;
F_HANDLE *img;
RGBTriplet_Struct Pixel;
int x,y;
if( GpFileOpen(filename,OPEN_R,&img)==SM_OK )
if( GpFileRead( img, &head,14, 1 )==SM_OK )
if( GpFileRead( img, &infos,40, 1 )==SM_OK )
{
int i=0,size;
bitmap->width=infos.biWidth;
bitmap->height=infos.biHeight;
size=infos.biHeight*infos.biWidth;
bitmap->imageData=gm_malloc(size);
for( y=0;y<infos.biHeight;y++ )
for( x=0;x<infos.biWidth;x++ )
{
GpFileRead( img, &Pixel,3,1 );
bitmap->imageData[x*infos.biWidth + infos.biHeight-(infos.biHeight-y)]=GpMakeCol16( Pixel.R,Pixel.G,Pixel.B);
}
GpFileClose( img );
return 1;
}
GpFileClose( img );
return NULL;
}
I use to call this as:
Code:
MYENTRY fsDirectoryContent[1024];
LoadBMP( "gp:\\gpmm\\test.bmp", &fsDirectoryContent[0].icon );
Where am I wrong?!?! I'm goin' crazy.. please helpme
Thanks to all
Later
Alessandro