bugfix: not working reousrce.load

This commit is contained in:
ikpil 2023-09-23 14:47:04 +09:00
parent a1e38a493d
commit c294275da4
1 changed files with 6 additions and 1 deletions

View File

@ -6,7 +6,12 @@ namespace DotRecast.Core
{ {
public static byte[] Load(string filename) public static byte[] Load(string filename)
{ {
var filepath = RcDirectory.SearchFile($"resources/{filename}"); var filepath = filename;
if (!File.Exists(filepath))
{
filepath = RcDirectory.SearchFile($"resources/{filename}");
}
using var fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read); using var fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read);
byte[] buffer = new byte[fs.Length]; byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length); fs.Read(buffer, 0, buffer.Length);