paysages: Fixed the random segfault at startup.
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@258 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
parent
5bfb590cb0
commit
007c5769e5
5 changed files with 12 additions and 5 deletions
1
TODO
1
TODO
|
@ -2,5 +2,4 @@
|
|||
- Implement light multi-sampling (mainly for skydome).
|
||||
- Implement scaling and scrolling on previews.
|
||||
- Water and terrain LOD moves with the camera, fix it like in the wanderer.
|
||||
- Find the random segfault at start (in PreviewTerrainColor::getColor).
|
||||
- Restore render progress.
|
||||
|
|
|
@ -151,7 +151,8 @@ void BaseForm::addPreview(Preview* preview, QString label)
|
|||
{
|
||||
previews->layout()->addWidget(new QLabel(label, previews));
|
||||
previews->layout()->addWidget(preview);
|
||||
|
||||
|
||||
preview->start();
|
||||
preview->setObjectName("_form_preview_");
|
||||
}
|
||||
|
||||
|
|
|
@ -98,10 +98,12 @@ DialogNoise::DialogNoise(QWidget *parent, NoiseGenerator* value):
|
|||
previews->layout()->addWidget(new QLabel("Level preview"));
|
||||
previews->layout()->addWidget(previewLevel);
|
||||
previewLevel->setScaling(1.0 / 127.0);
|
||||
previewLevel->start();
|
||||
previewTotal = new PreviewTotal(previews, _current);
|
||||
previews->layout()->addWidget(new QLabel("Total preview"));
|
||||
previews->layout()->addWidget(previewTotal);
|
||||
previewTotal->setScaling(1.0 / 127.0);
|
||||
previewTotal->start();
|
||||
|
||||
form = new QWidget(this);
|
||||
form->setLayout(new QVBoxLayout());
|
||||
|
|
|
@ -61,7 +61,6 @@ Preview::Preview(QWidget* parent) :
|
|||
QObject::connect(this, SIGNAL(redrawRequested()), this, SLOT(handleRedraw()));
|
||||
|
||||
this->updater = new PreviewDrawer(this);
|
||||
this->updater->start();
|
||||
}
|
||||
|
||||
Preview::~Preview()
|
||||
|
@ -73,7 +72,8 @@ Preview::~Preview()
|
|||
|
||||
delete updater;
|
||||
delete pixbuf;
|
||||
delete lock_drawing;;}
|
||||
delete lock_drawing;
|
||||
}
|
||||
|
||||
void Preview::updateData()
|
||||
{
|
||||
|
@ -84,6 +84,11 @@ QColor Preview::getColor(double x, double y)
|
|||
return QColor(0, 0, 0);
|
||||
}
|
||||
|
||||
void Preview::start()
|
||||
{
|
||||
this->updater->start();
|
||||
}
|
||||
|
||||
void Preview::doRender()
|
||||
{
|
||||
if (this->alive)
|
||||
|
|
|
@ -14,6 +14,7 @@ public:
|
|||
Preview(QWidget* parent);
|
||||
~Preview();
|
||||
|
||||
void start();
|
||||
void doRender();
|
||||
void redraw();
|
||||
|
||||
|
@ -30,7 +31,6 @@ protected:
|
|||
private:
|
||||
void forceRender();
|
||||
void renderPixbuf();
|
||||
static void startUpdater();
|
||||
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
void paintEvent(QPaintEvent* event);
|
||||
|
|
Loading…
Reference in a new issue