summaryrefslogtreecommitdiff
path: root/methods.py
diff options
context:
space:
mode:
Diffstat (limited to 'methods.py')
-rw-r--r--methods.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/methods.py b/methods.py
index ee88401671..7ede2592ff 100644
--- a/methods.py
+++ b/methods.py
@@ -488,29 +488,29 @@ def use_windows_spawn_fix(self, platform=None):
def save_active_platforms(apnames, ap):
for x in ap:
- 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)
- str = " /* AUTOGENERATED FILE, DO NOT EDIT */ \n"
- str += " static const unsigned char _" + x[9:] + "_" + name + "[]={"
+ svg_names = []
+ if os.path.isfile(x + "/logo.svg"):
+ svg_names.append("logo")
+ if os.path.isfile(x + "/run_icon.svg"):
+ svg_names.append("run_icon")
+
+ for name in svg_names:
+ svgf = open(x + "/" + name + ".svg", "rb")
+ b = svgf.read(1)
+ svg_str = " /* AUTOGENERATED FILE, DO NOT EDIT */ \n"
+ svg_str += " static const char *_" + x[9:] + "_" + name + '_svg = "'
while len(b) == 1:
- str += hex(ord(b))
- b = pngf.read(1)
- if len(b) == 1:
- str += ","
+ svg_str += "\\" + hex(ord(b))[1:]
+ b = svgf.read(1)
- str += "};\n"
+ svg_str += '";\n'
- pngf.close()
+ svgf.close()
# NOTE: It is safe to generate this file here, since this is still executed serially
- wf = x + "/" + name + ".gen.h"
- with open(wf, "w") as pngw:
- pngw.write(str)
+ wf = x + "/" + name + "_svg.gen.h"
+ with open(wf, "w") as svgw:
+ svgw.write(svg_str)
def no_verbose(sys, env):