Increases maximum sprite dimensions (if you suspect an issue, check this commit)

This commit is contained in:
Joshua Barretto 2020-11-11 16:20:14 +00:00
parent c3cedd4ddf
commit fc26305ac8
3 changed files with 14 additions and 24 deletions

View File

@ -159,9 +159,10 @@ where
&& lower_bound.z <= upper_bound.z && lower_bound.z <= upper_bound.z
); );
let greedy_size = upper_bound - lower_bound + 1; let greedy_size = upper_bound - lower_bound + 1;
// TODO: Should this be 16, 16, 64?
assert!( assert!(
greedy_size.x <= 16 && greedy_size.y <= 16 && greedy_size.z <= 64, greedy_size.x <= 32 && greedy_size.y <= 32 && greedy_size.z <= 64,
"Sprite size out of bounds: {:?} ≤ (15, 15, 63)", "Sprite size out of bounds: {:?} ≤ (31, 31, 63)",
greedy_size - 1 greedy_size - 1
); );
// NOTE: Cast to usize is safe because of previous check, since all values fit // NOTE: Cast to usize is safe because of previous check, since all values fit

View File

@ -291,7 +291,7 @@ impl<V: RectRasterableVol> Terrain<V> {
}| Vec3::new(x, y, z), }| Vec3::new(x, y, z),
) )
.unwrap_or(zero); .unwrap_or(zero);
let max_model_size = Vec3::new(15.0, 15.0, 63.0); let max_model_size = Vec3::new(31.0, 31.0, 63.0);
let model_scale = max_model_size.map2(model_size, |max_sz: f32, cur_sz| { let model_scale = max_model_size.map2(model_size, |max_sz: f32, cur_sz| {
let scale = max_sz / max_sz.max(cur_sz as f32); let scale = max_sz / max_sz.max(cur_sz as f32);
if scale < 1.0 && (cur_sz as f32 * scale).ceil() > max_sz { if scale < 1.0 && (cur_sz as f32 * scale).ceil() > max_sz {

View File

@ -195,7 +195,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas) {
// Desert Plants // Desert Plants
(DeadBush, false, |c, _| { (DeadBush, false, |c, _| {
( (
close(c.temp, 1.0, 0.95).min(close(c.humidity, 0.0, 0.3)) * MUSH_FACT * 15.0, close(c.temp, 1.0, 0.95).min(close(c.humidity, 0.0, 0.3)) * MUSH_FACT * 7.5,
None, None,
) )
}), }),
@ -206,65 +206,54 @@ pub fn apply_scatter_to(canvas: &mut Canvas) {
CONFIG.desert_hum, CONFIG.desert_hum,
0.2, 0.2,
)) * MUSH_FACT )) * MUSH_FACT
* 0.1, * 1.0,
None, None,
) )
}), }),
/*(BarrelCactus, false, |c, col| { (RoundCactus, false, |c, _| {
( (
close(c.temp, CONFIG.desert_temp + 0.2, 0.3).min(close( close(c.temp, CONFIG.desert_temp + 0.2, 0.3).min(close(
c.humidity, c.humidity,
CONFIG.desert_hum, CONFIG.desert_hum,
0.2, 0.2,
)) * MUSH_FACT )) * MUSH_FACT
* 0.1, * 1.0,
None, None,
) )
}), }),
(RoundCactus, false, |c, col| { (ShortCactus, false, |c, _| {
( (
close(c.temp, CONFIG.desert_temp + 0.2, 0.3).min(close( close(c.temp, CONFIG.desert_temp + 0.2, 0.3).min(close(
c.humidity, c.humidity,
CONFIG.desert_hum, CONFIG.desert_hum,
0.2, 0.2,
)) * MUSH_FACT )) * MUSH_FACT
* 0.1, * 1.0,
None, None,
) )
}), }),
(ShortCactus, false, |c, col| { (MedFlatCactus, false, |c, _| {
( (
close(c.temp, CONFIG.desert_temp + 0.2, 0.3).min(close( close(c.temp, CONFIG.desert_temp + 0.2, 0.3).min(close(
c.humidity, c.humidity,
CONFIG.desert_hum, CONFIG.desert_hum,
0.2, 0.2,
)) * MUSH_FACT )) * MUSH_FACT
* 0.1, * 1.0,
None, None,
) )
}), }),
(MedFlatCactus, false, |c, col| { (ShortFlatCactus, false, |c, _| {
( (
close(c.temp, CONFIG.desert_temp + 0.2, 0.3).min(close( close(c.temp, CONFIG.desert_temp + 0.2, 0.3).min(close(
c.humidity, c.humidity,
CONFIG.desert_hum, CONFIG.desert_hum,
0.2, 0.2,
)) * MUSH_FACT )) * MUSH_FACT
* 0.1, * 2.5,
None, None,
) )
}), }),
(ShortFlatCactus, false, |c, col| {
(
close(c.temp, CONFIG.desert_temp + 0.2, 0.3).min(close(
c.humidity,
CONFIG.desert_hum,
0.2,
)) * MUSH_FACT
* 0.1,
None,
)
}),*/
(Reed, false, |c, col| { (Reed, false, |c, col| {
( (
close(c.humidity, CONFIG.jungle_hum, 0.7) close(c.humidity, CONFIG.jungle_hum, 0.7)