summaryrefslogtreecommitdiff
path: root/src/convert-icon
diff options
context:
space:
mode:
Diffstat (limited to 'src/convert-icon')
-rwxr-xr-xsrc/convert-icon9
1 files changed, 6 insertions, 3 deletions
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(" ")