Skip to content

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbuck committed Jun 13, 2024
1 parent 443e428 commit bed9f2d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 38 deletions.
17 changes: 0 additions & 17 deletions Ion/Ion.Extensions.Assets.Abstractions/AssetTypes/IFontSet.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

namespace Ion.Extensions.Assets;
using Ion.Extensions.Assets;

namespace Ion.Extensions.Audio;

public interface ISoundEffect : IAsset
{
Expand Down
11 changes: 4 additions & 7 deletions Ion/Ion.Extensions.Audio.Abstractions/IAudioManager.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using Ion.Extensions.Assets;
namespace Ion.Extensions.Audio;

namespace Ion.Extensions.Audio
public interface IAudioManager
{
public interface IAudioManager
{
float MasterVolume { get; set; }
float MasterVolume { get; set; }

void Play(ISoundEffect soundEffect, float volume = 1f, float pitchShift = 0f);
}
void Play(ISoundEffect soundEffect, float volume = 1f, float pitchShift = 0f);
}
15 changes: 15 additions & 0 deletions Ion/Ion.Extensions.Graphics.Abstractions/Assets/IFontSet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Numerics;

using Ion.Extensions.Assets;

namespace Ion.Extensions.Graphics;

public interface IFontSet : IAsset { }

public interface IFont
{
IFontSet FontSet { get; }
float FontSize { get; }

Vector2 MeasureString(string text);
}
17 changes: 5 additions & 12 deletions Ion/Ion.Extensions.Graphics.Veldrid/2D/SpriteRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,11 @@ ITraceTimer<SpriteRenderer> trace

private bool _beginCalled = false;

private class BufferContainer
private class BufferContainer(DeviceBuffer buffer, ResourceSet instanceSet, ResourceSet textureSet)
{
public DeviceBuffer Buffer { get; set; }
public ResourceSet InstanceSet { get; set; }
public ResourceSet TextureSet { get; set; }

public BufferContainer(DeviceBuffer buffer, ResourceSet instanceSet, ResourceSet textureSet)
{
Buffer = buffer;
InstanceSet = instanceSet;
TextureSet = textureSet;
}
public DeviceBuffer Buffer { get; set; } = buffer;
public ResourceSet InstanceSet { get; set; } = instanceSet;
public ResourceSet TextureSet { get; set; } = textureSet;

public void Dispose()
{
Expand All @@ -49,7 +42,7 @@ public void Dispose()
}
}

private readonly Dictionary<ITexture2D, BufferContainer> _buffers = new();
private readonly Dictionary<ITexture2D, BufferContainer> _buffers = [];

private const string VertexCode = @"
#version 450
Expand Down

0 comments on commit bed9f2d

Please sign in to comment.