Changed: Generate an exception if file is not a supported bitmap format
This commit is contained in:
parent
031da2f78a
commit
f3e265c701
1 changed files with 3 additions and 1 deletions
|
@ -263,10 +263,12 @@ int main(int argc, char **argv)
|
||||||
pBtmp = new NLMISC::CBitmap;
|
pBtmp = new NLMISC::CBitmap;
|
||||||
NLMISC::CIFile inFile;
|
NLMISC::CIFile inFile;
|
||||||
|
|
||||||
if (!inFile.open(AllMapNames[i])) throw NLMISC::Exception("Unable to open " + AllMapNames[i]);
|
if (!inFile.open(AllMapNames[i])) throw NLMISC::Exception(toString("Unable to open %s", AllMapNames[i].c_str()));
|
||||||
|
|
||||||
uint8 colors = pBtmp->load(inFile);
|
uint8 colors = pBtmp->load(inFile);
|
||||||
|
|
||||||
|
if (!colors) throw NLMISC::Exception(toString("%s is not a bitmap", AllMapNames[i].c_str()));
|
||||||
|
|
||||||
if (pBtmp->getPixelFormat() != CBitmap::RGBA)
|
if (pBtmp->getPixelFormat() != CBitmap::RGBA)
|
||||||
{
|
{
|
||||||
outString(toString("Converting %s to RGBA (32 bits), originally using %u bits...", AllMapNames[i].c_str(), (uint)colors));
|
outString(toString("Converting %s to RGBA (32 bits), originally using %u bits...", AllMapNames[i].c_str(), (uint)colors));
|
||||||
|
|
Loading…
Reference in a new issue