Skip to content

Commit

Permalink
Remove unused noise param from archipelago functions et al.
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Rideout committed Nov 8, 2015
1 parent cd22b2b commit b6b1c0a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/heman.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ heman_image* heman_generate_archipelago_heightmap(
// RGB image in addition to the heightmap.
void heman_generate_archipelago_political(int width, int height,
heman_points* points, const heman_color* colors, heman_color ocean,
float noiseamt, int seed, heman_image** elevation, heman_image** political);
int seed, heman_image** elevation, heman_image** political);

// High-level function that sums up a number of noise octaves, also known as
// Fractional Brownian Motion. Taken alone, Perlin / Simplex noise are not
Expand Down
6 changes: 3 additions & 3 deletions src/generate.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ heman_image* heman_generate_archipelago_heightmap(

heman_image* heman_generate_archipelago_political_1(int width, int height,
heman_points* points, const heman_color* colors, heman_color ocean,
float noiseamt, int seed)
int seed)
{
heman_image* contour = heman_image_create(width, height, 3);
heman_image_clear(contour, 0);
Expand Down Expand Up @@ -340,10 +340,10 @@ heman_image* heman_generate_archipelago_political_2(int width, int height,

void heman_generate_archipelago_political(int width, int height,
heman_points* points, const heman_color* colors, heman_color ocean,
float noiseamt, int seed, heman_image** elevation, heman_image** political)
int seed, heman_image** elevation, heman_image** political)
{
*political = heman_generate_archipelago_political_1(
width, height, points, colors, ocean, noiseamt, seed);
width, height, points, colors, ocean, seed);
*elevation = heman_generate_archipelago_political_2(
width, height, ocean, seed, *political);
}
10 changes: 8 additions & 2 deletions src/ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,12 @@ heman_image* heman_ops_merge_political(
HEMAN_FLOAT oceang = (HEMAN_FLOAT)((ocean >> 8) & 0xff) * inv;
HEMAN_FLOAT oceanb = (HEMAN_FLOAT)(ocean & 0xff) * inv;
int size = hmap->height * hmap->width;
float minh = 1000;
float maxh = -1000;
for (int i = 0; i < size; ++i) {
minh = MIN(minh, pheight[i]);
maxh = MIN(maxh, pheight[i]);
}
for (int i = 0; i < size; ++i) {
HEMAN_FLOAT h = *pheight++;
if (h < 0) {
Expand All @@ -359,7 +365,7 @@ heman_image* heman_ops_merge_political(
*pmerged++ = *pcolour++;
*pmerged++ = *pcolour++;
}
*pmerged++ = h;
*pmerged++ = (h - minh) / (maxh - minh);
}
return result;
}
Expand All @@ -384,7 +390,7 @@ heman_image* heman_ops_emboss(heman_image* img, int mode)
float land_amplitude = 0.0005;
float land_frequency = 256.0;
float ocean_amplitude = 0.5;
float ocean_frequency = 2.0;
float ocean_frequency = 1.0;

#pragma omp parallel for
for (int y = 0; y < height; y++) {
Expand Down

0 comments on commit b6b1c0a

Please sign in to comment.