Commit 9ce25254 authored by hybrid's avatar hybrid

Silence missing default case warnings in release mode. Patch supplied by init512

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4028 dfc29bdd-3216-0410-991c-e03cc46cb475
parent c0586e30
......@@ -628,6 +628,10 @@ void CColorConverter::convert_viaFormat(const void* sP, ECOLOR_FORMAT sF, s32 sN
case ECF_R8G8B8:
convert_A1R5G5B5toR8G8B8(sP, sN, dP);
break;
#ifndef _DEBUG
default:
break;
#endif
}
break;
case ECF_R5G6B5:
......@@ -645,6 +649,10 @@ void CColorConverter::convert_viaFormat(const void* sP, ECOLOR_FORMAT sF, s32 sN
case ECF_R8G8B8:
convert_R5G6B5toR8G8B8(sP, sN, dP);
break;
#ifndef _DEBUG
default:
break;
#endif
}
break;
case ECF_A8R8G8B8:
......@@ -662,6 +670,10 @@ void CColorConverter::convert_viaFormat(const void* sP, ECOLOR_FORMAT sF, s32 sN
case ECF_R8G8B8:
convert_A8R8G8B8toR8G8B8(sP, sN, dP);
break;
#ifndef _DEBUG
default:
break;
#endif
}
break;
case ECF_R8G8B8:
......@@ -679,6 +691,10 @@ void CColorConverter::convert_viaFormat(const void* sP, ECOLOR_FORMAT sF, s32 sN
case ECF_R8G8B8:
convert_R8G8B8toR8G8B8(sP, sN, dP);
break;
#ifndef _DEBUG
default:
break;
#endif
}
break;
}
......@@ -687,4 +703,3 @@ void CColorConverter::convert_viaFormat(const void* sP, ECOLOR_FORMAT sF, s32 sN
} // end namespace video
} // end namespace irr
......@@ -211,6 +211,10 @@ void CImage::setPixel(u32 x, u32 y, const SColor &color, bool blend)
u32 * dest = (u32*) (Data + ( y * Pitch ) + ( x << 2 ));
*dest = blend ? PixelBlend32 ( *dest, color.color ) : color.color;
} break;
#ifndef _DEBUG
default:
break;
#endif
}
}
......@@ -234,6 +238,10 @@ SColor CImage::getPixel(u32 x, u32 y) const
u8* p = Data+(y*3)*Size.Width + (x*3);
return SColor(255,p[0],p[1],p[2]);
}
#ifndef _DEBUG
default:
break;
#endif
}
return SColor(0);
......
......@@ -80,6 +80,10 @@ bool CImageWriterBMP::writeImage(io::IWriteFile* file, IImage* image, u32 param)
CColorConverter_convertFORMATtoFORMAT
= CColorConverter::convert_R5G6B5toR8G8B8;
break;
#ifndef _DEBUG
default:
break;
#endif
}
// couldn't find a color converter
......
......@@ -121,6 +121,10 @@ static bool writeJPEGFile(io::IWriteFile* file, IImage* image, u32 quality)
case ECF_R5G6B5:
format = CColorConverter::convert_R5G6B5toR8G8B8;
break;
#ifndef _DEBUG
default:
break;
#endif
}
// couldn't find a color converter
......
......@@ -124,18 +124,7 @@ bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param)
}
s32 lineWidth=image->getDimension().Width;
switch(image->getColorFormat())
{
case ECF_R8G8B8:
case ECF_R5G6B5:
lineWidth*=3;
break;
case ECF_A8R8G8B8:
case ECF_A1R5G5B5:
lineWidth*=4;
break;
}
u8* tmpImage = new u8[image->getDimension().Height*lineWidth];
u8* tmpImage = new u8[image->getDimension().Height*lineWidth*image->getBytesPerPixel()];
if (!tmpImage)
{
os::Printer::log("PNGWriter: Internal PNG create image failure\n", file->getFileName(), ELL_ERROR);
......@@ -158,6 +147,11 @@ bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param)
case ECF_A1R5G5B5:
CColorConverter::convert_A1R5G5B5toA8R8G8B8(data,image->getDimension().Height*image->getDimension().Width,tmpImage);
break;
#ifndef _DEBUG
// TODO: Error handling in case of unsupported color format
default:
break;
#endif
}
image->unlock();
......
......@@ -84,6 +84,10 @@ bool CImageWriterTGA::writeImage(io::IWriteFile *file, IImage *image,u32 param)
imageHeader.PixelDepth = 24;
imageHeader.ImageDescriptor |= 0;
break;
#ifndef _DEBUG
default:
break;
#endif
}
// couldn't find a color converter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment