mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 05:00:06 -05:00
--Code changes
-Modernize some C++ code.
This commit is contained in:
parent
8086cfa731
commit
a726b99dea
@ -58,12 +58,12 @@ public:
|
||||
template <typename U>
|
||||
Affine2D<T>& operator = (const Affine2D<U>& affine)
|
||||
{
|
||||
A(T(affine.A()));
|
||||
B(T(affine.B()));
|
||||
C(T(affine.C()));
|
||||
D(T(affine.D()));
|
||||
E(T(affine.E()));
|
||||
F(T(affine.F()));
|
||||
A(static_cast<T>(affine.A()));
|
||||
B(static_cast<T>(affine.B()));
|
||||
C(static_cast<T>(affine.C()));
|
||||
D(static_cast<T>(affine.D()));
|
||||
E(static_cast<T>(affine.E()));
|
||||
F(static_cast<T>(affine.F()));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -107,45 +107,45 @@ public:
|
||||
m_FinalRasH = ember.m_FinalRasH;
|
||||
m_OrigFinalRasW = ember.m_OrigFinalRasW;
|
||||
m_OrigFinalRasH = ember.m_OrigFinalRasH;
|
||||
m_OrigPixPerUnit = T(ember.m_OrigPixPerUnit);
|
||||
m_RandPointRange = T(ember.m_RandPointRange);
|
||||
m_OrigPixPerUnit = static_cast<T>(ember.m_OrigPixPerUnit);
|
||||
m_RandPointRange = static_cast<T>(ember.m_RandPointRange);
|
||||
m_SubBatchSize = ember.m_SubBatchSize;
|
||||
m_FuseCount = ember.m_FuseCount;
|
||||
m_Supersample = ember.m_Supersample;
|
||||
m_TemporalSamples = ember.m_TemporalSamples;
|
||||
m_Symmetry = ember.m_Symmetry;
|
||||
m_Quality = T(ember.m_Quality);
|
||||
m_PixelsPerUnit = T(ember.m_PixelsPerUnit);
|
||||
m_Zoom = T(ember.m_Zoom);
|
||||
m_CamZPos = T(ember.m_CamZPos);
|
||||
m_CamPerspective = T(ember.m_CamPerspective);
|
||||
m_CamYaw = T(ember.m_CamYaw);
|
||||
m_CamPitch = T(ember.m_CamPitch);
|
||||
m_CamDepthBlur = T(ember.m_CamDepthBlur);
|
||||
m_BlurCurve = T(ember.m_BlurCurve);
|
||||
m_Quality = static_cast<T>(ember.m_Quality);
|
||||
m_PixelsPerUnit = static_cast<T>(ember.m_PixelsPerUnit);
|
||||
m_Zoom = static_cast<T>(ember.m_Zoom);
|
||||
m_CamZPos = static_cast<T>(ember.m_CamZPos);
|
||||
m_CamPerspective = static_cast<T>(ember.m_CamPerspective);
|
||||
m_CamYaw = static_cast<T>(ember.m_CamYaw);
|
||||
m_CamPitch = static_cast<T>(ember.m_CamPitch);
|
||||
m_CamDepthBlur = static_cast<T>(ember.m_CamDepthBlur);
|
||||
m_BlurCurve = static_cast<T>(ember.m_BlurCurve);
|
||||
m_CamMat = ember.m_CamMat;
|
||||
m_CenterX = T(ember.m_CenterX);
|
||||
m_CenterY = T(ember.m_CenterY);
|
||||
m_RotCenterY = T(ember.m_RotCenterY);
|
||||
m_Rotate = T(ember.m_Rotate);
|
||||
m_Brightness = T(ember.m_Brightness);
|
||||
m_Gamma = T(ember.m_Gamma);
|
||||
m_Vibrancy = T(ember.m_Vibrancy);
|
||||
m_GammaThresh = T(ember.m_GammaThresh);
|
||||
m_HighlightPower = T(ember.m_HighlightPower);
|
||||
m_K2 = T(ember.m_K2);
|
||||
m_Time = T(ember.m_Time);
|
||||
m_CenterX = static_cast<T>(ember.m_CenterX);
|
||||
m_CenterY = static_cast<T>(ember.m_CenterY);
|
||||
m_RotCenterY = static_cast<T>(ember.m_RotCenterY);
|
||||
m_Rotate = static_cast<T>(ember.m_Rotate);
|
||||
m_Brightness = static_cast<T>(ember.m_Brightness);
|
||||
m_Gamma = static_cast<T>(ember.m_Gamma);
|
||||
m_Vibrancy = static_cast<T>(ember.m_Vibrancy);
|
||||
m_GammaThresh = static_cast<T>(ember.m_GammaThresh);
|
||||
m_HighlightPower = static_cast<T>(ember.m_HighlightPower);
|
||||
m_K2 = static_cast<T>(ember.m_K2);
|
||||
m_Time = static_cast<T>(ember.m_Time);
|
||||
m_Background = ember.m_Background;
|
||||
m_Interp = ember.m_Interp;
|
||||
m_AffineInterp = ember.m_AffineInterp;
|
||||
m_MinRadDE = T(ember.m_MinRadDE);
|
||||
m_MaxRadDE = T(ember.m_MaxRadDE);
|
||||
m_CurveDE = T(ember.m_CurveDE);
|
||||
m_MinRadDE = static_cast<T>(ember.m_MinRadDE);
|
||||
m_MaxRadDE = static_cast<T>(ember.m_MaxRadDE);
|
||||
m_CurveDE = static_cast<T>(ember.m_CurveDE);
|
||||
m_SpatialFilterType = ember.m_SpatialFilterType;
|
||||
m_SpatialFilterRadius = T(ember.m_SpatialFilterRadius);
|
||||
m_SpatialFilterRadius = static_cast<T>(ember.m_SpatialFilterRadius);
|
||||
m_TemporalFilterType = ember.m_TemporalFilterType;
|
||||
m_TemporalFilterExp = T(ember.m_TemporalFilterExp);
|
||||
m_TemporalFilterWidth = T(ember.m_TemporalFilterWidth);
|
||||
m_TemporalFilterExp = static_cast<T>(ember.m_TemporalFilterExp);
|
||||
m_TemporalFilterWidth = static_cast<T>(ember.m_TemporalFilterWidth);
|
||||
m_PaletteMode = ember.m_PaletteMode;
|
||||
m_PaletteInterp = ember.m_PaletteInterp;
|
||||
m_Name = ember.m_Name;
|
||||
@ -223,7 +223,7 @@ public:
|
||||
for (size_t i = 0; i < count; i++)
|
||||
{
|
||||
Xform<T> xform;
|
||||
xform.m_ColorX = T((oldsize + i) & 1);
|
||||
xform.m_ColorX = static_cast<T>((oldsize + i) & 1);
|
||||
xform.AddVariation(m_VariationList->GetVariationCopy(eVariationId::VAR_LINEAR));
|
||||
AddXform(xform);
|
||||
}
|
||||
@ -381,7 +381,7 @@ public:
|
||||
|
||||
for (size_t i = 0; i < m_Xforms.size(); i++)
|
||||
if (GetXform(i) == xform)
|
||||
return intmax_t(i);
|
||||
return static_cast<intmax_t>(i);
|
||||
|
||||
return index;
|
||||
}
|
||||
@ -394,11 +394,11 @@ public:
|
||||
/// <returns>The index of the matched xform if found, else -1.</returns>
|
||||
intmax_t GetTotalXformIndex(const Xform<T>* xform, bool forceFinal = false) const
|
||||
{
|
||||
size_t totalXformCount = TotalXformCount(forceFinal);
|
||||
const auto totalXformCount = TotalXformCount(forceFinal);
|
||||
|
||||
for (size_t i = 0; i < totalXformCount; i++)
|
||||
if (GetTotalXform(i, forceFinal) == xform)
|
||||
return intmax_t(i);
|
||||
return static_cast<intmax_t>(i);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -483,16 +483,16 @@ public:
|
||||
m_CamMat[1][2] = std::sin(m_CamPitch) * std::cos(-m_CamYaw);
|
||||
m_CamMat[2][2] = std::cos(m_CamPitch);
|
||||
|
||||
if (projBits & et(eProjBits::PROJBITS_BLUR))
|
||||
if (projBits & static_cast<et>(eProjBits::PROJBITS_BLUR))
|
||||
{
|
||||
if (projBits & et(eProjBits::PROJBITS_YAW))
|
||||
if (projBits & static_cast<et>(eProjBits::PROJBITS_YAW))
|
||||
m_ProjFunc = &EmberNs::Ember<T>::ProjectPitchYawDepthBlur;
|
||||
else
|
||||
m_ProjFunc = &EmberNs::Ember<T>::ProjectPitchDepthBlur;
|
||||
}
|
||||
else if ((projBits & et(eProjBits::PROJBITS_PITCH)) || (projBits & et(eProjBits::PROJBITS_YAW)))
|
||||
else if ((projBits & static_cast<et>(eProjBits::PROJBITS_PITCH)) || (projBits & static_cast<et>(eProjBits::PROJBITS_YAW)))
|
||||
{
|
||||
if (projBits & et(eProjBits::PROJBITS_YAW))
|
||||
if (projBits & static_cast<et>(eProjBits::PROJBITS_YAW))
|
||||
m_ProjFunc = &EmberNs::Ember<T>::ProjectPitchYaw;
|
||||
else
|
||||
m_ProjFunc = &EmberNs::Ember<T>::ProjectPitch;
|
||||
@ -503,7 +503,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
m_BlurCoef = T(0.1) * m_CamDepthBlur;
|
||||
m_BlurCoef = static_cast<T>(0.1) * m_CamDepthBlur;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -540,9 +540,9 @@ public:
|
||||
if ((onlyScaleIfNewIsSmaller && (width < m_OrigFinalRasW || height < m_OrigFinalRasH)) || !onlyScaleIfNewIsSmaller)
|
||||
{
|
||||
if (scaleType == eScaleType::SCALE_WIDTH)
|
||||
m_PixelsPerUnit = m_OrigPixPerUnit * (T(width) / T(m_OrigFinalRasW));
|
||||
m_PixelsPerUnit = m_OrigPixPerUnit * (static_cast<T>(width) / static_cast<T>(m_OrigFinalRasW));
|
||||
else if (scaleType == eScaleType::SCALE_HEIGHT)
|
||||
m_PixelsPerUnit = m_OrigPixPerUnit * (T(height) / T(m_OrigFinalRasH));
|
||||
m_PixelsPerUnit = m_OrigPixPerUnit * (static_cast<T>(height) / static_cast<T> (m_OrigFinalRasH));
|
||||
else
|
||||
m_PixelsPerUnit = m_OrigPixPerUnit;
|
||||
}
|
||||
@ -577,7 +577,7 @@ public:
|
||||
/// </summary>
|
||||
void EqualizeWeights()
|
||||
{
|
||||
T weight = T(1) / m_Xforms.size();
|
||||
T weight = static_cast<T>(1) / m_Xforms.size();
|
||||
|
||||
for (auto& xform : m_Xforms) xform.m_Weight = weight;
|
||||
}
|
||||
@ -648,9 +648,9 @@ public:
|
||||
{
|
||||
size_t count = 0, i = 0, j = 0;
|
||||
|
||||
while (auto xform = GetTotalXform(i++))
|
||||
while (const auto xform = GetTotalXform(i++))
|
||||
for (j = 0; j < xform->TotalVariationCount(); j++)
|
||||
if (auto var = xform->GetVariation(j))
|
||||
if (const auto var = xform->GetVariation(j))
|
||||
count += var->StateParamCount();
|
||||
|
||||
return count;
|
||||
@ -735,9 +735,9 @@ public:
|
||||
Palette<float>::RgbToHsv(glm::value_ptr(embers[k].m_Palette[i]), t);
|
||||
|
||||
for (size_t j = 0; j < 3; j++)
|
||||
s[j] += float(coefs[k]) * t[j];
|
||||
s[j] += static_cast<float>(coefs[k]) * t[j];
|
||||
|
||||
s[3] += float(coefs[k]) * embers[k].m_Palette[i][3];
|
||||
s[3] += static_cast<float>(coefs[k]) * embers[k].m_Palette[i][3];
|
||||
}
|
||||
|
||||
Palette<float>::HsvToRgb(s, glm::value_ptr(m_Palette[i]));
|
||||
@ -1165,15 +1165,15 @@ public:
|
||||
{
|
||||
size_t val = 0;
|
||||
|
||||
if (m_CamZPos != 0) val |= et(eProjBits::PROJBITS_ZPOS);
|
||||
if (m_CamZPos != 0) val |= static_cast<et>(eProjBits::PROJBITS_ZPOS);
|
||||
|
||||
if (m_CamPerspective != 0) val |= et(eProjBits::PROJBITS_PERSP);
|
||||
if (m_CamPerspective != 0) val |= static_cast<et>(eProjBits::PROJBITS_PERSP);
|
||||
|
||||
if (m_CamPitch != 0) val |= et(eProjBits::PROJBITS_PITCH);
|
||||
if (m_CamPitch != 0) val |= static_cast<et>(eProjBits::PROJBITS_PITCH);
|
||||
|
||||
if (m_CamYaw != 0) val |= et(eProjBits::PROJBITS_YAW);
|
||||
if (m_CamYaw != 0) val |= static_cast<et>(eProjBits::PROJBITS_YAW);
|
||||
|
||||
if (m_CamDepthBlur != 0) val |= et(eProjBits::PROJBITS_BLUR);
|
||||
if (m_CamDepthBlur != 0) val |= static_cast<et>(eProjBits::PROJBITS_BLUR);
|
||||
|
||||
return val;
|
||||
}
|
||||
@ -1240,11 +1240,11 @@ public:
|
||||
z = m_CamMat[1][2] * point.m_Y + m_CamMat[2][2] * z;
|
||||
zr = Zeps(1 - m_CamPerspective * z);
|
||||
sincos(t, &dsin, &dcos);
|
||||
T prcx = point.m_X / ctr.CachedCarHalfX();
|
||||
T prcy = y / ctr.CachedCarHalfY();
|
||||
T dist = VarFuncs<T>::Hypot(prcx, prcy) * 10;
|
||||
T scale = m_BlurCurve ? (Sqr(dist) / (4 * m_BlurCurve)) : T(1);
|
||||
T dr = rand.Frand01<T>() * (m_BlurCoef * scale) * z;
|
||||
const T prcx = point.m_X / ctr.CachedCarHalfX();
|
||||
const T prcy = y / ctr.CachedCarHalfY();
|
||||
const T dist = VarFuncs<T>::Hypot(prcx, prcy) * 10;
|
||||
const T scale = m_BlurCurve ? (Sqr(dist) / (4 * m_BlurCurve)) : static_cast<T>(1);
|
||||
const T dr = rand.Frand01<T>() * (m_BlurCoef * scale) * z;
|
||||
point.m_X = (point.m_X + dr * dcos) / zr;
|
||||
point.m_Y = (y + dr * dsin) / zr;
|
||||
point.m_Z -= m_CamZPos;
|
||||
@ -1258,17 +1258,17 @@ public:
|
||||
void ProjectPitchYawDepthBlur(Point<T>& point, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand, const CarToRas<T>& ctr)
|
||||
{
|
||||
T dsin, dcos;
|
||||
T t = rand.Frand01<T>() * M_2PI;
|
||||
const T t = rand.Frand01<T>() * M_2PI;
|
||||
T z = point.m_Z - m_CamZPos;
|
||||
T x = m_CamMat[0][0] * point.m_X + m_CamMat[1][0] * point.m_Y;
|
||||
T y = m_CamMat[0][1] * point.m_X + m_CamMat[1][1] * point.m_Y + m_CamMat[2][1] * z;
|
||||
const T x = m_CamMat[0][0] * point.m_X + m_CamMat[1][0] * point.m_Y;
|
||||
const T y = m_CamMat[0][1] * point.m_X + m_CamMat[1][1] * point.m_Y + m_CamMat[2][1] * z;
|
||||
z = m_CamMat[0][2] * point.m_X + m_CamMat[1][2] * point.m_Y + m_CamMat[2][2] * z;
|
||||
T zr = Zeps(1 - m_CamPerspective * z);
|
||||
T prcx = x / ctr.CachedCarHalfX();
|
||||
T prcy = y / ctr.CachedCarHalfY();
|
||||
T dist = VarFuncs<T>::Hypot(prcx, prcy) * 10;
|
||||
T scale = m_BlurCurve ? (Sqr(dist) / (4 * m_BlurCurve)) : T(1);
|
||||
T dr = rand.Frand01<T>() * (m_BlurCoef * scale) * z;
|
||||
const T zr = Zeps(1 - m_CamPerspective * z);
|
||||
const T prcx = x / ctr.CachedCarHalfX();
|
||||
const T prcy = y / ctr.CachedCarHalfY();
|
||||
const T dist = VarFuncs<T>::Hypot(prcx, prcy) * 10;
|
||||
const T scale = m_BlurCurve ? (Sqr(dist) / (4 * m_BlurCurve)) : static_cast<T>(1);
|
||||
const T dr = rand.Frand01<T>() * (m_BlurCoef * scale) * z;
|
||||
sincos(t, &dsin, &dcos);
|
||||
point.m_X = (x + dr * dcos) / zr;
|
||||
point.m_Y = (y + dr * dsin) / zr;
|
||||
@ -1282,10 +1282,10 @@ public:
|
||||
/// <param name="rand">Ignored</param>
|
||||
void ProjectPitchYaw(Point<T>& point, QTIsaac<ISAAC_SIZE, ISAAC_INT>& rand, const CarToRas<T>& ctr)
|
||||
{
|
||||
T z = point.m_Z - m_CamZPos;
|
||||
T x = m_CamMat[0][0] * point.m_X + m_CamMat[1][0] * point.m_Y;
|
||||
T y = m_CamMat[0][1] * point.m_X + m_CamMat[1][1] * point.m_Y + m_CamMat[2][1] * z;
|
||||
T zr = Zeps(1 - m_CamPerspective * (m_CamMat[0][2] * point.m_X + m_CamMat[1][2] * point.m_Y + m_CamMat[2][2] * z));
|
||||
const T z = point.m_Z - m_CamZPos;
|
||||
const T x = m_CamMat[0][0] * point.m_X + m_CamMat[1][0] * point.m_Y;
|
||||
const T y = m_CamMat[0][1] * point.m_X + m_CamMat[1][1] * point.m_Y + m_CamMat[2][1] * z;
|
||||
const T zr = Zeps(1 - m_CamPerspective * (m_CamMat[0][2] * point.m_X + m_CamMat[1][2] * point.m_Y + m_CamMat[2][2] * z));
|
||||
point.m_X = x / zr;
|
||||
point.m_Y = y / zr;
|
||||
point.m_Z -= m_CamZPos;
|
||||
@ -1428,7 +1428,7 @@ public:
|
||||
m_FinalRasW = 100;
|
||||
m_FinalRasH = 100;
|
||||
m_Supersample = 1;
|
||||
m_SpatialFilterRadius = T(0.5);
|
||||
m_SpatialFilterRadius = static_cast<T>(0.5);
|
||||
m_Zoom = 0;
|
||||
m_ProjFunc = &EmberNs::Ember<T>::ProjectNone;
|
||||
m_CamZPos = 0;
|
||||
@ -1443,10 +1443,10 @@ public:
|
||||
m_SubBatchSize = 10240;
|
||||
m_RandPointRange = 1;
|
||||
m_FuseCount = 15;
|
||||
m_MaxRadDE = T(9.0);
|
||||
m_MaxRadDE = static_cast<T>(9.0);
|
||||
m_MinRadDE = 0;
|
||||
m_CurveDE = T(0.4);
|
||||
m_GammaThresh = T(0.01);
|
||||
m_CurveDE = static_cast<T>(0.4);
|
||||
m_GammaThresh = static_cast<T>(0.01);
|
||||
m_TemporalSamples = 100;
|
||||
m_SpatialFilterType = eSpatialFilterType::GAUSSIAN_SPATIAL_FILTER;
|
||||
m_AffineInterp = eAffineInterp::AFFINE_INTERP_LOG;
|
||||
@ -1702,7 +1702,7 @@ public:
|
||||
|
||||
//Gamma threshold used in gamma correction during final accumulation.
|
||||
//Xml field: "gamma_threshold".
|
||||
T m_GammaThresh = T(0.01);
|
||||
T m_GammaThresh = static_cast<T>(0.01);
|
||||
|
||||
//Value to control saturation of some pixels in gamma correction during final accumulation.
|
||||
//Xml field: "highlight_power".
|
||||
@ -1760,13 +1760,13 @@ public:
|
||||
|
||||
//The shape of the curve that governs how quickly or slowly the filter drops off as it moves away from the center point.
|
||||
//Xml field: "estimator_curve".
|
||||
T m_CurveDE = T(0.4);
|
||||
T m_CurveDE = static_cast<T>(0.4);
|
||||
|
||||
//Spatial Filter.
|
||||
|
||||
//The radius of the spatial filter used in final accumulation.
|
||||
//Xml field: "filter".
|
||||
T m_SpatialFilterRadius = T(0.5);
|
||||
T m_SpatialFilterRadius = static_cast<T>(0.5);
|
||||
|
||||
//The type of spatial filter used in final accumulation:
|
||||
//Gaussian, Hermite, Box, Triangle, Bell, Bspline, Lanczos3
|
||||
@ -1871,7 +1871,7 @@ private:
|
||||
for (size_t k = 0; k < size; k++)
|
||||
t += coefs[k] * embers[k].*m;
|
||||
|
||||
this->*m = size_t(std::rint(t));
|
||||
this->*m = static_cast<size_t>(std::rint(t));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -1886,7 +1886,7 @@ private:
|
||||
template <T Xform<T>::*m>
|
||||
void InterpXform(Xform<T>* xform, size_t i, const Ember<T>* embers, const vector<T>& coefs, size_t size)
|
||||
{
|
||||
xform->*m = T(0);
|
||||
xform->*m = static_cast<T>(0);
|
||||
|
||||
for (size_t k = 0; k < size; k++)
|
||||
xform->*m += coefs[k] * embers[k].GetTotalXform(i)->*m;
|
||||
|
@ -132,8 +132,8 @@ public:
|
||||
{
|
||||
CopyCont(m_MotionParams, other.m_MotionParams);
|
||||
m_MotionFunc = other.m_MotionFunc;
|
||||
m_MotionFreq = T(other.m_MotionFreq);
|
||||
m_MotionOffset = T(other.m_MotionOffset);
|
||||
m_MotionFreq = static_cast<T>(other.m_MotionFreq);
|
||||
m_MotionOffset = static_cast<T>(other.m_MotionOffset);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ public:
|
||||
#ifdef ISAAC_FLAM3_DEBUG
|
||||
return (Rand() & 0xfffffff) / (floatType)0xfffffff;
|
||||
#else
|
||||
return Frand<floatType>(floatType(0), floatType(1));
|
||||
return Frand<floatType>(static_cast<floatType>(0), static_cast<floatType>(1));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -397,7 +397,7 @@ public:
|
||||
/// <returns>A vector holding the color values</returns>
|
||||
vector<byte> MakeRgbPaletteBlock(size_t height)
|
||||
{
|
||||
size_t width = Size();
|
||||
const auto width = Size();
|
||||
vector<byte> v(height * width * 3);
|
||||
|
||||
if (v.size() == (height * Size() * 3))
|
||||
@ -406,9 +406,9 @@ public:
|
||||
{
|
||||
for (size_t j = 0; j < width; j++)
|
||||
{
|
||||
v[(width * 3 * i) + (j * 3)] = byte(m_Entries[j][0] * T(255));//Palettes are as [0..1], so convert to [0..255] here since it's for GUI display.
|
||||
v[(width * 3 * i) + (j * 3) + 1] = byte(m_Entries[j][1] * T(255));
|
||||
v[(width * 3 * i) + (j * 3) + 2] = byte(m_Entries[j][2] * T(255));
|
||||
v[(width * 3 * i) + (j * 3)] = static_cast<byte>(m_Entries[j][0] * T(255));//Palettes are as [0..1], so convert to [0..255] here since it's for GUI display.
|
||||
v[(width * 3 * i) + (j * 3) + 1] = static_cast<byte>(m_Entries[j][1] * T(255));
|
||||
v[(width * 3 * i) + (j * 3) + 2] = static_cast<byte>(m_Entries[j][2] * T(255));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -148,22 +148,22 @@ public:
|
||||
{
|
||||
m_Affine = xform.m_Affine;
|
||||
m_Post = xform.m_Post;
|
||||
m_Weight = T(xform.m_Weight);
|
||||
m_ColorX = T(xform.m_ColorX);
|
||||
m_ColorY = T(xform.m_ColorY);
|
||||
m_DirectColor = T(xform.m_DirectColor);
|
||||
m_ColorSpeed = T(xform.m_ColorSpeed);
|
||||
m_Animate = T(xform.m_Animate);
|
||||
m_Opacity = T(xform.m_Opacity);
|
||||
m_Weight = static_cast<T>(xform.m_Weight);
|
||||
m_ColorX = static_cast<T>(xform.m_ColorX);
|
||||
m_ColorY = static_cast<T>(xform.m_ColorY);
|
||||
m_DirectColor = static_cast<T>(xform.m_DirectColor);
|
||||
m_ColorSpeed = static_cast<T>(xform.m_ColorSpeed);
|
||||
m_Animate = static_cast<T>(xform.m_Animate);
|
||||
m_Opacity = static_cast<T>(xform.m_Opacity);
|
||||
CacheColorVals();
|
||||
m_HasPre = xform.HasPre();
|
||||
m_HasPost = xform.HasPost();
|
||||
m_HasPreOrRegularVars = xform.PreVariationCount() > 0 || xform.VariationCount() > 0;
|
||||
m_Wind[0] = T(xform.m_Wind[0]);
|
||||
m_Wind[1] = T(xform.m_Wind[1]);
|
||||
m_MotionFreq = T(xform.m_MotionFreq);
|
||||
m_Wind[0] = static_cast<T>(xform.m_Wind[0]);
|
||||
m_Wind[1] = static_cast<T>(xform.m_Wind[1]);
|
||||
m_MotionFreq = static_cast<T>(xform.m_MotionFreq);
|
||||
m_MotionFunc = xform.m_MotionFunc;
|
||||
m_MotionOffset = T(xform.m_MotionOffset);
|
||||
m_MotionOffset = static_cast<T>(xform.m_MotionOffset);
|
||||
ClearAndDeleteVariations();
|
||||
|
||||
//Must manually add them via the AddVariation() function so that
|
||||
@ -207,9 +207,9 @@ public:
|
||||
if (useDefaults)
|
||||
{
|
||||
m_Weight = 0;
|
||||
m_ColorSpeed = T(0.5);
|
||||
m_ColorSpeed = static_cast<T>(0.5);
|
||||
m_Animate = 1;
|
||||
m_ColorX = T(count & 1);
|
||||
m_ColorX = static_cast<T>(count & 1);
|
||||
m_ColorY = 0;
|
||||
m_DirectColor = 1;
|
||||
m_Opacity = 1;
|
||||
@ -562,7 +562,7 @@ public:
|
||||
//m_ColorSpeedCache = m_ColorX * (1 - m_ColorSpeed) / 2;//Apo style.
|
||||
//m_OneMinusColorCache = (1 + m_ColorSpeed) / 2;
|
||||
m_ColorSpeedCache = m_ColorSpeed * m_ColorX;//Flam3 style.
|
||||
m_OneMinusColorCache = T(1.0) - m_ColorSpeed;
|
||||
m_OneMinusColorCache = static_cast<T>(1) - m_ColorSpeed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -232,7 +232,7 @@ void GLWidget::DrawQuad()
|
||||
//Only draw if the dimensions match exactly.
|
||||
if (m_TexWidth == m_Fractorium->m_Controller->FinalRasW() &&
|
||||
m_TexHeight == m_Fractorium->m_Controller->FinalRasH() &&
|
||||
((m_TexWidth * m_TexHeight) == GLint(finalImage->size())))
|
||||
((m_TexWidth * m_TexHeight) == static_cast<GLint>(finalImage->size())))
|
||||
{
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
@ -284,7 +284,7 @@ void GLWidget::DrawQuad()
|
||||
|
||||
if (finalImage &&//Make absolutely sure all image dimensions match when copying host side buffer to GL texture.
|
||||
!finalImage->empty() &&
|
||||
((m_TexWidth * m_TexHeight) == GLint(finalImage->size())) &&
|
||||
((m_TexWidth * m_TexHeight) == static_cast<GLint>(finalImage->size())) &&
|
||||
(finalImage->size() == renderer->FinalDimensions()))
|
||||
this->glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_TexWidth, m_TexHeight, GL_RGBA, GL_FLOAT, finalImage->data());
|
||||
}
|
||||
@ -1243,8 +1243,8 @@ bool GLWidget::Allocate(bool force)
|
||||
|
||||
if (doIt)
|
||||
{
|
||||
m_TexWidth = GLint(w);
|
||||
m_TexHeight = GLint(h);
|
||||
m_TexWidth = static_cast<GLint>(w);
|
||||
m_TexHeight = static_cast<GLint>(h);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
|
||||
@ -1275,8 +1275,8 @@ bool GLWidget::Allocate(bool force)
|
||||
|
||||
if (doIt)
|
||||
{
|
||||
m_TexWidth = GLint(w);
|
||||
m_TexHeight = GLint(h);
|
||||
m_TexWidth = static_cast<GLint>(w);
|
||||
m_TexHeight = static_cast<GLint>(h);
|
||||
this->glEnable(GL_TEXTURE_2D);
|
||||
|
||||
if (doResize)
|
||||
@ -1335,7 +1335,7 @@ void GLWidget::SetViewport()
|
||||
{
|
||||
if (m_Init && (m_ViewWidth != m_TexWidth || m_ViewHeight != m_TexHeight))
|
||||
{
|
||||
this->glViewport(0, 0, GLint(m_TexWidth), GLint(m_TexHeight));
|
||||
this->glViewport(0, 0, static_cast<GLint>(m_TexWidth), static_cast<GLint>(m_TexHeight));
|
||||
#ifdef USE_GLSL
|
||||
m_Viewport = glm::ivec4(0, 0, m_TexWidth, m_TexHeight);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user