From 68a54d2594b60ec9883b76bb5f85c36f249cd3b6 Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 22 Aug 2020 11:17:35 -0700 Subject: [PATCH] Axe endian_swap() function and template Neither of these were used anywhere, so to simplify the code and prevent having potentially broken code that's never shown to be broken because it's never tested, I'm removing these. --- desktop_version/src/GraphicsUtil.cpp | 17 ----------------- desktop_version/src/GraphicsUtil.h | 2 -- 2 files changed, 19 deletions(-) diff --git a/desktop_version/src/GraphicsUtil.cpp b/desktop_version/src/GraphicsUtil.cpp index 159fe26a..b0312cad 100644 --- a/desktop_version/src/GraphicsUtil.cpp +++ b/desktop_version/src/GraphicsUtil.cpp @@ -11,23 +11,6 @@ void setRect( SDL_Rect& _r, int x, int y, int w, int h ) _r.h = h; } -unsigned int endian_swap( unsigned int x ) -{ - return (x>>24) | - ((x<<8) & 0x00FF0000) | - ((x>>8) & 0x0000FF00) | - (x<<24); -} - - -template -void endian_swap(T *objp) -{ - unsigned char *memp = reinterpret_cast(objp); - std::reverse(memp, memp + sizeof(T)); -} - - SDL_Surface* GetSubSurface( SDL_Surface* metaSurface, int x, int y, int width, int height ) { // Create an SDL_Rect with the area of the _surface diff --git a/desktop_version/src/GraphicsUtil.h b/desktop_version/src/GraphicsUtil.h index 9424115d..f6faddd4 100644 --- a/desktop_version/src/GraphicsUtil.h +++ b/desktop_version/src/GraphicsUtil.h @@ -11,8 +11,6 @@ struct colourTransform void setRect(SDL_Rect& _r, int x, int y, int w, int h); -unsigned int endian_swap(unsigned int x); - SDL_Surface* GetSubSurface( SDL_Surface* metaSurface, int x, int y, int width, int height ); void DrawPixel( SDL_Surface *surface, int x, int y, Uint32 pixel );