comparison examples/eclrenderer.rs @ 664:f08e8e3c6196

Use bitflags for the rank, instead of an u16.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 11 Aug 2019 19:55:45 +0200
parents 107bb5ca5cc8
children 965ecdbf0316
comparison
equal deleted inserted replaced
663:994f41154be8 664:f08e8e3c6196
10 use luminance_derive::{Semantics, Vertex, UniformInterface}; 10 use luminance_derive::{Semantics, Vertex, UniformInterface};
11 use luminance_glfw::event::{Action, Key, WindowEvent}; 11 use luminance_glfw::event::{Action, Key, WindowEvent};
12 use luminance_glfw::surface::{GlfwSurface, Surface, WindowDim, WindowOpt}; 12 use luminance_glfw::surface::{GlfwSurface, Surface, WindowDim, WindowOpt};
13 use touhou::th06::anm0::Anm0; 13 use touhou::th06::anm0::Anm0;
14 use touhou::th06::anm0_vm::{Sprite, Vertex as FakeVertex}; 14 use touhou::th06::anm0_vm::{Sprite, Vertex as FakeVertex};
15 use touhou::th06::ecl::Ecl; 15 use touhou::th06::ecl::{Ecl, Rank};
16 use touhou::th06::ecl_vm::EclRunner; 16 use touhou::th06::ecl_vm::EclRunner;
17 use touhou::th06::enemy::{Enemy, Game, Position}; 17 use touhou::th06::enemy::{Enemy, Game, Position};
18 use touhou::util::math::{perspective, setup_camera}; 18 use touhou::util::math::{perspective, setup_camera};
19 use touhou::util::prng::Prng; 19 use touhou::util::prng::Prng;
20 use std::cell::RefCell; 20 use std::cell::RefCell;
122 122
123 // TODO: seed this PRNG with a valid seed. 123 // TODO: seed this PRNG with a valid seed.
124 let prng = Rc::new(RefCell::new(Prng::new(0))); 124 let prng = Rc::new(RefCell::new(Prng::new(0)));
125 125
126 // Create the Game god object. 126 // Create the Game god object.
127 let game = Game::new(prng); 127 let game = Game::new(prng, Rank::Normal);
128 let game = Rc::new(RefCell::new(game)); 128 let game = Rc::new(RefCell::new(game));
129 129
130 // And the enemy object. 130 // And the enemy object.
131 let enemy = Enemy::new(Position::new(0., 0.), 500, 0, 640, Rc::downgrade(&anm0), Rc::downgrade(&game)); 131 let enemy = Enemy::new(Position::new(0., 0.), 500, 0, 640, Rc::downgrade(&anm0), Rc::downgrade(&game));
132 let mut ecl_runner = EclRunner::new(&ecl, enemy.clone(), sub); 132 let mut ecl_runner = EclRunner::new(&ecl, enemy.clone(), sub);