Fix compilation on different feature-sets

This commit is contained in:
Tobias Berger 2022-09-19 13:58:47 +02:00
parent 8fa5393a41
commit a4fc8286b1
Signed by: toby
GPG key ID: 2D05EFAB764D6A88
5 changed files with 62 additions and 53 deletions

View file

@ -38,6 +38,7 @@ impl From<BiomeType> for Biome {
match biome_type {
BiomeType::IceCap => Biome {
name: "Ice Cap".into(),
#[cfg(feature = "render")]
color: Color::rgb_u8(253, 244, 235),
min_altitude: World::MIN_ALTITUDE,
max_altitude: World::MAX_ALTITUDE,
@ -48,6 +49,7 @@ impl From<BiomeType> for Biome {
},
BiomeType::Ocean => Biome {
name: "Ocean".into(),
#[cfg(feature = "render")]
color: Color::rgb_u8(28, 66, 84),
min_altitude: World::MIN_ALTITUDE,
max_altitude: 0.0,
@ -58,6 +60,7 @@ impl From<BiomeType> for Biome {
},
BiomeType::Grassland => Biome {
name: "Grassland".into(),
#[cfg(feature = "render")]
color: Color::rgb_u8(167, 177, 84),
min_altitude: 0.0,
max_altitude: World::MAX_ALTITUDE,
@ -68,6 +71,7 @@ impl From<BiomeType> for Biome {
},
BiomeType::Forest => Biome {
name: "Forest".into(),
#[cfg(feature = "render")]
color: Color::rgb_u8(76, 132, 55),
min_altitude: 0.0,
max_altitude: World::MAX_ALTITUDE,
@ -78,6 +82,7 @@ impl From<BiomeType> for Biome {
},
BiomeType::Taiga => Biome {
name: "Taiga".into(),
#[cfg(feature = "render")]
color: Color::rgb_u8(43, 63, 40),
min_altitude: 0.0,
max_altitude: World::MAX_ALTITUDE,
@ -88,6 +93,7 @@ impl From<BiomeType> for Biome {
},
BiomeType::Tundra => Biome {
name: "Tundra ".into(),
#[cfg(feature = "render")]
color: Color::rgb_u8(139, 139, 128),
min_altitude: 0.0,
max_altitude: World::MAX_ALTITUDE,
@ -98,6 +104,7 @@ impl From<BiomeType> for Biome {
},
BiomeType::Desert => Biome {
name: "Desert ".into(),
#[cfg(feature = "render")]
color: Color::rgb_u8(253, 225, 171),
min_altitude: 0.0,
max_altitude: World::MAX_ALTITUDE,
@ -108,6 +115,7 @@ impl From<BiomeType> for Biome {
},
BiomeType::Rainforest => Biome {
name: "Rainforest".into(),
#[cfg(feature = "render")]
color: Color::rgb_u8(59, 103, 43),
min_altitude: 0.0,
max_altitude: World::MAX_ALTITUDE,

View file

@ -35,7 +35,7 @@
pub mod world;
pub use world::*;
pub mod biome;
pub use biome::Biome;
pub use biome::*;
pub mod world_manager;
pub use world_manager::*;
pub mod math_util;

View file

@ -1,12 +1,12 @@
// TODO: Logging doesn't seem to work here? Figure out why and fix
use {
crate::{
biome::BiomeType,
cartesian_coordinates,
mix_values,
perlin,
random_point_in_sphere,
Biome,
BiomeType,
CartesianError,
RepeatNum,
},

View file

@ -4,7 +4,7 @@ use bevy::log::debug;
use bevy::utils::default;
#[cfg(feature = "render")]
use {
crate::TerrainCell,
crate::{Biome, TerrainCell},
bevy::{
asset::{Assets, HandleId},
render::render_resource::Extent3d,
@ -12,7 +12,7 @@ use {
},
};
use {
crate::{Biome, World, WorldGenError},
crate::{World, WorldGenError},
bevy::log::warn,
rand::random,
std::{

View file

@ -100,6 +100,7 @@ use {
markers::{InfoPanel, ToolbarButton},
third_party::PanCam,
},
planet::Biome,
resources::CursorMapPosition,
ui_helpers::{toolbar_button, toolbar_button_text},
};
@ -109,7 +110,7 @@ use {
log::LogSettings,
utils::{default, tracing::Level},
},
planet::{Biome, WorldManager},
planet::WorldManager,
plugins::WorldPlugins,
};