render: add a frame parameter to all shaders

This commit is contained in:
2024-11-23 14:50:28 +01:00
parent 73c3ced3d7
commit 9dff0119a4
3 changed files with 10 additions and 7 deletions

View File

@@ -21,8 +21,8 @@ struct IdleShader {
}
impl Shader for IdleShader {
fn draw(&self, coords: &VirtualCoordinates) -> RGB8 {
Hsv::new_srgb(self.frame.wrapping_add(coords.x).wrapping_add(coords.y), 255, 255).into_rgb8()
fn draw(&self, coords: &VirtualCoordinates, frame: u8) -> RGB8 {
Hsv::new_srgb(frame.wrapping_add(coords.x).wrapping_add(coords.y), 255, 255).into_rgb8()
}
}
@@ -84,7 +84,7 @@ struct TestShader {
}
impl Shader for TestShader {
fn draw(&self, coords: &VirtualCoordinates) -> RGB8 {
fn draw(&self, coords: &VirtualCoordinates, _frame: usize) -> RGB8 {
match self.pattern {
Pattern::Red => RGB8::new(255, 0, 0),
Pattern::Green => RGB8::new(0, 255, 0),