Correct preview ground placement and expose original animation clips
This commit is contained in:
1 parent
670adb4795
commit
37fa18094f
22 files changed
+398
-33
No files matched your search
@@ -38,6 +38,7 @@ def enter_key():
|
||||
|
||||
def inside(args):
|
||||
work = Path('/work')
|
||||
if args.port_smoke: (work/'port-frame.ppm').unlink(missing_ok=True)
|
||||
with (work/'xvfb.log').open('w') as xlog, (work/'wine.log').open('w') as wlog:
|
||||
display = subprocess.Popen(['/native/usr/bin/Xvfb', ':89', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], stdout=xlog, stderr=xlog)
|
||||
wine = None
|
||||
@@ -52,8 +53,11 @@ def inside(args):
|
||||
application = ['/opt/wine-stable/bin/wine', r'Z:\port\GamePort.exe',
|
||||
'--assets', r'Z:\port\assets', '--scene', r'Z:\port\scenes\level1b\scene.json',
|
||||
'--level', 'gam/level1b.gam', '--original-camera', '--with-player',
|
||||
'--headless', '--frames', '2', '--time', '0.05', '--no-validation',
|
||||
'--frames', '6' if args.port_window else '2', '--time', '0.05', '--no-validation',
|
||||
'--screenshot', r'Z:\work\port-frame.ppm']
|
||||
application += ['--smoke-window'] if args.port_window else ['--headless']
|
||||
if args.asset_probe:
|
||||
application = ['/opt/wine-stable/bin/wine', r'Z:\probe.exe', args.probe_model]
|
||||
wine = subprocess.Popen(application, cwd='/work' if args.port_smoke else '/work/game', stdout=wlog, stderr=wlog, env=wine_env)
|
||||
captures = []
|
||||
for index in range(3):
|
||||
@@ -63,7 +67,7 @@ def inside(args):
|
||||
captures.append({'file': target, 'captureExit': image.returncode, 'wineExit': wine.poll()})
|
||||
if args.enter:
|
||||
captures[-1]['sentReturn'] = enter_key()
|
||||
if args.port_smoke and wine.poll() is not None: break
|
||||
if (args.port_smoke or args.asset_probe) and wine.poll() is not None: break
|
||||
tree = subprocess.run(['xwininfo', '-root', '-tree'], capture_output=True, text=True)
|
||||
(work/'windows.txt').write_text(tree.stdout + tree.stderr)
|
||||
processes = []
|
||||
@@ -71,7 +75,8 @@ def inside(args):
|
||||
try: processes.append(path.parent.name + ': ' + path.read_bytes().replace(b'\x00', b' ').decode('utf8', 'replace'))
|
||||
except OSError: pass
|
||||
(work/'processes.txt').write_text('\n'.join(processes)+'\n')
|
||||
(work/'capture.json').write_text(json.dumps({'game': 'GamePort.exe' if args.port_smoke else args.game, 'captures': captures}, indent=2)+'\n')
|
||||
application_name = 'GamePort.exe' if args.port_smoke else 'omt_shape_probe.exe' if args.asset_probe else args.game
|
||||
(work/'capture.json').write_text(json.dumps({'game': application_name, 'captures': captures}, indent=2)+'\n')
|
||||
finally:
|
||||
subprocess.run(['/opt/wine-stable/bin/wineserver', '-k'], timeout=10, check=False)
|
||||
if wine and wine.poll() is None: wine.terminate()
|
||||
@@ -88,13 +93,19 @@ def main():
|
||||
p.add_argument('--debug', action='store_true', help='Record Wine process and exception diagnostics')
|
||||
p.add_argument('--wine-renderer', choices=['gl','vulkan'], default='gl')
|
||||
p.add_argument('--port-smoke', action='store_true', help='Preliminary Windows port check under Wine64; not native Windows validation')
|
||||
p.add_argument('--port-window', action='store_true', help='Windows port SDL window/input/resize/animation smoke under Wine64')
|
||||
p.add_argument('--asset-probe', action='store_true', help='Run compiled read-only OMT shape probe inside isolated copy')
|
||||
p.add_argument('--probe-model', default=r'ASE\jimstop.ase')
|
||||
p.add_argument('--output', type=Path)
|
||||
args = p.parse_args()
|
||||
args.port_smoke = args.port_smoke or args.port_window
|
||||
if args.port_smoke and args.asset_probe: p.error('Select either port smoke or asset probe')
|
||||
if not 3 <= args.seconds <= 120: p.error('--seconds must be 3..120')
|
||||
if args.inside: return inside(args)
|
||||
project = Path(__file__).resolve().parents[2]
|
||||
source = project.parent/'Original'
|
||||
work = (args.output or project/('artifacts/windows-smoke' if args.port_smoke else 'artifacts/reference')).resolve()
|
||||
default_output = 'artifacts/windows-smoke' if args.port_smoke else 'artifacts/asset-probe' if args.asset_probe else 'artifacts/reference'
|
||||
work = (args.output or project/default_output).resolve()
|
||||
if work.is_relative_to(source.resolve()) or source.resolve().is_relative_to(work):
|
||||
p.error('Output must be separate from originals')
|
||||
work.mkdir(parents=True, exist_ok=True)
|
||||
@@ -113,6 +124,8 @@ def main():
|
||||
'--ro-bind', str(Path(__file__).resolve()), '/capture.py']
|
||||
if args.port_smoke:
|
||||
cmd += ['--ro-bind', str(project/'dist/win-x64'), '/port']
|
||||
if args.asset_probe:
|
||||
cmd += ['--ro-bind', str(project/'artifacts/binary/omt_shape_probe.exe'), '/probe.exe']
|
||||
for key,value in {'HOME':'/work/home', 'WINEPREFIX':'/work/prefix', 'WINEARCH':'win64' if args.port_smoke else 'win32',
|
||||
'DISPLAY':':89', 'PATH':'/opt/wine-stable/bin:/usr/bin:/bin', 'LANG':'C.UTF-8',
|
||||
'WINEDEBUG':'-all,err+all,warn+ddraw,warn+d3d,+seh' if args.debug else '-all',
|
||||
@@ -130,6 +143,8 @@ def main():
|
||||
cmd += ['/usr/bin/python3', '/capture.py', '--inside', '--game', args.game, '--seconds', str(args.seconds)]
|
||||
if args.enter: cmd += ['--enter']
|
||||
if args.port_smoke: cmd += ['--port-smoke']
|
||||
if args.port_window: cmd += ['--port-window']
|
||||
if args.asset_probe: cmd += ['--asset-probe', '--probe-model', args.probe_model]
|
||||
print('Running isolated Windows port' if args.port_smoke else 'Running copied original', 'with no network and no original-directory mount:', work, flush=True)
|
||||
subprocess.run(cmd, check=True, timeout=args.seconds + 40)
|
||||
print('Capture metadata:', work/'capture.json')
|
||||
@@ -138,6 +153,10 @@ def main():
|
||||
if result['captures'][-1]['wineExit'] != 0 or not (work/'port-frame.ppm').is_file():
|
||||
raise SystemExit('Windows port smoke did not pass; inspect wine.log (native Windows remains unverified)')
|
||||
print('Windows port rendered under Wine; native Windows validation is still required')
|
||||
if args.asset_probe:
|
||||
result = json.loads((work/'capture.json').read_text())
|
||||
if result['captures'][-1]['wineExit'] != 0 or 'VERTICES ' not in (work/'wine.log').read_text():
|
||||
raise SystemExit('OMT asset probe did not complete; inspect wine.log')
|
||||
|
||||
|
||||
if __name__ == '__main__': main()
|
||||
Reference in new issue
Block a user