Skip to content

Commit

Permalink
It runs!
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Nov 22, 2023
1 parent f1f820b commit c046e44
Show file tree
Hide file tree
Showing 32 changed files with 308 additions and 240 deletions.
6 changes: 3 additions & 3 deletions osu.Android.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<Project>
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\osu-framework\osu.Framework.Android\osu.Framework.Android.csproj" />
</ItemGroup>
<PropertyGroup>
<SupportedOSPlatformVersion>21.0</SupportedOSPlatformVersion>
<RuntimeIdentifiers>android-x86;android-arm;android-arm64</RuntimeIdentifiers>
Expand All @@ -9,9 +12,6 @@
<NullabilityInfoContextSupport>true</NullabilityInfoContextSupport>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.1121.1" />
</ItemGroup>
<PropertyGroup>
<!-- Fody does not handle Android build well, and warns when unchanged.
Since Realm objects are not declared directly in Android projects, simply disable Fody. -->
Expand Down
7 changes: 5 additions & 2 deletions osu.Android.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
"osu.Game.Rulesets.Taiko\\osu.Game.Rulesets.Taiko.csproj",
"osu.Game.Tests.Android\\osu.Game.Tests.Android.csproj",
"osu.Game.Tests\\osu.Game.Tests.csproj",
"osu.Game\\osu.Game.csproj"
"osu.Game\\osu.Game.csproj",
"../osu-framework/osu.Framework/osu.Framework.csproj",
"../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj",
"../osu-framework/osu.Framework.Android/osu.Framework.Android.csproj"
]
}
}
}
5 changes: 3 additions & 2 deletions osu.Desktop.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
"osu.Game.Tournament.Tests\\osu.Game.Tournament.Tests.csproj",
"osu.Game.Tournament\\osu.Game.Tournament.csproj",
"osu.Game\\osu.Game.csproj",

"Templates\\Rulesets\\ruleset-empty\\osu.Game.Rulesets.EmptyFreeform\\osu.Game.Rulesets.EmptyFreeform.csproj",
"Templates\\Rulesets\\ruleset-empty\\osu.Game.Rulesets.EmptyFreeform.Tests\\osu.Game.Rulesets.EmptyFreeform.Tests.csproj",
"Templates\\Rulesets\\ruleset-example\\osu.Game.Rulesets.Pippidon\\osu.Game.Rulesets.Pippidon.csproj",
"Templates\\Rulesets\\ruleset-example\\osu.Game.Rulesets.Pippidon.Tests\\osu.Game.Rulesets.Pippidon.Tests.csproj",
"Templates\\Rulesets\\ruleset-scrolling-empty\\osu.Game.Rulesets.EmptyScrolling\\osu.Game.Rulesets.EmptyScrolling.csproj",
"Templates\\Rulesets\\ruleset-scrolling-empty\\osu.Game.Rulesets.EmptyScrolling.Tests\\osu.Game.Rulesets.EmptyScrolling.Tests.csproj",
"Templates\\Rulesets\\ruleset-scrolling-example\\osu.Game.Rulesets.Pippidon\\osu.Game.Rulesets.Pippidon.csproj",
"Templates\\Rulesets\\ruleset-scrolling-example\\osu.Game.Rulesets.Pippidon.Tests\\osu.Game.Rulesets.Pippidon.Tests.csproj"
"Templates\\Rulesets\\ruleset-scrolling-example\\osu.Game.Rulesets.Pippidon.Tests\\osu.Game.Rulesets.Pippidon.Tests.csproj",
"../osu-framework/osu.Framework/osu.Framework.csproj",
"../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj"
]
}
}
2 changes: 2 additions & 0 deletions osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public ManiaPlayfield(List<StageDefinition> stageDefinitions)
AddInternal(playfieldGrid = new GridContainer
{
RelativeSizeAxes = Axes.Both,
Camera = new Camera(45, new Vector2(0.5f)),
Rotation3D = new Quaternion(-MathF.PI / 4, 0, 0),
Content = new[] { new Drawable[stageDefinitions.Count] }
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ protected override void LoadComplete()
Scheduler.AddOnce(updateSliderPathFromBSplineBuilder);
}, true);

