diff --git a/Fragmentarium-Source/Fragmentarium.desktop b/Fragmentarium-Source/Fragmentarium.desktop index 542f551..07c67d3 100644 --- a/Fragmentarium-Source/Fragmentarium.desktop +++ b/Fragmentarium-Source/Fragmentarium.desktop @@ -1,8 +1,8 @@ [Desktop Entry] Type=Application -Name=Fragmentarium-2.5.7-221219 +Name=Fragmentarium-2.5.7-221224 Comment=Experimental GLSL IDE An integrated environment for exploring GPU pixel graphics. -TryExec=Fragmentarium-2.5.7-221219 +TryExec=Fragmentarium-2.5.7-221224 Exec=Fragmentarium-2.5.7 Icon=FragMicon NoDisplay=false diff --git a/Fragmentarium-Source/Fragmentarium/GUI/DisplayWidget.h b/Fragmentarium-Source/Fragmentarium/GUI/DisplayWidget.h index 6df3f3b..96f1f19 100644 --- a/Fragmentarium-Source/Fragmentarium/GUI/DisplayWidget.h +++ b/Fragmentarium-Source/Fragmentarium/GUI/DisplayWidget.h @@ -148,7 +148,6 @@ class DisplayWidget : public QOpenGLWidget, protected QOpenGLFunctions { return continuous; } - void reset(); void setContextMenu ( QMenu *contextMenu ) { this->contextMenu = contextMenu; diff --git a/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.cpp b/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.cpp index 148ca8a..4e0ff41 100644 --- a/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.cpp +++ b/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.cpp @@ -73,7 +73,6 @@ MainWindow::MainWindow(QWidget* parent) supportProgramsMenu = nullptr; maxRecentFiles = 5; editorTheme = 0; - lastStoredTime = 0; engine = nullptr; setAcceptDrops(true); @@ -97,7 +96,6 @@ MainWindow::MainWindow(QWidget* parent) maxLogFileSize = 125000; fullPathInRecentFilesList = false; includeWithAutoSave = true; - playRestartMode = false; lockedAspect = false; @@ -251,8 +249,8 @@ void MainWindow::new2DFile() #include \"Complex.frag\" \r\n\ #include \"Progressive2D.frag\" \r\n\ \r\n\ -// Escape time fractals iterate a functions for each point \r\n\ -// in the plane, and check if the sequence generated converges. \r\n\ +// Escape time fractals iterate a function for each point \r\n\ +// in the plane, and checks if the sequence generated converges. \r\n\ // \r\n\ // Just implement the \'color\' function below. \r\n\ // It is possible to draw Mandelbrots and Julias \r\n\ @@ -541,8 +539,8 @@ void MainWindow::showHelpMessage(const QString title, const QString mess) mb.setText(mess); mb.setWindowTitle(title); mb.setIconPixmap(getMiscDir() + "/" + "Fragmentarium-sm.png"); - auto *layout = (QGridLayout *)mb.layout(); - layout->setColumnMinimumWidth( 2, 640); + QGridLayout *glayout = (QGridLayout *)mb.layout(); + glayout->setColumnMinimumWidth( 2, 640); mb.exec(); } @@ -827,7 +825,7 @@ void MainWindow::init() dockLog->setAllowedAreas(Qt::RightDockWidgetArea|Qt::BottomDockWidgetArea); QWidget* dockLogContents = new QWidget(dockLog); dockLogContents->setObjectName(QString::fromUtf8("dockWidgetContents")); - auto *vboxLayout1 = new QVBoxLayout(dockLogContents); + QVBoxLayout *vboxLayout1 = new QVBoxLayout(dockLogContents); vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); vboxLayout1->setContentsMargins(0, 0, 0, 0); logger = new ListWidgetLogger(dockLog); @@ -844,7 +842,7 @@ void MainWindow::init() dockVariableEditor->setAllowedAreas(Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea); QWidget* editorLogContents = new QWidget(dockLog); editorLogContents->setObjectName(QString::fromUtf8("editorLogContents")); - auto *vboxLayout2 = new QVBoxLayout(editorLogContents); + QVBoxLayout *vboxLayout2 = new QVBoxLayout(editorLogContents); vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); vboxLayout2->setContentsMargins(0, 0, 0, 0); variableEditor = new VariableEditor(dockVariableEditor, this); @@ -976,7 +974,7 @@ void MainWindow::initTools() exrToolsMenu = menuBar()->addMenu(tr("EXR Tools")); } // add item to menu - auto *a = new QAction(qfi.fileName(), this); + QAction *a = new QAction(qfi.fileName(), this); a->setData(toolName); a->setObjectName(toolName); connect(a, SIGNAL(triggered()), this, SLOT(runEXRTool())); @@ -1017,7 +1015,7 @@ void MainWindow::initTools() supportProgramsMenu = menuBar()->addMenu(tr("GLSL Tools")); } // add item to menu - auto *a = new QAction(qfi.fileName(), this); + QAction *a = new QAction(qfi.fileName(), this); a->setData(toolName); a->setObjectName(toolName); connect(a, SIGNAL(triggered()), this, SLOT(runSupportProgram())); @@ -1036,7 +1034,7 @@ void MainWindow::initTools() if (supportProgramsMenu == nullptr) { supportProgramsMenu = menuBar()->addMenu(tr("GLSL Tools")); } - auto *a = new QAction(tr("Import Gimp Gradient"), this); + QAction *a = new QAction(tr("Import Gimp Gradient"), this); a->setObjectName("convertgradient"); connect(a, SIGNAL(triggered()), this, SLOT(runSupportProgram())); supportProgramsMenu->addAction(a); @@ -1061,6 +1059,7 @@ void MainWindow::runEXRTool() QString helpText; while (!file.atEnd()) { QByteArray line = file.readLine(); + if(QString(line).contains(QDir::separator())) line = QString(line).split(QDir::separator()).last().toLocal8Bit(); if (QString(line).contains("Options") && QString(line).contains(":")) { break; } @@ -1214,6 +1213,7 @@ void MainWindow::createOpenGLContextMenu() openGLContextMenu->addMenu(renderMenu); openGLContextMenu->addMenu(examplesMenu); openGLContextMenu->addMenu(helpMenu); + openGLContextMenu->addMenu(optionsMenu); openGLContextMenu->addAction(exitAction); engine->setContextMenu(openGLContextMenu); } @@ -1367,10 +1367,17 @@ void MainWindow::createActions() connect(scriptingControlAction, SIGNAL(triggered()), this, SLOT(showScriptingHelp())); clearTexturesAction = new QAction(tr("Clear Texture Cache"), this); + clearTexturesAction->setObjectName(QString::fromUtf8("clearTexturesAction")); connect(clearTexturesAction, SIGNAL(triggered()), this, SLOT(clearTextures())); + clearAnimationObjectsAction = new QAction(tr("Clear Animation Actions"), this); + clearAnimationObjectsAction->setStatusTip(tr("Clears camera control and Easingcurve cache")); + clearAnimationObjectsAction->setObjectName(QString::fromUtf8("clearAnimationObjectsAction")); + connect(clearAnimationObjectsAction, SIGNAL(triggered()), this, SLOT(clearKeyFrames())); + testCompileGLSLAction = new QAction(tr("Test versions"), this); testCompileGLSLAction->setStatusTip(tr("Tests the current fragment against all supported GLSL versions.")); + testCompileGLSLAction->setObjectName(QString::fromUtf8("testCompileGLSLAction")); connect(testCompileGLSLAction, SIGNAL(triggered()), this, SLOT(testCompileGLSL())); loopCameraPathAction = new QAction(tr("Loop Camera Path"), this); @@ -1383,17 +1390,13 @@ void MainWindow::createActions() sfHomeAction->setStatusTip(tr("Open the project page in a browser.")); connect(sfHomeAction, SIGNAL(triggered()), this, SLOT(launchSfHome())); - referenceAction = new QAction(QIcon(":/Icons/agt_internet.png"), tr("&Fragmentarium@FractalForums (web link)"), this); - referenceAction->setStatusTip(tr("Open a FractalForums.com Fragmentarium web page in a browser.")); - connect(referenceAction, SIGNAL(triggered()), this, SLOT(launchReferenceHome())); - - referenceAction2 = new QAction(QIcon(":/Icons/agt_internet.png"), tr("&Fragmentarium 3Dickulus (web link)"), this); - referenceAction2->setStatusTip(tr("Open a Fragmentarium reference web page in a browser.")); - connect(referenceAction2, SIGNAL(triggered()), this, SLOT(launchReferenceHome2())); + ffReferenceAction = new QAction(QIcon(":/Icons/agt_internet.png"), tr("&Fragmentarium@FractalForums (web link)"), this); + ffReferenceAction->setStatusTip(tr("Open a FractalForums.com Fragmentarium web page in a browser.")); + connect(ffReferenceAction, SIGNAL(triggered()), this, SLOT(launchReferenceHome())); - referenceAction3 = new QAction(QIcon(":/Icons/agt_internet.png"), tr("&Fragmentarium Documentation (web link)"), this); - referenceAction3->setStatusTip(tr("Open a Fragmentarium reference web page in a browser.")); - connect(referenceAction3, SIGNAL(triggered()), this, SLOT(launchDocumentation())); + fragmReferenceAction = new QAction(QIcon(":/Icons/agt_internet.png"), tr("&Fragmentarium Documentation (web link)"), this); + fragmReferenceAction->setStatusTip(tr("Open a Fragmentarium reference web page in a browser.")); + connect(fragmReferenceAction, SIGNAL(triggered()), this, SLOT(launchDocumentation())); galleryAction = new QAction(QIcon(":/Icons/agt_internet.png"), tr("&Flickr Fragmentarium Group (web link)"), this); galleryAction->setStatusTip(tr("Opens the main Flickr group for Fragmentarium creations.")); @@ -1410,7 +1413,7 @@ void MainWindow::createActions() connect(faqAction, SIGNAL(triggered()), this, SLOT(launchFAQ())); for (int i = 0; i < maxRecentFiles; ++i) { - auto *a = new QAction(this); + QAction *a = new QAction(this); a->setVisible(false); connect(a, SIGNAL(triggered()), this, SLOT(openFile())); recentFileActions.append(a); @@ -1504,22 +1507,23 @@ void MainWindow::createMenus() helpMenu->addAction(scriptingHiresAction); helpMenu->addAction(scriptingControlAction); - helpMenu->addSeparator(); - helpMenu->addMenu(mc); // "windows" menu - helpMenu->addAction(clearTexturesAction); - helpMenu->addAction(testCompileGLSLAction); - helpMenu->addAction(loopCameraPathAction); helpMenu->addSeparator(); helpMenu->addAction(sfHomeAction); - helpMenu->addAction(referenceAction); - helpMenu->addAction(referenceAction2); - helpMenu->addAction(referenceAction3); + helpMenu->addAction(ffReferenceAction); + helpMenu->addAction(fragmReferenceAction); helpMenu->addAction(galleryAction); helpMenu->addAction(glslHomeAction); helpMenu->addAction(faqAction); helpMenu->addAction(introAction); + optionsMenu = menuBar()->addMenu(tr("&Options")); + optionsMenu->addMenu(mc); // "windows" menu + optionsMenu->addAction(clearTexturesAction); + optionsMenu->addAction(clearAnimationObjectsAction); + optionsMenu->addAction(testCompileGLSLAction); + optionsMenu->addAction(loopCameraPathAction); + createOpenGLContextMenu(); } @@ -1556,22 +1560,23 @@ void MainWindow::buildExamplesMenu() QStringList sl = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); for (int i = 0; i < sl.size(); i++) { - auto *menu = new QMenu(sl[i]); - QString absPath = QDir(path + "/" + sl[i]).absolutePath(); - menuMap[absPath] = menu; - currentMenu->addMenu(menu); - menu->setIcon(QIcon(":/Icons/folder.png")); - pathStack.push(absPath); + if(!sl[i].contains("Include")) { + QMenu *menu = new QMenu(sl[i]); + QString absPath = QDir(path + "/" + sl[i]).absolutePath(); + menuMap[absPath] = menu; + currentMenu->addMenu(menu); + menu->setIcon(QIcon(":/Icons/folder.png")); + pathStack.push(absPath); + } } dir.setNameFilters(filters); sl = dir.entryList(); for (int i = 0; i < sl.size(); i++) { - auto *a = new QAction(sl[i], this); + QAction *a = new QAction(sl[i], this); a->setIcon(QIcon(":/Icons/mail_new.png")); - QString absPath = QDir(path ).absoluteFilePath(sl[i]); a->setData(absPath); @@ -1582,8 +1587,7 @@ void MainWindow::buildExamplesMenu() } } -QString MainWindow::makeImgFileName(int timeStep, int timeSteps, - const QString fileName) +QString MainWindow::makeImgFileName(int timeStep, int timeSteps, const QString fileName) { QString name = fileName; @@ -1630,8 +1634,8 @@ void MainWindow::renderTiled(int maxTiles, int tileWidth, int tileHeight, int pa engine->renderTile(padding, time, maxSubframes, tileWidth, tileHeight, tile, maxTiles, &progress, &steps, &im, totalTime); if (padding>0.0) { - auto nw = (int)(tileWidth / (1.0 + padding)); - auto nh = (int)(tileHeight / (1.0 + padding)); + int nw = (int)(tileWidth / (1.0 + padding)); + int nh = (int)(tileHeight / (1.0 + padding)); int ox = (tileWidth-nw)/2; int oy = (tileHeight-nh)/2; im = im.copy(ox,oy,nw,nh); @@ -1733,8 +1737,8 @@ bool MainWindow::writeTiledEXR(int maxTiles, int tileWidth, int tileHeight, int if (padding>0.0) { int w = im.width(); int h = im.height(); - auto nw = (int)(w / (1.0 + padding)); - auto nh = (int)(h / (1.0 + padding)); + int nw = (int)(w / (1.0 + padding)); + int nh = (int)(h / (1.0 + padding)); int ox = (w-nw)/2; int oy = (h-nh)/2; im = im.copy(ox,oy,nw,nh); @@ -2183,13 +2187,13 @@ void MainWindow::tileBasedRender() qd = new QDialog(this); qd->setObjectName(QString::fromUtf8("PREVIEW")); - auto *l = new QVBoxLayout; + QVBoxLayout *l = new QVBoxLayout(qd); - QLabel* label = new QLabel(); + QLabel* label = new QLabel(qd); label->setObjectName(QString::fromUtf8("previewImage")); label->setPixmap(QPixmap::fromImage(finalImage)); - auto *scrollArea = new QScrollArea; + QScrollArea *scrollArea = new QScrollArea; scrollArea->setBackgroundRole(QPalette::Dark); scrollArea->setWidget(label); l->addWidget(scrollArea); @@ -2261,7 +2265,7 @@ void MainWindow::savePreview() QString fn; fn = QFileDialog::getSaveFileName(qd, tr("Save preview image..."), "preview.png", ext); if(!fn.isEmpty()) { - auto *label = qd->findChild("previewImage"); + QLabel *label = qd->findChild("previewImage"); if (label != nullptr) { QImage img = label->pixmap(Qt::ReturnByValue).toImage(); img.setText("frAg", variableEditor->getSettings()); @@ -2398,7 +2402,7 @@ void MainWindow::createToolBars() connect(bufferYSpinBox, SIGNAL(valueChanged(int)), this, SLOT(bufferYSpinBoxChanged(int))); connect(bufferYSpinBox, SIGNAL(editingFinished()), this, SLOT(bufferSizeYChanged())); bufferSizeControl = new QPushButton(tr("Lock to window size"), bufferToolBar); - auto *menu = new QMenu(); + QMenu *menu = new QMenu(bufferToolBar); bufferAction1 = menu->addAction(tr("Lock to window size")); menu->addSeparator(); bufferActionCustom = menu->addAction(tr("Custom size")); @@ -2425,7 +2429,7 @@ void MainWindow::createToolBars() animationButton = new QPushButton( tr("Animation"),renderModeToolBar); animationButton->setCheckable(true); - auto *bg = new QButtonGroup(renderModeToolBar); + QButtonGroup *bg = new QButtonGroup(renderModeToolBar); bg->addButton(progressiveButton); bg->addButton(animationButton); @@ -2549,7 +2553,7 @@ void MainWindow::timeLineRequest(QPoint p) Q_UNUSED(p) - auto *timeDialog = new TimeLineDialog(this, keyframeMap); + TimeLineDialog *timeDialog = new TimeLineDialog(this, keyframeMap); timeDialog->setWindowTitle(strippedName(tabInfo[tabBar->currentIndex()].filename)); timeDialog->exec(); @@ -2558,7 +2562,7 @@ void MainWindow::timeLineRequest(QPoint p) void MainWindow::videoEncoderRequest() { - auto *vDialog = new VideoDialog(this); + VideoDialog *vDialog = new VideoDialog(this); vDialog->exec(); }; @@ -2596,18 +2600,17 @@ void MainWindow::rewind() lastTime->restart(); lastStoredTime = 0; getTime(); + if(variableEditor->hasEasing()) engine->updateEasingCurves(0); engine->requireRedraw(true); engine->update(); } -void MainWindow::play( bool restart ) +void MainWindow::play() { playAction->setEnabled(false); stopAction->setEnabled(true); - if (restart) { lastTime->restart(); - } getTime(); pausePlay=false; engine->setContinuous(true); @@ -2615,11 +2618,10 @@ void MainWindow::play( bool restart ) void MainWindow::stop() { - - engine->setContinuous(false); playAction->setEnabled(true); stopAction->setEnabled(false); lastStoredTime = getTime(); + engine->setContinuous(false); if (engine->getState() == DisplayWidget::Animation) { INFO( tr("Stopping: last stored time set to %1").arg((double)lastStoredTime / renderFPS) ); @@ -2737,7 +2739,6 @@ void MainWindow::readSettings() maxLogFileSize = settings.value("maxLogFileSize", 125).toInt(); fullPathInRecentFilesList = settings.value("fullPathInRecentFilesList", false).toBool(); includeWithAutoSave = settings.value("includeWithAutoSave", false).toBool(); - playRestartMode = settings.value("playRestartMode", false).toBool(); useMimetypes = settings.value("useMimetypes", false).toBool(); exrBinaryPath = settings.value("exrBinPaths", "/usr/bin;bin;").toString().split(";"); supportProgramsBinaryPath = settings.value("supportProgramBinPaths", "/usr/bin;bin;").toString().split(";"); @@ -2790,7 +2791,6 @@ void MainWindow::writeSettings() settings.setValue("showEditToolbar", !editToolBar->isHidden() ); settings.setValue("fullPathInRecentFilesList", fullPathInRecentFilesList ); settings.setValue("includeWithAutoSave", includeWithAutoSave ); - settings.setValue("playRestartMode", playRestartMode ); settings.setValue("useMimetypes", useMimetypes ); settings.setValue("editorTheme", editorTheme); settings.setValue("guiStylesheet", guiStylesheet); @@ -2810,7 +2810,7 @@ void MainWindow::writeSettings() settings.setValue("openFiles", openFiles); settings.setValue("tilewidth",bufferXSpinBox->value()); settings.setValue("tileheight",bufferYSpinBox->value()); - settings.setValue ("tileSizeFromScreen", tileSizeFromScreen); + settings.setValue("tileSizeFromScreen", tileSizeFromScreen); settings.setValue("gimpGradientsPaths", gimpGradientsPaths); @@ -2821,7 +2821,7 @@ void MainWindow::writeSettings() void MainWindow::openFile() { - auto *action = qobject_cast(sender()); + QAction *action = qobject_cast(sender()); if (action != nullptr) { loadFragFile(action->data().toString()); } else { @@ -2848,7 +2848,7 @@ void MainWindow::reloadFragFile( int index ) QFile file(filename); if (!file.open(QFile::ReadOnly | QFile::Text)) { - WARNING(tr("Cannot read file %1:\n%2.").arg(filename).arg(file.errorString())); + WARNING(tr("Cannot read file %1:\n%2.").arg(filename).arg(file.errorString())); } else { te->clear(); QTextStream in(&file); @@ -3207,7 +3207,7 @@ bool MainWindow::initializeFragment() INFO(tr("Compiled script in %1 ms.").arg(ms)); engine->setState(oldState); - pause ? stop() : play(!playRestartMode); + pause ? stop() : play(); hideUnusedVariableWidgets(); @@ -3231,7 +3231,7 @@ void MainWindow::hideUnusedVariableWidgets() QStringList wnames = variableEditor->getWidgetNames(); for (int i = 0; i < wnames.count(); i++) { // find a widget in the variable editor - auto *vw = variableEditor->findChild(wnames.at(i)); + VariableWidget *vw = variableEditor->findChild(wnames.at(i)); if (vw != nullptr) { /// get the uniform location from the shader int uloc = vw->uniformLocation(engine->getShader()); @@ -3344,7 +3344,7 @@ void MainWindow::cursorPositionChanged() TextEdit *MainWindow::insertTabPage(QString filename) { - auto *textEdit = new TextEdit(this); + TextEdit *textEdit = new TextEdit(this); if(editorStylesheet.isEmpty()) textEdit->setStyleSheet("* {font: 9pt Courier;}"); else textEdit->setStyleSheet("* {" + editorStylesheet + "}"); @@ -3559,7 +3559,7 @@ void MainWindow::launchDocumentation() { INFO(tr("Launching web browser...")); - bool s = QDesktopServices::openUrl(QUrl("https://en.wikibooks.org/wiki/Fractals/fragmentarium")); + bool s = QDesktopServices::openUrl(QUrl("https://github.com/3Dickulus/FragM/wiki")); if (!s) { WARNING(tr("Failed to open browser...")); } @@ -3615,16 +3615,6 @@ void MainWindow::launchReferenceHome() } } -void MainWindow::launchReferenceHome2() -{ - - INFO("Launching web browser..."); - bool s = QDesktopServices::openUrl(QUrl("http://www.digilanti.org/fragmentarium/")); - if (!s) { - WARNING(tr("Failed to open browser...")); - } -} - void MainWindow::launchGallery() { @@ -4121,7 +4111,7 @@ void MainWindow::dumpShaderAsm() void MainWindow::saveCmdScript() { - auto *e = sender()->parent()->findChild("cmdScriptEditor", Qt::FindChildrenRecursively); + QTextEdit *e = sender()->parent()->findChild("cmdScriptEditor", Qt::FindChildrenRecursively); scriptText = e->toPlainText(); QString filter = tr("Cmd Script (*.fqs);;All Files (*.*)"); @@ -4167,7 +4157,7 @@ void MainWindow::loadCmdScript() INFO(tr("Cmd Script loaded from file: ") + fileName); settings.setValue("cmdscriptfilename", fileName); // is the editor open? overwrite current script. - auto *e = sender()->parent()->findChild("cmdScriptEditor", Qt::FindChildrenRecursively); + QTextEdit *e = sender()->parent()->findChild("cmdScriptEditor", Qt::FindChildrenRecursively); if (e != nullptr) { e->setPlainText(scriptText); } @@ -4196,7 +4186,7 @@ void MainWindow::editScript() QPushButton *executeButton = new QPushButton(tr("&Execute")); QPushButton *stopButton = new QPushButton(tr("&Stop")); QPushButton *closeButton = new QPushButton(tr("&Close")); - auto *buttonLayout = new QHBoxLayout; + QHBoxLayout *buttonLayout = new QHBoxLayout; buttonLayout->addWidget(saveButton); buttonLayout->addStretch(); buttonLayout->addWidget(loadButton); @@ -4207,7 +4197,7 @@ void MainWindow::editScript() buttonLayout->addStretch(); buttonLayout->addWidget(closeButton); // setup the main layout with text editor - auto *mainLayout = new QVBoxLayout; + QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(t); mainLayout->addLayout(buttonLayout); d->setLayout(mainLayout); diff --git a/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.h b/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.h index d3fa512..ce2881c 100644 --- a/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.h +++ b/Fragmentarium-Source/Fragmentarium/GUI/MainWindow.h @@ -581,7 +581,7 @@ public slots: void documentWasModified(); void closeTab ( int index ); void rewind(); - void play( bool restart = true ); + void play(); void stop(); // for benchmark script int getTileAVG() @@ -621,9 +621,9 @@ public slots: }; void setCameraPathLoop(bool l); + void initTools(); private slots: - void initTools(); void runEXRTool(); void runSupportProgram(); @@ -670,7 +670,6 @@ private slots: void launchFAQ(); void launchIntro(); void launchReferenceHome(); - void launchReferenceHome2(); void launchDocumentation(); void openFile(); void new2DFile(); @@ -758,14 +757,14 @@ private slots: QAction *glslHomeAction; QAction *introAction; QAction *faqAction; - QAction *referenceAction; - QAction *referenceAction2; - QAction *referenceAction3; + QAction *ffReferenceAction; + QAction *fragmReferenceAction; QAction *galleryAction; QAction *scriptingGeneralAction; QAction *scriptingParameterAction; QAction *scriptingHiresAction; QAction *scriptingControlAction; + QAction *clearAnimationObjectsAction; QAction *loopCameraPathAction; QMenu *fileMenu; QMenu *editMenu; @@ -773,6 +772,7 @@ private slots: QMenu *parametersMenu; QMenu *examplesMenu; QMenu *helpMenu; + QMenu *optionsMenu; QToolBar *fileToolBar; QToolBar *renderToolBar; QToolBar *renderModeToolBar; @@ -850,7 +850,6 @@ private slots: bool verbose; bool fullPathInRecentFilesList; bool includeWithAutoSave; - bool playRestartMode; bool useMimetypes; bool loopCameraPath; diff --git a/Fragmentarium-Source/Fragmentarium/GUI/PreferencesDialog.h b/Fragmentarium-Source/Fragmentarium/GUI/PreferencesDialog.h index b993263..14db43f 100644 --- a/Fragmentarium-Source/Fragmentarium/GUI/PreferencesDialog.h +++ b/Fragmentarium-Source/Fragmentarium/GUI/PreferencesDialog.h @@ -148,7 +148,6 @@ private slots: m_ui.includeWithAutoSaveCheckBox->setChecked (settings.value ( "includeWithAutoSave", true ).toBool() ); m_ui.jtloeCheckBox->setChecked (settings.value ( "jumpToLineOnError", true ).toBool() ); m_ui.ddCameraModeCheckBox->setChecked (settings.value ( "ddCameraMode", false ).toBool() ); - m_ui.playRestartModeCheckBox->setChecked (settings.value ( "playRestartMode", false ).toBool() ); m_ui.enableGLDebugCheckBox->setChecked (settings.value ( "enableGLDebug", false ).toBool() ); m_ui.compatPatchCheckBox->setChecked (settings.value ( "compatPatch", true ).toBool() ); m_ui.exrBinPathsLineEdit->setText (settings.value ( "exrBinPaths", "./bin;/usr/bin;" ).toString() ); @@ -186,7 +185,6 @@ private slots: settings.setValue("includeWithAutoSave", m_ui.includeWithAutoSaveCheckBox->isChecked() ); settings.setValue("jumpToLineOnError", m_ui.jtloeCheckBox->isChecked() ); settings.setValue("ddCameraMode", m_ui.ddCameraModeCheckBox->isChecked() ); - settings.setValue("playRestartMode", m_ui.playRestartModeCheckBox->isChecked() ); settings.setValue("enableGLDebug", m_ui.enableGLDebugCheckBox->isChecked() ); settings.setValue("compatPatch", m_ui.compatPatchCheckBox->isChecked() ); settings.setValue("exrBinPaths", m_ui.exrBinPathsLineEdit->text()); diff --git a/Fragmentarium-Source/Fragmentarium/GUI/PreferencesDialog.ui b/Fragmentarium-Source/Fragmentarium/GUI/PreferencesDialog.ui index b9bd09b..752bea4 100644 --- a/Fragmentarium-Source/Fragmentarium/GUI/PreferencesDialog.ui +++ b/Fragmentarium-Source/Fragmentarium/GUI/PreferencesDialog.ui @@ -6,7 +6,7 @@ 0 0 - 815 + 817 689 @@ -21,16 +21,6 @@ - - - Animation update on=continuous off=last set - - - false - - - - @@ -55,30 +45,14 @@ - - - - Qt::Vertical - - - - 320 - 3 - - - - - - - - Some engines use non GL matrices. - + + - Draw spline paths for camera and target + Spline Occlusion - + @@ -99,16 +73,6 @@ - - - - 2D Camera Mode on=traveling off=fixed - - - false - - - @@ -116,14 +80,20 @@ - - - - Full path in recent files menu. + + + + Qt::Vertical - + + + 320 + 3 + + + - + @@ -144,10 +114,30 @@ - - + + - Spline Occlusion + Full path in recent files menu. + + + + + + + Some engines use non GL matrices. + + + Draw spline paths for camera and target + + + + + + + 2D Camera Mode on=traveling off=fixed + + + false diff --git a/Fragmentarium-Source/Fragmentarium/Main.cpp b/Fragmentarium-Source/Fragmentarium/Main.cpp index 5bf34c5..59432b9 100644 --- a/Fragmentarium-Source/Fragmentarium/Main.cpp +++ b/Fragmentarium-Source/Fragmentarium/Main.cpp @@ -154,7 +154,7 @@ CommandLineParseResult parseCommandLine(QCommandLineParser &parser, QString *err printf( "%s\n", qPrintable(qApp->translate("main", "enabled.")) ); } } - + if( parser.isSet(QString("compatpatch")) ) { printf( "%s", qPrintable(qApp->translate("main", "Compatibility patch ")) ); if(parser.value(QString("compatpatch")) == "false") { @@ -200,7 +200,7 @@ CommandLineParseResult parseCommandLine(QCommandLineParser &parser, QString *err printf("%s\n", qPrintable(qApp->translate("main", "Frag editor theme set to ") + themeName)); } - + const QStringList positionalArguments = parser.positionalArguments(); if (positionalArguments.isEmpty()) { *errorMessage = qApp->translate("main", "Argument 'filename' missing."); @@ -217,6 +217,7 @@ CommandLineParseResult parseCommandLine(QCommandLineParser &parser, QString *err int main(int argc, char *argv[]) { + #ifdef Q_OS_WIN qApp->addLibraryPath("./"); qApp->addLibraryPath("./plugins"); @@ -242,13 +243,13 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(Fragmentarium); - qApp->setOrganizationName(QString("Syntopia_Software")); - qApp->setApplicationName(QString("Fragmentarium")); - qApp->setOrganizationDomain(QString("fractalforums.org")); - - QScopedPointer app(new QApplication(argc, argv)); + QApplication *app(new QApplication(argc, argv)); app->setObjectName("Application"); + app->setOrganizationName(QString("Syntopia_Software")); + app->setApplicationName(QString("Fragmentarium")); + app->setOrganizationDomain(QString("fractalforums.org")); + // before creating main window record the last run state last_run_state = QSettings().value("isStarting").toBool(); @@ -258,8 +259,7 @@ int main(int argc, char *argv[]) splash.setMask(pixmap.mask()); splash.show(); - Fragmentarium::GUI::MainWindow *mainWin; - mainWin = new Fragmentarium::GUI::MainWindow(); + Fragmentarium::GUI::MainWindow *mainWin = new Fragmentarium::GUI::MainWindow(); // Makes the splash screen wait until the widget mainWin is displayed before calling close() on itself. splash.finish(mainWin); @@ -293,7 +293,7 @@ int main(int argc, char *argv[]) // exits in showHelp function and never returns here Q_UNREACHABLE(); } - + QString langArg = QString("en"); // default english QTranslator myappTranslator; if(parser.isSet(QString("language"))) { @@ -314,7 +314,7 @@ int main(int argc, char *argv[]) mainWin->setVerbose(parser.isSet("verbose")); - mainWin->setWindowTitle(QString("%1 %2").arg(qApp->applicationName()).arg(qApp->applicationVersion())); + mainWin->setWindowTitle(QString("%1 %2").arg(app->applicationName()).arg(app->applicationVersion())); mainWin->readSettings(); diff --git a/Fragmentarium-Source/ThirdPartyCode/EasingDialog.ui b/Fragmentarium-Source/ThirdPartyCode/EasingDialog.ui index f62395d..d1b01b8 100644 --- a/Fragmentarium-Source/ThirdPartyCode/EasingDialog.ui +++ b/Fragmentarium-Source/ThirdPartyCode/EasingDialog.ui @@ -6,8 +6,8 @@ 0 0 - 555 - 612 + 558 + 669 @@ -18,38 +18,59 @@ ../../Misc/icon.jpg../../Misc/icon.jpg - - - - - 0 - 0 - + + + + true - + + Total + + + + + + - 16777215 - 120 + 352 + 280 - - Qt::ScrollBarAlwaysOff - - - QListView::Static + + + + + + true - - false + + + 30 + 0 + - - QListView::IconMode + + true - - false + + 0000 - + + + + Qt::Horizontal + + + + 175 + 20 + + + + + @@ -238,6 +259,18 @@ + + + 0 + 0 + + + + + 60 + 0 + + 6 @@ -252,6 +285,12 @@ + + + 60 + 0 + + 6 @@ -279,6 +318,12 @@ + + + 60 + 0 + + 99999 @@ -293,6 +338,15 @@ + + + 60 + 0 + + + + false + 99999 @@ -323,6 +377,12 @@ true + + + 60 + 0 + + 1 @@ -354,81 +414,118 @@ - - - - true - - - Total - - - - - - - true - - - 00000 - - - - - + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + false + + + + + + + Frames + + + Qt::AlignCenter + + + + + - 352 - 280 + 0 + 10 + + + + + 16777215 + 10 - - + + - Qt::Vertical + Qt::Horizontal - 338 - 15 + 144 + 13 - - - - Value + + + + Qt::Horizontal - - Qt::AlignCenter + + + 145 + 13 + - + - - - + + + + Qt::Vertical + + - 0 - 10 + 328 + 28 + + + + + + + 0 + 0 + + 16777215 - 10 + 120 + + Qt::ScrollBarAlwaysOff + + + QListView::Static + + + false + + + QListView::IconMode + + + false + - + Qt::Vertical @@ -441,18 +538,21 @@ - - - - Frames + + + + Qt::Vertical - - Qt::AlignCenter + + + 338 + 15 + - + - - + + 0 @@ -467,39 +567,29 @@ - - - - Qt::Vertical - - + + + - 328 - 28 + 0 + 10 - - - - - - Qt::Horizontal - - + - 175 - 20 + 16777215 + 10 - + - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + Value - - false + + Qt::AlignCenter diff --git a/Fragmentarium-Source/ThirdPartyCode/EasingWindow.cpp b/Fragmentarium-Source/ThirdPartyCode/EasingWindow.cpp index 509bee8..2acf8d0 100644 --- a/Fragmentarium-Source/ThirdPartyCode/EasingWindow.cpp +++ b/Fragmentarium-Source/ThirdPartyCode/EasingWindow.cpp @@ -98,7 +98,8 @@ EasingWindow::EasingWindow(QWidget *parent, double min, double max, double start connect(m_ui.buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(m_ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - m_ui.frameRangeSlider->setCutoffRange(QPair(1, animLength + 1)); + m_ui.frameRangeSlider->setCutoffRange(QPair(1, animLength)); + m_ui.loopRangeSlider->setCutoffRange(QPair(1, animLength)); m_ui.valueRangeSlider->setCutoffRange(QPair(min, max)); m_ui.loopSpinBox->setValue(loops); m_ui.pongCheckBox->setChecked(pp != 0); @@ -118,6 +119,7 @@ EasingWindow::EasingWindow(QWidget *parent, double min, double max, double start lastFrame = 1; pong = 0; m_ui.frameRangeSlider->setRange(QPair(1, 1)); + m_ui.loopRangeSlider->setRange(QPair(1, 1)); m_ui.valueRangeSlider->setRange(QPair(start, start)); m_ui.loopSpinBox->setValue(1); m_ui.pongCheckBox->setChecked(false); @@ -125,7 +127,7 @@ EasingWindow::EasingWindow(QWidget *parent, double min, double max, double start connect(m_ui.frameRangeSlider, SIGNAL(rangeChanged(QPair)), this, SLOT(frameRangeSliderChanged(QPair))); connect(m_ui.valueRangeSlider, SIGNAL(rangeChanged(QPair)), this, SLOT(valueRangeSliderChanged(QPair))); - + m_ui.loopRangeSlider->setEnabled(false); pathChanged(0); connect(m_anim, SIGNAL(finished()), this, SLOT(directionChange())); @@ -278,23 +280,22 @@ void EasingWindow::firstChanged(int f) firstFrame = f; lastFrame = f > lastFrame ? f : lastFrame; m_ui.frameRangeSlider->setRange(QPair(firstFrame, lastFrame)); + m_ui.loopRangeSlider->setRange(QPair(firstFrame, lastFrame)); if ((lastFrame - firstFrame) > 1) { m_ui.loopSpinBox->setMaximum((animFrames - firstFrame) / (lastFrame - firstFrame)); if (m_ui.loopSpinBox->value() < 1) { - m_ui.totalLoopFrames->setText(QString("00000")); + m_ui.totalLoopFrames->setText(QString("0000")); } else { loopChanged(m_ui.loopSpinBox->value()); } } + setLoopRange(); } void EasingWindow::loopChanged(int loop) { loopCount = loop; - if (loop > 0) { - m_ui.totalLoopFrames->setText(QString("%1").arg(loop * (lastFrame - (firstFrame-1)))); - } if (loop != 0 && loop != 1) { m_ui.pinglabel->setEnabled(true); @@ -303,6 +304,7 @@ void EasingWindow::loopChanged(int loop) m_ui.pinglabel->setEnabled(false); m_ui.pongCheckBox->setEnabled(false); } + setLoopRange(); } void EasingWindow::lastChanged(int f) @@ -310,15 +312,17 @@ void EasingWindow::lastChanged(int f) lastFrame = f; firstFrame = f < firstFrame ? f : firstFrame; m_ui.frameRangeSlider->setRange(QPair(firstFrame, lastFrame)); + m_ui.loopRangeSlider->setRange(QPair(firstFrame, lastFrame)); if ((lastFrame - firstFrame) > 1) { m_ui.loopSpinBox->setMaximum((animFrames - firstFrame) / (lastFrame - firstFrame)); if (m_ui.loopSpinBox->value() < 0) { - m_ui.totalLoopFrames->setText(QString("00000")); + m_ui.totalLoopFrames->setText(QString("0000")); } else { loopChanged(m_ui.loopSpinBox->value()); } } + setLoopRange(); } void EasingWindow::frameRangeSliderChanged(QPair fR) @@ -344,5 +348,18 @@ void EasingWindow::setValueRange(QPair vA) m_ui.valueRangeSlider->setCutoffRange(vA); valueRangeSliderChanged(vA); } + +// always based on frame in and frame out +void EasingWindow::setLoopRange() +{ + if(loopCount > 1) + m_ui.loopRangeSlider->setRange(QPair(firstFrame, firstFrame+(loopCount * (lastFrame - firstFrame)))); + else + m_ui.loopRangeSlider->setRange(QPair(firstFrame, lastFrame)); + + QString loopFrameCount = QStringLiteral("%1").arg(loopCount * (lastFrame - (firstFrame-1)), 4, 10, QLatin1Char('0')); + m_ui.totalLoopFrames->setText(loopFrameCount); +} + } // namespace GUI } // namespace Fragmentarium diff --git a/Fragmentarium-Source/ThirdPartyCode/EasingWindow.h b/Fragmentarium-Source/ThirdPartyCode/EasingWindow.h index 69c629f..406935f 100644 --- a/Fragmentarium-Source/ThirdPartyCode/EasingWindow.h +++ b/Fragmentarium-Source/ThirdPartyCode/EasingWindow.h @@ -180,7 +180,7 @@ private slots: void directionChange(); void frameRangeSliderChanged ( QPair fR ); void valueRangeSliderChanged ( QPair vA ); - + void setLoopRange(); private: void createCurveIcons(); void startAnimation(); diff --git a/Fragmentarium-Source/ThirdPartyCode/VideoDialog.ui b/Fragmentarium-Source/ThirdPartyCode/VideoDialog.ui index 2c2c412..4627cc3 100644 --- a/Fragmentarium-Source/ThirdPartyCode/VideoDialog.ui +++ b/Fragmentarium-Source/ThirdPartyCode/VideoDialog.ui @@ -81,7 +81,11 @@ - + + + Set by FragM, ffmpeg: -f -s -i -r , mencoder: mf:// -w -h -fps -type , from gui. + +