From ce6b85fe693f3d7c9dc678c7dd2c983667c42e2a Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 15 Nov 2025 15:01:17 +0200
Subject: [PATCH 34/34] SDL2_rotozoom: Clear trailing spaces

See RM #1738

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 dependencies/SDL2_gfx/SDL2_rotozoom.c | 304 +++++++++++++-------------
 dependencies/SDL2_gfx/SDL2_rotozoom.h |  14 +-
 2 files changed, 159 insertions(+), 159 deletions(-)

diff --git a/dependencies/SDL2_gfx/SDL2_rotozoom.c b/dependencies/SDL2_gfx/SDL2_rotozoom.c
index ec5e2f782d..11964fb720 100644
--- a/dependencies/SDL2_gfx/SDL2_rotozoom.c
+++ b/dependencies/SDL2_gfx/SDL2_rotozoom.c
@@ -1,4 +1,4 @@
-/*  
+/*
 
 SDL2_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces
 
@@ -55,18 +55,18 @@ typedef struct tColorY {
 	Uint8 y;
 } tColorY;
 
-/*! 
+/*!
 \brief Returns maximum of two numbers a and b.
 */
 #define MAX(a,b)    (((a) > (b)) ? (a) : (b))
 
-/*! 
+/*!
 \brief Number of guard rows added to destination surfaces.
 
 This is a simple but effective workaround for observed issues.
 These rows allocate extra memory and are then hidden from the surface.
-Rows are added to the end of destination surfaces when they are allocated. 
-This catches any potential overflows which seem to happen with 
+Rows are added to the end of destination surfaces when they are allocated.
+This catches any potential overflows which seem to happen with
 just the right src image dimensions and scale/rotation and can lead
 to a situation where the program can segfault.
 */
@@ -82,13 +82,13 @@ to a situation where the program can segfault.
 */
 static Uint32 _colorkey(SDL_Surface *src)
 {
-	Uint32 key = 0; 
+	Uint32 key = 0;
 	SDL_GetColorKey(src, &key);
 	return key;
 }
 
 
-/*! 
+/*!
 \brief Internal 32 bit integer-factor averaging Shrinker.
 
 Shrinks 32 bit RGBA/ABGR 'src' surface to 'dst' surface.
@@ -141,7 +141,7 @@ static int _shrinkSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int factorx,
 					aa += sp->a;
 
 					sp++;
-				} 
+				}
 				/* src dx loop */
 				sp = (tColorRGBA *)((Uint8*)sp + (src->pitch - 4*factorx)); // next y
 			}
@@ -157,26 +157,26 @@ static int _shrinkSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int factorx,
 			dp->a = aa/n_average;
 
 			/*
-			* Advance destination pointer 
+			* Advance destination pointer
 			*/
 			dp++;
-		} 
+		}
 		/* dst x loop */
 
 		/* next box-y */
 		sp = (tColorRGBA *)((Uint8*)osp + src->pitch*factory);
 
 		/*
-		* Advance destination pointers 
+		* Advance destination pointers
 		*/
 		dp = (tColorRGBA *) ((Uint8 *) dp + dgap);
-	} 
+	}
 	/* dst y loop */
 
 	return (0);
 }
 
-/*! 
+/*!
 \brief Internal 8 bit integer-factor averaging shrinker.
 
 Shrinks 8bit Y 'src' surface to 'dst' surface.
@@ -213,7 +213,7 @@ static int _shrinkSurfaceY(SDL_Surface * src, SDL_Surface * dst, int factorx, in
 	dp = (Uint8 *) dst->pixels;
 	dgap = dst->pitch - dst->w;
 
-	for (y = 0; y < dst->h; y++) {    
+	for (y = 0; y < dst->h; y++) {
 
 		osp=sp;
 		for (x = 0; x < dst->w; x++) {
@@ -224,13 +224,13 @@ static int _shrinkSurfaceY(SDL_Surface * src, SDL_Surface * dst, int factorx, in
 			for (dy=0; dy < factory; dy++) {
 				for (dx=0; dx < factorx; dx++) {
 					a += (*sp);
-					/* next x */           
+					/* next x */
 					sp++;
-				} 
-				/* end src dx loop */         
+				}
+				/* end src dx loop */
 				/* next y */
-				sp = (Uint8 *)((Uint8*)sp + (src->pitch - factorx)); 
-			} 
+				sp = (Uint8 *)((Uint8*)sp + (src->pitch - factorx));
+			}
 			/* end src dy loop */
 
 			/* next box-x */
