Fill remainder of component attribute table

stinkhead7ds
Ashley N. 2023-09-21 21:09:47 -04:00
parent dcf8079592
commit 6e63b9c40f
1 changed files with 8 additions and 0 deletions

View File

@ -379,6 +379,14 @@ pub fn get_ecs( tilemap: &TiledTilemap ) -> Result<Vec<u8>, Box<dyn Error>> {
} }
} }
// Fill the remainder of the sparse array with 0xFF, if needed
let remainder = 512 - tilemap.ecs.len();
for _ in 0..remainder {
for _ in 0..largest_type_attributes_size {
result.extend( ( 0xFFFF as u16 ).to_be_bytes() );
}
}
// Output IDs to terminal // Output IDs to terminal
let component_ids: Vec<String> = component_ids.into_iter().collect(); let component_ids: Vec<String> = component_ids.into_iter().collect();
for i in 0..component_ids.len() { for i in 0..component_ids.len() {