mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fix voxygen compilation without plugins, part 2
This commit is contained in:
@ -123,7 +123,6 @@ pub trait AssetExt: Sized + Send + Sync + 'static {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Extension to AssetExt to combine Ron files from filesystem and plugins
|
/// Extension to AssetExt to combine Ron files from filesystem and plugins
|
||||||
#[cfg(feature = "plugins")]
|
|
||||||
pub trait AssetCombined: AssetExt {
|
pub trait AssetCombined: AssetExt {
|
||||||
fn load_and_combine(specifier: &str) -> Result<AssetHandle<Self>, BoxedError>;
|
fn load_and_combine(specifier: &str) -> Result<AssetHandle<Self>, BoxedError>;
|
||||||
|
|
||||||
@ -140,7 +139,6 @@ pub trait AssetCombined: AssetExt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Extension to AnyCache to combine Ron files from filesystem and plugins
|
/// Extension to AnyCache to combine Ron files from filesystem and plugins
|
||||||
#[cfg(feature = "plugins")]
|
|
||||||
pub trait CacheCombined<'a> {
|
pub trait CacheCombined<'a> {
|
||||||
fn load_and_combine<A: Compound + Concatenate>(
|
fn load_and_combine<A: Compound + Concatenate>(
|
||||||
self,
|
self,
|
||||||
@ -201,12 +199,13 @@ impl<T: Compound> AssetExt for T {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "plugins")]
|
|
||||||
impl<'a> CacheCombined<'a> for AnyCache<'a> {
|
impl<'a> CacheCombined<'a> for AnyCache<'a> {
|
||||||
fn load_and_combine<A: Compound + Concatenate>(
|
fn load_and_combine<A: Compound + Concatenate>(
|
||||||
self,
|
self,
|
||||||
specifier: &str,
|
specifier: &str,
|
||||||
) -> Result<assets_manager::Handle<'a, A>, BoxedError> {
|
) -> Result<assets_manager::Handle<'a, A>, BoxedError> {
|
||||||
|
#[cfg(feature = "plugins")]
|
||||||
|
{
|
||||||
self.get_cached(specifier).map_or_else(
|
self.get_cached(specifier).map_or_else(
|
||||||
|| {
|
|| {
|
||||||
// only create this combined object if is not yet cached
|
// only create this combined object if is not yet cached
|
||||||
@ -220,9 +219,13 @@ impl<'a> CacheCombined<'a> for AnyCache<'a> {
|
|||||||
Ok,
|
Ok,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
#[cfg(not(feature = "plugins"))]
|
||||||
|
{
|
||||||
|
Ok(self.load(specifier)?)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "plugins")]
|
|
||||||
impl<T: Compound + Concatenate> AssetCombined for T {
|
impl<T: Compound + Concatenate> AssetCombined for T {
|
||||||
fn load_and_combine(specifier: &str) -> Result<AssetHandle<Self>, BoxedError> {
|
fn load_and_combine(specifier: &str) -> Result<AssetHandle<Self>, BoxedError> {
|
||||||
ASSETS.as_any_cache().load_and_combine(specifier)
|
ASSETS.as_any_cache().load_and_combine(specifier)
|
||||||
|
Reference in New Issue
Block a user