Skip to content

Commit

Permalink
Fix accidentally introduced bug in GenSoundEffectFeeder, fix XNB size
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0ade committed Oct 26, 2017
1 parent 7afb6f3 commit 1519430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Content/WaveBank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public static Action<Process> GenerateSoundEffectFeeder(
ffmpegWriter.Write("data".ToCharArray());
// Ignore XNB SoundEffect data size.
reader.ReadUInt32();
ffmpegWriter.Write(reader.ReadUInt32());
ffmpegWriter.Write(dataLength);
ffmpegWriter.Flush();
}

Expand Down
8 changes: 8 additions & 0 deletions src/Content/XNBContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public static void TransformContent(string path) {
// Replace .xnb with .tmp
File.Delete(path);
File.Move(path + ".tmp", path);

// Update the size embedded in the .xnb.
using (Stream stream = File.Open(path, FileMode.Open, FileAccess.ReadWrite))
using (BinaryWriter writer = new BinaryWriter(stream)) {
// We know that the size is always past the header, version and flags.
stream.Position = 6;
writer.Write((uint) stream.Length);
}
}

// Yo dawg, I heard you like patching...
Expand Down

0 comments on commit 1519430

Please sign in to comment.