// Update mesh based skybox colours if applicable.
sky->setSkyColors(*event->set_sky);
sky->setHorizonTint(
- event->set_sky->sun_tint,
- event->set_sky->moon_tint,
- event->set_sky->tint_type
+ event->set_sky->fog_sun_tint,
+ event->set_sky->fog_moon_tint,
+ event->set_sky->fog_tint_type
);
} else if (event->set_sky->type == "skybox" &&
event->set_sky->textures.size() == 6) {
sky->setFallbackBgColor(event->set_sky->bgcolor);
// Set sunrise and sunset fog tinting:
sky->setHorizonTint(
- event->set_sky->sun_tint,
- event->set_sky->moon_tint,
- event->set_sky->tint_type
+ event->set_sky->fog_sun_tint,
+ event->set_sky->fog_moon_tint,
+ event->set_sky->fog_tint_type
);
// Add textures to skybox.
for (int i = 0; i < 6; i++)
pointcolor_sun_f.g = pointcolor_light *
(float)m_materials[3].EmissiveColor.getGreen() / 255;
} else if (!m_default_tint) {
- pointcolor_sun_f = m_sky_params.sun_tint;
+ pointcolor_sun_f = m_sky_params.fog_sun_tint;
} else {
pointcolor_sun_f.r = pointcolor_light * 1;
pointcolor_sun_f.b = pointcolor_light *
);
} else {
pointcolor_moon_f = video::SColorf(
- (m_sky_params.moon_tint.getRed() / 255) * pointcolor_light,
- (m_sky_params.moon_tint.getGreen() / 255) * pointcolor_light,
- (m_sky_params.moon_tint.getBlue() / 255) * pointcolor_light,
+ (m_sky_params.fog_moon_tint.getRed() / 255) * pointcolor_light,
+ (m_sky_params.fog_moon_tint.getGreen() / 255) * pointcolor_light,
+ (m_sky_params.fog_moon_tint.getBlue() / 255) * pointcolor_light,
1
);
}
std::string use_sun_tint)
{
// Change sun and moon tinting:
- m_sky_params.sun_tint = sun_tint;
- m_sky_params.moon_tint = moon_tint;
+ m_sky_params.fog_sun_tint = sun_tint;
+ m_sky_params.fog_moon_tint = moon_tint;
// Faster than comparing strings every rendering frame
if (use_sun_tint == "default")
m_default_tint = true;
// Fix for "regular" skies, as color isn't kept:
if (skybox.type == "regular") {
skybox.sky_color = sky_defaults.getSkyColorDefaults();
- skybox.tint_type = "default";
- skybox.moon_tint = video::SColor(255, 255, 255, 255);
- skybox.sun_tint = video::SColor(255, 255, 255, 255);
+ skybox.fog_tint_type = "default";
+ skybox.fog_moon_tint = video::SColor(255, 255, 255, 255);
+ skybox.fog_sun_tint = video::SColor(255, 255, 255, 255);
}
else {
sun.visible = false;
std::string texture;
*pkt >> skybox.bgcolor >> skybox.type >> skybox.clouds >>
- skybox.sun_tint >> skybox.moon_tint >> skybox.tint_type;
+ skybox.fog_sun_tint >> skybox.fog_moon_tint >> skybox.fog_tint_type;
if (skybox.type == "skybox") {
*pkt >> texture_count;
u8[4] night_sky (ARGB)
u8[4] night_horizon (ARGB)
u8[4] indoors (ARGB)
- u8[4] sun_tint (ARGB)
- u8[4] moon_tint (ARGB)
- std::string tint_type
+ u8[4] fog_sun_tint (ARGB)
+ u8[4] fog_moon_tint (ARGB)
+ std::string fog_tint_type
*/
TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO = 0x50,
m_skybox_params.sky_color = sky_defaults.getSkyColorDefaults();
m_skybox_params.type = "regular";
m_skybox_params.clouds = true;
- m_skybox_params.sun_tint = video::SColor(255, 244, 125, 29);
- m_skybox_params.moon_tint = video::SColorf(0.5, 0.6, 0.8, 1).toSColor();
- m_skybox_params.tint_type = "default";
+ m_skybox_params.fog_sun_tint = video::SColor(255, 244, 125, 29);
+ m_skybox_params.fog_moon_tint = video::SColorf(0.5, 0.6, 0.8, 1).toSColor();
+ m_skybox_params.fog_tint_type = "default";
m_sun_params = sky_defaults.getSunDefaults();
m_moon_params = sky_defaults.getMoonDefaults();
lua_pop(L, 1);
// Prevent flickering clouds at dawn/dusk:
- skybox_params.sun_tint = video::SColor(255, 255, 255, 255);
+ skybox_params.fog_sun_tint = video::SColor(255, 255, 255, 255);
lua_getfield(L, -1, "fog_sun_tint");
- read_color(L, -1, &skybox_params.sun_tint);
+ read_color(L, -1, &skybox_params.fog_sun_tint);
lua_pop(L, 1);
- skybox_params.moon_tint = video::SColor(255, 255, 255, 255);
+ skybox_params.fog_moon_tint = video::SColor(255, 255, 255, 255);
lua_getfield(L, -1, "fog_moon_tint");
- read_color(L, -1, &skybox_params.moon_tint);
+ read_color(L, -1, &skybox_params.fog_moon_tint);
lua_pop(L, 1);
lua_getfield(L, -1, "fog_tint_type");
if (!lua_isnil(L, -1))
- skybox_params.tint_type = luaL_checkstring(L, -1);
+ skybox_params.fog_tint_type = luaL_checkstring(L, -1);
lua_pop(L, 1);
// Because we need to leave the "sky_color" table.
push_ARGB8(L, skybox_params.sky_color.indoors);
lua_setfield(L, -2, "indoors");
}
- push_ARGB8(L, skybox_params.sun_tint);
- lua_setfield(L, -2, "sun_tint");
- push_ARGB8(L, skybox_params.moon_tint);
- lua_setfield(L, -2, "moon_tint");
- lua_pushstring(L, skybox_params.tint_type.c_str());
- lua_setfield(L, -2, "tint_type");
+ push_ARGB8(L, skybox_params.fog_sun_tint);
+ lua_setfield(L, -2, "fog_sun_tint");
+ push_ARGB8(L, skybox_params.fog_moon_tint);
+ lua_setfield(L, -2, "fog_moon_tint");
+ lua_pushstring(L, skybox_params.fog_tint_type.c_str());
+ lua_setfield(L, -2, "fog_tint_type");
return 1;
}
pkt << params.clouds;
} else { // Handle current clients and future clients
pkt << params.bgcolor << params.type
- << params.clouds << params.sun_tint
- << params.moon_tint << params.tint_type;
+ << params.clouds << params.fog_sun_tint
+ << params.fog_moon_tint << params.fog_tint_type;
if (params.type == "skybox") {
pkt << (u16) params.textures.size();
std::vector<std::string> textures;
bool clouds;
SkyColor sky_color;
- video::SColor sun_tint;
- video::SColor moon_tint;
- std::string tint_type;
+ video::SColor fog_sun_tint;
+ video::SColor fog_moon_tint;
+ std::string fog_tint_type;
};
struct SunParams