mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
hotfix: panic trying to create a character
This commit is contained in:
parent
0fba5283a2
commit
779769f64e
@ -120,7 +120,7 @@ pub fn draw_vox(
|
|||||||
.xyz()
|
.xyz()
|
||||||
.map(|e| e.abs());
|
.map(|e| e.abs());
|
||||||
|
|
||||||
let dims = match sample_strat {
|
let mut dims = match sample_strat {
|
||||||
SampleStrat::None => output_size,
|
SampleStrat::None => output_size,
|
||||||
SampleStrat::SuperSampling(min_samples) => {
|
SampleStrat::SuperSampling(min_samples) => {
|
||||||
output_size * (min_samples as f32).sqrt().ceil() as usize
|
output_size * (min_samples as f32).sqrt().ceil() as usize
|
||||||
@ -137,6 +137,16 @@ pub fn draw_vox(
|
|||||||
}
|
}
|
||||||
.into_array();
|
.into_array();
|
||||||
|
|
||||||
|
// TODO: Imbris please fix
|
||||||
|
if dims[0] == 0 {
|
||||||
|
log::warn!("Tried to render an image with a width of 0. Defaulting to 1.");
|
||||||
|
dims[0] = 1;
|
||||||
|
}
|
||||||
|
if dims[1] == 0 {
|
||||||
|
log::warn!("Tried to render an image with a height of 0. Defaulting to 1.");
|
||||||
|
dims[1] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Rendering buffers
|
// Rendering buffers
|
||||||
let mut color = Buffer2d::new(dims, [0; 4]);
|
let mut color = Buffer2d::new(dims, [0; 4]);
|
||||||
let mut depth = Buffer2d::new(dims, 1.0);
|
let mut depth = Buffer2d::new(dims, 1.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user