unused vars cleanup
This commit is contained in:
parent
537e19c4e7
commit
96e69d5c5e
6 changed files with 9 additions and 11 deletions
|
|
@ -83,5 +83,3 @@ pub const TO_OVERMAP_GLYPH: char = '<';
|
||||||
pub const TO_OVERMAP_COLOUR: (u8, u8, u8) = (205, 127, 50);
|
pub const TO_OVERMAP_COLOUR: (u8, u8, u8) = (205, 127, 50);
|
||||||
pub const TO_TOWN_GLYPH: char = 'o';
|
pub const TO_TOWN_GLYPH: char = 'o';
|
||||||
pub const TO_TOWN_COLOUR: (u8, u8, u8) = (205, 127, 50);
|
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);
|
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ pub fn identify(gs: &mut State, ctx: &mut Rltk) -> (ItemMenuResult, Option<Entit
|
||||||
};
|
};
|
||||||
player_inventory
|
player_inventory
|
||||||
.entry(unique_item)
|
.entry(unique_item)
|
||||||
.and_modify(|(e, count)| {
|
.and_modify(|(_e, count)| {
|
||||||
*count += 1;
|
*count += 1;
|
||||||
})
|
})
|
||||||
.or_insert((entity, 1));
|
.or_insert((entity, 1));
|
||||||
|
|
|
||||||
|
|
@ -463,7 +463,7 @@ pub fn print_options(inventory: &PlayerInventory, mut x: i32, mut y: i32, ctx: &
|
||||||
|
|
||||||
pub fn get_max_inventory_width(inventory: &PlayerInventory) -> i32 {
|
pub fn get_max_inventory_width(inventory: &PlayerInventory) -> i32 {
|
||||||
let mut width: i32 = 0;
|
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;
|
let mut this_width = item.display_name.singular.len() as i32;
|
||||||
// Clean this up. It should use consts.
|
// Clean this up. It should use consts.
|
||||||
this_width += 4; // The spaces before and after the character to select this item, etc.
|
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
|
player_inventory
|
||||||
.entry(unique_item)
|
.entry(unique_item)
|
||||||
.and_modify(|(e, count)| {
|
.and_modify(|(_e, count)| {
|
||||||
*count += 1;
|
*count += 1;
|
||||||
})
|
})
|
||||||
.or_insert((entity, 1));
|
.or_insert((entity, 1));
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ pub fn remove_curse(gs: &mut State, ctx: &mut Rltk) -> (ItemMenuResult, Option<E
|
||||||
};
|
};
|
||||||
player_inventory
|
player_inventory
|
||||||
.entry(unique_item)
|
.entry(unique_item)
|
||||||
.and_modify(|(e, count)| {
|
.and_modify(|(_e, count)| {
|
||||||
*count += 1;
|
*count += 1;
|
||||||
})
|
})
|
||||||
.or_insert((entity, 1));
|
.or_insert((entity, 1));
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ use serde::{ Deserialize, Serialize };
|
||||||
use specs::prelude::*;
|
use specs::prelude::*;
|
||||||
use std::collections::{ HashMap, HashSet };
|
use std::collections::{ HashMap, HashSet };
|
||||||
use crate::data::events::*;
|
use crate::data::events::*;
|
||||||
use crate::data::ids::*;
|
|
||||||
|
|
||||||
#[derive(Default, Serialize, Deserialize, Clone)]
|
#[derive(Default, Serialize, Deserialize, Clone)]
|
||||||
pub struct MasterDungeonMap {
|
pub struct MasterDungeonMap {
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ fn get_forest_theme_renderables(idx:usize, map: &Map, debug: Option<bool>) -> (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::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::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; }
|
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) {
|
if bg_offsets == (-1, -1, -1) {
|
||||||
bg_offsets = offsets;
|
bg_offsets = offsets;
|
||||||
|
|
@ -319,10 +319,11 @@ fn darken_by_distance(pos: Point, other_pos: Point) -> f32 {
|
||||||
(distance - START_DARKEN_AT_N_TILES) /
|
(distance - START_DARKEN_AT_N_TILES) /
|
||||||
((crate::data::entity::DEFAULT_VIEWSHED_STANDARD as f32) - 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]
|
let interp_factor = interp_factor.max(0.0).min(1.0); // Clamp [0-1]
|
||||||
return (
|
let result =
|
||||||
1.0 -
|
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) {
|
fn brighten_by(mut fg: RGB, mut bg: RGB, amount: f32) -> (RGB, RGB) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue