summaryrefslogtreecommitdiff
path: root/misc/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'misc/scripts')
-rw-r--r--misc/scripts/fix_headers.py8
-rw-r--r--misc/scripts/make_glwrapper.py9
-rw-r--r--misc/scripts/make_icons.sh29
3 files changed, 35 insertions, 11 deletions
diff --git a/misc/scripts/fix_headers.py b/misc/scripts/fix_headers.py
index 809820c20f..48b9628b1f 100644
--- a/misc/scripts/fix_headers.py
+++ b/misc/scripts/fix_headers.py
@@ -92,9 +92,11 @@ while (fname != ""):
fileread.close()
# Write
- fileread = open(fname.strip(), "wb")
- fileread.write(text)
- fileread.close()
+ filewrite = open(fname.strip(), "wb")
+ filewrite.write(text)
+ filewrite.close()
# Next file
fname = files.readline()
+
+files.close() \ No newline at end of file
diff --git a/misc/scripts/make_glwrapper.py b/misc/scripts/make_glwrapper.py
index 5694d2327e..15b66a950b 100644
--- a/misc/scripts/make_glwrapper.py
+++ b/misc/scripts/make_glwrapper.py
@@ -16,9 +16,7 @@ READ_CONSTANTS = 2
read_what = READ_TYPES
-for x in (range(len(sys.argv) - 1)):
- f = open(sys.argv[x + 1], "r")
-
+def read_file(f):
while(True):
line = f.readline()
@@ -86,6 +84,9 @@ for x in (range(len(sys.argv) - 1)):
functions.append(funcdata)
print(funcdata)
+for path in sys.argv[1:]:
+ with open(path, "r") as f:
+ read_file(f)
# print(types)
# print(constants)
@@ -156,6 +157,7 @@ f.write("void glWrapperInit( GLWrapperFuncPtr (*wrapperFunc)(const char*) );\n")
f.write("#ifdef __cplusplus\n}\n#endif\n")
f.write("#endif\n\n")
+f.close()
f = open("glwrapper.c", "w")
@@ -176,3 +178,4 @@ for x in functions:
f.write("\n\n")
f.write("}\n")
f.write("\n\n")
+f.close()
diff --git a/misc/scripts/make_icons.sh b/misc/scripts/make_icons.sh
index 71037cd1c3..5f3ea40d6a 100644
--- a/misc/scripts/make_icons.sh
+++ b/misc/scripts/make_icons.sh
@@ -1,5 +1,24 @@
-convert -resize 32x32 ../../icon.svg icon32.ico
-convert -resize 32x32 ../../icon.svg icon32.icns
-for s in 16 24 32 64 96 128 256; do convert -resize ${s}x$s ../../icon.svg icon$s.png; done
-zip icons.zip icon*.png
-rm icon*.png
+# Generate .ico, .icns and .zip set of icons for Steam
+
+# Make icons with transparent backgrounds and all sizes
+for s in 16 24 32 48 64 128 256 512 1024; do
+ convert -resize ${s}x$s -antialias \
+ -background transparent \
+ ../../icon.svg icon$s.png
+done
+
+# 16px tga file for library
+convert icon16.png icon16.tga
+
+# zip for Linux
+zip godot-icons.zip icon*.png
+
+# ico for Windows
+# Not including biggest ones or it blows up in size
+icotool -c -o godot-icon.ico icon{16,24,32,48,64,128,256}.png
+
+# icns for macOS
+# Only some sizes: http://iconhandbook.co.uk/reference/chart/osx/
+png2icns godot-icon.icns icon{16,32,128,256,512,1024}.png
+
+rm -f icon*.png