paysages: More UI polishing.

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@293 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-04-12 20:20:57 +00:00 committed by ThunderK
parent 6099241ec9
commit 85e19d380a
5 changed files with 30 additions and 19 deletions

View file

@ -51,6 +51,6 @@ DialogWanderer::~DialogWanderer()
void DialogWanderer::validateCamera() void DialogWanderer::validateCamera()
{ {
_wanderer->validateCamera(); _wanderer->validateCamera();
reject(); accept();
} }

View file

@ -50,25 +50,28 @@ public:
_renderer.getTerrainHeight = _getTerrainHeight; _renderer.getTerrainHeight = _getTerrainHeight;
_renderer.applyLightingToSurface = _applyLightingToSurface; _renderer.applyLightingToSurface = _applyLightingToSurface;
_renderer.maskLight = _maskLight; _renderer.maskLight = _maskLight;
_renderer.camera_location.x = 0.0;
_renderer.camera_location.y = 50.0;
_renderer.camera_location.z = 0.0;
_lighting = lightingCreateDefinition(); _lighting = lightingCreateDefinition();
light.color.r = 0.7; light.color.r = 0.6;
light.color.g = 0.7; light.color.g = 0.6;
light.color.b = 0.7; light.color.b = 0.6;
light.amplitude = 0.0; light.amplitude = 0.0;
light.direction.x = -0.5; light.direction.x = -0.5;
light.direction.y = -0.7071; light.direction.y = -0.7071;
light.direction.z = 0.5; light.direction.z = 0.5;
light.filtered = 0; light.filtered = 0;
light.masked = 1; light.masked = 1;
light.reflection = 0.0; light.reflection = 1.0;
lightingAddLight(&_lighting, light); lightingAddLight(&_lighting, light);
light.color.r = 0.3; light.color.r = 0.3;
light.color.g = 0.3; light.color.g = 0.3;
light.color.b = 0.3; light.color.b = 0.3;
light.amplitude = 0.0; light.amplitude = 0.0;
light.direction.x = 0.5; light.direction.x = 0.5;
light.direction.y = -0.7071; light.direction.y = 0.7071;
light.direction.z = -0.5; light.direction.z = -0.5;
light.filtered = 0; light.filtered = 0;
light.masked = 0; light.masked = 0;
@ -81,7 +84,8 @@ public:
texturesAddLayer(&_textures); texturesAddLayer(&_textures);
texture = texturesGetLayer(&_textures, 0); texture = texturesGetLayer(&_textures, 0);
texture->material.base = COLOR_WHITE; texture->material.base = COLOR_WHITE;
texture->material.reflection = 0.0; texture->material.reflection = 0.3;
texture->material.shininess = 2.0;
texture->bump_height = 0.0; texture->bump_height = 0.0;
texturesLayerValidateDefinition(texture); texturesLayerValidateDefinition(texture);

View file

@ -38,11 +38,15 @@ void InputCamera::revert()
void InputCamera::editCamera() void InputCamera::editCamera()
{ {
int result;
DialogWanderer* dialog = new DialogWanderer(_control, _value, true); DialogWanderer* dialog = new DialogWanderer(_control, _value, true);
dialog->exec(); result = dialog->exec();
delete dialog; delete dialog;
// TODO Only if camera was edited if (result == QDialog::Accepted)
applyValue(); {
applyValue();
}
} }

View file

@ -174,15 +174,18 @@ void MainWindow::quickPreview()
void MainWindow::explore3D() void MainWindow::explore3D()
{ {
CameraDefinition camera; CameraDefinition camera;
int result;
sceneryGetCamera(&camera); sceneryGetCamera(&camera);
DialogWanderer* dialog = new DialogWanderer(this, &camera, true); DialogWanderer* dialog = new DialogWanderer(this, &camera, true);
dialog->exec(); result = dialog->exec();
scenerySetCamera(&camera);
delete dialog; delete dialog;
refreshAll(); if (result == QDialog::Accepted)
{
scenerySetCamera(&camera);
refreshAll();
}
} }

View file

@ -454,7 +454,7 @@ Maintenir Ctrl : Plus rapide</translation>
<context> <context>
<name>FormTerrain</name> <name>FormTerrain</name>
<message> <message>
<location filename="../gui_qt/formterrain.cpp" line="139"/> <location filename="../gui_qt/formterrain.cpp" line="143"/>
<source>Height preview (normalized)</source> <source>Height preview (normalized)</source>
<translation>Aperçu de la hauteur (normalisée)</translation> <translation>Aperçu de la hauteur (normalisée)</translation>
</message> </message>
@ -463,22 +463,22 @@ Maintenir Ctrl : Plus rapide</translation>
<translation type="obsolete">Aperçu du rendu (sans ombres)</translation> <translation type="obsolete">Aperçu du rendu (sans ombres)</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formterrain.cpp" line="140"/> <location filename="../gui_qt/formterrain.cpp" line="144"/>
<source>Lighted preview (no texture)</source> <source>Lighted preview (no texture)</source>
<translation>Aperçu éclairé (sans texture)</translation> <translation>Aperçu éclairé (sans texture)</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formterrain.cpp" line="142"/> <location filename="../gui_qt/formterrain.cpp" line="146"/>
<source>Noise</source> <source>Noise</source>
<translation>Bruit</translation> <translation>Bruit</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formterrain.cpp" line="143"/> <location filename="../gui_qt/formterrain.cpp" line="147"/>
<source>Height</source> <source>Height</source>
<translation>Hauteur</translation> <translation>Hauteur</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formterrain.cpp" line="144"/> <location filename="../gui_qt/formterrain.cpp" line="148"/>
<source>Scaling</source> <source>Scaling</source>
<translation>Echelle</translation> <translation>Echelle</translation>
</message> </message>