From cad9c1bbc9226a3d15321696c49eac2d3536782c Mon Sep 17 00:00:00 2001 From: Kyle K Date: Mon, 20 Apr 2015 16:14:32 -0500 Subject: add logic to detect game archive, test Wangan Midnight audio extraction --- wmn.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'wmn.cpp') diff --git a/wmn.cpp b/wmn.cpp index 5e57e22..6789317 100644 --- a/wmn.cpp +++ b/wmn.cpp @@ -266,6 +266,9 @@ int wmn_extract(FILE *fd_archive, FILE *fd_toc) { char **filenames; int i, ret; + rewind(fd_archive); + rewind(fd_toc); + // parse toc header and check for validity ret = fread((void *) &toc_header, sizeof(struct WMN_TOC_HEADER), 1, fd_toc); if ( ret != 1 || !(strncmp(toc_header.fourcc, "BLDh", 4) == 0) || !(strncmp(toc_header.def_section, "def ", 4) == 0) ) { @@ -295,3 +298,9 @@ int wmn_extract(FILE *fd_archive, FILE *fd_toc) { return 0; } + +int wmn_extract_audio(FILE *fd_archive, FILE *fd_toc) { + // audio files are stored uncompressed, since wmn_dat_inflate_file already can handle non zlib deflated files + // we can call wmn_extract directly + return wmn_extract(fd_archive, fd_toc); +} -- cgit v1.2.3