Add warning

This commit is contained in:
2025-12-25 16:23:34 +08:00
parent 110e15e7b2
commit 20ec866f2a
2 changed files with 9 additions and 1 deletions

View File

@@ -241,7 +241,7 @@ impl PsbValueFixed {
PsbNumber::Integer(n) => Some(*n),
PsbNumber::Double(n) if n.fract() == 0.0 => Some(*n as i64),
PsbNumber::Float(n) if n.fract() == 0.0 => Some(*n as i64),
_ => None
_ => None,
},
_ => None,
}

View File

@@ -303,6 +303,14 @@ impl Script for Psb {
let width = pb_data["width"].as_i64();
let height = pb_data["height"].as_i64();
let compress = pb_data["compress"].as_str();
if compress.is_some_and(|s| s == "RL") && (width.is_none() || height.is_none())
{
eprintln!(
"Warning: Resource {:?} is marked as RL compressed but width/height is missing (width={:?}, height={:?})",
path, pb_data["width"], pb_data["height"]
);
crate::COUNTER.inc_warning();
}
if let (Some(w), Some(h), Some(c)) = (width, height, compress) {
if c == "RL" {
let res_name: Vec<_> = path