void dumpTGA(const Common::UString &fileName, const ImageDecoder *image) { if (!image || (image->getMipMapCount() < 1)) throw Common::Exception("No image"); const ImageDecoder::MipMap &mipMap = image->getMipMap(0); dumpTGA(fileName, mipMap.data, mipMap.width, mipMap.height, image->getFormat()); }
void Console::cmdDumpTGA(const CommandLine &cl) { if (cl.args.empty()) { printCommandHelp(cl.cmd); return; } if (dumpTGA(cl.args)) printf("Dumped TGA \"%s\"", cl.args.c_str()); else printf("Failed dumping TGA \"%s\"", cl.args.c_str()); }