Minor fix

master
Mark 2024-01-04 19:18:47 -08:00
parent 83857d4d0d
commit 7593be18ee
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
2 changed files with 5 additions and 1 deletions

View File

@ -208,6 +208,8 @@ impl Content {
part::sprite::Sprite::build(root.sprite.take().unwrap(), &mut content)?;
}
// TODO: enforce sprite and image limits
if root.ship.is_some() {
part::ship::Ship::build(root.ship.take().unwrap(), &mut content)?;
}

View File

@ -105,8 +105,9 @@ impl TextureArray {
println!("sending to gpu");
let mut image_counter = 0;
let mut sprite_counter = 0;
for t in &ct.sprites {
sprite_data.data[image_counter as usize] = SpriteData {
sprite_data.data[sprite_counter] = SpriteData {
frame_count: t.frames.len() as u32,
repeatmode: t.repeat.as_int(),
aspect: t.aspect,
@ -114,6 +115,7 @@ impl TextureArray {
first_frame: image_counter,
_padding: Default::default(),
};
sprite_counter += 1;
// Insert texture location data
for path in &t.frames {