Commit Graph

61 Commits

Author SHA1 Message Date
5b0d75ee56 Only trim trailing spaces to avoid breakage in storyboard parsing 2021-03-18 16:30:30 +09:00
b9a49d5589 Coerce undefined animation loop types to Forever 2021-01-31 15:43:58 +01:00
25af091409 Fix storyboard animations of very old beatmaps playing too slow
Closes https://github.com/ppy/osu/issues/10772.
2020-11-12 17:03:43 +09:00
3090b6ccb5 Resolve CA2249 inspections
"Use `string.Contains` instead of `string.IndexOf` to improve
readability"
2020-11-01 18:54:44 +01:00
cdd56ece87 Read UseSkinSprites when decoding storyboards 2020-10-20 22:49:56 +02:00
b8f20831a1 Video no longer modifies storyboard resolution 2020-03-24 20:04:09 -07:00
c27751050b Switch back to strings and update setting labels 2020-03-12 23:29:11 -07:00
1d556bfc5f Merge branch 'master' into video-offset 2020-03-11 15:13:18 +09:00
e6858bf130 Fix crashes on some storyboards 2020-03-10 11:58:33 +09:00
4624582703 Revert position offset change for separate pull 2020-03-08 14:40:36 -07:00
22dd93a4f6 Code quality, read position offsets 2020-03-08 14:02:39 -07:00
76c832518f Render video as a part of the storyboard 2020-03-07 21:32:03 -08:00
5b452293d6 Minor cleanups for legacy beatmap decoders
Replaces some string.StartsWith(string, StringComparison.Ordinal) calls with ring.StartsWith(char) , when only one char is compared. Possible since .NET-Standard 2.1

And another LegacyStoryboardDecoder.handleEvents() cleanup, saves some MB of allocations.
2020-02-08 18:05:27 +01:00
eabb5a8701 Use ToString instead of Substring 2020-01-26 17:40:38 +09:00
219e14baa2 Address review and fix InspectCode 2020-01-24 17:05:27 +01:00
6658bdb223 Fix CodeFactor issues 2020-01-23 16:34:43 +01:00
316a764f6f Minor cleanups for Legacy Storyboard/Beatmap decoder 2020-01-23 16:23:53 +01:00
34d8740ec4 Remove remaining usage of osuTK.MathHelper 2020-01-08 20:21:13 +01:00
1802e0ff11 Fix storyboard incorrectly re-ordering elements 2019-12-20 16:04:05 +09:00
5cdc7d3b18 Merge pull request #7183 from smoogipoo/legacy-beatmap-saving
Add initial implementation of a legacy beatmap encoder
2019-12-18 18:43:14 +09:00
602ce698d5 Fix storyboard vectorscale and scale cross-pollution 2019-12-18 17:21:38 +09:00
abf3f341b7 Merge remote-tracking branch 'refs/remotes/origin/master' into legacy-beatmap-saving 2019-12-13 19:01:25 +09:00
b86a3dbfab PathStandardise -> ToStandardisedPath 2019-12-11 16:06:56 +08:00
6b3c7c8421 Remove usages of FileSafety class. 2019-12-11 16:05:35 +08:00
c378e525da Extract the rest of legacy enums 2019-12-10 20:23:15 +09:00
31cc0d13da Use 'out var'. 2019-11-12 19:55:26 +08:00
e9b8cbb516 Apply other styles. 2019-11-11 20:27:04 +08:00
ccc8aa6fa4 Apply brace style. 2019-11-11 20:13:13 +08:00
86588778b1 Implement fallback decoder registration
After the preparatory introduction of LineBufferedReader, it is now
possible to introduce registration of fallback decoders that won't drop
input supplied in the first line of the file.

A fallback decoder is used when the magic in the first line of the file
does not match any of the other known decoders. In such a case,
the fallback decoder is constructed and provided a LineBufferedReader
instance. The process of matching magic only peeks the first non-empty
line, so it is available for re-reading in Decode() using ReadLine().

There can be only one fallback decoder per type; a second attempt of
registering a fallback will result in an exception to avoid bugs.

To address the issue of parsing failing on badly or non-headered files,
set the legacy decoders for Beatmaps and Storyboards as the fallbacks.

Due to non-trivial logic, several new, passing unit tests with possible
edge cases also included.
2019-09-15 01:28:07 +02:00
11eda44d34 Migrate decoding to line-buffered reader
Migrate all usages of StreamReader in the context of decoding beatmaps,
storyboards or skins to the new LineBufferedReader.
2019-09-15 01:28:07 +02:00
7b04fb1690 StoryboardSample -> StoryboardSampleInfo 2019-08-23 14:54:39 +03:00
48716f8f2b Update framework 2019-08-21 13:29:50 +09:00
ac2060f1cf Throw exceptions and let LegacyDecoder handle them 2019-08-08 14:44:04 +09:00
da15e19912 return on storyboard side 2019-08-07 18:40:58 +09:00
7bcec31ea3 mention that the event was the type 2019-08-07 17:08:41 +09:00
66b02c0283 log type as well 2019-08-06 12:27:10 +09:00
cd6fe91882 Log error for invalid events 2019-08-06 10:05:21 +09:00
612db31c38 Apply newline additions 2019-04-01 12:16:32 +09:00
e45c08ad23 Adjust comment 2019-03-29 14:02:19 +09:00
92184adef5 Add stable sorting of storyboard elements 2019-03-26 16:37:52 +09:00
8617aaa2a7 Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
f27bd3ef3e OpenTK -> osuTK 2018-11-20 17:14:59 +09:00
710b0a4664 Remove unnecessary PathSanitise call 2018-10-12 15:30:24 +02:00
df84889646 Handle invalid origins as Anchor.TopLeft 2018-08-22 14:50:03 +09:00
541c4daa81 Use ordinal string comparison in hot paths 2018-08-21 11:10:54 +09:00
e360985d73 Replace variables into the entire line 2018-08-14 18:15:09 +09:00
6c861a1638 Strip comments from everything except metadata 2018-07-16 01:04:41 +02:00
32a74f95a5 Normalize all the line endings 2018-04-13 18:26:38 +09:00
e43de68ad3 Move colour parsing to LegacyDecoder 2018-03-13 19:13:50 +09:00
217dd2ecdc Initial push for better decoders 2018-03-09 21:24:15 +09:00