diff options
| author | Valentin Popov <valentin@popov.link> | 2026-10-18 07:55:47 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-10-18 07:55:47 +0300 |
| commit | 737e429cb109446ec008c4dcf91d4f04faccd64a (patch) | |
| tree | d8f4455b0462ec2dc8073f7eba64cc82d03d6f2d /crates/fparkan-fx/src/lib.rs | |
| parent | 2e02325bf0762a9ac89f0b66773e3bbd7ceb7fe7 (diff) | |
| download | fparkan-737e429cb109446ec008c4dcf91d4f04faccd64a.tar.xz fparkan-737e429cb109446ec008c4dcf91d4f04faccd64a.zip | |
feat(fx): evaluate native Op7 particle poolscodex/op7-evaluator
Diffstat (limited to 'crates/fparkan-fx/src/lib.rs')
| -rw-r--r-- | crates/fparkan-fx/src/lib.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/fparkan-fx/src/lib.rs b/crates/fparkan-fx/src/lib.rs index 1772d1c..04e54ad 100644 --- a/crates/fparkan-fx/src/lib.rs +++ b/crates/fparkan-fx/src/lib.rs @@ -10,9 +10,23 @@ pub mod ambient_op3; pub mod atmosphere; pub mod environment; pub mod fx_visual; +pub mod op7; pub mod shadow; pub mod sky; +/// Advances the native FX 16-bit-pair random state and returns its new high half. +/// +/// Native helpers store `low' = low * 2 ^ high` and `high' = high >> 1 ^ low'`. +#[must_use] +pub fn advance_native_fx_random_state(state: &mut u32) -> u16 { + let low = *state as u16; + let high = (*state >> 16) as u16; + let next_low = low.wrapping_shl(1) ^ high; + let next_high = (high >> 1) ^ next_low; + *state = u32::from(next_low) | (u32::from(next_high) << 16); + next_high +} + use fparkan_binary::{Cursor, DecodeError}; use std::sync::Arc; |
