mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 05:52:54 +08:00
Merge pull request #8592 from peppy/update-animation-usage
Update usages of Animation and Video in line with framework changes
This commit is contained in:
commit
9c688a5b83
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="RiderProjectSettingsUpdater">
|
<component name="RiderProjectSettingsUpdater">
|
||||||
<option name="vcsConfiguration" value="1" />
|
<option name="vcsConfiguration" value="2" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -52,6 +52,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.403.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.403.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.402.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.403.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -384,7 +384,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
currentCatcher.Show();
|
currentCatcher.Show();
|
||||||
(currentCatcher.Drawable as IAnimation)?.GotoFrame(0);
|
(currentCatcher.Drawable as IFramedAnimation)?.GotoFrame(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void beginTrail()
|
private void beginTrail()
|
||||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
// This animation is discarded and re-queried with the appropriate frame length afterwards.
|
// This animation is discarded and re-queried with the appropriate frame length afterwards.
|
||||||
var tmp = skin.GetAnimation(imageName, true, false);
|
var tmp = skin.GetAnimation(imageName, true, false);
|
||||||
double frameLength = 0;
|
double frameLength = 0;
|
||||||
if (tmp is IAnimation tmpAnimation && tmpAnimation.FrameCount > 0)
|
if (tmp is IFramedAnimation tmpAnimation && tmpAnimation.FrameCount > 0)
|
||||||
frameLength = Math.Max(1000 / 60.0, 170.0 / tmpAnimation.FrameCount);
|
frameLength = Math.Max(1000 / 60.0, 170.0 / tmpAnimation.FrameCount);
|
||||||
|
|
||||||
explosion = skin.GetAnimation(imageName, true, false, startAtCurrentTime: true, frameLength: frameLength).With(d =>
|
explosion = skin.GetAnimation(imageName, true, false, startAtCurrentTime: true, frameLength: frameLength).With(d =>
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
{
|
{
|
||||||
private readonly string filename;
|
private readonly string filename;
|
||||||
private readonly bool drawFallbackGradient;
|
private readonly bool drawFallbackGradient;
|
||||||
private VideoSprite video;
|
private Video video;
|
||||||
|
|
||||||
private ManualClock manualClock;
|
private ManualClock manualClock;
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
|
|
||||||
if (stream != null)
|
if (stream != null)
|
||||||
{
|
{
|
||||||
InternalChild = video = new VideoSprite(stream, false)
|
InternalChild = video = new Video(stream, false)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
|
@ -270,10 +270,9 @@ namespace osu.Game.Screens.Menu
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
InternalChild = new VideoSprite(videoStream, false)
|
InternalChild = new Video(videoStream, false)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Clock = new FramedOffsetClock(Clock) { Offset = -logo_1 }
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Animations;
|
using osu.Framework.Graphics.Animations;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Timing;
|
|
||||||
|
|
||||||
namespace osu.Game.Skinning
|
namespace osu.Game.Skinning
|
||||||
{
|
{
|
||||||
@ -28,7 +27,7 @@ namespace osu.Game.Skinning
|
|||||||
var animation = new SkinnableTextureAnimation(startAtCurrentTime)
|
var animation = new SkinnableTextureAnimation(startAtCurrentTime)
|
||||||
{
|
{
|
||||||
DefaultFrameLength = frameLength ?? getFrameLength(source, applyConfigFrameRate, textures),
|
DefaultFrameLength = frameLength ?? getFrameLength(source, applyConfigFrameRate, textures),
|
||||||
Repeat = looping,
|
Loop = looping,
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var t in textures)
|
foreach (var t in textures)
|
||||||
@ -71,7 +70,10 @@ namespace osu.Game.Skinning
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
if (timeReference != null)
|
if (timeReference != null)
|
||||||
Clock = new FramedOffsetClock(timeReference.Clock) { Offset = -timeReference.AnimationStartTime };
|
{
|
||||||
|
Clock = timeReference.Clock;
|
||||||
|
PlaybackPosition = timeReference.AnimationStartTime - timeReference.Clock.CurrentTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
Animation = animation;
|
Animation = animation;
|
||||||
Origin = animation.Origin;
|
Origin = animation.Origin;
|
||||||
Position = animation.InitialPosition;
|
Position = animation.InitialPosition;
|
||||||
Repeat = animation.LoopType == AnimationLoopType.LoopForever;
|
Loop = animation.LoopType == AnimationLoopType.LoopForever;
|
||||||
|
|
||||||
LifetimeStart = animation.StartTime;
|
LifetimeStart = animation.StartTime;
|
||||||
LifetimeEnd = animation.EndTime;
|
LifetimeEnd = animation.EndTime;
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Graphics.Video;
|
using osu.Framework.Graphics.Video;
|
||||||
using osu.Framework.Timing;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
|
||||||
namespace osu.Game.Storyboards.Drawables
|
namespace osu.Game.Storyboards.Drawables
|
||||||
@ -16,7 +15,7 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
public class DrawableStoryboardVideo : CompositeDrawable
|
public class DrawableStoryboardVideo : CompositeDrawable
|
||||||
{
|
{
|
||||||
public readonly StoryboardVideo Video;
|
public readonly StoryboardVideo Video;
|
||||||
private VideoSprite videoSprite;
|
private Video video;
|
||||||
|
|
||||||
public override bool RemoveWhenNotAlive => false;
|
public override bool RemoveWhenNotAlive => false;
|
||||||
|
|
||||||
@ -40,14 +39,14 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
if (stream == null)
|
if (stream == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
InternalChild = videoSprite = new VideoSprite(stream, false)
|
InternalChild = video = new Video(stream, false)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
Clock = new FramedOffsetClock(Clock) { Offset = -Video.StartTime }
|
PlaybackPosition = Video.StartTime
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,10 +54,10 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
if (videoSprite == null) return;
|
if (video == null) return;
|
||||||
|
|
||||||
using (videoSprite.BeginAbsoluteSequence(0))
|
using (video.BeginAbsoluteSequence(0))
|
||||||
videoSprite.FadeIn(500);
|
video.FadeIn(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
|
<PackageReference Include="ppy.osu.Framework" Version="2020.403.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.403.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.403.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.402.0" />
|
|
||||||
<PackageReference Include="Sentry" Version="2.1.1" />
|
<PackageReference Include="Sentry" Version="2.1.1" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
|
@ -70,8 +70,8 @@
|
|||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.403.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.403.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.403.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.402.0" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||||
<ItemGroup Label="Transitive Dependencies">
|
<ItemGroup Label="Transitive Dependencies">
|
||||||
@ -79,7 +79,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.402.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.403.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user