src/gfx/SDL_rotozoom.c
/*!
\brief Calculates the size of the target surface for a zoomSurface() call.

The minimum size of the target surface is 1. The input factors can be positive or negative.

\param width The width of the source surface to zoom.
\param height The height of the source surface to zoom.
\param zoomx The horizontal zoom factor.
\param zoomy The vertical zoom factor.
\param dstwidth Pointer to an integer to store the calculated width of the zoomed target surface.
\param dstheight Pointer to an integer to store the calculated height of the zoomed target surface.
*/
\brief Calculates the size of the target surface for a zoomSurface() call.
The minimum size of the target surface is 1. The input factors can be positive or negative.

\param width The width of the source surface to zoom.
\param height The height of the source surface to zoom.
\param zoomx The horizontal zoom factor.
\param zoomy The vertical zoom factor.
\param dstwidth Pointer to an integer to store the calculated width of the zoomed target surface.
\param dstheight Pointer to an integer to store the calculated height of the zoomed target surface.
\ brief Calculates the size of the target surface for a zoomSurface () call . The minimum size of the target surface is 1 . The input factors can be positive or negative . \ param width The width of the source surface to zoom . \ param height The height of the source surface to zoom . \ param zoomx The horizontal zoom factor . \ param zoomy The vertical zoom factor . \ param dstwidth Pointer to an integer to store the calculated width of the zoomed target surface . \ param dstheight Pointer to an integer to store the calculated height of the zoomed target surface .
void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight)
{
	int flipx, flipy;
	flipx = (zoomx<0.0);
	if (flipx) zoomx = -zoomx;
	flipy = (zoomy<0.0);
	if (flipy) zoomy = -zoomy;
	if (zoomx < VALUE_LIMIT) {
		zoomx = VALUE_LIMIT;
	}
	if (zoomy < VALUE_LIMIT) {
		zoomy = VALUE_LIMIT;
	}
	*dstwidth = (int) floor(((double) width * zoomx) + 0.5);
	*dstheight = (int) floor(((double) height * zoomy) + 0.5);
	if (*dstwidth < 1) {
		*dstwidth = 1;
	}
	if (*dstheight < 1) {
		*dstheight = 1;
	}
}
void zoomSurfaceSize ( int width , int height , double zoomx , double zoomy , int * dstwidth , int * dstheight ) { int flipx , flipy ; flipx = ( zoomx < 0.0 ) ; if ( flipx ) zoomx = - zoomx ; flipy = ( zoomy < 0.0 ) ; if ( flipy ) zoomy = - zoomy ; if ( zoomx < VALUE_LIMIT ) { zoomx = VALUE_LIMIT ; } if ( zoomy < VALUE_LIMIT ) { zoomy = VALUE_LIMIT ; } * dstwidth = ( int ) floor ( ( ( double ) width * zoomx ) + 0.5 ) ; * dstheight = ( int ) floor ( ( ( double ) height * zoomy ) + 0.5 ) ; if ( * dstwidth < 1 ) { * dstwidth = 1 ; } if ( * dstheight < 1 ) { * dstheight = 1 ; } }
\brief Calculates the size of the target surface for a zoomSurface() call.
\ brief Calculates the size of the target surface for a zoomSurface () call .
/*
	* Make zoom factors positive 
	*/ /*
	* Sanity check zoom factors 
	*/ /*
	* Calculate target size 
	*/