summaryrefslogtreecommitdiff
path: root/core/input
diff options
context:
space:
mode:
Diffstat (limited to 'core/input')
-rw-r--r--core/input/SCsub16
-rw-r--r--core/input/input_builders.py20
2 files changed, 26 insertions, 10 deletions
diff --git a/core/input/SCsub b/core/input/SCsub
index f1660932e5..d46e52a347 100644
--- a/core/input/SCsub
+++ b/core/input/SCsub
@@ -1,20 +1,28 @@
#!/usr/bin/env python
-Import('env')
+Import("env")
from platform_methods import run_in_subprocess
import input_builders
# Order matters here. Higher index controller database files write on top of lower index database files.
-controller_databases = ["#core/input/gamecontrollerdb_204.txt", "#core/input/gamecontrollerdb_205.txt", "#core/input/gamecontrollerdb.txt", "#core/input/godotcontrollerdb.txt"]
+controller_databases = [
+ "#core/input/gamecontrollerdb_204.txt",
+ "#core/input/gamecontrollerdb_205.txt",
+ "#core/input/gamecontrollerdb.txt",
+ "#core/input/godotcontrollerdb.txt",
+]
env.Depends("#core/input/default_controller_mappings.gen.cpp", controller_databases)
-env.CommandNoCache("#core/input/default_controller_mappings.gen.cpp", controller_databases, run_in_subprocess(input_builders.make_default_controller_mappings))
+env.CommandNoCache(
+ "#core/input/default_controller_mappings.gen.cpp",
+ controller_databases,
+ run_in_subprocess(input_builders.make_default_controller_mappings),
+)
env.add_source_files(env.core_sources, "*.cpp")
# Don't warn about duplicate entry here, we need it registered manually for first build,
# even if later builds will pick it up twice due to above *.cpp globbing.
env.add_source_files(env.core_sources, "#core/input/default_controller_mappings.gen.cpp", warn_duplicates=False)
-
diff --git a/core/input/input_builders.py b/core/input/input_builders.py
index ca142c0c80..6184c5debb 100644
--- a/core/input/input_builders.py
+++ b/core/input/input_builders.py
@@ -12,8 +12,8 @@ def make_default_controller_mappings(target, source, env):
g = open(dst, "w")
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
- g.write("#include \"core/typedefs.h\"\n")
- g.write("#include \"core/input/default_controller_mappings.h\"\n")
+ g.write('#include "core/typedefs.h"\n')
+ g.write('#include "core/input/default_controller_mappings.h"\n')
# ensure mappings have a consistent order
platform_mappings = OrderedDict()
@@ -37,11 +37,19 @@ def make_default_controller_mappings(target, source, env):
line_parts = line.split(",")
guid = line_parts[0]
if guid in platform_mappings[current_platform]:
- g.write("// WARNING - DATABASE {} OVERWROTE PRIOR MAPPING: {} {}\n".format(src_path, current_platform, platform_mappings[current_platform][guid]))
+ g.write(
+ "// WARNING - DATABASE {} OVERWROTE PRIOR MAPPING: {} {}\n".format(
+ src_path, current_platform, platform_mappings[current_platform][guid]
+ )
+ )
valid_mapping = True
for input_map in line_parts[2:]:
if "+" in input_map or "-" in input_map or "~" in input_map:
- g.write("// WARNING - DISCARDED UNSUPPORTED MAPPING TYPE FROM DATABASE {}: {} {}\n".format(src_path, current_platform, line))
+ g.write(
+ "// WARNING - DISCARDED UNSUPPORTED MAPPING TYPE FROM DATABASE {}: {} {}\n".format(
+ src_path, current_platform, line
+ )
+ )
valid_mapping = False
break
if valid_mapping:
@@ -62,12 +70,12 @@ def make_default_controller_mappings(target, source, env):
variable = platform_variables[platform]
g.write("{}\n".format(variable))
for mapping in mappings.values():
- g.write("\t\"{}\",\n".format(mapping))
+ g.write('\t"{}",\n'.format(mapping))
g.write("#endif\n")
g.write("\tNULL\n};\n")
g.close()
-if __name__ == '__main__':
+if __name__ == "__main__":
subprocess_main(globals())