indent
authorSam Lantinga <slouken@libsdl.org>
Sun, 07 Jun 2009 02:45:55 +0000
changeset 3169f294338ca6eb
parent 3168 6338b7f2d024
child 3170 b7a48f533966
indent
src/video/SDL_renderer_gles.c
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_renderer_gles.c	Sun Jun 07 02:44:46 2009 +0000
     1.2 +++ b/src/video/SDL_renderer_gles.c	Sun Jun 07 02:45:55 2009 +0000
     1.3 @@ -268,9 +268,9 @@
     1.4  #if _NTO_VERSION<=641
     1.5      /* QNX's OpenGL ES implementation is broken regarding             */
     1.6      /* packed textures support, affected versions 6.3.2, 6.4.0, 6.4.1 */
     1.7 -    renderer->info.num_texture_formats=2;
     1.8 -    renderer->info.texture_formats[0]=SDL_PIXELFORMAT_ABGR8888;
     1.9 -    renderer->info.texture_formats[1]=SDL_PIXELFORMAT_BGR24;
    1.10 +    renderer->info.num_texture_formats = 2;
    1.11 +    renderer->info.texture_formats[0] = SDL_PIXELFORMAT_ABGR8888;
    1.12 +    renderer->info.texture_formats[1] = SDL_PIXELFORMAT_BGR24;
    1.13  #endif /* _NTO_VERSION */
    1.14  #endif /* __QNXNTO__ */
    1.15  
     2.1 --- a/src/video/SDL_video.c	Sun Jun 07 02:44:46 2009 +0000
     2.2 +++ b/src/video/SDL_video.c	Sun Jun 07 02:45:55 2009 +0000
     2.3 @@ -1635,17 +1635,18 @@
     2.4              int apfmt;
     2.5  
     2.6              /* Pixel formats with alpha, sorted by best first */
     2.7 -            static const Uint32 sdl_alpha_pformats[]={
     2.8 -               SDL_PIXELFORMAT_ARGB8888,
     2.9 -               SDL_PIXELFORMAT_RGBA8888,
    2.10 -               SDL_PIXELFORMAT_ABGR8888,
    2.11 -               SDL_PIXELFORMAT_BGRA8888,
    2.12 -               SDL_PIXELFORMAT_ARGB1555,
    2.13 -               SDL_PIXELFORMAT_ABGR1555,
    2.14 -               SDL_PIXELFORMAT_ARGB4444,
    2.15 -               SDL_PIXELFORMAT_ABGR4444,
    2.16 -               SDL_PIXELFORMAT_ARGB2101010,
    2.17 -               SDL_PIXELFORMAT_UNKNOWN};
    2.18 +            static const Uint32 sdl_alpha_pformats[] = {
    2.19 +                SDL_PIXELFORMAT_ARGB8888,
    2.20 +                SDL_PIXELFORMAT_RGBA8888,
    2.21 +                SDL_PIXELFORMAT_ABGR8888,
    2.22 +                SDL_PIXELFORMAT_BGRA8888,
    2.23 +                SDL_PIXELFORMAT_ARGB1555,
    2.24 +                SDL_PIXELFORMAT_ABGR1555,
    2.25 +                SDL_PIXELFORMAT_ARGB4444,
    2.26 +                SDL_PIXELFORMAT_ABGR4444,
    2.27 +                SDL_PIXELFORMAT_ARGB2101010,
    2.28 +                SDL_PIXELFORMAT_UNKNOWN
    2.29 +            };
    2.30  
    2.31              bpp = 32;
    2.32              Rmask = 0x00FF0000;
    2.33 @@ -1653,7 +1654,8 @@
    2.34              Bmask = 0x000000FF;
    2.35              Amask = 0xFF000000;
    2.36  
    2.37 -            format = SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask);
    2.38 +            format =
    2.39 +                SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask);
    2.40              if (!format) {
    2.41                  SDL_SetError("Unknown pixel format");
    2.42                  return 0;
    2.43 @@ -1661,53 +1663,46 @@
    2.44  
    2.45              /* Search this format in the supported texture formats */
    2.46              /* by current renderer                                 */
    2.47 -            for (it=0; it<renderer->info.num_texture_formats; it++)
    2.48 -            {
    2.49 -                if (renderer->info.texture_formats[it]==format)
    2.50 -                {
    2.51 -                   break;
    2.52 +            for (it = 0; it < renderer->info.num_texture_formats; it++) {
    2.53 +                if (renderer->info.texture_formats[it] == format) {
    2.54 +                    break;
    2.55                  }
    2.56              }
    2.57  
    2.58              /* If this format can't be found, search any best       */
    2.59              /* compatible format with alpha which renderer provides */
    2.60 -            if (it==renderer->info.num_texture_formats)
    2.61 -            {
    2.62 -                apfmt=0;
    2.63 -                for (;;)
    2.64 -                {
    2.65 -                    if (sdl_alpha_pformats[apfmt]==SDL_PIXELFORMAT_UNKNOWN)
    2.66 -                    {
    2.67 +            if (it == renderer->info.num_texture_formats) {
    2.68 +                apfmt = 0;
    2.69 +                for (;;) {
    2.70 +                    if (sdl_alpha_pformats[apfmt] == SDL_PIXELFORMAT_UNKNOWN) {
    2.71                          break;
    2.72                      }
    2.73  
    2.74 -                    for (it=0; it<renderer->info.num_texture_formats; it++)
    2.75 -                    {
    2.76 -                       if (renderer->info.texture_formats[it]==sdl_alpha_pformats[apfmt])
    2.77 -                       {
    2.78 -                          break;
    2.79 -                       }
    2.80 +                    for (it = 0; it < renderer->info.num_texture_formats;
    2.81 +                         it++) {
    2.82 +                        if (renderer->info.texture_formats[it] ==
    2.83 +                            sdl_alpha_pformats[apfmt]) {
    2.84 +                            break;
    2.85 +                        }
    2.86                      }
    2.87  
    2.88 -                    if (it!=renderer->info.num_texture_formats)
    2.89 -                    {
    2.90 -                       /* Compatible format has been found */
    2.91 -                       break;
    2.92 +                    if (it != renderer->info.num_texture_formats) {
    2.93 +                        /* Compatible format has been found */
    2.94 +                        break;
    2.95                      }
    2.96                      apfmt++;
    2.97                  }
    2.98  
    2.99                  /* If compatible format can't be found, then return an error */
   2.100 -                if (it==renderer->info.num_texture_formats)
   2.101 -                {
   2.102 +                if (it == renderer->info.num_texture_formats) {
   2.103                      SDL_SetError("Compatible pixel format can't be found");
   2.104                      return 0;
   2.105                  }
   2.106  
   2.107                  /* Convert found pixel format back to color masks */
   2.108 -                if (SDL_PixelFormatEnumToMasks(renderer->info.texture_formats[it],
   2.109 -                       &bpp, &Rmask, &Gmask, &Bmask, &Amask)!=SDL_TRUE)
   2.110 -                {
   2.111 +                if (SDL_PixelFormatEnumToMasks
   2.112 +                    (renderer->info.texture_formats[it], &bpp, &Rmask, &Gmask,
   2.113 +                     &Bmask, &Amask) != SDL_TRUE) {
   2.114                      SDL_SetError("Unknown pixel format");
   2.115                      return 0;
   2.116                  }