Created
July 17, 2015 04:18
-
-
Save LordNed/465df6d85d7fed767a45 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GameFormatReader.Common; | |
using System.Diagnostics; | |
namespace WEditor.WindWaker.Loaders | |
{ | |
public partial class J3DLoader | |
{ | |
private DrawInfo LoadDRW1FromStream(EndianBinaryReader reader, long chunkStart) | |
{ | |
DrawInfo drawInfo = new DrawInfo(); | |
ushort sectionCount = reader.ReadUInt16(); | |
Debug.Assert(reader.ReadUInt16() == 0xFFFF); // Padding | |
uint isWeightedOffset = reader.ReadUInt32(); | |
uint indexOffset = reader.ReadUInt32(); | |
reader.BaseStream.Position = chunkStart + isWeightedOffset; | |
for (int k = 0; k < sectionCount; k++) | |
drawInfo.IsWeighted.Add(reader.ReadBoolean()); | |
reader.BaseStream.Position = chunkStart + indexOffset; | |
for (int k = 0; k < sectionCount; k++) | |
drawInfo.Indexes.Add(reader.ReadUInt16()); | |
return drawInfo; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment