Skip to content

Commit

Permalink
add mapgen debug info.
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed May 30, 2018
1 parent 78ab1fa commit ce66df1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/generators/default_map_generator_job.cpp
Expand Up @@ -36,6 +36,7 @@
static lg::log_domain log_mapgen("mapgen");
#define ERR_NG LOG_STREAM(err, log_mapgen)
#define LOG_NG LOG_STREAM(info, log_mapgen)
#define DBG_NG LOG_STREAM(debug, log_mapgen)

typedef std::vector<std::vector<int>> height_map;
typedef t_translation::ter_map terrain_map;
Expand Down Expand Up @@ -285,6 +286,7 @@ height_map default_map_generator_job::generate_height_map(size_t width, size_t h
}
}

DBG_NG << iterations << " iterations\n";
for(size_t i = 0; i != iterations; ++i) {

// (x1,y1) is the location of the hill,
Expand Down Expand Up @@ -312,6 +314,7 @@ height_map default_map_generator_job::generate_height_map(size_t width, size_t h
}

const int radius = rng_()%hill_size + 1;
DBG_NG << "placing hill at " << x1 << "," << y1 << " radius=" << radius << " is_valley=" << is_valley << "\n";

const int min_x = x1 - radius > 0 ? x1 - radius : 0;
const int max_x = x1 + radius < static_cast<long>(res.size()) ? x1 + radius : res.size();
Expand Down

0 comments on commit ce66df1

Please sign in to comment.