reverted some unnecessary changes

corrected typo

ran cargo fmt
This commit is contained in:
telastrus 2019-08-05 12:47:07 -04:00 committed by Forest
parent c098a5efd7
commit 4dcb53bdb8
5 changed files with 16 additions and 17 deletions

View File

@ -980,7 +980,7 @@ impl<'a> Widget for SettingsWindow<'a> {
.font_id(self.fonts.opensans)
.color(TEXT_COLOR)
.set(state.ids.max_fps_value, ui);
// FOV
Text::new("Field of View (deg)")
.down_from(state.ids.max_fps_slider, 10.0)
@ -1006,15 +1006,12 @@ impl<'a> Widget for SettingsWindow<'a> {
events.push(Event::AdjustFOV(new_val));
}
Text::new(&format!(
"{}",
self.global_state.settings.graphics.fov
))
.right_from(state.ids.fov_slider, 8.0)
.font_size(14)
.font_id(self.fonts.opensans)
.color(TEXT_COLOR)
.set(state.ids.fov_value, ui);
Text::new(&format!("{}", self.global_state.settings.graphics.fov))
.right_from(state.ids.fov_slider, 8.0)
.font_size(14)
.font_id(self.fonts.opensans)
.color(TEXT_COLOR)
.set(state.ids.fov_value, ui);
}
// 5) Sound Tab -----------------------------------

View File

@ -38,7 +38,7 @@ impl Camera {
ori: Vec3::zero(),
tgt_dist: 10.0,
dist: 10.0,
fov: 1.3,
fov: 1.1,
aspect,
mode,
@ -180,7 +180,7 @@ impl Camera {
/// Set the FOV in degrees
pub fn set_fov_deg(&mut self, fov: u16) {
//Magic value comes from p/180; no use recalculating.
//Magic value comes from pi/180; no use recalculating.
self.set_fov((fov as f32) * 0.01745329)
}

View File

@ -80,8 +80,8 @@ impl Scene {
}
/// Get a reference to the scene's camera.
pub fn camera(&mut self) -> &mut Camera {
&mut self.camera
pub fn camera(&self) -> &Camera {
&self.camera
}
/// Get a mutable reference to the scene's camera.

View File

@ -28,7 +28,9 @@ impl SessionState {
pub fn new(global_state: &mut GlobalState, client: Rc<RefCell<Client>>) -> Self {
// Create a scene for this session. The scene handles visible elements of the game world.
let mut scene = Scene::new(global_state.window.renderer_mut());
scene.camera_mut().set_fov_deg(global_state.settings.graphics.fov);
scene
.camera_mut()
.set_fov_deg(global_state.settings.graphics.fov);
Self {
scene,
client,

View File

@ -135,7 +135,7 @@ impl Default for Log {
pub struct GraphicsSettings {
pub view_distance: u32,
pub max_fps: u32,
pub fov: u16
pub fov: u16,
}
impl Default for GraphicsSettings {
@ -143,7 +143,7 @@ impl Default for GraphicsSettings {
Self {
view_distance: 5,
max_fps: 60,
fov: 75
fov: 75,
}
}
}