changeset 4991:dc9924fc5070

Fixed video mode format for unknown surface format
author Sam Lantinga <slouken@libsdl.org>
date Wed, 12 Jan 2011 19:33:29 -0800
parents 397e748d901a
children b12d76ef05e2
files android-project/src/org/libsdl/app/SDLActivity.java
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/android-project/src/org/libsdl/app/SDLActivity.java	Wed Jan 12 19:33:04 2011 -0800
+++ b/android-project/src/org/libsdl/app/SDLActivity.java	Wed Jan 12 19:33:29 2011 -0800
@@ -188,7 +188,7 @@
                                int format, int width, int height) {
         //Log.v("SDL", "surfaceChanged()");
 
-        int sdlFormat = 0;
+        int sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565 by default
         switch (format) {
         case PixelFormat.A_8:
             Log.v("SDL", "pixel format A_8");
@@ -228,6 +228,9 @@
             // Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
             sdlFormat = 0x86161804; // SDL_PIXELFORMAT_RGB888
             break;
+        default:
+            Log.v("SDL", "pixel format unknown " + format);
+            break;
         }
         SDLActivity.onNativeResize(width, height, sdlFormat);
 
@@ -310,12 +313,12 @@
     public boolean onKey(View  v, int keyCode, KeyEvent event) {
 
         if (event.getAction() == KeyEvent.ACTION_DOWN) {
-            //Log.v("SDL", "key down: " + keyCode);
+            Log.v("SDL", "key down: " + keyCode);
             SDLActivity.onNativeKeyDown(keyCode);
             return true;
         }
         else if (event.getAction() == KeyEvent.ACTION_UP) {
-            //Log.v("SDL", "key up: " + keyCode);
+            Log.v("SDL", "key up: " + keyCode);
             SDLActivity.onNativeKeyUp(keyCode);
             return true;
         }