From 51bfb41c640e184ddac422fd010f7f6b6782eb8e Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 Aug 2010 17:03:41 +0200 Subject: [PATCH] Changed: Allow to write interface into a PNG file --- code/nel/tools/3d/build_interface/main.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp index 207519aaa..1f8d50997 100644 --- a/code/nel/tools/3d/build_interface/main.cpp +++ b/code/nel/tools/3d/build_interface/main.cpp @@ -366,9 +366,20 @@ int main(int nNbArg, char **ppArgs) fmtName += ".tga"; if (outTga.open(fmtName)) { - GlobalTexture.writeTGA (outTga, 32); + std::string ext; + if (toLower(fmtName.find(".png")) != string::npos) + { + ext = "png"; + GlobalTexture.writePNG (outTga, 32); + } + else + { + ext = "tga"; + GlobalTexture.writeTGA (outTga, 32); + } + outTga.close(); - outString (string("Writing tga file : ") + fmtName + "\n"); + outString (toString("Writing %s file : %s\n", ext.c_str(), fmtName.c_str())); } else {