Commit Graph

65 Commits

Author SHA1 Message Date
RoosterDragon
52fd564eac Fix some whitespace formatting issues: stray tabs or spaces.
Wrap some long lines on affected code.
2023-03-02 20:02:45 +02:00
RoosterDragon
8ee6957e6a Fix IDE0048 2023-03-01 21:56:28 +02:00
Gustas
8d0fe52dd8 Remove unnecessary parentheses 2023-02-27 08:36:47 +02:00
abcdefg30
5bf7fe852c Remove the copyright year numbers 2023-01-11 11:58:54 +02:00
Andre Mohren
0b94a0639e Implemented WestwoodCompression for AUD files. 2023-01-08 12:40:57 +00:00
IceReaper
0aced08204 Support for InstallShield CAB version <= 5. 2022-11-17 00:16:59 +02:00
abcdefg30
6a31b1f9f3 Update the copyright header year 2022-05-28 00:35:10 -05:00
Eduardo Cáceres
7eb64ea6fc Use read-only autoimplemented property when possible 2022-05-18 11:42:36 -05:00
Matthias Mailänder
0e7ad43425 Remove unused parameters. 2022-04-01 23:30:26 +02:00
RoosterDragon
9cd55df584 Ensure editorconfig naming styles align with StyleCop SA13XX style rules.
Aligns the naming conventions defined in editorconfig (dotnet_naming_style, dotnet_naming_symbols, dotnet_naming_rule) which are reported under the IDE1006 rule with the existing StyleCop rules from the SA13XX range.

This ensures the two rulesets agree when rejecting and accepting naming conventions within the IDE, with a few edges cases where only one ruleset can enforce the convention. IDE1006 allows use to specify a naming convention for type parameters, const locals and protected readonly fields which SA13XX cannot enforce. Some StyleCop SA13XX rules such as SA1309 'Field names should not begin with underscore' are not possible to enforce with the naming rules of IDE1006.

Therefore we enable the IDE1006 as a build time warning to enforce conventions and extend them. We disable SA13XX rules that can now be covered by IDE1006 to avoid double-reporting but leave the remaining SA13XX rules that cover additional cases enabled.

We also re-enable the SA1311 rule convention but enforce it via IDE1006, requiring some violations to be fixed or duplication of existing suppressions. Most violations fixes are trivial renames with the following exception. In ActorInitializer.cs, we prefer to make the fields private instead. ValueActorInit provides a publicly accessible property for access and OwnerInit provides a publicly accessible method. Health.cs is adjusted to access the property base instead when overriding. The reflection calls must be adjusted to target the base class specifically, as searching for a private field from the derived class will fail to locate it on the base class.

Unused suppressions were removed.
2022-02-07 19:14:45 +01:00
penev92
bf332b6619 Fixed fields missing the readonly modifier 2022-01-22 18:47:06 +00:00
penev92
87b92b53a4 Reworked ISoundFormat.LengthInSeconds implementations 2022-01-09 18:40:32 +01:00
penev92
abea3a0f74 Fixed AudFormat and WavFormat implementations of ISoundFormat.LengthInSeconds
- Fixed a rounding issue in `WavReader.WaveLength()`.
- Fixed `AudReader.SoundLength()` not resetting the stream position.
- Fixed crashes caused by disposed streams because `LengthInSeconds` would try and calculate the length on the fly. It is now precalculated and cached (making it consistent across all 5 current `ISoundFormat` implementations).
- Fixed a crash in `AudReader.LoadSound()`'s `out Func<Stream> result` because that func would try and access the disposed stream's `Length` property. That works for `SegmentStream`, but not for `FileStream`.
- Fixed frameCount/soundLength label positioning in the AssetBrowser window to avoid text clipping .
2022-01-09 18:40:32 +01:00
RoosterDragon
0f01df5474 Avoid string allocations in MiniYaml parsing.
- Stream lines in as memory rather than needing to realise a string for each line, via a new method in StreamExts.
- Use span to avoid string allocations during parsing until we want to realise the node itself, in MiniYaml.FromLines.
- Change several callsites to use the streaming extension method rather than string method where possible.
2021-11-15 13:20:34 +01:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
teinarss
10676be377 Replace F extension with string interpolation 2021-05-08 22:20:59 +02:00
teinarss
e12ff2c59d Remove our own ReadOnlyDictionary and update usages 2021-04-03 11:33:31 +02:00
teinarss
6b74093c04 Add readonly to structs 2021-03-14 15:17:57 +01:00
teinarss
4a1e4f3e16 Use expression body syntax 2021-03-07 13:00:52 +00:00
Trevor Nichols
536c130a39 Add MSADPCM audio format decoding support 2021-02-19 01:56:57 +01:00
Matthias Mailänder
7bc17b59f5 Add a generic video player widget. 2021-01-10 10:21:17 +01:00
Paul Chote
cc2e369475 Fix corrupted final frame in VQA playback. 2020-10-02 11:37:00 +02:00
teinarss
9c4fd0e3d3 Use Null-Propagation Operator 2020-08-19 18:11:07 +01:00
teinarss
27f1a7ab27 Use out var syntax 2020-08-19 18:11:07 +01:00
reaperrr
d835090d0b Move LCWCompression support to Mods.Cnc 2020-02-22 15:40:37 +01:00
reaperrr
c687600d66 Duplicate part of LCWCompression to VqaReader
Duplicates the part needed by the VqaReader,
so we can move LCWCompression to Mods.Cnc
ahead of VQA (which has some additional prerequisites).
2020-02-22 15:40:37 +01:00
reaperrr
ed618c807d Streamline LCWCompression code
Just making it more concise to reduce line count.
No functionality/efficiency changes.
2020-02-22 15:40:37 +01:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
reaperrr
82be8d9990 Move AUD support to Mods.Cnc 2019-12-09 22:06:53 +01:00
reaperrr
4d92fde5f7 Remove VqaReader dependency on AudReader
Use ImaAdpcmReader directly, since VQAs only contain
header-less raw IMA  ADPCM audio.
2019-12-09 22:06:53 +01:00
reaperrr
5afc1c1443 Remove duplication between IMA and AUD readers
These parts were identical duplicates, so I removed them
and made AudReader depend on ImaAdpcmReader instead.

