From 3e3c97fe016e471df9bb5cd398bdccf5ed042d6b Mon Sep 17 00:00:00 2001 From: ZakatTeamI2P Date: Sat, 4 Apr 2026 00:11:31 +0400 Subject: [PATCH] =?UTF-8?q?Removed=20=D0=BA=D0=BE=D1=81=D1=82=D1=8B=D0=BB?= =?UTF-8?q?=D0=B8=20=D0=B5=D0=B1=D0=B0=D0=BD=D1=8B=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bitmap.cpp | 9 +++------ src/oldimpls/sdl/include.h | 9 ++------- src/oldimpls/sdl/rgb-surfaces.cpp | 23 ----------------------- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/src/bitmap.cpp b/src/bitmap.cpp index 7b65da3..39c2e82 100644 --- a/src/bitmap.cpp +++ b/src/bitmap.cpp @@ -443,7 +443,7 @@ void Bitmap::stretchBlt(const IntRect &destRect, SDL_GetMasksForPixelFormat(SDL_PIXELFORMAT_ABGR8888, &bpp, &rMask, &gMask, &bMask, &aMask); SDL_Surface *blitTemp = - SDL_CreateRGBSurface(0, destRect.w, destRect.h, bpp, rMask, gMask, bMask, aMask); + SDL_CreateSurface(destRect.w, destRect.h, SDL_GetPixelFormatForMasks(bpp, rMask, gMask, bMask, aMask)); SDL_BlitSurfaceScaled(srcSurf, &srcRect, blitTemp, NULL, SDL_ScaleMode::SDL_SCALEMODE_NEAREST); @@ -899,11 +899,8 @@ static std::string fixupString(const char *str) return s; } -static void applyShadow(SDL_Surface *&in, const SDL_PixelFormatDetails* fm, const SDL_Color &c) -{ - //SDL_CreateSurface(32, 32, SDL_PIXELFORMAT_INDEX8); - SDL_Surface *out = SDL_CreateRGBSurface(0, in->w+1, in->h+1, fm->bits_per_pixel, fm->Rmask, fm->Gmask, fm->Bmask, fm->Amask); - //SDL_Surface *out = SDL_CreateRGBSurface(in->w+1, in->h+1, fm->Rmask, fm->Gmask, fm->Bmask, fm->Amask); +static void applyShadow(SDL_Surface *&in, const SDL_PixelFormatDetails* fm, const SDL_Color &c){ + SDL_Surface *out = SDL_CreateSurface(in->w+1, in->h+1, SDL_GetPixelFormatForMasks(fm->bits_per_pixel, fm->Rmask, fm->Gmask, fm->Bmask, fm->Amask)); float fr = c.r / 255.0f; float fg = c.g / 255.0f; diff --git a/src/oldimpls/sdl/include.h b/src/oldimpls/sdl/include.h index bfc8060..a78eecd 100644 --- a/src/oldimpls/sdl/include.h +++ b/src/oldimpls/sdl/include.h @@ -2,10 +2,5 @@ #ifndef _OLDIMPLS_SDL_INCLUDE_H #define _OLDIMPLS_SDL_INCLUDE_H - -SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); -SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format); -SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); -SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format); - -#endif \ No newline at end of file +//:3 +#endif diff --git a/src/oldimpls/sdl/rgb-surfaces.cpp b/src/oldimpls/sdl/rgb-surfaces.cpp index 9b0be9c..670858b 100644 --- a/src/oldimpls/sdl/rgb-surfaces.cpp +++ b/src/oldimpls/sdl/rgb-surfaces.cpp @@ -1,26 +1,3 @@ #include "include.h" // taken from: https://wiki.libsdl.org/SDL3/README-migration#sdl_surfaceh - -SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) -{ - return SDL_CreateSurface(width, height, - SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask)); -} - -SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format) -{ - return SDL_CreateSurface(width, height, (SDL_PixelFormat)format); -} - -SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) -{ - return SDL_CreateSurfaceFrom(width, height, - SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask), - pixels, pitch); -} - -SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format) -{ - return SDL_CreateSurfaceFrom(width, height, (SDL_PixelFormat)format, pixels, pitch); -} \ No newline at end of file