paysages: Small fixes.

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@211 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-01-03 17:43:01 +00:00 committed by ThunderK
parent 201bd75625
commit 867ba2513f
3 changed files with 43 additions and 44 deletions

View file

@ -15,9 +15,6 @@ static Color _cbPreviewRenderPixel(SmallPreview* preview, double x, double y, do
result.r = result.g = result.b = terrainGetHeightNormalized(x, y); result.r = result.g = result.b = terrainGetHeightNormalized(x, y);
result.a = 1.0; result.a = 1.0;
/* TEMP */
//result = terrainGetColor(x, y, 0.01);
return result; return result;
} }
@ -32,7 +29,7 @@ static void _cbEditNoiseDone(NoiseGenerator* generator)
static void _cbEditNoise(GtkWidget* widget, gpointer data) static void _cbEditNoise(GtkWidget* widget, gpointer data)
{ {
guiNoiseEdit(texturesGetDefinition(0).bump_noise, _cbEditNoiseDone); guiNoiseEdit(_definition.height_noise, _cbEditNoiseDone);
} }
void guiTerrainInit() void guiTerrainInit()

View file

@ -21,6 +21,7 @@ static int _is_rendering = 0;
void autoInit() void autoInit()
{ {
_cpu_count = (int)sysconf(_SC_NPROCESSORS_ONLN); _cpu_count = (int)sysconf(_SC_NPROCESSORS_ONLN);
_cpu_count = 1;
renderSetBackgroundColor(&COLOR_BLACK); renderSetBackgroundColor(&COLOR_BLACK);
terrainInit(); terrainInit();
@ -222,7 +223,7 @@ void autoGenRealisticLandscape(int seed)
terrain = terrainCreateDefinition(); terrain = terrainCreateDefinition();
noiseGenerateBaseNoise(terrain.height_noise, 1048576); noiseGenerateBaseNoise(terrain.height_noise, 1048576);
noiseAddLevelsSimple(terrain.height_noise, 8, 10.0, 1.0); noiseAddLevelsSimple(terrain.height_noise, 10, 10.0, 1.0);
noiseNormalizeHeight(terrain.height_noise, -12.0, 12.0, 0); noiseNormalizeHeight(terrain.height_noise, -12.0, 12.0, 0);
terrainSetDefinition(terrain); terrainSetDefinition(terrain);
terrainDeleteDefinition(terrain); terrainDeleteDefinition(terrain);
@ -231,33 +232,34 @@ void autoGenRealisticLandscape(int seed)
texture = texturesCreateDefinition(); texture = texturesCreateDefinition();
noiseGenerateBaseNoise(texture.bump_noise, 102400); noiseGenerateBaseNoise(texture.bump_noise, 102400);
noiseAddLevelsSimple(texture.bump_noise, 6, 0.01, 0.01); noiseAddLevelsSimple(texture.bump_noise, 6, 0.01, 0.01);
texture.color = COLOR_WHITE; texture.color.r = 0.6;
texture.color.g = 0.55;
texture.color.b = 0.57;
texturesSetDefinition(layer, texture); texturesSetDefinition(layer, texture);
texturesDeleteDefinition(texture); texturesDeleteDefinition(texture);
/*tex = textureCreateFromFile("./data/textures/rock3.jpg"); layer = texturesAddLayer();
tex->scaling_x = 0.003; texture = texturesCreateDefinition();
tex->scaling_y = 0.003; zoneAddHeightRange(texture.zone, 1.0, -1.0, 0.0, 3.0, 15.0);
tex->scaling_z = 0.003; zoneAddSteepnessRange(texture.zone, 1.0, 0.0, 0.0, 0.3, 0.4);
zone = zoneCreate(1.0); noiseGenerateBaseNoise(texture.bump_noise, 102400);
terrainAddTexture(tex, 0.05, zone, 1.0); noiseAddLevelsSimple(texture.bump_noise, 6, 0.02, 0.008);
texture.color.r = 0.2;
texture.color.g = 0.24;
texture.color.b = 0.05;
texturesSetDefinition(layer, texture);
texturesDeleteDefinition(texture);
tex = textureCreateFromFile("./data/textures/grass1.jpg"); /*layer = texturesAddLayer();
tex->scaling_x = 0.0004; texture = texturesCreateDefinition();
tex->scaling_y = 0.0004; zoneAddHeightRange(texture.zone, 1.0, 3.0, 4.0, 100.0, 100.0);
tex->scaling_z = 0.0004; noiseGenerateBaseNoise(texture.bump_noise, 102400);
zone = zoneCreate(0.0); noiseAddLevelsSimple(texture.bump_noise, 6, 0.04, 0.003);
zoneAddHeightRange(zone, 1.0, -1.0, 0.0, 3.0, 15.0); texture.color.r = 1.0;
zoneAddSteepnessRange(zone, 1.0, 0.0, 0.0, 0.3, 0.4); texture.color.g = 1.0;
terrainAddTexture(tex, 0.15, zone, 0.05);*/ texture.color.b = 1.0;
texturesSetDefinition(layer, texture);
/*tex = textureCreateFromFile("./data/textures/snow1.jpg"); texturesDeleteDefinition(texture);*/
tex->scaling_x = 0.001;
tex->scaling_y = 0.001;
tex->scaling_z = 0.001;
zone = zoneCreate(0.0);
zoneAddHeightRange(zone, 1.0, 3.0, 4.0, 100.0, 100.0);
terrainAddTexture(tex, 0.5, zone, 0.1);*/
/* DEBUG */ /* DEBUG */
/*mod = modifierCreate(); /*mod = modifierCreate();

View file

@ -149,7 +149,7 @@ void zoneLoad(Zone* zone, FILE* f)
void zoneCopy(Zone* source, Zone* destination) void zoneCopy(Zone* source, Zone* destination)
{ {
*source = *destination; *destination = *source;
} }
void zoneIncludeCircleArea(Zone* zone, double value, double centerx, double centerz, double softradius, double hardradius) void zoneIncludeCircleArea(Zone* zone, double value, double centerx, double centerz, double softradius, double hardradius)