light_ambient setting
This commit is contained in:
parent
ae62cf2eda
commit
82043d019f
@ -1927,3 +1927,7 @@
|
||||
# Params for math mapgen in json format. generators supported: sphere, mandelbox, mengersponge, ... dont forget to lower water_level = -30000
|
||||
# type: string
|
||||
# mg_math = {"generator":"sphere"}
|
||||
|
||||
# Do not propagate dark shadows everywhere. Useful for math mapgen.
|
||||
# type: bool
|
||||
# light_ambient = false
|
||||
|
@ -178,6 +178,7 @@ void fm_set_default_settings(Settings *settings) {
|
||||
settings->setDefault("headless_optimize", "false");
|
||||
//settings->setDefault("node_highlighting", "halo");
|
||||
//settings->setDefault("enable_vbo", win ? "false" : "true");
|
||||
settings->setDefault("light_ambient", "false");
|
||||
|
||||
// Liquid
|
||||
settings->setDefault("liquid_real", "true");
|
||||
|
@ -653,6 +653,8 @@ bool Map::propagateSunlight(v3POS pos, std::set<v3POS> & light_sources,
|
||||
// Whether the sunlight at the top of the bottom block is valid
|
||||
bool block_below_is_valid = true;
|
||||
|
||||
const bool light_ambient = g_settings->getBool("light_ambient");
|
||||
|
||||
v3POS pos_relative = block->getPosRelative();
|
||||
|
||||
for(s16 x = 0; x < MAP_BLOCKSIZE; ++x) {
|
||||
@ -663,7 +665,7 @@ bool Map::propagateSunlight(v3POS pos, std::set<v3POS> & light_sources,
|
||||
|
||||
MapNode n = getNode(pos_relative + v3POS(x, MAP_BLOCKSIZE, z));
|
||||
if (n) {
|
||||
if(n.getLight(LIGHTBANK_DAY, m_gamedef->ndef()) != LIGHT_SUN) {
|
||||
if(n.getLight(LIGHTBANK_DAY, m_gamedef->ndef()) != LIGHT_SUN && !light_ambient) {
|
||||
no_sunlight = true;
|
||||
}
|
||||
} else {
|
||||
|
@ -198,10 +198,10 @@ inline double rooms(double dx, double dy, double dz, double d, int ITR = 1, int
|
||||
int x = dx, y = dy, z = dz;
|
||||
// if (x < y && x < z) return 0; // debug slice
|
||||
const auto rooms_pow_min = 2, rooms_pow_max = 9;
|
||||
const auto rooms_pow_cut_max = 8; // 7?
|
||||
const auto rooms_pow_cut_max = 7;
|
||||
const auto rooms_pow_fill_max = 4;
|
||||
const auto room_fill_every = 10;
|
||||
const auto room_big_every = 13; //14 ?
|
||||
const auto room_big_every = 14;
|
||||
const auto rooms_limit = 13; // 16384. next larger than map limit
|
||||
// errorstream << " t "<<" x=" << x << " y="<< y << " x="<<z << " pw="<<pw<< " every="<<every<< " ty="<<((int)y%every)<<"\n";
|
||||
const int cxi = (x >> rooms_pow_max), cyi = (y >> rooms_pow_max), czi = (z >> rooms_pow_max);
|
||||
|
Loading…
x
Reference in New Issue
Block a user