mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-25 08:45:34 +00:00
Fixed assertion loading button.bmp in testgamecontroller
This commit is contained in:
parent
20680d7db0
commit
229b438d42
|
@ -85,9 +85,13 @@ LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
|
||||||
} else {
|
} else {
|
||||||
/* Set transparent pixel as the pixel at (0,0) */
|
/* Set transparent pixel as the pixel at (0,0) */
|
||||||
if (transparent) {
|
if (transparent) {
|
||||||
SDL_assert(!temp->format->palette);
|
if (temp->format->BytesPerPixel == 1) {
|
||||||
SDL_assert(temp->format->BitsPerPixel == 24);
|
SDL_SetColorKey(temp, SDL_TRUE, *(Uint8 *)temp->pixels);
|
||||||
SDL_SetColorKey(temp, SDL_TRUE, (*(Uint32 *) temp->pixels) & 0x00FFFFFF);
|
} else {
|
||||||
|
SDL_assert(!temp->format->palette);
|
||||||
|
SDL_assert(temp->format->BitsPerPixel == 24);
|
||||||
|
SDL_SetColorKey(temp, SDL_TRUE, (*(Uint32 *)temp->pixels) & 0x00FFFFFF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
texture = SDL_CreateTextureFromSurface(renderer, temp);
|
texture = SDL_CreateTextureFromSurface(renderer, temp);
|
||||||
|
|
Loading…
Reference in a new issue