@@ -240,26 +240,26 @@ static int _shrinkSurfaceY(SDL_Surface * src, SDL_Surface * dst, int factorx, in
 			*dp = a/n_average;
 
 			/*
-			* Advance destination pointer 
+			* Advance destination pointer
 			*/
 			dp++;
-		} 
+		}
 		/* end dst x loop */
 
 		/* next box-y */
 		sp = (Uint8 *)((Uint8*)osp + src->pitch*factory);
 
 		/*
-		* Advance destination pointers 
+		* Advance destination pointers
 		*/
 		dp = (Uint8 *)((Uint8 *)dp + dgap);
-	} 
+	}
 	/* end dst y loop */
 
 	return (0);
 }
 
-/*! 
+/*!
 \brief Internal 32 bit Zoomer with optional anti-aliasing by bilinear interpolation.
 
 Zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface.
@@ -282,7 +282,7 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 	int spixelgap, spixelw, spixelh, dgap, t1, t2;
 
 	/*
-	* Allocate memory for row/column increments 
+	* Allocate memory for row/column increments
 	*/
 	if ((sax = (int *) malloc((dst->w + 1) * sizeof(Uint32))) == NULL) {
 		return (-1);
@@ -293,7 +293,7 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 	}
 
 	/*
-	* Precalculate row increments 
+	* Precalculate row increments
 	*/
 	spixelw = (src->w - 1);
 	spixelh = (src->h - 1);
@@ -318,8 +318,8 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 		csx += sx;
 
 		/* Guard from overflows */
-		if (csx > ssx) { 
-			csx = ssx; 
+		if (csx > ssx) {
+			csx = ssx;
 		}
 	}
 
@@ -346,12 +346,12 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 	if (flipy) sp += (spixelgap * spixelh);
 
 	/*
-	* Switch between interpolating and non-interpolating code 
+	* Switch between interpolating and non-interpolating code
 	*/
 	if (smooth) {
 
 		/*
-		* Interpolating Zoom 
+		* Interpolating Zoom
 		*/
 		csay = say;
 		for (y = 0; y < dst->h; y++) {
@@ -359,7 +359,7 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 			csax = sax;
 			for (x = 0; x < dst->w; x++) {
 				/*
-				* Setup color source pointers 
+				* Setup color source pointers
 				*/
 				ex = (*csax & 0xffff);
 				ey = (*csay & 0xffff);
@@ -389,7 +389,7 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 				}
 
 				/*
-				* Draw and interpolate colors 
+				* Draw and interpolate colors
 				*/
 				t1 = ((((c01->r - c00->r) * ex) >> 16) + c00->r) & 0xff;
 				t2 = ((((c11->r - c10->r) * ex) >> 16) + c10->r) & 0xff;
@@ -427,7 +427,7 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 			csay++;
 			sstep = (*csay >> 16) - (*salast >> 16);
 			sstep *= spixelgap;
-			if (flipy) { 
+			if (flipy) {
 				sp = csp - sstep;
 			} else {
 				sp = csp + sstep;
@@ -440,7 +440,7 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 		}
 	} else {
 		/*
-		* Non-Interpolating Zoom 
+		* Non-Interpolating Zoom
 		*/		
 		csay = say;
 		for (y = 0; y < dst->h; y++) {
@@ -448,7 +448,7 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 			csax = sax;
 			for (x = 0; x < dst->w; x++) {
 				/*
-				* Draw 
+				* Draw
 				*/
 				*dp = *sp;
 
@@ -484,7 +484,7 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 	}
 
 	/*
-	* Remove temp arrays 
+	* Remove temp arrays
 	*/
 	free(sax);
 	free(say);
@@ -492,7 +492,7 @@ static int _zoomSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int flipx, int
 	return (0);
 }
 
-/*! 
+/*!
 
 \brief Internal 8 bit Zoomer without smoothing.
 
@@ -516,7 +516,7 @@ static int _zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst, int flipx, int fl
 	int dgap;
 
 	/*
-	* Allocate memory for row increments 
+	* Allocate memory for row increments
 	*/
 	if ((sax = (Uint32 *) malloc((dst->w + 1) * sizeof(Uint32))) == NULL) {
 		return (-1);
@@ -527,7 +527,7 @@ static int _zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst, int flipx, int fl
 	}
 
 	/*
-	* Pointer setup 
+	* Pointer setup
 	*/
 	sp = csp = (Uint8 *) src->pixels;
 	dp = (Uint8 *) dst->pixels;
@@ -537,7 +537,7 @@ static int _zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst, int flipx, int fl
 	if (flipy) csp  = ( (Uint8*)csp + src->pitch*(src->h-1) );
 
 	/*
-	* Precalculate row increments 
+	* Precalculate row increments
 	*/
 	csx = 0;
 	csax = sax;
@@ -565,7 +565,7 @@ static int _zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst, int flipx, int fl
 	}
 
 	/*
-	* Draw 
+	* Draw
 	*/
 	csay = say;
 	for (y = 0; y < dst->h; y++) {
@@ -573,33 +573,33 @@ static int _zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst, int flipx, int fl
 		sp = csp;
 		for (x = 0; x < dst->w; x++) {
 			/*
-			* Draw 
+			* Draw
 			*/
 			*dp = *sp;
 			/*
-			* Advance source pointers 
+			* Advance source pointers
 			*/
 			sp += (*csax);
 			csax++;
 			/*
-			* Advance destination pointer 
+			* Advance destination pointer
 			*/
 			dp++;
 		}
 		/*
-		* Advance source pointer (for row) 
+		* Advance source pointer (for row)
 		*/
 		csp += ((*csay) * src->pitch);
 		csay++;
 
 		/*
-		* Advance destination pointers 
+		* Advance destination pointers
 		*/
 		dp += dgap;
 	}
 
 	/*
-	* Remove temp arrays 
+	* Remove temp arrays
 	*/
 	free(sax);
 	free(say);
@@ -607,10 +607,10 @@ static int _zoomSurfaceY(SDL_Surface * src, SDL_Surface * dst, int flipx, int fl
 	return (0);
 }
 
-/*! 
+/*!
 \brief Internal 32 bit rotozoomer with optional anti-aliasing.
 
-Rotates and zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control 
+Rotates and zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control
 parameters by scanning the destination surface and applying optionally anti-aliasing
 by bilinear interpolation.
 Assumes src and dst surfaces are of 32 bit depth.
@@ -634,7 +634,7 @@ static void _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx,
 	int gap;
 
 	/*
-	* Variable setup 
+	* Variable setup
 	*/
 	xd = ((src->w - dst->w) << 15);
 	yd = ((src->h - dst->h) << 15);
@@ -646,7 +646,7 @@ static void _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx,
 	gap = dst->pitch - dst->w * 4;
 
 	/*
-	* Switch between interpolating and non-interpolating code 
+	* Switch between interpolating and non-interpolating code
 	*/
 	if (smooth) {
 		for (y = 0; y < dst->h; y++) {
@@ -678,7 +678,7 @@ static void _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx,
 						cswap = c01; c01=c11; c11=cswap;
 					}
 					/*
-					* Interpolate colors 
+					* Interpolate colors
 					*/
 					ex = (sdx & 0xffff);
 					ey = (sdy & 0xffff);
@@ -729,7 +729,7 @@ static void _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx,
 
 \brief Rotates and zooms 8 bit palette/Y 'src' surface to 'dst' surface without smoothing.
 
-Rotates and zooms 8 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control 
+Rotates and zooms 8 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control
 parameters by scanning the destination surface.
 Assumes src and dst surfaces are of 8 bit depth.
 Assumes dst surface was allocated with the correct dimensions.
@@ -750,7 +750,7 @@ static void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int
 	int gap;
 
 	/*
-	* Variable setup 
+	* Variable setup
 	*/
 	xd = ((src->w - dst->w) << 15);
 	yd = ((src->h - dst->h) << 15);
@@ -759,11 +759,11 @@ static void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int
 	pc = (tColorY*) dst->pixels;
 	gap = dst->pitch - dst->w;
 	/*
-	* Clear surface to colorkey 
+	* Clear surface to colorkey
 	*/ 	
 	memset(pc, (int)(_colorkey(src) & 0xff), dst->pitch * dst->h);
 	/*
-	* Iterate through destination surface 
+	* Iterate through destination surface
 	*/
 	for (y = 0; y < dst->h; y++) {
 		dy = cy - y;
@@ -790,7 +790,7 @@ static void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int
 /*!
 \brief Rotates a 8/16/24/32 bit surface in increments of 90 degrees.
 
-Specialized 90 degree rotator which rotates a 'src' surface in 90 degree 
+Specialized 90 degree rotator which rotates a 'src' surface in 90 degree
 increments clockwise returning a new surface. Faster than rotozoomer since
 no scanning or interpolation takes place. Input surface must be 8/16/24/32 bit.
 (code contributed by J. Schiller, improved by C. Allport and A. Schiffler)
@@ -800,7 +800,7 @@ no scanning or interpolation takes place. Input surface must be 8/16/24/32 bit.
 
 \returns The new, rotated surface; or NULL for surfaces with incorrect input format.
 */
-SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns) 
+SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
 {
 	int row, col, newWidth, newHeight;
 	int bpp, bpr;
@@ -810,15 +810,15 @@ SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
 	int normalizedClockwiseTurns;
 
 	/* Has to be a valid surface pointer and be a Nbit surface where n is divisible by 8 */
-	if (!src || 
+	if (!src ||
 	    !src->format) {
 		SDL_SetError("NULL source surface or source surface format");
-	    return NULL; 
+	    return NULL;
 	}
 
 	if ((src->format->BitsPerPixel % 8) != 0) {
 		SDL_SetError("Invalid source surface bit depth");
-	    return NULL; 
+	    return NULL;
 	}
 
 	/* normalize numClockwiseTurns */
@@ -838,11 +838,11 @@ SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
 
 	dst = SDL_CreateRGBSurface( src->flags, newWidth, newHeight, src->format->BitsPerPixel,
 		src->format->Rmask,
-		src->format->Gmask, 
-		src->format->Bmask, 
+		src->format->Gmask,
+		src->format->Bmask,
 		src->format->Amask);
 	if(!dst) {
-		SDL_SetError("Could not create destination surface"); 
+		SDL_SetError("Could not create destination surface");
 		return NULL;
 	}
 
@@ -891,8 +891,8 @@ SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
 					memcpy (dstBuf, srcBuf, bpp);
 					srcBuf += bpp;
 					dstBuf += dst->pitch;
-				} 
-			} 
+				}
+			}
 		}
 		break;
 
@@ -905,8 +905,8 @@ SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
 					memcpy (dstBuf, srcBuf, bpp);
 					srcBuf += bpp;
 					dstBuf -= bpp;
-				} 
-			} 
+				}
+			}
 		}
 		break;
 
@@ -919,11 +919,11 @@ SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
 					memcpy (dstBuf, srcBuf, bpp);
 					srcBuf += bpp;
 					dstBuf -= dst->pitch;
-				} 
-			} 
+				}
+			}
 		}
 		break;
-	} 
+	}
 	/* end switch */
 
 	if (SDL_MUSTLOCK(src)) {
@@ -938,7 +938,7 @@ SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
 
 
 /*!
-\brief Internal target surface sizing function for rotozooms with trig result return. 
+\brief Internal target surface sizing function for rotozooms with trig result return.
 
 \param width The source surface width.
 \param height The source surface height.
@@ -952,7 +952,7 @@ SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns)
 
 */
 static void _rotozoomSurfaceSizeTrig(int width, int height, double angle, double zoomx, double zoomy,
-	int *dstwidth, int *dstheight, 
+	int *dstwidth, int *dstheight,
 	double *canglezoom, double *sanglezoom)
 {
 	double x, y, cx, cy, sx, sy;
@@ -960,7 +960,7 @@ static void _rotozoomSurfaceSizeTrig(int width, int height, double angle, double
 	int dstwidthhalf, dstheighthalf;
 
 	/*
-	* Determine destination width and height by rotating a centered source box 
+	* Determine destination width and height by rotating a centered source box
 	*/
 	radangle = angle * (M_PI / 180.0);
 	*sanglezoom = sin(radangle);
@@ -982,8 +982,8 @@ static void _rotozoomSurfaceSizeTrig(int width, int height, double angle, double
 	*dstheight = 2 * dstheighthalf;
 }
 
-/*! 
-\brief Returns the size of the resulting target surface for a rotozoomSurfaceXY() call. 
+/*!
+\brief Returns the size of the resulting target surface for a rotozoomSurfaceXY() call.
 
 \param width The source surface width.
 \param height The source surface height.
@@ -1000,8 +1000,8 @@ void rotozoomSurfaceSizeXY(int width, int height, double angle, double zoomx, do
 	_rotozoomSurfaceSizeTrig(width, height, angle, zoomx, zoomy, dstwidth, dstheight, &dummy_sanglezoom, &dummy_canglezoom);
 }
 
-/*! 
-\brief Returns the size of the resulting target surface for a rotozoomSurface() call. 
+/*!
+\brief Returns the size of the resulting target surface for a rotozoomSurface() call.
 
 \param width The source surface width.
 \param height The source surface height.
@@ -1018,7 +1018,7 @@ void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *
 }
 
 /*!
-\brief Rotates and zooms a surface and optional anti-aliasing. 
+\brief Rotates and zooms a surface and optional anti-aliasing.
 
 Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
 'angle' is the rotation in degrees and 'zoom' a scaling factor. If 'smooth' is set
@@ -1038,7 +1038,7 @@ SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int s
 }
 
 /*!
-\brief Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing. 
+\brief Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing.
 
 Rotates and zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface.
 'angle' is the rotation in degrees, 'zoomx and 'zoomy' scaling factors. If 'smooth' is set
@@ -1065,28 +1065,28 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 	int flipx,flipy;
 
 	/*
-	* Sanity check 
+	* Sanity check
 	*/
 	if (src == NULL) {
 		return (NULL);
 	}
 
 	/*
-	* Determine if source surface is 32bit or 8bit 
+	* Determine if source surface is 32bit or 8bit
 	*/
 	is32bit = (src->format->BitsPerPixel == 32);
 	if ((is32bit) || (src->format->BitsPerPixel == 8)) {
 		/*
-		* Use source surface 'as is' 
+		* Use source surface 'as is'
 		*/
 		rz_src = src;
 		src_converted = 0;
 	} else {
 		/*
-		* New source surface is 32bit with a defined RGBA ordering 
+		* New source surface is 32bit with a defined RGBA ordering
 		*/
 		rz_src =
-			SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32, 
+			SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32,
 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
 			0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000
 #else
@@ -1101,7 +1101,7 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 	}
 
 	/*
-	* Sanity check zoom factor 
+	* Sanity check zoom factor
 	*/
 	flipx = (zoomx<0.0);
 	if (flipx) zoomx=-zoomx;
@@ -1112,22 +1112,22 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 	zoominv = 65536.0 / (zoomx * zoomx);
 
 	/*
-	* Check if we have a rotozoom or just a zoom 
+	* Check if we have a rotozoom or just a zoom
 	*/
 	if (fabs(angle) > VALUE_LIMIT) {
 
 		/*
-		* Angle!=0: full rotozoom 
+		* Angle!=0: full rotozoom
 		*/
 		/*
-		* ----------------------- 
+		* -----------------------
 		*/
 
 		/* Determine target size */
 		_rotozoomSurfaceSizeTrig(rz_src->w, rz_src->h, angle, zoomx, zoomy, &dstwidth, &dstheight, &canglezoom, &sanglezoom);
 
 		/*
-		* Calculate target factors from sin/cos and zoom 
+		* Calculate target factors from sin/cos and zoom
 		*/
 		sanglezoominv = sanglezoom;
 		canglezoominv = canglezoom;
@@ -1139,12 +1139,12 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 		dstheighthalf = dstheight / 2;
 
 		/*
-		* Alloc space to completely contain the rotated surface 
+		* Alloc space to completely contain the rotated surface
 		*/
 		rz_dst = NULL;
 		if (is32bit) {
 			/*
-			* Target surface is 32bit with source RGBA/ABGR ordering 
+			* Target surface is 32bit with source RGBA/ABGR ordering
 			*/
 			rz_dst =
 				SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32,
@@ -1152,7 +1152,7 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 				rz_src->format->Bmask, rz_src->format->Amask);
 		} else {
 			/*
-			* Target surface is 8bit 
+			* Target surface is 8bit
 			*/
 			rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0);
 		}
@@ -1165,40 +1165,40 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 		rz_dst->h = dstheight;
 
 		/*
-		* Lock source surface 
+		* Lock source surface
 		*/
 		if (SDL_MUSTLOCK(rz_src)) {
 			SDL_LockSurface(rz_src);
 		}
 
 		/*
-		* Check which kind of surface we have 
+		* Check which kind of surface we have
 		*/
 		if (is32bit) {
 			/*
-			* Call the 32bit transformation routine to do the rotation (using alpha) 
+			* Call the 32bit transformation routine to do the rotation (using alpha)
 			*/
 			_transformSurfaceRGBA(rz_src, rz_dst, dstwidthhalf, dstheighthalf,
-				(int) (sanglezoominv), (int) (canglezoominv), 
+				(int) (sanglezoominv), (int) (canglezoominv),
 				flipx, flipy,
 				smooth);
 		} else {
 			/*
-			* Copy palette and colorkey info 
+			* Copy palette and colorkey info
 			*/
 			for (i = 0; i < rz_src->format->palette->ncolors; i++) {
 				rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i];
 			}
 			rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors;
 			/*
-			* Call the 8bit transformation routine to do the rotation 
+			* Call the 8bit transformation routine to do the rotation
 			*/
 			transformSurfaceY(rz_src, rz_dst, dstwidthhalf, dstheighthalf,
 				(int) (sanglezoominv), (int) (canglezoominv),
 				flipx, flipy);
 		}
 		/*
-		* Unlock source surface 
+		* Unlock source surface
 		*/
 		if (SDL_MUSTLOCK(rz_src)) {
 			SDL_UnlockSurface(rz_src);
@@ -1207,10 +1207,10 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 	} else {
 
 		/*
-		* Angle=0: Just a zoom 
+		* Angle=0: Just a zoom
 		*/
 		/*
-		* -------------------- 
+		* --------------------
 		*/
 
 		/*
@@ -1219,12 +1219,12 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 		zoomSurfaceSize(rz_src->w, rz_src->h, zoomx, zoomy, &dstwidth, &dstheight);
 
 		/*
-		* Alloc space to completely contain the zoomed surface 
+		* Alloc space to completely contain the zoomed surface
 		*/
 		rz_dst = NULL;
 		if (is32bit) {
 			/*
-			* Target surface is 32bit with source RGBA/ABGR ordering 
+			* Target surface is 32bit with source RGBA/ABGR ordering
 			*/
 			rz_dst =
 				SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32,
@@ -1232,7 +1232,7 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 				rz_src->format->Bmask, rz_src->format->Amask);
 		} else {
 			/*
-			* Target surface is 8bit 
+			* Target surface is 8bit
 			*/
 			rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0);
 		}
