mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 21:20:07 -05:00
6ba16888e3
-Add new variations: crackle, dc_perlin. -Make default palette interp mode be linear instead of step. -Make summary tab the selected one in the Info tab. -Allow for highlight power of up to 10. It was previously limited to 2. --Bug fixes -Direct color calculations were wrong. -Flattening was not applied to final xform. -Fix "pure virtual function call" error on shutdown. --Code changes -Allow for array precalc params in variations by adding a size member to the ParamWithName class. -In IterOpenCLKernelCreator, memcpy precalc params instead of a direct assign since they can now be of variable length. -Add new file VarFuncs to consolidate some functions that are common to multiple variations. This also contains texture data for crackle and dc_perlin. -Place OpenCL versions of these functions in the FunctionMapper class in the EmberCL project. -Add new Singleton class that uses CRTP, is thread safe, and deletes after the last reference goes away. This fixes the usual "delete after main()" problem with singletons that use the static local function variable pattern. -Began saving files with AStyle autoformatter turned on. This will eventually touch all files as they are worked on. -Add missing backslash to CUDA include and library paths for builds on Nvidia systems. -Add missing gl.h include for Windows. -Remove glew include paths from Fractorium, it's not used. -Remove any Nvidia specific #defines and build targets, they are no longer needed with OpenCL 1.2. -Fix bad paths on linux build. -General cleanup.
119 lines
3.0 KiB
C++
119 lines
3.0 KiB
C++
#include "FractoriumPch.h"
|
|
#include "Fractorium.h"
|
|
#include "QssDialog.h"
|
|
|
|
/// <summary>
|
|
/// Initialize the toolbar UI.
|
|
/// </summary>
|
|
void Fractorium::InitToolbarUI()
|
|
{
|
|
auto clGroup = new QActionGroup(this);
|
|
clGroup->addAction(ui.ActionCpu);
|
|
clGroup->addAction(ui.ActionCL);
|
|
auto spGroup = new QActionGroup(this);
|
|
spGroup->addAction(ui.ActionSP);
|
|
spGroup->addAction(ui.ActionDP);
|
|
SyncOptionsToToolbar();
|
|
connect(ui.ActionCpu, SIGNAL(triggered(bool)), this, SLOT(OnActionCpu(bool)), Qt::QueuedConnection);
|
|
connect(ui.ActionCL, SIGNAL(triggered(bool)), this, SLOT(OnActionCL(bool)), Qt::QueuedConnection);
|
|
connect(ui.ActionSP, SIGNAL(triggered(bool)), this, SLOT(OnActionSP(bool)), Qt::QueuedConnection);
|
|
connect(ui.ActionDP, SIGNAL(triggered(bool)), this, SLOT(OnActionDP(bool)), Qt::QueuedConnection);
|
|
connect(ui.ActionStyle, SIGNAL(triggered(bool)), this, SLOT(OnActionStyle(bool)), Qt::QueuedConnection);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Called when the CPU render option on the toolbar is clicked.
|
|
/// </summary>
|
|
/// <param name="checked">Check state, action only taken if true.</param>
|
|
void Fractorium::OnActionCpu(bool checked)
|
|
{
|
|
if (checked && m_Settings->OpenCL())
|
|
{
|
|
m_Settings->OpenCL(false);
|
|
ShutdownAndRecreateFromOptions();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Called when the OpenCL render option on the toolbar is clicked.
|
|
/// </summary>
|
|
/// <param name="checked">Check state, action only taken if true.</param>
|
|
void Fractorium::OnActionCL(bool checked)
|
|
{
|
|
if (checked && !m_Settings->OpenCL())
|
|
{
|
|
m_Settings->OpenCL(true);
|
|
ShutdownAndRecreateFromOptions();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Called when the single precision render option on the toolbar is clicked.
|
|
/// </summary>
|
|
/// <param name="checked">Check state, action only taken if true.</param>
|
|
void Fractorium::OnActionSP(bool checked)
|
|
{
|
|
if (checked && m_Settings->Double())
|
|
{
|
|
m_Settings->Double(false);
|
|
ShutdownAndRecreateFromOptions();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Called when the double precision render option on the toolbar is clicked.
|
|
/// </summary>
|
|
/// <param name="checked">Check state, action only taken if true.</param>
|
|
void Fractorium::OnActionDP(bool checked)
|
|
{
|
|
if (checked && !m_Settings->Double())
|
|
{
|
|
m_Settings->Double(true);
|
|
ShutdownAndRecreateFromOptions();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Called when the show style button is clicked.
|
|
/// </summary>
|
|
/// <param name="checked">Ignored</param>
|
|
void Fractorium::OnActionStyle(bool checked)
|
|
{
|
|
m_QssDialog->show();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sync options data to the check state of the toolbar buttons.
|
|
/// This does not trigger a clicked() event.
|
|
/// </summary>
|
|
void Fractorium::SyncOptionsToToolbar()
|
|
{
|
|
static bool openCL = !m_Info->Devices().empty();
|
|
|
|
if (!openCL)
|
|
{
|
|
ui.ActionCL->setEnabled(false);
|
|
}
|
|
|
|
if (openCL && m_Settings->OpenCL())
|
|
{
|
|
ui.ActionCpu->setChecked(false);
|
|
ui.ActionCL->setChecked(true);
|
|
}
|
|
else
|
|
{
|
|
ui.ActionCpu->setChecked(true);
|
|
ui.ActionCL->setChecked(false);
|
|
}
|
|
|
|
if (m_Settings->Double())
|
|
{
|
|
ui.ActionSP->setChecked(false);
|
|
ui.ActionDP->setChecked(true);
|
|
}
|
|
else
|
|
{
|
|
ui.ActionSP->setChecked(true);
|
|
ui.ActionDP->setChecked(false);
|
|
}
|
|
} |