Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed video mode format for unknown surface format
  • Loading branch information
slouken committed Jan 13, 2011
1 parent caf68f1 commit 525f249
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions android-project/src/org/libsdl/app/SDLActivity.java
Expand Up @@ -188,7 +188,7 @@ public void surfaceChanged(SurfaceHolder holder,
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");
Expand Down Expand Up @@ -228,6 +228,9 @@ public void surfaceChanged(SurfaceHolder holder,
// 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);

Expand Down Expand Up @@ -310,12 +313,12 @@ public void flipEGL() {
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;
}
Expand Down

0 comments on commit 525f249

Please sign in to comment.