From f91ed2c7f320d0407e9ec9e12ec7231e88b7879b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Tue, 10 Jan 2012 20:51:27 +0000 Subject: [PATCH] paysages: Qt GUI (WIP). git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@221 b1fd45b6-86a6-48da-8261-f70d1f35bdcc --- Makefile | 5 + cli/Makefile | 21 + cli/main.c | 10 + gui_gtk/global.c | 2 +- gui_gtk/gui.glade | 2091 +++++++++++++++++++++++++++++++++++++++ gui_qt/baseform.cpp | 18 +- gui_qt/baseform.h | 2 + gui_qt/dialogrender.cpp | 34 +- gui_qt/dialogrender.h | 8 +- gui_qt/formrender.cpp | 8 +- gui_qt/formrender.h | 2 + gui_qt/mainwindow.cpp | 34 +- gui_qt/mainwindow.h | 2 + lib_paysages/Makefile | 4 +- lib_paysages/render.c | 2 + lib_paysages/water.c | 2 + 16 files changed, 2224 insertions(+), 21 deletions(-) create mode 100644 cli/Makefile create mode 100644 cli/main.c create mode 100644 gui_gtk/gui.glade diff --git a/Makefile b/Makefile index 698f4f4..2158814 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,18 @@ all: cd lib_paysages && make + cd cli && make cd gui_gtk && make cd gui_qt && qmake && make clean: cd lib_paysages && make clean + cd cli && make clean cd gui_gtk && make clean cd gui_qt && make clean && rm -f Makefile paysages-qt +run_cli: + LD_LIBRARY_PATH=lib_paysages ./cli/paysages-cli + run_gtk: LD_LIBRARY_PATH=lib_paysages ./gui_gtk/paysages-gtk diff --git a/cli/Makefile b/cli/Makefile new file mode 100644 index 0000000..74ab6ad --- /dev/null +++ b/cli/Makefile @@ -0,0 +1,21 @@ +SOURCES=$(wildcard *.c) +OBJECTS=${SOURCES:.c=.o} +HEADERS=$(wildcard ../lib_paysages/shared/*.h ../lib_paysages/*.h *.h) +RESULT=paysages-cli +CC_FLAGS=-g -pg -Wall +CC_LDFLAGS=-L../lib_paysages/ -lpaysages + +all:${RESULT} + +clean: + rm -f ${OBJECTS} + rm -f ${RESULT} + +%.o:%.c ${HEADERS} + ${CC} -c ${CC_FLAGS} $< -o $@ + +${RESULT}:${OBJECTS} + ${CC} $^ ${CC_LDFLAGS} -o $@ + +.PHONY:all clean + diff --git a/cli/main.c b/cli/main.c new file mode 100644 index 0000000..73f8343 --- /dev/null +++ b/cli/main.c @@ -0,0 +1,10 @@ +#include +#include + +#include "../lib_paysages/shared/functions.h" + +int main(int argc, char** argv) +{ + paysagesInit(); + return 0; +} diff --git a/gui_gtk/global.c b/gui_gtk/global.c index c3f5387..31d7e39 100644 --- a/gui_gtk/global.c +++ b/gui_gtk/global.c @@ -67,7 +67,7 @@ void guiInit() gtk_init(&argc, &argv); gui_definition = gtk_builder_new(); - gtk_builder_add_from_file(gui_definition, "data/gui.glade", &p_err); + gtk_builder_add_from_file(gui_definition, "gui_gtk/gui.glade", &p_err); _main_window = GTK_WINDOW(GET_WIDGET("main_window")); g_signal_connect(_main_window, "delete_event", G_CALLBACK(_cbQuit), NULL); diff --git a/gui_gtk/gui.glade b/gui_gtk/gui.glade new file mode 100644 index 0000000..72dd9cc --- /dev/null +++ b/gui_gtk/gui.glade @@ -0,0 +1,2091 @@ + + + + + + + + + + + + + 0 + 0 + + + + + False + Paysages - Color gradient editor + False + True + center-on-parent + True + True + main_window + + + True + False + vertical + + + True + False + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK + 5 + + + 500 + 50 + True + False + gtk-missing-image + + + + + False + True + 0 + + + + + True + False + + + + + + + + + False + True + 1 + + + + + True + False + True + spread + + + Validate + True + True + True + False + + + False + False + 0 + + + + + Cancel + True + True + True + False + + + False + False + 1 + + + + + False + False + 5 + 2 + + + + + + + False + Paysages - Noise editor + False + True + center-on-parent + True + True + main_window + + + True + False + + + True + False + + + Randomize base noise + True + True + True + False + + + False + False + 5 + 0 + + + + + True + False + Entropy + + + False + False + 5 + 1 + + + + + True + True + The entropy is the size of the random base. +A small entropy will make the noise repeat more often. + + False + False + 1 + True + + + True + True + 5 + 2 + + + + + True + False + Random seed + + + False + False + 5 + 3 + + + + + True + True + + True + False + False + True + + + True + True + 5 + 4 + + + + + False + False + 5 + 0 + + + + + True + False + + + True + False + 0 + etched-out + + + True + False + 5 + + + True + False + GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK + + + 256 + 256 + True + False + gtk-missing-image + + + + + False + False + 5 + 0 + + + + + True + False + spread + + + Center + True + True + True + False + + + False + False + 0 + + + + + 1D + True + True + True + False + + + False + False + 1 + + + + + False + False + 5 + 1 + + + + + + + True + False + 5 + Preview + True + + + + + False + False + 5 + 0 + + + + + True + False + + + True + False + Noise levels + + + False + False + 0 + + + + + True + True + noise_editor_levels_model + False + False + + + + + + Height + + + + 0 + + + + + + + Scale + + + + 1 + + + + + + + True + True + 5 + 1 + + + + + True + False + 5 + True + spread + + + Add level + True + True + True + False + + + False + False + 0 + + + + + Remove level + True + True + True + False + + + False + False + 1 + + + + + False + False + 5 + 2 + + + + + True + False + 2 + 2 + + + True + False + Height + + + + + 5 + 5 + + + + + True + False + Scale + + + 1 + 2 + + + 5 + 5 + + + + + True + True + + False + False + 4 + True + + + 1 + 2 + + 5 + 5 + + + + + True + True + + False + False + 1.0000000000000001e-05 + 4 + True + + + 1 + 2 + 1 + 2 + + 5 + 5 + + + + + False + False + 5 + 3 + + + + + True + True + 5 + 1 + + + + + True + True + 5 + 1 + + + + + True + False + True + spread + + + Validate + True + True + True + False + + + False + False + 0 + + + + + Cancel + True + True + True + False + + + False + False + 1 + + + + + False + False + 5 + 2 + + + + + + + False + Paysages - Render + True + center-on-parent + True + True + False + main_window + + + True + False + + + 850 + 650 + True + True + + + True + False + + + True + False + gtk-missing-image + + + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + 0 + + + + + Stop rendering + True + True + True + False + + + True + True + 5 + 1 + + + + + Close + True + True + True + False + + + True + True + 2 + + + + + False + False + 5 + 1 + + + + + + + False + Paysages + + + True + False + + + True + False + + + True + False + False + _Fichier + True + + + True + False + + + gtk-new + True + False + False + False + True + True + + + + + gtk-open + True + False + False + True + True + + + + + gtk-save + True + False + False + False + True + True + + + + + gtk-save-as + True + False + False + True + True + + + + + True + False + False + + + + + gtk-quit + True + False + False + True + True + + + + + + + + + True + False + False + Aid_e + True + + + True + False + + + gtk-about + True + False + False + False + True + True + + + + + + + + + False + True + 0 + + + + + True + True + + + True + False + + + True + False + 5 + 5 + + + True + False + Height preview + + + False + False + 0 + + + + + True + False + GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK + + + 256 + 256 + True + False + gtk-missing-image + + + + + False + False + 1 + + + + + False + False + 0 + + + + + True + False + 5 + + + Edit noise + True + True + True + 5 + False + + + False + False + 0 + + + + + + + + True + True + 1 + + + + + False + + + + + True + False + Terrain + + + False + + + + + True + False + + + True + False + 5 + vertical + 5 + + + True + False + Coverage preview + + + False + False + 0 + + + + + True + False + GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK + + + 256 + 256 + True + False + gtk-missing-image + + + + + False + False + 1 + + + + + True + False + Look preview + + + False + False + 2 + + + + + True + False + GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK + + + 256 + 256 + True + False + gtk-missing-image + + + + + False + False + 3 + + + + + False + False + 0 + + + + + True + False + 5 + + + Edit noise (waves) + True + True + True + 5 + False + + + False + False + 0 + + + + + True + False + 5 + 5 + 5 + 6 + 2 + + + True + False + Height + + + 0 + 0 + 1 + 1 + + + + + True + False + Transparency + + + 0 + 1 + 1 + 1 + + + + + True + False + Reflection + + + 0 + 2 + 1 + 1 + + + + + 250 + True + True + 1 + 2 + + + 1 + 1 + 1 + 1 + + + + + 250 + True + True + 2 + 2 + + + 1 + 0 + 1 + 1 + + + + + True + False + Surface color + + + 0 + 3 + 1 + 1 + + + + + 100 + True + True + True + start + False + Choose a main water color + rgb(0,0,0) + + + 1 + 3 + 1 + 1 + + + + + 250 + True + True + 2 + 2 + + + 1 + 2 + 1 + 1 + + + + + True + False + Depth color + + + 0 + 4 + 1 + 1 + + + + + True + False + Depth limit + + + 0 + 5 + 1 + 1 + + + + + 100 + True + True + True + start + False + Choose a main water color + rgb(0,0,0) + + + 1 + 4 + 1 + 1 + + + + + 250 + True + True + 2 + 2 + + + 1 + 5 + 1 + 1 + + + + + False + False + 1 + + + + + True + False + 5 + spread + + + Apply + True + True + True + False + + + False + True + 0 + + + + + Cancel + True + True + True + False + + + False + True + 1 + + + + + False + False + 2 + + + + + False + False + 1 + + + + + 1 + + + + + True + False + Water + + + 1 + False + + + + + True + False + + + True + False + 5 + vertical + 5 + + + True + False + Horizon preview + + + False + True + 0 + + + + + True + False + GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK + + + 256 + 256 + True + False + gtk-missing-image + + + + + False + False + 1 + + + + + False + True + 0 + + + + + True + False + vertical + + + True + False + 5 + 5 + 5 + True + 7 + 2 + + + True + False + Day time + + + 0 + 0 + 1 + 1 + + + + + 250 + True + True + 2 + 2 + + + 1 + 0 + 1 + 1 + + + + + True + False + Sun color + + + 0 + 1 + 1 + 1 + + + + + True + False + Sun radius + + + 0 + 2 + 1 + 1 + + + + + 250 + True + True + 2 + 2 + + + 1 + 2 + 1 + 1 + + + + + True + False + Zenith color + + + 0 + 3 + 1 + 1 + + + + + True + False + Haze color + + + 0 + 4 + 1 + 1 + + + + + True + False + Haze height + + + 0 + 5 + 1 + 1 + + + + + 250 + True + True + 2 + 2 + + + 1 + 5 + 1 + 1 + + + + + True + False + Haze smoothing + + + 0 + 6 + 1 + 1 + + + + + 250 + True + True + 2 + 2 + + + 1 + 6 + 1 + 1 + + + + + True + False + + + 200 + 30 + True + False + gtk-missing-image + + + True + True + 0 + + + + + Edit + True + True + True + False + + + True + True + 1 + + + + + 1 + 1 + 1 + 1 + + + + + True + False + + + 200 + 30 + True + False + gtk-missing-image + + + True + True + 0 + + + + + Edit + True + True + True + False + + + True + True + 1 + + + + + 1 + 3 + 1 + 1 + + + + + True + False + + + 200 + 30 + True + False + gtk-missing-image + + + True + True + 0 + + + + + Edit + True + True + True + False + + + True + True + 1 + + + + + 1 + 4 + 1 + 1 + + + + + False + False + 0 + + + + + True + False + 5 + spread + + + Apply + True + True + True + False + + + False + True + 0 + + + + + Cancel + True + True + True + False + + + False + True + 1 + + + + + False + False + 1 + + + + + False + True + 1 + + + + + 2 + + + + + True + False + Sky + + + 2 + False + + + + + True + False + + + True + False + 5 + vertical + 5 + + + True + False + Layers + + + False + False + 0 + + + + + True + False + + + True + True + clouds_layers_model + + + + + + Altitude + + + + 0 + + + + + + + Height + + + + 1 + + + + + + + False + True + 0 + + + + + True + False + 5 + vertical + 5 + start + + + Add layer + True + True + True + False + + + False + False + 0 + + + + + Remove layer + True + True + True + False + + + False + False + 1 + + + + + False + False + 1 + + + + + False + False + 1 + + + + + True + False + Layer preview + + + False + False + 2 + + + + + True + False + GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK + + + 256 + 256 + True + False + gtk-missing-image + + + + + False + False + 3 + + + + + False + False + 0 + + + + + + + + 3 + + + + + True + False + Clouds + + + 3 + False + + + + + 280 + True + False + + + True + False + 4 + 2 + + + True + True + 5 + 5 + 5 + 5 + 0 + 0 + + + 1 + 2 + + 5 + 5 + + + + + True + False + Render quality + + + + + 5 + 5 + + + + + True + False + Render width + + + 1 + 2 + + + 5 + 5 + + + + + True + False + Render height + + + 2 + 3 + + + 5 + 5 + + + + + True + True + 5 + 6 + 5 + 5 + + 0 + True + + + 1 + 2 + 1 + 2 + + + + + + True + True + 5 + 5 + 5 + 5 + + 0 + True + + + 1 + 2 + 2 + 3 + + + + + + True + False + Render mode + + + 3 + 4 + + + 5 + 5 + + + + + True + False + 5 + 10 + + + Two pass (recommended) + True + True + False + Scenery is rendered using polygons then post-processed with texturing and lighting. + False + 0 + True + True + + + False + True + 0 + + + + + Ray walking + True + True + False + A ray is cast from the camera to find intersection with the scenery. +This method is currently largely inaccurate and slower than two-pass rendering. + False + 0 + True + True + rander_mode_twopass + + + False + True + 1 + + + + + 1 + 2 + 3 + 4 + + + + + + False + False + 0 + + + + + True + False + 5 + 10 + spread + + + Start new render + True + True + True + False + + + False + True + 0 + + + + + Show last render + True + True + True + False + + + False + True + 1 + + + + + Save last render + True + True + True + False + + + False + True + 2 + + + + + False + False + 1 + + + + + 4 + False + + + + + True + False + Render + + + 4 + False + + + + + True + True + 1 + + + + + + + + + + + + + + + 0 + 0 + + + + diff --git a/gui_qt/baseform.cpp b/gui_qt/baseform.cpp index 11d3ad5..9fa172a 100644 --- a/gui_qt/baseform.cpp +++ b/gui_qt/baseform.cpp @@ -14,7 +14,6 @@ BaseForm::BaseForm(QWidget* parent) : QWidget(parent) { - QPushButton* button; QWidget* hwidget; QVBoxLayout* vlayout; QHBoxLayout* hlayout; @@ -43,11 +42,14 @@ BaseForm::BaseForm(QWidget* parent) : hwidget->setLayout(hlayout); this->setLayout(vlayout); + this->setObjectName("_base_form_"); - button = addButton("Apply"); - connect(button, SIGNAL(clicked()), this, SLOT(applyConfig())); - button = addButton("Revert"); - connect(button, SIGNAL(clicked()), this, SLOT(revertConfig())); + button_apply = addButton("Apply"); + button_apply->setEnabled(false); + connect(button_apply, SIGNAL(clicked()), this, SLOT(applyConfig())); + button_revert = addButton("Revert"); + button_revert->setEnabled(false); + connect(button_revert, SIGNAL(clicked()), this, SLOT(revertConfig())); } void BaseForm::applyConfigPreview() @@ -57,6 +59,9 @@ void BaseForm::applyConfigPreview() { list_previews[i]->redraw(); } + + button_apply->setEnabled(true); + button_revert->setEnabled(true); } void BaseForm::revertConfig() @@ -68,6 +73,9 @@ void BaseForm::revertConfig() } BaseForm::applyConfigPreview(); + + button_apply->setEnabled(false); + button_revert->setEnabled(false); } void BaseForm::applyConfig() diff --git a/gui_qt/baseform.h b/gui_qt/baseform.h index 04670ae..90d3163 100644 --- a/gui_qt/baseform.h +++ b/gui_qt/baseform.h @@ -35,6 +35,8 @@ private: QWidget* previews; QWidget* form; QWidget* buttons; + QPushButton* button_apply; + QPushButton* button_revert; }; #endif // _PAYSAGES_QT_BASEFORM_H_ diff --git a/gui_qt/dialogrender.cpp b/gui_qt/dialogrender.cpp index ee96bd0..69c6547 100644 --- a/gui_qt/dialogrender.cpp +++ b/gui_qt/dialogrender.cpp @@ -62,7 +62,7 @@ public: } }; -DialogRender::DialogRender(QWidget *parent) : +DialogRender::DialogRender(QWidget *parent, int quality, int width, int height): QDialog(parent) { QScrollArea* scroll; @@ -74,7 +74,7 @@ DialogRender::DialogRender(QWidget *parent) : setLayout(new QVBoxLayout()); scroll = new QScrollArea(this); - scroll->setMinimumSize(850, 650); + scroll->setMinimumSize(width > 800 ? 850 : width + 50, height > 600 ? 650 : height + 50); scroll->setAlignment(Qt::AlignCenter); area = new RenderArea(scroll); scroll->setWidget(area); @@ -83,13 +83,39 @@ DialogRender::DialogRender(QWidget *parent) : progress = new QProgressBar(this); progress->setMinimum(0); progress->setMaximum(1000); + progress->setValue(0); layout()->addWidget(progress); progress_value = 0; - renderSetSize(800, 600); - autoSetRenderQuality(5); + renderSetSize(width, height); + autoSetRenderQuality(quality); + renderSetPreviewCallbacks(_renderResize, _renderClear, _renderDraw, _renderUpdate); render_thread = new RenderThread(); render_thread->start(); } + +void DialogRender::closeEvent(QCloseEvent* e) +{ + renderInterrupt(); + render_thread->wait(); + + renderSetPreviewCallbacks(NULL, NULL, NULL, NULL); + + delete render_thread; + delete pixbuf; +} + +void DialogRender::reject() +{ + renderInterrupt(); + render_thread->wait(); + + renderSetPreviewCallbacks(NULL, NULL, NULL, NULL); + + delete render_thread; + delete pixbuf; + + QDialog::reject(); +} diff --git a/gui_qt/dialogrender.h b/gui_qt/dialogrender.h index 4a0c821..6b34063 100644 --- a/gui_qt/dialogrender.h +++ b/gui_qt/dialogrender.h @@ -9,15 +9,17 @@ class DialogRender : public QDialog { Q_OBJECT public: - explicit DialogRender(QWidget *parent = 0); + explicit DialogRender(QWidget *parent, int quality, int width, int height); QImage* pixbuf; QWidget* area; QProgressBar* progress; int progress_value; -signals: - public slots: + virtual void reject(); + +protected: + virtual void closeEvent(QCloseEvent* e); private: QThread* render_thread; diff --git a/gui_qt/formrender.cpp b/gui_qt/formrender.cpp index 2a4ac33..4fe13d6 100644 --- a/gui_qt/formrender.cpp +++ b/gui_qt/formrender.cpp @@ -5,11 +5,15 @@ /**************** Form ****************/ FormRender::FormRender(QWidget *parent) : BaseForm(parent), - _quality(5) + _quality(5), + _width(800), + _height(600) { QPushButton* button; addInputInt("Quality", &_quality, 1, 10, 1, 1); + addInputInt("Image width", &_width, 100, 2000, 10, 100); + addInputInt("Image height", &_height, 100, 2000, 10, 100); button = addButton("Start new render"); connect(button, SIGNAL(clicked()), this, SLOT(startRender())); @@ -23,7 +27,7 @@ FormRender::FormRender(QWidget *parent) : void FormRender::startRender() { - DialogRender* dialog = new DialogRender(); + DialogRender* dialog = new DialogRender(this, _quality, _width, _height); dialog->exec(); delete dialog; diff --git a/gui_qt/formrender.h b/gui_qt/formrender.h index fd87b87..ba14f53 100644 --- a/gui_qt/formrender.h +++ b/gui_qt/formrender.h @@ -17,6 +17,8 @@ private slots: private: int _quality; + int _width; + int _height; }; #endif // _PAYSAGES_QT_FORMRENDER_H_ diff --git a/gui_qt/mainwindow.cpp b/gui_qt/mainwindow.cpp index b688b9b..81c17bb 100644 --- a/gui_qt/mainwindow.cpp +++ b/gui_qt/mainwindow.cpp @@ -7,6 +7,7 @@ #include "formwater.h" #include "formsky.h" #include "formrender.h" +#include "dialogrender.h" #include "../lib_paysages/shared/functions.h" @@ -36,28 +37,53 @@ MainWindow::MainWindow(QWidget *parent) : tabs->addTab(new FormSky(tabs), "Sky"); tabs->addTab(new FormRender(tabs), "Render"); - menu = menuBar()->addMenu("File"); + menu = menuBar()->addMenu("Scene"); menu->addAction("New", this, SLOT(fileNew())); menu->addAction("Save", this, SLOT(fileSave())); menu->addAction("Load", this, SLOT(fileLoad())); menu->addAction("Quit", this, SLOT(close())); + menu = menuBar()->addMenu("Render"); + menu->addAction("Quick render", this, SLOT(quickPreview()), QKeySequence("F2")); + setCentralWidget(tabs); } +void MainWindow::refreshAll() +{ + QList list_forms = this->findChildren("_base_form_"); + for (int i = 0; i < list_forms.size(); i++) + { + list_forms[i]->revertConfig(); + } +} + void MainWindow::fileNew() { - // TODO + autoGenRealisticLandscape(0); + refreshAll(); } void MainWindow::fileSave() { QString filepath = QFileDialog::getSaveFileName(this); - autoSave((char*)filepath.toStdString().c_str()); + if (!filepath.isNull()) + { + autoSave((char*)filepath.toStdString().c_str()); + } } void MainWindow::fileLoad() { QString filepath = QFileDialog::getOpenFileName(this); - autoLoad((char*)filepath.toStdString().c_str()); + if (!filepath.isNull()) + { + autoLoad((char*)filepath.toStdString().c_str()); + refreshAll(); + } +} + +void MainWindow::quickPreview() +{ + DialogRender(this, 3, 400, 300).exec(); } diff --git a/gui_qt/mainwindow.h b/gui_qt/mainwindow.h index 6675980..9b14af6 100644 --- a/gui_qt/mainwindow.h +++ b/gui_qt/mainwindow.h @@ -15,9 +15,11 @@ public: explicit MainWindow(QWidget *parent = 0); public slots: + void refreshAll(); void fileNew(); void fileSave(); void fileLoad(); + void quickPreview(); }; #endif // _PAYSAGES_QT_MAINWINDOW_H_ diff --git a/lib_paysages/Makefile b/lib_paysages/Makefile index 81b14d1..0fa5196 100644 --- a/lib_paysages/Makefile +++ b/lib_paysages/Makefile @@ -2,8 +2,8 @@ SOURCES=$(wildcard *.c) OBJECTS=${SOURCES:.c=.o} HEADERS=$(wildcard shared/*.h *.h) RESULT=libpaysages.so -CC_FLAGS=-g -pg -Wall $(shell pkg-config --cflags glib-2.0) -CC_LDFLAGS=$(shell pkg-config --libs glib-2.0) -lIL -lILU +CC_FLAGS=-g -pg -Wall $(shell pkg-config --cflags glib-2.0 gthread-2.0) +CC_LDFLAGS=$(shell pkg-config --libs glib-2.0 gthread-2.0) -lIL -lILU all:${RESULT} diff --git a/lib_paysages/render.c b/lib_paysages/render.c index 41226b5..ec2f9a6 100644 --- a/lib_paysages/render.c +++ b/lib_paysages/render.c @@ -136,6 +136,8 @@ void renderClear() scanline_right = render_width - 1; _progress = 0.0; + _progress_step_start = 0.0; + _progress_step_length = 0.0; _interrupt = 0; _cb_preview_clear(background_color); diff --git a/lib_paysages/water.c b/lib_paysages/water.c index a4f5832..f89e059 100644 --- a/lib_paysages/water.c +++ b/lib_paysages/water.c @@ -75,6 +75,8 @@ WaterDefinition waterCreateDefinition() { WaterDefinition result; + result.main_color = COLOR_BLACK; + result.depth_color = COLOR_BLACK; result.height = -1000.0; result.height_noise = noiseCreateGenerator(); result.height_noise_factor = 1.0;