Mercurial > touhou
comparison examples/eclrenderer.rs @ 661:598f3125cbac
Implement enough instructions to execute sub 0 from stage 1.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 10 Aug 2019 21:04:54 +0200 |
parents | 31fc0d881105 |
children | 107bb5ca5cc8 |
comparison
equal
deleted
inserted
replaced
660:31fc0d881105 | 661:598f3125cbac |
---|---|
163 | 163 |
164 _ => (), | 164 _ => (), |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 if frame == 60 { | 168 if ecl_runner.running == false { |
169 break; | 169 break; |
170 } | 170 } |
171 frame += 1; | 171 frame += 1; |
172 | 172 |
173 { | 173 { |
212 | 212 |
213 surface.swap_buffers(); | 213 surface.swap_buffers(); |
214 } | 214 } |
215 } | 215 } |
216 | 216 |
217 fn fill_vertices_ptr(sprites: Vec<Rc<RefCell<Sprite>>>, vertices: *mut Vertex) { | 217 fn fill_vertices_ptr(sprites: Vec<(f32, f32, f32, Rc<RefCell<Sprite>>)>, vertices: *mut Vertex) { |
218 let mut fake_vertices = unsafe { std::mem::transmute::<*mut Vertex, &mut [FakeVertex; 4]>(vertices) }; | 218 let mut fake_vertices = unsafe { std::mem::transmute::<*mut Vertex, &mut [FakeVertex; 4]>(vertices) }; |
219 for sprite in sprites { | 219 for (x, y, z, sprite) in sprites { |
220 let sprite = sprite.borrow(); | 220 let sprite = sprite.borrow(); |
221 sprite.fill_vertices(&mut fake_vertices); | 221 sprite.fill_vertices(&mut fake_vertices, x, y, z); |
222 } | 222 } |
223 } | 223 } |
224 | 224 |
225 fn load_from_disk(surface: &mut GlfwSurface, path: &Path) -> Option<Texture<Flat, Dim2, NormRGB8UI>> { | 225 fn load_from_disk(surface: &mut GlfwSurface, path: &Path) -> Option<Texture<Flat, Dim2, NormRGB8UI>> { |
226 // load the texture into memory as a whole bloc (i.e. no streaming) | 226 // load the texture into memory as a whole bloc (i.e. no streaming) |