paysages: Restored "show last render" feature.
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@282 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
parent
decaf96036
commit
df7041a82b
4 changed files with 30 additions and 12 deletions
1
TODO
1
TODO
|
@ -1,5 +1,4 @@
|
|||
- Implement scaling and scrolling on previews.
|
||||
- Improve color gradation dialog (with curve editor ?).
|
||||
- Replace FILE* by a custom type for Save and Load.
|
||||
- Water and terrain LOD moves with the camera, fix it like in the wanderer.
|
||||
- Restore render progress.
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include "../lib_paysages/auto.h"
|
||||
|
||||
static DialogRender* _current_dialog;
|
||||
static Renderer _renderer;
|
||||
static bool _renderer_inited = false;
|
||||
|
||||
static void _renderStart(int width, int height, Color background)
|
||||
{
|
||||
|
@ -72,7 +74,6 @@ DialogRender::DialogRender(QWidget *parent):
|
|||
pixbuf = new QImage(1, 1, QImage::Format_ARGB32);
|
||||
_current_dialog = this;
|
||||
render_thread = NULL;
|
||||
renderer = sceneryCreateStandardRenderer();
|
||||
|
||||
setModal(true);
|
||||
setWindowTitle(tr("Paysages 3D - Render"));
|
||||
|
@ -96,14 +97,11 @@ DialogRender::~DialogRender()
|
|||
{
|
||||
if (render_thread)
|
||||
{
|
||||
rendererInterrupt(&renderer);
|
||||
rendererInterrupt(&_renderer);
|
||||
render_thread->wait();
|
||||
|
||||
rendererSetPreviewCallbacks(&renderer, NULL, NULL, NULL);
|
||||
|
||||
delete render_thread;
|
||||
}
|
||||
rendererDelete(&renderer);
|
||||
delete pixbuf;
|
||||
}
|
||||
|
||||
|
@ -116,9 +114,16 @@ void DialogRender::startRender(int quality, int width, int height)
|
|||
area->resize(width, height);
|
||||
scroll->setMinimumSize(width > 800 ? 850 : width + 50, height > 600 ? 650 : height + 50);
|
||||
|
||||
rendererSetPreviewCallbacks(&renderer, _renderStart, _renderDraw, _renderUpdate);
|
||||
if (_renderer_inited)
|
||||
{
|
||||
rendererDelete(&_renderer);
|
||||
}
|
||||
_renderer = sceneryCreateStandardRenderer();
|
||||
_renderer_inited = true;
|
||||
|
||||
render_thread = new RenderThread(&renderer, width, height, quality);
|
||||
rendererSetPreviewCallbacks(&_renderer, _renderStart, _renderDraw, _renderUpdate);
|
||||
|
||||
render_thread = new RenderThread(&_renderer, width, height, quality);
|
||||
render_thread->start();
|
||||
|
||||
exec();
|
||||
|
@ -126,8 +131,23 @@ void DialogRender::startRender(int quality, int width, int height)
|
|||
|
||||
void DialogRender::loadLastRender()
|
||||
{
|
||||
int width, height;
|
||||
|
||||
progress->hide();
|
||||
//renderSetPreviewCallbacks(_renderStart, _renderDraw, _renderUpdate);
|
||||
if (_renderer_inited)
|
||||
{
|
||||
width = _renderer.render_width;
|
||||
height = _renderer.render_height;
|
||||
|
||||
delete pixbuf;
|
||||
pixbuf = new QImage(width, height, QImage::Format_ARGB32);
|
||||
area->setMinimumSize(width, height);
|
||||
area->setMaximumSize(width, height);
|
||||
area->resize(width, height);
|
||||
scroll->setMinimumSize(width > 800 ? 850 : width + 50, height > 600 ? 650 : height + 50);
|
||||
|
||||
rendererSetPreviewCallbacks(&_renderer, _renderStart, _renderDraw, _renderUpdate);
|
||||
}
|
||||
|
||||
exec();
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ public:
|
|||
|
||||
private:
|
||||
QThread* render_thread;
|
||||
Renderer renderer;
|
||||
};
|
||||
|
||||
#endif // _PAYSAGES_QT_DIALOGRENDER_H_
|
||||
|
|
|
@ -156,7 +156,7 @@ Cliquez avec le bouton droit sur un point pour le supprimer.</translation>
|
|||
<context>
|
||||
<name>DialogRender</name>
|
||||
<message>
|
||||
<location filename="../gui_qt/dialogrender.cpp" line="78"/>
|
||||
<location filename="../gui_qt/dialogrender.cpp" line="79"/>
|
||||
<source>Paysages 3D - Render</source>
|
||||
<translation>Paysages 3D - Rendu</translation>
|
||||
</message>
|
||||
|
|
Loading…
Reference in a new issue