Applied some style fixes while I was at it.
2019-12-09 22:06:53 +01:00
reaperrr
4751b1a176 Move ShpTDLoader, LZO and XORDelta formats to Mods.Cnc
They're pretty much RA/TD-specific formats.
2019-12-08 19:43:51 +00:00
reaperrr
b8e15fbe40 Move FastByteReader from LCW to own file
And make it public.
Making it easier to move formats that depend on it
to Mods.Cnc independently later.
2019-11-23 19:04:27 +01:00
Paul Chote
ebf2ce32c0 Make sure braces for multi-line statements are on their own lines. 2019-06-08 19:26:53 +02:00
Paul Chote
674155a8dd Move ctor initializers to their own line. 2019-06-08 18:44:50 +02:00
Paul Chote
353db73381 Fix a collection of minor style violations.
This enables several new StyleCopAnalyzer rules to
be enabled immediately during migration.
2019-05-09 20:40:08 +02:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
Paul Chote
d2ee9bcad9 Move Png loader back to OpenRA.Game. 2019-01-08 21:20:06 +00:00
Andre Mohren
7323db1492 Unified copyright regions. 2018-11-17 17:23:22 +00:00
Andre Mohren
b1a44086a0 Removed unused using directives. 2018-11-17 17:23:22 +00:00
Andre Mohren
693b5a54af PNG spritesheet support, along with PaletteFromPng.
Cursor palette loader can now be specified via yaml.
2018-09-29 21:12:40 +02:00
David Wilson
1b685955cd Fixes for WavReader to explictly handle "LIST" and "cue " chunks (RA2), and skip to EOF on unknown chunk 2018-04-11 19:22:47 +01:00
Paul Chote
e69cf4fd5c Rename another Stream.Write(byte[]) extension method. 2018-03-07 22:29:35 +01:00
Peter Antal
9ce0bcb0b7 Mop up active Stylecop nits.
Style consistency cleanup.
2018-03-03 11:45:35 +00:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
RoosterDragon
7760c41bd9 Avoid array resizing in OpenAlAsyncLoadSound.
- Where it is accessible, use the length of the stream to presize the MemoryStream to the correct size.
- Instead of copying out the result via ToArray, grab the underlying buffer via GetBuffer and use that to create the sound source.

This avoids extraneous copying of the array containing the audio.
2017-12-12 00:01:04 +01:00
RoosterDragon
7ed769421e Providing streaming WavFormat data.
WavFormat.GetPCMInputStream now returns data that is streamed, rather than a MemoryStream.
2017-09-24 11:23:39 +01:00
RoosterDragon
9413d9595c Providing streaming AudFormat data.
AudFormat.GetPCMInputStream now returns data that is streamed, rather than a MemoryStream.
2017-07-14 23:02:49 +01:00
Paul Chote
69587a2128 Move InstallShieldPackage to Mods.Common. 2017-05-29 12:41:28 +02:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00