shithub: pokered

Download patch

ref: 3a5864fb1317c5ecb830aa8c046c2a4e4231fa7d
parent: 237f2896402058b1ce94867436686b936a6a54c6
author: Bryan Bishop <kanzure@gmail.com>
date: Fri Jan 20 05:19:51 EST 2012

improvements to romviz.py

hg-commit-id: 7c93000d5ae5


--- a/extras/romviz.py
+++ b/extras/romviz.py
@@ -20,20 +20,15 @@
 width = 1024
 height = 1024
 
-color_table = {}
-print "creating color table..."
-for value in range(0, 256):
-    color_table[value] = (value, value, value)
+im = Image.new("P", (width, height))
 
-im = Image.new("RGB", (width, height))
+#print "drawing base color..."
+#for pos in range(0, len(extract_maps.rom)):
+#    widthx = pos % width
+#    heighty = floor(pos / height)
+#    #im.putpixel((widthx, heighty), color_table[ord(extract_maps.rom[pos])])
+#    im.putpixel((widthx, heighty), (0, 0, 0))
 
-print "drawing base color..."
-for pos in range(0, len(extract_maps.rom)):
-    widthx = pos % width
-    heighty = floor(pos / height)
-    #im.putpixel((widthx, heighty), color_table[ord(extract_maps.rom[pos])])
-    im.putpixel((widthx, heighty), (0, 0, 0))
-
     #print "Searching for incbin... for pos= " + hex(pos)
     #incbin_found = analyze_incbins.find_incbin_to_replace_for(pos)
     #if incbin_found == None:
@@ -50,6 +45,6 @@
     for pos in range(start, end+1):
         widthx = pos % width
         heighty = floor(pos / height)
-        im.putpixel((widthx, heighty), (255, 0, 0))
+        im.putpixel((widthx, heighty), 255)
 
 im.save("test.png")