mirror of
https://github.com/gryf/wmdocklib.git
synced 2026-10-06 05:40:33 +02:00
Fixed bitmap replacement.
For the existing character in both palettes, but with different color, there was missing adding the actual replacement for the original one. In this patch it was fixed. Also, loops has been removed in favor of list comprehensions.
This commit is contained in:
1 parent
222301fa93
commit
1cf858d431
1 file changed
+5
-8
@@ -254,10 +254,10 @@ def merge_palettes(pal1, pal2, bitmap_list):
|
||||
all_chars = pal1.copy()
|
||||
all_chars.update(pal2)
|
||||
sub = get_unique_key(all_chars)
|
||||
temp = []
|
||||
for line in bitmap_list:
|
||||
temp.append(line.replace(new_char, sub))
|
||||
bitmap_list = temp
|
||||
# remap clashing character to the new one
|
||||
bitmap_list = [r.replace(new_char, sub) for r in bitmap_list]
|
||||
# and now remap character with the one found in first palette
|
||||
bitmap_list = [r.replace(char, new_char) for r in bitmap_list]
|
||||
pal2[sub] = pal2[new_char]
|
||||
pal2[new_char] = MARKER
|
||||
pal2[char] = MARKER
|
||||
@@ -274,10 +274,7 @@ def merge_palettes(pal1, pal2, bitmap_list):
|
||||
all_chars = pal1.copy()
|
||||
all_chars.update(pal2)
|
||||
sub = get_unique_key(all_chars)
|
||||
temp = []
|
||||
for line in bitmap_list:
|
||||
temp.append(line.replace(char, sub))
|
||||
bitmap_list = temp
|
||||
bitmap_list = [r.replace(char, sub) for r in bitmap_list]
|
||||
pal2[sub] = color
|
||||
pal2[char] = MARKER
|
||||
rerun = True
|
||||
|
||||
Reference in new issue
Block a user