Skip to content

Commit

Permalink
Take alpha into account when blitting patches
Browse files Browse the repository at this point in the history
  • Loading branch information
Rua committed Apr 3, 2021
1 parent 1a4bfeb commit c246614
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/doom/map/textures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ pub fn import_wall(
let src_index = (src_x + src_y_index) as usize;
let dest_index = (dest_x + dest_y_index) as usize;

data[dest_index] = patch.data[src_index];
let src_pixel = patch.data[src_index];

if src_pixel.a != 0 {
data[dest_index] = src_pixel;
}
}
}

Expand Down

0 comments on commit c246614

Please sign in to comment.