Started asset refact
This commit is contained in:
@@ -36,7 +36,6 @@ def processPalette(asset):
|
||||
|
||||
# PSP requires that the palette size be a power of two, so we will pad the
|
||||
# palette with transparent colors if needed.
|
||||
# if args.platform == "psp":
|
||||
def mathNextPowTwo(x):
|
||||
return 1 << (x - 1).bit_length()
|
||||
|
||||
@@ -53,7 +52,7 @@ def processPalette(asset):
|
||||
data += f"static const color_t PALETTE_{paletteIndex}_COLORS[PALETTE_{paletteIndex}_COLOR_COUNT] = {{\n"
|
||||
for pixel in pixels:
|
||||
data += f" {{ 0x{pixel[0]:02X}, 0x{pixel[1]:02X}, 0x{pixel[2]:02X}, 0x{pixel[3]:02X} }},\n"
|
||||
data += f"}};\n\n"
|
||||
data += f"}};\n"
|
||||
data += f"#pragma pack(pop)\n\n"
|
||||
data += f"static const palette_t PALETTE_{paletteIndex} = {{\n"
|
||||
data += f" .colorCount = PALETTE_{paletteIndex}_COLOR_COUNT,\n"
|
||||
|
||||
Reference in New Issue
Block a user