From 3098204dda1839aeb0e848848dc48bca2b441b38 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Aug 2016 12:33:01 +0900 Subject: [PATCH 01/28] Add basic class structure for Beatmap/HitObject/SampleInfo/User. --- osu.Game/Beatmaps/Beatmap.cs | 17 +++++++++++++ osu.Game/Beatmaps/BeatmapSet.cs | 21 ++++++++++++++++ osu.Game/Beatmaps/Objects/HitObject.cs | 18 ++++++++++++++ osu.Game/Beatmaps/Samples/SampleBank.cs | 12 ++++++++++ osu.Game/Beatmaps/Samples/SampleInfo.cs | 11 +++++++++ osu.Game/Beatmaps/Samples/SampleSet.cs | 13 ++++++++++ osu.Game/Graphics/Components/FpsDisplay.cs | 28 ++++++++++++++++++++++ osu.Game/Users/User.cs | 17 +++++++++++++ osu.Game/osu.Game.csproj | 7 ++++++ 9 files changed, 144 insertions(+) create mode 100644 osu.Game/Beatmaps/Beatmap.cs create mode 100644 osu.Game/Beatmaps/BeatmapSet.cs create mode 100644 osu.Game/Beatmaps/Objects/HitObject.cs create mode 100644 osu.Game/Beatmaps/Samples/SampleBank.cs create mode 100644 osu.Game/Beatmaps/Samples/SampleInfo.cs create mode 100644 osu.Game/Beatmaps/Samples/SampleSet.cs create mode 100644 osu.Game/Graphics/Components/FpsDisplay.cs create mode 100644 osu.Game/Users/User.cs diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs new file mode 100644 index 0000000000..c666fa9b32 --- /dev/null +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -0,0 +1,17 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using osu.Game.Beatmaps.Objects; +using osu.Game.Users; + +namespace osu.Game.Beatmaps +{ + public class Beatmap + { + public List HitObjects; + + public string Difficulty; + public User Creator; + } +} \ No newline at end of file diff --git a/osu.Game/Beatmaps/BeatmapSet.cs b/osu.Game/Beatmaps/BeatmapSet.cs new file mode 100644 index 0000000000..de886f9375 --- /dev/null +++ b/osu.Game/Beatmaps/BeatmapSet.cs @@ -0,0 +1,21 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using osu.Game.Users; + +namespace osu.Game.Beatmaps +{ + /// + /// A beatmap set contains multiple beatmap (difficulties). + /// + public class BeatmapSet + { + public List Beatmaps { get; protected set; } + + public string Artist; + public string Title; + + public User Creator; + } +} diff --git a/osu.Game/Beatmaps/Objects/HitObject.cs b/osu.Game/Beatmaps/Objects/HitObject.cs new file mode 100644 index 0000000000..1990cfd704 --- /dev/null +++ b/osu.Game/Beatmaps/Objects/HitObject.cs @@ -0,0 +1,18 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Beatmaps.Samples; + +namespace osu.Game.Beatmaps.Objects +{ + /// + /// A hitobject describes a point in a beatmap + /// + public class HitObject + { + public double StartTime; + public double? EndTime; + + public SampleInfo Sample; + } +} diff --git a/osu.Game/Beatmaps/Samples/SampleBank.cs b/osu.Game/Beatmaps/Samples/SampleBank.cs new file mode 100644 index 0000000000..5284712549 --- /dev/null +++ b/osu.Game/Beatmaps/Samples/SampleBank.cs @@ -0,0 +1,12 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Beatmaps.Samples +{ + public enum SampleBank + { + Default = 0, + Custom1 = 1, + Custom2 = 2 + } +} \ No newline at end of file diff --git a/osu.Game/Beatmaps/Samples/SampleInfo.cs b/osu.Game/Beatmaps/Samples/SampleInfo.cs new file mode 100644 index 0000000000..0b595b3d74 --- /dev/null +++ b/osu.Game/Beatmaps/Samples/SampleInfo.cs @@ -0,0 +1,11 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Beatmaps.Samples +{ + public class SampleInfo + { + public SampleBank Bank; + public SampleSet Set; + } +} diff --git a/osu.Game/Beatmaps/Samples/SampleSet.cs b/osu.Game/Beatmaps/Samples/SampleSet.cs new file mode 100644 index 0000000000..db4d9a9f05 --- /dev/null +++ b/osu.Game/Beatmaps/Samples/SampleSet.cs @@ -0,0 +1,13 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Beatmaps.Samples +{ + public enum SampleSet + { + None = 0, + Normal = 1, + Soft = 2, + Drum = 3 + } +} \ No newline at end of file diff --git a/osu.Game/Graphics/Components/FpsDisplay.cs b/osu.Game/Graphics/Components/FpsDisplay.cs new file mode 100644 index 0000000000..c2e5d75059 --- /dev/null +++ b/osu.Game/Graphics/Components/FpsDisplay.cs @@ -0,0 +1,28 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.Containers; + +namespace osu.Game.Graphics.Components +{ + class FpsDisplay : OsuComponent + { + SpriteText fpsText; + public override void Load() + { + base.Load(); + + Add(fpsText = new SpriteText()); + + fpsText.Text = "..."; + } + + protected override void Update() + { + fpsText.Text = ((int)(1000 / Clock.ElapsedFrameTime)).ToString(); + base.Update(); + } + } +} diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs new file mode 100644 index 0000000000..33f9e65d51 --- /dev/null +++ b/osu.Game/Users/User.cs @@ -0,0 +1,17 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace osu.Game.Users +{ + public class User + { + public int Id; + public string Username; + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 5bea3d41f4..2c1a4fa1ba 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -45,6 +45,12 @@ + + + + + + @@ -68,6 +74,7 @@ + From abe8ff21f66973bc918194e3b98ada4e9d728a26 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Aug 2016 13:51:00 +0900 Subject: [PATCH 02/28] Add more timing and sample related classes. --- osu.Game/Beatmaps/Beatmap.cs | 3 +++ osu.Game/Beatmaps/Objects/HitObject.cs | 2 +- osu.Game/Beatmaps/Samples/HitSampleInfo.cs | 10 ++++++++++ osu.Game/Beatmaps/Samples/SampleType.cs | 17 +++++++++++++++++ osu.Game/Beatmaps/Timing/ControlPoint.cs | 16 ++++++++++++++++ osu.Game/Beatmaps/Timing/SampleChange.cs | 17 +++++++++++++++++ osu.Game/Beatmaps/Timing/TimingChange.cs | 18 ++++++++++++++++++ osu.Game/osu.Game.csproj | 5 +++++ 8 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 osu.Game/Beatmaps/Samples/HitSampleInfo.cs create mode 100644 osu.Game/Beatmaps/Samples/SampleType.cs create mode 100644 osu.Game/Beatmaps/Timing/ControlPoint.cs create mode 100644 osu.Game/Beatmaps/Timing/SampleChange.cs create mode 100644 osu.Game/Beatmaps/Timing/TimingChange.cs diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index c666fa9b32..2a6c976a5e 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using osu.Game.Beatmaps.Objects; +using osu.Game.Beatmaps.Timing; using osu.Game.Users; namespace osu.Game.Beatmaps @@ -11,6 +12,8 @@ namespace osu.Game.Beatmaps { public List HitObjects; + public List ControlPoints; + public string Difficulty; public User Creator; } diff --git a/osu.Game/Beatmaps/Objects/HitObject.cs b/osu.Game/Beatmaps/Objects/HitObject.cs index 1990cfd704..703a719716 100644 --- a/osu.Game/Beatmaps/Objects/HitObject.cs +++ b/osu.Game/Beatmaps/Objects/HitObject.cs @@ -13,6 +13,6 @@ namespace osu.Game.Beatmaps.Objects public double StartTime; public double? EndTime; - public SampleInfo Sample; + public HitSampleInfo Sample; } } diff --git a/osu.Game/Beatmaps/Samples/HitSampleInfo.cs b/osu.Game/Beatmaps/Samples/HitSampleInfo.cs new file mode 100644 index 0000000000..4083a528aa --- /dev/null +++ b/osu.Game/Beatmaps/Samples/HitSampleInfo.cs @@ -0,0 +1,10 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Beatmaps.Samples +{ + public class HitSampleInfo : SampleInfo + { + SampleType Type; + } +} diff --git a/osu.Game/Beatmaps/Samples/SampleType.cs b/osu.Game/Beatmaps/Samples/SampleType.cs new file mode 100644 index 0000000000..43499b24e9 --- /dev/null +++ b/osu.Game/Beatmaps/Samples/SampleType.cs @@ -0,0 +1,17 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; + +namespace osu.Game.Beatmaps.Samples +{ + [Flags] + public enum SampleType + { + None = 0, + Normal = 1, + Whistle = 2, + Finish = 4, + Clap = 8 + }; +} \ No newline at end of file diff --git a/osu.Game/Beatmaps/Timing/ControlPoint.cs b/osu.Game/Beatmaps/Timing/ControlPoint.cs new file mode 100644 index 0000000000..89eac572ec --- /dev/null +++ b/osu.Game/Beatmaps/Timing/ControlPoint.cs @@ -0,0 +1,16 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace osu.Game.Beatmaps.Timing +{ + public class ControlPoint + { + public double Time; + } +} diff --git a/osu.Game/Beatmaps/Timing/SampleChange.cs b/osu.Game/Beatmaps/Timing/SampleChange.cs new file mode 100644 index 0000000000..488d8f0a3b --- /dev/null +++ b/osu.Game/Beatmaps/Timing/SampleChange.cs @@ -0,0 +1,17 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Game.Beatmaps.Samples; + +namespace osu.Game.Beatmaps.Timing +{ + class SampleChange : ControlPoint + { + public SampleInfo Sample; + } +} diff --git a/osu.Game/Beatmaps/Timing/TimingChange.cs b/osu.Game/Beatmaps/Timing/TimingChange.cs new file mode 100644 index 0000000000..dd2b9cdc7c --- /dev/null +++ b/osu.Game/Beatmaps/Timing/TimingChange.cs @@ -0,0 +1,18 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace osu.Game.Beatmaps.Timing +{ + class TimingChange : ControlPoint + { + public double BeatLength; + + public double BPM => 60000 / BeatLength; + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2c1a4fa1ba..ecec8032a9 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -48,9 +48,14 @@ + + + + + From ef98e4ee3c67a206e164a5a3d160dbc1c30b5e9c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Aug 2016 13:52:30 +0900 Subject: [PATCH 03/28] Move beatmap metadata to separate class. --- osu.Game/Beatmaps/BeatmapSet.cs | 3 +-- osu.Game/Beatmaps/Metadata.cs | 8 ++++++++ osu.Game/osu.Game.csproj | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 osu.Game/Beatmaps/Metadata.cs diff --git a/osu.Game/Beatmaps/BeatmapSet.cs b/osu.Game/Beatmaps/BeatmapSet.cs index de886f9375..0a9e3335ab 100644 --- a/osu.Game/Beatmaps/BeatmapSet.cs +++ b/osu.Game/Beatmaps/BeatmapSet.cs @@ -13,8 +13,7 @@ namespace osu.Game.Beatmaps { public List Beatmaps { get; protected set; } - public string Artist; - public string Title; + public Metadata Metadata; public User Creator; } diff --git a/osu.Game/Beatmaps/Metadata.cs b/osu.Game/Beatmaps/Metadata.cs new file mode 100644 index 0000000000..db0987b3cf --- /dev/null +++ b/osu.Game/Beatmaps/Metadata.cs @@ -0,0 +1,8 @@ +namespace osu.Game.Beatmaps +{ + public class Metadata + { + public string Artist; + public string Title; + } +} \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ecec8032a9..4d269b3ecf 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -47,6 +47,7 @@ + From 016521240ae0f754fcb6bbccfc8df0655919c9f2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 18:06:36 +0900 Subject: [PATCH 04/28] Add playtest class. --- osu.Game/GameModes/Play/PlayTest.cs | 15 +++++++++++++++ osu.Game/OsuGame.cs | 4 +++- osu.Game/osu.Game.csproj | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 osu.Game/GameModes/Play/PlayTest.cs diff --git a/osu.Game/GameModes/Play/PlayTest.cs b/osu.Game/GameModes/Play/PlayTest.cs new file mode 100644 index 0000000000..2c4c01ce72 --- /dev/null +++ b/osu.Game/GameModes/Play/PlayTest.cs @@ -0,0 +1,15 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.GameModes; + +namespace osu.Game.GameModes.Play +{ + class PlayTest : GameMode + { + public override void Load() + { + base.Load(); + } + } +} diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index c77e4f5c70..f397bbd077 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -13,6 +13,7 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; +using osu.Game.GameModes.Play; namespace osu.Game { @@ -50,7 +51,8 @@ namespace osu.Game //Add(new FontTest()); - Add(new MainMenu()); + //Add(new MainMenu()); + Add(new PlayTest()); Add(new CursorContainer()); } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 4d269b3ecf..1c1d57bb8f 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -62,6 +62,7 @@ + From 7cee44ab1dbbcf896352cf5bd44320074cdad963 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 18:27:38 +0900 Subject: [PATCH 05/28] HitObject -> HitBase. Also add BaseHits for each game mode. --- osu.Game/Beatmaps/Beatmap.cs | 2 +- .../Objects/{HitObject.cs => BaseHit.cs} | 2 +- .../Beatmaps/Objects/Catch/CatchBaseHit.cs | 11 +++++++++++ .../Beatmaps/Objects/Mania/ManiaBaseHit.cs | 11 +++++++++++ osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs | 12 ++++++++++++ .../Beatmaps/Objects/Taiko/TaikoBaseHit.cs | 19 +++++++++++++++++++ osu.Game/GameModes/Play/PlayTest.cs | 11 +++++++++++ osu.Game/osu.Game.csproj | 6 +++++- 8 files changed, 71 insertions(+), 3 deletions(-) rename osu.Game/Beatmaps/Objects/{HitObject.cs => BaseHit.cs} (89%) create mode 100644 osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs create mode 100644 osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs create mode 100644 osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs create mode 100644 osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index 2a6c976a5e..7d1bd48040 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -10,7 +10,7 @@ namespace osu.Game.Beatmaps { public class Beatmap { - public List HitObjects; + public List HitObjects; public List ControlPoints; diff --git a/osu.Game/Beatmaps/Objects/HitObject.cs b/osu.Game/Beatmaps/Objects/BaseHit.cs similarity index 89% rename from osu.Game/Beatmaps/Objects/HitObject.cs rename to osu.Game/Beatmaps/Objects/BaseHit.cs index 703a719716..1be3faa4af 100644 --- a/osu.Game/Beatmaps/Objects/HitObject.cs +++ b/osu.Game/Beatmaps/Objects/BaseHit.cs @@ -8,7 +8,7 @@ namespace osu.Game.Beatmaps.Objects /// /// A hitobject describes a point in a beatmap /// - public class HitObject + public abstract class BaseHit { public double StartTime; public double? EndTime; diff --git a/osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs b/osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs new file mode 100644 index 0000000000..f6adc322a1 --- /dev/null +++ b/osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs @@ -0,0 +1,11 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + + +namespace osu.Game.Beatmaps.Objects.Catch +{ + class CatchBaseHit : BaseHit + { + public float Position; + } +} diff --git a/osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs b/osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs new file mode 100644 index 0000000000..16dfe104ef --- /dev/null +++ b/osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs @@ -0,0 +1,11 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + + +namespace osu.Game.Beatmaps.Objects.Mania +{ + class ManiaBaseHit : BaseHit + { + public int Column; + } +} diff --git a/osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs b/osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs new file mode 100644 index 0000000000..c381f48bb2 --- /dev/null +++ b/osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs @@ -0,0 +1,12 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; + +namespace osu.Game.Beatmaps.Objects +{ + public abstract class OsuHit : BaseHit + { + public Vector2 Position; + } +} diff --git a/osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs b/osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs new file mode 100644 index 0000000000..86140f97f3 --- /dev/null +++ b/osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs @@ -0,0 +1,19 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + + +namespace osu.Game.Beatmaps.Objects.Taiko +{ + class TaikoBaseHit : BaseHit + { + public bool Big; + + public TaikoColour Type; + } + + public enum TaikoColour + { + Red, + Blue + } +} diff --git a/osu.Game/GameModes/Play/PlayTest.cs b/osu.Game/GameModes/Play/PlayTest.cs index 2c4c01ce72..eece0bbd9b 100644 --- a/osu.Game/GameModes/Play/PlayTest.cs +++ b/osu.Game/GameModes/Play/PlayTest.cs @@ -1,7 +1,10 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using osu.Framework.GameModes; +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.Objects; namespace osu.Game.GameModes.Play { @@ -10,6 +13,14 @@ namespace osu.Game.GameModes.Play public override void Load() { base.Load(); + + Beatmap beatmap = new Beatmap(); + + beatmap.HitObjects = new List() + { + new HitObject() { }, + }; + } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 1c1d57bb8f..0a40e232e1 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -48,7 +48,11 @@ - + + + + + From 9d6b19a2eee5c25a205342affb4262e5b3f4fda4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 18:31:32 +0900 Subject: [PATCH 06/28] Add duration to BaseHit. --- osu.Game/Beatmaps/Objects/BaseHit.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Beatmaps/Objects/BaseHit.cs b/osu.Game/Beatmaps/Objects/BaseHit.cs index 1be3faa4af..47aa4c3b18 100644 --- a/osu.Game/Beatmaps/Objects/BaseHit.cs +++ b/osu.Game/Beatmaps/Objects/BaseHit.cs @@ -13,6 +13,8 @@ namespace osu.Game.Beatmaps.Objects public double StartTime; public double? EndTime; + public double Duration => (EndTime ?? StartTime) - StartTime; + public HitSampleInfo Sample; } } From cf12f4764fde8777a08519319cd71ddd116391e9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 18:35:49 +0900 Subject: [PATCH 07/28] Add basic structure for osu! mode objects. --- osu.Game/Beatmaps/Objects/Osu/Circle.cs | 10 ++++++++++ osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs | 4 ++-- osu.Game/Beatmaps/Objects/Osu/Slider.cs | 15 +++++++++++++++ osu.Game/Beatmaps/Objects/Osu/Spinner.cs | 10 ++++++++++ osu.Game/osu.Game.csproj | 3 +++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 osu.Game/Beatmaps/Objects/Osu/Circle.cs create mode 100644 osu.Game/Beatmaps/Objects/Osu/Slider.cs create mode 100644 osu.Game/Beatmaps/Objects/Osu/Spinner.cs diff --git a/osu.Game/Beatmaps/Objects/Osu/Circle.cs b/osu.Game/Beatmaps/Objects/Osu/Circle.cs new file mode 100644 index 0000000000..455bafd1a6 --- /dev/null +++ b/osu.Game/Beatmaps/Objects/Osu/Circle.cs @@ -0,0 +1,10 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + + +namespace osu.Game.Beatmaps.Objects.Osu +{ + public class Circle : OsuBaseHit + { + } +} diff --git a/osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs b/osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs index c381f48bb2..24c702b75b 100644 --- a/osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs +++ b/osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs @@ -3,9 +3,9 @@ using OpenTK; -namespace osu.Game.Beatmaps.Objects +namespace osu.Game.Beatmaps.Objects.Osu { - public abstract class OsuHit : BaseHit + public abstract class OsuBaseHit : BaseHit { public Vector2 Position; } diff --git a/osu.Game/Beatmaps/Objects/Osu/Slider.cs b/osu.Game/Beatmaps/Objects/Osu/Slider.cs new file mode 100644 index 0000000000..fef9cd858c --- /dev/null +++ b/osu.Game/Beatmaps/Objects/Osu/Slider.cs @@ -0,0 +1,15 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using OpenTK; + +namespace osu.Game.Beatmaps.Objects.Osu +{ + public class Slider : OsuBaseHit + { + public List Path; + + public int RepeatCount; + } +} diff --git a/osu.Game/Beatmaps/Objects/Osu/Spinner.cs b/osu.Game/Beatmaps/Objects/Osu/Spinner.cs new file mode 100644 index 0000000000..4aff200c5b --- /dev/null +++ b/osu.Game/Beatmaps/Objects/Osu/Spinner.cs @@ -0,0 +1,10 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + + +namespace osu.Game.Beatmaps.Objects.Osu +{ + public class Spinner + { + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 0a40e232e1..6ca8aaf382 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -51,7 +51,10 @@ + + + From c75d74c84ce851cfb253269468eb082fa1d8ffd9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 18:43:24 +0900 Subject: [PATCH 08/28] Taiko notes should have scale, not bool Big. --- osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs b/osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs index 86140f97f3..8f8c094e6d 100644 --- a/osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs +++ b/osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs @@ -6,7 +6,7 @@ namespace osu.Game.Beatmaps.Objects.Taiko { class TaikoBaseHit : BaseHit { - public bool Big; + public float Scale = 1; public TaikoColour Type; } From 0a0c8e20140f213bfeb642208bec4c122e7247c5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 18:43:46 +0900 Subject: [PATCH 09/28] Fix some base classes not being abstract. --- osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs | 2 +- osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs b/osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs index f6adc322a1..7a1f895335 100644 --- a/osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs +++ b/osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs @@ -4,7 +4,7 @@ namespace osu.Game.Beatmaps.Objects.Catch { - class CatchBaseHit : BaseHit + public abstract class CatchBaseHit : BaseHit { public float Position; } diff --git a/osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs b/osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs index 16dfe104ef..5c8b86a728 100644 --- a/osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs +++ b/osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs @@ -4,7 +4,7 @@ namespace osu.Game.Beatmaps.Objects.Mania { - class ManiaBaseHit : BaseHit + public abstract class ManiaBaseHit : BaseHit { public int Column; } From 49110cf8d8073c4876fdabf01f535d59d6c38822 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 18:44:02 +0900 Subject: [PATCH 10/28] Add mania Note and HoldNote. --- osu.Game/Beatmaps/Objects/Mania/HoldNote.cs | 10 ++++++++++ osu.Game/Beatmaps/Objects/Mania/Note.cs | 10 ++++++++++ osu.Game/osu.Game.csproj | 2 ++ 3 files changed, 22 insertions(+) create mode 100644 osu.Game/Beatmaps/Objects/Mania/HoldNote.cs create mode 100644 osu.Game/Beatmaps/Objects/Mania/Note.cs diff --git a/osu.Game/Beatmaps/Objects/Mania/HoldNote.cs b/osu.Game/Beatmaps/Objects/Mania/HoldNote.cs new file mode 100644 index 0000000000..523f6e4d7a --- /dev/null +++ b/osu.Game/Beatmaps/Objects/Mania/HoldNote.cs @@ -0,0 +1,10 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + + +namespace osu.Game.Beatmaps.Objects.Mania +{ + public class HoldNote : Note + { + } +} diff --git a/osu.Game/Beatmaps/Objects/Mania/Note.cs b/osu.Game/Beatmaps/Objects/Mania/Note.cs new file mode 100644 index 0000000000..21b11f7f52 --- /dev/null +++ b/osu.Game/Beatmaps/Objects/Mania/Note.cs @@ -0,0 +1,10 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + + +namespace osu.Game.Beatmaps.Objects.Mania +{ + public class Note : ManiaBaseHit + { + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 6ca8aaf382..6e3eb3e015 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -50,7 +50,9 @@ + + From ec25a50249de0609b2cc2c8099fe76433d2f3dd5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 18:47:15 +0900 Subject: [PATCH 11/28] Add basic structure for catch mode objects. --- osu.Game/Beatmaps/Objects/Catch/Droplet.cs | 10 ++++++++++ osu.Game/Beatmaps/Objects/Catch/Fruit.cs | 10 ++++++++++ osu.Game/osu.Game.csproj | 2 ++ 3 files changed, 22 insertions(+) create mode 100644 osu.Game/Beatmaps/Objects/Catch/Droplet.cs create mode 100644 osu.Game/Beatmaps/Objects/Catch/Fruit.cs diff --git a/osu.Game/Beatmaps/Objects/Catch/Droplet.cs b/osu.Game/Beatmaps/Objects/Catch/Droplet.cs new file mode 100644 index 0000000000..7f68f2125b --- /dev/null +++ b/osu.Game/Beatmaps/Objects/Catch/Droplet.cs @@ -0,0 +1,10 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + + +namespace osu.Game.Beatmaps.Objects.Catch +{ + public class Droplet : CatchBaseHit + { + } +} diff --git a/osu.Game/Beatmaps/Objects/Catch/Fruit.cs b/osu.Game/Beatmaps/Objects/Catch/Fruit.cs new file mode 100644 index 0000000000..f8b74722bd --- /dev/null +++ b/osu.Game/Beatmaps/Objects/Catch/Fruit.cs @@ -0,0 +1,10 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + + +namespace osu.Game.Beatmaps.Objects.Catch +{ + public class Fruit : CatchBaseHit + { + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 6e3eb3e015..bd2bbf130a 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -50,6 +50,8 @@ + + From 2ea5a5c675edf1faf0a94d3ace36c53ac6d8d864 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 19:25:13 +0900 Subject: [PATCH 12/28] Add basic HitRenderer framework. --- osu-framework | 2 +- osu.Game/GameModes/Play/HitRenderer.cs | 14 ++++ osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs | 76 +++++++++++++++++++ osu.Game/GameModes/Play/PlayTest.cs | 34 +++++++-- osu.Game/osu.Game.csproj | 2 + 5 files changed, 122 insertions(+), 6 deletions(-) create mode 100644 osu.Game/GameModes/Play/HitRenderer.cs create mode 100644 osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs diff --git a/osu-framework b/osu-framework index 907c74a83c..ea125b07f3 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 907c74a83cf68208e1bb959ea4a3332ebbd03a22 +Subproject commit ea125b07f36cb1f77666fd4f2bd888138f7a5032 diff --git a/osu.Game/GameModes/Play/HitRenderer.cs b/osu.Game/GameModes/Play/HitRenderer.cs new file mode 100644 index 0000000000..65869541f9 --- /dev/null +++ b/osu.Game/GameModes/Play/HitRenderer.cs @@ -0,0 +1,14 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using osu.Framework.Graphics.Containers; +using osu.Game.Beatmaps.Objects; + +namespace osu.Game.GameModes.Play +{ + public abstract class HitRenderer : LargeContainer + { + public abstract List Objects { get; set; } + } +} diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs new file mode 100644 index 0000000000..aa2fbe6881 --- /dev/null +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -0,0 +1,76 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Transformations; +using osu.Game.Beatmaps.Objects; +using osu.Game.Beatmaps.Objects.Osu; +using OpenTK; + +namespace osu.Game.GameModes.Play.Osu +{ + public class OsuHitRenderer : HitRenderer + { + List objects; + private OsuPlayfield playfield; + + public override List Objects + { + get + { + return objects.ConvertAll(o => (BaseHit)o); + } + + set + { + //osu! mode requires all objects to be of OsuBaseHit type. + objects = value.ConvertAll(o => (OsuBaseHit)o); + + if (Parent != null) + Load(); + } + } + + public override void Load() + { + base.Load(); + + if (playfield == null) + Add(playfield = new OsuPlayfield()); + else + playfield.Clear(); + + if (objects == null) return; + + foreach (OsuBaseHit h in objects) + { + //render stuff! + Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) + { + Origin = Anchor.Centre, + Scale = 0.2f, + Alpha = 0, + Position = h.Position + }; + + s.Transformations.Add(new TransformAlpha(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 0, EndValue = 1 }); + s.Transformations.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + + playfield.Add(s); + } + } + } + + public class OsuPlayfield : Container + { + public OsuPlayfield() + { + Size = new Vector2(512, 384); + Anchor = Anchor.Centre; + Origin = Anchor.Centre; + } + } +} diff --git a/osu.Game/GameModes/Play/PlayTest.cs b/osu.Game/GameModes/Play/PlayTest.cs index eece0bbd9b..3b5bd9ea92 100644 --- a/osu.Game/GameModes/Play/PlayTest.cs +++ b/osu.Game/GameModes/Play/PlayTest.cs @@ -5,22 +5,46 @@ using System.Collections.Generic; using osu.Framework.GameModes; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Objects; +using osu.Game.Beatmaps.Objects.Osu; +using osu.Game.GameModes.Play.Osu; +using OpenTK; namespace osu.Game.GameModes.Play { - class PlayTest : GameMode + public class PlayTest : GameMode { public override void Load() { base.Load(); - Beatmap beatmap = new Beatmap(); - - beatmap.HitObjects = new List() + Beatmap beatmap = new Beatmap { - new HitObject() { }, + HitObjects = new List() + { + new Circle() + { + StartTime = 500, + Position = new Vector2(0, 0) + }, + new Circle() + { + StartTime = 1000, + Position = new Vector2(512, 0) + }, + new Circle() + { + StartTime = 1500, + Position = new Vector2(512, 384) + }, + new Circle() + { + StartTime = 2000, + Position = new Vector2(0, 384) + }, + } }; + Add(new OsuHitRenderer() { Objects = beatmap.HitObjects }); } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index bd2bbf130a..816ff50147 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -73,6 +73,8 @@ + + From 677a1b0e56e47ef8a9b194689e25d7de632b65d5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 19:49:57 +0900 Subject: [PATCH 13/28] Add basic box background to OsuPlayfield. --- osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs index aa2fbe6881..de8137be6c 100644 --- a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Transformations; using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; @@ -72,5 +73,12 @@ namespace osu.Game.GameModes.Play.Osu Anchor = Anchor.Centre; Origin = Anchor.Centre; } + + public override void Load() + { + base.Load(); + + Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); + } } } From 93744f737242b52849b2f089fad0c54f290ab4d5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 19:50:22 +0900 Subject: [PATCH 14/28] Add basic TaikoHitRenderer. --- osu.Game/GameModes/Play/PlayTest.cs | 10 +- .../GameModes/Play/Taiko/TaikoHitRenderer.cs | 116 ++++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 3 files changed, 123 insertions(+), 4 deletions(-) create mode 100644 osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs diff --git a/osu.Game/GameModes/Play/PlayTest.cs b/osu.Game/GameModes/Play/PlayTest.cs index 3b5bd9ea92..55e3065fd8 100644 --- a/osu.Game/GameModes/Play/PlayTest.cs +++ b/osu.Game/GameModes/Play/PlayTest.cs @@ -7,6 +7,7 @@ using osu.Game.Beatmaps; using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; using osu.Game.GameModes.Play.Osu; +using osu.Game.GameModes.Play.Taiko; using OpenTK; namespace osu.Game.GameModes.Play @@ -23,28 +24,29 @@ namespace osu.Game.GameModes.Play { new Circle() { - StartTime = 500, + StartTime = 1500, Position = new Vector2(0, 0) }, new Circle() { - StartTime = 1000, + StartTime = 2000, Position = new Vector2(512, 0) }, new Circle() { - StartTime = 1500, + StartTime = 2500, Position = new Vector2(512, 384) }, new Circle() { - StartTime = 2000, + StartTime = 3000, Position = new Vector2(0, 384) }, } }; Add(new OsuHitRenderer() { Objects = beatmap.HitObjects }); + Add(new TaikoHitRenderer() { Objects = beatmap.HitObjects }); } } } diff --git a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs new file mode 100644 index 0000000000..a12faf59b2 --- /dev/null +++ b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs @@ -0,0 +1,116 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Drawables; +using osu.Framework.Graphics.Transformations; +using osu.Game.Beatmaps.Objects; +using osu.Game.Beatmaps.Objects.Osu; +using osu.Game.Beatmaps.Objects.Taiko; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.GameModes.Play.Taiko +{ + public class TaikoHitRenderer : HitRenderer + { + List objects; + private TaikoPlayfield playfield; + + public override List Objects + { + get + { + return objects.ConvertAll(o => (BaseHit)o); + } + + set + { + //osu! mode requires all objects to be of TaikoBaseHit type. + objects = value.ConvertAll(convertForTaiko); + + if (Parent != null) + Load(); + } + } + + private TaikoBaseHit convertForTaiko(BaseHit input) + { + TaikoBaseHit h = input as TaikoBaseHit; + + if (h == null) + { + OsuBaseHit o = input as OsuBaseHit; + + if (o == null) throw new Exception(@"Can't convert!"); + + h = new TaikoBaseHit() + { + StartTime = o.StartTime + }; + } + + return h; + } + + public override void Load() + { + base.Load(); + + if (playfield == null) + Add(playfield = new TaikoPlayfield()); + else + playfield.Clear(); + + if (objects == null) return; + + foreach (TaikoBaseHit h in objects) + { + //render stuff! + Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) + { + Origin = Anchor.Centre, + Scale = 0.2f, + PositionMode = InheritMode.XY, + Position = new Vector2(1.1f, 0.5f) + }; + + s.Transformations.Add(new TransformPosition(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(1.1f, 0.5f), EndValue = new Vector2(0.1f, 0.5f) }); + s.Transformations.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + + playfield.Add(s); + } + } + } + + public class TaikoPlayfield : Container + { + public TaikoPlayfield() + { + SizeMode = InheritMode.X; + Size = new Vector2(1, 100); + Anchor = Anchor.Centre; + Origin = Anchor.Centre; + } + + public override void Load() + { + base.Load(); + + Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); + + Add(new Sprite(Game.Textures.Get(@"menu-osu")) + { + Origin = Anchor.Centre, + Scale = 0.2f, + PositionMode = InheritMode.XY, + Position = new Vector2(0.1f, 0.5f), + Colour = Color4.Gray + }); + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 816ff50147..b4225dbfb4 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -76,6 +76,7 @@ + From 024ae1d1c24496dba500b4e7598ed812ac7a894c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 19:58:57 +0900 Subject: [PATCH 15/28] Move playfields to own class. --- osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs | 20 ---------- osu.Game/GameModes/Play/Osu/OsuPlayfield.cs | 27 +++++++++++++ .../GameModes/Play/Taiko/TaikoHitRenderer.cs | 30 -------------- .../GameModes/Play/Taiko/TaikoPlayfield.cs | 39 +++++++++++++++++++ osu.Game/osu.Game.csproj | 2 + 5 files changed, 68 insertions(+), 50 deletions(-) create mode 100644 osu.Game/GameModes/Play/Osu/OsuPlayfield.cs create mode 100644 osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs index de8137be6c..2850ca912a 100644 --- a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -4,12 +4,9 @@ using System.Collections.Generic; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Transformations; using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; -using OpenTK; namespace osu.Game.GameModes.Play.Osu { @@ -64,21 +61,4 @@ namespace osu.Game.GameModes.Play.Osu } } } - - public class OsuPlayfield : Container - { - public OsuPlayfield() - { - Size = new Vector2(512, 384); - Anchor = Anchor.Centre; - Origin = Anchor.Centre; - } - - public override void Load() - { - base.Load(); - - Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); - } - } } diff --git a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs new file mode 100644 index 0000000000..d8290c0ffa --- /dev/null +++ b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs @@ -0,0 +1,27 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Drawables; +using OpenTK; + +namespace osu.Game.GameModes.Play.Osu +{ + public class OsuPlayfield : Container + { + public OsuPlayfield() + { + Size = new Vector2(512, 384); + Anchor = Anchor.Centre; + Origin = Anchor.Centre; + } + + public override void Load() + { + base.Load(); + + Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); + } + } +} \ No newline at end of file diff --git a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs index a12faf59b2..13b6004ff6 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs @@ -5,14 +5,11 @@ using System; using System.Collections.Generic; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Transformations; using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; using osu.Game.Beatmaps.Objects.Taiko; using OpenTK; -using OpenTK.Graphics; namespace osu.Game.GameModes.Play.Taiko { @@ -86,31 +83,4 @@ namespace osu.Game.GameModes.Play.Taiko } } } - - public class TaikoPlayfield : Container - { - public TaikoPlayfield() - { - SizeMode = InheritMode.X; - Size = new Vector2(1, 100); - Anchor = Anchor.Centre; - Origin = Anchor.Centre; - } - - public override void Load() - { - base.Load(); - - Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); - - Add(new Sprite(Game.Textures.Get(@"menu-osu")) - { - Origin = Anchor.Centre, - Scale = 0.2f, - PositionMode = InheritMode.XY, - Position = new Vector2(0.1f, 0.5f), - Colour = Color4.Gray - }); - } - } } diff --git a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs new file mode 100644 index 0000000000..09388249cf --- /dev/null +++ b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs @@ -0,0 +1,39 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Drawables; +using osu.Framework.Graphics.Sprites; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.GameModes.Play.Taiko +{ + public class TaikoPlayfield : Container + { + public TaikoPlayfield() + { + SizeMode = InheritMode.X; + Size = new Vector2(1, 100); + Anchor = Anchor.Centre; + Origin = Anchor.Centre; + } + + public override void Load() + { + base.Load(); + + Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); + + Add(new Sprite(Game.Textures.Get(@"menu-osu")) + { + Origin = Anchor.Centre, + Scale = 0.2f, + PositionMode = InheritMode.XY, + Position = new Vector2(0.1f, 0.5f), + Colour = Color4.Gray + }); + } + } +} \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b4225dbfb4..1bd72749bb 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -75,8 +75,10 @@ + + From 97d101310df5fbfecc8c2d182b90b68f270e2ce2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 20:07:27 +0900 Subject: [PATCH 16/28] Make OsuPlayfield box a bit larger. --- osu.Game/GameModes/Play/Osu/OsuPlayfield.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs index d8290c0ffa..926502a11e 100644 --- a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs +++ b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs @@ -21,7 +21,14 @@ namespace osu.Game.GameModes.Play.Osu { base.Load(); - Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); + Add(new Box() + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + SizeMode = InheritMode.XY, + Size = new Vector2(1.3f, 1.3f), + Alpha = 0.5f + }); } } } \ No newline at end of file From 9e76feb159e54006b539dbf333c66d3f1a28cedf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Sep 2016 20:30:27 +0900 Subject: [PATCH 17/28] Add remaining HitRenderers. Many general improvements. --- .../GameModes/Play/Catch/CatchHitRenderer.cs | 87 +++++++++++++++++ .../GameModes/Play/Catch/CatchPlayfield.cs | 30 ++++++ osu.Game/GameModes/Play/HitRenderer.cs | 10 ++ .../GameModes/Play/Mania/ManiaHitRenderer.cs | 93 +++++++++++++++++++ .../GameModes/Play/Mania/ManiaPlayfield.cs | 44 +++++++++ osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs | 2 +- osu.Game/GameModes/Play/Osu/OsuPlayfield.cs | 2 +- osu.Game/GameModes/Play/PlayTest.cs | 75 ++++++++++----- osu.Game/GameModes/Play/Playfield.cs | 16 ++++ .../GameModes/Play/Taiko/TaikoHitRenderer.cs | 2 +- .../GameModes/Play/Taiko/TaikoPlayfield.cs | 2 +- osu.Game/osu.Game.csproj | 5 + 12 files changed, 339 insertions(+), 29 deletions(-) create mode 100644 osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs create mode 100644 osu.Game/GameModes/Play/Catch/CatchPlayfield.cs create mode 100644 osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs create mode 100644 osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs create mode 100644 osu.Game/GameModes/Play/Playfield.cs diff --git a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs new file mode 100644 index 0000000000..a8a2cab9fe --- /dev/null +++ b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs @@ -0,0 +1,87 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Transformations; +using osu.Game.Beatmaps.Objects; +using osu.Game.Beatmaps.Objects.Osu; +using osu.Game.Beatmaps.Objects.Catch; +using OpenTK; + +namespace osu.Game.GameModes.Play.Catch +{ + public class CatchHitRenderer : HitRenderer + { + List objects; + private CatchPlayfield playfield; + + public override List Objects + { + get + { + return objects.ConvertAll(o => (BaseHit)o); + } + + set + { + //osu! mode requires all objects to be of CatchBaseHit type. + objects = value.ConvertAll(convertForCatch); + + if (Parent != null) + Load(); + } + } + + private CatchBaseHit convertForCatch(BaseHit input) + { + CatchBaseHit h = input as CatchBaseHit; + + if (h == null) + { + OsuBaseHit o = input as OsuBaseHit; + + if (o == null) throw new Exception(@"Can't convert!"); + + h = new Fruit() + { + StartTime = o.StartTime, + Position = o.Position.X + }; + } + + return h; + } + + public override void Load() + { + base.Load(); + + if (playfield == null) + Add(playfield = new CatchPlayfield()); + else + playfield.Clear(); + + if (objects == null) return; + + foreach (CatchBaseHit h in objects) + { + //render stuff! + Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) + { + Origin = Anchor.Centre, + Scale = 0.1f, + PositionMode = InheritMode.Y, + Position = new Vector2(h.Position, -0.1f) + }; + + s.Transformations.Add(new TransformPosition(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) }); + s.Transformations.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + + playfield.Add(s); + } + } + } +} diff --git a/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs new file mode 100644 index 0000000000..74721233c3 --- /dev/null +++ b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs @@ -0,0 +1,30 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Drawables; +using osu.Framework.Graphics.Sprites; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.GameModes.Play.Catch +{ + public class CatchPlayfield : Playfield + { + public CatchPlayfield() + { + SizeMode = InheritMode.Y; + Size = new Vector2(512, 0.9f); + Anchor = Anchor.BottomCentre; + Origin = Anchor.BottomCentre; + } + + public override void Load() + { + base.Load(); + + Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); + } + } +} \ No newline at end of file diff --git a/osu.Game/GameModes/Play/HitRenderer.cs b/osu.Game/GameModes/Play/HitRenderer.cs index 65869541f9..dca6850ab4 100644 --- a/osu.Game/GameModes/Play/HitRenderer.cs +++ b/osu.Game/GameModes/Play/HitRenderer.cs @@ -2,7 +2,10 @@ //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Batches; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Drawables; using osu.Game.Beatmaps.Objects; namespace osu.Game.GameModes.Play @@ -10,5 +13,12 @@ namespace osu.Game.GameModes.Play public abstract class HitRenderer : LargeContainer { public abstract List Objects { get; set; } + + public override void Load() + { + base.Load(); + + Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.1f, Scale = 0.99f }); + } } } diff --git a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs new file mode 100644 index 0000000000..4803f7a549 --- /dev/null +++ b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs @@ -0,0 +1,93 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Transformations; +using osu.Game.Beatmaps.Objects; +using osu.Game.Beatmaps.Objects.Osu; +using osu.Game.Beatmaps.Objects.Mania; +using OpenTK; + +namespace osu.Game.GameModes.Play.Mania +{ + public class ManiaHitRenderer : HitRenderer + { + private readonly int columns; + List objects; + private ManiaPlayfield playfield; + + public ManiaHitRenderer(int columns = 5) + { + this.columns = columns; + } + + public override List Objects + { + get + { + return objects.ConvertAll(o => (BaseHit)o); + } + + set + { + //osu! mode requires all objects to be of ManiaBaseHit type. + objects = value.ConvertAll(convertForMania); + + if (Parent != null) + Load(); + } + } + + private ManiaBaseHit convertForMania(BaseHit input) + { + ManiaBaseHit h = input as ManiaBaseHit; + + if (h == null) + { + OsuBaseHit o = input as OsuBaseHit; + + if (o == null) throw new Exception(@"Can't convert!"); + + h = new Note() + { + StartTime = o.StartTime, + Column = (int)Math.Round(o.Position.X / 512 * columns) + }; + } + + return h; + } + + public override void Load() + { + base.Load(); + + if (playfield == null) + Add(playfield = new ManiaPlayfield(columns)); + else + playfield.Clear(); + + if (objects == null) return; + + foreach (ManiaBaseHit h in objects) + { + //render stuff! + Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) + { + Origin = Anchor.Centre, + Scale = 0.1f, + PositionMode = InheritMode.XY, + Position = new Vector2((float)(h.Column + 0.5) / columns, -0.1f) + }; + + s.Transformations.Add(new TransformPositionY(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = -0.1f, EndValue = 0.9f }); + s.Transformations.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + + playfield.Add(s); + } + } + } +} diff --git a/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs b/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs new file mode 100644 index 0000000000..81639e237f --- /dev/null +++ b/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs @@ -0,0 +1,44 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Drawables; +using osu.Framework.Graphics.Sprites; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.GameModes.Play.Mania +{ + public class ManiaPlayfield : Playfield + { + private readonly int columns; + + public ManiaPlayfield(int columns) + { + this.columns = columns; + SizeMode = InheritMode.XY; + Size = new Vector2(columns / 20f, 1f); + Anchor = Anchor.BottomCentre; + Origin = Anchor.BottomCentre; + } + + public override void Load() + { + base.Load(); + + Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); + + for (int i = 0; i < columns; i++) + Add(new Box() + { + SizeMode = InheritMode.Y, + Size = new Vector2(2, 1), + PositionMode = InheritMode.XY, + Position = new Vector2((float)i / columns, 0), + Alpha = 0.5f, + Colour = Color4.Black + }); + } + } +} \ No newline at end of file diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs index 2850ca912a..1f1496b2a2 100644 --- a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -49,7 +49,7 @@ namespace osu.Game.GameModes.Play.Osu Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) { Origin = Anchor.Centre, - Scale = 0.2f, + Scale = 0.1f, Alpha = 0, Position = h.Position }; diff --git a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs index 926502a11e..63421b03da 100644 --- a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs +++ b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs @@ -8,7 +8,7 @@ using OpenTK; namespace osu.Game.GameModes.Play.Osu { - public class OsuPlayfield : Container + public class OsuPlayfield : Playfield { public OsuPlayfield() { diff --git a/osu.Game/GameModes/Play/PlayTest.cs b/osu.Game/GameModes/Play/PlayTest.cs index 55e3065fd8..8d35b8f1fe 100644 --- a/osu.Game/GameModes/Play/PlayTest.cs +++ b/osu.Game/GameModes/Play/PlayTest.cs @@ -3,11 +3,15 @@ using System.Collections.Generic; using osu.Framework.GameModes; +using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; +using osu.Game.GameModes.Play.Catch; using osu.Game.GameModes.Play.Osu; using osu.Game.GameModes.Play.Taiko; +using osu.Framework.Graphics; +using osu.Game.GameModes.Play.Mania; using OpenTK; namespace osu.Game.GameModes.Play @@ -18,35 +22,56 @@ namespace osu.Game.GameModes.Play { base.Load(); + List objects = new List(); + + int time = 0; + for (int i = 0; i < 100; i++) + { + objects.Add(new Circle() + { + StartTime = time, + Position = new Vector2(RNG.Next(0, 512), RNG.Next(0, 384)) + }); + + time += RNG.Next(50, 500); + } + Beatmap beatmap = new Beatmap { - HitObjects = new List() - { - new Circle() - { - StartTime = 1500, - Position = new Vector2(0, 0) - }, - new Circle() - { - StartTime = 2000, - Position = new Vector2(512, 0) - }, - new Circle() - { - StartTime = 2500, - Position = new Vector2(512, 384) - }, - new Circle() - { - StartTime = 3000, - Position = new Vector2(0, 384) - }, - } + HitObjects = objects }; - Add(new OsuHitRenderer() { Objects = beatmap.HitObjects }); - Add(new TaikoHitRenderer() { Objects = beatmap.HitObjects }); + Add(new OsuHitRenderer() + { + Objects = beatmap.HitObjects, + Scale = 0.5f, + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft + }); + + Add(new TaikoHitRenderer() + { + Objects = beatmap.HitObjects, + Scale = 0.5f, + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight + }); + + Add(new CatchHitRenderer() + { + Objects = beatmap.HitObjects, + Scale = 0.5f, + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft + }); + + Add(new ManiaHitRenderer() + { + Objects = beatmap.HitObjects, + Scale = 0.5f, + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight + }); } } } diff --git a/osu.Game/GameModes/Play/Playfield.cs b/osu.Game/GameModes/Play/Playfield.cs new file mode 100644 index 0000000000..7503731ff0 --- /dev/null +++ b/osu.Game/GameModes/Play/Playfield.cs @@ -0,0 +1,16 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Framework.Graphics.Containers; + +namespace osu.Game.GameModes.Play +{ + public class Playfield : MaskingContainer + { + } +} diff --git a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs index 13b6004ff6..e2b8f38673 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs @@ -76,7 +76,7 @@ namespace osu.Game.GameModes.Play.Taiko Position = new Vector2(1.1f, 0.5f) }; - s.Transformations.Add(new TransformPosition(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(1.1f, 0.5f), EndValue = new Vector2(0.1f, 0.5f) }); + s.Transformations.Add(new TransformPositionX(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 1.1f, EndValue = 0.1f }); s.Transformations.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); playfield.Add(s); diff --git a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs index 09388249cf..53121ec6ad 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs @@ -10,7 +10,7 @@ using OpenTK.Graphics; namespace osu.Game.GameModes.Play.Taiko { - public class TaikoPlayfield : Container + public class TaikoPlayfield : Playfield { public TaikoPlayfield() { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 1bd72749bb..b8eff1dc45 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -73,10 +73,15 @@ + + + + + From 753a67fb3dd096b2ddc3379e1b9f6e0e0429d49e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 3 Sep 2016 16:17:15 +0900 Subject: [PATCH 18/28] Update to use new transform logic. --- osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs | 4 ++-- osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs | 4 ++-- osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs | 4 ++-- osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs index a8a2cab9fe..b398dcc194 100644 --- a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs +++ b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs @@ -77,8 +77,8 @@ namespace osu.Game.GameModes.Play.Catch Position = new Vector2(h.Position, -0.1f) }; - s.Transformations.Add(new TransformPosition(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) }); - s.Transformations.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + s.Transforms.Add(new TransformPosition(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) }); + s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); playfield.Add(s); } diff --git a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs index 4803f7a549..85b3aef2f1 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs @@ -83,8 +83,8 @@ namespace osu.Game.GameModes.Play.Mania Position = new Vector2((float)(h.Column + 0.5) / columns, -0.1f) }; - s.Transformations.Add(new TransformPositionY(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = -0.1f, EndValue = 0.9f }); - s.Transformations.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + s.Transforms.Add(new TransformPositionY(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = -0.1f, EndValue = 0.9f }); + s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); playfield.Add(s); } diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs index 1f1496b2a2..b529efdc5a 100644 --- a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -54,8 +54,8 @@ namespace osu.Game.GameModes.Play.Osu Position = h.Position }; - s.Transformations.Add(new TransformAlpha(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 0, EndValue = 1 }); - s.Transformations.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 0, EndValue = 1 }); + s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); playfield.Add(s); } diff --git a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs index e2b8f38673..576dbcf591 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs @@ -76,8 +76,8 @@ namespace osu.Game.GameModes.Play.Taiko Position = new Vector2(1.1f, 0.5f) }; - s.Transformations.Add(new TransformPositionX(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 1.1f, EndValue = 0.1f }); - s.Transformations.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + s.Transforms.Add(new TransformPositionX(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 1.1f, EndValue = 0.1f }); + s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); playfield.Add(s); } From 842fb1892f76a97687c1998a02fefa5b42eb913a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Sep 2016 02:23:26 +0900 Subject: [PATCH 19/28] Update to latest framework version. --- osu-framework | 2 +- osu.Game/GameModes/FieldTest.cs | 2 +- osu.Game/GameModes/FontTest.cs | 3 ++- osu.Game/GameModes/Menu/ButtonSystem.cs | 12 ++++++------ osu.Game/Graphics/Processing/RatioAdjust.cs | 4 ++-- osu.Game/Graphics/UserInterface/TextBox.cs | 2 +- osu.Game/OsuGame.cs | 8 ++++---- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/osu-framework b/osu-framework index 1b97dd48c3..0576492962 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 1b97dd48c3efa59f97907d7868f007c999686e66 +Subproject commit 0576492962ac9fd80b46706ae5a78be9e99ae1b5 diff --git a/osu.Game/GameModes/FieldTest.cs b/osu.Game/GameModes/FieldTest.cs index a27698cdc1..58df93eee3 100644 --- a/osu.Game/GameModes/FieldTest.cs +++ b/osu.Game/GameModes/FieldTest.cs @@ -122,7 +122,7 @@ namespace osu.Game.GameModes protected override bool OnClick(InputState state) { - Scale = 1.5f; + Scale = new Vector2(1.5f); ScaleTo(1, 500, EasingTypes.In); Activated?.Invoke(); diff --git a/osu.Game/GameModes/FontTest.cs b/osu.Game/GameModes/FontTest.cs index 2617b3ee19..a24acd73c8 100644 --- a/osu.Game/GameModes/FontTest.cs +++ b/osu.Game/GameModes/FontTest.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics.Containers; +using OpenTK; namespace osu.Game.GameModes { @@ -36,7 +37,7 @@ namespace osu.Game.GameModes SpriteText text = new SpriteText() { Text = $@"Font testy at size {i}", - Scale = i + Scale = new Vector2(i) }; flow.Add(text); diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs index 897c1655d4..acee3e35b8 100644 --- a/osu.Game/GameModes/Menu/ButtonSystem.cs +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -279,7 +279,7 @@ namespace osu.Game.GameModes.Menu private MenuVisualisation vis; private Action clickAction; - public float SizeForFlow => logo == null ? 0 : logo.ActualSize.X * logo.Scale * logoBounceContainer.Scale * 0.8f; + public float SizeForFlow => logo == null ? 0 : logo.ActualSize.X * logo.Scale.X * logoBounceContainer.Scale.X * 0.8f; public override void Load() { @@ -424,7 +424,7 @@ namespace osu.Game.GameModes.Menu Anchor = Anchor.Centre, Origin = Anchor.Centre, Colour = colour, - VectorScale = new Vector2(0, 1) + Scale = new Vector2(0, 1) }); iconText = new AutoSizeContainer @@ -440,7 +440,7 @@ namespace osu.Game.GameModes.Menu { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Scale = 0.7f, + Scale = new Vector2(0.7f), }; iconText.Add(icon); @@ -588,8 +588,8 @@ namespace osu.Game.GameModes.Menu protected override void Update() { - HandleInput = state != ButtonState.Exploded && box.VectorScale.X >= 0.8f; - iconText.Alpha = MathHelper.Clamp((box.VectorScale.X - 0.5f) / 0.3f, 0, 1); + HandleInput = state != ButtonState.Exploded && box.Scale.X >= 0.8f; + iconText.Alpha = MathHelper.Clamp((box.Scale.X - 0.5f) / 0.3f, 0, 1); base.Update(); } @@ -663,7 +663,7 @@ namespace osu.Game.GameModes.Menu Quad q = base.DrawQuad; //Will become infinite if we don't limit its maximum size. - float wedge = Math.Min(q.Width, wedgeWidth / Scale / VectorScale.X); + float wedge = Math.Min(q.Width, wedgeWidth / Scale.X); q.TopLeft.X += wedge; q.BottomRight.X -= wedge; diff --git a/osu.Game/Graphics/Processing/RatioAdjust.cs b/osu.Game/Graphics/Processing/RatioAdjust.cs index 6aeb9dbb9d..2f3a7d3a2a 100644 --- a/osu.Game/Graphics/Processing/RatioAdjust.cs +++ b/osu.Game/Graphics/Processing/RatioAdjust.cs @@ -12,8 +12,8 @@ namespace osu.Game.Graphics.Processing protected override void Update() { base.Update(); - Scale = Parent.ActualSize.Y / 768f; - Size = new Vector2(1 / Scale); + Scale = new Vector2(Parent.ActualSize.Y / 768f); + Size = new Vector2(1 / Scale.X); } } } diff --git a/osu.Game/Graphics/UserInterface/TextBox.cs b/osu.Game/Graphics/UserInterface/TextBox.cs index a9551a10c0..9a1fc58ebb 100644 --- a/osu.Game/Graphics/UserInterface/TextBox.cs +++ b/osu.Game/Graphics/UserInterface/TextBox.cs @@ -70,8 +70,8 @@ namespace osu.Game.Graphics.UserInterface SizeMode = InheritMode.Y, Alpha = 0 }; - TextContainer.Add(cursor); + TextContainer.Add(cursor); TextContainer.Add(textFlow); } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index c77e4f5c70..084e4410e8 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -46,7 +46,7 @@ namespace osu.Game //}; //API.Queue(req); - AddProcessingContainer(new RatioAdjust()); + AddProcessing(new RatioAdjust()); //Add(new FontTest()); @@ -62,10 +62,10 @@ namespace osu.Game base.Dispose(isDisposing); } - public override bool Invalidate(bool affectsSize = true, bool affectsPosition = true, Drawable source = null) + public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) { - if (!base.Invalidate(affectsSize, affectsPosition, source)) return false; - + if (!base.Invalidate(invalidation, source, shallPropagate)) return false; + if (Parent != null) { Parent.Width = Config.Set(OsuConfig.Width, ActualSize.X).Value; From 851ef4fbbf1fdccec9839c99d8b5c65893896ba9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Sep 2016 02:27:42 +0900 Subject: [PATCH 20/28] Framework updates. --- osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs | 2 +- osu.Game/GameModes/Play/HitRenderer.cs | 3 ++- osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs | 2 +- osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs | 3 ++- osu.Game/GameModes/Play/PlayTest.cs | 8 ++++---- osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs | 2 +- osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs index b398dcc194..86fa222541 100644 --- a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs +++ b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs @@ -72,7 +72,7 @@ namespace osu.Game.GameModes.Play.Catch Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) { Origin = Anchor.Centre, - Scale = 0.1f, + Scale = new Vector2(0.1f), PositionMode = InheritMode.Y, Position = new Vector2(h.Position, -0.1f) }; diff --git a/osu.Game/GameModes/Play/HitRenderer.cs b/osu.Game/GameModes/Play/HitRenderer.cs index dca6850ab4..e09fb0e923 100644 --- a/osu.Game/GameModes/Play/HitRenderer.cs +++ b/osu.Game/GameModes/Play/HitRenderer.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Batches; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Drawables; using osu.Game.Beatmaps.Objects; +using OpenTK; namespace osu.Game.GameModes.Play { @@ -18,7 +19,7 @@ namespace osu.Game.GameModes.Play { base.Load(); - Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.1f, Scale = 0.99f }); + Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.1f, Scale = new Vector2(0.99f) }); } } } diff --git a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs index 85b3aef2f1..85715b37bb 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs @@ -78,7 +78,7 @@ namespace osu.Game.GameModes.Play.Mania Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) { Origin = Anchor.Centre, - Scale = 0.1f, + Scale = new Vector2(0.1f), PositionMode = InheritMode.XY, Position = new Vector2((float)(h.Column + 0.5) / columns, -0.1f) }; diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs index b529efdc5a..8646e4a07c 100644 --- a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Transformations; using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; +using OpenTK; namespace osu.Game.GameModes.Play.Osu { @@ -49,7 +50,7 @@ namespace osu.Game.GameModes.Play.Osu Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) { Origin = Anchor.Centre, - Scale = 0.1f, + Scale = new Vector2(0.1f), Alpha = 0, Position = h.Position }; diff --git a/osu.Game/GameModes/Play/PlayTest.cs b/osu.Game/GameModes/Play/PlayTest.cs index 8d35b8f1fe..82ee295995 100644 --- a/osu.Game/GameModes/Play/PlayTest.cs +++ b/osu.Game/GameModes/Play/PlayTest.cs @@ -44,7 +44,7 @@ namespace osu.Game.GameModes.Play Add(new OsuHitRenderer() { Objects = beatmap.HitObjects, - Scale = 0.5f, + Scale = new Vector2(0.5f), Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft }); @@ -52,7 +52,7 @@ namespace osu.Game.GameModes.Play Add(new TaikoHitRenderer() { Objects = beatmap.HitObjects, - Scale = 0.5f, + Scale = new Vector2(0.5f), Anchor = Anchor.TopRight, Origin = Anchor.TopRight }); @@ -60,7 +60,7 @@ namespace osu.Game.GameModes.Play Add(new CatchHitRenderer() { Objects = beatmap.HitObjects, - Scale = 0.5f, + Scale = new Vector2(0.5f), Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }); @@ -68,7 +68,7 @@ namespace osu.Game.GameModes.Play Add(new ManiaHitRenderer() { Objects = beatmap.HitObjects, - Scale = 0.5f, + Scale = new Vector2(0.5f), Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight }); diff --git a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs index 576dbcf591..41b35bcb48 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs @@ -71,7 +71,7 @@ namespace osu.Game.GameModes.Play.Taiko Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) { Origin = Anchor.Centre, - Scale = 0.2f, + Scale = new Vector2(0.2f), PositionMode = InheritMode.XY, Position = new Vector2(1.1f, 0.5f) }; diff --git a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs index 53121ec6ad..62f81224b5 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs @@ -29,7 +29,7 @@ namespace osu.Game.GameModes.Play.Taiko Add(new Sprite(Game.Textures.Get(@"menu-osu")) { Origin = Anchor.Centre, - Scale = 0.2f, + Scale = new Vector2(0.2f), PositionMode = InheritMode.XY, Position = new Vector2(0.1f, 0.5f), Colour = Color4.Gray From 36ae4dd2715f911d0d649c7e133ae7392b0f6558 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Sep 2016 23:58:02 +0900 Subject: [PATCH 21/28] Fix osu! playfield (was using inheriting sizemode when it shouldn't). --- osu.Game/GameModes/Play/Osu/OsuPlayfield.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs index 63421b03da..4deb012a09 100644 --- a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs +++ b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs @@ -12,6 +12,7 @@ namespace osu.Game.GameModes.Play.Osu { public OsuPlayfield() { + SizeMode = InheritMode.None; Size = new Vector2(512, 384); Anchor = Anchor.Centre; Origin = Anchor.Centre; @@ -26,7 +27,6 @@ namespace osu.Game.GameModes.Play.Osu Anchor = Anchor.Centre, Origin = Anchor.Centre, SizeMode = InheritMode.XY, - Size = new Vector2(1.3f, 1.3f), Alpha = 0.5f }); } From f1688499e41bb76b926c5c748f3601595f608c12 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 21 Sep 2016 13:12:05 +0900 Subject: [PATCH 22/28] Bring framework up-to-date. --- osu-framework | 2 +- osu.Game/GameModes/Menu/ButtonSystem.cs | 10 ++++++---- osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs | 3 ++- osu.Game/GameModes/Play/Catch/CatchPlayfield.cs | 2 +- osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs | 3 ++- osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs | 3 ++- osu.Game/GameModes/Play/Playfield.cs | 7 +------ osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs | 3 ++- osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs | 5 +++-- 9 files changed, 20 insertions(+), 18 deletions(-) diff --git a/osu-framework b/osu-framework index 0ca3fe2b5d..556bf7e3c1 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 0ca3fe2b5d20f9aa71ef8a65cd9a676d5d3035e3 +Subproject commit 556bf7e3c1f50cac0b9924300eaf97ecae4aece7 diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs index 75fec4bdbf..b4cbb9cf96 100644 --- a/osu.Game/GameModes/Menu/ButtonSystem.cs +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -298,14 +298,16 @@ namespace osu.Game.GameModes.Menu { Children = new Drawable[] { - logo = new Sprite(Game.Textures.Get(@"menu-osu")) + logo = new Sprite { - Anchor = Anchor.Centre, + Texture = Game.Textures.Get(@"menu-osu"), + Anchor = Anchor.Centre, Origin = Anchor.Centre }, - ripple = new Sprite(Game.Textures.Get(@"menu-osu")) + ripple = new Sprite { - Anchor = Anchor.Centre, + Texture = Game.Textures.Get(@"menu-osu"), + Anchor = Anchor.Centre, Origin = Anchor.Centre, Alpha = 0.4f }, diff --git a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs index 86fa222541..76580826b0 100644 --- a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs +++ b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs @@ -69,8 +69,9 @@ namespace osu.Game.GameModes.Play.Catch foreach (CatchBaseHit h in objects) { //render stuff! - Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) + Sprite s = new Sprite { + Texture = Game.Textures.Get(@"menu-osu"), Origin = Anchor.Centre, Scale = new Vector2(0.1f), PositionMode = InheritMode.Y, diff --git a/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs index 74721233c3..5f148f7606 100644 --- a/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs +++ b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs @@ -24,7 +24,7 @@ namespace osu.Game.GameModes.Play.Catch { base.Load(); - Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); + Add(new Box { SizeMode = InheritMode.XY, Alpha = 0.5f }); } } } \ No newline at end of file diff --git a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs index 85715b37bb..44e0bb53c8 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs @@ -75,8 +75,9 @@ namespace osu.Game.GameModes.Play.Mania foreach (ManiaBaseHit h in objects) { //render stuff! - Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) + Sprite s = new Sprite { + Texture = Game.Textures.Get(@"menu-osu"), Origin = Anchor.Centre, Scale = new Vector2(0.1f), PositionMode = InheritMode.XY, diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs index 8646e4a07c..7754e3976d 100644 --- a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -47,8 +47,9 @@ namespace osu.Game.GameModes.Play.Osu foreach (OsuBaseHit h in objects) { //render stuff! - Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) + Sprite s = new Sprite { + Texture = Game.Textures.Get(@"menu-osu"), Origin = Anchor.Centre, Scale = new Vector2(0.1f), Alpha = 0, diff --git a/osu.Game/GameModes/Play/Playfield.cs b/osu.Game/GameModes/Play/Playfield.cs index 7503731ff0..331ce41f7a 100644 --- a/osu.Game/GameModes/Play/Playfield.cs +++ b/osu.Game/GameModes/Play/Playfield.cs @@ -1,16 +1,11 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using osu.Framework.Graphics.Containers; namespace osu.Game.GameModes.Play { - public class Playfield : MaskingContainer + public class Playfield : Container { } } diff --git a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs index 41b35bcb48..a5958f7bc1 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs @@ -68,8 +68,9 @@ namespace osu.Game.GameModes.Play.Taiko foreach (TaikoBaseHit h in objects) { //render stuff! - Sprite s = new Sprite(Game.Textures.Get(@"menu-osu")) + Sprite s = new Sprite { + Texture = Game.Textures.Get(@"menu-osu"), Origin = Anchor.Centre, Scale = new Vector2(0.2f), PositionMode = InheritMode.XY, diff --git a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs index 62f81224b5..03c33c2c9b 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs @@ -24,10 +24,11 @@ namespace osu.Game.GameModes.Play.Taiko { base.Load(); - Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); + Add(new Box { SizeMode = InheritMode.XY, Alpha = 0.5f }); - Add(new Sprite(Game.Textures.Get(@"menu-osu")) + Add(new Sprite { + Texture = Game.Textures.Get(@"menu-osu"), Origin = Anchor.Centre, Scale = new Vector2(0.2f), PositionMode = InheritMode.XY, From 1712a142a526f71b855b65b38ad7e159c1421973 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 21 Sep 2016 13:12:15 +0900 Subject: [PATCH 23/28] Add proper HitObject expiration. --- osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs | 1 + osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs | 1 + osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs | 1 + osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs | 1 + 4 files changed, 4 insertions(+) diff --git a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs index 76580826b0..ff0eb4307c 100644 --- a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs +++ b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs @@ -80,6 +80,7 @@ namespace osu.Game.GameModes.Play.Catch s.Transforms.Add(new TransformPosition(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) }); s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + s.Expire(true); playfield.Add(s); } diff --git a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs index 44e0bb53c8..8f6810c4d9 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs @@ -86,6 +86,7 @@ namespace osu.Game.GameModes.Play.Mania s.Transforms.Add(new TransformPositionY(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = -0.1f, EndValue = 0.9f }); s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + s.Expire(true); playfield.Add(s); } diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs index 7754e3976d..453c894efb 100644 --- a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -58,6 +58,7 @@ namespace osu.Game.GameModes.Play.Osu s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 0, EndValue = 1 }); s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + s.Expire(true); playfield.Add(s); } diff --git a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs index a5958f7bc1..5ff78a4700 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs @@ -79,6 +79,7 @@ namespace osu.Game.GameModes.Play.Taiko s.Transforms.Add(new TransformPositionX(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 1.1f, EndValue = 0.1f }); s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + s.Expire(true); playfield.Add(s); } From 3a5f37444cda4ed8fd2cd43dfb870a2ee59d11a6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 21 Sep 2016 13:21:55 +0900 Subject: [PATCH 24/28] Add back Playfield masking. --- osu.Game/GameModes/Play/Playfield.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/GameModes/Play/Playfield.cs b/osu.Game/GameModes/Play/Playfield.cs index 331ce41f7a..41a73472d8 100644 --- a/osu.Game/GameModes/Play/Playfield.cs +++ b/osu.Game/GameModes/Play/Playfield.cs @@ -7,5 +7,11 @@ namespace osu.Game.GameModes.Play { public class Playfield : Container { + public override void Load() + { + base.Load(); + + Masking = true; + } } } From 33e46facec88246dfd952a5117dafcc18db39f27 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 21 Sep 2016 13:25:23 +0900 Subject: [PATCH 25/28] Use children for initialisation. --- osu.Game/GameModes/Play/PlayTest.cs | 60 ++++++++++++++--------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/osu.Game/GameModes/Play/PlayTest.cs b/osu.Game/GameModes/Play/PlayTest.cs index 82ee295995..988ddbbd70 100644 --- a/osu.Game/GameModes/Play/PlayTest.cs +++ b/osu.Game/GameModes/Play/PlayTest.cs @@ -41,37 +41,37 @@ namespace osu.Game.GameModes.Play HitObjects = objects }; - Add(new OsuHitRenderer() + Children = new Drawable[] { - Objects = beatmap.HitObjects, - Scale = new Vector2(0.5f), - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft - }); - - Add(new TaikoHitRenderer() - { - Objects = beatmap.HitObjects, - Scale = new Vector2(0.5f), - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight - }); - - Add(new CatchHitRenderer() - { - Objects = beatmap.HitObjects, - Scale = new Vector2(0.5f), - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft - }); - - Add(new ManiaHitRenderer() - { - Objects = beatmap.HitObjects, - Scale = new Vector2(0.5f), - Anchor = Anchor.BottomRight, - Origin = Anchor.BottomRight - }); + new OsuHitRenderer + { + Objects = beatmap.HitObjects, + Scale = new Vector2(0.5f), + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft + }, + new TaikoHitRenderer + { + Objects = beatmap.HitObjects, + Scale = new Vector2(0.5f), + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight + }, + new CatchHitRenderer + { + Objects = beatmap.HitObjects, + Scale = new Vector2(0.5f), + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft + }, + new ManiaHitRenderer + { + Objects = beatmap.HitObjects, + Scale = new Vector2(0.5f), + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight + } + }; } } } From ae100e3137ca626c90dbbac82da2eed4eef1f661 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 25 Sep 2016 13:59:38 +0900 Subject: [PATCH 26/28] Move PlayTest to the VisualTests project. --- .../Tests/TestCaseGamefield.cs | 42 +++++++++++++------ .../osu.Desktop.VisualTests.csproj | 1 + osu.Game/osu.Game.csproj | 1 - 3 files changed, 31 insertions(+), 13 deletions(-) rename osu.Game/GameModes/Play/PlayTest.cs => osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs (70%) diff --git a/osu.Game/GameModes/Play/PlayTest.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs similarity index 70% rename from osu.Game/GameModes/Play/PlayTest.cs rename to osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index 988ddbbd70..ac133163d0 100644 --- a/osu.Game/GameModes/Play/PlayTest.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -1,30 +1,42 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; -using osu.Framework.GameModes; +using OpenTK; +using osu.Framework.GameModes.Testing; +using osu.Framework.Graphics; using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; using osu.Game.GameModes.Play.Catch; +using osu.Game.GameModes.Play.Mania; using osu.Game.GameModes.Play.Osu; using osu.Game.GameModes.Play.Taiko; -using osu.Framework.Graphics; -using osu.Game.GameModes.Play.Mania; -using OpenTK; +using System.Collections.Generic; +using osu.Framework.Timing; -namespace osu.Game.GameModes.Play +namespace osu.Desktop.Tests { - public class PlayTest : GameMode + class TestCaseGamefield : TestCase { - public override void Load() + public override string Name => @"Gamefield"; + + public override string Description => @"Showing hitobjects and what not."; + + FramedOffsetClock localClock; + + protected override IFrameBasedClock Clock => localClock; + + public override void Reset() { - base.Load(); + base.Reset(); + + ///create a new clock offset to 0. + localClock = new FramedOffsetClock(base.Clock) { Offset = -base.Clock.CurrentTime }; List objects = new List(); - int time = 0; + int time = 500; for (int i = 0; i < 100; i++) { objects.Add(new Circle() @@ -41,7 +53,7 @@ namespace osu.Game.GameModes.Play HitObjects = objects }; - Children = new Drawable[] + Add(new Drawable[] { new OsuHitRenderer { @@ -71,7 +83,13 @@ namespace osu.Game.GameModes.Play Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight } - }; + }); + } + + protected override void Update() + { + base.Update(); + localClock.ProcessFrame(); } } } diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 4430339937..393559a257 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -147,6 +147,7 @@ + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 9d2a741dcd..3f0d806845 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -79,7 +79,6 @@ - From f0284ce57cc1825c928376aea3e468db607b7af1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 26 Sep 2016 15:07:29 +0900 Subject: [PATCH 27/28] Use the old naming style for now. --- osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs | 2 +- osu.Game/Beatmaps/Beatmap.cs | 2 +- osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs | 2 +- osu.Game/Beatmaps/Objects/{BaseHit.cs => HitObject.cs} | 2 +- osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs | 2 +- osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs | 2 +- osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs | 2 +- osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs | 6 +++--- osu.Game/GameModes/Play/HitRenderer.cs | 2 +- osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs | 6 +++--- osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs | 4 ++-- osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs | 6 +++--- osu.Game/osu.Game.csproj | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) rename osu.Game/Beatmaps/Objects/{BaseHit.cs => HitObject.cs} (89%) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index ac133163d0..2786cecd44 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -34,7 +34,7 @@ namespace osu.Desktop.Tests ///create a new clock offset to 0. localClock = new FramedOffsetClock(base.Clock) { Offset = -base.Clock.CurrentTime }; - List objects = new List(); + List objects = new List(); int time = 500; for (int i = 0; i < 100; i++) diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index 7d1bd48040..2a6c976a5e 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -10,7 +10,7 @@ namespace osu.Game.Beatmaps { public class Beatmap { - public List HitObjects; + public List HitObjects; public List ControlPoints; diff --git a/osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs b/osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs index 27f3b06b75..590bd8f5b3 100644 --- a/osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs +++ b/osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs @@ -3,7 +3,7 @@ namespace osu.Game.Beatmaps.Objects.Catch { - public abstract class CatchBaseHit : BaseHit + public abstract class CatchBaseHit : HitObject { public float Position; } diff --git a/osu.Game/Beatmaps/Objects/BaseHit.cs b/osu.Game/Beatmaps/Objects/HitObject.cs similarity index 89% rename from osu.Game/Beatmaps/Objects/BaseHit.cs rename to osu.Game/Beatmaps/Objects/HitObject.cs index 47aa4c3b18..74636d0a6f 100644 --- a/osu.Game/Beatmaps/Objects/BaseHit.cs +++ b/osu.Game/Beatmaps/Objects/HitObject.cs @@ -8,7 +8,7 @@ namespace osu.Game.Beatmaps.Objects /// /// A hitobject describes a point in a beatmap /// - public abstract class BaseHit + public abstract class HitObject { public double StartTime; public double? EndTime; diff --git a/osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs b/osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs index 25070dc453..d3fe475c6f 100644 --- a/osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs +++ b/osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs @@ -3,7 +3,7 @@ namespace osu.Game.Beatmaps.Objects.Mania { - public abstract class ManiaBaseHit : BaseHit + public abstract class ManiaBaseHit : HitObject { public int Column; } diff --git a/osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs b/osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs index 24c702b75b..8224bb7dc9 100644 --- a/osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs +++ b/osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs @@ -5,7 +5,7 @@ using OpenTK; namespace osu.Game.Beatmaps.Objects.Osu { - public abstract class OsuBaseHit : BaseHit + public abstract class OsuBaseHit : HitObject { public Vector2 Position; } diff --git a/osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs b/osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs index 51797bca86..ddd8375204 100644 --- a/osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs +++ b/osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs @@ -3,7 +3,7 @@ namespace osu.Game.Beatmaps.Objects.Taiko { - class TaikoBaseHit : BaseHit + class TaikoBaseHit : HitObject { public float Scale = 1; diff --git a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs index ff0eb4307c..4927166ef5 100644 --- a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs +++ b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs @@ -18,11 +18,11 @@ namespace osu.Game.GameModes.Play.Catch List objects; private CatchPlayfield playfield; - public override List Objects + public override List Objects { get { - return objects.ConvertAll(o => (BaseHit)o); + return objects.ConvertAll(o => (HitObject)o); } set @@ -35,7 +35,7 @@ namespace osu.Game.GameModes.Play.Catch } } - private CatchBaseHit convertForCatch(BaseHit input) + private CatchBaseHit convertForCatch(HitObject input) { CatchBaseHit h = input as CatchBaseHit; diff --git a/osu.Game/GameModes/Play/HitRenderer.cs b/osu.Game/GameModes/Play/HitRenderer.cs index e09fb0e923..77015946c5 100644 --- a/osu.Game/GameModes/Play/HitRenderer.cs +++ b/osu.Game/GameModes/Play/HitRenderer.cs @@ -13,7 +13,7 @@ namespace osu.Game.GameModes.Play { public abstract class HitRenderer : LargeContainer { - public abstract List Objects { get; set; } + public abstract List Objects { get; set; } public override void Load() { diff --git a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs index 8f6810c4d9..a873a810b4 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs @@ -24,11 +24,11 @@ namespace osu.Game.GameModes.Play.Mania this.columns = columns; } - public override List Objects + public override List Objects { get { - return objects.ConvertAll(o => (BaseHit)o); + return objects.ConvertAll(o => (HitObject)o); } set @@ -41,7 +41,7 @@ namespace osu.Game.GameModes.Play.Mania } } - private ManiaBaseHit convertForMania(BaseHit input) + private ManiaBaseHit convertForMania(HitObject input) { ManiaBaseHit h = input as ManiaBaseHit; diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs index 453c894efb..bd9294035d 100644 --- a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -16,11 +16,11 @@ namespace osu.Game.GameModes.Play.Osu List objects; private OsuPlayfield playfield; - public override List Objects + public override List Objects { get { - return objects.ConvertAll(o => (BaseHit)o); + return objects.ConvertAll(o => (HitObject)o); } set diff --git a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs index 5ff78a4700..772c7fcb16 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs @@ -18,11 +18,11 @@ namespace osu.Game.GameModes.Play.Taiko List objects; private TaikoPlayfield playfield; - public override List Objects + public override List Objects { get { - return objects.ConvertAll(o => (BaseHit)o); + return objects.ConvertAll(o => (HitObject)o); } set @@ -35,7 +35,7 @@ namespace osu.Game.GameModes.Play.Taiko } } - private TaikoBaseHit convertForTaiko(BaseHit input) + private TaikoBaseHit convertForTaiko(HitObject input) { TaikoBaseHit h = input as TaikoBaseHit; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 3f0d806845..f1fe6c5847 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -48,7 +48,7 @@ - + From aad58532ec43782abde541623d57b6344e78d838 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Sep 2016 15:49:47 +0900 Subject: [PATCH 28/28] Remove getter on Objects. --- osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs | 5 ----- osu.Game/GameModes/Play/HitRenderer.cs | 2 +- osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs | 5 ----- osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs | 5 ----- osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs | 5 ----- 5 files changed, 1 insertion(+), 21 deletions(-) diff --git a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs index 4927166ef5..645354629f 100644 --- a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs +++ b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs @@ -20,11 +20,6 @@ namespace osu.Game.GameModes.Play.Catch public override List Objects { - get - { - return objects.ConvertAll(o => (HitObject)o); - } - set { //osu! mode requires all objects to be of CatchBaseHit type. diff --git a/osu.Game/GameModes/Play/HitRenderer.cs b/osu.Game/GameModes/Play/HitRenderer.cs index 77015946c5..3268789a6a 100644 --- a/osu.Game/GameModes/Play/HitRenderer.cs +++ b/osu.Game/GameModes/Play/HitRenderer.cs @@ -13,7 +13,7 @@ namespace osu.Game.GameModes.Play { public abstract class HitRenderer : LargeContainer { - public abstract List Objects { get; set; } + public abstract List Objects { set; } public override void Load() { diff --git a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs index a873a810b4..551d94d2b6 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs @@ -26,11 +26,6 @@ namespace osu.Game.GameModes.Play.Mania public override List Objects { - get - { - return objects.ConvertAll(o => (HitObject)o); - } - set { //osu! mode requires all objects to be of ManiaBaseHit type. diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs index bd9294035d..8dd49807c0 100644 --- a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -18,11 +18,6 @@ namespace osu.Game.GameModes.Play.Osu public override List Objects { - get - { - return objects.ConvertAll(o => (HitObject)o); - } - set { //osu! mode requires all objects to be of OsuBaseHit type. diff --git a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs index 772c7fcb16..e1d3b2e5aa 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs @@ -20,11 +20,6 @@ namespace osu.Game.GameModes.Play.Taiko public override List Objects { - get - { - return objects.ConvertAll(o => (HitObject)o); - } - set { //osu! mode requires all objects to be of TaikoBaseHit type.