mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-18 03:58:54 +00:00
Fixed a few remaining functions to directly return their values instead of an error code.
This commit is contained in:
parent
1e828eec57
commit
3d2e5a0b66
15 changed files with 91 additions and 123 deletions
|
|
@ -355,7 +355,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex
|
|||
return -1;
|
||||
}
|
||||
|
||||
SDL_GetSurfaceBlendMode(src, &blendmode);
|
||||
blendmode = SDL_GetSurfaceBlendMode(src);
|
||||
SDL_GetSurfaceAlphaMod(src, &alphaMod);
|
||||
SDL_GetSurfaceColorMod(src, &rMod, &gMod, &bMod);
|
||||
|
||||
|
|
@ -841,7 +841,7 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo
|
|||
SDL_BlendMode blendmode;
|
||||
Uint8 alphaMod, rMod, gMod, bMod;
|
||||
|
||||
SDL_GetSurfaceBlendMode(src, &blendmode);
|
||||
blendmode = SDL_GetSurfaceBlendMode(src);
|
||||
SDL_GetSurfaceAlphaMod(src, &alphaMod);
|
||||
SDL_GetSurfaceColorMod(src, &rMod, &gMod, &bMod);
|
||||
|
||||
|
|
|
|||
|
|
@ -78,11 +78,7 @@ Returns colorkey info for a surface
|
|||
*/
|
||||
static Uint32 get_colorkey(SDL_Surface *src)
|
||||
{
|
||||
Uint32 key = 0;
|
||||
if (SDL_SurfaceHasColorKey(src)) {
|
||||
SDL_GetSurfaceColorKey(src, &key);
|
||||
}
|
||||
return key;
|
||||
return SDL_GetSurfaceColorKey(src);
|
||||
}
|
||||
|
||||
/* rotate (sx, sy) by (angle, center) into (dx, dy) */
|
||||
|
|
@ -501,9 +497,8 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in
|
|||
}
|
||||
|
||||
if (SDL_SurfaceHasColorKey(src)) {
|
||||
if (SDL_GetSurfaceColorKey(src, &colorkey) == 0) {
|
||||
colorKeyAvailable = SDL_TRUE;
|
||||
}
|
||||
colorkey = SDL_GetSurfaceColorKey(src);
|
||||
colorKeyAvailable = SDL_TRUE;
|
||||
}
|
||||
/* This function requires a 32-bit surface or 8-bit surface with a colorkey */
|
||||
is8bit = src->internal->format->bits_per_pixel == 8 && colorKeyAvailable;
|
||||
|
|
@ -536,7 +531,7 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in
|
|||
/* Adjust for guard rows */
|
||||
rz_dst->h = rect_dest->h;
|
||||
|
||||
SDL_GetSurfaceBlendMode(src, &blendmode);
|
||||
blendmode = SDL_GetSurfaceBlendMode(src);
|
||||
|
||||
if (colorKeyAvailable == SDL_TRUE) {
|
||||
/* If available, the colorkey will be used to discard the pixels that are outside of the rotated area. */
|
||||
|
|
|
|||
|
|
@ -524,7 +524,7 @@ int SDL_SW_BlitTriangle(
|
|||
|
||||
bounding_rect_fixedpoint(d0, d1, d2, &dstrect);
|
||||
|
||||
SDL_GetSurfaceBlendMode(src, &blend);
|
||||
blend = SDL_GetSurfaceBlendMode(src);
|
||||
|
||||
/* TRIANGLE_GET_TEXTCOORD interpolates up to the max values included, so reduce by 1 */
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue