1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 20:33:08 +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:
Dean Herbert 2020-04-03 22:22:31 +09:00 committed by GitHub
commit 9c688a5b83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 22 additions and 22 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="vcsConfiguration" value="1" />
<option name="vcsConfiguration" value="2" />
</component>
</project>

View File

@ -52,6 +52,6 @@
</ItemGroup>
<ItemGroup>
<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>
</Project>

View File

@ -384,7 +384,7 @@ namespace osu.Game.Rulesets.Catch.UI
}
currentCatcher.Show();
(currentCatcher.Drawable as IAnimation)?.GotoFrame(0);
(currentCatcher.Drawable as IFramedAnimation)?.GotoFrame(0);
}
private void beginTrail()

View File

@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Mania.Skinning
// This animation is discarded and re-queried with the appropriate frame length afterwards.
var tmp = skin.GetAnimation(imageName, true, false);
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);
explosion = skin.GetAnimation(imageName, true, false, startAtCurrentTime: true, frameLength: frameLength).With(d =>

View File

@ -16,7 +16,7 @@ namespace osu.Game.Tournament.Components
{
private readonly string filename;
private readonly bool drawFallbackGradient;
private VideoSprite video;
private Video video;
private ManualClock manualClock;
@ -33,7 +33,7 @@ namespace osu.Game.Tournament.Components
if (stream != null)
{
InternalChild = video = new VideoSprite(stream, false)
InternalChild = video = new Video(stream, false)
{
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit,

View File

@ -270,10 +270,9 @@ namespace osu.Game.Screens.Menu
[BackgroundDependencyLoader]
private void load()
{
InternalChild = new VideoSprite(videoStream, false)
InternalChild = new Video(videoStream, false)
{
RelativeSizeAxes = Axes.Both,
Clock = new FramedOffsetClock(Clock) { Offset = -logo_1 }
};
}
}

View File

@ -8,7 +8,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Animations;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Timing;
namespace osu.Game.Skinning
{
@ -28,7 +27,7 @@ namespace osu.Game.Skinning
var animation = new SkinnableTextureAnimation(startAtCurrentTime)
{
DefaultFrameLength = frameLength ?? getFrameLength(source, applyConfigFrameRate, textures),
Repeat = looping,
Loop = looping,
};
foreach (var t in textures)
@ -71,7 +70,10 @@ namespace osu.Game.Skinning
base.LoadComplete();
if (timeReference != null)
Clock = new FramedOffsetClock(timeReference.Clock) { Offset = -timeReference.AnimationStartTime };
{
Clock = timeReference.Clock;
PlaybackPosition = timeReference.AnimationStartTime - timeReference.Clock.CurrentTime;
}
}
}

View File

@ -108,7 +108,7 @@ namespace osu.Game.Storyboards.Drawables
Animation = animation;
Origin = animation.Origin;
Position = animation.InitialPosition;
Repeat = animation.LoopType == AnimationLoopType.LoopForever;
Loop = animation.LoopType == AnimationLoopType.LoopForever;
LifetimeStart = animation.StartTime;
LifetimeEnd = animation.EndTime;

View File

@ -8,7 +8,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Video;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
namespace osu.Game.Storyboards.Drawables
@ -16,7 +15,7 @@ namespace osu.Game.Storyboards.Drawables
public class DrawableStoryboardVideo : CompositeDrawable
{
public readonly StoryboardVideo Video;
private VideoSprite videoSprite;
private Video video;
public override bool RemoveWhenNotAlive => false;
@ -40,14 +39,14 @@ namespace osu.Game.Storyboards.Drawables
if (stream == null)
return;
InternalChild = videoSprite = new VideoSprite(stream, false)
InternalChild = video = new Video(stream, false)
{
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fill,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Alpha = 0,
Clock = new FramedOffsetClock(Clock) { Offset = -Video.StartTime }
PlaybackPosition = Video.StartTime
};
}
@ -55,10 +54,10 @@ namespace osu.Game.Storyboards.Drawables
{
base.LoadComplete();
if (videoSprite == null) return;
if (video == null) return;
using (videoSprite.BeginAbsoluteSequence(0))
videoSprite.FadeIn(500);
using (video.BeginAbsoluteSequence(0))
video.FadeIn(500);
}
}
}

View File

@ -22,8 +22,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
<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.Framework" Version="2020.402.0" />
<PackageReference Include="Sentry" Version="2.1.1" />
<PackageReference Include="SharpCompress" Version="0.24.0" />
<PackageReference Include="NUnit" Version="3.12.0" />

View File

@ -70,8 +70,8 @@
<Reference Include="System.Net.Http" />
</ItemGroup>
<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.Framework.iOS" Version="2020.402.0" />
</ItemGroup>
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
<ItemGroup Label="Transitive Dependencies">
@ -79,7 +79,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
<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="NUnit" Version="3.12.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />