From c14178ca726852ffe66285b0ea7e2648380db9e7 Mon Sep 17 00:00:00 2001 From: chaoticgd <43898262+chaoticgd@users.noreply.github.com> Date: Wed, 13 Sep 2023 21:36:26 +0100 Subject: [PATCH] Don't include the texture metadata in extracted texture files --- CHANGELOG.md | 1 + extractall.c | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62d8bfc..13bbce7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## v2.0.3 - The texture metadata stored in the table of contents is now regenerated for modified textures. +- The extractall tool now extracts files in a format that includes the header from the table of contents. - Fixed a bug where too many mods loaded at once would cause mod loading to fail. - The mod list is now sorted case insensitively. diff --git a/extractall.c b/extractall.c index a209959..5a062f5 100644 --- a/extractall.c +++ b/extractall.c @@ -97,19 +97,10 @@ int main(int argc, char** argv) { if(toc_asset->has_header) { data_offset += sizeof(RA_TocAssetHeader); } - if(toc_asset->has_texture_meta) { - data_offset += sizeof(RA_TocTextureMeta); - } u8* data = RA_calloc(1, data_offset + toc_asset->metadata.size); u32 size = data_offset + toc_asset->metadata.size; if(toc_asset->has_header) { memcpy(data, &toc_asset->header, sizeof(RA_TocAssetHeader)); - if(toc_asset->has_texture_meta) { - memcpy(data + sizeof(RA_TocAssetHeader), &toc_asset->texture_meta, sizeof(RA_TocTextureMeta)); - } - } else if(toc_asset->has_texture_meta) { - fprintf(stderr, "error: Asset '%s' has texture metadata but no header.\n", asset_path); - return 1; } if(data == NULL) { fprintf(stderr, "error: Failed allocate memory for asset '%s'.\n", asset_path);