1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Use custom native-run icons for Android and HTML5

This commit is contained in:
L. Krause
2017-05-25 20:57:13 +02:00
parent 90592ccf03
commit 92367968e7
7 changed files with 42 additions and 16 deletions

View File

@@ -1513,23 +1513,26 @@ def split_lib(self, libname):
def save_active_platforms(apnames, ap):
for x in ap:
pth = x + "/logo.png"
# print("open path: "+pth)
pngf = open(pth, "rb")
b = pngf.read(1)
str = " /* AUTOGENERATED FILE, DO NOT EDIT */ \n"
str += " static const unsigned char _" + x[9:] + "_logo[]={"
while(len(b) == 1):
str += hex(ord(b))
names = ['logo']
if os.path.isfile(x + "/run_icon.png"):
names.append('run_icon')
for name in names:
pngf = open(x + "/" + name + ".png", "rb")
b = pngf.read(1)
if (len(b) == 1):
str += ","
str = " /* AUTOGENERATED FILE, DO NOT EDIT */ \n"
str += " static const unsigned char _" + x[9:] + "_" + name + "[]={"
while(len(b) == 1):
str += hex(ord(b))
b = pngf.read(1)
if (len(b) == 1):
str += ","
str += "};\n"
str += "};\n"
wf = x + "/logo.gen.h"
logow = open(wf, "wb")
logow.write(str)
wf = x + "/" + name + ".gen.h"
pngw = open(wf, "wb")
pngw.write(str)
def no_verbose(sys, env):