Ryujinx/Ryujinx.HLE/Utilities/StructWriter.cs
LDj3SNuD eee639d6ba .NET Core 3.0 is here! (#784)
* .NET Core 3.0 is here!

* Remove IMemoryManager.cs and its references.

* Add T Math/F.FusedMultiplyAdd(T, T, T). Nits.

* Nit.

* Update appveyor.yml

* Revert "Resolve Visual Studio build issues"

This reverts commit 1772128ce0.

* Update SvcTable.cs
2019-10-31 19:09:03 +01:00

26 lines
557 B
C#

using ARMeilleure.Memory;
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.Utilities
{
class StructWriter
{
private MemoryManager _memory;
public long Position { get; private set; }
public StructWriter(MemoryManager memory, long position)
{
_memory = memory;
Position = position;
}
public void Write<T>(T value) where T : struct
{
MemoryHelper.Write(_memory, Position, value);
Position += Marshal.SizeOf<T>();
}
}
}