paysages: Small changes

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@196 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2011-12-17 15:54:10 +00:00 committed by ThunderK
parent d61539e08d
commit d8dfb6c1ab
4 changed files with 153 additions and 116 deletions

View file

@ -679,6 +679,8 @@ A small entropy will make the noise repeat more often.</property>
<object class="GtkVBox" id="vbox12">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel" id="label19">
<property name="visible">True</property>
@ -716,7 +718,6 @@ A small entropy will make the noise repeat more often.</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
@ -724,18 +725,19 @@ A small entropy will make the noise repeat more often.</property>
<object class="GtkVBox" id="vbox7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<child>
<object class="GtkButton" id="terrain_noise_edit">
<property name="label" translatable="yes">Edit noise</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="border_width">5</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
@ -746,7 +748,6 @@ A small entropy will make the noise repeat more often.</property>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
@ -853,6 +854,7 @@ A small entropy will make the noise repeat more often.</property>
<object class="GtkVBox" id="vbox13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<child>
<object class="GtkButton" id="water_noise_edit">
<property name="label" translatable="yes">Edit noise (waves)</property>
@ -1004,7 +1006,6 @@ A small entropy will make the noise repeat more often.</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="spacing">10</property>
<property name="layout_style">spread</property>
<child>
<object class="GtkButton" id="water_apply">
@ -1171,21 +1172,6 @@ A small entropy will make the noise repeat more often.</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkImage" id="sky_colorgradient_sun">
<property name="width_request">250</property>
<property name="height_request">20</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label30">
<property name="visible">True</property>
@ -1227,21 +1213,6 @@ A small entropy will make the noise repeat more often.</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkImage" id="sky_colorgradient_zenith">
<property name="width_request">250</property>
<property name="height_request">20</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label33">
<property name="visible">True</property>
@ -1255,21 +1226,6 @@ A small entropy will make the noise repeat more often.</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkImage" id="sky_colorgradient_haze">
<property name="width_request">250</property>
<property name="height_request">20</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label34">
<property name="visible">True</property>
@ -1326,6 +1282,126 @@ A small entropy will make the noise repeat more often.</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="sky_colorgradient_sun">
<property name="width_request">200</property>
<property name="height_request">30</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="sky_colorgradient_sun_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="sky_colorgradient_zenith">
<property name="width_request">200</property>
<property name="height_request">30</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="sky_colorgradient_zenith_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="sky_colorgradient_haze">
<property name="width_request">200</property>
<property name="height_request">30</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="sky_colorgradient_haze_edit">
<property name="label" translatable="yes">Edit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
@ -1338,7 +1414,6 @@ A small entropy will make the noise repeat more often.</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="spacing">10</property>
<property name="layout_style">spread</property>
<child>
<object class="GtkButton" id="sky_apply">

View file

@ -185,6 +185,7 @@ void autoGenRealisticLandscape(int seed)
/* Sky */
sky.sun_color = colorGradationCreate();
colorGradationAddRgba(&sky.sun_color, 0.5, 1.0, 0.98, 0.95, 1.0);
sky.zenith_color = colorGradationCreate();
colorGradationAddRgba(&sky.zenith_color, 0.2, 0.03, 0.03, 0.05, 1.0);
colorGradationAddRgba(&sky.zenith_color, 0.25, 0.25, 0.33, 0.37, 1.0);

View file

@ -150,45 +150,6 @@ CloudsQuality cloudsGetQuality()
return _quality;
}
/*int cloudsAddLayer(double ymin, double ycenter, double ymax, Color color, double scaling, double coverage)
{
CloudsDefinition* layer = _layers + _layers_count;
layer->ycenter = ycenter;
layer->ymin = ymin;
layer->ymax = ymax;
layer->color = color;
layer->scaling = scaling;
layer->coverage = coverage;
layer->noise = noiseCreateGenerator();
noiseGenerateBaseNoise(layer->noise, 262144);
noiseAddLevelSimple(layer->noise, scaling, 0.3);
noiseAddLevelSimple(layer->noise, scaling / 2.0, 0.2);
noiseAddLevelSimple(layer->noise, scaling / 4.0, 0.1);
noiseAddLevelSimple(layer->noise, scaling / 10.0, 0.05);
noiseAddLevelSimple(layer->noise, scaling / 20.0, 0.03);
noiseAddLevelSimple(layer->noise, scaling / 40.0, 0.02);
noiseAddLevelSimple(layer->noise, scaling / 60.0, 0.01);
noiseAddLevelSimple(layer->noise, scaling / 80.0, 0.005);
noiseAddLevelSimple(layer->noise, scaling / 100.0, 0.02);
noiseAddLevelSimple(layer->noise, scaling / 150.0, 0.005);
noiseAddLevelSimple(layer->noise, scaling / 200.0, 0.003);
noiseAddLevelSimple(layer->noise, scaling / 400.0, 0.008);
noiseAddLevelSimple(layer->noise, scaling / 800.0, 0.001);
noiseAddLevelSimple(layer->noise, scaling / 1000.0, 0.0005);
if (coverage < 0.5)
{
noiseNormalizeHeight(layer->noise, -1.0, coverage * 2.0, 0);
}
else
{
noiseNormalizeHeight(layer->noise, -(1.0 - coverage) * 2.0, 1.0, 0);
}
return _layers_count++;
}*/
static inline double _getDistanceToBorder(CloudsDefinition* layer, Vector3 position, double detail)
{
double val, min;

View file

@ -29,7 +29,7 @@ static inline void _updatePreview()
static void _redrawColorGradation(GtkImage* image, ColorGradation* gradation)
{
GdkPixbuf* pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, 1, 8, 250, 20);
GdkPixbuf* pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, 1, 8, 200, 30);
void* pixels = gdk_pixbuf_get_pixels(pixbuf);
int rowstride = gdk_pixbuf_get_rowstride(pixbuf);
@ -37,12 +37,12 @@ static void _redrawColorGradation(GtkImage* image, ColorGradation* gradation)
guint32* pixel;
Color col;
for (x = 0; x < 250; x++)
for (x = 0; x < 200; x++)
{
for (y = 0; y < 20; y++)
for (y = 0; y < 30; y++)
{
pixel = (guint32*)(pixels + y * rowstride + x * 4);
col = colorGradationGet(gradation, (double)x / 250.0);
col = colorGradationGet(gradation, (double)x / 200.0);
*pixel = (guint32)colorTo32BitRGBA(&col);
}
}