@@ -1245,24 +1245,24 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 		rz_dst->h = dstheight;
 
 		/*
-		* Lock source surface 
+		* Lock source surface
 		*/
 		if (SDL_MUSTLOCK(rz_src)) {
 			SDL_LockSurface(rz_src);
 		}
 
 		/*
-		* Check which kind of surface we have 
+		* Check which kind of surface we have
 		*/
 		if (is32bit) {
 			/*
-			* Call the 32bit transformation routine to do the zooming (using alpha) 
+			* Call the 32bit transformation routine to do the zooming (using alpha)
 			*/
 			_zoomSurfaceRGBA(rz_src, rz_dst, flipx, flipy, smooth);
 
 		} else {
 			/*
-			* Copy palette and colorkey info 
+			* Copy palette and colorkey info
 			*/
 			for (i = 0; i < rz_src->format->palette->ncolors; i++) {
 				rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i];
@@ -1270,13 +1270,13 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 			rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors;
 
 			/*
-			* Call the 8bit transformation routine to do the zooming 
+			* Call the 8bit transformation routine to do the zooming
 			*/
 			_zoomSurfaceY(rz_src, rz_dst, flipx, flipy);
 		}
 
 		/*
-		* Unlock source surface 
+		* Unlock source surface
 		*/
 		if (SDL_MUSTLOCK(rz_src)) {
 			SDL_UnlockSurface(rz_src);
@@ -1284,14 +1284,14 @@ SDL_Surface *rotozoomSurfaceXY(SDL_Surface * src, double angle, double zoomx, do
 	}
 
 	/*
-	* Cleanup temp surface 
+	* Cleanup temp surface
 	*/
 	if (src_converted) {
 		SDL_FreeSurface(rz_src);
 	}
 
 	/*
-	* Return destination surface 
+	* Return destination surface
 	*/
 	return (rz_dst);
 }
