Skip to content

Instantly share code, notes, and snippets.

@ChadSki
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChadSki/f065c6aaadc31723924c to your computer and use it in GitHub Desktop.
Save ChadSki/f065c6aaadc31723924c to your computer and use it in GitHub Desktop.
Halo Tag Size in C
// start with the largest possible size
uint32_t tagSize = (0x40440000 + header->metaSize) - tag.data;
for(uint32_t q=0;q<tagCount;q++) {
// skip if the offset starts before the tag in question
if(tags[q].data <= tag.data) continue;
// skip when the offsets are the same
if(tag.data == tags[q].data) continue;
// skip when the offset is zero (BSP)
if(tags[q].data == 0) continue;
// if the difference between the offsets is smaller, keep the new smallest value
if(tags[q].data - tag.data < tagSize) tagSize = tags[q].data - tag.data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment