Fix transition on software rendere (#543)

This commit is contained in:
Anders Jenbo 2025-07-07 02:43:25 +02:00 committed by GitHub
parent d95946abfe
commit 6df6ae407c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -800,9 +800,17 @@ void Direct3DRMSoftwareRenderer::Draw2DImage(
return;
}
bool isUpscaling = centeredRect.w > srcRect.w || centeredRect.h > srcRect.h;
SDL_Surface* surface = m_textures[textureId].cached;
SDL_UnlockSurface(surface);
SDL_BlitSurfaceScaled(surface, &srcRect, m_renderedImage, &centeredRect, SDL_SCALEMODE_LINEAR);
SDL_BlitSurfaceScaled(
surface,
&srcRect,
m_renderedImage,
&centeredRect,
isUpscaling ? SDL_SCALEMODE_NEAREST : SDL_SCALEMODE_LINEAR
);
SDL_LockSurface(surface);
}