add some extra derive's to various structs
This commit is contained in:
parent
5b2a3c9cb6
commit
d06ae1837b
|
@ -11,7 +11,7 @@ pub enum AudioBufferError {
|
|||
}
|
||||
|
||||
/// Holds audio sample data that can be played via [`AudioDevice`].
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct AudioBuffer {
|
||||
spec: AudioSpec,
|
||||
pub data: Vec<u8>,
|
||||
|
|
|
@ -40,7 +40,7 @@ pub enum BitmapError {
|
|||
/// one row to the next is always exactly equal to the bitmap width. Rendering operations provided
|
||||
/// here are done with respect to the bitmaps clipping region, where rendering outside of the
|
||||
/// clipping region is simply not performed / stops at the clipping boundary.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct Bitmap {
|
||||
width: u32,
|
||||
height: u32,
|
||||
|
|
|
@ -11,7 +11,7 @@ pub enum BitmapAtlasError {
|
|||
OutOfBounds,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct BitmapAtlas {
|
||||
bitmap: Bitmap,
|
||||
bounds: Rect,
|
||||
|
|
|
@ -43,7 +43,7 @@ pub trait Font {
|
|||
fn measure(&self, text: &str, opts: FontRenderOpts) -> (u32, u32);
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct BitmaskCharacter {
|
||||
bytes: [u8; CHAR_HEIGHT],
|
||||
bounds: Rect,
|
||||
|
@ -83,7 +83,7 @@ impl Character for BitmaskCharacter {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct BitmaskFont {
|
||||
characters: Box<[BitmaskCharacter]>,
|
||||
line_height: u8,
|
||||
|
|
|
@ -189,7 +189,7 @@ pub enum PaletteFormat {
|
|||
|
||||
/// Contains a 256 color palette, and provides methods useful for working with palettes. The
|
||||
/// colors are all stored individually as 32-bit packed values in the format 0xAARRGGBB.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct Palette {
|
||||
colors: [u32; NUM_COLORS],
|
||||
}
|
||||
|
@ -495,13 +495,6 @@ impl IndexMut<u8> for Palette {
|
|||
}
|
||||
}
|
||||
|
||||
impl PartialEq for Palette {
|
||||
#[inline]
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.colors == other.colors
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use tempfile::TempDir;
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::ops::{Mul, MulAssign};
|
|||
use crate::math::*;
|
||||
|
||||
/// Represents a 3x3 column-major matrix and provides common methods for matrix math.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
pub struct Matrix3x3 {
|
||||
pub m: [f32; 9],
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue