Squashing commits

This commit is contained in:
Xeno333 2024-05-17 14:25:43 -05:00
parent 93f4844c9c
commit f8f01e134a
6 changed files with 25 additions and 8 deletions

View File

@ -265,8 +265,8 @@ undersampling (Undersampling) int 1 1 8
[**Graphics Effects]
# Makes all liquids opaque
opaque_water (Opaque liquids) bool false
# Makes water translucent
translucent_water (Translucent water) bool true
# Leaves style:
# - Fancy: all faces visible

View File

@ -282,7 +282,7 @@ void set_default_settings()
settings->setDefault("enable_3d_clouds", "true");
settings->setDefault("cloud_radius", "12");
settings->setDefault("menu_clouds", "true");
settings->setDefault("opaque_water", "false");
settings->setDefault("translucent_water", "true");
settings->setDefault("console_height", "0.6");
settings->setDefault("console_color", "(0,0,0)");
settings->setDefault("console_alpha", "200");

View File

@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "filesys.h"
#include "version.h"
#include "defaultsettings.h"
#include "migratesettings.hpp"
#include "gettext.h"
#include "log.h"
#include "util/quicktune.h"
@ -687,6 +688,8 @@ static bool init_common(const Settings &cmd_args, int argc, char *argv[])
if (!read_config_file(cmd_args))
return false;
migrate_settings();
init_log_streams(cmd_args);
// Initialize random seed

14
src/migratesettings.hpp Normal file
View File

@ -0,0 +1,14 @@
// Minetest
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "settings.h"
void migrate_settings()
{
// Converts opaque_water to translucent_water
if (g_settings->existsLocal("opaque_water")) {
g_settings->set("translucent_water",
g_settings->getBool("opaque_water") ? "false" : "true");
g_settings->remove("opaque_water");
}
}

View File

@ -283,7 +283,7 @@ void TileDef::deSerialize(std::istream &is, NodeDrawType drawtype, u16 protocol_
void TextureSettings::readSettings()
{
connected_glass = g_settings->getBool("connected_glass");
opaque_water = g_settings->getBool("opaque_water");
translucent_water = g_settings->getBool("translucent_water");
bool smooth_lighting = g_settings->getBool("smooth_lighting");
enable_mesh_cache = g_settings->getBool("enable_mesh_cache");
enable_minimap = g_settings->getBool("enable_minimap");
@ -683,7 +683,7 @@ void ContentFeatures::deSerialize(std::istream &is, u16 protocol_version)
if (is.eof())
throw SerializationError("");
post_effect_color_shaded = tmp;
} catch(SerializationError &e) {};
} catch (SerializationError &e) {};
}
#ifndef SERVER
@ -825,14 +825,14 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc
solidness = 0;
break;
case NDT_LIQUID:
if (tsettings.opaque_water)
if (!tsettings.translucent_water)
alpha = ALPHAMODE_OPAQUE;
solidness = 1;
is_liquid = true;
break;
case NDT_FLOWINGLIQUID:
solidness = 0;
if (tsettings.opaque_water)
if (!tsettings.translucent_water)
alpha = ALPHAMODE_OPAQUE;
is_liquid = true;
break;

View File

@ -184,7 +184,7 @@ public:
WorldAlignMode world_aligned_mode;
AutoScale autoscale_mode;
int node_texture_size;
bool opaque_water;
bool translucent_water;
bool connected_glass;
bool enable_mesh_cache;
bool enable_minimap;