mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-04-19 09:21:42 -04:00
--Code changes
-Fix build. -Cleanup warnings.
This commit is contained in:
parent
09fd339696
commit
10c12b5250
@ -156,11 +156,12 @@ xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)"</
|
|||||||
<PrecompiledHeaderFile>FractoriumPch.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>FractoriumPch.h</PrecompiledHeaderFile>
|
||||||
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
|
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||||
<ProgramDataBaseFileName>$(TargetDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
<ProgramDataBaseFileName>$(TargetDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||||
<DisableSpecificWarnings>4661</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4251;4661</DisableSpecificWarnings>
|
||||||
<AdditionalOptions>/bigobj -Zm150 %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions>/bigobj -Zm150 %(AdditionalOptions)</AdditionalOptions>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<FloatingPointExceptions>false</FloatingPointExceptions>
|
<FloatingPointExceptions>false</FloatingPointExceptions>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@ -241,12 +242,13 @@ xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)"</
|
|||||||
<PrecompiledHeaderFile>FractoriumPch.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>FractoriumPch.h</PrecompiledHeaderFile>
|
||||||
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
|
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||||
<ProgramDataBaseFileName>$(TargetDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
<ProgramDataBaseFileName>$(TargetDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||||
<DisableSpecificWarnings>4661</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4251;4661</DisableSpecificWarnings>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<FloatingPointExceptions>false</FloatingPointExceptions>
|
<FloatingPointExceptions>false</FloatingPointExceptions>
|
||||||
<AdditionalOptions>/bigobj -Zm150 %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions>/bigobj -Zm150 %(AdditionalOptions)</AdditionalOptions>
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@ -274,11 +276,12 @@ xcopy /F /Y /R /D "$(SolutionDir)..\..\..\Data\flam3-palettes.xml" "$(OutDir)"</
|
|||||||
<PrecompiledHeaderFile>FractoriumPch.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>FractoriumPch.h</PrecompiledHeaderFile>
|
||||||
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
|
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
|
||||||
<ProgramDataBaseFileName>$(TargetDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
<ProgramDataBaseFileName>$(TargetDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||||
<DisableSpecificWarnings>4661</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4251;4661</DisableSpecificWarnings>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<FloatingPointExceptions>false</FloatingPointExceptions>
|
<FloatingPointExceptions>false</FloatingPointExceptions>
|
||||||
<AdditionalOptions>/bigobj -Zm150 %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions>/bigobj -Zm150 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
namespace EmberNs
|
namespace EmberNs
|
||||||
{
|
{
|
||||||
template<> unique_ptr<QTIsaac<ISAAC_SIZE, ISAAC_INT>> QTIsaac<ISAAC_SIZE, ISAAC_INT>::GlobalRand = unique_ptr<QTIsaac<ISAAC_SIZE, ISAAC_INT>>(new QTIsaac<ISAAC_SIZE, ISAAC_INT>());
|
template<> unique_ptr<QTIsaac<ISAAC_SIZE, ISAAC_INT>> QTIsaac<ISAAC_SIZE, ISAAC_INT>::GlobalRand = unique_ptr<QTIsaac<ISAAC_SIZE, ISAAC_INT>>(new QTIsaac<ISAAC_SIZE, ISAAC_INT>());
|
||||||
template<> std::recursive_mutex QTIsaac<ISAAC_SIZE, ISAAC_INT>::s_CS;
|
template<> unique_ptr<recursive_mutex> QTIsaac<ISAAC_SIZE, ISAAC_INT>::s_CS = unique_ptr<recursive_mutex>(new recursive_mutex());
|
||||||
|
template EMBER_API class QTIsaac<ISAAC_SIZE, ISAAC_INT>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "Curves.h"
|
#include "Curves.h"
|
||||||
|
@ -101,7 +101,7 @@ public:
|
|||||||
m_FinalRasH = ember.m_FinalRasH;
|
m_FinalRasH = ember.m_FinalRasH;
|
||||||
m_OrigFinalRasW = ember.m_OrigFinalRasW;
|
m_OrigFinalRasW = ember.m_OrigFinalRasW;
|
||||||
m_OrigFinalRasH = ember.m_OrigFinalRasH;
|
m_OrigFinalRasH = ember.m_OrigFinalRasH;
|
||||||
m_OrigPixPerUnit = ember.m_OrigPixPerUnit;
|
m_OrigPixPerUnit = T(ember.m_OrigPixPerUnit);
|
||||||
m_SubBatchSize = ember.m_SubBatchSize;
|
m_SubBatchSize = ember.m_SubBatchSize;
|
||||||
m_FuseCount = ember.m_FuseCount;
|
m_FuseCount = ember.m_FuseCount;
|
||||||
m_Supersample = ember.m_Supersample;
|
m_Supersample = ember.m_Supersample;
|
||||||
|
@ -828,11 +828,11 @@ public:
|
|||||||
//The first line below makes the first xform interpolate first.
|
//The first line below makes the first xform interpolate first.
|
||||||
//The second line makes the last xform interpolate first.
|
//The second line makes the last xform interpolate first.
|
||||||
T st = stagScaled * (numXforms - 1 - thisXform) / (numXforms - 1);
|
T st = stagScaled * (numXforms - 1 - thisXform) / (numXforms - 1);
|
||||||
T et = st + (1 - stagScaled);
|
T ett = st + (1 - stagScaled);
|
||||||
|
|
||||||
if (t <= st)
|
if (t <= st)
|
||||||
return 0;
|
return 0;
|
||||||
else if (t >= et)
|
else if (t >= ett)
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return Smoother((t - st) / (1 - stagScaled));
|
return Smoother((t - st) / (1 - stagScaled));
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
|
|
||||||
namespace EmberNs
|
namespace EmberNs
|
||||||
{
|
{
|
||||||
|
|
||||||
union UintBytes
|
union UintBytes
|
||||||
{
|
{
|
||||||
unsigned char Bytes[4];
|
unsigned char Bytes[4];
|
||||||
@ -59,14 +58,6 @@ public:
|
|||||||
UintBytes m_Cache;
|
UintBytes m_Cache;
|
||||||
size_t m_LastIndex;
|
size_t m_LastIndex;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Global ISAAC RNG to be used from anywhere. This is not thread safe, so take caution to only
|
|
||||||
/// use it when no other threads are.
|
|
||||||
/// </summary>
|
|
||||||
static unique_ptr<QTIsaac<ALPHA, ISAAC_INT>> GlobalRand;
|
|
||||||
|
|
||||||
static std::recursive_mutex s_CS;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The structure which holds all of the random information.
|
/// The structure which holds all of the random information.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -124,7 +115,7 @@ public:
|
|||||||
/// <returns>The next random integer in the range of 0-255</returns>
|
/// <returns>The next random integer in the range of 0-255</returns>
|
||||||
static inline T LockedRandByte()
|
static inline T LockedRandByte()
|
||||||
{
|
{
|
||||||
rlg l(s_CS);
|
rlg l(*s_CS.get());
|
||||||
T t = GlobalRand->RandByte();
|
T t = GlobalRand->RandByte();
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -148,7 +139,7 @@ public:
|
|||||||
/// <returns>The next random integer</returns>
|
/// <returns>The next random integer</returns>
|
||||||
static inline T LockedRand()
|
static inline T LockedRand()
|
||||||
{
|
{
|
||||||
rlg l(s_CS);
|
rlg l(*s_CS.get());
|
||||||
T t = GlobalRand->Rand();
|
T t = GlobalRand->Rand();
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -170,7 +161,7 @@ public:
|
|||||||
/// <returns>A value between 0 and the value passed in minus 1</returns>
|
/// <returns>A value between 0 and the value passed in minus 1</returns>
|
||||||
static inline T LockedRand(T upper)
|
static inline T LockedRand(T upper)
|
||||||
{
|
{
|
||||||
rlg l(s_CS);
|
rlg l(*s_CS.get());
|
||||||
T t = GlobalRand->Rand(upper);
|
T t = GlobalRand->Rand(upper);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -198,7 +189,7 @@ public:
|
|||||||
template<typename floatType>
|
template<typename floatType>
|
||||||
static inline floatType LockedFrand(floatType fMin, floatType fMax)
|
static inline floatType LockedFrand(floatType fMin, floatType fMax)
|
||||||
{
|
{
|
||||||
rlg l(s_CS);
|
rlg l(*s_CS.get());
|
||||||
floatType t = GlobalRand->template Frand<floatType>(fMin, fMax);
|
floatType t = GlobalRand->template Frand<floatType>(fMin, fMax);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -225,7 +216,7 @@ public:
|
|||||||
template<typename floatType>
|
template<typename floatType>
|
||||||
static inline floatType LockedFrand01()
|
static inline floatType LockedFrand01()
|
||||||
{
|
{
|
||||||
rlg l(s_CS);
|
rlg l(*s_CS.get());
|
||||||
floatType t = GlobalRand->template Frand01<floatType>();
|
floatType t = GlobalRand->template Frand01<floatType>();
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -252,7 +243,7 @@ public:
|
|||||||
template<typename floatType>
|
template<typename floatType>
|
||||||
static inline floatType LockedFrand11()
|
static inline floatType LockedFrand11()
|
||||||
{
|
{
|
||||||
rlg l(s_CS);
|
rlg l(*s_CS.get());
|
||||||
floatType t = GlobalRand->template Frand11<floatType>();
|
floatType t = GlobalRand->template Frand11<floatType>();
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -274,7 +265,7 @@ public:
|
|||||||
template<typename floatType>
|
template<typename floatType>
|
||||||
static inline floatType LockedGoldenBit()
|
static inline floatType LockedGoldenBit()
|
||||||
{
|
{
|
||||||
rlg l(s_CS);
|
rlg l(*s_CS.get());
|
||||||
floatType t = GlobalRand->template GoldenBit<floatType>();
|
floatType t = GlobalRand->template GoldenBit<floatType>();
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -294,7 +285,7 @@ public:
|
|||||||
/// <returns>A random 0 or 1</returns>
|
/// <returns>A random 0 or 1</returns>
|
||||||
static inline uint LockedRandBit()
|
static inline uint LockedRandBit()
|
||||||
{
|
{
|
||||||
rlg l(s_CS);
|
rlg l(*s_CS.get());
|
||||||
uint t = GlobalRand->RandBit();
|
uint t = GlobalRand->RandBit();
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -516,5 +507,12 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
randctx m_Rc;//The random context which holds all of the seed and state information as well as the random number values.
|
randctx m_Rc;//The random context which holds all of the seed and state information as well as the random number values.
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Global ISAAC RNG to be used from anywhere. This is not thread safe, so take caution to only
|
||||||
|
/// use it when no other threads are.
|
||||||
|
/// </summary>
|
||||||
|
static unique_ptr<QTIsaac<ALPHA, ISAAC_INT>> GlobalRand;
|
||||||
|
static unique_ptr<recursive_mutex> s_CS;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ public:
|
|||||||
Palette<T>* GetRandomPalette()
|
Palette<T>* GetRandomPalette()
|
||||||
{
|
{
|
||||||
auto p = s_Palettes.begin();
|
auto p = s_Palettes.begin();
|
||||||
size_t i = 0, paletteFileIndex = QTIsaac<ISAAC_SIZE, ISAAC_INT>::GlobalRand->Rand() % Size();
|
size_t i = 0, paletteFileIndex = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand() % Size();
|
||||||
|
|
||||||
//Move p forward i elements.
|
//Move p forward i elements.
|
||||||
while (i < paletteFileIndex && p != s_Palettes.end())
|
while (i < paletteFileIndex && p != s_Palettes.end())
|
||||||
@ -93,7 +93,7 @@ public:
|
|||||||
|
|
||||||
if (i < Size())
|
if (i < Size())
|
||||||
{
|
{
|
||||||
size_t paletteIndex = QTIsaac<ISAAC_SIZE, ISAAC_INT>::GlobalRand->Rand() % p->second.size();
|
size_t paletteIndex = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand() % p->second.size();
|
||||||
|
|
||||||
if (paletteIndex < p->second.size())
|
if (paletteIndex < p->second.size())
|
||||||
return &p->second[paletteIndex];
|
return &p->second[paletteIndex];
|
||||||
|
@ -867,18 +867,14 @@ static inline bool IsClose(T val1, T val2, T tolerance = 1e-6)
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
static inline T NormalizeDeg180(T angle)
|
static inline T NormalizeDeg180(T angle)
|
||||||
{
|
{
|
||||||
angle = fmod(angle, 360);
|
auto a = fmod(angle, T(360));
|
||||||
|
|
||||||
if (angle > 180)
|
if (a > 180)
|
||||||
{
|
a -= 360;
|
||||||
angle -= 360;
|
else if (a < -180)
|
||||||
}
|
a += 360;
|
||||||
else if (angle < -180)
|
|
||||||
{
|
|
||||||
angle += 360;
|
|
||||||
}
|
|
||||||
|
|
||||||
return angle;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -3784,7 +3784,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string weightDivPiDiv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string weightDivPiDiv2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
@ -850,7 +850,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params.
|
string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params.
|
||||||
@ -1674,7 +1674,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string hole = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
@ -3291,7 +3291,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params.
|
string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params.
|
||||||
@ -3529,7 +3529,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
@ -3621,7 +3621,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string c = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
@ -4012,7 +4012,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string c1r = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string c1r = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
@ -4601,7 +4601,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string shiftX = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string shiftX = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
@ -4930,7 +4930,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string vvar2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params.
|
string vvar2 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params.
|
||||||
@ -5282,7 +5282,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string weight01 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string weight01 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
@ -358,7 +358,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string pull = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string pull = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
@ -2966,7 +2966,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t i = 0;
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
string even = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string even = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
|
@ -3985,7 +3985,7 @@ public:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
T x, s, c;
|
T x, s, c;
|
||||||
x = ((int)(rand.Frand01<T>() * 2)) ? m_WorkPower + (rand.Frand01<T>() * m_Scatter + m_Offset + edge) * T(M_PI) : -(rand.Frand01<T>() * m_Scatter + m_Offset + edge) * T(M_PI);
|
x = int(rand.Frand01<T>() * 2) ? m_WorkPower + (rand.Frand01<T>() * m_Scatter + m_Offset + edge) * T(M_PI) : -(rand.Frand01<T>() * m_Scatter + m_Offset + edge) * T(M_PI);
|
||||||
sincos(x, &s, &c);
|
sincos(x, &s, &c);
|
||||||
|
|
||||||
if (m_Static > 1 || m_Static == -1)
|
if (m_Static > 1 || m_Static == -1)
|
||||||
@ -4519,7 +4519,7 @@ public:
|
|||||||
T s, c;
|
T s, c;
|
||||||
T total = 0;
|
T total = 0;
|
||||||
T total2 = 0;
|
T total2 = 0;
|
||||||
T temp1, temp2, temp3, temp4;
|
T temp1, temp2, temp4;
|
||||||
|
|
||||||
if (m_Hypergon != 0)
|
if (m_Hypergon != 0)
|
||||||
{
|
{
|
||||||
@ -4532,7 +4532,6 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
temp3 = m_HypergonD;
|
|
||||||
total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2);
|
total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4568,7 +4567,6 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
temp3 = m_HypergonD;
|
|
||||||
total2 += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2);
|
total2 += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4644,7 +4642,7 @@ public:
|
|||||||
<< "\t\treal_t s, c;\n"
|
<< "\t\treal_t s, c;\n"
|
||||||
<< "\t\treal_t total = 0;\n"
|
<< "\t\treal_t total = 0;\n"
|
||||||
<< "\t\treal_t total2 = 0;\n"
|
<< "\t\treal_t total2 = 0;\n"
|
||||||
<< "\t\treal_t temp1, temp2, temp3, temp4;\n"
|
<< "\t\treal_t temp1, temp2, temp4;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (" << hypergon << " != 0)\n"
|
<< "\t\tif (" << hypergon << " != 0)\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
@ -4657,7 +4655,6 @@ public:
|
|||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t temp3 = " << hypergonD << ";\n"
|
|
||||||
<< "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n"
|
<< "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
@ -4693,7 +4690,6 @@ public:
|
|||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t temp3 = " << hypergonD << ";\n"
|
|
||||||
<< "\t\t total2 += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n"
|
<< "\t\t total2 += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
@ -4813,11 +4809,10 @@ public:
|
|||||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||||
{
|
{
|
||||||
T a = helper.m_PrecalcAtanyx;
|
T a = helper.m_PrecalcAtanyx;
|
||||||
T a90 = atan2(helper.In.x, -helper.In.y);
|
|
||||||
T r;
|
T r;
|
||||||
T s, c;
|
T s, c;
|
||||||
T total = 0;
|
T total = 0;
|
||||||
T temp1, temp2, temp3, temp4;
|
T temp1, temp2, temp4;
|
||||||
|
|
||||||
if (m_Hypergon != 0)
|
if (m_Hypergon != 0)
|
||||||
{
|
{
|
||||||
@ -4830,7 +4825,6 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
temp3 = m_HypergonD;
|
|
||||||
total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2);
|
total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4886,11 +4880,10 @@ public:
|
|||||||
string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t a = precalcAtanyx;\n"
|
<< "\t\treal_t a = precalcAtanyx;\n"
|
||||||
<< "\t\treal_t a90 = atan2(vIn.x, -vIn.y);\n"
|
|
||||||
<< "\t\treal_t r;\n"
|
<< "\t\treal_t r;\n"
|
||||||
<< "\t\treal_t s, c;\n"
|
<< "\t\treal_t s, c;\n"
|
||||||
<< "\t\treal_t total = 0;\n"
|
<< "\t\treal_t total = 0;\n"
|
||||||
<< "\t\treal_t temp1, temp2, temp3, temp4;\n"
|
<< "\t\treal_t temp1, temp2, temp4;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (" << hypergon << " != 0)\n"
|
<< "\t\tif (" << hypergon << " != 0)\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
@ -4903,7 +4896,6 @@ public:
|
|||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t temp3 = " << hypergonD << ";\n"
|
|
||||||
<< "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n"
|
<< "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
@ -5014,11 +5006,10 @@ public:
|
|||||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||||
{
|
{
|
||||||
T a = helper.m_PrecalcAtanyx;
|
T a = helper.m_PrecalcAtanyx;
|
||||||
T a90 = atan2(helper.In.x, -helper.In.y);
|
|
||||||
T r;
|
T r;
|
||||||
T s, c;
|
T s, c;
|
||||||
T total = 0;
|
T total = 0;
|
||||||
T temp1, temp2, temp3, temp4;
|
T temp1, temp2, temp4;
|
||||||
|
|
||||||
if (m_Hypergon != 0)
|
if (m_Hypergon != 0)
|
||||||
{
|
{
|
||||||
@ -5031,7 +5022,6 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
temp3 = m_HypergonD;
|
|
||||||
total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2);
|
total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5087,11 +5077,10 @@ public:
|
|||||||
string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
string oneOverSuperN1 = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
<< "\t\treal_t a = precalcAtanyx;\n"
|
<< "\t\treal_t a = precalcAtanyx;\n"
|
||||||
<< "\t\treal_t a90 = atan2(vIn.x, -vIn.y);\n"
|
|
||||||
<< "\t\treal_t r;\n"
|
<< "\t\treal_t r;\n"
|
||||||
<< "\t\treal_t s, c;\n"
|
<< "\t\treal_t s, c;\n"
|
||||||
<< "\t\treal_t total = 0;\n"
|
<< "\t\treal_t total = 0;\n"
|
||||||
<< "\t\treal_t temp1, temp2, temp3, temp4;\n"
|
<< "\t\treal_t temp1, temp2, temp4;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (" << hypergon << " != 0)\n"
|
<< "\t\tif (" << hypergon << " != 0)\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
@ -5104,7 +5093,6 @@ public:
|
|||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t temp3 = " << hypergonD << ";\n"
|
|
||||||
<< "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n"
|
<< "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
@ -5215,11 +5203,10 @@ public:
|
|||||||
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
virtual void Func(IteratorHelper<T>& helper, Point<T>& outPoint, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand) override
|
||||||
{
|
{
|
||||||
T a = helper.m_PrecalcAtanyx;
|
T a = helper.m_PrecalcAtanyx;
|
||||||
T a90 = atan2(helper.In.x, -helper.In.y);
|
|
||||||
T r;
|
T r;
|
||||||
T s, c;
|
T s, c;
|
||||||
T total = 0;
|
T total = 0;
|
||||||
T temp1, temp2, temp3, temp4;
|
T temp1, temp2, temp4;
|
||||||
|
|
||||||
if (m_Hypergon != 0)
|
if (m_Hypergon != 0)
|
||||||
{
|
{
|
||||||
@ -5232,7 +5219,6 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
temp3 = m_HypergonD;
|
|
||||||
total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2);
|
total += m_Hypergon * (m_HypergonD - std::sqrt(Sqr(m_HypergonD) - temp2)) / std::sqrt(temp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5292,7 +5278,7 @@ public:
|
|||||||
<< "\t\treal_t r;\n"
|
<< "\t\treal_t r;\n"
|
||||||
<< "\t\treal_t s, c;\n"
|
<< "\t\treal_t s, c;\n"
|
||||||
<< "\t\treal_t total = 0;\n"
|
<< "\t\treal_t total = 0;\n"
|
||||||
<< "\t\treal_t temp1, temp2, temp3, temp4;\n"
|
<< "\t\treal_t temp1, temp2, temp4;\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\t\tif (" << hypergon << " != 0)\n"
|
<< "\t\tif (" << hypergon << " != 0)\n"
|
||||||
<< "\t\t{\n"
|
<< "\t\t{\n"
|
||||||
@ -5305,7 +5291,6 @@ public:
|
|||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t else\n"
|
<< "\t\t else\n"
|
||||||
<< "\t\t {\n"
|
<< "\t\t {\n"
|
||||||
<< "\t\t temp3 = " << hypergonD << ";\n"
|
|
||||||
<< "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n"
|
<< "\t\t total += " << hypergon << " * (" << hypergonD << " - sqrt(Sqr(" << hypergonD << ") - temp2)) / sqrt(temp2);\n"
|
||||||
<< "\t\t }\n"
|
<< "\t\t }\n"
|
||||||
<< "\t\t}\n"
|
<< "\t\t}\n"
|
||||||
|
@ -543,7 +543,7 @@ public:
|
|||||||
virtual string OpenCLString() const override
|
virtual string OpenCLString() const override
|
||||||
{
|
{
|
||||||
ostringstream ss, ss2;
|
ostringstream ss, ss2;
|
||||||
intmax_t i = 0, varIndex = IndexInXform();
|
intmax_t varIndex = IndexInXform();
|
||||||
ss2 << "_" << XformIndexInEmber() << "]";
|
ss2 << "_" << XformIndexInEmber() << "]";
|
||||||
string index = ss2.str();
|
string index = ss2.str();
|
||||||
ss << "\t{\n"
|
ss << "\t{\n"
|
||||||
|
@ -159,9 +159,9 @@ public:
|
|||||||
m_HasPreOrRegularVars = xform.PreVariationCount() > 0 || xform.VariationCount() > 0;
|
m_HasPreOrRegularVars = xform.PreVariationCount() > 0 || xform.VariationCount() > 0;
|
||||||
m_Wind[0] = T(xform.m_Wind[0]);
|
m_Wind[0] = T(xform.m_Wind[0]);
|
||||||
m_Wind[1] = T(xform.m_Wind[1]);
|
m_Wind[1] = T(xform.m_Wind[1]);
|
||||||
m_MotionFreq = xform.m_MotionFreq;
|
m_MotionFreq = T(xform.m_MotionFreq);
|
||||||
m_MotionFunc = xform.m_MotionFunc;
|
m_MotionFunc = xform.m_MotionFunc;
|
||||||
m_MotionOffset = xform.m_MotionOffset;
|
m_MotionOffset = T(xform.m_MotionOffset);
|
||||||
ClearAndDeleteVariations();
|
ClearAndDeleteVariations();
|
||||||
|
|
||||||
//Must manually add them via the AddVariation() function so that
|
//Must manually add them via the AddVariation() function so that
|
||||||
|
@ -79,194 +79,211 @@ public:
|
|||||||
|
|
||||||
if (!m_Init)
|
if (!m_Init)
|
||||||
{
|
{
|
||||||
m_BadParamNames.reserve(100);
|
m_BadParamNames = unordered_map<string, string>
|
||||||
m_BadParamNames["swtin_distort"] = "stwin_distort";//stwin.
|
{
|
||||||
m_BadParamNames["pow_numerator"] = "pow_block_numerator";//pow_block.
|
{ "swtin_distort" , "stwin_distort" },//stwin.
|
||||||
m_BadParamNames["pow_denominator"] = "pow_block_denominator";
|
{ "pow_numerator" , "pow_block_numerator" },//pow_block.
|
||||||
m_BadParamNames["pow_root"] = "pow_block_root";
|
{ "pow_denominator" , "pow_block_denominator" },
|
||||||
m_BadParamNames["pow_correctn"] = "pow_block_correctn";
|
{ "pow_root" , "pow_block_root" },
|
||||||
m_BadParamNames["pow_correctd"] = "pow_block_correctd";
|
{ "pow_correctn" , "pow_block_correctn" },
|
||||||
m_BadParamNames["pow_power"] = "pow_block_power";
|
{ "pow_correctd" , "pow_block_correctd" },
|
||||||
m_BadParamNames["lt"] = "linearT_powX";//linearT.
|
{ "pow_power" , "pow_block_power" },
|
||||||
m_BadParamNames["lt"] = "linearT_powY";
|
{ "lt" , "linearT_powX" },//linearT.
|
||||||
m_BadParamNames["re_a"] = "Mobius_Re_A";//Mobius.
|
{ "lt" , "linearT_powY" },
|
||||||
m_BadParamNames["im_a"] = "Mobius_Im_A";
|
{ "re_a" , "Mobius_Re_A" },//Mobius.
|
||||||
m_BadParamNames["re_b"] = "Mobius_Re_B";
|
{ "im_a" , "Mobius_Im_A" },
|
||||||
m_BadParamNames["im_b"] = "Mobius_Im_B";
|
{ "re_b" , "Mobius_Re_B" },
|
||||||
m_BadParamNames["re_c"] = "Mobius_Re_C";
|
{ "im_b" , "Mobius_Im_B" },
|
||||||
m_BadParamNames["im_c"] = "Mobius_Im_C";
|
{ "re_c" , "Mobius_Re_C" },
|
||||||
m_BadParamNames["re_d"] = "Mobius_Re_D";
|
{ "im_c" , "Mobius_Im_C" },
|
||||||
m_BadParamNames["im_d"] = "Mobius_Im_D";
|
{ "re_d" , "Mobius_Re_D" },
|
||||||
m_BadParamNames["rx_sin"] = "rotate_x_sin";//rotate_x.
|
{ "im_d" , "Mobius_Im_D" },
|
||||||
m_BadParamNames["rx_cos"] = "rotate_x_cos";
|
{ "rx_sin" , "rotate_x_sin" },//rotate_x.
|
||||||
m_BadParamNames["ry_sin"] = "rotate_y_sin";//rotate_y.
|
{ "rx_cos" , "rotate_x_cos" },
|
||||||
m_BadParamNames["ry_cos"] = "rotate_y_cos";
|
{ "ry_sin" , "rotate_y_sin" },//rotate_y.
|
||||||
m_BadParamNames["intrfr2_a1"] = "interference2_a1";//interference2.
|
{ "ry_cos" , "rotate_y_cos" },
|
||||||
m_BadParamNames["intrfr2_b1"] = "interference2_b1";
|
{ "intrfr2_a1" , "interference2_a1" },//interference2.
|
||||||
m_BadParamNames["intrfr2_c1"] = "interference2_c1";
|
{ "intrfr2_b1" , "interference2_b1" },
|
||||||
m_BadParamNames["intrfr2_p1"] = "interference2_p1";
|
{ "intrfr2_c1" , "interference2_c1" },
|
||||||
m_BadParamNames["intrfr2_t1"] = "interference2_t1";
|
{ "intrfr2_p1" , "interference2_p1" },
|
||||||
m_BadParamNames["intrfr2_a2"] = "interference2_a2";
|
{ "intrfr2_t1" , "interference2_t1" },
|
||||||
m_BadParamNames["intrfr2_b2"] = "interference2_b2";
|
{ "intrfr2_a2" , "interference2_a2" },
|
||||||
m_BadParamNames["intrfr2_c2"] = "interference2_c2";
|
{ "intrfr2_b2" , "interference2_b2" },
|
||||||
m_BadParamNames["intrfr2_p2"] = "interference2_p2";
|
{ "intrfr2_c2" , "interference2_c2" },
|
||||||
m_BadParamNames["intrfr2_t2"] = "interference2_t2";
|
{ "intrfr2_p2" , "interference2_p2" },
|
||||||
m_BadParamNames["octa_x"] = "octagon_x";//octagon.
|
{ "intrfr2_t2" , "interference2_t2" },
|
||||||
m_BadParamNames["octa_y"] = "octagon_y";
|
{ "octa_x" , "octagon_x" },//octagon.
|
||||||
m_BadParamNames["octa_z"] = "octagon_z";
|
{ "octa_y" , "octagon_y" },
|
||||||
m_BadParamNames["bubble_x"] = "bubble2_x";//bubble2.
|
{ "octa_z" , "octagon_z" },
|
||||||
m_BadParamNames["bubble_y"] = "bubble2_y";
|
{ "bubble_x" , "bubble2_x" },//bubble2.
|
||||||
m_BadParamNames["bubble_z"] = "bubble2_z";
|
{ "bubble_y" , "bubble2_y" },
|
||||||
m_BadParamNames["cubic3d_xpand"] = "cubicLattice_3D_xpand";//cubicLattice_3D.
|
{ "bubble_z" , "bubble2_z" },
|
||||||
m_BadParamNames["cubic3d_style"] = "cubicLattice_3D_style";
|
{ "cubic3d_xpand" , "cubicLattice_3D_xpand" },//cubicLattice_3D.
|
||||||
m_BadParamNames["splitb_x"] = "SplitBrdr_x";//SplitBrdr.
|
{ "cubic3d_style" , "cubicLattice_3D_style" },
|
||||||
m_BadParamNames["splitb_y"] = "SplitBrdr_y";
|
{ "splitb_x" , "SplitBrdr_x" },//SplitBrdr.
|
||||||
m_BadParamNames["splitb_px"] = "SplitBrdr_px";
|
{ "splitb_y" , "SplitBrdr_y" },
|
||||||
m_BadParamNames["splitb_py"] = "SplitBrdr_py";
|
{ "splitb_px" , "SplitBrdr_px" },
|
||||||
m_BadParamNames["dc_cyl_offset"] = "dc_cylinder_offset";//dc_cylinder.
|
{ "splitb_py" , "SplitBrdr_py" },
|
||||||
m_BadParamNames["dc_cyl_angle"] = "dc_cylinder_angle";
|
{ "dc_cyl_offset" , "dc_cylinder_offset" },//dc_cylinder.
|
||||||
m_BadParamNames["dc_cyl_scale"] = "dc_cylinder_scale";
|
{ "dc_cyl_angle" , "dc_cylinder_angle" },
|
||||||
m_BadParamNames["cyl_x"] = "dc_cylinder_x";
|
{ "dc_cyl_scale" , "dc_cylinder_scale" },
|
||||||
m_BadParamNames["cyl_y"] = "dc_cylinder_y";
|
{ "cyl_x" , "dc_cylinder_x" },
|
||||||
m_BadParamNames["cyl_blur"] = "dc_cylinder_blur";
|
{ "cyl_y" , "dc_cylinder_y" },
|
||||||
m_BadParamNames["mobius_radius"] = "mobius_strip_radius";//mobius_strip.
|
{ "cyl_blur" , "dc_cylinder_blur" },
|
||||||
m_BadParamNames["mobius_width"] = "mobius_strip_width";
|
{ "mobius_radius" , "mobius_strip_radius" },//mobius_strip.
|
||||||
m_BadParamNames["mobius_rect_x"] = "mobius_strip_rect_x";
|
{ "mobius_width" , "mobius_strip_width" },
|
||||||
m_BadParamNames["mobius_rect_y"] = "mobius_strip_rect_y";
|
{ "mobius_rect_x" , "mobius_strip_rect_x" },
|
||||||
m_BadParamNames["mobius_rotate_x"] = "mobius_strip_rotate_x";
|
{ "mobius_rect_y" , "mobius_strip_rect_y" },
|
||||||
m_BadParamNames["mobius_rotate_y"] = "mobius_strip_rotate_y";
|
{ "mobius_rotate_x" , "mobius_strip_rotate_x" },
|
||||||
m_BadParamNames["bwraps2_cellsize"] = "bwraps_cellsize";//bwraps2.
|
{ "mobius_rotate_y" , "mobius_strip_rotate_y" },
|
||||||
m_BadParamNames["bwraps2_space"] = "bwraps_space";
|
{ "bwraps2_cellsize" , "bwraps_cellsize" },//bwraps2.
|
||||||
m_BadParamNames["bwraps2_gain"] = "bwraps_gain";
|
{ "bwraps2_space" , "bwraps_space" },
|
||||||
m_BadParamNames["bwraps2_inner_twist"] = "bwraps_inner_twist";
|
{ "bwraps2_gain" , "bwraps_gain" },
|
||||||
m_BadParamNames["bwraps2_outer_twist"] = "bwraps_outer_twist";
|
{ "bwraps2_inner_twist" , "bwraps_inner_twist" },
|
||||||
m_BadParamNames["bwraps7_cellsize"] = "bwraps_cellsize";//bwraps7.
|
{ "bwraps2_outer_twist" , "bwraps_outer_twist" },
|
||||||
m_BadParamNames["bwraps7_space"] = "bwraps_space";
|
{ "bwraps7_cellsize" , "bwraps_cellsize" },//bwraps7.
|
||||||
m_BadParamNames["bwraps7_gain"] = "bwraps_gain";
|
{ "bwraps7_space" , "bwraps_space" },
|
||||||
m_BadParamNames["bwraps7_inner_twist"] = "bwraps_inner_twist";
|
{ "bwraps7_gain" , "bwraps_gain" },
|
||||||
m_BadParamNames["bwraps7_outer_twist"] = "bwraps_outer_twist";
|
{ "bwraps7_inner_twist" , "bwraps_inner_twist" },
|
||||||
m_BadParamNames["pre_bwraps2_cellsize"] = "pre_bwraps_cellsize";
|
{ "bwraps7_outer_twist" , "bwraps_outer_twist" },
|
||||||
m_BadParamNames["pre_bwraps2_space"] = "pre_bwraps_space";
|
{ "pre_bwraps2_cellsize" , "pre_bwraps_cellsize" },//bwraps2.
|
||||||
m_BadParamNames["pre_bwraps2_gain"] = "pre_bwraps_gain";
|
{ "pre_bwraps2_space" , "pre_bwraps_space" },
|
||||||
m_BadParamNames["pre_bwraps2_inner_twist"] = "pre_bwraps_inner_twist";
|
{ "pre_bwraps2_gain" , "pre_bwraps_gain" },
|
||||||
m_BadParamNames["pre_bwraps2_outer_twist"] = "pre_bwraps_outer_twist";
|
{ "pre_bwraps2_inner_twist" , "pre_bwraps_inner_twist" },
|
||||||
m_BadParamNames["post_bwraps2_cellsize"] = "post_bwraps_cellsize";
|
{ "pre_bwraps2_outer_twist" , "pre_bwraps_outer_twist" },
|
||||||
m_BadParamNames["post_bwraps2_space"] = "post_bwraps_space";
|
{ "post_bwraps2_cellsize" , "post_bwraps_cellsize" },
|
||||||
m_BadParamNames["post_bwraps2_gain"] = "post_bwraps_gain";
|
{ "post_bwraps2_space" , "post_bwraps_space" },
|
||||||
m_BadParamNames["post_bwraps2_inner_twist"] = "post_bwraps_inner_twist";
|
{ "post_bwraps2_gain" , "post_bwraps_gain" },
|
||||||
m_BadParamNames["post_bwraps2_outer_twist"] = "post_bwraps_outer_twist";
|
{ "post_bwraps2_inner_twist", "post_bwraps_inner_twist" },
|
||||||
m_BadParamNames["hexa3d_majp"] = "hexaplay3D_majp";
|
{ "post_bwraps2_outer_twist", "post_bwraps_outer_twist" },
|
||||||
m_BadParamNames["hexa3d_scale"] = "hexaplay3D_scale";
|
{ "hexa3d_majp" , "hexaplay3D_majp" },//hexaplay3D.
|
||||||
m_BadParamNames["hexa3d_zlift"] = "hexaplay3D_zlift";
|
{ "hexa3d_scale" , "hexaplay3D_scale" },
|
||||||
m_BadParamNames["nb_numedges"] = "nBlur_numEdges";
|
{ "hexa3d_zlift" , "hexaplay3D_zlift" },
|
||||||
m_BadParamNames["nb_numstripes"] = "nBlur_numStripes";
|
{ "nb_numedges" , "nBlur_numEdges" },//nBlur.
|
||||||
m_BadParamNames["nb_ratiostripes"] = "nBlur_ratioStripes";
|
{ "nb_numstripes" , "nBlur_numStripes" },
|
||||||
m_BadParamNames["nb_ratiohole"] = "nBlur_ratioHole";
|
{ "nb_ratiostripes" , "nBlur_ratioStripes" },
|
||||||
m_BadParamNames["nb_circumcircle"] = "nBlur_circumCircle";
|
{ "nb_ratiohole" , "nBlur_ratioHole" },
|
||||||
m_BadParamNames["nb_adjusttolinear"] = "nBlur_adjustToLinear";
|
{ "nb_circumcircle" , "nBlur_circumCircle" },
|
||||||
m_BadParamNames["nb_equalblur"] = "nBlur_equalBlur";
|
{ "nb_adjusttolinear" , "nBlur_adjustToLinear" },
|
||||||
m_BadParamNames["nb_exactcalc"] = "nBlur_exactCalc";
|
{ "nb_equalblur" , "nBlur_equalBlur" },
|
||||||
m_BadParamNames["nb_highlightedges"] = "nBlur_highlightEdges";
|
{ "nb_exactcalc" , "nBlur_exactCalc" },
|
||||||
m_BadParamNames["octapol_r"] = "octapol_radius";
|
{ "nb_highlightedges" , "nBlur_highlightEdges" },
|
||||||
m_BadParamNames["number_of_stripes"] = "bubbleT3D_number_of_stripes";
|
{ "octapol_r" , "octapol_radius" },//octapol.
|
||||||
m_BadParamNames["ratio_of_stripes"] = "bubbleT3D_ratio_of_stripes";
|
{ "number_of_stripes" , "bubbleT3D_number_of_stripes" },//bubbleT3D.
|
||||||
m_BadParamNames["angle_of_hole"] = "bubbleT3D_angle_of_hole";
|
{ "ratio_of_stripes" , "bubbleT3D_ratio_of_stripes" },
|
||||||
m_BadParamNames["exponentZ"] = "bubbleT3D_exponentZ";
|
{ "angle_of_hole" , "bubbleT3D_angle_of_hole" },
|
||||||
m_BadParamNames["_symmetryZ"] = "bubbleT3D_symmetryZ";
|
{ "exponentZ" , "bubbleT3D_exponentZ" },
|
||||||
m_BadParamNames["_modusBlur"] = "bubbleT3D_modusBlur";
|
{ "_symmetryZ" , "bubbleT3D_symmetryZ" },
|
||||||
m_BadParamNames["post_scrop_power"] = "post_smartcrop_power";
|
{ "_modusBlur" , "bubbleT3D_modusBlur" },
|
||||||
m_BadParamNames["post_scrop_radius"] = "post_smartcrop_radius";
|
{ "post_scrop_power" , "post_smartcrop_power" },//post_smartcrop.
|
||||||
m_BadParamNames["post_scrop_roundstr"] = "post_smartcrop_roundstr";
|
{ "post_scrop_radius" , "post_smartcrop_radius" },
|
||||||
m_BadParamNames["post_scrop_roundwidth"] = "post_smartcrop_roundwidth";
|
{ "post_scrop_roundstr" , "post_smartcrop_roundstr" },
|
||||||
m_BadParamNames["post_scrop_distortion"] = "post_smartcrop_distortion";
|
{ "post_scrop_roundwidth" , "post_smartcrop_roundwidth" },
|
||||||
m_BadParamNames["post_scrop_edge"] = "post_smartcrop_edge";
|
{ "post_scrop_distortion" , "post_smartcrop_distortion" },
|
||||||
m_BadParamNames["post_scrop_scatter"] = "post_smartcrop_scatter";
|
{ "post_scrop_edge" , "post_smartcrop_edge" },
|
||||||
m_BadParamNames["post_scrop_offset"] = "post_smartcrop_offset";
|
{ "post_scrop_scatter" , "post_smartcrop_scatter" },
|
||||||
m_BadParamNames["post_scrop_rotation"] = "post_smartcrop_rotation";
|
{ "post_scrop_offset" , "post_smartcrop_offset" },
|
||||||
m_BadParamNames["post_scrop_cropmode"] = "post_smartcrop_cropmode";
|
{ "post_scrop_rotation" , "post_smartcrop_rotation" },
|
||||||
m_BadParamNames["post_scrop_static"] = "post_smartcrop_static";
|
{ "post_scrop_cropmode" , "post_smartcrop_cropmode" },
|
||||||
m_FlattenNames.reserve(24);
|
{ "post_scrop_static" , "post_smartcrop_static" }
|
||||||
m_FlattenNames.push_back("pre_crop");
|
};
|
||||||
m_FlattenNames.push_back("pre_falloff2");
|
m_FlattenNames =
|
||||||
m_FlattenNames.push_back("pre_rotate_x");
|
{
|
||||||
m_FlattenNames.push_back("pre_rotate_y");
|
"pre_crop",
|
||||||
m_FlattenNames.push_back("pre_ztranslate");
|
"pre_falloff2",
|
||||||
m_FlattenNames.push_back("blur3D");
|
"pre_rotate_x",
|
||||||
m_FlattenNames.push_back("bubble");
|
"pre_rotate_y",
|
||||||
m_FlattenNames.push_back("bwraps");
|
"pre_ztranslate",
|
||||||
m_FlattenNames.push_back("bwraps2");
|
"blur3D",
|
||||||
m_FlattenNames.push_back("crop");
|
"bubble",
|
||||||
m_FlattenNames.push_back("cylinder");
|
"bwraps",
|
||||||
m_FlattenNames.push_back("falloff2");
|
"bwraps2",
|
||||||
m_FlattenNames.push_back("hemisphere");
|
"crop",
|
||||||
m_FlattenNames.push_back("julia3D");
|
"cylinder",
|
||||||
m_FlattenNames.push_back("julia3Dz");
|
"falloff2",
|
||||||
m_FlattenNames.push_back("linear3D");
|
"hemisphere",
|
||||||
m_FlattenNames.push_back("zblur");
|
"julia3D",
|
||||||
m_FlattenNames.push_back("zcone");
|
"julia3Dz",
|
||||||
m_FlattenNames.push_back("ztranslate");
|
"linear3D",
|
||||||
m_FlattenNames.push_back("post_crop");
|
"zblur",
|
||||||
m_FlattenNames.push_back("post_falloff2");
|
"zcone",
|
||||||
m_FlattenNames.push_back("post_rotate_x");
|
"ztranslate",
|
||||||
m_FlattenNames.push_back("post_rotate_y");
|
"post_crop",
|
||||||
m_FlattenNames.push_back("curl3D_cz");
|
"post_falloff2",
|
||||||
|
"post_rotate_x",
|
||||||
|
"post_rotate_y",
|
||||||
|
"curl3D_cz",
|
||||||
|
};
|
||||||
//This is a vector of the param names as they are in the legacy, badly named flam3/Apophysis code.
|
//This is a vector of the param names as they are in the legacy, badly named flam3/Apophysis code.
|
||||||
vector<string> badParams;
|
vector<string> badParams =
|
||||||
badParams.reserve(11);
|
{
|
||||||
badParams.push_back("bwraps7_cellsize");
|
"bwraps7_cellsize",
|
||||||
badParams.push_back("bwraps7_space");
|
"bwraps7_space",
|
||||||
badParams.push_back("bwraps7_gain");
|
"bwraps7_gain",
|
||||||
badParams.push_back("bwraps7_inner_twist");
|
"bwraps7_inner_twist",
|
||||||
badParams.push_back("bwraps7_outer_twist");
|
"bwraps7_outer_twist"
|
||||||
|
};
|
||||||
m_BadVariationNames.push_back(make_pair(make_pair(string("bwraps7"), string("bwraps")), badParams));//bwraps7 is the same as bwraps.
|
m_BadVariationNames.push_back(make_pair(make_pair(string("bwraps7"), string("bwraps")), badParams));//bwraps7 is the same as bwraps.
|
||||||
badParams.clear();
|
badParams =
|
||||||
badParams.push_back("bwraps2_cellsize");
|
{
|
||||||
badParams.push_back("bwraps2_space");
|
"bwraps2_cellsize",
|
||||||
badParams.push_back("bwraps2_gain");
|
"bwraps2_space",
|
||||||
badParams.push_back("bwraps2_inner_twist");
|
"bwraps2_gain",
|
||||||
badParams.push_back("bwraps2_outer_twist");
|
"bwraps2_inner_twist",
|
||||||
|
"bwraps2_outer_twist"
|
||||||
|
};
|
||||||
m_BadVariationNames.push_back(make_pair(make_pair(string("bwraps2"), string("bwraps")), badParams));//bwraps2 is the same as bwraps.
|
m_BadVariationNames.push_back(make_pair(make_pair(string("bwraps2"), string("bwraps")), badParams));//bwraps2 is the same as bwraps.
|
||||||
badParams.clear();
|
badParams =
|
||||||
badParams.push_back("pre_bwraps2_cellsize");
|
{
|
||||||
badParams.push_back("pre_bwraps2_space");
|
"pre_bwraps2_cellsize",
|
||||||
badParams.push_back("pre_bwraps2_gain");
|
"pre_bwraps2_space",
|
||||||
badParams.push_back("pre_bwraps2_inner_twist");
|
"pre_bwraps2_gain",
|
||||||
badParams.push_back("pre_bwraps2_outer_twist");
|
"pre_bwraps2_inner_twist",
|
||||||
|
"pre_bwraps2_outer_twist"
|
||||||
|
};
|
||||||
m_BadVariationNames.push_back(make_pair(make_pair(string("pre_bwraps2"), string("pre_bwraps")), badParams));
|
m_BadVariationNames.push_back(make_pair(make_pair(string("pre_bwraps2"), string("pre_bwraps")), badParams));
|
||||||
badParams.clear();
|
badParams =
|
||||||
badParams.push_back("post_bwraps2_cellsize");
|
{
|
||||||
badParams.push_back("post_bwraps2_space");
|
"post_bwraps2_cellsize",
|
||||||
badParams.push_back("post_bwraps2_gain");
|
"post_bwraps2_space",
|
||||||
badParams.push_back("post_bwraps2_inner_twist");
|
"post_bwraps2_gain",
|
||||||
badParams.push_back("post_bwraps2_outer_twist");
|
"post_bwraps2_inner_twist",
|
||||||
|
"post_bwraps2_outer_twist"
|
||||||
|
};
|
||||||
m_BadVariationNames.push_back(make_pair(make_pair(string("post_bwraps2"), string("post_bwraps")), badParams));
|
m_BadVariationNames.push_back(make_pair(make_pair(string("post_bwraps2"), string("post_bwraps")), badParams));
|
||||||
badParams.clear();
|
badParams =
|
||||||
badParams.push_back("mobius_radius");
|
{
|
||||||
badParams.push_back("mobius_width");
|
"mobius_radius",
|
||||||
badParams.push_back("mobius_rect_x");
|
"mobius_width",
|
||||||
badParams.push_back("mobius_rect_y");
|
"mobius_rect_x",
|
||||||
badParams.push_back("mobius_rotate_x");
|
"mobius_rect_y",
|
||||||
badParams.push_back("mobius_rotate_y");
|
"mobius_rotate_x",
|
||||||
|
"mobius_rotate_y"
|
||||||
|
};
|
||||||
m_BadVariationNames.push_back(make_pair(make_pair(string("mobius"), string("mobius_strip")), badParams));//mobius_strip clashes with Mobius.
|
m_BadVariationNames.push_back(make_pair(make_pair(string("mobius"), string("mobius_strip")), badParams));//mobius_strip clashes with Mobius.
|
||||||
badParams.clear();
|
badParams =
|
||||||
badParams.push_back("post_dcztransl_x0");
|
{
|
||||||
badParams.push_back("post_dcztransl_x1");
|
"post_dcztransl_x0",
|
||||||
badParams.push_back("post_dcztransl_factor");
|
"post_dcztransl_x1",
|
||||||
badParams.push_back("post_dcztransl_overwrite");
|
"post_dcztransl_factor",
|
||||||
badParams.push_back("post_dcztransl_clamp");
|
"post_dcztransl_overwrite",
|
||||||
|
"post_dcztransl_clamp"
|
||||||
|
};
|
||||||
m_BadVariationNames.push_back(make_pair(make_pair(string("post_dcztransl"), string("post_dc_ztransl")), badParams));
|
m_BadVariationNames.push_back(make_pair(make_pair(string("post_dcztransl"), string("post_dc_ztransl")), badParams));
|
||||||
badParams.clear();
|
badParams =
|
||||||
badParams.push_back("post_scrop_power");
|
{
|
||||||
badParams.push_back("post_scrop_radius");
|
"post_scrop_power",
|
||||||
badParams.push_back("post_scrop_roundstr");
|
"post_scrop_radius",
|
||||||
badParams.push_back("post_scrop_roundwidth");
|
"post_scrop_roundstr",
|
||||||
badParams.push_back("post_scrop_distortion");
|
"post_scrop_roundwidth",
|
||||||
badParams.push_back("post_scrop_edge");
|
"post_scrop_distortion",
|
||||||
badParams.push_back("post_scrop_scatter");
|
"post_scrop_edge",
|
||||||
badParams.push_back("post_scrop_offset");
|
"post_scrop_scatter",
|
||||||
badParams.push_back("post_scrop_rotation");
|
"post_scrop_offset",
|
||||||
badParams.push_back("post_scrop_cropmode");
|
"post_scrop_rotation",
|
||||||
badParams.push_back("post_scrop_static");
|
"post_scrop_cropmode",
|
||||||
|
"post_scrop_static"
|
||||||
|
};
|
||||||
m_BadVariationNames.push_back(make_pair(make_pair(string("post_scrop"), string("post_smartcrop")), badParams));
|
m_BadVariationNames.push_back(make_pair(make_pair(string("post_scrop"), string("post_smartcrop")), badParams));
|
||||||
//Note that splits3D can't be done here because it's param names are also used by splits.
|
//Note that splits3D can't be done here because it's param names are also used by splits.
|
||||||
badParams.clear();
|
badParams.clear();
|
||||||
|
@ -192,9 +192,9 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="i">The index in the file of the ember</param>
|
/// <param name="i">The index in the file of the ember</param>
|
||||||
/// <returns>The default ember name</returns>
|
/// <returns>The default ember name</returns>
|
||||||
static QString DefaultEmberName(uint i)
|
static QString DefaultEmberName(T i)
|
||||||
{
|
{
|
||||||
return DefaultFilename() + "_" + ToString(i);
|
return DefaultFilename() + "_" + ToString<T>(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString m_Filename;
|
QString m_Filename;
|
||||||
|
@ -19,7 +19,7 @@ public:
|
|||||||
/// This is meant to be a root level item.
|
/// This is meant to be a root level item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="p">The parent widget of this item</param>
|
/// <param name="p">The parent widget of this item</param>
|
||||||
explicit EmberTreeWidgetItemBase(QTreeWidget* p = 0)
|
explicit EmberTreeWidgetItemBase(QTreeWidget* p)
|
||||||
: QTreeWidgetItem(p)
|
: QTreeWidgetItem(p)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -29,7 +29,7 @@ public:
|
|||||||
/// This is meant to be the child of a root level item.
|
/// This is meant to be the child of a root level item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="p">The parent widget of this item</param>
|
/// <param name="p">The parent widget of this item</param>
|
||||||
explicit EmberTreeWidgetItemBase(QTreeWidgetItem* p = 0)
|
explicit EmberTreeWidgetItemBase(QTreeWidgetItem* p)
|
||||||
: QTreeWidgetItem(p)
|
: QTreeWidgetItem(p)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -43,7 +43,6 @@ public:
|
|||||||
void SetImage(vector<byte>& v, uint width, uint height)
|
void SetImage(vector<byte>& v, uint width, uint height)
|
||||||
{
|
{
|
||||||
int size = 64;
|
int size = 64;
|
||||||
|
|
||||||
m_Image = QImage(width, height, QImage::Format_RGBA8888);
|
m_Image = QImage(width, height, QImage::Format_RGBA8888);
|
||||||
memcpy(m_Image.scanLine(0), v.data(), v.size() * sizeof(v[0]));//Memcpy the data in.
|
memcpy(m_Image.scanLine(0), v.data(), v.size() * sizeof(v[0]));//Memcpy the data in.
|
||||||
m_Pixmap = QPixmap::fromImage(m_Image).scaled(QSize(size, size), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);//Create a QPixmap out of the QImage, scaled to size.
|
m_Pixmap = QPixmap::fromImage(m_Image).scaled(QSize(size, size), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);//Create a QPixmap out of the QImage, scaled to size.
|
||||||
|
@ -116,7 +116,7 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(FractoriumSettings* set
|
|||||||
m_QualitySpin->setValue(m_Settings->FinalQuality());
|
m_QualitySpin->setValue(m_Settings->FinalQuality());
|
||||||
m_TemporalSamplesSpin->setValue(m_Settings->FinalTemporalSamples());
|
m_TemporalSamplesSpin->setValue(m_Settings->FinalTemporalSamples());
|
||||||
m_SupersampleSpin->setValue(m_Settings->FinalSupersample());
|
m_SupersampleSpin->setValue(m_Settings->FinalSupersample());
|
||||||
m_StripsSpin->setValue(m_Settings->FinalStrips());
|
m_StripsSpin->setValue(int(m_Settings->FinalStrips()));
|
||||||
Scale(eScaleType(m_Settings->FinalScale()));
|
Scale(eScaleType(m_Settings->FinalScale()));
|
||||||
|
|
||||||
if (m_Settings->FinalExt() == "jpg")
|
if (m_Settings->FinalExt() == "jpg")
|
||||||
@ -622,7 +622,7 @@ void FractoriumFinalRenderDialog::showEvent(QShowEvent* e)
|
|||||||
{
|
{
|
||||||
if (CreateControllerFromGUI(true))
|
if (CreateControllerFromGUI(true))
|
||||||
{
|
{
|
||||||
int index = m_Fractorium->m_Controller->Index() + 1;
|
int index = int(m_Fractorium->m_Controller->Index()) + 1;
|
||||||
#ifdef DO_DOUBLE
|
#ifdef DO_DOUBLE
|
||||||
Ember<double> ed;
|
Ember<double> ed;
|
||||||
EmberFile<double> efi;
|
EmberFile<double> efi;
|
||||||
@ -644,7 +644,7 @@ void FractoriumFinalRenderDialog::showEvent(QShowEvent* e)
|
|||||||
});//Copy the whole file, will take about 0.2ms per ember in the file.
|
});//Copy the whole file, will take about 0.2ms per ember in the file.
|
||||||
#endif
|
#endif
|
||||||
m_Controller->SetEmberFile(efi);//Copy the temp file into the final render controller.
|
m_Controller->SetEmberFile(efi);//Copy the temp file into the final render controller.
|
||||||
ui.FinalRenderCurrentSpin->setMaximum(efi.Size());
|
ui.FinalRenderCurrentSpin->setMaximum(int(efi.Size()));
|
||||||
ui.FinalRenderCurrentSpin->blockSignals(true);
|
ui.FinalRenderCurrentSpin->blockSignals(true);
|
||||||
ui.FinalRenderCurrentSpin->setValue(index);//Set the currently selected ember to the one that was being edited.
|
ui.FinalRenderCurrentSpin->setValue(index);//Set the currently selected ember to the one that was being edited.
|
||||||
ui.FinalRenderCurrentSpin->blockSignals(false);
|
ui.FinalRenderCurrentSpin->blockSignals(false);
|
||||||
|
@ -142,7 +142,7 @@ FinalRenderEmberController<T>::FinalRenderEmberController(FractoriumFinalRenderD
|
|||||||
[&](size_t strip) { },//Error.
|
[&](size_t strip) { },//Error.
|
||||||
[&](Ember<T>& finalEmber)//Final strip.
|
[&](Ember<T>& finalEmber)//Final strip.
|
||||||
{
|
{
|
||||||
QImage image(finalEmber.m_FinalRasW, finalEmber.m_FinalRasH, QImage::Format_RGBA8888);//The label wants RGBA.
|
QImage image(int(finalEmber.m_FinalRasW), int(finalEmber.m_FinalRasH), QImage::Format_RGBA8888);//The label wants RGBA.
|
||||||
memcpy(image.scanLine(0), m_PreviewFinalImage.data(), finalEmber.m_FinalRasW * finalEmber.m_FinalRasH * 4);//Memcpy the data in.
|
memcpy(image.scanLine(0), m_PreviewFinalImage.data(), finalEmber.m_FinalRasW * finalEmber.m_FinalRasH * 4);//Memcpy the data in.
|
||||||
QPixmap pixmap(QPixmap::fromImage(image));
|
QPixmap pixmap(QPixmap::fromImage(image));
|
||||||
QMetaObject::invokeMethod(widget, "setPixmap", Qt::QueuedConnection, Q_ARG(QPixmap, pixmap));
|
QMetaObject::invokeMethod(widget, "setPixmap", Qt::QueuedConnection, Q_ARG(QPixmap, pixmap));
|
||||||
|
@ -43,7 +43,7 @@ struct FinalRenderGuiState
|
|||||||
double m_Quality;
|
double m_Quality;
|
||||||
uint m_TemporalSamples;
|
uint m_TemporalSamples;
|
||||||
uint m_Supersample;
|
uint m_Supersample;
|
||||||
uint m_Strips;
|
size_t m_Strips;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -211,7 +211,7 @@ static vector<pair<size_t, size_t>> Devices(const QList<QVariant>& selectedDevic
|
|||||||
auto& devices = OpenCLInfo::Instance()->DeviceIndices();
|
auto& devices = OpenCLInfo::Instance()->DeviceIndices();
|
||||||
vec.reserve(selectedDevices.size());
|
vec.reserve(selectedDevices.size());
|
||||||
|
|
||||||
for (size_t i = 0; i < selectedDevices.size(); i++)
|
for (int i = 0; i < selectedDevices.size(); i++)
|
||||||
{
|
{
|
||||||
auto index = selectedDevices[i].toUInt();
|
auto index = selectedDevices[i].toUInt();
|
||||||
|
|
||||||
@ -235,9 +235,9 @@ static void SetupDeviceTable(QTableWidget* table, const QList<QVariant>& setting
|
|||||||
bool primary = false;
|
bool primary = false;
|
||||||
auto& deviceNames = OpenCLInfo::Instance()->AllDeviceNames();
|
auto& deviceNames = OpenCLInfo::Instance()->AllDeviceNames();
|
||||||
table->clearContents();
|
table->clearContents();
|
||||||
table->setRowCount(deviceNames.size());
|
table->setRowCount(int(deviceNames.size()));
|
||||||
|
|
||||||
for (size_t i = 0; i < deviceNames.size(); i++)
|
for (int i = 0; i < deviceNames.size(); i++)
|
||||||
{
|
{
|
||||||
auto checkItem = new QTableWidgetItem();
|
auto checkItem = new QTableWidgetItem();
|
||||||
auto radio = new QRadioButton();
|
auto radio = new QRadioButton();
|
||||||
|
@ -100,7 +100,7 @@ FractoriumEmberController<T>::FractoriumEmberController(Fractorium* fractorium)
|
|||||||
|
|
||||||
if (auto top = tree->topLevelItem(0))
|
if (auto top = tree->topLevelItem(0))
|
||||||
{
|
{
|
||||||
for (size_t i = start; m_PreviewRun && i < end && i < m_EmberFile.Size(); i++)
|
for (auto i = start; m_PreviewRun && i < end && i < m_EmberFile.Size(); i++)
|
||||||
{
|
{
|
||||||
Ember<T> ember = m_EmberFile.m_Embers[i];
|
Ember<T> ember = m_EmberFile.m_Embers[i];
|
||||||
ember.SyncSize();
|
ember.SyncSize();
|
||||||
@ -112,7 +112,7 @@ FractoriumEmberController<T>::FractoriumEmberController(Fractorium* fractorium)
|
|||||||
|
|
||||||
if (m_PreviewRenderer->Run(m_PreviewFinalImage) == eRenderStatus::RENDER_OK)
|
if (m_PreviewRenderer->Run(m_PreviewFinalImage) == eRenderStatus::RENDER_OK)
|
||||||
{
|
{
|
||||||
if (auto treeItem = dynamic_cast<EmberTreeWidgetItem<T>*>(top->child(i)))
|
if (auto treeItem = dynamic_cast<EmberTreeWidgetItem<T>*>(top->child(int(i))))
|
||||||
{
|
{
|
||||||
//It is critical that Qt::BlockingQueuedConnection is passed because this is running on a different thread than the UI.
|
//It is critical that Qt::BlockingQueuedConnection is passed because this is running on a different thread than the UI.
|
||||||
//This ensures the events are processed in order as each preview is updated, and that control does not return here
|
//This ensures the events are processed in order as each preview is updated, and that control does not return here
|
||||||
@ -173,8 +173,8 @@ template <typename T> Ember<T>* FractoriumEmberController<T>::CurrentEmber() { r
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void FractoriumEmberController<T>::ConstrainDimensions(Ember<T>& ember)
|
void FractoriumEmberController<T>::ConstrainDimensions(Ember<T>& ember)
|
||||||
{
|
{
|
||||||
ember.m_FinalRasW = std::min<int>(m_Fractorium->ui.GLDisplay->MaxTexSize(), ember.m_FinalRasW);
|
ember.m_FinalRasW = std::min<int>(m_Fractorium->ui.GLDisplay->MaxTexSize(), int(ember.m_FinalRasW));
|
||||||
ember.m_FinalRasH = std::min<int>(m_Fractorium->ui.GLDisplay->MaxTexSize(), ember.m_FinalRasH);
|
ember.m_FinalRasH = std::min<int>(m_Fractorium->ui.GLDisplay->MaxTexSize(), int(ember.m_FinalRasH));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -190,7 +190,7 @@ void FractoriumEmberController<T>::SetEmber(size_t index)
|
|||||||
{
|
{
|
||||||
if (auto top = m_Fractorium->ui.LibraryTree->topLevelItem(0))
|
if (auto top = m_Fractorium->ui.LibraryTree->topLevelItem(0))
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < top->childCount(); i++)
|
for (int i = 0; i < top->childCount(); i++)
|
||||||
{
|
{
|
||||||
if (auto emberItem = dynamic_cast<EmberTreeWidgetItem<T>*>(top->child(i)))
|
if (auto emberItem = dynamic_cast<EmberTreeWidgetItem<T>*>(top->child(i)))
|
||||||
emberItem->setSelected(i == index);
|
emberItem->setSelected(i == index);
|
||||||
@ -229,7 +229,7 @@ void FractoriumEmberController<T>::Update(std::function<void (void)> func, bool
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void FractoriumEmberController<T>::UpdateXform(std::function<void(Xform<T>*)> func, eXformUpdate updateType, bool updateRender, eProcessAction action)
|
void FractoriumEmberController<T>::UpdateXform(std::function<void(Xform<T>*)> func, eXformUpdate updateType, bool updateRender, eProcessAction action)
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
int i = 0;
|
||||||
bool isCurrentFinal = m_Ember.IsFinalXform(CurrentXform());
|
bool isCurrentFinal = m_Ember.IsFinalXform(CurrentXform());
|
||||||
bool doFinal = updateType != eXformUpdate::UPDATE_SELECTED_EXCEPT_FINAL && updateType != eXformUpdate::UPDATE_ALL_EXCEPT_FINAL;
|
bool doFinal = updateType != eXformUpdate::UPDATE_SELECTED_EXCEPT_FINAL && updateType != eXformUpdate::UPDATE_ALL_EXCEPT_FINAL;
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ public:
|
|||||||
virtual void RandomXaos() { }
|
virtual void RandomXaos() { }
|
||||||
|
|
||||||
//Palette.
|
//Palette.
|
||||||
virtual int InitPaletteList(const string& s) { return 0; }
|
virtual size_t InitPaletteList(const string& s) { return 0; }
|
||||||
virtual bool FillPaletteTable(const string& s) { return false; }
|
virtual bool FillPaletteTable(const string& s) { return false; }
|
||||||
virtual void ApplyPaletteToEmber() { }
|
virtual void ApplyPaletteToEmber() { }
|
||||||
virtual void PaletteAdjust() { }
|
virtual void PaletteAdjust() { }
|
||||||
@ -240,9 +240,9 @@ protected:
|
|||||||
bool m_Shared;
|
bool m_Shared;
|
||||||
bool m_LastEditWasUndoRedo;
|
bool m_LastEditWasUndoRedo;
|
||||||
vector<pair<size_t, size_t>> m_Devices;
|
vector<pair<size_t, size_t>> m_Devices;
|
||||||
uint m_SubBatchCount;
|
size_t m_SubBatchCount;
|
||||||
uint m_FailedRenders;
|
uint m_FailedRenders;
|
||||||
uint m_UndoIndex;
|
size_t m_UndoIndex;
|
||||||
double m_LockedScale;
|
double m_LockedScale;
|
||||||
eRendererType m_RenderType;
|
eRendererType m_RenderType;
|
||||||
eEditUndoState m_EditState;
|
eEditUndoState m_EditState;
|
||||||
@ -443,7 +443,7 @@ public:
|
|||||||
virtual void RandomXaos() override;
|
virtual void RandomXaos() override;
|
||||||
|
|
||||||
//Palette.
|
//Palette.
|
||||||
virtual int InitPaletteList(const string& s) override;
|
virtual size_t InitPaletteList(const string& s) override;
|
||||||
virtual bool FillPaletteTable(const string& s) override;
|
virtual bool FillPaletteTable(const string& s) override;
|
||||||
virtual void ApplyPaletteToEmber() override;
|
virtual void ApplyPaletteToEmber() override;
|
||||||
virtual void PaletteAdjust() override;
|
virtual void PaletteAdjust() override;
|
||||||
|
@ -18,7 +18,7 @@ void Fractorium::InitLibraryUI()
|
|||||||
/// <returns>A pair containing the index of the item clicked and a pointer to the item</param>
|
/// <returns>A pair containing the index of the item clicked and a pointer to the item</param>
|
||||||
pair<size_t, QTreeWidgetItem*> Fractorium::GetCurrentEmberIndex()
|
pair<size_t, QTreeWidgetItem*> Fractorium::GetCurrentEmberIndex()
|
||||||
{
|
{
|
||||||
size_t index = 0;
|
int index = 0;
|
||||||
QTreeWidgetItem* item = nullptr;
|
QTreeWidgetItem* item = nullptr;
|
||||||
auto tree = ui.LibraryTree;
|
auto tree = ui.LibraryTree;
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ void FractoriumEmberController<T>::FillLibraryTree(int selectIndex)
|
|||||||
emberItem->setSelected(true);
|
emberItem->setSelected(true);
|
||||||
|
|
||||||
QCoreApplication::flush();
|
QCoreApplication::flush();
|
||||||
RenderPreviews(0, m_EmberFile.Size());
|
RenderPreviews(0, uint(m_EmberFile.Size()));
|
||||||
tree->expandAll();
|
tree->expandAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ void FractoriumEmberController<T>::UpdateLibraryTree()
|
|||||||
//the pointers contained in the EmberTreeWidgetItems. So reassign all pointers here.
|
//the pointers contained in the EmberTreeWidgetItems. So reassign all pointers here.
|
||||||
SyncPointers();
|
SyncPointers();
|
||||||
tree->blockSignals(false);
|
tree->blockSignals(false);
|
||||||
RenderPreviews(childCount, m_EmberFile.Size());
|
RenderPreviews(childCount, uint(m_EmberFile.Size()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ void FractoriumEmberController<T>::RenderPreviews(uint start, uint end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
tree->blockSignals(false);
|
tree->blockSignals(false);
|
||||||
m_PreviewResult = QtConcurrent::run(m_PreviewRenderFunc, 0, m_EmberFile.Size());
|
m_PreviewResult = QtConcurrent::run(m_PreviewRenderFunc, 0, uint(m_EmberFile.Size()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_PreviewResult = QtConcurrent::run(m_PreviewRenderFunc, start, end);
|
m_PreviewResult = QtConcurrent::run(m_PreviewRenderFunc, start, end);
|
||||||
|
@ -60,7 +60,7 @@ void FractoriumEmberController<T>::NewFlock(size_t count)
|
|||||||
|
|
||||||
for (size_t i = 0; i < count; i++)
|
for (size_t i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
m_SheepTools->Random(ember, m_FilteredVariations, static_cast<intmax_t>(QTIsaac<ISAAC_SIZE, ISAAC_INT>::GlobalRand->Frand<T>(-2, 2)), 0, MAX_CL_VARS);
|
m_SheepTools->Random(ember, m_FilteredVariations, static_cast<intmax_t>(QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedFrand<T>(-2, 2)), 0, MAX_CL_VARS);
|
||||||
ParamsToEmber(ember);
|
ParamsToEmber(ember);
|
||||||
ember.m_Index = i;
|
ember.m_Index = i;
|
||||||
ember.m_Name = m_EmberFile.m_Filename.toStdString() + "_" + ToString(i + 1ULL).toStdString();
|
ember.m_Name = m_EmberFile.m_Filename.toStdString() + "_" + ToString(i + 1ULL).toStdString();
|
||||||
@ -119,7 +119,7 @@ void FractoriumEmberController<T>::NewRandomFlameInCurrentFile()
|
|||||||
{
|
{
|
||||||
Ember<T> ember;
|
Ember<T> ember;
|
||||||
StopPreviewRender();
|
StopPreviewRender();
|
||||||
m_SheepTools->Random(ember, m_FilteredVariations, static_cast<int>(QTIsaac<ISAAC_SIZE, ISAAC_INT>::GlobalRand->Frand<T>(-2, 2)), 0, MAX_CL_VARS);
|
m_SheepTools->Random(ember, m_FilteredVariations, static_cast<int>(QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedFrand<T>(-2, 2)), 0, MAX_CL_VARS);
|
||||||
ParamsToEmber(ember);
|
ParamsToEmber(ember);
|
||||||
ember.m_Name = EmberFile<T>::DefaultEmberName(m_EmberFile.Size() + 1).toStdString();
|
ember.m_Name = EmberFile<T>::DefaultEmberName(m_EmberFile.Size() + 1).toStdString();
|
||||||
ember.m_Index = m_EmberFile.Size();
|
ember.m_Index = m_EmberFile.Size();
|
||||||
@ -172,7 +172,7 @@ void FractoriumEmberController<T>::OpenAndPrepFiles(const QStringList& filenames
|
|||||||
EmberFile<T> emberFile;
|
EmberFile<T> emberFile;
|
||||||
XmlToEmber<T> parser;
|
XmlToEmber<T> parser;
|
||||||
vector<Ember<T>> embers;
|
vector<Ember<T>> embers;
|
||||||
uint previousSize = append ? m_EmberFile.Size() : 0;
|
uint previousSize = append ? uint(m_EmberFile.Size()) : 0u;
|
||||||
StopPreviewRender();
|
StopPreviewRender();
|
||||||
emberFile.m_Filename = filenames[0];
|
emberFile.m_Filename = filenames[0];
|
||||||
|
|
||||||
@ -366,7 +366,7 @@ void Fractorium::OnActionSaveCurrentScreen(bool checked)
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void FractoriumEmberController<T>::SaveCurrentToOpenedFile()
|
void FractoriumEmberController<T>::SaveCurrentToOpenedFile()
|
||||||
{
|
{
|
||||||
size_t i;
|
uint i;
|
||||||
bool fileFound = false;
|
bool fileFound = false;
|
||||||
|
|
||||||
for (i = 0; i < m_EmberFile.Size(); i++)
|
for (i = 0; i < m_EmberFile.Size(); i++)
|
||||||
@ -415,7 +415,7 @@ void FractoriumEmberController<T>::Undo()
|
|||||||
{
|
{
|
||||||
int index = m_Ember.GetTotalXformIndex(CurrentXform());
|
int index = m_Ember.GetTotalXformIndex(CurrentXform());
|
||||||
m_LastEditWasUndoRedo = true;
|
m_LastEditWasUndoRedo = true;
|
||||||
m_UndoIndex = std::max(0u, m_UndoIndex - 1u);
|
m_UndoIndex = std::max<size_t>(0u, m_UndoIndex - 1u);
|
||||||
SetEmber(m_UndoList[m_UndoIndex], true);
|
SetEmber(m_UndoList[m_UndoIndex], true);
|
||||||
m_EditState = eEditUndoState::UNDO_REDO;
|
m_EditState = eEditUndoState::UNDO_REDO;
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ void FractoriumEmberController<T>::Redo()
|
|||||||
{
|
{
|
||||||
int index = m_Ember.GetTotalXformIndex(CurrentXform());
|
int index = m_Ember.GetTotalXformIndex(CurrentXform());
|
||||||
m_LastEditWasUndoRedo = true;
|
m_LastEditWasUndoRedo = true;
|
||||||
m_UndoIndex = std::min<uint>(m_UndoIndex + 1, m_UndoList.size() - 1);
|
m_UndoIndex = std::min<size_t>(m_UndoIndex + 1, m_UndoList.size() - 1);
|
||||||
SetEmber(m_UndoList[m_UndoIndex], true);
|
SetEmber(m_UndoList[m_UndoIndex], true);
|
||||||
m_EditState = eEditUndoState::UNDO_REDO;
|
m_EditState = eEditUndoState::UNDO_REDO;
|
||||||
|
|
||||||
@ -506,7 +506,7 @@ void Fractorium::OnActionCopyAllXml(bool checked) { m_Controller->CopyAllXml();
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void FractoriumEmberController<T>::PasteXmlAppend()
|
void FractoriumEmberController<T>::PasteXmlAppend()
|
||||||
{
|
{
|
||||||
uint i, previousSize = m_EmberFile.Size();
|
size_t previousSize = m_EmberFile.Size();
|
||||||
string s, errors;
|
string s, errors;
|
||||||
XmlToEmber<T> parser;
|
XmlToEmber<T> parser;
|
||||||
vector<Ember<T>> embers;
|
vector<Ember<T>> embers;
|
||||||
@ -514,7 +514,7 @@ void FractoriumEmberController<T>::PasteXmlAppend()
|
|||||||
auto b = codec->fromUnicode(QApplication::clipboard()->text());
|
auto b = codec->fromUnicode(QApplication::clipboard()->text());
|
||||||
s.reserve(b.size());
|
s.reserve(b.size());
|
||||||
|
|
||||||
for (i = 0; i < b.size(); i++)
|
for (auto i = 0; i < b.size(); i++)
|
||||||
{
|
{
|
||||||
if (uint(b[i]) < 128u)
|
if (uint(b[i]) < 128u)
|
||||||
s.push_back(b[i]);
|
s.push_back(b[i]);
|
||||||
@ -532,7 +532,7 @@ void FractoriumEmberController<T>::PasteXmlAppend()
|
|||||||
|
|
||||||
if (!embers.empty())
|
if (!embers.empty())
|
||||||
{
|
{
|
||||||
for (i = 0; i < embers.size(); i++)
|
for (auto i = 0; i < embers.size(); i++)
|
||||||
{
|
{
|
||||||
embers[i].m_Index = m_EmberFile.Size();
|
embers[i].m_Index = m_EmberFile.Size();
|
||||||
ConstrainDimensions(embers[i]);//Do not exceed the max texture size.
|
ConstrainDimensions(embers[i]);//Do not exceed the max texture size.
|
||||||
@ -560,7 +560,6 @@ void Fractorium::OnActionPasteXmlAppend(bool checked) { m_Controller->PasteXmlAp
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void FractoriumEmberController<T>::PasteXmlOver()
|
void FractoriumEmberController<T>::PasteXmlOver()
|
||||||
{
|
{
|
||||||
uint i;
|
|
||||||
string s, errors;
|
string s, errors;
|
||||||
XmlToEmber<T> parser;
|
XmlToEmber<T> parser;
|
||||||
auto backupEmber = m_EmberFile.m_Embers[0];
|
auto backupEmber = m_EmberFile.m_Embers[0];
|
||||||
@ -568,7 +567,7 @@ void FractoriumEmberController<T>::PasteXmlOver()
|
|||||||
auto b = codec->fromUnicode(QApplication::clipboard()->text());
|
auto b = codec->fromUnicode(QApplication::clipboard()->text());
|
||||||
s.reserve(b.size());
|
s.reserve(b.size());
|
||||||
|
|
||||||
for (i = 0; i < b.size(); i++)
|
for (auto i = 0; i < b.size(); i++)
|
||||||
{
|
{
|
||||||
if (uint(b[i]) < 128u)
|
if (uint(b[i]) < 128u)
|
||||||
s.push_back(b[i]);
|
s.push_back(b[i]);
|
||||||
@ -587,7 +586,7 @@ void FractoriumEmberController<T>::PasteXmlOver()
|
|||||||
|
|
||||||
if (m_EmberFile.Size())
|
if (m_EmberFile.Size())
|
||||||
{
|
{
|
||||||
for (i = 0; i < m_EmberFile.Size(); i++)
|
for (auto i = 0; i < m_EmberFile.Size(); i++)
|
||||||
{
|
{
|
||||||
m_EmberFile.m_Embers[i].m_Index = i;
|
m_EmberFile.m_Embers[i].m_Index = i;
|
||||||
ConstrainDimensions(m_EmberFile.m_Embers[i]);//Do not exceed the max texture size.
|
ConstrainDimensions(m_EmberFile.m_Embers[i]);//Do not exceed the max texture size.
|
||||||
@ -698,8 +697,8 @@ void FractoriumEmberController<T>::AddReflectiveSymmetry()
|
|||||||
Update([&]()
|
Update([&]()
|
||||||
{
|
{
|
||||||
m_Ember.AddSymmetry(-1, m_Rand);
|
m_Ember.AddSymmetry(-1, m_Rand);
|
||||||
int index = m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1);//Set index to the last item before final.
|
auto index = m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1);//Set index to the last item before final.
|
||||||
FillXforms(index);
|
FillXforms(int(index));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -716,8 +715,8 @@ void FractoriumEmberController<T>::AddRotationalSymmetry()
|
|||||||
Update([&]()
|
Update([&]()
|
||||||
{
|
{
|
||||||
m_Ember.AddSymmetry(2, m_Rand);
|
m_Ember.AddSymmetry(2, m_Rand);
|
||||||
int index = m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1);//Set index to the last item before final.
|
auto index = m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1);//Set index to the last item before final.
|
||||||
FillXforms(index);
|
FillXforms(int(index));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -734,8 +733,8 @@ void FractoriumEmberController<T>::AddBothSymmetry()
|
|||||||
Update([&]()
|
Update([&]()
|
||||||
{
|
{
|
||||||
m_Ember.AddSymmetry(-2, m_Rand);
|
m_Ember.AddSymmetry(-2, m_Rand);
|
||||||
int index = m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1);//Set index to the last item before final.
|
auto index = m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1);//Set index to the last item before final.
|
||||||
FillXforms(index);
|
FillXforms(int(index));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ void Fractorium::InitPaletteUI()
|
|||||||
/// <param name="s">The full path to the palette files folder</param>
|
/// <param name="s">The full path to the palette files folder</param>
|
||||||
/// <returns>The number of palettes successfully added</returns>
|
/// <returns>The number of palettes successfully added</returns>
|
||||||
template <typename T>
|
template <typename T>
|
||||||
int FractoriumEmberController<T>::InitPaletteList(const string& s)
|
size_t FractoriumEmberController<T>::InitPaletteList(const string& s)
|
||||||
{
|
{
|
||||||
QDirIterator it(s.c_str(), QStringList() << "*.xml", QDir::Files, QDirIterator::FollowSymlinks);
|
QDirIterator it(s.c_str(), QStringList() << "*.xml", QDir::Files, QDirIterator::FollowSymlinks);
|
||||||
m_PaletteList.Clear();
|
m_PaletteList.Clear();
|
||||||
@ -84,7 +84,7 @@ bool FractoriumEmberController<T>::FillPaletteTable(const string& s)
|
|||||||
auto palettePreviewTable = m_Fractorium->ui.PalettePreviewTable;
|
auto palettePreviewTable = m_Fractorium->ui.PalettePreviewTable;
|
||||||
m_CurrentPaletteFilePath = m_Fractorium->ui.PaletteFilenameCombo->property("path").toString().toStdString() + "/" + s;
|
m_CurrentPaletteFilePath = m_Fractorium->ui.PaletteFilenameCombo->property("path").toString().toStdString() + "/" + s;
|
||||||
|
|
||||||
if (size_t paletteSize = m_PaletteList.Size(m_CurrentPaletteFilePath))
|
if (int paletteSize = int(m_PaletteList.Size(m_CurrentPaletteFilePath)))
|
||||||
{
|
{
|
||||||
paletteTable->clear();
|
paletteTable->clear();
|
||||||
paletteTable->blockSignals(true);
|
paletteTable->blockSignals(true);
|
||||||
@ -98,7 +98,7 @@ bool FractoriumEmberController<T>::FillPaletteTable(const string& s)
|
|||||||
paletteTable->setHorizontalHeaderItem(1, paletteHeader);
|
paletteTable->setHorizontalHeaderItem(1, paletteHeader);
|
||||||
|
|
||||||
//Palette list table.
|
//Palette list table.
|
||||||
for (size_t i = 0; i < paletteSize; i++)
|
for (auto i = 0; i < paletteSize; i++)
|
||||||
{
|
{
|
||||||
if (auto p = m_PaletteList.GetPalette(m_CurrentPaletteFilePath, i))
|
if (auto p = m_PaletteList.GetPalette(m_CurrentPaletteFilePath, i))
|
||||||
{
|
{
|
||||||
@ -106,7 +106,7 @@ bool FractoriumEmberController<T>::FillPaletteTable(const string& s)
|
|||||||
auto nameCol = new QTableWidgetItem(p->m_Name.c_str());
|
auto nameCol = new QTableWidgetItem(p->m_Name.c_str());
|
||||||
nameCol->setToolTip(p->m_Name.c_str());
|
nameCol->setToolTip(p->m_Name.c_str());
|
||||||
paletteTable->setItem(i, 0, nameCol);
|
paletteTable->setItem(i, 0, nameCol);
|
||||||
QImage image(v.data(), p->Size(), PALETTE_CELL_HEIGHT, QImage::Format_RGB888);
|
QImage image(v.data(), int(p->Size()), PALETTE_CELL_HEIGHT, QImage::Format_RGB888);
|
||||||
auto paletteItem = new PaletteTableWidgetItem<T>(p);
|
auto paletteItem = new PaletteTableWidgetItem<T>(p);
|
||||||
paletteItem->setData(Qt::DecorationRole, QPixmap::fromImage(image));
|
paletteItem->setData(Qt::DecorationRole, QPixmap::fromImage(image));
|
||||||
paletteTable->setItem(i, 1, paletteItem);
|
paletteTable->setItem(i, 1, paletteItem);
|
||||||
@ -168,7 +168,7 @@ void FractoriumEmberController<T>::UpdateAdjustedPaletteGUI(Palette<T>& palette)
|
|||||||
{
|
{
|
||||||
//Use the adjusted palette to fill the preview palette control so the user can see the effects of applying the adjustements.
|
//Use the adjusted palette to fill the preview palette control so the user can see the effects of applying the adjustements.
|
||||||
vector<byte> v = palette.MakeRgbPaletteBlock(PALETTE_CELL_HEIGHT);//Make the palette repeat for PALETTE_CELL_HEIGHT rows.
|
vector<byte> v = palette.MakeRgbPaletteBlock(PALETTE_CELL_HEIGHT);//Make the palette repeat for PALETTE_CELL_HEIGHT rows.
|
||||||
m_FinalPaletteImage = QImage(palette.Size(), PALETTE_CELL_HEIGHT, QImage::Format_RGB888);//Create a QImage out of it.
|
m_FinalPaletteImage = QImage(int(palette.Size()), PALETTE_CELL_HEIGHT, QImage::Format_RGB888);//Create a QImage out of it.
|
||||||
memcpy(m_FinalPaletteImage.scanLine(0), v.data(), v.size() * sizeof(v[0]));//Memcpy the data in.
|
memcpy(m_FinalPaletteImage.scanLine(0), v.data(), v.size() * sizeof(v[0]));//Memcpy the data in.
|
||||||
QPixmap pixmap(QPixmap::fromImage(m_FinalPaletteImage));//Create a QPixmap out of the QImage.
|
QPixmap pixmap(QPixmap::fromImage(m_FinalPaletteImage));//Create a QPixmap out of the QImage.
|
||||||
previewPaletteItem->setData(Qt::DecorationRole, pixmap.scaled(QSize(pixmap.width(), palettePreviewTable->rowHeight(0) + 2), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));//Set the pixmap on the palette tab.
|
previewPaletteItem->setData(Qt::DecorationRole, pixmap.scaled(QSize(pixmap.width(), palettePreviewTable->rowHeight(0) + 2), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));//Set the pixmap on the palette tab.
|
||||||
@ -235,7 +235,7 @@ void Fractorium::OnPaletteCellClicked(int row, int col)
|
|||||||
{
|
{
|
||||||
if (auto item = dynamic_cast<PaletteTableWidgetItemBase*>(ui.PaletteListTable->item(row, 1)))
|
if (auto item = dynamic_cast<PaletteTableWidgetItemBase*>(ui.PaletteListTable->item(row, 1)))
|
||||||
{
|
{
|
||||||
auto index = item->Index();
|
auto index = int(item->Index());
|
||||||
|
|
||||||
if (m_PreviousPaletteRow != index)
|
if (m_PreviousPaletteRow != index)
|
||||||
{
|
{
|
||||||
@ -272,7 +272,7 @@ void Fractorium::OnPaletteRandomSelectButtonClicked(bool checked)
|
|||||||
uint i = 0;
|
uint i = 0;
|
||||||
int rowCount = ui.PaletteListTable->rowCount() - 1;
|
int rowCount = ui.PaletteListTable->rowCount() - 1;
|
||||||
|
|
||||||
while ((i = QTIsaac<ISAAC_SIZE, ISAAC_INT>::GlobalRand->Rand(rowCount)) == uint(m_PreviousPaletteRow));
|
while ((i = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(rowCount)) == uint(m_PreviousPaletteRow));
|
||||||
|
|
||||||
if (checked)
|
if (checked)
|
||||||
OnPaletteCellDoubleClicked(i, 1);//Will clear the adjustments.
|
OnPaletteCellDoubleClicked(i, 1);//Will clear the adjustments.
|
||||||
@ -287,22 +287,21 @@ void Fractorium::OnPaletteRandomSelectButtonClicked(bool checked)
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
void Fractorium::OnPaletteRandomAdjustButtonClicked(bool checked)
|
void Fractorium::OnPaletteRandomAdjustButtonClicked(bool checked)
|
||||||
{
|
{
|
||||||
auto gRand = QTIsaac<ISAAC_SIZE, ISAAC_INT>::GlobalRand.get();
|
m_PaletteHueSpin->setValue(-180 + QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(361));
|
||||||
m_PaletteHueSpin->setValue(-180 + gRand->Rand(361));
|
m_PaletteSaturationSpin->setValue(-50 + QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(101));//Full range of these leads to bad palettes, so clamp range.
|
||||||
m_PaletteSaturationSpin->setValue(-50 + gRand->Rand(101));//Full range of these leads to bad palettes, so clamp range.
|
m_PaletteBrightnessSpin->setValue(-50 + QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(101));
|
||||||
m_PaletteBrightnessSpin->setValue(-50 + gRand->Rand(101));
|
m_PaletteContrastSpin->setValue(-50 + QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(101));
|
||||||
m_PaletteContrastSpin->setValue(-50 + gRand->Rand(101));
|
|
||||||
|
|
||||||
//Doing frequency and blur together gives bad palettes that are just a solid color.
|
//Doing frequency and blur together gives bad palettes that are just a solid color.
|
||||||
if (gRand->RandBit())
|
if (QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRandBit())
|
||||||
{
|
{
|
||||||
m_PaletteBlurSpin->setValue(gRand->Rand(21));
|
m_PaletteBlurSpin->setValue(QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(21));
|
||||||
m_PaletteFrequencySpin->setValue(1);
|
m_PaletteFrequencySpin->setValue(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_PaletteBlurSpin->setValue(0);
|
m_PaletteBlurSpin->setValue(0);
|
||||||
m_PaletteFrequencySpin->setValue(1 + gRand->Rand(10));
|
m_PaletteFrequencySpin->setValue(1 + QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
OnPaletteAdjust(0);
|
OnPaletteAdjust(0);
|
||||||
|
@ -260,7 +260,7 @@ bool FractoriumEmberController<T>::SyncSizes()
|
|||||||
if (!m_GLController->SizesMatch())
|
if (!m_GLController->SizesMatch())
|
||||||
{
|
{
|
||||||
m_GLController->ClearWindow();
|
m_GLController->ClearWindow();
|
||||||
gl->SetDimensions(m_Ember.m_FinalRasW, m_Ember.m_FinalRasH);
|
gl->SetDimensions(int(m_Ember.m_FinalRasW), int(m_Ember.m_FinalRasH));
|
||||||
gl->Allocate();
|
gl->Allocate();
|
||||||
gl->SetViewport();
|
gl->SetViewport();
|
||||||
|
|
||||||
@ -660,12 +660,12 @@ bool Fractorium::CreateControllerFromOptions()
|
|||||||
|
|
||||||
if (!m_Controller.get() || (m_Controller->SizeOfT() != elementSize))
|
if (!m_Controller.get() || (m_Controller->SizeOfT() != elementSize))
|
||||||
{
|
{
|
||||||
double hue = m_PaletteHueSpin->value();
|
auto hue = m_PaletteHueSpin->value();
|
||||||
double sat = m_PaletteSaturationSpin->value();
|
auto sat = m_PaletteSaturationSpin->value();
|
||||||
double bright = m_PaletteBrightnessSpin->value();
|
auto bright = m_PaletteBrightnessSpin->value();
|
||||||
double con = m_PaletteContrastSpin->value();
|
auto con = m_PaletteContrastSpin->value();
|
||||||
double blur = m_PaletteBlurSpin->value();
|
auto blur = m_PaletteBlurSpin->value();
|
||||||
double freq = m_PaletteFrequencySpin->value();
|
auto freq = m_PaletteFrequencySpin->value();
|
||||||
#ifdef DO_DOUBLE
|
#ifdef DO_DOUBLE
|
||||||
Ember<double> ed;
|
Ember<double> ed;
|
||||||
EmberFile<double> efd;
|
EmberFile<double> efd;
|
||||||
|
@ -180,8 +180,8 @@ void FractoriumSettings::FinalTemporalSamples(uint i) { setValue(FINALTEMPO
|
|||||||
uint FractoriumSettings::FinalSupersample() { return value(FINALSUPERSAMPLE).toUInt(); }
|
uint FractoriumSettings::FinalSupersample() { return value(FINALSUPERSAMPLE).toUInt(); }
|
||||||
void FractoriumSettings::FinalSupersample(uint i) { setValue(FINALSUPERSAMPLE, i); }
|
void FractoriumSettings::FinalSupersample(uint i) { setValue(FINALSUPERSAMPLE, i); }
|
||||||
|
|
||||||
uint FractoriumSettings::FinalStrips() { return value(FINALSTRIPS).toUInt(); }
|
size_t FractoriumSettings::FinalStrips() { return value(FINALSTRIPS).toULongLong(); }
|
||||||
void FractoriumSettings::FinalStrips(uint i) { setValue(FINALSTRIPS, i); }
|
void FractoriumSettings::FinalStrips(size_t i) { setValue(FINALSTRIPS, uint(i)); }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Xml file saving settings.
|
/// Xml file saving settings.
|
||||||
|
@ -168,8 +168,8 @@ public:
|
|||||||
uint FinalSupersample();
|
uint FinalSupersample();
|
||||||
void FinalSupersample(uint i);
|
void FinalSupersample(uint i);
|
||||||
|
|
||||||
uint FinalStrips();
|
size_t FinalStrips();
|
||||||
void FinalStrips(uint i);
|
void FinalStrips(size_t i);
|
||||||
|
|
||||||
uint XmlTemporalSamples();
|
uint XmlTemporalSamples();
|
||||||
void XmlTemporalSamples(uint i);
|
void XmlTemporalSamples(uint i);
|
||||||
|
@ -101,7 +101,7 @@ void FractoriumEmberController<T>::AddXform()
|
|||||||
newXform.m_Weight = 0.25;
|
newXform.m_Weight = 0.25;
|
||||||
newXform.m_ColorX = m_Rand.Frand01<T>();
|
newXform.m_ColorX = m_Rand.Frand01<T>();
|
||||||
m_Ember.AddXform(newXform);
|
m_Ember.AddXform(newXform);
|
||||||
int index = m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1);//Set index to the last item before final.
|
int index = int(m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1));//Set index to the last item before final.
|
||||||
FillXforms(index);
|
FillXforms(index);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ void FractoriumEmberController<T>::AddLinkedXform()
|
|||||||
|
|
||||||
xform->SetXaos(count - 1, 1);//Set the xaos value for the previous xform pointing to the new one to one.
|
xform->SetXaos(count - 1, 1);//Set the xaos value for the previous xform pointing to the new one to one.
|
||||||
xform->m_Opacity = 0;//Clear the opacity of the previous xform.
|
xform->m_Opacity = 0;//Clear the opacity of the previous xform.
|
||||||
int index = m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1);//Set index to the last item before final.
|
int index = int(m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1));//Set index to the last item before final.
|
||||||
FillXforms(index);
|
FillXforms(index);
|
||||||
FillXaos();
|
FillXaos();
|
||||||
}, eXformUpdate::UPDATE_CURRENT);
|
}, eXformUpdate::UPDATE_CURRENT);
|
||||||
@ -178,7 +178,7 @@ void FractoriumEmberController<T>::DuplicateXform()
|
|||||||
for (auto& it : vec)
|
for (auto& it : vec)
|
||||||
m_Ember.AddXform(it);
|
m_Ember.AddXform(it);
|
||||||
|
|
||||||
int index = m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1);//Set index to the last item before final.
|
int index = int(m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1));//Set index to the last item before final.
|
||||||
FillXforms(index);//Handles xaos.
|
FillXforms(index);//Handles xaos.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -257,7 +257,7 @@ void FractoriumEmberController<T>::DeleteXforms()
|
|||||||
|
|
||||||
if (offset)
|
if (offset)
|
||||||
{
|
{
|
||||||
int index = m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1);//Set index to the last item before final. Note final is requeried one last time.
|
int index = int(m_Ember.TotalXformCount() - (m_Ember.UseFinalXform() ? 2 : 1));//Set index to the last item before final. Note final is requeried one last time.
|
||||||
FillXforms(index);
|
FillXforms(index);
|
||||||
UpdateRender();
|
UpdateRender();
|
||||||
}
|
}
|
||||||
@ -284,7 +284,7 @@ void FractoriumEmberController<T>::AddFinalXform()
|
|||||||
auto combo = m_Fractorium->ui.CurrentXformCombo;
|
auto combo = m_Fractorium->ui.CurrentXformCombo;
|
||||||
final.AddVariation(new LinearVariation<T>());//Just a placeholder so other parts of the code don't see it as being empty.
|
final.AddVariation(new LinearVariation<T>());//Just a placeholder so other parts of the code don't see it as being empty.
|
||||||
m_Ember.SetFinalXform(final);
|
m_Ember.SetFinalXform(final);
|
||||||
int index = m_Ember.TotalXformCount() - 1;//Set index to the last item.
|
int index = int(m_Ember.TotalXformCount() - 1);//Set index to the last item.
|
||||||
FillXforms(index);
|
FillXforms(index);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ void Fractorium::OnCurvesBlueRadioButtonToggled(bool checked) { if (checked) ui
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
QColor FractoriumEmberController<T>::ColorIndexToQColor(double d)
|
QColor FractoriumEmberController<T>::ColorIndexToQColor(double d)
|
||||||
{
|
{
|
||||||
v4T entry = m_Ember.m_Palette[Clamp<int>(d * COLORMAP_LENGTH_MINUS_1, 0, m_Ember.m_Palette.Size())];
|
v4T entry = m_Ember.m_Palette[Clamp<size_t>(d * COLORMAP_LENGTH_MINUS_1, 0, m_Ember.m_Palette.Size())];
|
||||||
entry.r *= 255;
|
entry.r *= 255;
|
||||||
entry.g *= 255;
|
entry.g *= 255;
|
||||||
entry.b *= 255;
|
entry.b *= 255;
|
||||||
@ -220,9 +220,9 @@ void FractoriumEmberController<T>::FillCurvesControl()
|
|||||||
{
|
{
|
||||||
m_Fractorium->ui.CurvesView->blockSignals(true);
|
m_Fractorium->ui.CurvesView->blockSignals(true);
|
||||||
|
|
||||||
for (size_t i = 0; i < 4; i++)
|
for (auto i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
for (size_t j = 1; j < 3; j++)//Only do middle points.
|
for (auto j = 1; j < 3; j++)//Only do middle points.
|
||||||
{
|
{
|
||||||
QPointF point(m_Ember.m_Curves.m_Points[i][j].x, m_Ember.m_Curves.m_Points[i][j].y);
|
QPointF point(m_Ember.m_Curves.m_Points[i][j].x, m_Ember.m_Curves.m_Points[i][j].y);
|
||||||
m_Fractorium->ui.CurvesView->Set(i, j, point);
|
m_Fractorium->ui.CurvesView->Set(i, j, point);
|
||||||
|
@ -255,13 +255,13 @@ void GLEmberController<T>::QueryMatrices(bool print)
|
|||||||
|
|
||||||
if (print)
|
if (print)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < 4; i++)
|
for (glm::length_t i = 0; i < 4; i++)
|
||||||
qDebug() << "Viewport[" << i << "] = " << m_Viewport[i] << "\n";
|
qDebug() << "Viewport[" << i << "] = " << m_Viewport[i] << "\n";
|
||||||
|
|
||||||
for (size_t i = 0; i < 16; i++)
|
for (glm::length_t i = 0; i < 16; i++)
|
||||||
qDebug() << "Modelview[" << i << "] = " << glm::value_ptr(m_Modelview)[i] << "\n";
|
qDebug() << "Modelview[" << i << "] = " << glm::value_ptr(m_Modelview)[i] << "\n";
|
||||||
|
|
||||||
for (size_t i = 0; i < 16; i++)
|
for (glm::length_t i = 0; i < 16; i++)
|
||||||
qDebug() << "Projection[" << i << "] = " << glm::value_ptr(m_Projection)[i] << "\n";
|
qDebug() << "Projection[" << i << "] = " << glm::value_ptr(m_Projection)[i] << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -995,7 +995,7 @@ int GLEmberController<T>::UpdateHover(v3T& glCoords)
|
|||||||
bool post = m_Fractorium->ui.PostAffineGroupBox->isChecked();
|
bool post = m_Fractorium->ui.PostAffineGroupBox->isChecked();
|
||||||
bool preAll = pre && m_Fractorium->DrawAllPre();
|
bool preAll = pre && m_Fractorium->DrawAllPre();
|
||||||
bool postAll = post && m_Fractorium->DrawAllPost();
|
bool postAll = post && m_Fractorium->DrawAllPost();
|
||||||
uint bestIndex = -1;
|
int bestIndex = -1;
|
||||||
T bestDist = 10;
|
T bestDist = 10;
|
||||||
auto ember = m_FractoriumEmberController->CurrentEmber();
|
auto ember = m_FractoriumEmberController->CurrentEmber();
|
||||||
m_HoverType = eHoverType::HoverNone;
|
m_HoverType = eHoverType::HoverNone;
|
||||||
@ -1012,12 +1012,12 @@ int GLEmberController<T>::UpdateHover(v3T& glCoords)
|
|||||||
if (CheckXformHover(m_SelectedXform, glCoords, bestDist, checkSelPre, checkSelPost))
|
if (CheckXformHover(m_SelectedXform, glCoords, bestDist, checkSelPre, checkSelPost))
|
||||||
{
|
{
|
||||||
m_HoverXform = m_SelectedXform;
|
m_HoverXform = m_SelectedXform;
|
||||||
bestIndex = ember->GetTotalXformIndex(m_SelectedXform);
|
bestIndex = int(ember->GetTotalXformIndex(m_SelectedXform));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check all xforms.
|
//Check all xforms.
|
||||||
for (size_t i = 0; i < ember->TotalXformCount(); i++)
|
for (int i = 0; i < int(ember->TotalXformCount()); i++)
|
||||||
{
|
{
|
||||||
auto xform = ember->GetTotalXform(i);
|
auto xform = ember->GetTotalXform(i);
|
||||||
|
|
||||||
@ -1186,7 +1186,8 @@ void GLEmberController<T>::CalcDragXAxis()
|
|||||||
|
|
||||||
if (GetShift())
|
if (GetShift())
|
||||||
{
|
{
|
||||||
v3T snapped = GetControl() ? SnapToNormalizedAngle(m_MouseWorldPos + m_DragHandleOffset, 24) : m_MouseWorldPos + m_DragHandleOffset;
|
auto posOffset = m_MouseWorldPos + m_DragHandleOffset;
|
||||||
|
v3T snapped = GetControl() ? SnapToNormalizedAngle(posOffset, 24u) : posOffset;
|
||||||
auto startDiff = (v2T(m_MouseDownWorldPos) * scale) - m_DragSrcTransform.O();
|
auto startDiff = (v2T(m_MouseDownWorldPos) * scale) - m_DragSrcTransform.O();
|
||||||
auto endDiff = (v2T(snapped) * scale) - m_DragSrcTransform.O();
|
auto endDiff = (v2T(snapped) * scale) - m_DragSrcTransform.O();
|
||||||
T startAngle = std::atan2(startDiff.y, startDiff.x);
|
T startAngle = std::atan2(startDiff.y, startDiff.x);
|
||||||
@ -1222,11 +1223,12 @@ void GLEmberController<T>::CalcDragXAxis()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
v3T diff;
|
v3T diff;
|
||||||
|
auto posOffset = m_MouseWorldPos + m_DragHandleOffset;
|
||||||
|
|
||||||
if (GetControl())
|
if (GetControl())
|
||||||
diff = SnapToGrid(m_MouseWorldPos + m_DragHandleOffset) - m_MouseDownWorldPos;
|
diff = SnapToGrid(posOffset) - m_MouseDownWorldPos;
|
||||||
else
|
else
|
||||||
diff = (m_MouseWorldPos + m_DragHandleOffset) - m_MouseDownWorldPos;
|
diff = posOffset - m_MouseDownWorldPos;
|
||||||
|
|
||||||
auto origXPlusOff = v3T(m_DragSrcTransform.X(), 0) + (diff * scale);
|
auto origXPlusOff = v3T(m_DragSrcTransform.X(), 0) + (diff * scale);
|
||||||
m_FractoriumEmberController->UpdateXform([&](Xform<T>* xform)
|
m_FractoriumEmberController->UpdateXform([&](Xform<T>* xform)
|
||||||
@ -1274,7 +1276,8 @@ void GLEmberController<T>::CalcDragYAxis()
|
|||||||
|
|
||||||
if (GetShift())
|
if (GetShift())
|
||||||
{
|
{
|
||||||
v3T snapped = GetControl() ? SnapToNormalizedAngle(m_MouseWorldPos + m_DragHandleOffset, 24) : m_MouseWorldPos + m_DragHandleOffset;
|
auto posOffset = m_MouseWorldPos + m_DragHandleOffset;
|
||||||
|
v3T snapped = GetControl() ? SnapToNormalizedAngle(posOffset, 24u) : posOffset;
|
||||||
auto startDiff = (v2T(m_MouseDownWorldPos) * scale) - m_DragSrcTransform.O();
|
auto startDiff = (v2T(m_MouseDownWorldPos) * scale) - m_DragSrcTransform.O();
|
||||||
auto endDiff = (v2T(snapped) * scale) - m_DragSrcTransform.O();
|
auto endDiff = (v2T(snapped) * scale) - m_DragSrcTransform.O();
|
||||||
T startAngle = std::atan2(startDiff.y, startDiff.x);
|
T startAngle = std::atan2(startDiff.y, startDiff.x);
|
||||||
@ -1310,11 +1313,12 @@ void GLEmberController<T>::CalcDragYAxis()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
v3T diff;
|
v3T diff;
|
||||||
|
auto posOffset = m_MouseWorldPos + m_DragHandleOffset;
|
||||||
|
|
||||||
if (GetControl())
|
if (GetControl())
|
||||||
diff = SnapToGrid(m_MouseWorldPos + m_DragHandleOffset) - m_MouseDownWorldPos;
|
diff = SnapToGrid(posOffset) - m_MouseDownWorldPos;
|
||||||
else
|
else
|
||||||
diff = (m_MouseWorldPos + m_DragHandleOffset) - m_MouseDownWorldPos;
|
diff = posOffset - m_MouseDownWorldPos;
|
||||||
|
|
||||||
auto origXPlusOff = v3T(m_DragSrcTransform.Y(), 0) + (diff * scale);
|
auto origXPlusOff = v3T(m_DragSrcTransform.Y(), 0) + (diff * scale);
|
||||||
m_FractoriumEmberController->UpdateXform([&](Xform<T>* xform)
|
m_FractoriumEmberController->UpdateXform([&](Xform<T>* xform)
|
||||||
|
@ -43,6 +43,8 @@ void SpinBox::SetValueStealth(int d)
|
|||||||
blockSignals(false);
|
blockSignals(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SpinBox::SetValueStealth(size_t d) { SetValueStealth(int(d)); }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set whether to respond to double click events.
|
/// Set whether to respond to double click events.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -19,6 +19,7 @@ public:
|
|||||||
explicit SpinBox(QWidget* p = 0, int height = 16, int step = 1);
|
explicit SpinBox(QWidget* p = 0, int height = 16, int step = 1);
|
||||||
virtual ~SpinBox() { }
|
virtual ~SpinBox() { }
|
||||||
void SetValueStealth(int d);
|
void SetValueStealth(int d);
|
||||||
|
void SetValueStealth(size_t d);
|
||||||
void DoubleClick(bool b);
|
void DoubleClick(bool b);
|
||||||
void DoubleClickZero(int val);
|
void DoubleClickZero(int val);
|
||||||
void DoubleClickNonZero(int val);
|
void DoubleClickNonZero(int val);
|
||||||
|
@ -127,10 +127,10 @@ void FractoriumVariationsDialog::OnSelectNoneButtonClicked(bool checked)
|
|||||||
void FractoriumVariationsDialog::Populate()
|
void FractoriumVariationsDialog::Populate()
|
||||||
{
|
{
|
||||||
auto table = ui.VariationsTable;
|
auto table = ui.VariationsTable;
|
||||||
auto size = std::max<size_t>(std::max<size_t>(m_VariationList.RegSize(), m_VariationList.PreSize()), m_VariationList.PostSize());
|
int size = int(std::max<size_t>(std::max<size_t>(m_VariationList.RegSize(), m_VariationList.PreSize()), m_VariationList.PostSize()));
|
||||||
table->setRowCount(size);
|
table->setRowCount(size);
|
||||||
|
|
||||||
for (size_t i = 0; i < size; i++)
|
for (auto i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
if (auto pre = m_VariationList.GetVariation(i, eVariationType::VARTYPE_PRE))
|
if (auto pre = m_VariationList.GetVariation(i, eVariationType::VARTYPE_PRE))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user