Skip to content

Commit

Permalink
Force palette alpha to be 1
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Jan 21, 2024
1 parent 49ac44e commit 7130e23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions bin/boilerplate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ impl Harness {
.unwrap();

let surface_caps = surface.get_capabilities(&adapter);
log::info!("Supported surface formats: {:?}", surface_caps.formats);
let present_mode = if surface_caps
.present_modes
.contains(&wgpu::PresentMode::Mailbox)
Expand Down
4 changes: 2 additions & 2 deletions src/level/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ fn print_palette(data: &[[u8; 4]], info: &str) {

pub fn read_palette(input: File, config: Option<&[TerrainConfig]>) -> [[u8; 4]; 0x100] {
let mut file = BufReader::new(input);
let mut data = [[0; 4]; 0x100];
let mut data = [[0xFF; 4]; 0x100];
for p in data.iter_mut() {
file.read_exact(&mut p[..3]).unwrap();
//p[0] <<= 2; p[1] <<= 2; p[2] <<= 2;
Expand All @@ -214,7 +214,7 @@ pub fn read_palette(input: File, config: Option<&[TerrainConfig]>) -> [[u8; 4];

for i in 0..16 {
let mut value = [(i * 4) as u8; 4];
value[3] = 0;
value[3] = 0xFF;
data[224 + i] = value;
}

Expand Down

0 comments on commit 7130e23

Please sign in to comment.