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.Graphics.Gpu/Shader/DiskCache/DiskCacheCommon.cs | |
| parent | cd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff) | |
Move solution and projects to src
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheCommon.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheCommon.cs | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheCommon.cs b/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheCommon.cs deleted file mode 100644 index c8a9f7ff..00000000 --- a/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheCommon.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Ryujinx.Common.Logging; -using System.IO; - -namespace Ryujinx.Graphics.Gpu.Shader.DiskCache -{ - /// <summary> - /// Common disk cache utility methods. - /// </summary> - static class DiskCacheCommon - { - /// <summary> - /// Opens a file for read or write. - /// </summary> - /// <param name="basePath">Base path of the file (should not include the file name)</param> - /// <param name="fileName">Name of the file</param> - /// <param name="writable">Indicates if the file will be read or written</param> - /// <returns>File stream</returns> - public static FileStream OpenFile(string basePath, string fileName, bool writable) - { - string fullPath = Path.Combine(basePath, fileName); - - FileMode mode; - FileAccess access; - - if (writable) - { - mode = FileMode.OpenOrCreate; - access = FileAccess.ReadWrite; - } - else - { - mode = FileMode.Open; - access = FileAccess.Read; - } - - try - { - return new FileStream(fullPath, mode, access, FileShare.Read); - } - catch (IOException ioException) - { - Logger.Error?.Print(LogClass.Gpu, $"Could not access file \"{fullPath}\". {ioException.Message}"); - - throw new DiskCacheLoadException(DiskCacheLoadResult.NoAccess); - } - } - - /// <summary> - /// Gets the compression algorithm that should be used when writing the disk cache. - /// </summary> - /// <returns>Compression algorithm</returns> - public static CompressionAlgorithm GetCompressionAlgorithm() - { - return CompressionAlgorithm.Deflate; - } - } -}
\ No newline at end of file |
