mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Cargo fmt
This commit is contained in:
parent
5294603431
commit
f6e2c6885c
@ -1008,7 +1008,7 @@ impl Client {
|
|||||||
self.lod_distance = lod_distance;
|
self.lod_distance = lod_distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_flashing_lights_enabled(&mut self, flashing_lights_enabled: bool){
|
pub fn set_flashing_lights_enabled(&mut self, flashing_lights_enabled: bool) {
|
||||||
self.flashing_lights_enabled = flashing_lights_enabled;
|
self.flashing_lights_enabled = flashing_lights_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
use common::{
|
use common::{comp::Ori, outcome::HealthChangeInfo};
|
||||||
comp::Ori,
|
|
||||||
outcome::HealthChangeInfo
|
|
||||||
};
|
|
||||||
use specs::{Component, VecStorage};
|
use specs::{Component, VecStorage};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ use crate::audio::sfx::SfxEventItem;
|
|||||||
use common::{event::EventBus, slowjob::SlowJobPool};
|
use common::{event::EventBus, slowjob::SlowJobPool};
|
||||||
use specs::{World, WorldExt};
|
use specs::{World, WorldExt};
|
||||||
|
|
||||||
|
|
||||||
pub fn init(world: &mut World) {
|
pub fn init(world: &mut World) {
|
||||||
world.register::<comp::HpFloaterList>();
|
world.register::<comp::HpFloaterList>();
|
||||||
world.register::<comp::Interpolated>();
|
world.register::<comp::Interpolated>();
|
||||||
|
@ -135,7 +135,7 @@ pub struct SceneData<'a> {
|
|||||||
pub flashing_lights_enabled: bool,
|
pub flashing_lights_enabled: bool,
|
||||||
pub figure_lod_render_distance: f32,
|
pub figure_lod_render_distance: f32,
|
||||||
pub is_aiming: bool,
|
pub is_aiming: bool,
|
||||||
pub interpolated_time_of_day: f64
|
pub interpolated_time_of_day: f64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> SceneData<'a> {
|
impl<'a> SceneData<'a> {
|
||||||
@ -503,7 +503,7 @@ impl Scene {
|
|||||||
audio: &mut AudioFrontend,
|
audio: &mut AudioFrontend,
|
||||||
scene_data: &SceneData,
|
scene_data: &SceneData,
|
||||||
client: &Client,
|
client: &Client,
|
||||||
) {
|
) {
|
||||||
span!(_guard, "maintain", "Scene::maintain");
|
span!(_guard, "maintain", "Scene::maintain");
|
||||||
// Get player position.
|
// Get player position.
|
||||||
let ecs = scene_data.state.ecs();
|
let ecs = scene_data.state.ecs();
|
||||||
@ -718,16 +718,18 @@ impl Scene {
|
|||||||
|
|
||||||
// Update light projection matrices for the shadow map.
|
// Update light projection matrices for the shadow map.
|
||||||
|
|
||||||
// When the target time of day and time of day have a large discrepancy
|
// When the target time of day and time of day have a large discrepancy
|
||||||
// (i.e two days), the linear interpolation causes brght flashing effects
|
// (i.e two days), the linear interpolation causes brght flashing effects
|
||||||
// in the sky. This will snap the time of day to the target time of day
|
// in the sky. This will snap the time of day to the target time of day
|
||||||
// for the client to avoid the flashing effect if flashing lights is
|
// for the client to avoid the flashing effect if flashing lights is
|
||||||
// disabled.
|
// disabled.
|
||||||
const DAY: f64 = 60.0 * 60.0 * 24.0;
|
const DAY: f64 = 60.0 * 60.0 * 24.0;
|
||||||
let time_of_day = scene_data.state.get_time_of_day();
|
let time_of_day = scene_data.state.get_time_of_day();
|
||||||
self.interpolated_time_of_day = if (self.interpolated_time_of_day - time_of_day).abs() > DAY*2.0
|
self.interpolated_time_of_day = if (self.interpolated_time_of_day - time_of_day).abs()
|
||||||
&& !scene_data.flashing_lights_enabled{
|
> DAY * 2.0
|
||||||
time_of_day
|
&& !scene_data.flashing_lights_enabled
|
||||||
|
{
|
||||||
|
time_of_day
|
||||||
} else {
|
} else {
|
||||||
Lerp::lerp(self.interpolated_time_of_day, time_of_day, dt as f64)
|
Lerp::lerp(self.interpolated_time_of_day, time_of_day, dt as f64)
|
||||||
};
|
};
|
||||||
|
@ -1818,7 +1818,7 @@ impl PlayState for SessionState {
|
|||||||
weapon_trails_enabled: settings.graphics.weapon_trails_enabled,
|
weapon_trails_enabled: settings.graphics.weapon_trails_enabled,
|
||||||
flashing_lights_enabled: settings.graphics.render_mode.flashing_lights_enabled,
|
flashing_lights_enabled: settings.graphics.render_mode.flashing_lights_enabled,
|
||||||
is_aiming: self.is_aiming,
|
is_aiming: self.is_aiming,
|
||||||
interpolated_time_of_day: self.scene.interpolated_time_of_day
|
interpolated_time_of_day: self.scene.interpolated_time_of_day,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Render world
|
// Render world
|
||||||
|
Loading…
Reference in New Issue
Block a user