This checkout had no git history at all, so this one commit carries the whole
of the Everwood work as a single import on top of chairmanpow/benilla-octo's
`main` (706cd71). The two trees have genuinely diverged — each has files the
other does not — so this is a fork point, not a catch-up.
Today's work, which is the reason a baseline exists at all:
- Booth previews no longer cast world shadows (`NO_BOOTH_SHADOW`). Portrait
characters were entering the sun's shadow cascades, so every skinned-rig
shadow specialization compiled live mid-frame; the hitch detector logged
"main thread blocked 1316 ms" beside a `compiled LIVE` warning. This was
the Fashion/Tmog stutter.
- Per-pane dress-up: each `DressUpModel` pane assembles and stages its own
tried-on look instead of every pane mirroring the live player.
- Item template cache is append-only JSONL written on the IO pool, replacing
an 11.6 MB whole-map JSON rewrite on the main thread every 10 s.
- `WOW_SYSTEM_TIMING` rebuilt per-thread: it took 2 mutexes per system enter
and 4 per exit, costing 15 ms a frame (590 fps -> 60) and corrupting the
measurements it was taken to produce.
- The visibility-churn sweep moved to its own `WOW_FLASH_CHURN` switch, so a
frame-cost reading no longer pays 2.7 ms a frame for it.
Local state (`benilla-config/`, `logs/`, `target/`) is excluded by the
existing .gitignore; the account credential it holds is not in this commit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
116 lines
3.0 KiB
Rust
116 lines
3.0 KiB
Rust
//! Low level bindings to Lua 5.5/5.4/5.3/5.2/5.1 (including LuaJIT) and Luau.
|
|
|
|
#![allow(non_camel_case_types, non_snake_case)]
|
|
#![allow(clippy::missing_safety_doc)]
|
|
#![allow(unsafe_op_in_unsafe_fn)]
|
|
#![doc(test(attr(deny(warnings))))]
|
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
|
|
|
use std::os::raw::c_int;
|
|
|
|
#[cfg(any(feature = "lua55", doc))]
|
|
pub use lua55::*;
|
|
|
|
#[cfg(any(feature = "lua54", doc))]
|
|
pub use lua54::*;
|
|
|
|
#[cfg(any(feature = "lua53", doc))]
|
|
pub use lua53::*;
|
|
|
|
#[cfg(any(feature = "lua52", doc))]
|
|
pub use lua52::*;
|
|
|
|
#[cfg(any(feature = "lua51", feature = "luajit", doc))]
|
|
pub use lua51::*;
|
|
|
|
#[cfg(any(feature = "luau", doc))]
|
|
pub use luau::*;
|
|
|
|
#[cfg(any(feature = "lua55", feature = "lua54", feature = "lua53", feature = "lua52"))]
|
|
#[doc(hidden)]
|
|
pub const LUA_MAX_UPVALUES: c_int = 255;
|
|
|
|
#[cfg(any(feature = "lua51", feature = "luajit"))]
|
|
#[doc(hidden)]
|
|
pub const LUA_MAX_UPVALUES: c_int = 60;
|
|
|
|
#[cfg(feature = "luau")]
|
|
#[doc(hidden)]
|
|
pub const LUA_MAX_UPVALUES: c_int = 200;
|
|
|
|
// I believe `luaL_traceback` < 5.4 requires this much free stack to not error.
|
|
// 5.4 uses `luaL_Buffer`
|
|
#[doc(hidden)]
|
|
pub const LUA_TRACEBACK_STACK: c_int = 11;
|
|
|
|
// The minimum alignment guaranteed by the architecture.
|
|
// Copied from https://github.com/rust-lang/rust/blob/main/library/std/src/sys/alloc/mod.rs
|
|
#[doc(hidden)]
|
|
#[rustfmt::skip]
|
|
pub const SYS_MIN_ALIGN: usize = if cfg!(any(
|
|
all(target_arch = "riscv32", any(target_os = "espidf", target_os = "zkvm")),
|
|
all(target_arch = "xtensa", target_os = "espidf"),
|
|
)) {
|
|
// The allocator on the esp-idf and zkvm platforms guarantees 4 byte alignment.
|
|
4
|
|
} else if cfg!(any(
|
|
target_arch = "x86",
|
|
target_arch = "arm",
|
|
target_arch = "m68k",
|
|
target_arch = "csky",
|
|
target_arch = "loongarch32",
|
|
target_arch = "mips",
|
|
target_arch = "mips32r6",
|
|
target_arch = "powerpc",
|
|
target_arch = "powerpc64",
|
|
target_arch = "sparc",
|
|
target_arch = "wasm32",
|
|
target_arch = "hexagon",
|
|
target_arch = "riscv32",
|
|
target_arch = "xtensa",
|
|
)) {
|
|
8
|
|
} else if cfg!(any(
|
|
target_arch = "x86_64",
|
|
target_arch = "aarch64",
|
|
target_arch = "arm64ec",
|
|
target_arch = "loongarch64",
|
|
target_arch = "mips64",
|
|
target_arch = "mips64r6",
|
|
target_arch = "s390x",
|
|
target_arch = "sparc64",
|
|
target_arch = "riscv64",
|
|
target_arch = "wasm64",
|
|
)) {
|
|
16
|
|
} else {
|
|
panic!("no value for SYS_MIN_ALIGN")
|
|
};
|
|
|
|
#[macro_use]
|
|
mod macros;
|
|
|
|
#[cfg(any(feature = "lua55", doc))]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "lua55")))]
|
|
pub mod lua55;
|
|
|
|
#[cfg(any(feature = "lua54", doc))]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "lua54")))]
|
|
pub mod lua54;
|
|
|
|
#[cfg(any(feature = "lua53", doc))]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "lua53")))]
|
|
pub mod lua53;
|
|
|
|
#[cfg(any(feature = "lua52", doc))]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "lua52")))]
|
|
pub mod lua52;
|
|
|
|
#[cfg(any(feature = "lua51", feature = "luajit", doc))]
|
|
#[cfg_attr(docsrs, doc(cfg(any(feature = "lua51", feature = "luajit"))))]
|
|
pub mod lua51;
|
|
|
|
#[cfg(any(feature = "luau", doc))]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "luau")))]
|
|
pub mod luau;
|