diff options
author | Treeki <treeki@gmail.com> | 2011-03-26 03:45:34 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-03-26 03:45:34 +0100 |
commit | fd085848e60831a8582c24de8f30ad4528f9d490 (patch) | |
tree | b00fd7539c1cb02ff5187f212b5bd2e8128e82bd /NW4RTools/BrresReader.cs | |
parent | 6a3b743987ca132729845613bc2d043f75f0d9e5 (diff) | |
download | nw4rtools-fd085848e60831a8582c24de8f30ad4528f9d490.tar.gz nw4rtools-fd085848e60831a8582c24de8f30ad4528f9d490.zip |
unfinished console interface to NW4RTools added
Diffstat (limited to '')
-rw-r--r-- | NW4RTools/BrresReader.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/NW4RTools/BrresReader.cs b/NW4RTools/BrresReader.cs index d5db720..aa54437 100644 --- a/NW4RTools/BrresReader.cs +++ b/NW4RTools/BrresReader.cs @@ -7,7 +7,11 @@ using NW4RTools.Models; namespace NW4RTools { public class BrresReader { public static ResFile LoadFile(byte[] data) { - return new BrresReader().Load(new InputStream(data, ByteEndian.BigEndian)); + return LoadFile(data, true); + } + + public static ResFile LoadFile(byte[] data, bool debug) { + return new BrresReader(debug).Load(new InputStream(data, ByteEndian.BigEndian)); } @@ -21,8 +25,12 @@ namespace NW4RTools { private ILogger Debug; private SortedDictionary<int, string> OffsetMap; - private BrresReader() { - Debug = new ConsoleLogger(); + private BrresReader(bool debug) { + if (debug) + Debug = new ConsoleLogger(); + else + Debug = new NullLogger(); + OffsetMap = new SortedDictionary<int, string>(); } |