From 07828b78525d85498811687311f0a9cff5901e03 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Sun, 4 Jan 2009 20:29:17 +0000 Subject: Small fix to the tile_convert utility to allow PNGs to be loaded too. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8206 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/rltiles/tool/tile_convert.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/rltiles/tool') diff --git a/crawl-ref/source/rltiles/tool/tile_convert.cc b/crawl-ref/source/rltiles/tool/tile_convert.cc index b65518cfb2..aa337fc5cb 100644 --- a/crawl-ref/source/rltiles/tool/tile_convert.cc +++ b/crawl-ref/source/rltiles/tool/tile_convert.cc @@ -18,16 +18,22 @@ int main(int argc, char **argv) strcpy(dest, argv[1]); size_t len = strlen(dest); - if (strcmp(&dest[len-4], ".bmp")) + if (!strcmp(&dest[len-4], ".bmp")) { - printf("File '%s' does not end in bmp.\n", argv[1]); + dest[len-3] = 'p'; + dest[len-2] = 'n'; + dest[len-1] = 'g'; + } + else if (!strcmp(&dest[len-4], ".png")) + { + // ok as-is. + } + else + { + printf("File '%s' does not end in bmp or png.\n", argv[1]); return -2; } - dest[len-3] = 'p'; - dest[len-2] = 'n'; - dest[len-1] = 'g'; - tile conv; if (!conv.load(argv[1])) { -- cgit v1.2.3-54-g00ecf