mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
reverted some unnecessary changes
corrected typo ran cargo fmt
This commit is contained in:
parent
c098a5efd7
commit
4dcb53bdb8
@ -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 -----------------------------------
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user