1
0
mirror of https://github.com/weiju/amiga-stuff synced 2025-11-20 00:09:58 +00:00

added sound effects playing

This commit is contained in:
Wei-ju Wu
2016-11-29 15:40:07 -08:00
parent 57f3a4f22d
commit de5588751d
6 changed files with 135 additions and 9 deletions

View File

@ -75,6 +75,8 @@ def write_amiga_image(im, outfile, img_name, use_intuition, interleaved, verbose
# colors is a list of 3-integer lists ([[r1, g1, b1], ...])
colors = [i for i in chunks([b for b in im.palette.tobytes()], 3)]
depth = round(math.log(len(colors), 2))
if depth == 0:
raise Exception("images with only 1 color can't be handled")
# fill the missing colors with black entries
num_missing_colors = 2 ** depth - len(colors)
colors += [[0, 0, 0]] * num_missing_colors