From 0a8519a26fc7c10b4e7415746e9045caa3ae978f Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 15 Jun 2013 22:23:06 -0400 Subject: Add initial Decoration support, many misc. improvements & modifications --- src/emerge.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/emerge.cpp') diff --git a/src/emerge.cpp b/src/emerge.cpp index fd6c0e91f..2c94d46c1 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -101,6 +101,10 @@ EmergeManager::~EmergeManager() { for (unsigned int i = 0; i < ores.size(); i++) delete ores[i]; ores.clear(); + + for (unsigned int i = 0; i < decorations.size(); i++) + delete decorations[i]; + decorations.clear(); for (std::map::iterator iter = mglist.begin(); iter != mglist.end(); iter ++) { -- cgit v1.2.3 From 0b20768a242851364ba645a99c24a85c23544f86 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Mon, 17 Jun 2013 18:51:29 -0400 Subject: Decoration, Ore: Resolve node names on Mapgen init --- src/emerge.cpp | 6 +++++- src/mapgen.cpp | 4 ---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/emerge.cpp') diff --git a/src/emerge.cpp b/src/emerge.cpp index 2c94d46c1..9edc42b7b 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -123,9 +123,13 @@ void EmergeManager::initMapgens(MapgenParams *mgparams) { return; biomedef->resolveNodeNames(ndef); + for (size_t i = 0; i != ores.size(); i++) + ores[i]->resolveNodeNames(ndef); + for (size_t i = 0; i != decorations.size(); i++) + decorations[i]->resolveNodeNames(ndef); this->params = mgparams; - for (unsigned int i = 0; i != emergethread.size(); i++) { + for (size_t i = 0; i != emergethread.size(); i++) { mg = createMapgen(params->mg_name, 0, params); if (!mg) { infostream << "EmergeManager: falling back to mapgen v6" << std::endl; diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 17afcf350..d2bde0063 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -109,8 +109,6 @@ void Ore::placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { if (!in_range) return; - resolveNodeNames(mg->ndef); - int ymin, ymax; if (in_range & ORE_RANGE_MIRROR) { ymin = MYMAX(nmin.Y, -height_max); @@ -226,8 +224,6 @@ void Decoration::resolveNodeNames(INodeDefManager *ndef) { void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { - resolveNodeNames(mg->ndef); - PseudoRandom ps(blockseed + 53); int carea_size = nmax.X - nmin.X + 1; -- cgit v1.2.3