From b5057edf29a1ba0902226e34b1af3ffba0a63cdb Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 7 Nov 2023 09:23:26 -0800
Subject: [PATCH] Remove unused SDL_TextureModulate enum
Fixes https://github.com/libsdl-org/SDL/issues/6387
---
include/SDL3/SDL_render.h | 10 ----------
src/render/SDL_render.c | 10 ----------
src/render/SDL_sysrender.h | 1 -
3 files changed, 21 deletions(-)
diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h
index 120c3968fd60..0a58fadf5fdc 100644
--- a/include/SDL3/SDL_render.h
+++ b/include/SDL3/SDL_render.h
@@ -115,16 +115,6 @@ typedef enum
SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */
} SDL_TextureAccess;
-/**
- * The texture channel modulation used in SDL_RenderTexture().
- */
-typedef enum
-{
- SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */
- SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */
- SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */
-} SDL_TextureModulate;
-
/**
* Flip constants for SDL_RenderTextureRotated
*/
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index dfcd8a97d0f5..b4dc16fe5e06 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -1408,11 +1408,6 @@ int SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b)
{
CHECK_TEXTURE_MAGIC(texture, -1);
- if (r < 255 || g < 255 || b < 255) {
- texture->modMode |= SDL_TEXTUREMODULATE_COLOR;
- } else {
- texture->modMode &= ~SDL_TEXTUREMODULATE_COLOR;
- }
texture->color.r = r;
texture->color.g = g;
texture->color.b = b;
@@ -1442,11 +1437,6 @@ int SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha)
{
CHECK_TEXTURE_MAGIC(texture, -1);
- if (alpha < 255) {
- texture->modMode |= SDL_TEXTUREMODULATE_ALPHA;
- } else {
- texture->modMode &= ~SDL_TEXTUREMODULATE_ALPHA;
- }
texture->color.a = alpha;
if (texture->native) {
return SDL_SetTextureAlphaMod(texture->native, alpha);
diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h
index 38bc703b3cb3..afa2f652352b 100644
--- a/src/render/SDL_sysrender.h
+++ b/src/render/SDL_sysrender.h
@@ -65,7 +65,6 @@ struct SDL_Texture
int access; /**< SDL_TextureAccess */
int w; /**< The width of the texture */
int h; /**< The height of the texture */
- int modMode; /**< The texture modulation mode */
SDL_BlendMode blendMode; /**< The texture blend mode */
SDL_ScaleMode scaleMode; /**< The texture scale mode */
SDL_Color color; /**< Texture modulation values */