Fixed bug 1740 - Android pixel format constants out of sync
authorSam Lantinga <slouken@libsdl.org>
Sun, 03 Mar 2013 21:52:51 -0800
changeset 6957a35f752269d8
parent 6956 afdc35fa58e9
child 6958 3aecdfd1c68b
Fixed bug 1740 - Android pixel format constants out of sync

wjp

In SDL HG (2.0) the pixel format constants in
android-project/src/org/libsdl/app/SDLActivity.java seem to have gone out of
sync with include/SDL_pixels.h in HG rev b1124b32b07d.

E.g., at a glance it seems like 0x85151002 should have become 0x15151002.
android-project/src/org/libsdl/app/SDLActivity.java
     1.1 --- a/android-project/src/org/libsdl/app/SDLActivity.java	Sun Mar 03 17:22:51 2013 -0800
     1.2 +++ b/android-project/src/org/libsdl/app/SDLActivity.java	Sun Mar 03 21:52:51 2013 -0800
     1.3 @@ -509,7 +509,7 @@
     1.4                                 int format, int width, int height) {
     1.5          Log.v("SDL", "surfaceChanged()");
     1.6  
     1.7 -        int sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565 by default
     1.8 +        int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default
     1.9          switch (format) {
    1.10          case PixelFormat.A_8:
    1.11              Log.v("SDL", "pixel format A_8");
    1.12 @@ -522,32 +522,32 @@
    1.13              break;
    1.14          case PixelFormat.RGBA_4444:
    1.15              Log.v("SDL", "pixel format RGBA_4444");
    1.16 -            sdlFormat = 0x85421002; // SDL_PIXELFORMAT_RGBA4444
    1.17 +            sdlFormat = 0x15421002; // SDL_PIXELFORMAT_RGBA4444
    1.18              break;
    1.19          case PixelFormat.RGBA_5551:
    1.20              Log.v("SDL", "pixel format RGBA_5551");
    1.21 -            sdlFormat = 0x85441002; // SDL_PIXELFORMAT_RGBA5551
    1.22 +            sdlFormat = 0x15441002; // SDL_PIXELFORMAT_RGBA5551
    1.23              break;
    1.24          case PixelFormat.RGBA_8888:
    1.25              Log.v("SDL", "pixel format RGBA_8888");
    1.26 -            sdlFormat = 0x86462004; // SDL_PIXELFORMAT_RGBA8888
    1.27 +            sdlFormat = 0x16462004; // SDL_PIXELFORMAT_RGBA8888
    1.28              break;
    1.29          case PixelFormat.RGBX_8888:
    1.30              Log.v("SDL", "pixel format RGBX_8888");
    1.31 -            sdlFormat = 0x86262004; // SDL_PIXELFORMAT_RGBX8888
    1.32 +            sdlFormat = 0x16261804; // SDL_PIXELFORMAT_RGBX8888
    1.33              break;
    1.34          case PixelFormat.RGB_332:
    1.35              Log.v("SDL", "pixel format RGB_332");
    1.36 -            sdlFormat = 0x84110801; // SDL_PIXELFORMAT_RGB332
    1.37 +            sdlFormat = 0x14110801; // SDL_PIXELFORMAT_RGB332
    1.38              break;
    1.39          case PixelFormat.RGB_565:
    1.40              Log.v("SDL", "pixel format RGB_565");
    1.41 -            sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565
    1.42 +            sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565
    1.43              break;
    1.44          case PixelFormat.RGB_888:
    1.45              Log.v("SDL", "pixel format RGB_888");
    1.46              // Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
    1.47 -            sdlFormat = 0x86161804; // SDL_PIXELFORMAT_RGB888
    1.48 +            sdlFormat = 0x16161804; // SDL_PIXELFORMAT_RGB888
    1.49              break;
    1.50          default:
    1.51              Log.v("SDL", "pixel format unknown " + format);