From 3d3cbc73e5c94ed80106364e901e941487344422 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 28 Aug 2004 09:09:34 +0000 Subject: [PATCH] SM_SDL_OrderedDither -> RageSurfaceUtils::OrderedDither SM_SDL_ErrorDiffusionDither -> RageSurfaceUtils::ErrorDiffusionDither (these have nothing to do with SDL; I'd rename the files but I hate losing CVS history) --- stepmania/src/BannerCache.cpp | 4 ++-- stepmania/src/RageBitmapTexture.cpp | 2 +- stepmania/src/SDL_dither.cpp | 4 ++-- stepmania/src/SDL_dither.h | 7 +++++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/stepmania/src/BannerCache.cpp b/stepmania/src/BannerCache.cpp index 807894da88..04e8d8b3c0 100644 --- a/stepmania/src/BannerCache.cpp +++ b/stepmania/src/BannerCache.cpp @@ -383,9 +383,9 @@ void BannerCache::CacheBannerInternal( CString BannerPath ) RageSurface *dst = CreateSurface( img->w, img->h, 16, 0x7C00, 0x03E0, 0x001F, 0x8000 ); - /* SM_SDL_OrderedDither is still faster than SM_SDL_ErrorDiffusionDither, and + /* OrderedDither is still faster than ErrorDiffusionDither, and * these images are very small and only displayed briefly. */ - SM_SDL_OrderedDither(img, dst); + RageSurfaceUtils::OrderedDither( img, dst ); delete img; img = dst; } diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index 4e6dcfd4c4..c754e5eb07 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -233,7 +233,7 @@ void RageBitmapTexture::Create() RageSurface *dst = CreateSurface( img->w, img->h, pfd->bpp, pfd->masks[0], pfd->masks[1], pfd->masks[2], pfd->masks[3] ); - SM_SDL_ErrorDiffusionDither(img, dst); + RageSurfaceUtils::ErrorDiffusionDither( img, dst ); delete img; img = dst; } diff --git a/stepmania/src/SDL_dither.cpp b/stepmania/src/SDL_dither.cpp index 18f62a0800..d628a189e6 100644 --- a/stepmania/src/SDL_dither.cpp +++ b/stepmania/src/SDL_dither.cpp @@ -52,7 +52,7 @@ static uint8_t DitherPixel(int x, int y, int intensity, int conv) return uint8_t((out_intensity + 1) >> 16); } -void SM_SDL_OrderedDither(const RageSurface *src, RageSurface *dst) +void RageSurfaceUtils::OrderedDither( const RageSurface *src, RageSurface *dst ) { static bool DitherMatCalc_initted = false; if( !DitherMatCalc_initted ) @@ -167,7 +167,7 @@ void SM_SDL_OrderedDither(const RageSurface *src, RageSurface *dst) /* This is very similar to SM_SDL_OrderedDither, except instead of using a matrix * containing rounding values, we truncate and then add the resulting error for * each pixel to the next pixel on the same line. (Maybe we could do both?) */ -void SM_SDL_ErrorDiffusionDither(const RageSurface *src, RageSurface *dst) +void RageSurfaceUtils::ErrorDiffusionDither( const RageSurface *src, RageSurface *dst ) { /* We can't dither to paletted surfaces. */ ASSERT( dst->format->BytesPerPixel > 1 ); diff --git a/stepmania/src/SDL_dither.h b/stepmania/src/SDL_dither.h index dc0c86a288..0c817b12fc 100644 --- a/stepmania/src/SDL_dither.h +++ b/stepmania/src/SDL_dither.h @@ -2,8 +2,11 @@ #define SM_SDL_DITHER_H struct RageSurface; -void SM_SDL_OrderedDither(const RageSurface *src, RageSurface *dst); -void SM_SDL_ErrorDiffusionDither(const RageSurface *src, RageSurface *dst); +namespace RageSurfaceUtils +{ + void OrderedDither(const RageSurface *src, RageSurface *dst); + void ErrorDiffusionDither(const RageSurface *src, RageSurface *dst); +}; #endif