Commit 0a027f75 authored by Sam Lantinga's avatar Sam Lantinga

Fall back to opaque sprite if no formats with alpha are supported.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403835
parent 4309e332
...@@ -81,6 +81,10 @@ LoadSprite(char *file) ...@@ -81,6 +81,10 @@ LoadSprite(char *file)
for (i = 0; i < state->num_windows; ++i) { for (i = 0; i < state->num_windows; ++i) {
SDL_SelectRenderer(state->windows[i]); SDL_SelectRenderer(state->windows[i]);
sprites[i] = SDL_CreateTextureFromSurface(0, temp); sprites[i] = SDL_CreateTextureFromSurface(0, temp);
if (!sprites[i]) {
SDL_SetColorKey(temp, 0, 0);
sprites[i] = SDL_CreateTextureFromSurface(0, temp);
}
if (!sprites[i]) { if (!sprites[i]) {
fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError()); fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError());
SDL_FreeSurface(temp); SDL_FreeSurface(temp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment