Original Post
The following function, when called, causes a segmentation fault: After much debugging and commenting several lines of code, I narrowed it down to these two lines: I don't see how this could cause a segmentation fault. What's the problem, here? Also, if it helps, I'm using Dev-C++/gcc. Thank you, -KG_Brad
BITMAP *grabframe(BITMAP *src,int w,int h,int sx,int sy,int columns,int frame)
{
BITMAP *temp = create_bitmap(w,h);
int x = sx + frame%columns * w;
int y = sy + frame/columns * h;
blit(src,temp,x,y,0,0,w,h);
return temp;
}
int x = sx + frame%columns * w;
int y = sy + frame/columns * h;