From f3a3dd9aa480a060a54bfc1b1a203aeaf90ef073 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 16 Jan 2006 23:35:55 +0000 Subject: Write icon data as hex numbers, rather than decimal Subversion-branch: /trunk/chocolate-doom Subversion-revision: 297 --- src/convert-icon | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/convert-icon') diff --git a/src/convert-icon b/src/convert-icon index 9c093b89..c42093d6 100755 --- a/src/convert-icon +++ b/src/convert-icon @@ -1,6 +1,6 @@ #!/usr/bin/python # -# $Id: convert-icon 137 2005-09-27 22:23:32Z fraggle $ +# $Id: convert-icon 297 2006-01-16 23:35:55Z fraggle $ # # Copyright(C) 2005 Simon Howard # @@ -22,6 +22,9 @@ # Converts images into C structures to be inserted in programs # # $Log$ +# Revision 1.3 2006/01/16 23:35:55 fraggle +# Write icon data as hex numbers, rather than decimal +# # Revision 1.2 2005/09/27 22:23:32 fraggle # Don't write converted output file unless everything went through # okay. @@ -60,10 +63,10 @@ def convert_image(filename, output_filename): for y in range(size[1]): for x in range(size[0]): val = im.getpixel((x, y)) - outfile.write("%i,%i,%i, " % val) + outfile.write("0x%02x,0x%02x,0x%02x, " % val) elements_on_line += 1 - if elements_on_line > 4: + if elements_on_line >= 4: elements_on_line = 0 outfile.write("\n") outfile.write(" ") -- cgit v1.2.3