Fix some new inspections

This commit is contained in:
Dean Herbert
2025-10-20 19:47:43 +09:00
parent eff55a2e98
commit d43f2eae00
6 changed files with 18 additions and 20 deletions

View File

@@ -26,7 +26,7 @@ namespace osu.Framework.Audio.Sample
/// <summary>
/// Whether this <see cref="ISample"/> is fully loaded.
/// </summary>
public bool IsLoaded { get; }
bool IsLoaded { get; }
/// <summary>
/// The number of times this sample (as identified by name) can be played back concurrently.

View File

@@ -54,7 +54,7 @@ namespace osu.Framework.Audio.Track
/// <summary>
/// Whether this track has finished playing back.
/// </summary>
public bool HasCompleted { get; }
bool HasCompleted { get; }
/// <summary>
/// Restarts this track from the <see cref="Track.RestartPoint"/> while retaining adjustments.

View File

@@ -16,7 +16,7 @@ namespace osu.Framework.Bindables
/// If the value type is one supported by the <see cref="BindableNumber{T}"/>, an instance of <see cref="BindableNumberWithCurrent{T}"/> will be returned.
/// Otherwise an instance of <see cref="BindableWithCurrent{T}"/> will be returned instead.
/// </summary>
public static IBindableWithCurrent<T> Create()
static IBindableWithCurrent<T> Create()
{
if (Validation.IsSupportedBindableNumberType<T>())
return (IBindableWithCurrent<T>)Activator.CreateInstance(typeof(BindableNumberWithCurrent<>).MakeGenericType(typeof(T)), default(T));

View File

@@ -11,12 +11,12 @@ namespace osu.Framework.Graphics.Animations
/// <summary>
/// The duration of the animation.
/// </summary>
public double Duration { get; }
double Duration { get; }
/// <summary>
/// True if the animation has finished playing, false otherwise.
/// </summary>
public bool FinishedPlaying => !Loop && PlaybackPosition > Duration;
bool FinishedPlaying => !Loop && PlaybackPosition > Duration;
/// <summary>
/// True if the animation is playing, false otherwise. <c>true</c> by default.
@@ -37,6 +37,6 @@ namespace osu.Framework.Graphics.Animations
/// <summary>
/// The current position of playback.
/// </summary>
public double PlaybackPosition { get; set; }
double PlaybackPosition { get; set; }
}
}

View File

@@ -24,25 +24,25 @@ namespace osu.Framework.Graphics.Rendering
/// Maximum number of <see cref="DrawNode"/>s a <see cref="Drawable"/> can draw with.
/// This is a carefully-chosen number to enable the update and draw threads to work concurrently without causing unnecessary load.
/// </summary>
public const int MAX_DRAW_NODES = 3;
const int MAX_DRAW_NODES = 3;
public const int MAX_MIPMAP_LEVELS = 3;
const int MAX_MIPMAP_LEVELS = 3;
public const int VERTICES_PER_TRIANGLE = 4;
const int VERTICES_PER_TRIANGLE = 4;
public const int VERTICES_PER_QUAD = 4;
const int VERTICES_PER_QUAD = 4;
public const int INDICES_PER_QUAD = VERTICES_PER_QUAD + 2;
const int INDICES_PER_QUAD = VERTICES_PER_QUAD + 2;
/// <summary>
/// Maximum number of vertices in a linear vertex buffer.
/// </summary>
public const int MAX_VERTICES = ushort.MaxValue;
const int MAX_VERTICES = ushort.MaxValue;
/// <summary>
/// Maximum number of quads in a quad vertex buffer.
/// </summary>
public const int MAX_QUADS = ushort.MaxValue / INDICES_PER_QUAD;
const int MAX_QUADS = ushort.MaxValue / INDICES_PER_QUAD;
/// <summary>
/// Enables or disables vertical sync.
@@ -353,7 +353,7 @@ namespace osu.Framework.Graphics.Rendering
/// <summary>
/// Returns an image containing the content of a framebuffer.
/// </summary>
public Image<Rgba32>? ExtractFrameBufferData(IFrameBuffer frameBuffer);
Image<Rgba32>? ExtractFrameBufferData(IFrameBuffer frameBuffer);
/// <summary>
/// Creates a new <see cref="IShaderPart"/>.

View File

@@ -356,12 +356,10 @@ namespace osu.Framework.Text
return tryGetGlyph(character, font, store) ??
tryGetGlyph(fallbackCharacter, font, store);
static ITexturedCharacterGlyph? tryGetGlyph(char character, FontUsage font, ITexturedGlyphLookupStore store)
{
return store.Get(font.FontName, character)
?? store.Get(font.FontNameNoFamily, character)
?? store.Get(string.Empty, character);
}
static ITexturedCharacterGlyph? tryGetGlyph(char character, FontUsage font, ITexturedGlyphLookupStore store) =>
store.Get(font.FontName, character)
?? store.Get(font.FontNameNoFamily, character)
?? store.Get(string.Empty, character);
}
}
}