SDL: Removed short aliases for 16-bit pixel formats

From df25e4022df32a097460a4412330d34f8db99564 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 27 May 2024 06:51:39 -0700
Subject: [PATCH] Removed short aliases for 16-bit pixel formats

These were potentially misleading in the same way the RGB888/BGR888 aliases were

Fixes https://github.com/libsdl-org/SDL/issues/4994
---
 build-scripts/SDL_migration.cocci           | 20 ++++++++++++++++++--
 docs/README-migration.md                    |  8 ++++++++
 include/SDL3/SDL_oldnames.h                 |  8 ++++++++
 include/SDL3/SDL_pixels.h                   |  4 ----
 src/camera/coremedia/SDL_camera_coremedia.m |  2 +-
 src/video/SDL_bmp.c                         |  2 +-
 src/video/SDL_pixels.c                      | 20 ++++++++++----------
 src/video/haiku/SDL_bmodes.cc               |  2 +-
 src/video/ngage/SDL_ngageframebuffer.cpp    |  2 +-
 src/video/ngage/SDL_ngagevideo.cpp          |  2 +-
 src/video/sdlgenblit.pl                     |  4 ++--
 src/video/windows/SDL_windowsmodes.c        |  4 ++--
 test/testautomation_pixels.c                | 16 ++++++++--------
 test/testautomation_surface.c               | 14 +++++++-------
 test/testffmpeg.c                           |  6 +++---
 test/testyuv.c                              |  2 +-
 16 files changed, 72 insertions(+), 44 deletions(-)

diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci
index 97610f9aa0640..cca3621d444e5 100644
--- a/build-scripts/SDL_migration.cocci
+++ b/build-scripts/SDL_migration.cocci
@@ -2664,14 +2664,30 @@ typedef SDL_cond, SDL_Condition;
 + SDL_WINDOW_UTILITY
 @@
 @@
-- SDL_PIXELFORMAT_RGB888
-+ SDL_PIXELFORMAT_XRGB8888
+- SDL_PIXELFORMAT_BGR444
++ SDL_PIXELFORMAT_XBGR4444
+@@
+@@
+- SDL_PIXELFORMAT_BGR555
++ SDL_PIXELFORMAT_XBGR1555
 @@
 @@
 - SDL_PIXELFORMAT_BGR888
 + SDL_PIXELFORMAT_XBGR8888
 @@
 @@
+- SDL_PIXELFORMAT_RGB444
++ SDL_PIXELFORMAT_XRGB4444
+@@
+@@
+- SDL_PIXELFORMAT_RGB555
++ SDL_PIXELFORMAT_XRGB1555
+@@
+@@
+- SDL_PIXELFORMAT_RGB888
++ SDL_PIXELFORMAT_XRGB8888
+@@
+@@
 - SDL_strtokr
 + SDL_strtok_r
   (...)
diff --git a/docs/README-migration.md b/docs/README-migration.md
index bbb8f943efaf3..020b1fffc52c2 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -1004,6 +1004,14 @@ The following functions have been renamed:
 * SDL_MasksToPixelFormatEnum() => SDL_GetPixelFormatEnumForMasks()
 * SDL_PixelFormatEnumToMasks() => SDL_GetMasksForPixelFormatEnum()
 
+The following symbols have been renamed:
+* SDL_PIXELFORMAT_BGR444 => SDL_PIXELFORMAT_XBGR4444
+* SDL_PIXELFORMAT_BGR555 => SDL_PIXELFORMAT_XBGR1555
+* SDL_PIXELFORMAT_BGR888 => SDL_PIXELFORMAT_XBGR8888
+* SDL_PIXELFORMAT_RGB444 => SDL_PIXELFORMAT_XRGB4444
+* SDL_PIXELFORMAT_RGB555 => SDL_PIXELFORMAT_XRGB1555
+* SDL_PIXELFORMAT_RGB888 => SDL_PIXELFORMAT_XRGB8888
+
 The following macros have been removed:
 * SDL_Colour - use SDL_Color instead
 
diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h
index d1a9bade7ce1c..f7ebd77fa8891 100644
--- a/include/SDL3/SDL_oldnames.h
+++ b/include/SDL3/SDL_oldnames.h
@@ -398,7 +398,11 @@
 #define SDL_FreeFormat SDL_DestroyPixelFormat
 #define SDL_FreePalette SDL_DestroyPalette
 #define SDL_MasksToPixelFormatEnum SDL_GetPixelFormatEnumForMasks
+#define SDL_PIXELFORMAT_BGR444 SDL_PIXELFORMAT_XBGR4444
+#define SDL_PIXELFORMAT_BGR555 SDL_PIXELFORMAT_XBGR1555
 #define SDL_PIXELFORMAT_BGR888 SDL_PIXELFORMAT_XBGR8888
+#define SDL_PIXELFORMAT_RGB444 SDL_PIXELFORMAT_XRGB4444
+#define SDL_PIXELFORMAT_RGB555 SDL_PIXELFORMAT_XRGB1555
 #define SDL_PIXELFORMAT_RGB888 SDL_PIXELFORMAT_XRGB8888
 #define SDL_PixelFormatEnumToMasks SDL_GetMasksForPixelFormatEnum
 
@@ -917,7 +921,11 @@
 #define SDL_FreeFormat SDL_FreeFormat_renamed_SDL_DestroyPixelFormat
 #define SDL_FreePalette SDL_FreePalette_renamed_SDL_DestroyPalette
 #define SDL_MasksToPixelFormatEnum SDL_MasksToPixelFormatEnum_renamed_SDL_GetPixelFormatEnumForMasks
+#define SDL_PIXELFORMAT_BGR444 SDL_PIXELFORMAT_BGR444_renamed_SDL_PIXELFORMAT_XBGR4444
+#define SDL_PIXELFORMAT_BGR555 SDL_PIXELFORMAT_BGR555_renamed_SDL_PIXELFORMAT_XBGR1555
 #define SDL_PIXELFORMAT_BGR888 SDL_PIXELFORMAT_BGR888_renamed_SDL_PIXELFORMAT_XBGR8888
+#define SDL_PIXELFORMAT_RGB444 SDL_PIXELFORMAT_RGB444_renamed_SDL_PIXELFORMAT_XRGB4444
+#define SDL_PIXELFORMAT_RGB555 SDL_PIXELFORMAT_RGB555_renamed_SDL_PIXELFORMAT_XRGB1555
 #define SDL_PIXELFORMAT_RGB888 SDL_PIXELFORMAT_RGB888_renamed_SDL_PIXELFORMAT_XRGB8888
 #define SDL_PixelFormatEnumToMasks SDL_PixelFormatEnumToMasks_renamed_SDL_GetMasksForPixelFormatEnum
 
diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h
index 7b0b9f2ad1c60..a969e79668c40 100644
--- a/include/SDL3/SDL_pixels.h
+++ b/include/SDL3/SDL_pixels.h
@@ -243,19 +243,15 @@ typedef enum SDL_PixelFormatEnum
     SDL_PIXELFORMAT_XRGB4444 =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
                                SDL_PACKEDLAYOUT_4444, 12, 2),
-    SDL_PIXELFORMAT_RGB444 = SDL_PIXELFORMAT_XRGB4444,
     SDL_PIXELFORMAT_XBGR4444 =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
                                SDL_PACKEDLAYOUT_4444, 12, 2),
-    SDL_PIXELFORMAT_BGR444 = SDL_PIXELFORMAT_XBGR4444,
     SDL_PIXELFORMAT_XRGB1555 =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
                                SDL_PACKEDLAYOUT_1555, 15, 2),
-    SDL_PIXELFORMAT_RGB555 = SDL_PIXELFORMAT_XRGB1555,
     SDL_PIXELFORMAT_XBGR1555 =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
                                SDL_PACKEDLAYOUT_1555, 15, 2),
