Fixed video mode format for unknown surface format
authorSam Lantinga
Wed, 12 Jan 2011 19:33:29 -0800
changeset 4991dc9924fc5070
parent 4990 397e748d901a
child 4992 b12d76ef05e2
Fixed video mode format for unknown surface format
android-project/src/org/libsdl/app/SDLActivity.java
     1.1 --- a/android-project/src/org/libsdl/app/SDLActivity.java	Wed Jan 12 19:33:04 2011 -0800
     1.2 +++ b/android-project/src/org/libsdl/app/SDLActivity.java	Wed Jan 12 19:33:29 2011 -0800
     1.3 @@ -188,7 +188,7 @@
     1.4                                 int format, int width, int height) {
     1.5          //Log.v("SDL", "surfaceChanged()");
     1.6  
     1.7 -        int sdlFormat = 0;
     1.8 +        int sdlFormat = 0x85151002; // 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 @@ -228,6 +228,9 @@
    1.13              // Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
    1.14              sdlFormat = 0x86161804; // SDL_PIXELFORMAT_RGB888
    1.15              break;
    1.16 +        default:
    1.17 +            Log.v("SDL", "pixel format unknown " + format);
    1.18 +            break;
    1.19          }
    1.20          SDLActivity.onNativeResize(width, height, sdlFormat);
    1.21  
    1.22 @@ -310,12 +313,12 @@
    1.23      public boolean onKey(View  v, int keyCode, KeyEvent event) {
    1.24  
    1.25          if (event.getAction() == KeyEvent.ACTION_DOWN) {
    1.26 -            //Log.v("SDL", "key down: " + keyCode);
    1.27 +            Log.v("SDL", "key down: " + keyCode);
    1.28              SDLActivity.onNativeKeyDown(keyCode);
    1.29              return true;
    1.30          }
    1.31          else if (event.getAction() == KeyEvent.ACTION_UP) {
    1.32 -            //Log.v("SDL", "key up: " + keyCode);
    1.33 +            Log.v("SDL", "key up: " + keyCode);
    1.34              SDLActivity.onNativeKeyUp(keyCode);
    1.35              return true;
    1.36          }