summaryrefslogtreecommitdiff
path: root/scene/resources/default_theme/make_header.py
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/default_theme/make_header.py')
-rwxr-xr-xscene/resources/default_theme/make_header.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/scene/resources/default_theme/make_header.py b/scene/resources/default_theme/make_header.py
index 03c2c9be4a..db449f9417 100755
--- a/scene/resources/default_theme/make_header.py
+++ b/scene/resources/default_theme/make_header.py
@@ -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()