SDL: Use RLE acceleration for SDL2 transparent surfaces
We were already doing it for SDL1.2, but with SDL2 the SDL_RLEACCEL is not passed to SDL and instead we need to call SDL_SetSurfaceRLE.
This commit is contained in:
parent
1d1f898c01
commit
6b4195a542
1 changed files with 10 additions and 1 deletions
|
@ -754,10 +754,13 @@ int SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha) {
|
||||||
if (SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_NONE)) {
|
if (SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_NONE)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
SDL_SetSurfaceRLE(surface, 0);
|
||||||
} else {
|
} else {
|
||||||
if (SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND)) {
|
if (SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (flag & SDL_RLEACCEL)
|
||||||
|
SDL_SetSurfaceRLE(surface, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -765,7 +768,13 @@ int SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha) {
|
||||||
|
|
||||||
#undef SDL_SetColorKey
|
#undef SDL_SetColorKey
|
||||||
int SDL_SetColorKey_replacement(SDL_Surface *surface, Uint32 flag, Uint32 key) {
|
int SDL_SetColorKey_replacement(SDL_Surface *surface, Uint32 flag, Uint32 key) {
|
||||||
return SDL_SetColorKey(surface, SDL_TRUE, key) ? -1 : 0;
|
if (SDL_SetColorKey(surface, SDL_TRUE, key)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag & SDL_RLEACCEL)
|
||||||
|
SDL_SetSurfaceRLE(surface, 1);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue