Survivalcraft API 1.8.2.3
v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
ImageReader.cs
浏览该文件的文档.
1
using
System.Diagnostics;
2
using
Engine.Media
;
3
4
namespace
Game.IContentReader
{
5
public
class
ImageReader
:
IContentReader
{
6
public
override
string
Type
=>
"Engine.Media.Image"
;
7
public
override
string
[]
DefaultSuffix
=> [
"webp"
,
"png"
,
"jpg"
,
"jpeg"
];
8
9
public
override
object
Get
(
ContentInfo
[] contents) {
10
ContentInfo
contentInfo = contents[0];
11
Image
result;
12
if
(contentInfo.
InUse
.TryEnter()) {
13
result =
Image
.
Load
(contentInfo.
Duplicate
());
14
contentInfo.
InUse
.Exit();
15
}
16
else
{
17
while
(!contentInfo.
InUse
.TryEnter()) {
18
Thread.Sleep(10);
19
}
20
result =
ContentManager
.
Get
<
Image
>(contentInfo.
ContentPath
, contentInfo.
ContentSuffix
);
21
}
22
return
result;
23
}
24
}
25
}
Engine.Media.Image
定义
Image.cs:16
Engine.Media.Image.Load
static Image Load(Stream stream, ImageFileFormat format)
定义
Image.cs:129
Game.ContentInfo
定义
ContentManager.cs:8
Game.ContentInfo.ContentSuffix
string ContentSuffix
定义
ContentManager.cs:12
Game.ContentInfo.InUse
Lock InUse
定义
ContentManager.cs:14
Game.ContentInfo.ContentPath
string ContentPath
定义
ContentManager.cs:11
Game.ContentInfo.Duplicate
Stream Duplicate()
定义
ContentManager.cs:35
Game.ContentManager
定义
ContentManager.cs:50
Game.ContentManager.Get
static object Get(Type type, string name)
定义
ContentManager.cs:70
Game.IContentReader.IContentReader
定义
IContentReader.cs:2
Game.IContentReader.ImageReader
定义
ImageReader.cs:5
Game.IContentReader.ImageReader.Get
override object Get(ContentInfo[] contents)
定义
ImageReader.cs:9
Game.IContentReader.ImageReader.DefaultSuffix
override string[] DefaultSuffix
定义
ImageReader.cs:7
Game.IContentReader.ImageReader.Type
override string Type
定义
ImageReader.cs:6
Engine.Media
定义
BitmapFont.cs:5
Game.IContentReader
定义
AssemblyReader.cs:3
SurvivalcraftApi 1.8.2.3
Survivalcraft.Windows
IContentReader
ImageReader.cs
制作者
1.16.1