[Horus] Next round of screen changes + refactoring

This commit is contained in:
Bertrand Songis
2015-11-03 19:53:55 +01:00
parent 8f4c161dc0
commit a556c50956
106 changed files with 1848 additions and 1195 deletions
+2 -2
View File
@@ -86,8 +86,8 @@ def createFontBitmap(filename, fontname, fontsize, fontbold, foreground, backgro
f.write("{ ")
f.write(",".join(str(tmp) for tmp in coords))
if extraWidth:
for w in (7, 20, 30, 41, 52, 57, 70, 80, 92, 104, 113, 126, 136):
f.write(", %d" % (int(coords[-1])+w))
for i in range(1, 14):
f.write(", %d" % (int(coords[-1])+i*(extraWidth/12)))
# f.write(file("fonts/extra_%dpx.specs" % fontsize).read())
f.write(" }")
f.close()
+4 -3
View File
@@ -44,13 +44,14 @@ elif what == "4/4/4/4":
pixel = image.pixel(x, y)
f.write("0x%1x%1x%1x%1x," % (Qt.qAlpha(pixel)/16, Qt.qRed(pixel)/16, Qt.qGreen(pixel)/16, Qt.qBlue(pixel)/16))
f.write("\n")
elif what == "5/6/5":
elif what == "5/6/5/8":
colors = []
f.write("%d,%d,\n" % (width, height))
writeSize(f, width, height)
for y in range(height):
for x in range(width):
pixel = image.pixel(x, y)
f.write("0x%04x," % (((Qt.qRed(pixel) >> 3) << 11) + ((Qt.qGreen(pixel) >> 2) << 5) + ((Qt.qBlue(pixel) >> 3) << 0)))
val = ((Qt.qRed(pixel) >> 3) << 11) + ((Qt.qGreen(pixel) >> 2) << 5) + ((Qt.qBlue(pixel) >> 3) << 0)
f.write("%d,%d,%d," % (val%256, val/256, Qt.qAlpha(pixel) >> 4))
f.write("\n")
elif what == "4bits":
colors = []