freehandToolboxGroup.CornerThreshold.BindValueChanged(e =>
{
bSplineBuilder.CornerThreshold = e.NewValue;
Scheduler.AddOnce(updateSliderPathFromBSplineBuilder);
}, true);
// freehandToolboxGroup.CornerThreshold.BindValueChanged(e =>
// {
// bSplineBuilder.CornerThreshold = e.NewValue;
// Scheduler.AddOnce(updateSliderPathFromBSplineBuilder);
// }, true);
}
}

Expand Down Expand Up @@ -308,46 +308,46 @@ private void updateSlider()

private void updateSliderPathFromBSplineBuilder()
{
IReadOnlyList<Vector2> builderPoints = bSplineBuilder.ControlPoints;

if (builderPoints.Count == 0)
return;

int lastSegmentStart = 0;
PathType? lastPathType = null;

HitObject.Path.ControlPoints.Clear();

// Iterate through generated points, finding each segment and adding non-inheriting path types where appropriate.
// Importantly, the B-Spline builder returns three Vector2s at the same location when a new segment is to be started.
for (int i = 0; i < builderPoints.Count; i++)
{
bool isLastPoint = i == builderPoints.Count - 1;
bool isNewSegment = i < builderPoints.Count - 2 && builderPoints[i] == builderPoints[i + 1] && builderPoints[i] == builderPoints[i + 2];

if (isNewSegment || isLastPoint)
{
int pointsInSegment = i - lastSegmentStart;

// Where possible, we can use the simpler LINEAR path type.
PathType? pathType = pointsInSegment == 1 ? PathType.LINEAR : PathType.BSpline(3);

// Linear segments can be combined, as two adjacent linear sections are computationally the same as one with the points combined.
if (lastPathType == pathType && lastPathType == PathType.LINEAR)
pathType = null;

HitObject.Path.ControlPoints.Add(new PathControlPoint(builderPoints[lastSegmentStart], pathType));
for (int j = lastSegmentStart + 1; j < i; j++)
HitObject.Path.ControlPoints.Add(new PathControlPoint(builderPoints[j]));

if (isLastPoint)
HitObject.Path.ControlPoints.Add(new PathControlPoint(builderPoints[i]));

// Skip the redundant duplicated points (see isNewSegment above) which have been coalesced into a path type.
lastSegmentStart = (i += 2);
if (pathType != null) lastPathType = pathType;
}
}
// IReadOnlyList<Vector2> builderPoints = bSplineBuilder.ControlPoints;
//
// if (builderPoints.Count == 0)
// return;
//
// int lastSegmentStart = 0;
// PathType? lastPathType = null;
//
// HitObject.Path.ControlPoints.Clear();
//
// // Iterate through generated points, finding each segment and adding non-inheriting path types where appropriate.
// // Importantly, the B-Spline builder returns three Vector2s at the same location when a new segment is to be started.
// for (int i = 0; i < builderPoints.Count; i++)
// {
// bool isLastPoint = i == builderPoints.Count - 1;
// bool isNewSegment = i < builderPoints.Count - 2 && builderPoints[i] == builderPoints[i + 1] && builderPoints[i] == builderPoints[i + 2];
//
// if (isNewSegment || isLastPoint)
// {
// int pointsInSegment = i - lastSegmentStart;
//
// // Where possible, we can use the simpler LINEAR path type.
// PathType? pathType = pointsInSegment == 1 ? PathType.LINEAR : PathType.BSpline(3);
//
// // Linear segments can be combined, as two adjacent linear sections are computationally the same as one with the points combined.
// if (lastPathType == pathType && lastPathType == PathType.LINEAR)
// pathType = null;
//
// HitObject.Path.ControlPoints.Add(new PathControlPoint(builderPoints[lastSegmentStart], pathType));
// for (int j = lastSegmentStart + 1; j < i; j++)
// HitObject.Path.ControlPoints.Add(new PathControlPoint(builderPoints[j]));
//
// if (isLastPoint)
// HitObject.Path.ControlPoints.Add(new PathControlPoint(builderPoints[i]));
//
// // Skip the redundant duplicated points (see isNewSegment above) which have been coalesced into a path type.
// lastSegmentStart = (i += 2);
// if (pathType != null) lastPathType = pathType;
// }
// }
}

