Skip to content

Commit

Permalink
Merge pull request #1 from qoh/master
Browse files Browse the repository at this point in the history
Use brs 0.2.0
  • Loading branch information
mraware authored May 8, 2020
2 parents ae3e6b9 + 08f4d9b commit 56918ba
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 65 deletions.
111 changes: 58 additions & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ crate-type = ["cdylib", "rlib"]
default = ["console_error_panic_hook", "chrono/wasmbind"]

[dependencies]
brs = "0.1"
brs = "0.2.0"
image = { version = "0.23.0", default-features = false, features = ["gif", "jpeg", "ico", "png", "pnm", "tga", "tiff", "webp", "bmp", "hdr", "dxt", "dds"] }
wasm-bindgen-futures = "0.4.12"
js-sys = "0.3.39"
Expand All @@ -33,4 +33,4 @@ features = [
"File",
"FileReader",
"FilePropertyBag"
]
]
13 changes: 3 additions & 10 deletions src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn pixel_to_brick(x: u32, y: u32, size: (u32, u32, u32), vertical: bool, px: Rgb
visibility: true,
material_index: 0,
color: color_mode,
owner_index: 0
owner_index: None,
};

return brick;
Expand All @@ -122,13 +122,6 @@ fn write_brs<T: Write>(mut writer: &mut T, bricks: Vec<Brick>, asset_name_index:
name: String::from("PUBLIC")
};

let brick_owners = vec![
User {
id: Uuid::parse_str("ffffffff-ffff-ffff-ffff-ffffffffffff").unwrap(),
name: String::from("PUBLIC")
}
];

let brick_name = lists::get_brick_assets()[asset_name_index as usize].clone();
let material_name = lists::get_materials()[material_index as usize].clone();

Expand All @@ -141,9 +134,9 @@ fn write_brs<T: Write>(mut writer: &mut T, bricks: Vec<Brick>, asset_name_index:
brick_assets: vec![brick_name],
colors: vec![],
materials: vec![material_name],
brick_owners,
brick_owners: vec![],
bricks
};

brs::write_save(&mut writer, &write_data).unwrap();
}
}

0 comments on commit 56918ba

Please sign in to comment.