Lots of work to get MP2 repacking functional

This commit is contained in:
parax0
2016-11-07 03:07:00 -07:00
parent 040caca896
commit f6fd78af14
135 changed files with 677 additions and 1239 deletions

View File

@@ -200,10 +200,11 @@ void CAreaCooker::WritePrimeSCLY(IOutputStream& rOut)
// SCGN
if (mVersion == eEchoesDemo)
{
rOut.WriteString("SCGN", 4);
// IMPORTANT TODO - REGENERATE SCGN LAYER
/*rOut.WriteString("SCGN", 4);
rOut.WriteByte(1);
CScriptCooker::WriteLayer(mVersion, mpArea->mpGeneratorLayer, rOut);
FinishSection(false);
FinishSection(false);*/
}
}
@@ -220,9 +221,10 @@ void CAreaCooker::WriteEchoesSCLY(IOutputStream& rOut)
}
// SCGN
// IMPORTANT TODO - REGENERATE SCGN
rOut.WriteString("SCGN", 4);
rOut.WriteByte(0x1);
CScriptCooker::WriteLayer(mVersion, mpArea->mpGeneratorLayer, rOut);
//CScriptCooker::WriteLayer(mVersion, mpArea->mpGeneratorLayer, rOut);
FinishSection(true);
}
@@ -276,7 +278,7 @@ void CAreaCooker::FinishBlock()
if (EnableCompression)
{
bool Success = CompressionUtil::CompressSegmentedData((u8*) mCompressedData.Data(), mCompressedData.Size(), CompressedBuf.data(), CompressedSize, UseZlib);
bool Success = CompressionUtil::CompressSegmentedData((u8*) mCompressedData.Data(), mCompressedData.Size(), CompressedBuf.data(), CompressedSize, UseZlib, true);
u32 PadBytes = (32 - (CompressedSize % 32)) & 0x1F;
WriteCompressedData = Success && (CompressedSize + PadBytes < (u32) mCompressedData.Size());
}

View File

@@ -141,6 +141,10 @@ bool CWorldCooker::CookMLVL(CWorld *pWorld, IOutputStream& rMLVL)
for (u32 iOff = 0; iOff < ModuleLayerOffsets.size(); iOff++)
rMLVL.WriteLong(ModuleLayerOffsets[iOff]);
}
// Internal Name
if (Game >= eEchoesDemo)
rMLVL.WriteString(rArea.InternalName.ToStdString());
}
if (Game <= eCorruption)