Last active
August 29, 2015 14:02
-
-
Save ChadSki/f065c6aaadc31723924c to your computer and use it in GitHub Desktop.
Halo Tag Size in C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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