mirror of
https://github.com/lucannez64/darling-lol.git
synced 2026-10-26 19:47:42 +00:00
CGDisplayScreenSize returned 0x0 for any display with EDID (upstream left that branch unimplemented). League divides by it for its camera aspect ratio, so the view-projection x row became NaN: every 3D vertex was discarded, the scene showed only its blue clear colour, and world clicks were ignored. Read the size from the EDID detailed timing (mm) or basic parameters (cm), fall back to 96 dpi, and use the main display for an unknown id. CGDisplayCopyAllDisplayModes returned NULL for display 0 (a window off every screen), which League passes straight to CFArrayGetCount. Fall back to the main display, then to an empty array. Add riot-display-modes-check covering both for the main display, display 0 and an unknown id. Co-Authored-By: Claude Opus 5.5 <[email protected]>
22 lines
1.1 KiB
Python
22 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""Build the CGDisplayCopyAllDisplayModes NULL-result probe against Darling's SDK."""
|
|
from pathlib import Path
|
|
import shlex
|
|
import subprocess
|
|
|
|
root = Path(__file__).resolve().parent.parent
|
|
folder = root / 'build/darling-src/build/src/external/cocotron/CoreGraphics'
|
|
flags = {}
|
|
for line in (folder / 'CMakeFiles/CoreGraphics.dir/flags.make').read_text().splitlines():
|
|
if line.startswith('C_') and ' = ' in line:
|
|
key, value = line.split(' = ', 1)
|
|
flags[key] = shlex.split(value)
|
|
obj = root / 'build/riot-display-modes-check.o'
|
|
subprocess.run(['clang', *flags['C_DEFINES'], *flags['C_INCLUDES'], *flags['C_FLAGS'],
|
|
'-Wno-macro-redefined', '-c', str(root / 'tools/riot-display-modes-check.c'),
|
|
'-o', str(obj)], check=True)
|
|
subprocess.run(['clang', '-target', 'x86_64-apple-macosx11.0', '-fuse-ld=lld', '-nostdlib',
|
|
'-isysroot', '@DARLING_SDK@', str(obj), '-lSystem',
|
|
'-framework', 'CoreGraphics', '-framework', 'CoreFoundation',
|
|
'-o', str(root / 'build/riot-display-modes-check')], check=True)
|