diff --git a/gui_qt/dialogwanderer.cpp b/gui_qt/dialogwanderer.cpp index fa5e89a..2e0b7e5 100644 --- a/gui_qt/dialogwanderer.cpp +++ b/gui_qt/dialogwanderer.cpp @@ -51,6 +51,6 @@ DialogWanderer::~DialogWanderer() void DialogWanderer::validateCamera() { _wanderer->validateCamera(); - reject(); + accept(); } diff --git a/gui_qt/formterrain.cpp b/gui_qt/formterrain.cpp index 19d9ff2..a76633b 100644 --- a/gui_qt/formterrain.cpp +++ b/gui_qt/formterrain.cpp @@ -50,25 +50,28 @@ public: _renderer.getTerrainHeight = _getTerrainHeight; _renderer.applyLightingToSurface = _applyLightingToSurface; _renderer.maskLight = _maskLight; + _renderer.camera_location.x = 0.0; + _renderer.camera_location.y = 50.0; + _renderer.camera_location.z = 0.0; _lighting = lightingCreateDefinition(); - light.color.r = 0.7; - light.color.g = 0.7; - light.color.b = 0.7; + light.color.r = 0.6; + light.color.g = 0.6; + light.color.b = 0.6; light.amplitude = 0.0; light.direction.x = -0.5; light.direction.y = -0.7071; light.direction.z = 0.5; light.filtered = 0; light.masked = 1; - light.reflection = 0.0; + light.reflection = 1.0; lightingAddLight(&_lighting, light); light.color.r = 0.3; light.color.g = 0.3; light.color.b = 0.3; light.amplitude = 0.0; light.direction.x = 0.5; - light.direction.y = -0.7071; + light.direction.y = 0.7071; light.direction.z = -0.5; light.filtered = 0; light.masked = 0; @@ -81,7 +84,8 @@ public: texturesAddLayer(&_textures); texture = texturesGetLayer(&_textures, 0); 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; texturesLayerValidateDefinition(texture); diff --git a/gui_qt/inputcamera.cpp b/gui_qt/inputcamera.cpp index 837ab77..7a947f8 100644 --- a/gui_qt/inputcamera.cpp +++ b/gui_qt/inputcamera.cpp @@ -38,11 +38,15 @@ void InputCamera::revert() void InputCamera::editCamera() { + int result; + DialogWanderer* dialog = new DialogWanderer(_control, _value, true); - dialog->exec(); + result = dialog->exec(); delete dialog; - // TODO Only if camera was edited - applyValue(); + if (result == QDialog::Accepted) + { + applyValue(); + } } diff --git a/gui_qt/mainwindow.cpp b/gui_qt/mainwindow.cpp index 61973ec..32c2b38 100644 --- a/gui_qt/mainwindow.cpp +++ b/gui_qt/mainwindow.cpp @@ -174,15 +174,18 @@ void MainWindow::quickPreview() void MainWindow::explore3D() { CameraDefinition camera; + int result; sceneryGetCamera(&camera); DialogWanderer* dialog = new DialogWanderer(this, &camera, true); - dialog->exec(); + result = dialog->exec(); - scenerySetCamera(&camera); - delete dialog; - refreshAll(); + if (result == QDialog::Accepted) + { + scenerySetCamera(&camera); + refreshAll(); + } } diff --git a/i18n/paysages_fr.ts b/i18n/paysages_fr.ts index 890f527..b45dab0 100644 --- a/i18n/paysages_fr.ts +++ b/i18n/paysages_fr.ts @@ -454,7 +454,7 @@ Maintenir Ctrl : Plus rapide FormTerrain - + Height preview (normalized) Aperçu de la hauteur (normalisée) @@ -463,22 +463,22 @@ Maintenir Ctrl : Plus rapide Aperçu du rendu (sans ombres) - + Lighted preview (no texture) Aperçu éclairé (sans texture) - + Noise Bruit - + Height Hauteur - + Scaling Echelle