diff options
| author | TSR Berry <20988865+TSRBerry@users.noreply.github.com> | 2023-04-08 01:22:00 +0200 |
|---|---|---|
| committer | Mary <thog@protonmail.com> | 2023-04-27 23:51:14 +0200 |
| commit | cee712105850ac3385cd0091a923438167433f9f (patch) | |
| tree | 4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.Common/GraphicsDriver/NVAPI/NvapiUnicodeString.cs | |
| parent | cd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff) | |
Move solution and projects to src
Diffstat (limited to 'Ryujinx.Common/GraphicsDriver/NVAPI/NvapiUnicodeString.cs')
| -rw-r--r-- | Ryujinx.Common/GraphicsDriver/NVAPI/NvapiUnicodeString.cs | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/Ryujinx.Common/GraphicsDriver/NVAPI/NvapiUnicodeString.cs b/Ryujinx.Common/GraphicsDriver/NVAPI/NvapiUnicodeString.cs deleted file mode 100644 index 6bbff2de..00000000 --- a/Ryujinx.Common/GraphicsDriver/NVAPI/NvapiUnicodeString.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Runtime.InteropServices; -using System.Text; - -namespace Ryujinx.Common.GraphicsDriver.NVAPI -{ - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public unsafe struct NvapiUnicodeString - { - private fixed byte _data[4096]; - - public NvapiUnicodeString(string text) - { - Set(text); - } - - public string Get() - { - fixed (byte* data = _data) - { - string text = Encoding.Unicode.GetString(data, 4096); - - int index = text.IndexOf('\0'); - if (index > -1) - { - text = text.Remove(index); - } - - return text; - } - } - - public void Set(string text) - { - text += '\0'; - fixed (char* textPtr = text) - fixed (byte* data = _data) - { - int written = Encoding.Unicode.GetBytes(textPtr, text.Length, data, 4096); - } - } - } -} |
