Skip to content

Commit b2baf34

Browse files
committed
Use now available enum values.
1 parent 9b0d786 commit b2baf34

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/render/sdlgpu/SDL_render_gpu.c

+8-13
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ typedef struct GPU_TextureData
103103
#endif
104104
} GPU_TextureData;
105105

106-
enum
107-
{
108-
BLEND_INVALID = 0x7fffffff,
109-
};
110-
111106
static SDL_GpuBlendFactor GetBlendFunc(SDL_BlendFactor factor)
112107
{
113108
switch (factor) {
@@ -132,7 +127,7 @@ static SDL_GpuBlendFactor GetBlendFunc(SDL_BlendFactor factor)
132127
case SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA:
133128
return SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA;
134129
default:
135-
return BLEND_INVALID;
130+
return SDL_GPU_BLENDFACTOR_INVALID;
136131
}
137132
}
138133

@@ -150,7 +145,7 @@ static SDL_GpuBlendOp GetBlendEquation(SDL_BlendOperation operation)
150145
case SDL_BLENDOPERATION_MAXIMUM:
151146
return SDL_GPU_BLENDOP_MAX;
152147
default:
153-
return BLEND_INVALID;
148+
return SDL_GPU_BLENDOP_INVALID;
154149
}
155150
}
156151

@@ -163,12 +158,12 @@ static SDL_bool GPU_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blen
163158
SDL_BlendFactor dstAlphaFactor = SDL_GetBlendModeDstAlphaFactor(blendMode);
164159
SDL_BlendOperation alphaOperation = SDL_GetBlendModeAlphaOperation(blendMode);
165160

166-
if (GetBlendFunc(srcColorFactor) == BLEND_INVALID ||
167-
GetBlendFunc(srcAlphaFactor) == BLEND_INVALID ||
168-
GetBlendEquation(colorOperation) == BLEND_INVALID ||
169-
GetBlendFunc(dstColorFactor) == BLEND_INVALID ||
170-
GetBlendFunc(dstAlphaFactor) == BLEND_INVALID ||
171-
GetBlendEquation(alphaOperation) == BLEND_INVALID) {
161+
if (GetBlendFunc(srcColorFactor) == SDL_GPU_BLENDFACTOR_INVALID ||
162+
GetBlendFunc(srcAlphaFactor) == SDL_GPU_BLENDFACTOR_INVALID ||
163+
GetBlendEquation(colorOperation) == SDL_GPU_BLENDOP_INVALID ||
164+
GetBlendFunc(dstColorFactor) == SDL_GPU_BLENDFACTOR_INVALID ||
165+
GetBlendFunc(dstAlphaFactor) == SDL_GPU_BLENDFACTOR_INVALID ||
166+
GetBlendEquation(alphaOperation) == SDL_GPU_BLENDOP_INVALID) {
172167
return SDL_FALSE;
173168
}
174169

0 commit comments

Comments
 (0)