mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Remove warnings
This commit is contained in:
parent
cff79eadc9
commit
ce33a6e1f8
@ -11,19 +11,20 @@ struct Voxel {
|
||||
mvp: Mat4<f32>,
|
||||
}
|
||||
|
||||
// TODO: use norm or remove it
|
||||
#[derive(Copy, Clone)]
|
||||
struct Vert {
|
||||
pos: Vec3<f32>,
|
||||
col: Rgb<f32>,
|
||||
norm: Vec3<f32>,
|
||||
//norm: Vec3<f32>,
|
||||
ao_level: u8,
|
||||
}
|
||||
impl Vert {
|
||||
fn new(pos: Vec3<f32>, col: Rgb<f32>, norm: Vec3<f32>, ao_level: u8) -> Self {
|
||||
fn new(pos: Vec3<f32>, col: Rgb<f32>, _norm: Vec3<f32>, ao_level: u8) -> Self {
|
||||
Vert {
|
||||
pos,
|
||||
col,
|
||||
norm,
|
||||
//norm,
|
||||
ao_level,
|
||||
}
|
||||
}
|
||||
@ -40,7 +41,7 @@ impl<'a> Pipeline for Voxel {
|
||||
Vert {
|
||||
pos,
|
||||
col,
|
||||
norm: _,
|
||||
//norm: _,
|
||||
ao_level,
|
||||
}: &Self::Vertex,
|
||||
) -> ([f32; 3], Self::VsOut) {
|
||||
|
@ -356,7 +356,7 @@ impl Ui {
|
||||
PrimitiveKind::Image {
|
||||
image_id,
|
||||
color,
|
||||
source_rect,
|
||||
source_rect: _, // TODO: <-- use this
|
||||
} => {
|
||||
let graphic_id = self
|
||||
.image_map
|
||||
|
@ -48,10 +48,6 @@ impl Scale {
|
||||
pub fn scale_factor_physical(&self) -> f64 {
|
||||
self.scale_factor_logical() * self.dpi_factor
|
||||
}
|
||||
// Get the dpi factor (ratio between physical and logical coordinates)
|
||||
pub fn dpi_factor(&self) -> f64 {
|
||||
self.dpi_factor
|
||||
}
|
||||
// Updates internal window size (and/or dpi_factor).
|
||||
pub fn window_resized(&mut self, new_dims: Vec2<f64>, renderer: &Renderer) {
|
||||
self.dpi_factor = renderer.get_resolution().x as f64 / new_dims.x;
|
||||
|
@ -1,8 +1,5 @@
|
||||
use conrod_core::{
|
||||
builder_methods,
|
||||
position::Dimension,
|
||||
widget::{self, Id},
|
||||
Position, Ui, UiCell, Widget, WidgetCommon,
|
||||
builder_methods, position::Dimension, widget, Position, Ui, UiCell, Widget, WidgetCommon,
|
||||
};
|
||||
use vek::*;
|
||||
|
||||
@ -18,12 +15,11 @@ pub trait Ingameable: Widget + Sized {
|
||||
fn prim_count(&self) -> usize;
|
||||
// Note this is not responsible for the 3d positioning
|
||||
// Only call this directly if using IngameAnchor
|
||||
fn set_ingame(self, id: widget::Id, parent_id: Id, ui: &mut UiCell) -> Self::Event {
|
||||
fn set_ingame(self, id: widget::Id, ui: &mut UiCell) -> Self::Event {
|
||||
self
|
||||
// should pass focus to the window if these are clicked
|
||||
// (they are not displayed where conrod thinks they are)
|
||||
.graphics_for(ui.window)
|
||||
//.parent(parent_id) // TODO: Is this needed?
|
||||
.set(id, ui)
|
||||
}
|
||||
fn position_ingame(self, pos: Vec3<f32>) -> Ingame<Self> {
|
||||
@ -104,7 +100,7 @@ impl<W: Ingameable> Widget for Ingame<W> {
|
||||
}
|
||||
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
let widget::UpdateArgs { id, state, ui, .. } = args;
|
||||
let widget::UpdateArgs { state, ui, .. } = args;
|
||||
let Ingame {
|
||||
widget, parameters, ..
|
||||
} = self;
|
||||
@ -116,19 +112,19 @@ impl<W: Ingameable> Widget for Ingame<W> {
|
||||
});
|
||||
}
|
||||
|
||||
widget.set_ingame(state.id.unwrap(), id, ui)
|
||||
widget.set_ingame(state.id.unwrap(), ui)
|
||||
}
|
||||
|
||||
fn default_x_position(&self, ui: &Ui) -> Position {
|
||||
fn default_x_position(&self, _: &Ui) -> Position {
|
||||
Position::Absolute(0.0)
|
||||
}
|
||||
fn default_y_position(&self, ui: &Ui) -> Position {
|
||||
fn default_y_position(&self, _: &Ui) -> Position {
|
||||
Position::Absolute(0.0)
|
||||
}
|
||||
fn default_x_dimension(&self, ui: &Ui) -> Dimension {
|
||||
fn default_x_dimension(&self, _: &Ui) -> Dimension {
|
||||
Dimension::Absolute(1.0)
|
||||
}
|
||||
fn default_y_dimension(&self, ui: &Ui) -> Dimension {
|
||||
fn default_y_dimension(&self, _: &Ui) -> Dimension {
|
||||
Dimension::Absolute(1.0)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user