carry: the runtime and render3d work Maroon Lake builds against
Input.text, App.monitor_count / window_to_monitor / window_fixed, gl_sleep_us, and the grass and collide changes, uncommitted on main and depended on by the game; carried here so the language work starts from what the game actually uses. main's working tree is untouched.
This commit is contained in:
parent
86492064aa
commit
e6f565a6c4
17 changed files with 622 additions and 34 deletions
|
|
@ -258,6 +258,27 @@ function emit_ns_call(ns: pointer, meth: pointer, e: Node) -> Val {
|
|||
if g_windowed { emit(` call void @lp_app_icon(ptr {ip})\n`) }
|
||||
return val("0", "void")
|
||||
}
|
||||
if (meth == "monitor_count") {
|
||||
# how many displays the desktop spans (1 where the platform does not say)
|
||||
use_pak()
|
||||
if g_windowed { return val(emit_bind("call i32 @win_monitor_count()"), "int") }
|
||||
return val("1", "int")
|
||||
}
|
||||
if (meth == "window_to_monitor") {
|
||||
# put the window on that display, centred
|
||||
use_pak()
|
||||
let mp = arg_code(e, 0)
|
||||
if g_windowed { emit(` call void @app_window_to_monitor(i32 {mp})\n`) }
|
||||
return val("0", "void")
|
||||
}
|
||||
if (meth == "window_fixed") {
|
||||
# take the resize grip and the maximise button off this window (or put them back): the
|
||||
# launcher is a fixed panel, not the game, and a window you cannot maximise says so.
|
||||
use_pak()
|
||||
let fp = arg_code(e, 0)
|
||||
if g_windowed { emit(` call void @app_window_fixed(i32 {fp})\n`) }
|
||||
return val("0", "void")
|
||||
}
|
||||
if (meth == "window_hide") or (meth == "window_show") {
|
||||
# Hide / show the game's own window (not the splash) without tearing down its
|
||||
# GL / Vulkan surface - a launcher steps aside while the game it started runs.
|
||||
|
|
@ -458,6 +479,7 @@ function emit_ns_call(ns: pointer, meth: pointer, e: Node) -> Val {
|
|||
if (meth == "key_pressed") { bare = "input_key_pressed"; push(labels, "key") }
|
||||
if (meth == "key_released") { bare = "input_key_released"; push(labels, "key") }
|
||||
if (meth == "key_label") { bare = "input_key_label"; push(labels, "key") }
|
||||
if (meth == "text") { bare = "input_text" } # what was TYPED, UTF-8
|
||||
if (meth == "press") { bare = "input_press"; push(labels, "key") }
|
||||
if (meth == "release") { bare = "input_release"; push(labels, "key") }
|
||||
if (meth == "axis") { bare = "input_axis"; push(labels, "neg"); push(labels, "pos") }
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ function emit_header() -> void {
|
|||
emith("declare void @win_close()\n")
|
||||
emith("declare void @win_held(ptr)\n")
|
||||
emith("declare i32 @win_key_char(i32)\n")
|
||||
emith("declare i32 @win_text(ptr, i32)\n")
|
||||
emith("declare void @win_mouse(ptr)\n")
|
||||
emith("declare void @win_pad(ptr)\n")
|
||||
emith("declare void @win_touch(ptr)\n")
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ function is_intrinsic2(name: pointer) -> bool {
|
|||
if (name == "win_open") or (name == "win_poll") or (name == "win_present") { return true }
|
||||
if (name == "win_running") or (name == "win_close") { return true }
|
||||
if (name == "win_held") or (name == "win_mouse") { return true } # #50 device layer
|
||||
if (name == "win_text") { return true } # typed characters
|
||||
if (name == "win_key_char") { return true } # Input.key_label
|
||||
if (name == "win_pad") or (name == "win_touch") { return true } # #51 gamepad / touch
|
||||
if (name == "win_cursor_mode") { return true } # #89 cursor capture
|
||||
|
|
@ -75,6 +76,10 @@ function emit_intrinsic2(name: pointer, e: Node) -> Val {
|
|||
# what the active keyboard layout types on a held-set key position (windowed only,
|
||||
# DCE'd headless): a code point, 0 for none.
|
||||
if (name == "win_key_char") { let a = arg_code(e, 0); return val(emit_bind(`call i32 @win_key_char(i32 {a})`), "int") }
|
||||
# what the player TYPED since the last call - UTF-16 code units into the caller's buffer, one per
|
||||
# word, returning how many. The layout, the modifiers and any dead key are already applied, which
|
||||
# is why a name field must read this rather than build text out of key codes.
|
||||
if (name == "win_text") { let a = arg_code(e, 0); let b = arg_code(e, 1); return val(emit_bind(`call i32 @win_text(ptr {a}, i32 {b})`), "int") }
|
||||
# #51 — win_pad: 6 words/pad [connected, mask, lx, ly, rx, ry]; win_touch: 3
|
||||
# words/point [active, x, y]. Both windowed-only, DCE'd headless.
|
||||
if (name == "win_pad") { let a = arg_code(e, 0); emit(" call void @win_pad(ptr "); emit(a); emit(")\n"); return val("0", "void") }
|
||||
|
|
|
|||
|
|
@ -120,6 +120,9 @@ function emit_pak_prelude() -> void {
|
|||
emith("declare void @splash_show(ptr, i32, i32)\n")
|
||||
emith("declare void @splash_hide()\n")
|
||||
emith("declare void @app_set_icon(ptr, i32)\n")
|
||||
emith("declare void @app_window_fixed(i32)\n")
|
||||
emith("declare i32 @win_monitor_count()\n")
|
||||
emith("declare void @app_window_to_monitor(i32)\n")
|
||||
emith("declare void @app_window_hide()\n")
|
||||
emith("declare void @app_window_show()\n")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue