完善客户端功能并同步差距文档
This commit is contained in:
@@ -140,6 +140,7 @@ bool parse_environment(const std::string& text, Environment& out, std::string* e
|
||||
|
||||
if (auto* l = root.kv("ScriptType")) out.script_type = l->size() > 1 ? (*l)[1] : "";
|
||||
out.script_version = root.f("ScriptVersion", 1);
|
||||
out.reserved = root.i("Reserved") != 0;
|
||||
|
||||
if (const Block* dl = root.child("DirectionalLight")) {
|
||||
if (auto* d = dl->kv("Direction"))
|
||||
@@ -163,15 +164,28 @@ bool parse_environment(const std::string& text, Environment& out, std::string* e
|
||||
}
|
||||
if (const Block* fg = root.child("Fog")) {
|
||||
out.fog.fog_level = fg->i("foglevel", 0);
|
||||
out.fog.density_fog = fg->i("IsDensity") != 0;
|
||||
out.fog.near_distance = fg->f("NearDistance", 1);
|
||||
out.fog.far_distance = fg->f("FarDistance", 1);
|
||||
out.fog.color = rgba(fg->kv("Color"));
|
||||
out.fog.enable = (fg->kv("Enable") && fg->i("Enable") != 0) || out.fog.fog_level > 0;
|
||||
}
|
||||
if (const Block* flt = root.child("Filter")) {
|
||||
out.filter.enable = flt->i("Enable") != 0;
|
||||
out.filter.color = rgba(flt->kv("Color"));
|
||||
out.filter.alpha_src = flt->i("AlphaSrc", out.filter.alpha_src);
|
||||
out.filter.alpha_dest = flt->i("AlphaDest", out.filter.alpha_dest);
|
||||
}
|
||||
if (const Block* sb = root.child("SkyBox")) {
|
||||
out.sky.texture_render_mode = sb->i("BTextureRenderMode") != 0;
|
||||
for (int k = 0; k < 3; ++k) out.sky.scale[k] = sb->f("Scale", k + 1);
|
||||
out.sky.gradient_level_upper = sb->i("GradientLevelUpper");
|
||||
out.sky.gradient_level_lower = sb->i("GradientLevelLower");
|
||||
static constexpr const char* kFaceKeys[6] = {
|
||||
"FrontFaceFileName", "BackFaceFileName", "LeftFaceFileName",
|
||||
"RightFaceFileName", "TopFaceFileName", "BottomFaceFileName"};
|
||||
for (int k = 0; k < 6; ++k)
|
||||
out.sky.face_textures[k] = sb->s(kFaceKeys[k]);
|
||||
for (int k = 0; k < 2; ++k) {
|
||||
out.sky.cloud_scale[k] = sb->f("CloudScale", k + 1);
|
||||
out.sky.cloud_texture_scale[k] = sb->f("CloudTextureScale", k + 1);
|
||||
|
||||
Reference in New Issue
Block a user