mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
cleanup
This commit is contained in:
parent
bfaa18e010
commit
5813f626d1
9
Cargo.lock
generated
9
Cargo.lock
generated
@ -3062,9 +3062,8 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "specs-idvs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://gitlab.com/veloren/specs-idvs.git?branch=imbris/specs-15#f049bf725f2a690d01ea8a83da49c7ebf8d8ea2a"
|
||||
source = "git+https://gitlab.com/veloren/specs-idvs.git#111548cf44e9bb4c43feb12aa3fc253953ac6e4a"
|
||||
dependencies = [
|
||||
"hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -3460,7 +3459,7 @@ dependencies = [
|
||||
"serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git?branch=imbris/specs-15)",
|
||||
"specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)",
|
||||
"sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@ -3484,7 +3483,7 @@ dependencies = [
|
||||
"serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git?branch=imbris/specs-15)",
|
||||
"specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)",
|
||||
"uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"veloren-common 0.4.0",
|
||||
@ -4166,7 +4165,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum smithay-client-toolkit 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "93960e8975909fcb14cc755de93af2149d8b8f4eb368315537d40cfd0f324054"
|
||||
"checksum smithay-clipboard 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9667a262ef7a9ff1c55a7e665cd3d36f9bc2809f94167b1fb3fc31423a83f8c0"
|
||||
"checksum specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4943fde8c5d3d14c3d19d2a4c7abbd7b626c270a19e6cd35252294a48feb698c"
|
||||
"checksum specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git?branch=imbris/specs-15)" = "<none>"
|
||||
"checksum specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)" = "<none>"
|
||||
"checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
|
||||
"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
|
||||
"checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5"
|
||||
|
@ -5,7 +5,7 @@ authors = ["Joshua Barretto <joshua.s.barretto@gmail.com>", "Maciej Ćwięka <mc
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git", branch = "imbris/specs-15" }
|
||||
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
|
||||
|
||||
specs = { version = "0.15.1", features = ["serde", "nightly", "storage-event-control"] }
|
||||
vek = { version = "0.9.9", features = ["serde"] }
|
||||
|
@ -12,7 +12,6 @@ pub enum MustHaveMoreThanOneVariant {}
|
||||
sum_type! {
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub enum EcsResPacket {
|
||||
//Time(state::Time),
|
||||
MustHaveMoreThanOneVariant(MustHaveMoreThanOneVariant),
|
||||
TimeOfDay(state::TimeOfDay),
|
||||
}
|
||||
@ -20,7 +19,6 @@ sum_type! {
|
||||
impl sync::ResPacket for EcsResPacket {
|
||||
fn apply(self, world: &specs::World) {
|
||||
match self {
|
||||
//EcsResPacket::Time(time) => sync::handle_res_update(time, world),
|
||||
EcsResPacket::MustHaveMoreThanOneVariant(_) => unimplemented!(),
|
||||
EcsResPacket::TimeOfDay(time_of_day) => sync::handle_res_update(time_of_day, world),
|
||||
}
|
||||
@ -41,7 +39,6 @@ sum_type! {
|
||||
MountState(comp::MountState),
|
||||
Mounting(comp::Mounting),
|
||||
Mass(comp::Mass),
|
||||
//Projectile(comp::Projectile),
|
||||
Gravity(comp::Gravity),
|
||||
Sticky(comp::Sticky),
|
||||
}
|
||||
@ -61,7 +58,6 @@ sum_type! {
|
||||
MountState(PhantomData<comp::MountState>),
|
||||
Mounting(PhantomData<comp::Mounting>),
|
||||
Mass(PhantomData<comp::Mass>),
|
||||
//Projectile(PhantomData<comp::Projectile>),
|
||||
Gravity(PhantomData<comp::Gravity>),
|
||||
Sticky(PhantomData<comp::Sticky>),
|
||||
}
|
||||
@ -80,7 +76,6 @@ impl sync::CompPacket for EcsCompPacket {
|
||||
EcsCompPacket::MountState(comp) => sync::handle_insert(comp, entity, world),
|
||||
EcsCompPacket::Mounting(comp) => sync::handle_insert(comp, entity, world),
|
||||
EcsCompPacket::Mass(comp) => sync::handle_insert(comp, entity, world),
|
||||
//EcsCompPacket::Projectile(comp) => sync::handle_insert(comp, entity, world),
|
||||
EcsCompPacket::Gravity(comp) => sync::handle_insert(comp, entity, world),
|
||||
EcsCompPacket::Sticky(comp) => sync::handle_insert(comp, entity, world),
|
||||
}
|
||||
@ -97,7 +92,6 @@ impl sync::CompPacket for EcsCompPacket {
|
||||
EcsCompPacket::MountState(comp) => sync::handle_modify(comp, entity, world),
|
||||
EcsCompPacket::Mounting(comp) => sync::handle_modify(comp, entity, world),
|
||||
EcsCompPacket::Mass(comp) => sync::handle_modify(comp, entity, world),
|
||||
//EcsCompPacket::Projectile(comp) => sync::handle_modify(comp, entity, world),
|
||||
EcsCompPacket::Gravity(comp) => sync::handle_modify(comp, entity, world),
|
||||
EcsCompPacket::Sticky(comp) => sync::handle_modify(comp, entity, world),
|
||||
}
|
||||
@ -116,7 +110,6 @@ impl sync::CompPacket for EcsCompPacket {
|
||||
EcsCompPhantom::MountState(_) => sync::handle_remove::<comp::MountState>(entity, world),
|
||||
EcsCompPhantom::Mounting(_) => sync::handle_remove::<comp::Mounting>(entity, world),
|
||||
EcsCompPhantom::Mass(_) => sync::handle_remove::<comp::Mass>(entity, world),
|
||||
//EcsCompPhantom::Projectile(_) => sync::handle_remove::<comp::Projectile>(entity, world),
|
||||
EcsCompPhantom::Gravity(_) => sync::handle_remove::<comp::Gravity>(entity, world),
|
||||
EcsCompPhantom::Sticky(_) => sync::handle_remove::<comp::Sticky>(entity, world),
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ edition = "2018"
|
||||
common = { package = "veloren-common", path = "../common" }
|
||||
world = { package = "veloren-world", path = "../world" }
|
||||
|
||||
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git", branch = "imbris/specs-15"}
|
||||
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
|
||||
|
||||
log = "0.4.8"
|
||||
specs = { version = "0.15.1", features = ["shred-derive"] }
|
||||
|
@ -21,7 +21,6 @@ const SENTINEL_SYS: &str = "sentinel_sys";
|
||||
const SUBSCRIPTION_SYS: &str = "server_subscription_sys";
|
||||
const TERRAIN_SYNC_SYS: &str = "server_terrain_sync_sys";
|
||||
const TERRAIN_SYS: &str = "server_terrain_sys";
|
||||
//const MESSAGE_SYS: &str = "server_message_sys";
|
||||
|
||||
pub fn add_server_systems(dispatch_builder: &mut DispatcherBuilder) {
|
||||
// TODO: makes some of these dependent on systems in common like the phys system
|
||||
|
@ -53,7 +53,6 @@ pub struct TrackedComps<'a> {
|
||||
pub mass: ReadStorage<'a, Mass>,
|
||||
pub sticky: ReadStorage<'a, Sticky>,
|
||||
pub gravity: ReadStorage<'a, Gravity>,
|
||||
//pub projectile: ReadStorage<'a, Projectile>,
|
||||
}
|
||||
impl<'a> TrackedComps<'a> {
|
||||
pub fn create_entity_package(&self, entity: EcsEntity) -> EntityPackage<EcsCompPacket> {
|
||||
@ -112,10 +111,6 @@ impl<'a> TrackedComps<'a> {
|
||||
.get(entity)
|
||||
.copied()
|
||||
.map(|c| packets.push(c.into()));
|
||||
//self.projectile
|
||||
// .get(entity)
|
||||
// .cloned()
|
||||
// .map(|c| packets.push(c.into()));
|
||||
|
||||
EntityPackage(uid, packets)
|
||||
}
|
||||
@ -135,7 +130,6 @@ pub struct ReadTrackers<'a> {
|
||||
pub mass: ReadExpect<'a, UpdateTracker<Mass>>,
|
||||
pub sticky: ReadExpect<'a, UpdateTracker<Sticky>>,
|
||||
pub gravity: ReadExpect<'a, UpdateTracker<Gravity>>,
|
||||
//pub projectile: ReadExpect<'a, UpdateTracker<Projectile>>,
|
||||
}
|
||||
impl<'a> ReadTrackers<'a> {
|
||||
pub fn create_sync_package(
|
||||
@ -162,12 +156,6 @@ impl<'a> ReadTrackers<'a> {
|
||||
.with_component(&comps.uid, &*self.mass, &comps.mass, filter)
|
||||
.with_component(&comps.uid, &*self.sticky, &comps.sticky, filter)
|
||||
.with_component(&comps.uid, &*self.gravity, &comps.gravity, filter)
|
||||
//.with_component(
|
||||
// &comps.uid,
|
||||
// self.projectile.deref(),
|
||||
// &comps.projectile,
|
||||
// filter,
|
||||
//)
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,7 +174,6 @@ pub struct WriteTrackers<'a> {
|
||||
mass: WriteExpect<'a, UpdateTracker<Mass>>,
|
||||
sticky: WriteExpect<'a, UpdateTracker<Sticky>>,
|
||||
gravity: WriteExpect<'a, UpdateTracker<Gravity>>,
|
||||
//projectile: WriteExpect<'a, UpdateTracker<Projectile>>,
|
||||
}
|
||||
|
||||
fn record_changes(comps: &TrackedComps, trackers: &mut WriteTrackers) {
|
||||
@ -204,7 +191,6 @@ fn record_changes(comps: &TrackedComps, trackers: &mut WriteTrackers) {
|
||||
trackers.mass.record_changes(&comps.mass);
|
||||
trackers.sticky.record_changes(&comps.sticky);
|
||||
trackers.gravity.record_changes(&comps.gravity);
|
||||
//trackers.projectile.record_changes(&comps.projectile);
|
||||
}
|
||||
|
||||
pub fn register_trackers(world: &mut World) {
|
||||
@ -221,7 +207,6 @@ pub fn register_trackers(world: &mut World) {
|
||||
world.register_tracker::<Mass>();
|
||||
world.register_tracker::<Sticky>();
|
||||
world.register_tracker::<Gravity>();
|
||||
//world.register_tracker::<Projectile>();
|
||||
}
|
||||
|
||||
#[derive(SystemData)]
|
||||
|
@ -342,7 +342,7 @@ impl Ui {
|
||||
// moving origin to top-left corner (from middle).
|
||||
let min_x = self.ui.win_w / 2.0 + l;
|
||||
let min_y = self.ui.win_h / 2.0 - b - h;
|
||||
Aabr {
|
||||
let intersection = Aabr {
|
||||
min: Vec2 {
|
||||
x: (min_x * scale_factor) as u16,
|
||||
y: (min_y * scale_factor) as u16,
|
||||
@ -352,7 +352,13 @@ impl Ui {
|
||||
y: ((min_y + h) * scale_factor) as u16,
|
||||
},
|
||||
}
|
||||
.intersection(window_scissor)
|
||||
.intersection(window_scissor);
|
||||
|
||||
if intersection.is_valid() {
|
||||
intersection
|
||||
} else {
|
||||
Aabr::new_empty(Vec2::zero())
|
||||
}
|
||||
};
|
||||
if new_scissor != current_scissor {
|
||||
// Finish the current command.
|
||||
@ -750,7 +756,10 @@ impl Ui {
|
||||
}
|
||||
|
||||
fn default_scissor(renderer: &Renderer) -> Aabr<u16> {
|
||||
let (screen_w, screen_h) = renderer.get_resolution().map(|e| e as u16).into_tuple();
|
||||
let (screen_w, screen_h) = renderer
|
||||
.get_resolution()
|
||||
.map(|e| (e as u16).max(1))
|
||||
.into_tuple();
|
||||
Aabr {
|
||||
min: Vec2 { x: 0, y: 0 },
|
||||
max: Vec2 {
|
||||
|
@ -324,7 +324,7 @@ impl WorldSim {
|
||||
let logistic_cdf = |x: f64| (x / logistic_2_base).tanh() * 0.5 + 0.5;
|
||||
|
||||
let erosion_pow = 2.0;
|
||||
let n_steps = 7;
|
||||
let n_steps = 100;
|
||||
let erosion_factor = |x: f64| logistic_cdf(erosion_pow * logit(x));
|
||||
let alt = do_erosion(
|
||||
0.0,
|
||||
|
Loading…
Reference in New Issue
Block a user