-    SDL_PIXELFORMAT_BGR555 = SDL_PIXELFORMAT_XBGR1555,
     SDL_PIXELFORMAT_ARGB4444 =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
                                SDL_PACKEDLAYOUT_4444, 16, 2),
diff --git a/src/camera/coremedia/SDL_camera_coremedia.m b/src/camera/coremedia/SDL_camera_coremedia.m
index 0b1b7ad985c49..93ab90f1ba1c9 100644
--- a/src/camera/coremedia/SDL_camera_coremedia.m
+++ b/src/camera/coremedia/SDL_camera_coremedia.m
@@ -47,7 +47,7 @@ static Uint32 CoreMediaFormatToSDL(FourCharCode fmt)
         #define CASE(x, y) case x: return y
         // the 16LE ones should use 16BE if we're on a Bigendian system like PowerPC,
         // but at current time there is no bigendian Apple platform that has CoreMedia.
-        CASE(kCMPixelFormat_16LE555, SDL_PIXELFORMAT_RGB555);
+        CASE(kCMPixelFormat_16LE555, SDL_PIXELFORMAT_XRGB1555);
         CASE(kCMPixelFormat_16LE5551, SDL_PIXELFORMAT_RGBA5551);
         CASE(kCMPixelFormat_16LE565, SDL_PIXELFORMAT_RGB565);
         CASE(kCMPixelFormat_24RGB, SDL_PIXELFORMAT_RGB24);
diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c
index 7993c7789ea2e..1d80cbd13c3d4 100644
--- a/src/video/SDL_bmp.c
+++ b/src/video/SDL_bmp.c
@@ -386,7 +386,7 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio)
         switch (biBitCount) {
         case 15:
         case 16:
-            /* SDL_PIXELFORMAT_RGB555 or SDL_PIXELFORMAT_ARGB1555 if Amask */
+            /* SDL_PIXELFORMAT_XRGB1555 or SDL_PIXELFORMAT_ARGB1555 if Amask */
             Rmask = 0x7C00;
             Gmask = 0x03E0;
             Bmask = 0x001F;
diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c
index 6f6e55199cb3a..980ba6e4a307d 100644
--- a/src/video/SDL_pixels.c
+++ b/src/video/SDL_pixels.c
@@ -100,10 +100,10 @@ const char *SDL_GetPixelFormatName(SDL_PixelFormatEnum format)
         CASE(SDL_PIXELFORMAT_INDEX4MSB)
         CASE(SDL_PIXELFORMAT_INDEX8)
         CASE(SDL_PIXELFORMAT_RGB332)
-        CASE(SDL_PIXELFORMAT_RGB444)
-        CASE(SDL_PIXELFORMAT_BGR444)
-        CASE(SDL_PIXELFORMAT_RGB555)
-        CASE(SDL_PIXELFORMAT_BGR555)
+        CASE(SDL_PIXELFORMAT_XRGB4444)
+        CASE(SDL_PIXELFORMAT_XBGR4444)
+        CASE(SDL_PIXELFORMAT_XRGB1555)
+        CASE(SDL_PIXELFORMAT_XBGR1555)
         CASE(SDL_PIXELFORMAT_ARGB4444)
         CASE(SDL_PIXELFORMAT_RGBA4444)
         CASE(SDL_PIXELFORMAT_ABGR4444)
@@ -360,24 +360,24 @@ SDL_PixelFormatEnum SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32
         return SDL_PIXELFORMAT_INDEX8;
     case 12:
         if (Rmask == 0) {
-            return SDL_PIXELFORMAT_RGB444;
+            return SDL_PIXELFORMAT_XRGB4444;
         }
         if (Rmask == 0x0F00 &&
             Gmask == 0x00F0 &&
             Bmask == 0x000F &&
             Amask == 0x0000) {
-            return SDL_PIXELFORMAT_RGB444;
+            return SDL_PIXELFORMAT_XRGB4444;
         }
         if (Rmask == 0x000F &&
             Gmask == 0x00F0 &&
             Bmask == 0x0F00 &&
             Amask == 0x0000) {
-            return SDL_PIXELFORMAT_BGR444;
+            return SDL_PIXELFORMAT_XBGR4444;
         }
         break;
     case 15:
         if (Rmask == 0) {
-            return SDL_PIXELFORMAT_RGB555;
+            return SDL_PIXELFORMAT_XRGB1555;
         }
         SDL_FALLTHROUGH;
     case 16:
@@ -388,13 +388,13 @@ SDL_PixelFormatEnum SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32
             Gmask == 0x03E0 &&
             Bmask == 0x001F &&
             Amask == 0x0000) {
-            return SDL_PIXELFORMAT_RGB555;
+            return SDL_PIXELFORMAT_XRGB1555;
         }
         if (Rmask == 0x001F &&
             Gmask == 0x03E0 &&
             Bmask == 0x7C00 &&
             Amask == 0x0000) {
-            return SDL_PIXELFORMAT_BGR555;
+            return SDL_PIXELFORMAT_XBGR1555;
         }
         if (Rmask == 0x0F00 &&
             Gmask == 0x00F0 &&
diff --git a/src/video/haiku/SDL_bmodes.cc b/src/video/haiku/SDL_bmodes.cc
index fda4e1fa24127..09e1e84dd015b 100644
--- a/src/video/haiku/SDL_bmodes.cc
+++ b/src/video/haiku/SDL_bmodes.cc
@@ -142,7 +142,7 @@ SDL_PixelFormatEnum HAIKU_ColorSpaceToSDLPxFormat(uint32 colorspace)
     case B_RGBA15:
     case B_RGB15_BIG:
     case B_RGBA15_BIG:
-        return SDL_PIXELFORMAT_RGB555;
+        return SDL_PIXELFORMAT_XRGB1555;
         break;
     case B_RGB16:
     case B_RGB16_BIG:
diff --git a/src/video/ngage/SDL_ngageframebuffer.cpp b/src/video/ngage/SDL_ngageframebuffer.cpp
index 04229c37bf85c..143ad50d2a5bf 100644
--- a/src/video/ngage/SDL_ngageframebuffer.cpp
+++ b/src/video/ngage/SDL_ngageframebuffer.cpp
@@ -48,7 +48,7 @@ int SDL_NGAGE_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window
 {
     SDL_VideoData *phdata = _this->driverdata;
     SDL_Surface *surface;
-    const SDL_PixelFormatEnum surface_format = SDL_PIXELFORMAT_RGB444;
+    const SDL_PixelFormatEnum surface_format = SDL_PIXELFORMAT_XRGB4444;
     int w, h;
 
     /* Free the old framebuffer surface */
diff --git a/src/video/ngage/SDL_ngagevideo.cpp b/src/video/ngage/SDL_ngagevideo.cpp
index b53ddc327e785..a543494c58e89 100644
--- a/src/video/ngage/SDL_ngagevideo.cpp
+++ b/src/video/ngage/SDL_ngagevideo.cpp
@@ -146,7 +146,7 @@ int NGAGE_VideoInit(SDL_VideoDevice *_this)
 
     /* Use 12-bpp desktop mode */
     SDL_zero(mode);
-    mode.format = SDL_PIXELFORMAT_RGB444;
+    mode.format = SDL_PIXELFORMAT_XRGB4444;
     mode.w = 176;
     mode.h = 208;
     if (SDL_AddBasicVideoDisplay(&mode) == 0) {
diff --git a/src/video/sdlgenblit.pl b/src/video/sdlgenblit.pl
index 2e589030b59af..00eede2c05159 100755
--- a/src/video/sdlgenblit.pl
+++ b/src/video/sdlgenblit.pl
@@ -10,8 +10,8 @@
 
 # The formats potentially supported by this script:
 # SDL_PIXELFORMAT_RGB332
-# SDL_PIXELFORMAT_RGB444
-# SDL_PIXELFORMAT_RGB555
+# SDL_PIXELFORMAT_XRGB4444
+# SDL_PIXELFORMAT_XRGB1555
 # SDL_PIXELFORMAT_ARGB4444
 # SDL_PIXELFORMAT_ARGB1555
 # SDL_PIXELFORMAT_RGB565
diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c
index e9371fc441ff4..ca689d810d6a8 100644
--- a/src/video/windows/SDL_windowsmodes.c
+++ b/src/video/windows/SDL_windowsmodes.c
@@ -70,7 +70,7 @@ static void WIN_UpdateDisplayMode(SDL_VideoDevice *_this, LPCWSTR deviceName, DW
                 mode->format = SDL_PIXELFORMAT_RGB565;
                 break;
             case 0x7C00:
-                mode->format = SDL_PIXELFORMAT_RGB555;
+                mode->format = SDL_PIXELFORMAT_XRGB1555;
                 break;
             }
         } else if (bmi->bmiHeader.biCompression == BI_RGB) {
@@ -96,7 +96,7 @@ static void WIN_UpdateDisplayMode(SDL_VideoDevice *_this, LPCWSTR deviceName, DW
                 mode->format = SDL_PIXELFORMAT_RGB565;
                 break;
             case 15:
-                mode->format = SDL_PIXELFORMAT_RGB555;
+                mode->format = SDL_PIXELFORMAT_XRGB1555;
                 break;
             case 8:
                 mode->format = SDL_PIXELFORMAT_INDEX8;
diff --git a/test/testautomation_pixels.c b/test/testautomation_pixels.c
index f99ca916aeb8d..6814b66fcc975 100644
--- a/test/testautomation_pixels.c
+++ b/test/testautomation_pixels.c
@@ -17,10 +17,10 @@ static const SDL_PixelFormatEnum g_AllFormats[] = {
     SDL_PIXELFORMAT_INDEX4MSB,
     SDL_PIXELFORMAT_INDEX8,
     SDL_PIXELFORMAT_RGB332,
-    SDL_PIXELFORMAT_RGB444,
-    SDL_PIXELFORMAT_BGR444,
-    SDL_PIXELFORMAT_RGB555,
-    SDL_PIXELFORMAT_BGR555,
+    SDL_PIXELFORMAT_XRGB4444,
+    SDL_PIXELFORMAT_XBGR4444,
+    SDL_PIXELFORMAT_XRGB1555,
+    SDL_PIXELFORMAT_XBGR1555,
     SDL_PIXELFORMAT_ARGB4444,
     SDL_PIXELFORMAT_RGBA4444,
     SDL_PIXELFORMAT_ABGR4444,
@@ -64,10 +64,10 @@ static const char *g_AllFormatsVerbose[] = {
     "SDL_PIXELFORMAT_INDEX4MSB",
     "SDL_PIXELFORMAT_INDEX8",
     "SDL_PIXELFORMAT_RGB332",
-    "SDL_PIXELFORMAT_RGB444",
-    "SDL_PIXELFORMAT_BGR444",
-    "SDL_PIXELFORMAT_RGB555",
-    "SDL_PIXELFORMAT_BGR555",
+    "SDL_PIXELFORMAT_XRGB4444",
+    "SDL_PIXELFORMAT_XBGR4444",
+    "SDL_PIXELFORMAT_XRGB1555",
+    "SDL_PIXELFORMAT_XBGR1555",
     "SDL_PIXELFORMAT_ARGB4444",
     "SDL_PIXELFORMAT_RGBA4444",
     "SDL_PIXELFORMAT_ABGR4444",
diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c
index 32bd4bdb66264..98c9293c40279 100644
--- a/test/testautomation_surface.c
+++ b/test/testautomation_surface.c
@@ -312,10 +312,10 @@ static int surface_testCompleteSurfaceConversion(void *arg)
     Uint32 pixel_formats[] = {
         SDL_PIXELFORMAT_INDEX8,
         SDL_PIXELFORMAT_RGB332,
-        SDL_PIXELFORMAT_RGB444,
-        SDL_PIXELFORMAT_BGR444,
-        SDL_PIXELFORMAT_RGB555,
-        SDL_PIXELFORMAT_BGR555,
+        SDL_PIXELFORMAT_XRGB4444,
+        SDL_PIXELFORMAT_XBGR4444,
+        SDL_PIXELFORMAT_XRGB1555,
+        SDL_PIXELFORMAT_XBGR1555,
         SDL_PIXELFORMAT_ARGB4444,
         SDL_PIXELFORMAT_RGBA4444,
         SDL_PIXELFORMAT_ABGR4444,
@@ -754,16 +754,16 @@ static int surface_testOverflow(void *arg)
     /* Everything else requires more than 1 byte per pixel, and rounds up
      * each pixel to an integer number of bytes (e.g. RGB555 is really
      * XRGB1555, with 1 bit per pixel wasted). */
-    surface = SDL_CreateSurfaceFrom(buf, 3, 1, 6, SDL_PIXELFORMAT_RGB555);
+    surface = SDL_CreateSurfaceFrom(buf, 3, 1, 6, SDL_PIXELFORMAT_XRGB1555);
     SDLTest_AssertCheck(surface != NULL, "3px * 15 (really 16) bits per px fits in 6 bytes: %s",
                         surface != NULL ? "(success)" : SDL_GetError());
     SDL_DestroySurface(surface);
-    surface = SDL_CreateSurfaceFrom(buf, 3, 1, 6, SDL_PIXELFORMAT_RGB555);
+    surface = SDL_CreateSurfaceFrom(buf, 3, 1, 6, SDL_PIXELFORMAT_XRGB1555);
     SDLTest_AssertCheck(surface != NULL, "5px * 15 (really 16) bits per px fits in 6 bytes: %s",
                         surface != NULL ? "(success)" : SDL_GetError());
     SDL_DestroySurface(surface);
 
-    surface = SDL_CreateSurfaceFrom(buf, 4, 1, 6, SDL_PIXELFORMAT_RGB555);
+    surface = SDL_CreateSurfaceFrom(buf, 4, 1, 6, SDL_PIXELFORMAT_XRGB1555);
     SDLTest_AssertCheck(surface == NULL, "4px * 15 (really 16) bits per px doesn't fit in 6 bytes");
     SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0,
                         "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError());
diff --git a/test/testffmpeg.c b/test/testffmpeg.c
index e2fd85f7e2c0d..99d06d0770014 100644
--- a/test/testffmpeg.c
+++ b/test/testffmpeg.c
@@ -291,11 +291,11 @@ static SDL_PixelFormatEnum GetTextureFormat(enum AVPixelFormat format)
     case AV_PIX_FMT_RGB8:
         return SDL_PIXELFORMAT_RGB332;
     case AV_PIX_FMT_RGB444:
-        return SDL_PIXELFORMAT_RGB444;
+        return SDL_PIXELFORMAT_XRGB4444;
     case AV_PIX_FMT_RGB555:
-        return SDL_PIXELFORMAT_RGB555;
+        return SDL_PIXELFORMAT_XRGB1555;
     case AV_PIX_FMT_BGR555:
-        return SDL_PIXELFORMAT_BGR555;
+        return SDL_PIXELFORMAT_XBGR1555;
     case AV_PIX_FMT_RGB565:
         return SDL_PIXELFORMAT_RGB565;
     case AV_PIX_FMT_BGR565:
diff --git a/test/testyuv.c b/test/testyuv.c
index 981c63b4dd074..cabffdaee109d 100644
--- a/test/testyuv.c
+++ b/test/testyuv.c
@@ -351,7 +351,7 @@ int main(int argc, char **argv)
                 yuv_format = SDL_PIXELFORMAT_NV21;
                 consumed = 1;
             } else if (SDL_strcmp(argv[i], "--rgb555") == 0) {
-                rgb_format = SDL_PIXELFORMAT_RGB555;
+                rgb_format = SDL_PIXELFORMAT_XRGB1555;
                 consumed = 1;
             } else if (SDL_strcmp(argv[i], "--rgb565") == 0) {
                 rgb_format = SDL_PIXELFORMAT_RGB565;