@@ -1311,7 +1311,7 @@ The minimum size of the target surface is 1. The input factors can be positive o
 void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight)
 {
 	/*
-	* Make zoom factors positive 
+	* Make zoom factors positive
 	*/
 	int flipx, flipy;
 	flipx = (zoomx<0.0);
@@ -1320,7 +1320,7 @@ void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dst
 	if (flipy) zoomy = -zoomy;
 
 	/*
-	* Sanity check zoom factors 
+	* Sanity check zoom factors
 	*/
 	if (zoomx < VALUE_LIMIT) {
 		zoomx = VALUE_LIMIT;
@@ -1330,7 +1330,7 @@ void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dst
 	}
 
 	/*
-	* Calculate target size 
+	* Calculate target size
 	*/
 	*dstwidth = (int) floor(((double) width * zoomx) + 0.5);
 	*dstheight = (int) floor(((double) height * zoomy) + 0.5);
@@ -1342,7 +1342,7 @@ void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dst
 	}
 }
 
-/*! 
+/*!
 \brief Zoom a surface by independent horizontal and vertical factors with optional smoothing.
 
 Zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface.
@@ -1368,27 +1368,27 @@ SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smoo
 	int flipx, flipy;
 
 	/*
-	* Sanity check 
+	* Sanity check
 	*/
 	if (src == NULL)
 		return (NULL);
 
 	/*
-	* Determine if source surface is 32bit or 8bit 
+	* Determine if source surface is 32bit or 8bit
 	*/
 	is32bit = (src->format->BitsPerPixel == 32);
 	if ((is32bit) || (src->format->BitsPerPixel == 8)) {
 		/*
-		* Use source surface 'as is' 
+		* Use source surface 'as is'
 		*/
 		rz_src = src;
 		src_converted = 0;
 	} else {
 		/*
-		* New source surface is 32bit with a defined RGBA ordering 
+		* New source surface is 32bit with a defined RGBA ordering
 		*/
 		rz_src =
-			SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32, 
+			SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32,
 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
 			0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000
 #else
@@ -1412,12 +1412,12 @@ SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smoo
 	zoomSurfaceSize(rz_src->w, rz_src->h, zoomx, zoomy, &dstwidth, &dstheight);
 
 	/*
-	* Alloc space to completely contain the zoomed surface 
+	* Alloc space to completely contain the zoomed surface
 	*/
 	rz_dst = NULL;
 	if (is32bit) {
 		/*
-		* Target surface is 32bit with source RGBA/ABGR ordering 
+		* Target surface is 32bit with source RGBA/ABGR ordering
 		*/
 		rz_dst =
 			SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32,
@@ -1425,7 +1425,7 @@ SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smoo
 			rz_src->format->Bmask, rz_src->format->Amask);
 	} else {
 		/*
-		* Target surface is 8bit 
+		* Target surface is 8bit
 		*/
 		rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0);
 	}
