From 9818e276ccea91fe0190791e281d713fac4fe2f2 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Wed, 27 Aug 2008 22:36:25 +0200 Subject: [PATCH] Request RGBA when you want that (and not RV32). This fixes the skin loading. The color seems wrong but I think the skin code is right (vlc RGBA is stored in memory R, B, G, A). --- modules/gui/skins2/src/file_bitmap.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/gui/skins2/src/file_bitmap.cpp b/modules/gui/skins2/src/file_bitmap.cpp index e46a61c34a..1724b49844 100644 --- a/modules/gui/skins2/src/file_bitmap.cpp +++ b/modules/gui/skins2/src/file_bitmap.cpp @@ -39,7 +39,7 @@ FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler, video_format_t fmt_in = {0}, fmt_out = {0}; picture_t *pPic; - fmt_out.i_chroma = VLC_FOURCC('R','V','3','2'); + fmt_out.i_chroma = VLC_FOURCC('R','G','B','A'); pPic = image_ReadUrl( pImageHandler, fileName.c_str(), &fmt_in, &fmt_out ); if( !pPic ) return; @@ -55,13 +55,14 @@ FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler, { for( int x = 0; x < m_width; x++ ) { - uint32_t b = *(pSrc++); - uint32_t g = *(pSrc++); - uint32_t r = *(pSrc++); - uint8_t a = *(pSrc++); - *(pData++) = (b * a) >> 8; - *(pData++) = (g * a) >> 8; - *(pData++) = (r * a) >> 8; + uint32_t r = *pSrc++; + uint32_t g = *pSrc++; + uint32_t b = *pSrc++; + uint8_t a = *pSrc++; + + *(pData++) = b * a / 255; + *(pData++) = g * a / 255; + *(pData++) = r * a / 255; // Transparent pixel ? if( aColor == (r<<16 | g<<8 | b) ) -- 2.20.1