changeset 35728:168aae142525

Redefine PACK_RGB16 and PACK_RGB15. First and third parameter were mixed up which resulted in confusing calls.
author ib
date Tue, 22 Jan 2013 15:37:17 +0000
parents 652e66d22aea
children a5f7a861a293
files gui/wm/ws.c
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/gui/wm/ws.c	Tue Jan 22 10:59:51 2013 +0000
+++ b/gui/wm/ws.c	Tue Jan 22 15:37:17 2013 +0000
@@ -80,17 +80,19 @@
 
 /* --- */
 
-#define PACK_RGB16(r, g, b, pixel) pixel = (b >> 3); \
+#define PACK_RGB16(r, g, b, pixel) \
+    pixel   = (r >> 3); \
     pixel <<= 6; \
     pixel  |= (g >> 2); \
     pixel <<= 5; \
-    pixel  |= (r >> 3)
+    pixel  |= (b >> 3)
 
-#define PACK_RGB15(r, g, b, pixel) pixel = (b >> 3); \
+#define PACK_RGB15(r, g, b, pixel) \
+    pixel   = (r >> 3); \
     pixel <<= 5; \
     pixel  |= (g >> 3); \
     pixel <<= 5; \
-    pixel  |= (r >> 3)
+    pixel  |= (b >> 3)
 
 static enum AVPixelFormat out_pix_fmt = PIX_FMT_NONE;
 
@@ -1099,19 +1101,19 @@
         break;
 
     case wsRGB16:
-        PACK_RGB16(b, g, r, color);
-        break;
-
-    case wsBGR16:
         PACK_RGB16(r, g, b, color);
         break;
 
+    case wsBGR16:
+        PACK_RGB16(b, g, r, color);
+        break;
+
     case wsRGB15:
-        PACK_RGB15(b, g, r, color);
+        PACK_RGB15(r, g, b, color);
         break;
 
     case wsBGR15:
-        PACK_RGB15(r, g, b, color);
+        PACK_RGB15(b, g, r, color);
         break;
     }