|
@@ -1,6 +1,6 @@
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
-use std::fmt::Display;
|
|
|
+use std::fmt::{Debug, Display};
|
|
|
|
|
|
use binrw::{binrw, BinRead, BinWrite};
|
|
|
|
|
@@ -14,7 +14,7 @@ pub type U16 = FieldOf<u16>;
|
|
|
pub type F64 = FieldOf<f64>;
|
|
|
|
|
|
#[binrw]
|
|
|
-#[derive(Debug, PartialEq)]
|
|
|
+#[derive(PartialEq)]
|
|
|
pub struct WString {
|
|
|
// Temporary variable that holds number of elements
|
|
|
#[br(temp)]
|
|
@@ -38,6 +38,12 @@ impl From<String> for WString {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+impl Debug for WString {
|
|
|
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
|
+ write!(f, "\"{}\"", String::from(self))
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
impl Display for WString {
|
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
|
write!(f, "{}", String::from(self))
|
|
@@ -52,28 +58,12 @@ pub struct Rgba {
|
|
|
pub alpha: u8,
|
|
|
}
|
|
|
|
|
|
-impl Display for Rgba {
|
|
|
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
|
- write!(
|
|
|
- f,
|
|
|
- "({}, {}, {}, {})",
|
|
|
- self.red, self.green, self.blue, self.alpha
|
|
|
- )
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
#[derive(BinRead, BinWrite, PartialEq, Debug)]
|
|
|
pub struct Point {
|
|
|
pub x: f64,
|
|
|
pub y: f64,
|
|
|
}
|
|
|
|
|
|
-impl Display for Point {
|
|
|
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
|
- write!(f, "({:.2}, {:.2})", self.x, self.y)
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
#[derive(BinRead, BinWrite, PartialEq, Debug, strum::Display)]
|
|
|
#[brw(repr(u32))]
|
|
|
#[repr(u32)]
|