BITMAP *grabframe(BITMAP *source,int startx,int starty,int width,int height,int frame,int columns)
BITMAP *temp = create_bitmap(width,height);
int x = startx + (frame %columns)* width;
int y = starty + (frame /columns) * height;
blit(source, temp, x,y, 0, 0,width,height);
Hi guys I'm using this function to fill an array of bitmap which then I can use for drawing frames.Is there a drawback from doing this?
It seems intuitive to me but the majority of other methods that I've seen use the sprite sheet and then calculate the position of a given frame in order to draw it. What would be the advantage of doing that?