Commit b3556c8f authored by Sam Lantinga's avatar Sam Lantinga

indent

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403627
parent f6408982
...@@ -268,9 +268,9 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) ...@@ -268,9 +268,9 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags)
#if _NTO_VERSION<=641 #if _NTO_VERSION<=641
/* QNX's OpenGL ES implementation is broken regarding */ /* QNX's OpenGL ES implementation is broken regarding */
/* packed textures support, affected versions 6.3.2, 6.4.0, 6.4.1 */ /* packed textures support, affected versions 6.3.2, 6.4.0, 6.4.1 */
renderer->info.num_texture_formats=2; renderer->info.num_texture_formats = 2;
renderer->info.texture_formats[0]=SDL_PIXELFORMAT_ABGR8888; renderer->info.texture_formats[0] = SDL_PIXELFORMAT_ABGR8888;
renderer->info.texture_formats[1]=SDL_PIXELFORMAT_BGR24; renderer->info.texture_formats[1] = SDL_PIXELFORMAT_BGR24;
#endif /* _NTO_VERSION */ #endif /* _NTO_VERSION */
#endif /* __QNXNTO__ */ #endif /* __QNXNTO__ */
......
...@@ -1635,17 +1635,18 @@ SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface * surface) ...@@ -1635,17 +1635,18 @@ SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface * surface)
int apfmt; int apfmt;
/* Pixel formats with alpha, sorted by best first */ /* Pixel formats with alpha, sorted by best first */
static const Uint32 sdl_alpha_pformats[]={ static const Uint32 sdl_alpha_pformats[] = {
SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888,
SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGBA8888,
SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888,
SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGRA8888,
SDL_PIXELFORMAT_ARGB1555, SDL_PIXELFORMAT_ARGB1555,
SDL_PIXELFORMAT_ABGR1555, SDL_PIXELFORMAT_ABGR1555,
SDL_PIXELFORMAT_ARGB4444, SDL_PIXELFORMAT_ARGB4444,
SDL_PIXELFORMAT_ABGR4444, SDL_PIXELFORMAT_ABGR4444,
SDL_PIXELFORMAT_ARGB2101010, SDL_PIXELFORMAT_ARGB2101010,
SDL_PIXELFORMAT_UNKNOWN}; SDL_PIXELFORMAT_UNKNOWN
};
bpp = 32; bpp = 32;
Rmask = 0x00FF0000; Rmask = 0x00FF0000;
...@@ -1653,7 +1654,8 @@ SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface * surface) ...@@ -1653,7 +1654,8 @@ SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface * surface)
Bmask = 0x000000FF; Bmask = 0x000000FF;
Amask = 0xFF000000; Amask = 0xFF000000;
format = SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask); format =
SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask);
if (!format) { if (!format) {
SDL_SetError("Unknown pixel format"); SDL_SetError("Unknown pixel format");
return 0; return 0;
...@@ -1661,53 +1663,46 @@ SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface * surface) ...@@ -1661,53 +1663,46 @@ SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface * surface)
/* Search this format in the supported texture formats */ /* Search this format in the supported texture formats */
/* by current renderer */ /* by current renderer */
for (it=0; it<renderer->info.num_texture_formats; it++) for (it = 0; it < renderer->info.num_texture_formats; it++) {
{ if (renderer->info.texture_formats[it] == format) {
if (renderer->info.texture_formats[it]==format) break;
{
break;
} }
} }
/* If this format can't be found, search any best */ /* If this format can't be found, search any best */
/* compatible format with alpha which renderer provides */ /* compatible format with alpha which renderer provides */
if (it==renderer->info.num_texture_formats) if (it == renderer->info.num_texture_formats) {
{ apfmt = 0;
apfmt=0; for (;;) {
for (;;) if (sdl_alpha_pformats[apfmt] == SDL_PIXELFORMAT_UNKNOWN) {
{
if (sdl_alpha_pformats[apfmt]==SDL_PIXELFORMAT_UNKNOWN)
{
break; break;
} }
for (it=0; it<renderer->info.num_texture_formats; it++) for (it = 0; it < renderer->info.num_texture_formats;
{ it++) {
if (renderer->info.texture_formats[it]==sdl_alpha_pformats[apfmt]) if (renderer->info.texture_formats[it] ==
{ sdl_alpha_pformats[apfmt]) {
break; break;
} }
} }
if (it!=renderer->info.num_texture_formats) if (it != renderer->info.num_texture_formats) {
{ /* Compatible format has been found */
/* Compatible format has been found */ break;
break;
} }
apfmt++; apfmt++;
} }
/* If compatible format can't be found, then return an error */ /* If compatible format can't be found, then return an error */
if (it==renderer->info.num_texture_formats) if (it == renderer->info.num_texture_formats) {
{
SDL_SetError("Compatible pixel format can't be found"); SDL_SetError("Compatible pixel format can't be found");
return 0; return 0;
} }
/* Convert found pixel format back to color masks */ /* Convert found pixel format back to color masks */
if (SDL_PixelFormatEnumToMasks(renderer->info.texture_formats[it], if (SDL_PixelFormatEnumToMasks
&bpp, &Rmask, &Gmask, &Bmask, &Amask)!=SDL_TRUE) (renderer->info.texture_formats[it], &bpp, &Rmask, &Gmask,
{ &Bmask, &Amask) != SDL_TRUE) {
SDL_SetError("Unknown pixel format"); SDL_SetError("Unknown pixel format");
return 0; return 0;
} }
......
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