Blit directly to texture (#1870)

* Blit directly to texture

* Omit unneeded vars
This commit is contained in:
gendlin 2024-08-28 03:54:35 -04:00 committed by GitHub
parent edff3f2009
commit cbf2e289b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -665,9 +665,12 @@ void I_StartFrame(void)
static void UpdateRender(void) static void UpdateRender(void)
{ {
SDL_LockTexture(texture, &blit_rect, &argbbuffer->pixels,
&argbbuffer->pitch);
SDL_LowerBlit(screenbuffer, &blit_rect, argbbuffer, &blit_rect); SDL_LowerBlit(screenbuffer, &blit_rect, argbbuffer, &blit_rect);
SDL_UpdateTexture(texture, &blit_rect, argbbuffer->pixels,
argbbuffer->pitch); SDL_UnlockTexture(texture);
if (letterboxed) if (letterboxed)
{ {
@ -1814,16 +1817,9 @@ static void CreateSurfaces(int w, int h)
} }
// [FG] create intermediate ARGB frame buffer // [FG] create intermediate ARGB frame buffer
{
uint32_t rmask, gmask, bmask, amask;
int bpp;
SDL_PixelFormatEnumToMasks(SDL_PIXELFORMAT_ARGB8888, &bpp, argbbuffer = SDL_CreateRGBSurfaceWithFormatFrom(
&rmask, &gmask, &bmask, &amask); NULL, w, h, 8, 0, SDL_PIXELFORMAT_ARGB8888);
argbbuffer =
SDL_CreateRGBSurface(0, w, h, bpp, rmask, gmask, bmask, amask);
SDL_FillRect(argbbuffer, NULL, 0);
}
I_SetPalette(W_CacheLumpName("PLAYPAL", PU_CACHE)); I_SetPalette(W_CacheLumpName("PLAYPAL", PU_CACHE));