ft: deserialization
This commit is contained in:
@@ -72,14 +72,15 @@ fn random_sphere_on_floor<T: Hittable>(
|
||||
sphere
|
||||
}
|
||||
|
||||
// FIXME: bunch of unwraps/expects in deserialization code
|
||||
// TODO: implement scene serialization
|
||||
fn main() {
|
||||
dotenv().ok();
|
||||
pretty_env_logger::init();
|
||||
|
||||
// TODO: use cli arg for scenefile
|
||||
let json_str = fs::read_to_string("./scenes/scene.json").expect("waddehell!");
|
||||
let json_file = "./scenes/scenes.json";
|
||||
// let json_file = "./scenes/failsMatBounds.json";
|
||||
let json_str = fs::read_to_string(json_file).expect("Reading specified scene file failed!");
|
||||
let mut scene: Scene = serde_json::from_str(&json_str).unwrap();
|
||||
scene.render();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user