summaryrefslogtreecommitdiff
path: root/src/convert-icon
diff options
context:
space:
mode:
authorSimon Howard2006-01-16 23:35:55 +0000
committerSimon Howard2006-01-16 23:35:55 +0000
commitf3a3dd9aa480a060a54bfc1b1a203aeaf90ef073 (patch)
tree539337d4de2815238442c71bac8208515ae7eb64 /src/convert-icon
parent764d7ecb7a88b2ad0381574a05b90ccedce6655c (diff)
downloadchocolate-doom-f3a3dd9aa480a060a54bfc1b1a203aeaf90ef073.tar.gz
chocolate-doom-f3a3dd9aa480a060a54bfc1b1a203aeaf90ef073.tar.bz2
chocolate-doom-f3a3dd9aa480a060a54bfc1b1a203aeaf90ef073.zip
Write icon data as hex numbers, rather than decimal
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 297
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(" ")