paysages : Preview improvements.

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@315 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-05-01 11:39:04 +00:00 committed by ThunderK
parent 0aebb5afa7
commit 3c2137ded1
3 changed files with 16 additions and 5 deletions

6
TODO
View file

@ -11,10 +11,10 @@ Technology Preview 2 :
- Improve curve editor.
- Water and terrain LOD moves with the camera, fix it like in the wanderer.
- There should not have to be more preview threads than cpu cores.
- Add preview threads pausing (for rendering).
- Add preview chunks priority (for visible previews).
- Interrupt preview chunk renderings that will be discarded at commit.
- Pause previews drawing of main window when a dialog is opened.
- Interrupt preview chunk renderings that will be discarded at commit, or that are no more visible.
- Can't overwrite picture files (ILError).
- Fix "RGB parameters out of range" on preview while moving render size fast in render tab.
Technology Preview 3 :
- Restore render progress.

View file

@ -47,6 +47,11 @@ public:
{
_need_render = false;
if (!_preview->isVisible())
{
return false;
}
QImage pixbuf = _preview->startChunkTransaction(_xstart, _ystart, _xsize, _ysize, &revision);
for (int x = 0; x < _xsize; x++)
@ -108,7 +113,7 @@ void PreviewDrawingThread::run()
while (_running)
{
_drawing_manager->performOneThreadJob();
QThread::usleep(50000);
QThread::usleep(5000);
}
}
@ -124,7 +129,7 @@ PreviewDrawingManager::PreviewDrawingManager()
void PreviewDrawingManager::startThreads()
{
for (int i = 0; i < _thread_count * 3; i++)
for (int i = 0; i < _thread_count; i++)
{
PreviewDrawingThread* thread = new PreviewDrawingThread();
_threads.append(thread);
@ -363,6 +368,11 @@ void BasePreview::handleRedraw()
lock_drawing->unlock();
}
void BasePreview::showEvent(QShowEvent* event)
{
updateChunks();
}
void BasePreview::resizeEvent(QResizeEvent* event)
{
QImage* image;

View file

@ -40,6 +40,7 @@ private:
void updateScaling();
void updateChunks();
void showEvent(QShowEvent* event);
void resizeEvent(QResizeEvent* event);
void paintEvent(QPaintEvent* event);