From f3e265c701a164a6e54dfbb409428a32a0e92cd6 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 --- 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));