synkro
0xdeadbeef
so here is my function, with this functin it works w/o problem but not with the sdk blit functions
Code:
/*********************************************************************
* Inline functions to check a point is inside the screen boundary.
*
*/
inline int withinWidth(int x)
{
return ((unsigned int)x < WIDTH);
}
inline int withinHeight(int y)
{
return ((unsigned int)y < HEIGHT);
}
inline int withinScreen(int x, int y)
{
return (withinWidth(x) && withinHeight(y));
}
/**************************************************************************
* Substitute for gp_putSprite() uses real screen coords (0,0) bottom left
*
* *sprite 16bit raw image data
* sprite_x, sprite_y sprite size in pixel
* put_x, put_y screen position
* *framebuffer target framebuffer
*/
void drawSprite(unsigned short *sprite, unsigned short sprite_x,
unsigned short sprite_y, int put_x, int put_y,
unsigned short *framebuffer)
{
int xx,yy,i,tempx;
u16 color;
i=0;
for (xx=0; xx<sprite_x; xx++)
{
tempx = put_x+xx;
for (yy=0; yy<sprite_y; yy++)
{
color = sprite[i++];
if(withinScreen(tempx, put_y+yy))
*(framebuffer +(put_y+yy)+(240*(tempx)) ) = color;
}
}
}