forked from mirror/DotRecast
bugfix: not working reousrce.load
This commit is contained in:
parent
a1e38a493d
commit
c294275da4
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue