ft: deserialization

This commit is contained in:
djaidjai committed 2026-04-26 23:49:03 +02:00
1 parent 430bdf63bc
commit 076bcc7155
5 files changed
+55 -27

No files matched your search

+3 -2
View File
@@ -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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.