text almost works

This commit is contained in:
2021-08-15 23:29:25 +02:00
parent 40aa7f635e
commit fb045f210a
10 changed files with 30 additions and 25 deletions

View File

@@ -60,14 +60,15 @@ pub fn save_level(path: &str, game: &mut TestGame, renderer: &mut VulkanRenderer
}
}).collect();
let objects = game.game_objects.iter().map(|game_object_handle| {
let objects = game.game_objects.iter().filter_map(|game_object_handle| {
let game_object = game_object_handle.get_game_object(renderer).unwrap();
ObjectJson {
if game_object.pipeline_index != 0 { return None; }
Some(ObjectJson {
mesh_index: Some(game_object_handle.object_index),
position: game_object.position.into(),
rotation: game_object.rotation.into(),
scale: game_object.scale.into()
}
})
}).collect();
let player = ObjectJson {