From f270c6aad0d57dcca3db94b135eca077fd722882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Fri, 8 Jun 2012 12:28:46 +0000 Subject: [PATCH] paysages : Explorer chunks refactoring for future skybox (WIP) git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@339 b1fd45b6-86a6-48da-8261-f70d1f35bdcc --- gui_qt/baseexplorerchunk.cpp | 150 ++++++++++++++++++++ gui_qt/baseexplorerchunk.h | 48 +++++++ gui_qt/explorerchunkterrain.cpp | 158 +++++++++++++++++++++ gui_qt/explorerchunkterrain.h | 36 +++++ gui_qt/formsky.cpp | 38 +++-- gui_qt/wandererchunk.cpp | 242 -------------------------------- gui_qt/wandererchunk.h | 45 ------ gui_qt/widgetwanderer.cpp | 7 +- gui_qt/widgetwanderer.h | 6 +- i18n/paysages_fr.ts | 22 +-- 10 files changed, 436 insertions(+), 316 deletions(-) create mode 100644 gui_qt/baseexplorerchunk.cpp create mode 100644 gui_qt/baseexplorerchunk.h create mode 100644 gui_qt/explorerchunkterrain.cpp create mode 100644 gui_qt/explorerchunkterrain.h delete mode 100644 gui_qt/wandererchunk.cpp delete mode 100644 gui_qt/wandererchunk.h diff --git a/gui_qt/baseexplorerchunk.cpp b/gui_qt/baseexplorerchunk.cpp new file mode 100644 index 0000000..d217452 --- /dev/null +++ b/gui_qt/baseexplorerchunk.cpp @@ -0,0 +1,150 @@ +#include "baseexplorerchunk.h" + +BaseExplorerChunk::BaseExplorerChunk(Renderer* renderer) +{ + _renderer = renderer; + + priority = 0.0; + _reset_needed = false; + + _texture = new QImage(1, 1, QImage::Format_ARGB32); + _texture_id = 0; + _texture_changed = false; + _texture_current_size = 0; + _texture_max_size = 0; +} + +BaseExplorerChunk::~BaseExplorerChunk() +{ + _lock_data.lock(); + delete _texture; + _lock_data.unlock(); +} + +bool BaseExplorerChunk::maintain() +{ + bool subchanged; + + _lock_data.lock(); + if (_reset_needed) + { + _reset_needed = false; + _texture_current_size = 0; + onResetEvent(); + } + _lock_data.unlock(); + + subchanged = onMaintainEvent(); + + // Improve texture resolution + if (_texture_current_size < _texture_max_size) + { + int new_texture_size = _texture_current_size ? _texture_current_size * 2 : 1; + QImage* new_image = new QImage(_texture->scaled(new_texture_size + 1, new_texture_size + 1, Qt::IgnoreAspectRatio, Qt::FastTransformation)); + for (int j = 0; j <= new_texture_size; j++) + { + for (int i = 0; i <= new_texture_size; i++) + { + if (_texture_current_size <= 1 || i % 2 != 0 || j % 2 != 0) + { + Color color = getTextureColor((double)i / (double)(new_texture_size + 1), (double)j / (double)(new_texture_size + 1)); + new_image->setPixel(i, j, colorTo32BitBGRA(&color)); + } + } + } + + _lock_data.lock(); + delete _texture; + _texture = new_image; + _texture_current_size = new_texture_size; + _texture_changed = true; + _lock_data.unlock(); + + return true; + } + else + { + return subchanged; + } +} + +void BaseExplorerChunk::updatePriority(CameraDefinition* camera) +{ + if (_reset_needed || (_texture_max_size > 0 && _texture_current_size == 0)) + { + priority = 1000.0; + } + else if (_texture_current_size == _texture_max_size) + { + priority = -1000.0; + } + else + { + priority = getDisplayedSizeHint(camera) - _texture_current_size; + } + onCameraEvent(camera); +} + +void BaseExplorerChunk::render(QGLWidget* widget) +{ + // Put texture in place + _lock_data.lock(); + if (_texture_changed) + { + _texture_changed = false; + if (_texture_id) + { + widget->deleteTexture(_texture_id); + } + // TODO Only do the scale if not power-of-two textures are unsupported by GPU + _texture_id = widget->bindTexture(_texture->scaled(_texture_current_size, _texture_current_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + //_texture_id = widget->bindTexture(*_texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + } + else + { + glBindTexture(GL_TEXTURE_2D, _texture_id); + } + _lock_data.unlock(); + + // Delegate poly rendering to subclass + onRenderEvent(widget); +} + +void BaseExplorerChunk::askReset() +{ + _reset_needed = true; +} + +void BaseExplorerChunk::setMaxTextureSize(int size) +{ + _texture_max_size = size; +} + +void BaseExplorerChunk::onCameraEvent(CameraDefinition* camera) +{ +} + +void BaseExplorerChunk::onResetEvent() +{ +} + +bool BaseExplorerChunk::onMaintainEvent() +{ + return false; +} + +void BaseExplorerChunk::onRenderEvent(QGLWidget* widget) +{ +} + +double BaseExplorerChunk::getDisplayedSizeHint(CameraDefinition* camera) +{ + return 0.0; +} + +Color BaseExplorerChunk::getTextureColor(double x, double y) +{ + return COLOR_TRANSPARENT; +} \ No newline at end of file diff --git a/gui_qt/baseexplorerchunk.h b/gui_qt/baseexplorerchunk.h new file mode 100644 index 0000000..3f64290 --- /dev/null +++ b/gui_qt/baseexplorerchunk.h @@ -0,0 +1,48 @@ +#ifndef _PAYSAGES_QT_BASEEXPLORERCHUNK_H_ +#define _PAYSAGES_QT_BASEEXPLORERCHUNK_H_ + +#include +#include +#include +#include "../lib_paysages/renderer.h" + +class BaseExplorerChunk +{ +public: + virtual ~BaseExplorerChunk(); + + bool maintain(); + void updatePriority(CameraDefinition* camera); + void render(QGLWidget* widget); + + double priority; +protected: + BaseExplorerChunk(Renderer* renderer); + + inline Renderer* renderer() {return _renderer;}; + + void askReset(); + void setMaxTextureSize(int size); + + virtual void onCameraEvent(CameraDefinition* camera); + virtual void onResetEvent(); + virtual bool onMaintainEvent(); + virtual void onRenderEvent(QGLWidget* widget); + virtual double getDisplayedSizeHint(CameraDefinition* camera); + virtual Color getTextureColor(double x, double y); + + QMutex _lock_data; + +private: + Renderer* _renderer; + + bool _reset_needed; + + QImage* _texture; + GLuint _texture_id; + bool _texture_changed; + int _texture_current_size; + int _texture_max_size; +}; + +#endif diff --git a/gui_qt/explorerchunkterrain.cpp b/gui_qt/explorerchunkterrain.cpp new file mode 100644 index 0000000..62e1ff8 --- /dev/null +++ b/gui_qt/explorerchunkterrain.cpp @@ -0,0 +1,158 @@ +#include "explorerchunkterrain.h" + +#include +#include "baseexplorerchunk.h" +#include "../lib_paysages/camera.h" + +ExplorerChunkTerrain::ExplorerChunkTerrain(Renderer* renderer, double x, double z, double size, int nbchunks) : BaseExplorerChunk(renderer) +{ + _startx = x; + _startz = z; + _size = size; + _overall_step = size * (double)nbchunks; + + _tessellation_max_size = 32; + _tessellation = new double[(_tessellation_max_size + 1) * (_tessellation_max_size + 1)]; + _tessellation_current_size = 0; + _tessellation_step = _size / (double)_tessellation_max_size; + + setMaxTextureSize(128); + + maintain(); +} + +ExplorerChunkTerrain::~ExplorerChunkTerrain() +{ + _lock_data.lock(); + delete [] _tessellation; + _lock_data.unlock(); +} + +void ExplorerChunkTerrain::onResetEvent() +{ + _tessellation_current_size = 0; +} + +bool ExplorerChunkTerrain::onMaintainEvent() +{ + Renderer* renderer = this->renderer(); + + // Improve heightmap resolution + if (_tessellation_current_size < _tessellation_max_size) + { + int new_tessellation_size = _tessellation_current_size ? _tessellation_current_size * 4 : 2; + int old_tessellation_inc = _tessellation_current_size ? _tessellation_max_size / _tessellation_current_size : 1; + int new_tessellation_inc = _tessellation_max_size / new_tessellation_size; + for (int j = 0; j <= _tessellation_max_size; j += new_tessellation_inc) + { + for (int i = 0; i <= _tessellation_max_size; i += new_tessellation_inc) + { + if (_tessellation_current_size == 0 || i % old_tessellation_inc != 0 || j % old_tessellation_inc != 0) + { + double height = renderer->getTerrainHeight(renderer, _startx + _tessellation_step * (double)i, _startz + _tessellation_step * (double)j); + _tessellation[j * (_tessellation_max_size + 1) + i] = height; + } + } + } + + _lock_data.lock(); + _tessellation_current_size = new_tessellation_size; + _lock_data.unlock(); + + return true; + } + else + { + return false; + } +} + +void ExplorerChunkTerrain::onCameraEvent(CameraDefinition* camera) +{ + // Handle position + _lock_data.lock(); + if (camera->location.x > _startx + _overall_step * 0.5) + { + _startx += _overall_step; + askReset(); + } + if (camera->location.z > _startz + _overall_step * 0.5) + { + _startz += _overall_step; + askReset(); + } + if (camera->location.x < _startx - _overall_step * 0.5) + { + _startx -= _overall_step; + askReset(); + } + if (camera->location.z < _startz - _overall_step * 0.5) + { + _startz -= _overall_step; + askReset(); + } + _lock_data.unlock(); +} + +void ExplorerChunkTerrain::onRenderEvent(QGLWidget* widget) +{ + _lock_data.lock(); + int tessellation_size = _tessellation_current_size; + double tsize = 1.0 / (double)_tessellation_max_size; + _lock_data.unlock(); + + if (tessellation_size == 0) + { + return; + } + + int tessellation_inc = _tessellation_max_size / (double)tessellation_size; + for (int j = 0; j < _tessellation_max_size; j += tessellation_inc) + { + glBegin(GL_QUAD_STRIP); + for (int i = 0; i <= _tessellation_max_size; i += tessellation_inc) + { + glTexCoord2d(tsize * (double)i, 1.0 - tsize * (double)j); + glVertex3d(_startx + _tessellation_step * (double)i, _tessellation[j * (_tessellation_max_size + 1) + i], _startz + _tessellation_step * (double)j); + glTexCoord2d(tsize * (double)i, 1.0 - tsize * (double)(j + tessellation_inc)); + glVertex3d(_startx + _tessellation_step * (double)i, _tessellation[(j + tessellation_inc) * (_tessellation_max_size + 1) + i], _startz + _tessellation_step * (double)(j + tessellation_inc)); + } + glEnd(); + } +} + +double ExplorerChunkTerrain::getDisplayedSizeHint(CameraDefinition* camera) +{ + double distance, wanted_size; + Vector3 center; + + center = getCenter(); + + distance = v3Norm(v3Sub(camera->location, center)); + distance = distance < 0.1 ? 0.1 : distance; + wanted_size = (int)ceil(120.0 - distance / 3.0); + + if (!cameraIsBoxInView(camera, center, _size, _size, 40.0)) + { + wanted_size -= 500.0; + } + + return wanted_size; +} + +Color ExplorerChunkTerrain::getTextureColor(double x, double y) +{ + Vector3 location = {_startx + x * _size, 0.0, _startz + y * _size}; + return renderer()->applyTextures(renderer(), location, 0.01); +} + +Vector3 ExplorerChunkTerrain::getCenter() +{ + Vector3 result; + + result.x = _startx + _size / 2.0; + result.y = 0.0; + result.z = _startz + _size / 2.0; + + return result; +} diff --git a/gui_qt/explorerchunkterrain.h b/gui_qt/explorerchunkterrain.h new file mode 100644 index 0000000..64f608d --- /dev/null +++ b/gui_qt/explorerchunkterrain.h @@ -0,0 +1,36 @@ +#ifndef _PAYSAGES_QT_EXPLORERCHUNKTERRAIN_H_ +#define _PAYSAGES_QT_EXPLORERCHUNKTERRAIN_H_ + +#include "baseexplorerchunk.h" +#include "../lib_paysages/renderer.h" +#include "../lib_paysages/euclid.h" + +class ExplorerChunkTerrain:public BaseExplorerChunk +{ +public: + ExplorerChunkTerrain(Renderer* renderer, double x, double z, double size, int nbchunks); + ~ExplorerChunkTerrain(); + + void onCameraEvent(CameraDefinition* camera); + void onResetEvent(); + bool onMaintainEvent(); + void onRenderEvent(QGLWidget* widget); + double getDisplayedSizeHint(CameraDefinition* camera); + Color getTextureColor(double x, double y); + +private: + Vector3 getCenter(); + + double _startx; + double _startz; + double _size; + double _overall_step; + + double* _tessellation; + int _tessellation_max_size; + int _tessellation_current_size; + double _tessellation_step; + +}; + +#endif diff --git a/gui_qt/formsky.cpp b/gui_qt/formsky.cpp index 5526c05..b7c5fac 100644 --- a/gui_qt/formsky.cpp +++ b/gui_qt/formsky.cpp @@ -27,14 +27,21 @@ public: protected: QColor getColor(double x, double y) { - Vector3 eye = {0.0, 0.0, 0.0}; - Vector3 look; + if (y > 0.0) + { + return QColor(0, 0, 0); + } + else + { + Vector3 eye = {0.0, 0.0, 0.0}; + Vector3 look; - look.x = 1.0; - look.y = -y; - look.z = x; + look.x = 1.0; + look.y = -y; + look.z = x; - return colorToQColor(skyGetColor(&_preview_definition, &_renderer, eye, look)); + return colorToQColor(skyGetColor(&_preview_definition, &_renderer, eye, look)); + } } void updateData() { @@ -59,14 +66,21 @@ public: protected: QColor getColor(double x, double y) { - Vector3 eye = {0.0, 0.0, 0.0}; - Vector3 look; + if (y > 0.0) + { + return QColor(0, 0, 0); + } + else + { + Vector3 eye = {0.0, 0.0, 0.0}; + Vector3 look; - look.x = -1.0; - look.y = -y; - look.z = -x; + look.x = -1.0; + look.y = -y; + look.z = -x; - return colorToQColor(skyGetColor(&_preview_definition, &_renderer, eye, look)); + return colorToQColor(skyGetColor(&_preview_definition, &_renderer, eye, look)); + } } void updateData() { diff --git a/gui_qt/wandererchunk.cpp b/gui_qt/wandererchunk.cpp deleted file mode 100644 index e9e4ebf..0000000 --- a/gui_qt/wandererchunk.cpp +++ /dev/null @@ -1,242 +0,0 @@ -#include "wandererchunk.h" - -#include -#include -#include -#include -#include -#include "../lib_paysages/camera.h" -#include "../lib_paysages/color.h" -#include "../lib_paysages/euclid.h" -#include "../lib_paysages/tools.h" - -WandererChunk::WandererChunk(Renderer* renderer, double x, double z, double size, int nbchunks) -{ - _renderer = renderer; - - _startx = x; - _startz = z; - _size = size; - _overall_step = size * (double)nbchunks; - _restart_needed = false; - - priority = 0.0; - - _tessellation_max_size = 32; - _tessellation = new double[(_tessellation_max_size + 1) * (_tessellation_max_size + 1)]; - _tessellation_current_size = 0; - _tessellation_step = _size / (double)_tessellation_max_size; - - _texture_max_size = 128; - _texture_current_size = 0; - _texture = new QImage(1, 1, QImage::Format_ARGB32); - _texture_id = 0; - _texture_changed = false; - - maintain(); -} - -WandererChunk::~WandererChunk() -{ - _lock_data.lock(); - delete _texture; - delete [] _tessellation; - _lock_data.unlock(); -} - -void WandererChunk::render(QGLWidget* widget) -{ - _lock_data.lock(); - - if (_texture_changed) - { - _texture_changed = false; - if (_texture_id) - { - widget->deleteTexture(_texture_id); - } - // TODO Only do the scale if not power-of-two textures are unsupported by GPU - _texture_id = widget->bindTexture(_texture->scaled(_texture_current_size, _texture_current_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - //_texture_id = widget->bindTexture(*_texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - } - else - { - glBindTexture(GL_TEXTURE_2D, _texture_id); - } - - int tessellation_size = _tessellation_current_size; - double tsize = 1.0 / (double)_tessellation_max_size; - - _lock_data.unlock(); - - if (tessellation_size == 0) - { - return; - } - - int tessellation_inc = _tessellation_max_size / (double)tessellation_size; - for (int j = 0; j < _tessellation_max_size; j += tessellation_inc) - { - glBegin(GL_QUAD_STRIP); - for (int i = 0; i <= _tessellation_max_size; i += tessellation_inc) - { - glTexCoord2d(tsize * (double)i, 1.0 - tsize * (double)j); - glVertex3d(_startx + _tessellation_step * (double)i, _tessellation[j * (_tessellation_max_size + 1) + i], _startz + _tessellation_step * (double)j); - glTexCoord2d(tsize * (double)i, 1.0 - tsize * (double)(j + tessellation_inc)); - glVertex3d(_startx + _tessellation_step * (double)i, _tessellation[(j + tessellation_inc) * (_tessellation_max_size + 1) + i], _startz + _tessellation_step * (double)(j + tessellation_inc)); - } - glEnd(); - } -} - -void WandererChunk::updatePriority(CameraDefinition* camera) -{ - // Compute new priority - _lock_data.lock(); - if (camera->location.x > _startx + _overall_step * 0.5) - { - _startx += _overall_step; - _restart_needed = true; - } - if (camera->location.z > _startz + _overall_step * 0.5) - { - _startz += _overall_step; - _restart_needed = true; - } - if (camera->location.x < _startx - _overall_step * 0.5) - { - _startx -= _overall_step; - _restart_needed = true; - } - if (camera->location.z < _startz - _overall_step * 0.5) - { - _startz -= _overall_step; - _restart_needed = true; - } - - if (_restart_needed || _texture_current_size <= 1) - { - priority = 1000.0; - } - else if (_tessellation_current_size == _tessellation_max_size && _texture_current_size == _texture_max_size) - { - priority = -1000.0; - } - else - { - double distance, wanted_size; - Vector3 center; - - center = getCenter(); - - distance = v3Norm(v3Sub(camera->location, center)); - distance = distance < 0.1 ? 0.1 : distance; - wanted_size = (int)ceil(120.0 - distance / 3.0); - - priority = wanted_size - _texture_current_size; - /*else if (distance < 30.0 && _texture_current_size < _texture_max_size / 8) - { - priority += 75.0; - } - else if (distance < 15.0 && _texture_current_size < _texture_max_size) - { - priority += 50.0; - } - else if (distance < 30.0 && _texture_current_size < _texture_max_size / 2) - { - priority += 25.0; - }*/ - - if (!cameraIsBoxInView(camera, center, _size, _size, 40.0)) - { - priority -= 100.0; - } - } - _lock_data.unlock(); -} - -bool WandererChunk::maintain() -{ - if (_restart_needed) - { - _restart_needed = false; - - _lock_data.lock(); - _texture_current_size = 0; - _tessellation_current_size = 0; - _lock_data.unlock(); - } - - if (_tessellation_current_size < _tessellation_max_size || _texture_current_size < _texture_max_size) - { - // Improve heightmap resolution - if (_tessellation_current_size < _tessellation_max_size) - { - int new_tessellation_size = _tessellation_current_size ? _tessellation_current_size * 4 : 2; - int old_tessellation_inc = _tessellation_current_size ? _tessellation_max_size / _tessellation_current_size : 1; - int new_tessellation_inc = _tessellation_max_size / new_tessellation_size; - for (int j = 0; j <= _tessellation_max_size; j += new_tessellation_inc) - { - for (int i = 0; i <= _tessellation_max_size; i += new_tessellation_inc) - { - if (_tessellation_current_size == 0 || i % old_tessellation_inc != 0 || j % old_tessellation_inc != 0) - { - double height = _renderer->getTerrainHeight(_renderer, _startx + _tessellation_step * (double)i, _startz + _tessellation_step * (double)j); - _tessellation[j * (_tessellation_max_size + 1) + i] = height; - } - } - } - - _lock_data.lock(); - _tessellation_current_size = new_tessellation_size; - _lock_data.unlock(); - } - - // Improve texture resolution - if (_texture_current_size < _texture_max_size) - { - int new_texture_size = _texture_current_size ? _texture_current_size * 2 : 1; - double step_size = _texture_current_size ? _size / (double)(new_texture_size) : 0.1; - //QImage* new_image = new QImage(new_texture_size, new_texture_size, QImage::Format_ARGB32); - QImage* new_image = new QImage(_texture->scaled(new_texture_size + 1, new_texture_size + 1, Qt::IgnoreAspectRatio, Qt::FastTransformation)); - for (int j = 0; j <= new_texture_size; j++) - { - for (int i = 0; i <= new_texture_size; i++) - { - if (_texture_current_size <= 1 || i % 2 != 0 || j % 2 != 0) - { - Vector3 location = {_startx + step_size * (double)i, 0.0, _startz + step_size * (double)j}; - Color color = _renderer->applyTextures(_renderer, location, step_size); - new_image->setPixel(i, j, colorTo32BitBGRA(&color)); - } - } - } - - _lock_data.lock(); - delete _texture; - _texture = new_image; - _texture_current_size = new_texture_size; - _texture_changed = true; - _lock_data.unlock(); - } - - return true; - } - else - { - return false; - } -} - -Vector3 WandererChunk::getCenter() -{ - Vector3 result; - - result.x = _startx + _size / 2.0; - result.y = 0.0; - result.z = _startz + _size / 2.0; - - return result; -} diff --git a/gui_qt/wandererchunk.h b/gui_qt/wandererchunk.h deleted file mode 100644 index b44ef97..0000000 --- a/gui_qt/wandererchunk.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _PAYSAGES_QT_WANDERERCHUNK_H_ -#define _PAYSAGES_QT_WANDERERCHUNK_H_ - -#include -#include -#include -#include "../lib_paysages/renderer.h" - -class WandererChunk -{ -public: - WandererChunk(Renderer* renderer, double x, double z, double size, int nbchunks); - ~WandererChunk(); - - bool maintain(); - void updatePriority(CameraDefinition* camera); - void render(QGLWidget* widget); - - Vector3 getCenter(); - - double priority; - -private: - QMutex _lock_data; - Renderer* _renderer; - - double _startx; - double _startz; - double _size; - double _overall_step; - bool _restart_needed; - - double* _tessellation; - int _tessellation_max_size; - int _tessellation_current_size; - double _tessellation_step; - - QImage* _texture; - GLuint _texture_id; - bool _texture_changed; - int _texture_max_size; - int _texture_current_size; -}; - -#endif diff --git a/gui_qt/widgetwanderer.cpp b/gui_qt/widgetwanderer.cpp index 5cd8dcf..2a8629f 100644 --- a/gui_qt/widgetwanderer.cpp +++ b/gui_qt/widgetwanderer.cpp @@ -8,6 +8,7 @@ #include #include "../lib_paysages/scenery.h" #include "../lib_paysages/euclid.h" +#include "explorerchunkterrain.h" class ChunkMaintenanceThread:public QThread { @@ -106,7 +107,7 @@ WidgetWanderer::WidgetWanderer(QWidget *parent, CameraDefinition* camera): { for (int j = 0; j < chunks; j++) { - WandererChunk* chunk = new WandererChunk(&_renderer, start + chunksize * (double)i, start + chunksize * (double)j, chunksize, chunks); + ExplorerChunkTerrain* chunk = new ExplorerChunkTerrain(&_renderer, start + chunksize * (double)i, start + chunksize * (double)j, chunksize, chunks); _chunks.append(chunk); _updateQueue.append(chunk); } @@ -167,14 +168,14 @@ void WidgetWanderer::stopThreads() } } -bool _cmpChunks(const WandererChunk* c1, const WandererChunk* c2) +bool _cmpChunks(const BaseExplorerChunk* c1, const BaseExplorerChunk* c2) { return c1->priority > c2->priority; } void WidgetWanderer::performChunksMaintenance() { - WandererChunk* chunk; + BaseExplorerChunk* chunk; _lock_chunks.lock(); if (_updateQueue.count() > 0) diff --git a/gui_qt/widgetwanderer.h b/gui_qt/widgetwanderer.h index 6c00c90..827ab9c 100644 --- a/gui_qt/widgetwanderer.h +++ b/gui_qt/widgetwanderer.h @@ -2,7 +2,7 @@ #define _PAYSAGES_QT_WIDGETWANDERER_H_ #include -#include "wandererchunk.h" +#include "baseexplorerchunk.h" #include "../lib_paysages/camera.h" #include "../lib_paysages/water.h" #include "../lib_paysages/renderer.h" @@ -45,8 +45,8 @@ private: Renderer _renderer; bool _updated; - QVector _chunks; - QList _updateQueue; + QVector _chunks; + QList _updateQueue; bool _alive; QMutex _lock_chunks; diff --git a/i18n/paysages_fr.ts b/i18n/paysages_fr.ts index 3293356..5ab5dff 100644 --- a/i18n/paysages_fr.ts +++ b/i18n/paysages_fr.ts @@ -520,57 +520,57 @@ Maintenir Ctrl : Plus rapide FormSky - + West preview Aperçu de l'ouest - + East preview Aperçu de l'est - + Day time Heure du jour - + Sun color Couleur du soleil - + Sun radius Diamètre apparent du soleil - + Sun halo radius - + Sun halo profile - + Zenith color Couleur du ciel au zénith - + Haze color Couleur de la brume - + Haze height Hauteur apparente de la brume - + Haze smoothing Facteur de lissage de la brume