mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add a feature to optionnally disable hot-reloading
This commit is contained in:
parent
c86118ee2c
commit
110b9742b7
@ -6,6 +6,7 @@ edition = "2018"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
no-assets = []
|
no-assets = []
|
||||||
|
hot-reloading = ["common-assets/hot-reloading"]
|
||||||
simd = ["vek/platform_intrinsics"]
|
simd = ["vek/platform_intrinsics"]
|
||||||
bin_csv = ["ron", "csv", "structopt"]
|
bin_csv = ["ron", "csv", "structopt"]
|
||||||
bin_graphviz = ["petgraph"]
|
bin_graphviz = ["petgraph"]
|
||||||
|
@ -7,7 +7,7 @@ version = "0.10.0"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
assets_manager = {version = "0.5.0", features = ["bincode", "ron", "json", "hot-reloading"]}
|
assets_manager = {version = "0.5.0", features = ["bincode", "ron", "json"]}
|
||||||
ron = { version = "0.6", default-features = false }
|
ron = { version = "0.6", default-features = false }
|
||||||
dot_vox = "4.0"
|
dot_vox = "4.0"
|
||||||
image = { version = "0.23.12", default-features = false, features = ["png"] }
|
image = { version = "0.23.12", default-features = false, features = ["png"] }
|
||||||
@ -21,4 +21,5 @@ serial_test = {version = "0.5", optional = true}
|
|||||||
walkdir = "2.3.2"
|
walkdir = "2.3.2"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
asset_tweak = ["serial_test", "serde"]
|
hot-reloading = ["assets_manager/hot-reloading"]
|
||||||
|
asset_tweak = ["serial_test", "serde", "hot-reloading"]
|
||||||
|
@ -21,6 +21,7 @@ lazy_static! {
|
|||||||
AssetCache::new(&*ASSETS_PATH).unwrap();
|
AssetCache::new(&*ASSETS_PATH).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "hot-reloading")]
|
||||||
pub fn start_hot_reloading() { ASSETS.enhance_hot_reloading(); }
|
pub fn start_hot_reloading() { ASSETS.enhance_hot_reloading(); }
|
||||||
|
|
||||||
pub type AssetHandle<T> = assets_manager::Handle<'static, T>;
|
pub type AssetHandle<T> = assets_manager::Handle<'static, T>;
|
||||||
|
@ -24,6 +24,7 @@ buildInputs = ["xorg.libxcb"]
|
|||||||
[features]
|
[features]
|
||||||
hot-anim = ["anim/use-dyn-lib"]
|
hot-anim = ["anim/use-dyn-lib"]
|
||||||
hot-egui = ["voxygen-egui/use-dyn-lib", "egui"]
|
hot-egui = ["voxygen-egui/use-dyn-lib", "egui"]
|
||||||
|
hot-reloading = ["common/hot-reloading"]
|
||||||
singleplayer = ["server"]
|
singleplayer = ["server"]
|
||||||
simd = ["vek/platform_intrinsics"]
|
simd = ["vek/platform_intrinsics"]
|
||||||
tracy = ["profiling", "profiling/profile-with-tracy", "common-frontend/tracy", "client/tracy"]
|
tracy = ["profiling", "profiling/profile-with-tracy", "common-frontend/tracy", "client/tracy"]
|
||||||
@ -32,7 +33,7 @@ egui-ui = ["voxygen-egui", "egui", "egui_wgpu_backend", "egui_winit_platform"]
|
|||||||
|
|
||||||
# We don't ship egui with published release builds so a separate feature is required that excludes it.
|
# We don't ship egui with published release builds so a separate feature is required that excludes it.
|
||||||
default-publish = ["singleplayer", "native-dialog", "plugins", "simd"]
|
default-publish = ["singleplayer", "native-dialog", "plugins", "simd"]
|
||||||
default = ["default-publish", "egui-ui"]
|
default = ["default-publish", "egui-ui", "hot-reloading"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
client = {package = "veloren-client", path = "../client"}
|
client = {package = "veloren-client", path = "../client"}
|
||||||
|
@ -14,10 +14,9 @@ use veloren_voxygen::{
|
|||||||
GlobalState,
|
GlobalState,
|
||||||
};
|
};
|
||||||
|
|
||||||
use common::{
|
#[cfg(feature = "hot-reloading")]
|
||||||
assets::{self},
|
use common::assets;
|
||||||
clock::Clock,
|
use common::clock::Clock;
|
||||||
};
|
|
||||||
use std::panic;
|
use std::panic;
|
||||||
use tracing::{error, info, warn};
|
use tracing::{error, info, warn};
|
||||||
#[cfg(feature = "egui-ui")]
|
#[cfg(feature = "egui-ui")]
|
||||||
@ -145,6 +144,7 @@ fn main() {
|
|||||||
default_hook(panic_info);
|
default_hook(panic_info);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
#[cfg(feature = "hot-reloading")]
|
||||||
assets::start_hot_reloading();
|
assets::start_hot_reloading();
|
||||||
|
|
||||||
// Initialise watcher for animation hot-reloading
|
// Initialise watcher for animation hot-reloading
|
||||||
|
Loading…
Reference in New Issue
Block a user