From ac57a464d4cf3240667b67db548fe0940df55bf2 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 4 Jan 2016 22:16:21 +0100 Subject: [PATCH] Fixed: Converting AlphaLuminance to Luminance --HG-- branch : develop --- code/nel/src/misc/bitmap.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/code/nel/src/misc/bitmap.cpp b/code/nel/src/misc/bitmap.cpp index 7a90b6282..67557b5cf 100644 --- a/code/nel/src/misc/bitmap.cpp +++ b/code/nel/src/misc/bitmap.cpp @@ -935,28 +935,27 @@ bool CBitmap::alphaToLuminance() \*-------------------------------------------------------------------*/ bool CBitmap::alphaLuminanceToLuminance() { - uint32 i; - - if(_Width*_Height == 0) return false; + if (_Width*_Height == 0) return false; - for(uint8 m= 0; m<_MipMapCount; m++) + for(uint8 m = 0; m<_MipMapCount; ++m) { CObjectVector dataTmp; dataTmp.resize(_Data[m].size()/2); uint dstId= 0; - for(i=0; i<_Data[m].size(); i+=2) + for(uint32 i=0; i<_Data[m].size(); i+=2) { - dataTmp[dstId++]= 0; - dataTmp[dstId++]= 0; - dataTmp[dstId++]= 0; dataTmp[dstId++]= _Data[m][i]; } + NLMISC::contReset(_Data[m]); + _Data[m].resize(0); _Data[m] = dataTmp; } + PixelFormat = Luminance; + return true; }