diff --git a/src/data/visuals.rs b/src/data/visuals.rs index 2970f63..b1c2217 100644 --- a/src/data/visuals.rs +++ b/src/data/visuals.rs @@ -83,5 +83,3 @@ pub const TO_OVERMAP_GLYPH: char = '<'; pub const TO_OVERMAP_COLOUR: (u8, u8, u8) = (205, 127, 50); pub const TO_TOWN_GLYPH: char = 'o'; pub const TO_TOWN_COLOUR: (u8, u8, u8) = (205, 127, 50); -pub const TO_INFINITE_GLYPH: char = '*'; -pub const TO_INFINITE_COLOUR: (u8, u8, u8) = (205, 127, 50); diff --git a/src/gui/identify_menu.rs b/src/gui/identify_menu.rs index 730dd64..3d0dbec 100644 --- a/src/gui/identify_menu.rs +++ b/src/gui/identify_menu.rs @@ -112,7 +112,7 @@ pub fn identify(gs: &mut State, ctx: &mut Rltk) -> (ItemMenuResult, Option i32 { let mut width: i32 = 0; - for (item, (e, count)) in inventory { + for (item, (_e, count)) in inventory { let mut this_width = item.display_name.singular.len() as i32; // Clean this up. It should use consts. this_width += 4; // The spaces before and after the character to select this item, etc. @@ -749,7 +749,7 @@ pub fn get_player_inventory(ecs: &World) -> PlayerInventory { }; player_inventory .entry(unique_item) - .and_modify(|(e, count)| { + .and_modify(|(_e, count)| { *count += 1; }) .or_insert((entity, 1)); diff --git a/src/gui/remove_curse_menu.rs b/src/gui/remove_curse_menu.rs index e552c62..fd97dd2 100644 --- a/src/gui/remove_curse_menu.rs +++ b/src/gui/remove_curse_menu.rs @@ -95,7 +95,7 @@ pub fn remove_curse(gs: &mut State, ctx: &mut Rltk) -> (ItemMenuResult, Option) -> (r TileType::Wall => { glyph = rltk::to_cp437(FOREST_WALL_GLYPH); fg = RGB::named(FOREST_WALL_COLOUR); bg = RGB::named(GRASS_COLOUR); offsets = GRASS_OFFSETS; } TileType::Road => { glyph = rltk::to_cp437(ROAD_GLYPH); bg = RGB::named(ROAD_COLOUR); } TileType::ShallowWater => { glyph = rltk::to_cp437(SHALLOW_WATER_GLYPH); bg = RGB::named(SHALLOW_WATER_COLOUR); offsets = SHALLOW_WATER_OFFSETS; } - _ => { (glyph, fg, _, (offsets, bg_offsets)) = get_default_theme_renderables(idx, map, debug); bg = RGB::named(GRASS_COLOUR); bg_offsets = GRASS_OFFSETS; } + _ => { (glyph, fg, _, (offsets, _)) = get_default_theme_renderables(idx, map, debug); bg = RGB::named(GRASS_COLOUR); bg_offsets = GRASS_OFFSETS; } } if bg_offsets == (-1, -1, -1) { bg_offsets = offsets; @@ -319,10 +319,11 @@ fn darken_by_distance(pos: Point, other_pos: Point) -> f32 { (distance - START_DARKEN_AT_N_TILES) / ((crate::data::entity::DEFAULT_VIEWSHED_STANDARD as f32) - START_DARKEN_AT_N_TILES); let interp_factor = interp_factor.max(0.0).min(1.0); // Clamp [0-1] - return ( + let result = 1.0 - - interp_factor * (1.0 - (if CONFIG.visuals.with_scanlines { MAX_DARKENING_IF_SCANLINES } else { MAX_DARKENING })) - ); + interp_factor * + (1.0 - (if CONFIG.visuals.with_scanlines { MAX_DARKENING_IF_SCANLINES } else { MAX_DARKENING })); + return result; } fn brighten_by(mut fg: RGB, mut bg: RGB, amount: f32) -> (RGB, RGB) {