From ec5deea3f01e86508d2028d6d8147053a9217818 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 24 Sep 2016 14:19:35 +0200 Subject: [PATCH] Changed: Generate an exception if file is not a supported bitmap format --HG-- branch : develop --- code/nel/tools/3d/build_interface/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp index 04213d34b..c56934662 100644 --- a/code/nel/tools/3d/build_interface/main.cpp +++ b/code/nel/tools/3d/build_interface/main.cpp @@ -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));