VC6 compilation fix in wxDIB::Create().
Deal with the lack of scope around variables declared inside the for loop in this compiler, previously it gave "error C2360: initialization of 'x' is skipped by 'case' label" message and also complained about redefinition of 'x'. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -688,12 +688,14 @@ bool wxDIB::Create(const wxImage& image, PixelFormat pf)
|
|||||||
unsigned char *dst = dstLineStart;
|
unsigned char *dst = dstLineStart;
|
||||||
if ( alpha )
|
if ( alpha )
|
||||||
{
|
{
|
||||||
|
int x;
|
||||||
|
|
||||||
switch ( pf )
|
switch ( pf )
|
||||||
{
|
{
|
||||||
case PixelFormat_PreMultiplied:
|
case PixelFormat_PreMultiplied:
|
||||||
// Pre-multiply pixel values so that the DIB could be used
|
// Pre-multiply pixel values so that the DIB could be used
|
||||||
// with ::AlphaBlend().
|
// with ::AlphaBlend().
|
||||||
for ( int x = 0; x < w; x++ )
|
for ( x = 0; x < w; x++ )
|
||||||
{
|
{
|
||||||
const unsigned char a = *alpha++;
|
const unsigned char a = *alpha++;
|
||||||
*dst++ = (unsigned char)((src[2] * a + 127) / 255);
|
*dst++ = (unsigned char)((src[2] * a + 127) / 255);
|
||||||
@@ -706,7 +708,7 @@ bool wxDIB::Create(const wxImage& image, PixelFormat pf)
|
|||||||
|
|
||||||
case PixelFormat_NotPreMultiplied:
|
case PixelFormat_NotPreMultiplied:
|
||||||
// Just copy pixel data without changing it.
|
// Just copy pixel data without changing it.
|
||||||
for ( int x = 0; x < w; x++ )
|
for ( x = 0; x < w; x++ )
|
||||||
{
|
{
|
||||||
*dst++ = src[2];
|
*dst++ = src[2];
|
||||||
*dst++ = src[1];
|
*dst++ = src[1];
|
||||||
|
Reference in New Issue
Block a user