From 0d017deb24e7f6f8e049616a71691f1401c50b6a Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 11 Feb 2011 01:10:44 +0100 Subject: tons of stuff: more work on shapes, unfinished OBJ exporter, ... --- NW4RTools/InputStream.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'NW4RTools/InputStream.cs') diff --git a/NW4RTools/InputStream.cs b/NW4RTools/InputStream.cs index 3a776b4..134cb93 100644 --- a/NW4RTools/InputStream.cs +++ b/NW4RTools/InputStream.cs @@ -29,8 +29,14 @@ namespace NW4RTools { MustReverseArrays = !BitConverter.IsLittleEndian; } + public bool AtEnd { + get { + return (Position == Data.Length); + } + } + public void Seek(int pos) { - if (pos < 0 || pos >= Data.Length) + if (pos < 0 || pos > Data.Length) throw new ArgumentOutOfRangeException(); Position = pos; @@ -60,6 +66,10 @@ namespace NW4RTools { return ret; } + public SByte ReadSByte() { + return unchecked((sbyte)ReadByte()); + } + public Int16 ReadInt16() { return BitConverter.ToInt16(ReadReversedBytes(2), 0); } -- cgit v1.2.3