Temporary for taiko lagging on auto replays due to inImportantSection.

Note that this isn't a full "as intended" fix, because the full fix is quite big. I'll be saving it for a separate branch/pull-req.
This commit is contained in:
smoogipooo 2017-04-20 15:26:42 +09:00
parent ef56058ad2
commit 61090d918c
4 changed files with 21 additions and 21 deletions

View File

@ -138,8 +138,8 @@ namespace osu.Game.Rulesets.Osu
if (h is Spinner)
{
targetPosition.X = Frames[Frames.Count - 1].MouseX;
targetPosition.Y = Frames[Frames.Count - 1].MouseY;
targetPosition.X = Frames[Frames.Count - 1].Position.X;
targetPosition.Y = Frames[Frames.Count - 1].Position.Y;
Vector2 difference = spinner_centre - targetPosition;
@ -193,7 +193,7 @@ namespace osu.Game.Rulesets.Osu
addFrameToReplay(lastFrame);
}
Vector2 lastPosition = new Vector2(lastFrame.MouseX, lastFrame.MouseY);
Vector2 lastPosition = lastFrame.Position;
double timeDifference = applyModsToTime(h.StartTime - lastFrame.Time);

View File

@ -24,8 +24,8 @@ namespace osu.Game.Rulesets.Taiko.Replays
{
bool hitButton = true;
Frames.Add(new ReplayFrame(-100000, 320, 240, ReplayButtonState.None));
Frames.Add(new ReplayFrame(beatmap.HitObjects[0].StartTime - 1000, 320, 240, ReplayButtonState.None));
Frames.Add(new ReplayFrame(-100000, null, null, ReplayButtonState.None));
Frames.Add(new ReplayFrame(beatmap.HitObjects[0].StartTime - 1000, null, null, ReplayButtonState.None));
for (int i = 0; i < beatmap.HitObjects.Count; i++)
{
@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Taiko.Replays
break;
}
Frames.Add(new ReplayFrame(j, 0, 0, button));
Frames.Add(new ReplayFrame(j, null, null, button));
d = (d + 1) % 4;
if (++count > req)
break;
@ -74,7 +74,7 @@ namespace osu.Game.Rulesets.Taiko.Replays
{
foreach (var tick in drumRoll.Ticks)
{
Frames.Add(new ReplayFrame(tick.StartTime, 0, 0, hitButton ? ReplayButtonState.Left1 : ReplayButtonState.Left2));
Frames.Add(new ReplayFrame(tick.StartTime, null, null, hitButton ? ReplayButtonState.Left1 : ReplayButtonState.Left2));
hitButton = !hitButton;
}
}
@ -95,18 +95,18 @@ namespace osu.Game.Rulesets.Taiko.Replays
button = hitButton ? ReplayButtonState.Left1 : ReplayButtonState.Left2;
}
Frames.Add(new ReplayFrame(h.StartTime, 0, 0, button));
Frames.Add(new ReplayFrame(h.StartTime, null, null, button));
}
else
throw new Exception("Unknown hit object type.");
Frames.Add(new ReplayFrame(endTime + KEY_UP_DELAY, 0, 0, ReplayButtonState.None));
Frames.Add(new ReplayFrame(endTime + KEY_UP_DELAY, null, null, ReplayButtonState.None));
if (i < beatmap.HitObjects.Count - 1)
{
double waitTime = beatmap.HitObjects[i + 1].StartTime - 1000;
if (waitTime > endTime)
Frames.Add(new ReplayFrame(waitTime, 0, 0, ReplayButtonState.None));
Frames.Add(new ReplayFrame(waitTime, null, null, ReplayButtonState.None));
}
hitButton = !hitButton;

View File

@ -108,7 +108,7 @@ namespace osu.Game.Database
using (var lzma = new LzmaStream(properties, replayInStream, compressedSize, outSize))
using (var reader = new StreamReader(lzma))
score.Replay = createReplay(reader);
score.Replay = createLegacyReplay(reader);
}
}
@ -116,11 +116,11 @@ namespace osu.Game.Database
}
/// <summary>
/// Creates a replay which is read from a stream.
/// Creates a legacy replay which is read from a stream.
/// </summary>
/// <param name="reader">The stream reader.</param>
/// <returns>The replay.</returns>
private Replay createReplay(StreamReader reader)
/// <returns>The legacy replay.</returns>
private Replay createLegacyReplay(StreamReader reader)
{
var frames = new List<ReplayFrame>();

View File

@ -7,12 +7,12 @@ namespace osu.Game.Rulesets.Replays
{
public class ReplayFrame
{
public Vector2 Position => new Vector2(MouseX, MouseY);
public Vector2 Position => new Vector2(MouseX ?? 0, MouseY ?? 0);
public bool IsImportant => MouseLeft || MouseRight;
public bool IsImportant => (MouseX.HasValue && MouseY.HasValue) && (MouseLeft || MouseRight);
public float MouseX;
public float MouseY;
public float? MouseX;
public float? MouseY;
public bool MouseLeft => MouseLeft1 || MouseLeft2;
public bool MouseRight => MouseRight1 || MouseRight2;
@ -55,10 +55,10 @@ namespace osu.Game.Rulesets.Replays
}
public ReplayFrame(double time, float posX, float posY, ReplayButtonState buttonState)
public ReplayFrame(double time, float? mouseX, float? mouseY, ReplayButtonState buttonState)
{
MouseX = posX;
MouseY = posY;
MouseX = mouseX;
MouseY = mouseY;
ButtonState = buttonState;
Time = time;
}