darokin
Still Fresh
Hi,
I am coding a game for gp2x but I have a problem with one of my sprite.
For my sprite I load a picture wich contain all the frames of my sprite.
For example I have a ball.bmp wich contain the 4 frames of my ball wich make an animation.
And I do something like that to know wich rect of my surface I blit to the screen :
where spr is a structure to manage my sprites :
But the main character (a sheep) don't want to be shown. I thinks it's related with memory...
My prog don't freeze when I load the bmp but my sheep don't want to appear on screen. And if I try a SDL_SetColorKey (for transparency) on this surface, my prog freeze.
But the same thing WORKS PERFECTLY if I compile for windows instead !
I know my bmp is 24 bpp and my screen only 16 but it works with other sprite..
My sheep.bmp is 320 x 320...
I think it's a memory issue....
I couldn't load bmp bigger than the screen res ?
...I hope someone could help me by giving me more information
But I also hope I wont have to re-code the way I load my sprite because it's was quite boring to put all the frame in one image and was also easier for coding...
Sorry for my crappy english...
Thanks....
I am coding a game for gp2x but I have a problem with one of my sprite.
For my sprite I load a picture wich contain all the frames of my sprite.
For example I have a ball.bmp wich contain the 4 frames of my ball wich make an animation.
And I do something like that to know wich rect of my surface I blit to the screen :
where spr is a structure to manage my sprites :
Code:
num = current_frame;
spr->rect.x = (spr->num * spr->w) % spr->full_w;
spr->rect.y = ((spr->num * spr->w) / spr->full_w) * spr->h;
SDL_BlitSurface(spr->Surface, &spr->rect, screen, &spr->dest);
But the main character (a sheep) don't want to be shown. I thinks it's related with memory...
My prog don't freeze when I load the bmp but my sheep don't want to appear on screen. And if I try a SDL_SetColorKey (for transparency) on this surface, my prog freeze.
But the same thing WORKS PERFECTLY if I compile for windows instead !
I know my bmp is 24 bpp and my screen only 16 but it works with other sprite..
My sheep.bmp is 320 x 320...
I think it's a memory issue....
I couldn't load bmp bigger than the screen res ?
...I hope someone could help me by giving me more information
But I also hope I wont have to re-code the way I load my sprite because it's was quite boring to put all the frame in one image and was also easier for coding...
Sorry for my crappy english...
Thanks....