Commit Graph

40 Commits

Author SHA1 Message Date
Matthias Mailänder
51468c60ed use UTF8 instead of system locale code page 2016-01-02 09:08:21 +01:00
RoosterDragon
b5f24c3fa6 Add some missing Dispose calls, fix some Dispose implementations. 2016-01-01 04:51:54 +00:00
Pavel Penev
d08a400565 Add a context argument to package files contructors 2015-12-14 03:42:25 +02:00
Pavel Penev
1b88d24cfa Unstatic GlobalFileSystem and rename it to FileSystem
Add a ModFiles field on ModData and move all access to the file system to go through that.
2015-12-14 03:42:22 +02:00
Pavel Penev
5684bcec1c Move IFolder out of GlobalFileSystem.cs 2015-12-14 03:42:18 +02:00
RoosterDragon
bfe1804bf6 Fix some spellings. 2015-11-27 16:19:59 +00:00
RoosterDragon
210c7e312b Don't keep mix files in memory.
Added SegmentStream class to assist in maintaining views into portions of the FileStream of the overall mix file to avoid having to copy sections into in-memory buffers.
2015-10-13 19:23:56 +01:00
James
5000369463 Fixed TFD Not Creating Install Directory 2015-10-12 19:52:49 +01:00
Matthias Mailänder
245d7904fe allow to specify the folder directly in the virtual file system
using folder:file syntax
2015-08-02 17:29:41 +02:00
James
8468ce5fe6 added InstallShield CAB Extractor 2015-07-29 08:18:26 +01:00
RoosterDragon
ce73bb909e Make IFolder interface inherently IDisposable.
Fix up implementations to ensure they dispose any stream they acquire, and ensure the constructor will not leave a stream open if it fails. Dispose folders when unmounting them in GlobalFileSystem.
2015-07-23 22:31:20 +01:00
Matthias Mailänder
e93faeaa04 dispose the memory stream and avoid the binary reader 2015-06-24 07:15:59 +02:00
Oliver Brakmann
a572044497 Revert "Dispose of a MemoryStream in PackageEntry" 2015-06-23 17:37:35 +02:00
penev92
04cc54c392 Get rid of an undisposed MemoryStream in PackageEntry
And a BinaryReader
2015-06-22 20:06:36 +03:00
Pavel Penev
b7567fa5fa Merge pull request #8399 from Mailaender/mix-readblock-guards
Fixed EndOfStreamException in MixFile.ReadBlocks
2015-06-11 17:38:35 +03:00
Matthias Mailänder
07711f01b3 add exceptions for debugging 2015-06-10 20:41:34 +02:00
Matthias Mailänder
9261f685a7 fix a null reference exception 2015-06-10 06:48:10 +02:00
Benno van den Bogaard
8cf7c46c8f Added audio.bag/audio.idx support used in RA2 2015-03-31 18:13:20 +02:00
Paul Chote
b2458fc614 Remove GlobalFilesystem.OpenWithExts. Closes #5272. 2015-03-28 12:38:48 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
RoosterDragon
a6cda967c2 Formatted all files.
Automatically formatted all files via VS. This generally corrects indentation, removes trailing whitespace and corrects misplaced tabs or spaces. Manually tweaked a few files where required.
2015-01-06 21:28:50 +00:00
Matthias Mailänder
44cd174a8d StyleCop clean OpenRA.Game 2015-01-03 19:00:48 +01:00
Oliver Brakmann
30e42cdc62 Merge pull request #7247 from Hellhake/stylecop-game
Fix StyleCop warnings in OpenRA.Game
2015-01-02 12:58:04 +01:00
Hellhake
5a97a4b63b Fix StyleCop warnings in OpenRA.Game 2015-01-02 12:11:01 +01:00
Hellhake
fa72e04042 Remove BOM 2015-01-01 22:51:12 +01:00
Paul Chote
4f44cc1969 Load assets using absolute paths. Fixes #6717. 2014-10-11 11:02:30 +13:00
Chris Forbes
edbd65bdf3 filesystem: Fix benign use of loop variable in closure
This closure never outlives a single loop iteration.
2014-10-07 18:17:09 +13:00
Alexander Fast
070d00c678 Fixes year numbers in license text in file headers. 2014-08-21 11:27:52 +02:00
ScottNZ
009dc79222 Add support for C&C Generals .big archive files 2014-08-17 17:02:38 +12:00
ScottNZ
90894aa03e Use var everywhere 2014-06-15 22:17:34 +12:00
RoosterDragon
a598a01108 Fixed IDisposable implementation and usage.
- Implement IDisposable interface correctly, with sealed classes where possible for simplicity.
- Add using statement around undisposed local variables.
2014-06-10 11:23:55 +01:00
Paul Chote
d8e5177a36 Merge pull request #5405 from RoosterDragon/min-max
Added MinBy, MaxBy, etc.
2014-06-09 17:42:01 +12:00
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
RoosterDragon
0c8bdff5be Formatting fixes.
Spaces to tabs, indents, etc.
2014-05-26 18:10:59 +01:00
RoosterDragon
b733465f33 General uncontroversial cleanup:
- Made private methods static where possible (runtime can elide checking the object for null).
- Declared attribute classes as sealed (allows reflection on attributes to complete faster).
- Moved some static cctor's into field initializers (static cctor's are slower than static field initializers).
- Made classes static if they contained only static methods (can't create instances of useless objects).
- Use inferable Exts.Lazy and not new Lazy<T>().
- Added required STAThread attribute to CrashDialog.
- Removed unused parameters in private methods.
- Added Serializable attribute to exceptions.
- Added parameter name in calls to ArgumentNullException.
- Use of as operator instead of is + cast.
- Changed (x as Foo).Bar anti-pattern into ((Foo)x).Bar. Results in sensible cast exceptions on error rather than null dereferences.
- Removed unused method in NullShader.
2014-05-23 15:50:54 +01:00
RoosterDragon
0ea3509ee4 Added MinBy, MaxBy, MinByOrDefault and MaxByOrDefault methods and replaced calls of the style OrderBy[Descending]().First[OrDefault]() which is not as performant. 2014-05-23 08:23:42 +01:00
Pavlos Touboulidis
531338a955 Preload sequences and fix #5382 2014-05-22 03:45:28 +03:00
ForNeVeR
06671c8aa4 Fix encoding problems with ZipFile.
Without setting the DefaultCodePage it may cause problems on systems without 866 code page installed.
2014-05-17 17:11:29 +07:00
Matthias Mailänder
59ace5d01b new shorthand Exts.(Try)ParseIntegerInvariant 2014-05-13 14:16:41 +02:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00