Jolt Patch

This commit is contained in:
2026-07-09 17:25:48 -07:00
parent cb19c9b5b4
commit 9d83c318b6
18 changed files with 2542 additions and 157 deletions

View File

@ -1185,6 +1185,8 @@ def build_success():
if state.target == 'windows-hl':
vs_version_major = wrd.lnx_project_win_list_vs
build_mode = wrd.lnx_project_win_build_mode # Debug or Release
if state.is_play:
build_mode = 'Debug' if wrd.lnx_debug_console else 'Release'
build_arch = wrd.lnx_project_win_build_arch # x64 or x86 (maps to Win32 for MSBuild)
platform = 'x64' if build_arch == 'x64' else 'Win32' # MSBuild uses Win32 for x86

View File

@ -217,6 +217,11 @@ def init_properties():
('Oimo', 'Oimo', 'Oimo'),
('Jolt', 'Jolt', 'Jolt')],
name="Physics Engine", default='Bullet', update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_jolt_multithread = EnumProperty(
items=[('Auto', 'Auto', 'Use multithreading for krom/node targets, single-thread for html5'),
('Enabled', 'Enabled', 'Always use multithreaded Jolt build'),
('Disabled', 'Disabled', 'Always use single-threaded Jolt build')],
name="Jolt Multithreading", default='Auto', update=assets.invalidate_compiler_cache)
bpy.types.World.lnx_physics_fixed_step = FloatProperty(
name="Fixed Step", default=1/60, min=0, max=1,
description="Physics steps for fixed update"

View File

@ -1291,6 +1291,8 @@ class LNX_PT_ProjectModulesPanel(bpy.types.Panel):
layout.prop(wrd, 'lnx_physics')
if wrd.lnx_physics != 'Disabled':
layout.prop(wrd, 'lnx_physics_engine')
if wrd.lnx_physics_engine == 'Jolt':
layout.prop(wrd, 'lnx_jolt_multithread')
layout.prop(wrd, 'lnx_navigation')
if wrd.lnx_navigation != 'Disabled':
layout.prop(wrd, 'lnx_navigation_engine')

View File

@ -290,12 +290,28 @@ let project = new Project('""" + lnx.utils.safesrc(wrd.lnx_project_name + '-' +
if not os.path.exists('Libraries/haxejolt'):
khafile.write(add_leenkx_library(sdk_path + '/lib/', 'haxejolt', rel_path=do_relpath_sdk))
if state.target.startswith('krom') or state.target == 'html5' or state.target == 'node':
joltjs_path = sdk_path + '/lib/haxejolt/jolt/jolt.wasm.js'
joltjs_path = joltjs_path.replace('\\', '/').replace('//', '/')
khafile.write(add_assets(joltjs_path, rel_path=do_relpath_sdk))
joltjs_wasm_path = sdk_path + '/lib/haxejolt/jolt/jolt.wasm.wasm'
joltjs_wasm_path = joltjs_wasm_path.replace('\\', '/').replace('//', '/')
khafile.write(add_assets(joltjs_wasm_path, rel_path=do_relpath_sdk))
jolt_mt = wrd.lnx_jolt_multithread
multithread = False
if jolt_mt == 'Enabled':
multithread = True
elif jolt_mt == 'Auto':
if state.target.startswith('krom') or state.target == 'node':
multithread = True
if multithread:
assets.add_khafile_def('lnx_jolt_mt')
joltjs_path = sdk_path + '/lib/haxejolt/jolt/jolt.mt.wasm.js'
joltjs_path = joltjs_path.replace('\\', '/').replace('//', '/')
khafile.write(add_assets(joltjs_path, rel_path=do_relpath_sdk))
joltjs_wasm_path = sdk_path + '/lib/haxejolt/jolt/jolt.mt.wasm.wasm'
joltjs_wasm_path = joltjs_wasm_path.replace('\\', '/').replace('//', '/')
khafile.write(add_assets(joltjs_wasm_path, rel_path=do_relpath_sdk))
else:
joltjs_path = sdk_path + '/lib/haxejolt/jolt/jolt.wasm.js'
joltjs_path = joltjs_path.replace('\\', '/').replace('//', '/')
khafile.write(add_assets(joltjs_path, rel_path=do_relpath_sdk))
joltjs_wasm_path = sdk_path + '/lib/haxejolt/jolt/jolt.wasm.wasm'
joltjs_wasm_path = joltjs_wasm_path.replace('\\', '/').replace('//', '/')
khafile.write(add_assets(joltjs_wasm_path, rel_path=do_relpath_sdk))
if export_navigation:
assets.add_khafile_def('lnx_navigation')