AeThex-Engine-Core/engine/core/input/input_builders.py
MrPiglr 9dddce666d
🚀 AeThex Engine v1.0 - Complete Fork
- Forked from Godot Engine 4.7-dev (MIT License)
- Rebranded to AeThex Engine with cyan/purple theme
- Added AI-powered development assistant module
- Integrated Claude API for code completion & error fixing
- Custom hexagon logo and branding
- Multi-platform CI/CD (Windows, Linux, macOS)
- Built Linux editor binary (151MB)
- Complete source code with all customizations

Tech Stack:
- C++ game engine core
- AI Module: Claude 3.5 Sonnet integration
- Build: SCons, 14K+ source files
- License: MIT (Godot) + Custom (AeThex features)

Ready for Windows build via GitHub Actions!
2026-02-23 05:01:56 +00:00

65 lines
2.4 KiB
Python

"""Functions used to generate source files during build time"""
from collections import OrderedDict
import methods
def make_default_controller_mappings(target, source, env):
with methods.generated_wrapper(str(target[0])) as file:
file.write("""\
#include "core/input/default_controller_mappings.h"
#include "core/typedefs.h"
""")
PLATFORM_VARIABLES = {
"Linux": "LINUXBSD",
"Windows": "WINDOWS",
"Mac OS X": "MACOS",
"Android": "ANDROID",
"iOS": "APPLE_EMBEDDED",
"Web": "WEB",
}
# ensure mappings have a consistent order
platform_mappings = OrderedDict()
for src_path in map(str, source):
with open(src_path, "r", encoding="utf-8") as f:
mapping_file_lines = f.readlines()
current_platform = None
for line in mapping_file_lines:
if not line:
continue
line = line.strip()
if len(line) == 0:
continue
if line[0] == "#":
platform_or_header = line[1:].strip()
if platform_or_header not in PLATFORM_VARIABLES:
continue # Header
current_platform = platform_or_header
if current_platform not in platform_mappings:
platform_mappings[current_platform] = {}
elif current_platform:
line_parts = line.split(",")
guid = line_parts[0]
if guid in platform_mappings[current_platform]:
file.write(
"// WARNING: DATABASE {} OVERWROTE PRIOR MAPPING: {} {}\n".format(
src_path, current_platform, platform_mappings[current_platform][guid]
)
)
platform_mappings[current_platform][guid] = line
file.write("const char *DefaultControllerMappings::mappings[] = {\n")
for platform, mappings in platform_mappings.items():
variable = PLATFORM_VARIABLES[platform]
file.write(f"#ifdef {variable}_ENABLED\n")
for mapping in mappings.values():
file.write(f'\t"{mapping}",\n')
file.write(f"#endif // {variable}_ENABLED\n")
file.write("\tnullptr\n};\n")