private enum SliderPlacementState
Expand Down
62 changes: 31 additions & 31 deletions osu.Game.Rulesets.Osu/Mods/OsuModBlinds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,37 +135,37 @@ private void load()

protected override void Update()
{
float start, end;

if (Precision.AlmostEquals(restrictTo.Rotation, 0))
{
start = Parent!.ToLocalSpace(restrictTo.ScreenSpaceDrawQuad.TopLeft).X;
end = Parent!.ToLocalSpace(restrictTo.ScreenSpaceDrawQuad.TopRight).X;
}
else
{
float center = restrictTo.ToSpaceOfOtherDrawable(restrictTo.OriginPosition, Parent!).X;
float halfDiagonal = (restrictTo.DrawSize / 2).LengthFast;

start = center - halfDiagonal;
end = center + halfDiagonal;
}

float rawWidth = end - start;

start -= rawWidth * leniency * 0.5f;
end += rawWidth * leniency * 0.5f;

float width = (end - start) * 0.5f * applyAdjustmentCurve(calculateGap(easing));

// different values in case the playfield ever moves from center to somewhere else.
blackBoxLeft.Width = start + width;
blackBoxRight.Width = DrawWidth - end + width;

panelLeft.X = start + width;
panelRight.X = end - width;
bgPanelLeft.X = start;
bgPanelRight.X = end;
// float start, end;
//
// if (Precision.AlmostEquals(restrictTo.Rotation, 0))
// {
// // start = Parent!.ToLocalSpace(restrictTo.ScreenSpaceDrawQuad.TopLeft).X;
// // end = Parent!.ToLocalSpace(restrictTo.ScreenSpaceDrawQuad.TopRight).X;
// }
// else
// {
// float center = restrictTo.ToSpaceOfOtherDrawable(restrictTo.OriginPosition, Parent!).X;
// float halfDiagonal = (restrictTo.DrawSize / 2).LengthFast;
//
// start = center - halfDiagonal;
// end = center + halfDiagonal;
// }
//
// float rawWidth = end - start;
//
// start -= rawWidth * leniency * 0.5f;
// end += rawWidth * leniency * 0.5f;
//
// float width = (end - start) * 0.5f * applyAdjustmentCurve(calculateGap(easing));
//
// // different values in case the playfield ever moves from center to somewhere else.
// blackBoxLeft.Width = start + width;
// blackBoxRight.Width = DrawWidth - end + width;
//
// panelLeft.X = start + width;
// panelRight.X = end - width;
// bgPanelLeft.X = start;
// bgPanelRight.X = end;
}

protected override void LoadComplete()
Expand Down
88 changes: 44 additions & 44 deletions osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,50 +327,50 @@ protected virtual Vector2 PointDirection(SmokePoint point, int index)

