bool new_style_water = g_settings->getBool("new_style_water");
bool new_style_leaves = g_settings->getBool("new_style_leaves");
bool invisible_stone = g_settings->getBool("invisible_stone");
+ bool opaque_water = g_settings->getBool("opaque_water");
content_t i;
ContentFeatures *f = NULL;
f->liquid_alternative_source = CONTENT_WATERSOURCE;
f->liquid_viscosity = WATER_VISC;
#ifndef SERVER
- f->vertex_alpha = WATER_ALPHA;
+ if(!opaque_water)
+ f->vertex_alpha = WATER_ALPHA;
f->post_effect_color = video::SColor(64, 100, 100, 200);
if(f->special_material == NULL && g_texturesource)
{
f->special_material->setFlag(video::EMF_BACK_FACE_CULLING, false);
f->special_material->setFlag(video::EMF_BILINEAR_FILTER, false);
f->special_material->setFlag(video::EMF_FOG_ENABLE, true);
- f->special_material->MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;
+ if(!opaque_water)
+ f->special_material->MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;
AtlasPointer *pa_water1 = new AtlasPointer(g_texturesource->getTexture(
g_texturesource->getTextureId("water.png")));
f->special_material->setTexture(0, pa_water1->atlas);
if(g_texturesource)
t.texture = g_texturesource->getTexture("water.png");
- t.alpha = WATER_ALPHA;
- t.material_type = MATERIAL_ALPHA_VERTEX;
+ if(!opaque_water){
+ t.alpha = WATER_ALPHA;
+ t.material_type = MATERIAL_ALPHA_VERTEX;
+ }
t.material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING;
f->setAllTiles(t);
#endif
f->liquid_alternative_source = CONTENT_WATERSOURCE;
f->liquid_viscosity = WATER_VISC;
#ifndef SERVER
- f->vertex_alpha = WATER_ALPHA;
+ if(!opaque_water)
+ f->vertex_alpha = WATER_ALPHA;
f->post_effect_color = video::SColor(64, 100, 100, 200);
if(f->special_material == NULL && g_texturesource)
{
settings->setDefault("screenshot_path", ".");
settings->setDefault("view_bobbing_amount", "1.0");
settings->setDefault("enable_3d_clouds", "false");
+ settings->setDefault("opaque_water", "false");
// Server stuff
// "map-dir" doesn't exist by default.
bool fancy_trees;
bool smooth_lighting;
bool clouds_3d;
+ bool opaque_water;
// Client options
{
else
clouds_3d = m_data->clouds_3d;
}
+ {
+ gui::IGUIElement *e = getElementFromId(GUI_ID_OPAQUE_WATER_CB);
+ if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
+ opaque_water = ((gui::IGUICheckBox*)e)->isChecked();
+ else
+ opaque_water = m_data->opaque_water;
+ }
// Server options
{
Environment->addCheckBox(clouds_3d, rect, this, GUI_ID_3D_CLOUDS_CB,
wgettext("3D Clouds"));
}
+ {
+ core::rect<s32> rect(0, 0, 250, 30);
+ rect += topleft_client + v2s32(35, 150+60);
+ Environment->addCheckBox(opaque_water, rect, this, GUI_ID_OPAQUE_WATER_CB,
+ wgettext("Opaque water"));
+ }
// Start game button
{
core::rect<s32> rect(0, 0, 180, 30);
m_data->enable_damage = ((gui::IGUICheckBox*)e)->isChecked();
}
{
- gui::IGUIElement *e = getElementFromId(GUI_ID_3D_CLOUDS_CB);
+ gui::IGUIElement *e = getElementFromId(GUI_ID_FANCYTREE_CB);
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
- m_data->clouds_3d = ((gui::IGUICheckBox*)e)->isChecked();
+ m_data->fancy_trees = ((gui::IGUICheckBox*)e)->isChecked();
}
{
gui::IGUIElement *e = getElementFromId(GUI_ID_SMOOTH_LIGHTING_CB);
m_data->smooth_lighting = ((gui::IGUICheckBox*)e)->isChecked();
}
{
- gui::IGUIElement *e = getElementFromId(GUI_ID_FANCYTREE_CB);
+ gui::IGUIElement *e = getElementFromId(GUI_ID_3D_CLOUDS_CB);
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
- m_data->fancy_trees = ((gui::IGUICheckBox*)e)->isChecked();
+ m_data->clouds_3d = ((gui::IGUICheckBox*)e)->isChecked();
+ }
+ {
+ gui::IGUIElement *e = getElementFromId(GUI_ID_OPAQUE_WATER_CB);
+ if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
+ m_data->opaque_water = ((gui::IGUICheckBox*)e)->isChecked();
}
m_accepted = true;
GUI_ID_FANCYTREE_CB,
GUI_ID_SMOOTH_LIGHTING_CB,
GUI_ID_3D_CLOUDS_CB,
+ GUI_ID_OPAQUE_WATER_CB,
GUI_ID_DAMAGE_CB,
GUI_ID_CREATIVE_CB,
GUI_ID_JOIN_GAME_BUTTON,
bool fancy_trees;
bool smooth_lighting;
bool clouds_3d;
+ bool opaque_water;
// Server options
bool creative_mode;
bool enable_damage;
menudata.fancy_trees = g_settings->getBool("new_style_leaves");
menudata.smooth_lighting = g_settings->getBool("smooth_lighting");
menudata.clouds_3d = g_settings->getBool("enable_3d_clouds");
+ menudata.opaque_water = g_settings->getBool("opaque_water");
menudata.creative_mode = g_settings->getBool("creative_mode");
menudata.enable_damage = g_settings->getBool("enable_damage");
g_settings->set("new_style_leaves", itos(menudata.fancy_trees));
g_settings->set("smooth_lighting", itos(menudata.smooth_lighting));
g_settings->set("enable_3d_clouds", itos(menudata.clouds_3d));
+ g_settings->set("opaque_water", itos(menudata.opaque_water));
g_settings->set("creative_mode", itos(menudata.creative_mode));
g_settings->set("enable_damage", itos(menudata.enable_damage));