Survivalcraft API 1.8.2.3
v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
ContentFileBridge.cs
浏览该文件的文档.
1
using
System.Runtime.CompilerServices;
2
using
System.Runtime.InteropServices;
3
4
namespace
Game
{
5
public
static
unsafe
class
ContentFileBridge
{
6
static
byte
*
_sharedPtr
;
7
8
public
static
IntPtr
Initialize
() {
9
nuint length = (nuint)(
ContentFileInfo
.
FileSize
+ 8);
10
void
* ptr = NativeMemory.AlignedAlloc(length, 16);
11
NativeMemory.Clear(ptr, length);
12
_sharedPtr
= (
byte
*)ptr;
13
return
(IntPtr)ptr;
14
}
15
16
public
static
UnmanagedMemoryStream
GetStream
() =>
new
(
_sharedPtr
+ 8,
ContentFileInfo
.
FileSize
);
17
18
public
static
bool
GetIsDownloaded
() => Volatile.Read(ref Unsafe.AsRef<
byte
>(
_sharedPtr
)) == 1;
19
}
20
}
unsafe
unsafe
定义
Main.cs:15
Game.ContentFileBridge
定义
ContentFileBridge.cs:5
Game.ContentFileBridge.GetStream
static UnmanagedMemoryStream GetStream()
定义
ContentFileBridge.cs:16
Game.ContentFileBridge.Initialize
static IntPtr Initialize()
定义
ContentFileBridge.cs:8
Game.ContentFileBridge._sharedPtr
static byte * _sharedPtr
定义
ContentFileBridge.cs:6
Game.ContentFileBridge.GetIsDownloaded
static bool GetIsDownloaded()
定义
ContentFileBridge.cs:18
Game.ContentFileInfo
定义
ContentFileInfo.g.cs:2
Game.ContentFileInfo.FileSize
const long FileSize
定义
ContentFileInfo.g.cs:3
Game
定义
ContentFileBridge.cs:4
SurvivalcraftApi 1.8.2.3
Survivalcraft.Browser
ContentFileBridge.cs
制作者
1.16.1