mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Removed костыли ебаные
This commit is contained in:
parent
a2e5e8adcd
commit
3e3c97fe01
3 changed files with 5 additions and 36 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
//:3
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
Loading…
Reference in a new issue