Fix theme_data.h formatting via make_header.py

Should make clang-format happy.
This commit is contained in:
Rémi Verschelde 2017-04-27 08:57:43 +02:00
parent d730ee66a4
commit 5f15f03d38
2 changed files with 232 additions and 352 deletions

View File

@ -1,3 +1,4 @@
#!/usr/bin/env python
import os
import glob
@ -10,21 +11,17 @@ f = open("theme_data.h", "wb")
f.write("// THIS FILE HAS BEEN AUTOGENERATED, DON'T EDIT!!\n")
f.write("\n\n")
# Generate png image block
f.write("\n// png image block\n");
pixmaps = glob.glob("*.png")
pixmaps.sort()
f.write("\n\n\n")
for x in pixmaps:
var_str = x[:-4] + "_png"
f.write("static const unsigned char " + var_str + "[]={\n")
f.write("\nstatic const unsigned char " + var_str + "[] = {\n\t")
pngf = open(x, "rb")
@ -33,24 +30,22 @@ for x in pixmaps:
f.write(hex(ord(b)))
b = pngf.read(1)
if (len(b) == 1):
f.write(",")
f.write(", ")
f.write("\n};\n\n\n")
f.write("\n};\n")
pngf.close()
# Generate shaders block
f.write("\n// shaders block\n");
shaders = glob.glob("*.gsl")
shaders.sort()
f.write("\n\n\n")
for x in shaders:
var_str = x[:-4] + "_shader_code"
f.write("static const char *" + var_str + "=\n")
f.write("\nstatic const char *" + var_str + " = \n")
sf = open(x, "rb")
@ -65,7 +60,7 @@ for x in shaders:
if (b != ""):
f.write("\"\n")
f.write("\";\n\n\n")
f.write("\";\n")
sf.close()
f.close()

File diff suppressed because one or more lines are too long