Mercurial > touhou
comparison src/th06/anm0_vm.rs @ 648:3331eb7389b3
Fix AnmRunner instance in test (requires Prng).
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 08 Aug 2019 13:38:31 +0200 |
parents | 7d92730bf543 |
children | 988e5130fb00 |
comparison
equal
deleted
inserted
replaced
647:1520b559cacc | 648:3331eb7389b3 |
---|---|
428 file.read_to_end(&mut buf).unwrap(); | 428 file.read_to_end(&mut buf).unwrap(); |
429 let anm0 = Anm0::from_slice(&buf).unwrap(); | 429 let anm0 = Anm0::from_slice(&buf).unwrap(); |
430 assert_eq!(anm0.size, (256, 256)); | 430 assert_eq!(anm0.size, (256, 256)); |
431 assert_eq!(anm0.format, 5); | 431 assert_eq!(anm0.format, 5); |
432 let sprite = Rc::new(RefCell::new(Sprite::new(0., 0.))); | 432 let sprite = Rc::new(RefCell::new(Sprite::new(0., 0.))); |
433 let mut anm_runner = AnmRunner::new(&anm0, 1, sprite.clone(), 0); | 433 let prng = Rc::new(RefCell::new(Prng::new(0))); |
434 let mut anm_runner = AnmRunner::new(&anm0, 1, sprite.clone(), Rc::downgrade(&prng), 0); | |
434 for _ in 0..50 { | 435 for _ in 0..50 { |
435 anm_runner.run_frame(); | 436 anm_runner.run_frame(); |
436 } | 437 } |
437 } | 438 } |
438 } | 439 } |