mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-26 17:16:20 +00:00
Changed: Generate an exception if file is not a supported bitmap format
--HG-- branch : develop
This commit is contained in:
parent
af1f02c53f
commit
ec5deea3f0
1 changed files with 3 additions and 1 deletions
|
@ -263,10 +263,12 @@ int main(int argc, char **argv)
|
|||
pBtmp = new NLMISC::CBitmap;
|
||||
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);
|
||||
|
||||
if (!colors) throw NLMISC::Exception(toString("%s is not a bitmap", AllMapNames[i].c_str()));
|
||||
|
||||
if (pBtmp->getPixelFormat() != CBitmap::RGBA)
|
||||
{
|
||||
outString(toString("Converting %s to RGBA (32 bits), originally using %u bits...", AllMapNames[i].c_str(), (uint)colors));
|
||||
|
|
Loading…
Reference in a new issue