diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/SCsub | 14 | ||||
-rw-r--r-- | tools/editor/SCsub | 8 | ||||
-rw-r--r-- | tools/editor/icons/SCsub | 36 | ||||
-rwxr-xr-x | tools/scripts/file-hex-array.py | 3 | ||||
-rw-r--r-- | tools/scripts/make_glwrapper.py | 10 |
5 files changed, 36 insertions, 35 deletions
diff --git a/tools/SCsub b/tools/SCsub index f11aa34ee6..43cad794d4 100644 --- a/tools/SCsub +++ b/tools/SCsub @@ -47,11 +47,11 @@ def make_translations_header(target, source, env): xl_names.append([name, len(buf), str(decomp_size)]) g.write("struct EditorTranslationList {\n") - g.write("\tconst char* lang;\n"); - g.write("\tint comp_size;\n"); - g.write("\tint uncomp_size;\n"); - g.write("\tconst unsigned char* data;\n"); - g.write("};\n\n"); + g.write("\tconst char* lang;\n") + g.write("\tint comp_size;\n") + g.write("\tint uncomp_size;\n") + g.write("\tconst unsigned char* data;\n") + g.write("};\n\n") g.write("static EditorTranslationList _editor_translations[]={\n") for x in xl_names: g.write("\t{ \"" + x[0] + "\", " + str(x[1]) + ", " + str(x[2]) + ",_translation_" + x[0] + "_compressed},\n") @@ -112,8 +112,8 @@ if (env["tools"] != "no"): env.Depends('#tools/editor/builtin_fonts.h', flist) env.Command('#tools/editor/builtin_fonts.h', flist, make_fonts_header) - SConscript('editor/SCsub'); - SConscript('collada/SCsub'); + SConscript('editor/SCsub') + SConscript('collada/SCsub') SConscript('doc/SCsub') lib = env.Library("tool", env.tool_sources) diff --git a/tools/editor/SCsub b/tools/editor/SCsub index 625103eaee..caf45d25be 100644 --- a/tools/editor/SCsub +++ b/tools/editor/SCsub @@ -74,7 +74,7 @@ if (env["tools"] == "yes"): env.add_source_files(env.tool_sources, "*.cpp") Export('env') - SConscript('icons/SCsub'); - SConscript('plugins/SCsub'); - SConscript('fileserver/SCsub'); - SConscript('io_plugins/SCsub'); + SConscript('icons/SCsub') + SConscript('plugins/SCsub') + SConscript('fileserver/SCsub') + SConscript('io_plugins/SCsub') diff --git a/tools/editor/icons/SCsub b/tools/editor/icons/SCsub index f27350a184..af6ebd67fd 100644 --- a/tools/editor/icons/SCsub +++ b/tools/editor/icons/SCsub @@ -22,42 +22,42 @@ def make_editor_icons_action(target, source, env): for x in pixmaps: x = str(x) - var_str = os.path.basename(x)[:-4] + "_png"; + var_str = os.path.basename(x)[:-4] + "_png" # print(var_str) - s.write("static const unsigned char " + var_str + "[]={\n"); + s.write("static const unsigned char " + var_str + "[]={\n") - pngf = open(x, "rb"); + pngf = open(x, "rb") - b = pngf.read(1); + b = pngf.read(1) while(len(b) == 1): s.write(hex(ord(b))) - b = pngf.read(1); + b = pngf.read(1) if (len(b) == 1): s.write(",") - s.write("\n};\n\n"); + s.write("\n};\n\n") - pngf.close(); - var_str = os.path.basename(x)[:-4] + "_hidpi_png"; + pngf.close() + var_str = os.path.basename(x)[:-4] + "_hidpi_png" try: pngf = open(os.path.dirname(x) + "/2x/" + os.path.basename(x), "rb") - s.write("static const unsigned char " + var_str + "[]={\n"); + s.write("static const unsigned char " + var_str + "[]={\n") - b = pngf.read(1); + b = pngf.read(1) while(len(b) == 1): s.write(hex(ord(b))) - b = pngf.read(1); + b = pngf.read(1) if (len(b) == 1): s.write(",") - s.write("\n};\n\n\n"); + s.write("\n};\n\n\n") hidpi_list.append(x) except: - s.write("static const unsigned char* " + var_str + "=NULL;\n\n\n"); + s.write("static const unsigned char* " + var_str + "=NULL;\n\n\n") s.write("static Ref<ImageTexture> make_icon(const uint8_t* p_png,const uint8_t* p_hidpi_png) {\n") s.write("\tRef<ImageTexture> texture( memnew( ImageTexture ) );\n") @@ -74,12 +74,12 @@ def make_editor_icons_action(target, source, env): for x in pixmaps: x = os.path.basename(str(x)) - type = x[5:-4].title().replace("_", ""); - var_str = x[:-4] + "_png"; - var_str_hidpi = x[:-4] + "_hidpi_png"; - s.write("\tp_theme->set_icon(\"" + type + "\",\"EditorIcons\",make_icon(" + var_str + "," + var_str_hidpi + "));\n"); + type = x[5:-4].title().replace("_", "") + var_str = x[:-4] + "_png" + var_str_hidpi = x[:-4] + "_hidpi_png" + s.write("\tp_theme->set_icon(\"" + type + "\",\"EditorIcons\",make_icon(" + var_str + "," + var_str_hidpi + "));\n") - s.write("\n\n}\n\n"); + s.write("\n\n}\n\n") f = open(dst, "wb") f.write(s.getvalue()) diff --git a/tools/scripts/file-hex-array.py b/tools/scripts/file-hex-array.py index da95c9505f..a6cdfe541f 100755 --- a/tools/scripts/file-hex-array.py +++ b/tools/scripts/file-hex-array.py @@ -9,7 +9,8 @@ def tof(filepath): content = content.replace("0x", "") content = content.split(',') for i in range(len(content)): - if len(content[i]) == 1: content[i] = "0" + content[i] + if len(content[i]) == 1: + content[i] = "0" + content[i] content = "".join(content) with open(filepath + ".file", 'wb') as f: content = f.write(content.decode("hex")) diff --git a/tools/scripts/make_glwrapper.py b/tools/scripts/make_glwrapper.py index bae0eeeadc..5694d2327e 100644 --- a/tools/scripts/make_glwrapper.py +++ b/tools/scripts/make_glwrapper.py @@ -61,7 +61,7 @@ for x in (range(len(sys.argv) - 1)): if (glpos == -1): continue - ret = line[:glpos].strip(); + ret = line[:glpos].strip() line = line[glpos:].strip() namepos = line.find("(") @@ -127,14 +127,14 @@ header_code = """\ f.write("#include <stddef.h>\n\n\n") -f.write(header_code); +f.write(header_code) f.write("#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n") f.write("#if defined(_WIN32) && !defined(__CYGWIN__)\n") f.write("#define GLWRP_APIENTRY __stdcall\n") -f.write("#else\n"); +f.write("#else\n") f.write("#define GLWRP_APIENTRY \n") -f.write("#endif\n\n"); +f.write("#endif\n\n") for x in types: f.write(x + "\n") @@ -150,7 +150,7 @@ for x in functions: f.write("#define " + x["name"] + " __wrapper_" + x["name"] + "\n") f.write("\n\n") -f.write("typedef void (*GLWrapperFuncPtr)(void);\n\n"); +f.write("typedef void (*GLWrapperFuncPtr)(void);\n\n") f.write("void glWrapperInit( GLWrapperFuncPtr (*wrapperFunc)(const char*) );\n") f.write("#ifdef __cplusplus\n}\n#endif\n") |