summaryrefslogtreecommitdiff
path: root/scene/resources/default_theme/make_png_header.py
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/default_theme/make_png_header.py')
-rw-r--r--scene/resources/default_theme/make_png_header.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/scene/resources/default_theme/make_png_header.py b/scene/resources/default_theme/make_png_header.py
new file mode 100644
index 0000000000..0f0ce1808f
--- /dev/null
+++ b/scene/resources/default_theme/make_png_header.py
@@ -0,0 +1,41 @@
+
+import os;
+import glob;
+import string;
+
+pixmaps = glob.glob("*.png");
+
+pixmaps.sort();
+
+#Generate include files
+
+f=open("theme_data.h","wb")
+
+f.write("// THIS FILE HAS BEEN AUTOGENERATED, DONT EDIT!!\n");
+
+f.write("\n\n");
+
+f.write("\n\n\n");
+
+
+
+for x in pixmaps:
+
+ var_str=x[:-4]+"_png";
+
+ f.write("static const unsigned char "+ var_str +"[]={\n");
+
+ pngf=open(x,"rb");
+
+ b=pngf.read(1);
+ while(len(b)==1):
+ f.write(hex(ord(b)))
+ b=pngf.read(1);
+ if (len(b)==1):
+ f.write(",")
+
+ f.write("\n};\n\n\n");
+ pngf.close();
+
+f.close();
+