some fiddling with documentation. Added Poly type

This commit is contained in:
2020-02-21 19:29:24 -08:00
parent 99ed07e070
commit 9ddc88400e
12 changed files with 166 additions and 861 deletions

View File

@@ -200,7 +200,7 @@ impl CanvasState {
let mut compute_path = project_root.clone();
compute_path.push(PathBuf::from("resources/images/"));
compute_path.push(PathBuf::from(image_filename));
compute_path.push(PathBuf::from(image_filename.clone()));
let img = image::open(compute_path).expect("Couldn't find image");
@@ -212,7 +212,7 @@ impl CanvasState {
let mut image_buffer = Vec::new();
if pixel_count != data_length as usize {
println!("Creating apha channel...");
println!("Creating alpha channel for {}", image_filename.clone());
for i in img.raw_pixels().iter() {
if (image_buffer.len() + 1) % 4 == 0 {
image_buffer.push(255);
@@ -236,7 +236,6 @@ impl CanvasState {
/// Load a texture using it's filename from a file. Returns the handle of the loaded texture
pub fn load_texture(&mut self, filename: String) -> Option<Arc<CanvasTextureHandle>> {
let texture_buffer = self.get_texture_from_file(filename.clone());
let handle = Arc::new(CanvasTextureHandle {
handle: self.texture_buffers.len() as u32