summaryrefslogtreecommitdiff
path: root/NW4RTools/InputStream.cs
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-02-11 01:10:44 +0100
committerTreeki <treeki@gmail.com>2011-02-11 01:10:44 +0100
commit0d017deb24e7f6f8e049616a71691f1401c50b6a (patch)
tree8b107dcb3d51163831ffcce96010367f3779585e /NW4RTools/InputStream.cs
parent58dead7b909861732011325f5d4844eae21a9bc2 (diff)
downloadnw4rtools-0d017deb24e7f6f8e049616a71691f1401c50b6a.tar.gz
nw4rtools-0d017deb24e7f6f8e049616a71691f1401c50b6a.zip
tons of stuff: more work on shapes, unfinished OBJ exporter, ...
Diffstat (limited to 'NW4RTools/InputStream.cs')
-rw-r--r--NW4RTools/InputStream.cs12
1 files changed, 11 insertions, 1 deletions
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);
}