Update generate_world_map.bin.py

Fix for https://github.com/eried/portapack-mayhem/issues/217
This commit is contained in:
Erwin Ried 2020-10-24 22:38:43 +02:00
parent 94fcab19d9
commit 47c5c1e9e5

View File

@ -33,6 +33,8 @@ pix = im.load()
outfile.write(struct.pack('H', im.size[0]))
outfile.write(struct.pack('H', im.size[1]))
print("Generating: \t" + outfile.name + "\n from\t\t" + im.filename + "\n please wait...");
for y in range (0, im.size[1]):
line = ''
for x in range (0, im.size[0]):
@ -45,6 +47,8 @@ for y in range (0, im.size[1]):
# pixel_lcd = (pix[x, y][0] >> 5) << 5
# pixel_lcd |= (pix[x, y][1] >> 5) << 2
# pixel_lcd |= (pix[x, y][2] >> 6)
line += struct.pack('H', pixel_lcd)
outfile.write(line)
line += str(struct.pack('H', pixel_lcd))
outfile.write(line.encode('utf-8'))
print(str(y) + '/' + str(im.size[1]) + '\r', end="")
print("Ready.");