/* Internal function to move Bresenham line iterator to the next position. 
Maybe updates the x and y coordinates of the iterator struct. */
int _bresenhamIterate(SDL_gfxBresenhamIterator *b)
/* Internal function to move Bresenham line iterator to the next position. 
Maybe updates the x and y coordinates of the iterator struct. */
int _bresenhamIterate(SDL_gfxBresenhamIterator *b)
{	if (b==NULL) {
		return (-1);
	}
	if (b->count==0) {
		return (2);
	}
	while (b->error >= 0) {
		if (b->swapdir) {
			b->x += b->s1;
		} else  {
			b->y += b->s2;
		}
		b->error -= b->dx;
	}
	if (b->swapdir) {
		b->y += b->s2;
	} else {
		b->x += b->s1;
	}
	b->error += b->dy;	b->count--;
	return ((b->count) ? 0 : 1);
}