@@ -1433,7 +1433,7 @@ SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smoo
 	/* Check target */
 	if (rz_dst == NULL) {
 		/*
-		* Cleanup temp surface 
+		* Cleanup temp surface
 		*/
 		if (src_converted) {
 			SDL_FreeSurface(rz_src);
@@ -1445,54 +1445,54 @@ SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smoo
 	rz_dst->h = dstheight;
 
 	/*
-	* Lock source surface 
+	* Lock source surface
 	*/
 	if (SDL_MUSTLOCK(rz_src)) {
 		SDL_LockSurface(rz_src);
 	}
 
 	/*
-	* Check which kind of surface we have 
+	* Check which kind of surface we have
 	*/
 	if (is32bit) {
 		/*
-		* Call the 32bit transformation routine to do the zooming (using alpha) 
+		* Call the 32bit transformation routine to do the zooming (using alpha)
 		*/
 		_zoomSurfaceRGBA(rz_src, rz_dst, flipx, flipy, smooth);
 	} else {
 		/*
-		* Copy palette and colorkey info 
+		* Copy palette and colorkey info
 		*/
 		for (i = 0; i < rz_src->format->palette->ncolors; i++) {
 			rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i];
 		}
 		rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors;
 		/*
-		* Call the 8bit transformation routine to do the zooming 
+		* Call the 8bit transformation routine to do the zooming
 		*/
 		_zoomSurfaceY(rz_src, rz_dst, flipx, flipy);
 	}
 	/*
-	* Unlock source surface 
+	* Unlock source surface
 	*/
 	if (SDL_MUSTLOCK(rz_src)) {
 		SDL_UnlockSurface(rz_src);
 	}
 
 	/*
-	* Cleanup temp surface 
+	* Cleanup temp surface
 	*/
 	if (src_converted) {
 		SDL_FreeSurface(rz_src);
 	}
 
 	/*
-	* Return destination surface 
+	* Return destination surface
 	*/
 	return (rz_dst);
 }
 
-/*! 
+/*!
 \brief Shrink a surface by an integer ratio using averaging.
 
 Shrinks a 32bit or 8bit 'src' surface to a newly created 'dst' surface.
@@ -1508,7 +1508,7 @@ The input surface is not modified. The output surface is newly allocated.
 
 \return The new, shrunken surface.
 */
