mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-15 16:14:05 +00:00
Fixed a few remaining functions to directly return their values instead of an error code.
This commit is contained in:
@@ -402,9 +402,8 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo
|
||||
return;
|
||||
}
|
||||
if (SDL_ISPIXELFORMAT_ALPHA(dst_format)) {
|
||||
SDL_BlendMode blendMode = SDL_BLENDMODE_NONE;
|
||||
ret = SDL_GetTextureBlendMode(dst, &blendMode);
|
||||
SDLTest_AssertCheck(ret == 0, "Verify result from SDL_GetTextureBlendMode(), expected: 0, got: %i", ret);
|
||||
SDL_BlendMode blendMode = SDL_GetTextureBlendMode(dst);
|
||||
SDLTest_AssertCheck(blendMode != SDL_BLENDMODE_INVALID, "Verify result from SDL_GetTextureBlendMode(), expected: !SDL_BLENDMODE_INVALID, got: 0x%" SDL_PRIx32, blendMode);
|
||||
SDLTest_AssertCheck(blendMode == SDL_BLENDMODE_BLEND, "Verify alpha texture blend mode, expected %d, got %" SDL_PRIu32, SDL_BLENDMODE_BLEND, blendMode);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@ static void surfaceSetUp(void *arg)
|
||||
/* Disable blend mode for target surface */
|
||||
result = SDL_SetSurfaceBlendMode(testSurface, blendMode);
|
||||
SDLTest_AssertCheck(result == 0, "Validate result from SDL_SetSurfaceBlendMode, expected: 0, got: %i", result);
|
||||
result = SDL_GetSurfaceBlendMode(testSurface, ¤tBlendMode);
|
||||
SDLTest_AssertCheck(result == 0, "Validate result from SDL_GetSurfaceBlendMode, expected: 0, got: %i", result);
|
||||
currentBlendMode = SDL_GetSurfaceBlendMode(testSurface);
|
||||
SDLTest_AssertCheck(currentBlendMode != SDL_BLENDMODE_INVALID, "Validate result from SDL_GetSurfaceBlendMode, expected: !SDL_BLENDMODE_INVALID, got: 0x%" SDL_PRIx32, currentBlendMode);
|
||||
SDLTest_AssertCheck(currentBlendMode == blendMode, "Validate blendMode, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, blendMode, currentBlendMode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ SDL_GL_LoadTexture(SDL_Surface *surface, GLfloat *texcoord)
|
||||
}
|
||||
|
||||
/* Save the alpha blending attributes */
|
||||
SDL_GetSurfaceBlendMode(surface, &saved_mode);
|
||||
saved_mode = SDL_GetSurfaceBlendMode(surface);
|
||||
SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_NONE);
|
||||
|
||||
/* Copy the surface into the GL texture image */
|
||||
|
||||
Reference in New Issue
Block a user