Fixed asset header compare incosistenty
This commit is contained in:
@@ -64,7 +64,17 @@ errorret_t assetLoad(const char_t *filename, void *output) {
|
||||
for(uint_fast8_t i = 0; i < ASSET_TYPE_COUNT; i++) {
|
||||
const assettypedef_t *cmp = &ASSET_TYPE_DEFINITIONS[i];
|
||||
if(cmp->header == NULL) continue;
|
||||
if(strcmp(header.header, cmp->header) != 0) continue;
|
||||
|
||||
// strcmp didn't work because it's a fixed char_t[3] I think, or maybe
|
||||
// because of the packed struct?
|
||||
bool_t match = true;
|
||||
for(size_t h = 0; h < ASSET_HEADER_SIZE; h++) {
|
||||
if(header.header[h] == cmp->header[h]) continue;
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
if(!match) continue;
|
||||
|
||||
def = cmp;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user