Fix transition on software rendere

This commit is contained in:
Anders Jenbo 2025-07-07 02:29:13 +02:00
parent d95946abfe
commit 2f1935d826

View File

@ -800,9 +800,17 @@ void Direct3DRMSoftwareRenderer::Draw2DImage(
return; return;
} }
bool isUpscaling = centeredRect.w > srcRect.w || centeredRect.h > srcRect.h;
SDL_Surface* surface = m_textures[textureId].cached; SDL_Surface* surface = m_textures[textureId].cached;
SDL_UnlockSurface(surface); 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); SDL_LockSurface(surface);
} }