Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Don't include the texture metadata in extracted texture files
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoticgd committed Sep 13, 2023
1 parent 3ccbd3a commit c14178c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
9 changes: 0 additions & 9 deletions extractall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c14178c

Please sign in to comment.