1
0
Fork 0
mirror of https://github.com/italicsjenga/agb.git synced 2025-02-23 22:58:18 +11:00

PingPong is 2 words

This commit is contained in:
Gwilym Kuiper 2022-11-17 21:10:26 +00:00
parent 0d6e6c709c
commit aa29b52b6b

View file

@ -348,7 +348,7 @@ impl TagMap {
enum Direction { enum Direction {
Forward, Forward,
Backward, Backward,
Pingpong, PingPong,
} }
impl Direction { impl Direction {
@ -356,7 +356,7 @@ impl Direction {
match a { match a {
0 => Direction::Forward, 0 => Direction::Forward,
1 => Direction::Backward, 1 => Direction::Backward,
2 => Direction::Pingpong, 2 => Direction::PingPong,
_ => panic!("Invalid direction, this is a bug in image converter or agb"), _ => panic!("Invalid direction, this is a bug in image converter or agb"),
} }
} }
@ -400,7 +400,7 @@ impl Tag {
match self.direction { match self.direction {
Direction::Forward => self.sprite(idx % self.len), Direction::Forward => self.sprite(idx % self.len),
Direction::Backward => self.sprite(len_sub_1 - (idx % self.len)), Direction::Backward => self.sprite(len_sub_1 - (idx % self.len)),
Direction::Pingpong => self.sprite( Direction::PingPong => self.sprite(
(((idx + len_sub_1) % (len_sub_1 * 2)) as isize - len_sub_1 as isize) (((idx + len_sub_1) % (len_sub_1 * 2)) as isize - len_sub_1 as isize)
.unsigned_abs(), .unsigned_abs(),
), ),