Commit 0e0e0272b895f215e4b73fb3cc4de16038cfcf36

Sylvain Becker 2019-01-10T16:04:52

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

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