mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-16 01:45:36 +02:00
Huge overhaul of the entire MapgenParams system
MapgenParams is no longer a polymorphic class, eliminating the need for messy and bug-prone reallocations. Separation between the common and mapgen-specific parameters is now strongly defined. Mapgen parameters objects are now properly encapsulated within the proper subsystems.
This commit is contained in:
@@ -147,7 +147,7 @@ double sphere(double x, double y, double z, double d, int ITR = 1) {
|
||||
|
||||
//////////////////////// Mapgen Math parameter read/write
|
||||
|
||||
bool MapgenMathParams::readParams(Settings *settings) {
|
||||
void MapgenMathParams::readParams(Settings *settings) {
|
||||
//params = settings->getJson("mg_math");
|
||||
// can be counfigured from here.
|
||||
std::string value = "{}";
|
||||
@@ -157,8 +157,6 @@ bool MapgenMathParams::readParams(Settings *settings) {
|
||||
}
|
||||
|
||||
if (params["generator"].empty()) params["generator"] = settings->get("mgmath_generator");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -169,8 +167,8 @@ void MapgenMathParams::writeParams(Settings *settings) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
MapgenMath::MapgenMath(int mapgenid, MapgenMathParams *params_, EmergeManager *emerge) : MapgenV7(mapgenid, params_, emerge) {
|
||||
mg_params = params_;
|
||||
MapgenMath::MapgenMath(int mapgenid, MapgenParams *params_, EmergeManager *emerge) : MapgenV7(mapgenid, params_, emerge) {
|
||||
mg_params = (MapgenMathParams *)params_;
|
||||
this->flags |= MG_NOLIGHT;
|
||||
|
||||
Json::Value & params = mg_params->params;
|
||||
|
Reference in New Issue
Block a user