From 5a34f40d80ea1a339b599bc11db549a6bd86912f Mon Sep 17 00:00:00 2001 From: kwolekr Date: Mon, 3 Feb 2014 22:42:10 -0500 Subject: 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. --- src/mapgen_math.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/mapgen_math.cpp') diff --git a/src/mapgen_math.cpp b/src/mapgen_math.cpp index 7748895b5..aee2b0d2a 100644 --- a/src/mapgen_math.cpp +++ b/src/mapgen_math.cpp @@ -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; -- cgit v1.2.3