Commit Graph

3 Commits

Author SHA1 Message Date
RoosterDragon
531e3b7861 Fixes to StreamExts.
- Almost all calls to Stream.Read were broken. These have been patched to all go through ReadBytes which itself has been fixed to function correctly. The key thing to note is that Stream.Read is very much allowed to return less than the requested number of bytes. If this happens and you're not checking the return result, you'll be working with partially initialized arrays and really bad stuff happens when you do that.
- Call CopyTo rather than copying between streams manually.
- Peek and ReadUInt8 have been changed to avoid a pointless array allocation which is significant overhead for such simple calls.
2014-06-07 00:49:25 +01:00
Pavlos Touboulidis
2ec6df9680 Fix strange d2k loading slowness
There is a strange issue that appears* when Theater calls
ISpriteFrame.Frames on the R8Reader. The R8Reader uses
IEnumerable.Cast<> which behaves slower and slower, which
makes map loading become 10+ times slower.

The changes here simply avoid the casting.

[*] This happens at least on Linux x86_64 with Mono 3.2.8.

See https://bugzilla.xamarin.com/show_bug.cgi?id=19668
2014-05-11 06:38:19 +03:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00