Android: remove deprecated PixelFormat in surfaceChanged() Can be check by adding in build.grable: gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" } } SDLActivity.java:1691: warning: [deprecation] A_8 in PixelFormat has been deprecated case PixelFormat.A_8: SDLActivity.java:1694: warning: [deprecation] LA_88 in PixelFormat has been deprecated SDLActivity.java:1697: warning: [deprecation] L_8 in PixelFormat has been deprecated SDLActivity.java:1700: warning: [deprecation] RGBA_4444 in PixelFormat has been deprecated SDLActivity.java:1704: warning: [deprecation] RGBA_5551 in PixelFormat has been deprecated SDLActivity.java:1716: warning: [deprecation] RGB_332 in PixelFormat has been deprecated
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
index 6e7a7f8..44cee5a 100644
--- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
@@ -1598,23 +1598,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default
switch (format) {
- case PixelFormat.A_8:
- Log.v("SDL", "pixel format A_8");
- break;
- case PixelFormat.LA_88:
- Log.v("SDL", "pixel format LA_88");
- break;
- case PixelFormat.L_8:
- Log.v("SDL", "pixel format L_8");
- break;
- case PixelFormat.RGBA_4444:
- Log.v("SDL", "pixel format RGBA_4444");
- sdlFormat = 0x15421002; // SDL_PIXELFORMAT_RGBA4444
- break;
- case PixelFormat.RGBA_5551:
- Log.v("SDL", "pixel format RGBA_5551");
- sdlFormat = 0x15441002; // SDL_PIXELFORMAT_RGBA5551
- break;
case PixelFormat.RGBA_8888:
Log.v("SDL", "pixel format RGBA_8888");
sdlFormat = 0x16462004; // SDL_PIXELFORMAT_RGBA8888
@@ -1623,10 +1606,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
Log.v("SDL", "pixel format RGBX_8888");
sdlFormat = 0x16261804; // SDL_PIXELFORMAT_RGBX8888
break;
- case PixelFormat.RGB_332:
- Log.v("SDL", "pixel format RGB_332");
- sdlFormat = 0x14110801; // SDL_PIXELFORMAT_RGB332
- break;
case PixelFormat.RGB_565:
Log.v("SDL", "pixel format RGB_565");
sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565