Skip to content

Commit

Permalink
Disabling warnings on missing XML for now; fixing various XML comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NoelFB committed Jul 30, 2024
1 parent 33cf1aa commit 41938fe
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 27 deletions.
1 change: 1 addition & 0 deletions Framework/Foster.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<PackageOutputPath>$(SolutionDir)artifacts/</PackageOutputPath>
<IsAotCompatible>true</IsAotCompatible>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>CS1591</NoWarn>
</PropertyGroup>

<PropertyGroup>
Expand Down
8 changes: 8 additions & 0 deletions Framework/Graphics/Batcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,12 @@ public void PopScissor()
/// <summary>
/// Pushes a Matrix that will transform all future data
/// </summary>
/// <param name="position"></param>
/// <param name="scale"></param>
/// <param name="origin"></param>
/// <param name="rotation"></param>
/// <param name="relative">If the Matrix should be relative to the previously pushed transformations</param>
/// <returns></returns>
public Matrix3x2 PushMatrix(in Vector2 position, in Vector2 scale, in Vector2 origin, float rotation, bool relative = true)
{
return PushMatrix(Transform.CreateMatrix(position, origin, scale, rotation), relative);
Expand All @@ -515,6 +520,7 @@ public Matrix3x2 PushMatrix(in Vector2 position, in Vector2 scale, in Vector2 or
/// <summary>
/// Pushes a Matrix that will transform all future data
/// </summary>
/// <param name="transform"></param>
/// <param name="relative">If the Matrix should be relative to the previously pushed transformations</param>
public Matrix3x2 PushMatrix(Transform transform, bool relative = true)
{
Expand All @@ -524,6 +530,7 @@ public Matrix3x2 PushMatrix(Transform transform, bool relative = true)
/// <summary>
/// Pushes a Matrix that will transform all future data
/// </summary>
/// <param name="position"></param>
/// <param name="relative">If the Matrix should be relative to the previously pushed transformations</param>
public Matrix3x2 PushMatrix(in Vector2 position, bool relative = true)
{
Expand All @@ -533,6 +540,7 @@ public Matrix3x2 PushMatrix(in Vector2 position, bool relative = true)
/// <summary>
/// Pushes a Matrix that will transform all future data
/// </summary>
/// <param name="matrix"></param>
/// <param name="relative">If the Matrix should be relative to the previously pushed transformations</param>
public Matrix3x2 PushMatrix(in Matrix3x2 matrix, bool relative = true)
{
Expand Down
2 changes: 1 addition & 1 deletion Framework/Graphics/Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void Clear()
}

/// <summary>
/// Copies the Shader & Uniform values from this Material to the given one
/// Copies the Shader &amp; Uniform values from this Material to the given one
/// </summary>
public void CopyTo(Material material)
{
Expand Down
21 changes: 21 additions & 0 deletions Framework/Graphics/Mesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@

namespace Foster.Framework;

/// <summary>
/// The Mesh contains a buffer of Vertices and optionally a buffer of Indices
/// used during a DrawCommand.
/// </summary>
public class Mesh : IResource
{
/// <summary>
/// Optional Mesh Name
/// </summary>
public string Name { get; set; } = string.Empty;

/// <summary>
/// If the Mesh has been disposed
/// </summary>
public bool IsDisposed => disposed;

/// <summary>
Expand All @@ -31,6 +42,9 @@ public class Mesh : IResource
internal IntPtr resource;
internal bool disposed = false;

/// <summary>
/// Creates a new Mesh for rendering
/// </summary>
public Mesh()
{
resource = Platform.FosterMeshCreate();
Expand All @@ -39,6 +53,9 @@ public Mesh()
Graphics.Resources.RegisterAllocated(this, resource, Platform.FosterMeshDestroy);
}

/// <summary>
/// Disposes the Mesh resources
/// </summary>
~Mesh()
{
Dispose(false);
Expand Down Expand Up @@ -252,6 +269,10 @@ public unsafe void SetSubVertices(int offset, IntPtr data, int count)
);
}

/// <summary>
/// Disposes the graphical resources of the Mesh. Once Disposed, the Mesh
/// is no longer usable.
/// </summary>
public void Dispose()
{
Dispose(true);
Expand Down
1 change: 1 addition & 0 deletions Framework/Images/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public override readonly string ToString()
/// Returns a Hex String representation of the Color's given components
/// </summary>
/// <param name="components">The Components, in any order. ex. "RGBA" or "RGB" or "ARGB"</param>
/// <param name="destination">The destination to write the string to</param>
public readonly void ToHexString(ReadOnlySpan<char> components, Span<char> destination)
{
if (destination.Length < components.Length * 2)
Expand Down
4 changes: 2 additions & 2 deletions Framework/Images/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static unsafe void Write(IntPtr context, IntPtr data, int size)
}

/// <summary>
/// Get &amp Set the color of a pixel.
/// Get &amp; Set the color of a pixel.
/// </summary>
public Color this[int index]
{
Expand All @@ -212,7 +212,7 @@ public Color this[int index]
}

/// <summary>
/// Get &amp Set the color of a pixel.
/// Get &amp; Set the color of a pixel.
/// </summary>
public Color this[int x, int y]
{
Expand Down
34 changes: 10 additions & 24 deletions Framework/Images/Packer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,17 @@ public class Packer
/// <summary>
/// A single packed Entry
/// </summary>
/// <param name="Index">Index when added to the Packer</param>
/// <param name="Name">The Name of the Entry</param>
/// <param name="Page">The corresponding image page of the Entry</param>
/// <param name="Source">The Source Rectangle</param>
/// <param name="Frame">The Frame Rectangle. This is the size of the image before it was packed</param>
public readonly record struct Entry
(
/// <summary>
/// Index when added to the Packer
/// </summary>
int Index,

/// <summary>
/// The Name of the Entry
/// </summary>
string Name,

/// <summary>
/// The corresponding image page of the Entry
/// </summary>
int Page,

/// <summary>
/// The Source Rectangle
/// </summary>
RectInt Source,

/// <summary>
/// The Frame Rectangle. This is the size of the image before it was packed
/// </summary>
(
int Index,
string Name,
int Page,
RectInt Source,
RectInt Frame
);

Expand Down

0 comments on commit 41938fe

Please sign in to comment.