-/*@null@*/ 
+/*@null@*/
 SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
 {
 	int result;
@@ -1520,27 +1520,27 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
 	int haveError = 0;
 
 	/*
-	* Sanity check 
+	* Sanity check
 	*/
 	if (src == NULL) {
 		return (NULL);
 	}
 
 	/*
-	* Determine if source surface is 32bit or 8bit 
+	* Determine if source surface is 32bit or 8bit
 	*/
 	is32bit = (src->format->BitsPerPixel == 32);
 	if ((is32bit) || (src->format->BitsPerPixel == 8)) {
 		/*
-		* Use source surface 'as is' 
+		* Use source surface 'as is'
 		*/
 		rz_src = src;
 		src_converted = 0;
 	} else {
 		/*
-		* New source surface is 32bit with a defined RGBA ordering 
+		* New source surface is 32bit with a defined RGBA ordering
 		*/
-		rz_src = SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32, 
+		rz_src = SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32,
 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
 			0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000
 #else
@@ -1558,7 +1558,7 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
 	}
 
 	/*
-	* Lock the surface 
+	* Lock the surface
 	*/
 	if (SDL_MUSTLOCK(rz_src)) {
 		if (SDL_LockSurface(rz_src) < 0) {
@@ -1579,7 +1579,7 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
 	*/
 	if (is32bit==1) {
 		/*
-		* Target surface is 32bit with source RGBA/ABGR ordering 
+		* Target surface is 32bit with source RGBA/ABGR ordering
 		*/
 		rz_dst =
 			SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32,
@@ -1587,7 +1587,7 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
 			rz_src->format->Bmask, rz_src->format->Amask);
 	} else {
 		/*
-		* Target surface is 8bit 
+		* Target surface is 8bit
 		*/
 		rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0);
 	}
@@ -1602,11 +1602,11 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
 	rz_dst->h = dstheight;
 
 	/*
-	* Check which kind of surface we have 
+	* Check which kind of surface we have
 	*/
 	if (is32bit==1) {
 		/*
-		* Call the 32bit transformation routine to do the shrinking (using alpha) 
+		* Call the 32bit transformation routine to do the shrinking (using alpha)
 		*/
 		result = _shrinkSurfaceRGBA(rz_src, rz_dst, factorx, factory);		
 		if ((result!=0) || (rz_dst==NULL)) {
@@ -1615,14 +1615,14 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
 		}
 	} else {
 		/*
-		* Copy palette and colorkey info 
+		* Copy palette and colorkey info
 		*/
 		for (i = 0; i < rz_src->format->palette->ncolors; i++) {
 			rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i];
 		}
 		rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors;
 		/*
-		* Call the 8bit transformation routine to do the shrinking 
+		* Call the 8bit transformation routine to do the shrinking
 		*/
 		result = _shrinkSurfaceY(rz_src, rz_dst, factorx, factory);
 		if (result!=0) {
@@ -1634,14 +1634,14 @@ SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory)
 exitShrinkSurface:
 	if (rz_src!=NULL) {
 		/*
-		* Unlock source surface 
+		* Unlock source surface
 		*/
 		if (SDL_MUSTLOCK(rz_src)) {
 			SDL_UnlockSurface(rz_src);
 		}
 
 		/*
-		* Cleanup temp surface 
+		* Cleanup temp surface
 		*/
 		if (src_converted==1) {
 			SDL_FreeSurface(rz_src);
@@ -1654,10 +1654,10 @@ exitShrinkSurface:
 			SDL_FreeSurface(rz_dst);
 		}
 		rz_dst=NULL;
-	} 
+	}
 
 	/*
-	* Return destination surface 
+	* Return destination surface
 	*/
 	return (rz_dst);
 }
diff --git a/dependencies/SDL2_gfx/SDL2_rotozoom.h b/dependencies/SDL2_gfx/SDL2_rotozoom.h
index 88c3c11432..7f837a0963 100644
--- a/dependencies/SDL2_gfx/SDL2_rotozoom.h
+++ b/dependencies/SDL2_gfx/SDL2_rotozoom.h
@@ -1,4 +1,4 @@
-/*  
+/*
 
 SDL2_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces
 
@@ -77,7 +77,7 @@ extern "C" {
 #  define SDL2_ROTOZOOM_SCOPE extern
 #endif
 
-	/* 
+	/*
 
 	Rotozoom functions
 
@@ -93,10 +93,10 @@ extern "C" {
 		int *dstheight);
 
 	SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSizeXY
-		(int width, int height, double angle, double zoomx, double zoomy, 
+		(int width, int height, double angle, double zoomx, double zoomy,
 		int *dstwidth, int *dstheight);
 
-	/* 
+	/*
 
 	Zooming functions
 
@@ -106,15 +106,15 @@ extern "C" {
 
 	SDL2_ROTOZOOM_SCOPE void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight);
 
-	/* 
+	/*
 
 	Shrinking functions
 
-	*/     
+	*/
 
 	SDL2_ROTOZOOM_SCOPE SDL_Surface *shrinkSurface(SDL_Surface * src, int factorx, int factory);
 
-	/* 
+	/*
 
 	Specialized rotation functions
 
-- 
2.51.0

