Mapgen: Remove unnecessary 'this->' from constructors (#6069)
This commit is contained in:
parent
367d218f2b
commit
2e53801fc0
@ -51,15 +51,15 @@ FlagDesc flagdesc_mapgen_flat[] = {
|
|||||||
MapgenFlat::MapgenFlat(int mapgenid, MapgenFlatParams *params, EmergeManager *emerge)
|
MapgenFlat::MapgenFlat(int mapgenid, MapgenFlatParams *params, EmergeManager *emerge)
|
||||||
: MapgenBasic(mapgenid, params, emerge)
|
: MapgenBasic(mapgenid, params, emerge)
|
||||||
{
|
{
|
||||||
this->spflags = params->spflags;
|
spflags = params->spflags;
|
||||||
this->ground_level = params->ground_level;
|
ground_level = params->ground_level;
|
||||||
this->large_cave_depth = params->large_cave_depth;
|
large_cave_depth = params->large_cave_depth;
|
||||||
this->lava_depth = params->lava_depth;
|
lava_depth = params->lava_depth;
|
||||||
this->cave_width = params->cave_width;
|
cave_width = params->cave_width;
|
||||||
this->lake_threshold = params->lake_threshold;
|
lake_threshold = params->lake_threshold;
|
||||||
this->lake_steepness = params->lake_steepness;
|
lake_steepness = params->lake_steepness;
|
||||||
this->hill_threshold = params->hill_threshold;
|
hill_threshold = params->hill_threshold;
|
||||||
this->hill_steepness = params->hill_steepness;
|
hill_steepness = params->hill_steepness;
|
||||||
|
|
||||||
// 2D noise
|
// 2D noise
|
||||||
noise_filler_depth = new Noise(¶ms->np_filler_depth, seed, csize.X, csize.Z);
|
noise_filler_depth = new Noise(¶ms->np_filler_depth, seed, csize.X, csize.Z);
|
||||||
|
@ -49,19 +49,19 @@ FlagDesc flagdesc_mapgen_fractal[] = {
|
|||||||
MapgenFractal::MapgenFractal(int mapgenid, MapgenFractalParams *params, EmergeManager *emerge)
|
MapgenFractal::MapgenFractal(int mapgenid, MapgenFractalParams *params, EmergeManager *emerge)
|
||||||
: MapgenBasic(mapgenid, params, emerge)
|
: MapgenBasic(mapgenid, params, emerge)
|
||||||
{
|
{
|
||||||
this->spflags = params->spflags;
|
spflags = params->spflags;
|
||||||
this->cave_width = params->cave_width;
|
cave_width = params->cave_width;
|
||||||
this->large_cave_depth = params->large_cave_depth;
|
large_cave_depth = params->large_cave_depth;
|
||||||
this->lava_depth = params->lava_depth;
|
lava_depth = params->lava_depth;
|
||||||
this->fractal = params->fractal;
|
fractal = params->fractal;
|
||||||
this->iterations = params->iterations;
|
iterations = params->iterations;
|
||||||
this->scale = params->scale;
|
scale = params->scale;
|
||||||
this->offset = params->offset;
|
offset = params->offset;
|
||||||
this->slice_w = params->slice_w;
|
slice_w = params->slice_w;
|
||||||
this->julia_x = params->julia_x;
|
julia_x = params->julia_x;
|
||||||
this->julia_y = params->julia_y;
|
julia_y = params->julia_y;
|
||||||
this->julia_z = params->julia_z;
|
julia_z = params->julia_z;
|
||||||
this->julia_w = params->julia_w;
|
julia_w = params->julia_w;
|
||||||
|
|
||||||
//// 2D terrain noise
|
//// 2D terrain noise
|
||||||
noise_seabed = new Noise(¶ms->np_seabed, seed, csize.X, csize.Z);
|
noise_seabed = new Noise(¶ms->np_seabed, seed, csize.X, csize.Z);
|
||||||
@ -70,8 +70,8 @@ MapgenFractal::MapgenFractal(int mapgenid, MapgenFractalParams *params, EmergeMa
|
|||||||
MapgenBasic::np_cave1 = params->np_cave1;
|
MapgenBasic::np_cave1 = params->np_cave1;
|
||||||
MapgenBasic::np_cave2 = params->np_cave2;
|
MapgenBasic::np_cave2 = params->np_cave2;
|
||||||
|
|
||||||
this->formula = fractal / 2 + fractal % 2;
|
formula = fractal / 2 + fractal % 2;
|
||||||
this->julia = fractal % 2 == 0;
|
julia = fractal % 2 == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,13 +48,13 @@ FlagDesc flagdesc_mapgen_v5[] = {
|
|||||||
MapgenV5::MapgenV5(int mapgenid, MapgenV5Params *params, EmergeManager *emerge)
|
MapgenV5::MapgenV5(int mapgenid, MapgenV5Params *params, EmergeManager *emerge)
|
||||||
: MapgenBasic(mapgenid, params, emerge)
|
: MapgenBasic(mapgenid, params, emerge)
|
||||||
{
|
{
|
||||||
this->spflags = params->spflags;
|
spflags = params->spflags;
|
||||||
this->cave_width = params->cave_width;
|
cave_width = params->cave_width;
|
||||||
this->large_cave_depth = params->large_cave_depth;
|
large_cave_depth = params->large_cave_depth;
|
||||||
this->lava_depth = params->lava_depth;
|
lava_depth = params->lava_depth;
|
||||||
this->cavern_limit = params->cavern_limit;
|
cavern_limit = params->cavern_limit;
|
||||||
this->cavern_taper = params->cavern_taper;
|
cavern_taper = params->cavern_taper;
|
||||||
this->cavern_threshold = params->cavern_threshold;
|
cavern_threshold = params->cavern_threshold;
|
||||||
|
|
||||||
// Terrain noise
|
// Terrain noise
|
||||||
noise_filler_depth = new Noise(¶ms->np_filler_depth, seed, csize.X, csize.Z);
|
noise_filler_depth = new Noise(¶ms->np_filler_depth, seed, csize.X, csize.Z);
|
||||||
|
@ -58,14 +58,14 @@ FlagDesc flagdesc_mapgen_v6[] = {
|
|||||||
MapgenV6::MapgenV6(int mapgenid, MapgenV6Params *params, EmergeManager *emerge)
|
MapgenV6::MapgenV6(int mapgenid, MapgenV6Params *params, EmergeManager *emerge)
|
||||||
: Mapgen(mapgenid, params, emerge)
|
: Mapgen(mapgenid, params, emerge)
|
||||||
{
|
{
|
||||||
this->m_emerge = emerge;
|
m_emerge = emerge;
|
||||||
this->ystride = csize.X; //////fix this
|
ystride = csize.X; //////fix this
|
||||||
|
|
||||||
this->heightmap = new s16[csize.X * csize.Z];
|
heightmap = new s16[csize.X * csize.Z];
|
||||||
|
|
||||||
this->spflags = params->spflags;
|
spflags = params->spflags;
|
||||||
this->freq_desert = params->freq_desert;
|
freq_desert = params->freq_desert;
|
||||||
this->freq_beach = params->freq_beach;
|
freq_beach = params->freq_beach;
|
||||||
|
|
||||||
np_cave = ¶ms->np_cave;
|
np_cave = ¶ms->np_cave;
|
||||||
np_humidity = ¶ms->np_humidity;
|
np_humidity = ¶ms->np_humidity;
|
||||||
|
@ -54,21 +54,21 @@ FlagDesc flagdesc_mapgen_v7[] = {
|
|||||||
MapgenV7::MapgenV7(int mapgenid, MapgenV7Params *params, EmergeManager *emerge)
|
MapgenV7::MapgenV7(int mapgenid, MapgenV7Params *params, EmergeManager *emerge)
|
||||||
: MapgenBasic(mapgenid, params, emerge)
|
: MapgenBasic(mapgenid, params, emerge)
|
||||||
{
|
{
|
||||||
this->spflags = params->spflags;
|
spflags = params->spflags;
|
||||||
this->cave_width = params->cave_width;
|
cave_width = params->cave_width;
|
||||||
this->large_cave_depth = params->large_cave_depth;
|
large_cave_depth = params->large_cave_depth;
|
||||||
this->lava_depth = params->lava_depth;
|
lava_depth = params->lava_depth;
|
||||||
this->float_mount_density = params->float_mount_density;
|
float_mount_density = params->float_mount_density;
|
||||||
this->floatland_level = params->floatland_level;
|
floatland_level = params->floatland_level;
|
||||||
this->shadow_limit = params->shadow_limit;
|
shadow_limit = params->shadow_limit;
|
||||||
this->cavern_limit = params->cavern_limit;
|
cavern_limit = params->cavern_limit;
|
||||||
this->cavern_taper = params->cavern_taper;
|
cavern_taper = params->cavern_taper;
|
||||||
this->cavern_threshold = params->cavern_threshold;
|
cavern_threshold = params->cavern_threshold;
|
||||||
|
|
||||||
// This is to avoid a divide-by-zero.
|
// This is to avoid a divide-by-zero.
|
||||||
// Parameter will be saved to map_meta.txt in limited form.
|
// Parameter will be saved to map_meta.txt in limited form.
|
||||||
params->float_mount_height = MYMAX(params->float_mount_height, 1.0f);
|
params->float_mount_height = MYMAX(params->float_mount_height, 1.0f);
|
||||||
this->float_mount_height = params->float_mount_height;
|
float_mount_height = params->float_mount_height;
|
||||||
|
|
||||||
// 2D noise
|
// 2D noise
|
||||||
noise_terrain_base = new Noise(¶ms->np_terrain_base, seed, csize.X, csize.Z);
|
noise_terrain_base = new Noise(¶ms->np_terrain_base, seed, csize.X, csize.Z);
|
||||||
|
@ -66,19 +66,19 @@ MapgenValleys::MapgenValleys(int mapgenid, MapgenValleysParams *params, EmergeMa
|
|||||||
: MapgenBasic(mapgenid, params, emerge)
|
: MapgenBasic(mapgenid, params, emerge)
|
||||||
{
|
{
|
||||||
// NOTE: MapgenValleys has a hard dependency on BiomeGenOriginal
|
// NOTE: MapgenValleys has a hard dependency on BiomeGenOriginal
|
||||||
this->m_bgen = (BiomeGenOriginal *)biomegen;
|
m_bgen = (BiomeGenOriginal *)biomegen;
|
||||||
|
|
||||||
BiomeParamsOriginal *bp = (BiomeParamsOriginal *)params->bparams;
|
BiomeParamsOriginal *bp = (BiomeParamsOriginal *)params->bparams;
|
||||||
|
|
||||||
this->spflags = params->spflags;
|
spflags = params->spflags;
|
||||||
this->altitude_chill = params->altitude_chill;
|
altitude_chill = params->altitude_chill;
|
||||||
this->large_cave_depth = params->large_cave_depth;
|
large_cave_depth = params->large_cave_depth;
|
||||||
this->lava_features_lim = rangelim(params->lava_features, 0, 10);
|
lava_features_lim = rangelim(params->lava_features, 0, 10);
|
||||||
this->massive_cave_depth = params->massive_cave_depth;
|
massive_cave_depth = params->massive_cave_depth;
|
||||||
this->river_depth_bed = params->river_depth + 1.f;
|
river_depth_bed = params->river_depth + 1.f;
|
||||||
this->river_size_factor = params->river_size / 100.f;
|
river_size_factor = params->river_size / 100.f;
|
||||||
this->water_features_lim = rangelim(params->water_features, 0, 10);
|
water_features_lim = rangelim(params->water_features, 0, 10);
|
||||||
this->cave_width = params->cave_width;
|
cave_width = params->cave_width;
|
||||||
|
|
||||||
//// 2D Terrain noise
|
//// 2D Terrain noise
|
||||||
noise_filler_depth = new Noise(¶ms->np_filler_depth, seed, csize.X, csize.Z);
|
noise_filler_depth = new Noise(¶ms->np_filler_depth, seed, csize.X, csize.Z);
|
||||||
@ -96,13 +96,13 @@ MapgenValleys::MapgenValleys(int mapgenid, MapgenValleysParams *params, EmergeMa
|
|||||||
noise_cave2 = new Noise(¶ms->np_cave2, seed, csize.X, csize.Y + 1, csize.Z);
|
noise_cave2 = new Noise(¶ms->np_cave2, seed, csize.X, csize.Y + 1, csize.Z);
|
||||||
noise_massive_caves = new Noise(¶ms->np_massive_caves, seed, csize.X, csize.Y + 1, csize.Z);
|
noise_massive_caves = new Noise(¶ms->np_massive_caves, seed, csize.X, csize.Y + 1, csize.Z);
|
||||||
|
|
||||||
this->humid_rivers = (spflags & MGVALLEYS_HUMID_RIVERS);
|
humid_rivers = (spflags & MGVALLEYS_HUMID_RIVERS);
|
||||||
this->use_altitude_chill = (spflags & MGVALLEYS_ALT_CHILL);
|
use_altitude_chill = (spflags & MGVALLEYS_ALT_CHILL);
|
||||||
this->humidity_adjust = bp->np_humidity.offset - 50.f;
|
humidity_adjust = bp->np_humidity.offset - 50.f;
|
||||||
|
|
||||||
// a small chance of overflows if the settings are very high
|
// a small chance of overflows if the settings are very high
|
||||||
this->cave_water_max_height = water_level + MYMAX(0, water_features_lim - 4) * 50;
|
cave_water_max_height = water_level + MYMAX(0, water_features_lim - 4) * 50;
|
||||||
this->lava_max_height = water_level + MYMAX(0, lava_features_lim - 4) * 50;
|
lava_max_height = water_level + MYMAX(0, lava_features_lim - 4) * 50;
|
||||||
|
|
||||||
tcave_cache = new float[csize.Y + 2];
|
tcave_cache = new float[csize.Y + 2];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user