private void drawPointQuad(IRenderer renderer, SmokePoint point, RectangleF textureRect, int index)
{
Debug.Assert(quadBatch != null);

var colour = PointColour(point);
if (colour.A == 0)
return;

float scale = PointScale(point);
if (scale == 0)
return;

var dir = PointDirection(point, index);
var ortho = dir.PerpendicularLeft;
dir *= scale * width;
ortho *= scale * height;

var localTopLeft = point.Position - ortho - dir;
var localTopRight = point.Position - ortho + dir;
var localBotLeft = point.Position + ortho - dir;
var localBotRight = point.Position + ortho + dir;

quadBatch.Add(new TexturedVertex2D(renderer)
{
Position = localTopLeft,
TexturePosition = textureRect.TopLeft,
Colour = Color4Extensions.Multiply(ColourAtPosition(localTopLeft), colour),
});
quadBatch.Add(new TexturedVertex2D(renderer)
{
Position = localTopRight,
TexturePosition = textureRect.TopRight,
Colour = Color4Extensions.Multiply(ColourAtPosition(localTopRight), colour),
});
quadBatch.Add(new TexturedVertex2D(renderer)
{
Position = localBotRight,
TexturePosition = textureRect.BottomRight,
Colour = Color4Extensions.Multiply(ColourAtPosition(localBotRight), colour),
});
quadBatch.Add(new TexturedVertex2D(renderer)
{
Position = localBotLeft,
TexturePosition = textureRect.BottomLeft,
Colour = Color4Extensions.Multiply(ColourAtPosition(localBotLeft), colour),
});
// Debug.Assert(quadBatch != null);
//
// var colour = PointColour(point);
// if (colour.A == 0)
// return;
//
// float scale = PointScale(point);
// if (scale == 0)
// return;
//
// var dir = PointDirection(point, index);
// var ortho = dir.PerpendicularLeft;
// dir *= scale * width;
// ortho *= scale * height;
//
// var localTopLeft = point.Position - ortho - dir;
// var localTopRight = point.Position - ortho + dir;
// var localBotLeft = point.Position + ortho - dir;
// var localBotRight = point.Position + ortho + dir;
//
// quadBatch.Add(new TexturedVertex2D(renderer)
// {
// Position = localTopLeft,
// TexturePosition = textureRect.TopLeft,
// Colour = Color4Extensions.Multiply(ColourAtPosition(localTopLeft), colour),
// });
// quadBatch.Add(new TexturedVertex2D(renderer)
// {
// Position = localTopRight,
// TexturePosition = textureRect.TopRight,
// Colour = Color4Extensions.Multiply(ColourAtPosition(localTopRight), colour),
// });
// quadBatch.Add(new TexturedVertex2D(renderer)
// {
// Position = localBotRight,
// TexturePosition = textureRect.BottomRight,
// Colour = Color4Extensions.Multiply(ColourAtPosition(localBotRight), colour),
// });
// quadBatch.Add(new TexturedVertex2D(renderer)
// {
// Position = localBotLeft,
// TexturePosition = textureRect.BottomLeft,
// Colour = Color4Extensions.Multiply(ColourAtPosition(localBotLeft), colour),
// });
}

protected override void Dispose(bool isDisposing)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ protected override void Update()
var topLeft = new Vector2(float.MaxValue, float.MaxValue);
var bottomRight = new Vector2(float.MinValue, float.MinValue);

topLeft = Vector2.ComponentMin(topLeft, Parent!.ToLocalSpace(DrawableObject.ScreenSpaceDrawQuad.TopLeft));
bottomRight = Vector2.ComponentMax(bottomRight, Parent!.ToLocalSpace(DrawableObject.ScreenSpaceDrawQuad.BottomRight));

Size = bottomRight - topLeft;
Position = topLeft;
// topLeft = Vector2.ComponentMin(topLeft, Parent!.ToLocalSpace(DrawableObject.ScreenSpaceDrawQuad.TopLeft));
// bottomRight = Vector2.ComponentMax(bottomRight, Parent!.ToLocalSpace(DrawableObject.ScreenSpaceDrawQuad.BottomRight));
//
// Size = bottomRight - topLeft;
// Position = topLeft;
}
}
}
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Taiko/UI/DrawableTaikoRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected override void UpdateAfterChildren()
base.UpdateAfterChildren();

var playfieldScreen = Playfield.ScreenSpaceDrawQuad;
scroller.Height = ToLocalSpace(playfieldScreen.TopLeft + new Vector2(0, playfieldScreen.Height / 20)).Y;
// scroller.Height = ToLocalSpace(playfieldScreen.TopLeft + new Vector2(0, playfieldScreen.Height / 20)).Y;
}

public MultiplierControlPoint ControlPointAt(double time)
Expand Down
Loading

0 comments on commit c046e44

Please sign in to comment.