Skip to content

Commit

Permalink
Merge pull request #481 from rparrett/fix-color-srgbness
Browse files Browse the repository at this point in the history
Fix tile color srgbness
  • Loading branch information
StarArawn authored Dec 17, 2023
2 parents 04b5bfa + 555585a commit fb2e2b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/render/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub struct PackedTileData {
pub visible: bool,
pub position: Vec4,
pub texture: Vec4,
pub color: Vec4,
pub color: [f32; 4],
}

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -374,8 +374,7 @@ impl RenderChunk2d {
.into_iter(),
);

let color: [f32; 4] = tile.color.into();
colors.extend([color, color, color, color].into_iter());
colors.extend(std::iter::repeat(tile.color).take(4));

// flipping and rotation packed in bits
// bit 0 : flip_x
Expand Down
2 changes: 1 addition & 1 deletion src/render/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ pub fn extract(
visible: visible.0,
position,
texture,
color: color.0.into(),
color: color.0.as_linear_rgba_f32(),
};

let data = tilemap_query.get(tilemap_id.0).unwrap();
Expand Down

0 comments on commit fb2e2b2

Please sign in to comment.