mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00: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:
parent
a439343844
commit
5a34f40d80
24 changed files with 402 additions and 619 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue