mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 11:07:19 +08:00
Merge pull request #132 from peppy/general-fixes
General fixes & framework update.
This commit is contained in:
commit
627cd12a9e
@ -1 +1 @@
|
||||
Subproject commit 2b9a56e8b3bb6c99bf4c75307639e6726fe8d3ec
|
||||
Subproject commit 6650f7fbbcbfb29489e378e73cb4f3b1042384bd
|
@ -46,13 +46,10 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
Add(new Player
|
||||
{
|
||||
Beatmap = new WorkingBeatmap
|
||||
Beatmap = new WorkingBeatmap(new Beatmap
|
||||
{
|
||||
Beatmap = new Beatmap
|
||||
{
|
||||
HitObjects = objects
|
||||
}
|
||||
}
|
||||
HitObjects = objects
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Additive = true,
|
||||
BlendingMode = BlendingMode.Additive,
|
||||
Alpha = 0.5f,
|
||||
}
|
||||
};
|
||||
@ -203,7 +203,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Additive = true;
|
||||
BlendingMode = BlendingMode.Additive;
|
||||
Alpha = 0;
|
||||
|
||||
Children = new Framework.Graphics.Drawable[]
|
||||
@ -225,7 +225,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Additive = true;
|
||||
BlendingMode = BlendingMode.Additive;
|
||||
Alpha = 0;
|
||||
|
||||
Children = new Framework.Graphics.Drawable[]
|
||||
@ -296,7 +296,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable
|
||||
},
|
||||
triangles = new Triangles
|
||||
{
|
||||
Additive = true,
|
||||
BlendingMode = BlendingMode.Additive,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
};
|
||||
|
@ -13,6 +13,11 @@ namespace osu.Game.Beatmaps.Timing
|
||||
{
|
||||
public double BeatLength;
|
||||
|
||||
public TimingChange(double beatLength)
|
||||
{
|
||||
BeatLength = beatLength;
|
||||
}
|
||||
|
||||
public double BPM => 60000 / BeatLength;
|
||||
}
|
||||
}
|
||||
|
@ -12,9 +12,12 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
public class WorkingBeatmap : IDisposable
|
||||
{
|
||||
public BeatmapInfo BeatmapInfo;
|
||||
public readonly BeatmapInfo BeatmapInfo;
|
||||
|
||||
public readonly ArchiveReader Reader;
|
||||
public readonly BeatmapSetInfo BeatmapSetInfo;
|
||||
private readonly BeatmapDatabase database;
|
||||
|
||||
private ArchiveReader reader => database.GetReader(BeatmapSetInfo);
|
||||
|
||||
private Beatmap beatmap;
|
||||
public Beatmap Beatmap
|
||||
@ -25,7 +28,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
try
|
||||
{
|
||||
using (var stream = new StreamReader(Reader.ReadFile(BeatmapInfo.Path)))
|
||||
using (var stream = new StreamReader(reader.ReadFile(BeatmapInfo.Path)))
|
||||
beatmap = BeatmapDecoder.GetDecoder(stream)?.Decode(stream);
|
||||
}
|
||||
catch { }
|
||||
@ -44,7 +47,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
try
|
||||
{
|
||||
var trackData = Reader.ReadFile(BeatmapInfo.Metadata.AudioFile);
|
||||
var trackData = reader.ReadFile(BeatmapInfo.Metadata.AudioFile);
|
||||
if (trackData != null)
|
||||
track = new AudioTrackBass(trackData);
|
||||
}
|
||||
@ -55,10 +58,16 @@ namespace osu.Game.Beatmaps
|
||||
set { track = value; }
|
||||
}
|
||||
|
||||
public WorkingBeatmap(BeatmapInfo beatmapInfo = null, ArchiveReader reader = null)
|
||||
public WorkingBeatmap(Beatmap beatmap)
|
||||
{
|
||||
this.beatmap = beatmap;
|
||||
}
|
||||
|
||||
public WorkingBeatmap(BeatmapInfo beatmapInfo, BeatmapSetInfo beatmapSetInfo, BeatmapDatabase database)
|
||||
{
|
||||
this.BeatmapInfo = beatmapInfo;
|
||||
Reader = reader;
|
||||
this.BeatmapSetInfo = beatmapSetInfo;
|
||||
this.database = database;
|
||||
}
|
||||
|
||||
private bool isDisposed;
|
||||
@ -68,7 +77,7 @@ namespace osu.Game.Beatmaps
|
||||
if (!isDisposed)
|
||||
{
|
||||
track?.Dispose();
|
||||
Reader?.Dispose();
|
||||
reader?.Dispose();
|
||||
isDisposed = true;
|
||||
}
|
||||
}
|
||||
|
@ -149,12 +149,10 @@ namespace osu.Game.Database
|
||||
if (beatmapSetInfo == null)
|
||||
throw new InvalidOperationException($@"Beatmap set {beatmapInfo.BeatmapSetID} is not in the local database.");
|
||||
|
||||
var reader = GetReader(beatmapSetInfo);
|
||||
|
||||
if (beatmapInfo.Metadata == null)
|
||||
beatmapInfo.Metadata = beatmapSetInfo.Metadata;
|
||||
|
||||
var working = new WorkingBeatmap(beatmapInfo, reader);
|
||||
var working = new WorkingBeatmap(beatmapInfo, beatmapSetInfo, this);
|
||||
|
||||
previous?.TransferTo(working);
|
||||
|
||||
|
@ -91,7 +91,7 @@ namespace osu.Game.GameModes
|
||||
Origin = Anchor.Centre,
|
||||
Colour = getColourFor(GetType()),
|
||||
Alpha = 1,
|
||||
Additive = false
|
||||
BlendingMode = BlendingMode.Additive,
|
||||
},
|
||||
textContainer = new Container
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ namespace osu.Game.GameModes.Menu
|
||||
logo = new OsuLogo()
|
||||
{
|
||||
Alpha = 0,
|
||||
Additive = true,
|
||||
BlendingMode = BlendingMode.Additive,
|
||||
Interactive = false,
|
||||
Colour = Color4.DarkGray,
|
||||
Ripple = false
|
||||
|
@ -83,7 +83,7 @@ namespace osu.Game.GameModes.Menu
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Additive = true,
|
||||
BlendingMode = BlendingMode.Additive,
|
||||
Alpha = 0.05f
|
||||
}
|
||||
}
|
||||
@ -93,7 +93,7 @@ namespace osu.Game.GameModes.Menu
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = logo.Size,
|
||||
Additive = true,
|
||||
BlendingMode = BlendingMode.Additive,
|
||||
Alpha = 0.2f,
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
|
||||
namespace osu.Game.Graphics.Background
|
||||
{
|
||||
@ -27,8 +26,6 @@ namespace osu.Game.Graphics.Background
|
||||
Depth = float.MinValue;
|
||||
}
|
||||
|
||||
Texture texture;
|
||||
|
||||
protected override void Load(BaseGame game)
|
||||
{
|
||||
base.Load(game);
|
||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Overlays
|
||||
new ScrollContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ScrollDraggerOnLeft = true,
|
||||
ScrollDraggerAnchor = Anchor.TopLeft,
|
||||
Children = new[]
|
||||
{
|
||||
new FlowContainer
|
||||
|
@ -66,7 +66,7 @@ namespace osu.Game.Overlays
|
||||
HoverBackground = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Additive = true,
|
||||
BlendingMode = BlendingMode.Additive,
|
||||
Colour = new Color4(60, 60, 60, 255),
|
||||
Alpha = 0,
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user