mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-23 07:22:52 +08:00
AWC/XML conversion bug fix
This commit is contained in:
parent
70b490e552
commit
05d971d8cf
@ -269,7 +269,6 @@ namespace CodeWalker.GameFiles
|
|||||||
{
|
{
|
||||||
var stream = Streams[i];
|
var stream = Streams[i];
|
||||||
stream.Write(w);
|
stream.Write(w);
|
||||||
stream.WriteDataChunks(w);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -731,7 +730,7 @@ namespace CodeWalker.GameFiles
|
|||||||
{
|
{
|
||||||
foreach (var chunk in Chunks)
|
foreach (var chunk in Chunks)
|
||||||
{
|
{
|
||||||
if (!(chunk is AwcDataChunk))
|
if (!((chunk is AwcDataChunk) && Awc.MultiChannelFlag))
|
||||||
{
|
{
|
||||||
if (Awc.MultiChannelFlag && (chunk is AwcMarkersChunk))
|
if (Awc.MultiChannelFlag && (chunk is AwcMarkersChunk))
|
||||||
{
|
{
|
||||||
@ -747,19 +746,17 @@ namespace CodeWalker.GameFiles
|
|||||||
}
|
}
|
||||||
public void WriteDataChunks(DataWriter w)
|
public void WriteDataChunks(DataWriter w)
|
||||||
{
|
{
|
||||||
|
//for use by multichannel only, to write the data at the end
|
||||||
|
|
||||||
if (Chunks != null)
|
if (Chunks != null)
|
||||||
{
|
{
|
||||||
foreach (var chunk in Chunks)
|
foreach (var chunk in Chunks)
|
||||||
{
|
{
|
||||||
if (chunk is AwcDataChunk)
|
if (chunk is AwcDataChunk)
|
||||||
{
|
|
||||||
if (Awc.MultiChannelFlag)
|
|
||||||
{
|
{
|
||||||
//write padding to align to 16 bytes
|
//write padding to align to 16 bytes
|
||||||
var padc = (16 - (w.Position % 16)) % 16;
|
var padc = (16 - (w.Position % 16)) % 16;
|
||||||
if (padc > 0) w.Write(new byte[padc]);
|
if (padc > 0) w.Write(new byte[padc]);
|
||||||
}
|
|
||||||
|
|
||||||
chunk.Write(w);
|
chunk.Write(w);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user