C -> CPP
This commit is contained in:
@@ -45,7 +45,7 @@ def processPalette(asset):
|
||||
# Header
|
||||
now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
data = f"// Palette Generated for {asset['path']} at {now}\n"
|
||||
data += f"#include \"display/palette/palette.h\"\n\n"
|
||||
data += f"#include \"display/palette/palette.hpp\"\n\n"
|
||||
data += f"#define PALETTE_{paletteIndex}_COLOR_COUNT {len(pixels)}\n\n"
|
||||
data += f"#pragma pack(push, 1)\n"
|
||||
data += f"static const color_t PALETTE_{paletteIndex}_COLORS[PALETTE_{paletteIndex}_COLOR_COUNT] = {{\n"
|
||||
@@ -59,7 +59,7 @@ def processPalette(asset):
|
||||
data += f"}};\n"
|
||||
|
||||
# Write Header
|
||||
outputFile = os.path.join(args.headers_dir, "display", "palette", f"palette_{paletteIndex}.h")
|
||||
outputFile = os.path.join(args.headers_dir, "display", "palette", f"palette_{paletteIndex}.hpp")
|
||||
os.makedirs(os.path.dirname(outputFile), exist_ok=True)
|
||||
with open(outputFile, "w") as f:
|
||||
f.write(data)
|
||||
@@ -88,7 +88,7 @@ def processPaletteList():
|
||||
data += f"}};\n"
|
||||
|
||||
# Write the palette list to a header file
|
||||
outputFile = os.path.join(args.headers_dir, "display", "palette", "palettelist.h")
|
||||
outputFile = os.path.join(args.headers_dir, "display", "palette", "palettelist.hpp")
|
||||
os.makedirs(os.path.dirname(outputFile), exist_ok=True)
|
||||
with open(outputFile, "w") as f:
|
||||
f.write(data)
|
||||
Reference in New Issue
Block a user