Skip to content

Commit

Permalink
refactor: update default values
Browse files Browse the repository at this point in the history
  • Loading branch information
manankarnik committed Jan 22, 2024
1 parent 4baf540 commit f891033
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ impl Default for Map {
fn default() -> Self {
Self {
noise: Noise::default(),
size: [100; 2],
image_size: [100; 2],
size: [400; 2],
image_size: [400; 2],
same_size: true,
anti_aliasing: true,
export: false,
Expand Down
15 changes: 5 additions & 10 deletions src/noise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl Default for Gradient {
Self {
image: Handle::default(),
size: [250, 50],
segments: 3,
segments: 0,
smoothness: 0.0,
}
}
Expand Down Expand Up @@ -179,18 +179,13 @@ impl Default for Noise {
function: Function::default(),
regions: vec![
Region {
label: "Sand".to_string(),
color: [242, 241, 199, 255],
label: "Region #1".to_string(),
color: [255, 0, 0, 255],
position: 0.0,
},
Region {
label: "Grass".to_string(),
color: [24, 148, 67, 255],
position: 50.0,
},
Region {
label: "Forest".to_string(),
color: [10, 82, 35, 255],
label: "Region #2".to_string(),
color: [0, 0, 255, 255],
position: 100.0,
},
],
Expand Down
21 changes: 8 additions & 13 deletions src/planet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,33 +82,28 @@ impl Default for Planet {
fn default() -> Self {
Self {
seed: 0,
scale: 1.0,
scale: 20.0,
offset: [0.0; 3],
method: Method::Perlin,
function: Function::default(),
resolution: 10,
resolution: 20,
regions: vec![
Region {
label: "Sand".to_string(),
color: [242, 241, 199, 255],
label: "Region #1".to_string(),
color: [255, 0, 0, 255],
position: 0.0,
},
Region {
label: "Grass".to_string(),
color: [24, 148, 67, 255],
position: 50.0,
},
Region {
label: "Forest".to_string(),
color: [10, 82, 35, 255],
label: "Region #2".to_string(),
color: [0, 0, 255, 255],
position: 100.0,
},
],
gradient: Gradient::default(),
base_color: [255, 255, 255, 255],
wireframe: false,
height_exponent: 1.0,
sea_percent: 10.0,
height_exponent: 1.5,
sea_percent: 50.0,
export: false,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/terrain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Default for Terrain {
Self {
noise: Noise::default(),
size: [2; 2],
resolution: 10,
resolution: 15,
wireframe: false,
height_exponent: 1.0,
sea_percent: 10.0,
Expand Down

0 comments on commit f891033

Please sign in to comment.