From b4a3d2b90267d713135e18144638f77f511ea42e Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Mon, 16 Jan 2017 17:51:42 -1000 Subject: [PATCH] MP2/3 MREA extract fix --- DataSpec/DNAMP2/MREA.cpp | 6 +++++- DataSpec/DNAMP3/MREA.cpp | 6 +++++- Runtime/MP1/CPreFrontEnd.cpp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/DataSpec/DNAMP2/MREA.cpp b/DataSpec/DNAMP2/MREA.cpp index 62fea319f..24c818461 100644 --- a/DataSpec/DNAMP2/MREA.cpp +++ b/DataSpec/DNAMP2/MREA.cpp @@ -7,6 +7,8 @@ namespace DataSpec { +extern hecl::Database::DataSpecEntry SpecEntMP2ORIG; + namespace DNAMP2 { @@ -179,7 +181,9 @@ bool MREA::Extract(const SpecBase& dataSpec, /* MREA decompression stream */ StreamReader drs(rs, head.compressedBlockCount); - athena::io::FileWriter mreaDecompOut(pakRouter.getCooked(&entry).getWithExtension(_S(".decomp")).getAbsolutePath()); + hecl::ProjectPath decompPath = outPath.getCookedPath(SpecEntMP2ORIG).getWithExtension(_S(".decomp")); + decompPath.makeDirChain(false); + athena::io::FileWriter mreaDecompOut(decompPath.getAbsolutePath()); head.write(mreaDecompOut); mreaDecompOut.seekAlign32(); drs.writeDecompInfos(mreaDecompOut); diff --git a/DataSpec/DNAMP3/MREA.cpp b/DataSpec/DNAMP3/MREA.cpp index f7ca252c3..e2b5ef311 100644 --- a/DataSpec/DNAMP3/MREA.cpp +++ b/DataSpec/DNAMP3/MREA.cpp @@ -5,6 +5,8 @@ namespace DataSpec { +extern hecl::Database::DataSpecEntry SpecEntMP3ORIG; + namespace DNAMP3 { @@ -88,7 +90,9 @@ bool MREA::Extract(const SpecBase& dataSpec, /* MREA decompression stream */ StreamReader drs(rs, head.compressedBlockCount, head.secIndexCount); - athena::io::FileWriter mreaDecompOut(pakRouter.getCooked(&entry).getWithExtension(_S(".decomp")).getAbsolutePath()); + hecl::ProjectPath decompPath = outPath.getCookedPath(SpecEntMP3ORIG).getWithExtension(_S(".decomp")); + decompPath.makeDirChain(false); + athena::io::FileWriter mreaDecompOut(decompPath.getAbsolutePath()); head.write(mreaDecompOut); mreaDecompOut.seekAlign32(); drs.writeDecompInfos(mreaDecompOut); diff --git a/Runtime/MP1/CPreFrontEnd.cpp b/Runtime/MP1/CPreFrontEnd.cpp index 63f2fcde5..10a5918eb 100644 --- a/Runtime/MP1/CPreFrontEnd.cpp +++ b/Runtime/MP1/CPreFrontEnd.cpp @@ -13,7 +13,7 @@ CPreFrontEnd::CPreFrontEnd() CIOWin::EMessageReturn CPreFrontEnd::OnMessage(const CArchitectureMessage&, CArchitectureQueue&) { - return EMessageReturn::Normal; + return EMessageReturn::Exit; } }