fix texture blend mode, reenabling transparency
Some checks failed
ContinuousIntegration / linux (push) Successful in 4m15s
ContinuousDelivery / linux-ubuntu (push) Failing after 4m54s
ContinuousIntegration / android (push) Successful in 5m42s
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled

This commit is contained in:
Green Sky 2024-06-01 12:51:50 +02:00
parent 95eb0eb26d
commit fc5023ec1c
No known key found for this signature in database

View File

@ -31,6 +31,11 @@ uint64_t SDLRendererTextureUploader::uploadRGBA(const uint8_t* data, uint32_t wi
// TODO: error reporting // TODO: error reporting
SDL_UpdateTexture(tex, nullptr, surf->pixels, surf->pitch); SDL_UpdateTexture(tex, nullptr, surf->pixels, surf->pitch);
SDL_BlendMode surf_blend_mode = SDL_BLENDMODE_NONE;
if (SDL_GetSurfaceBlendMode(surf, &surf_blend_mode) == 0) {
SDL_SetTextureBlendMode(tex, surf_blend_mode);
}
if (filter == NEAREST) { if (filter == NEAREST) {
SDL_SetTextureScaleMode(tex, SDL_SCALEMODE_NEAREST); SDL_SetTextureScaleMode(tex, SDL_SCALEMODE_NEAREST);
} else if (filter == LINEAR) { } else if (filter == LINEAR) {