Skip to content

Commit

Permalink
Cocoa: don't fail outright if we see an unknown display format.
Browse files Browse the repository at this point in the history
Just treat it as ARGB8888.
  • Loading branch information
icculus committed May 26, 2015
1 parent aba4d78 commit 22704ac
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/video/cocoa/SDL_cocoamodes.m
Expand Up @@ -192,9 +192,16 @@
mode->format = SDL_PIXELFORMAT_ARGB8888;
break;
case 8: /* We don't support palettized modes now */
default: /* Totally unrecognizable bit depth. */
SDL_free(data);
return SDL_FALSE;
default:
/* Totally unrecognizable format. Maybe a new string reported by
CGDisplayModeCopyPixelEncoding() in a future platform SDK.
Just lie and call it 32-bit ARGB for now, so existing programs
don't completely fail on new setups. (most apps don't care about
the actual mode format anyhow.) */
mode->format = SDL_PIXELFORMAT_ARGB8888;
break;
}
mode->w = width;
mode->h = height;
Expand Down

0 comments on commit 22704ac

Please sign in to comment.