aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-fx
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-01 07:41:00 +0300
committerValentin Popov <valentin@popov.link>2026-11-01 07:41:00 +0300
commit6c603976d4e368708935ab80e152b495a5c5e47a (patch)
treeb17df5ae85d8ec9c4899cf47dc71883d286eac79 /crates/fparkan-fx
parent651f5e10a7e5fbaa65a9acffd76d033925291e8e (diff)
downloadfparkan-6c603976d4e368708935ab80e152b495a5c5e47a.tar.xz
fparkan-6c603976d4e368708935ab80e152b495a5c5e47a.zip
chore(render): report unexpanded ambient effects
Diffstat (limited to 'crates/fparkan-fx')
-rw-r--r--crates/fparkan-fx/src/lib.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/fparkan-fx/src/lib.rs b/crates/fparkan-fx/src/lib.rs
index af7408a..8a567de 100644
--- a/crates/fparkan-fx/src/lib.rs
+++ b/crates/fparkan-fx/src/lib.rs
@@ -67,6 +67,12 @@ pub struct FxHeader {
pub scale: [f32; 3],
}
+/// Effect.dll RVA 0x5C60 reads an owner/provider for modes 4 through 17, including mode 14.
+#[must_use]
+pub const fn fx_time_mode_requires_owner_state(mode: u32) -> bool {
+ matches!(mode, 4..=17)
+}
+
/// FX opcode.
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub enum FxOpcode {
@@ -624,6 +630,16 @@ mod tests {
use std::path::{Path, PathBuf};
#[test]
+ fn phase_sources_distinguish_elapsed_damage_and_progress_modes() {
+ for mode in [0, 1, 2, 3, 18, u32::MAX] {
+ assert!(!fx_time_mode_requires_owner_state(mode));
+ }
+ for mode in [4, 5, 9, 13, 14, 15, 16, 17] {
+ assert!(fx_time_mode_requires_owner_state(mode));
+ }
+ }
+
+ #[test]
fn decodes_synthetic_opcodes_and_refs() {
let mut bytes = header(2);
bytes.extend_from_slice(&command_with_ref_at(