mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-01 13:56:06 -04:00
More Linux work. This has Render, Animate and Genome building and running on Linux.
This commit is contained in:
@ -166,7 +166,7 @@ void Affine2D<T>::Rotate(T angle)
|
||||
{
|
||||
m4T origMat4 = ToMat4ColMajor(true);//Must center and use column major for glm to work.
|
||||
m4T newMat4 = glm::rotate(origMat4, angle * DEG_2_RAD_T, v3T(0, 0, 1));//Assuming only rotating around z.
|
||||
|
||||
|
||||
A(newMat4[0][0]);//Use direct assignments instead of constructor to skip assigning C and F.
|
||||
B(newMat4[0][1]);
|
||||
D(newMat4[1][0]);
|
||||
@ -357,4 +357,13 @@ void Affine2D<T>::CalcRSAC(const v2T& from, const v2T& to, T& a, T& c)
|
||||
a = (from.y * to.y + from.x * to.x) / lsq;
|
||||
c = (from.x * to.y - from.y * to.x) / lsq;
|
||||
}
|
||||
}
|
||||
|
||||
//This class had to be implemented in a cpp file because the compiler was breaking.
|
||||
//So the explicit instantiation must be declared here rather than in Ember.cpp where
|
||||
//all of the other classes are done.
|
||||
template EMBER_API class Affine2D<float>;
|
||||
|
||||
#ifdef DO_DOUBLE
|
||||
template EMBER_API class Affine2D<double>;
|
||||
#endif
|
||||
}
|
||||
|
@ -117,9 +117,9 @@ public:
|
||||
//This class had to be implemented in a cpp file because the compiler was breaking.
|
||||
//So the explicit instantiation must be declared here rather than in Ember.cpp where
|
||||
//all of the other classes are done.
|
||||
template EMBER_API class Affine2D<float>;
|
||||
//template EMBER_API class Affine2D<float>;
|
||||
|
||||
#ifdef DO_DOUBLE
|
||||
template EMBER_API class Affine2D<double>;
|
||||
#endif
|
||||
}
|
||||
//#ifdef DO_DOUBLE
|
||||
// template EMBER_API class Affine2D<double>;
|
||||
//#endif
|
||||
}
|
||||
|
@ -20,22 +20,28 @@
|
||||
#define _stricmp strcmp
|
||||
#define sscanf_s sscanf
|
||||
#define sprintf_s snprintf
|
||||
#define snprintf_s snprintf
|
||||
typedef int errno_t;
|
||||
#endif
|
||||
|
||||
#define RESTRICT __restrict//This might make things faster, unsure if it really does though.
|
||||
//#define RESTRICT
|
||||
|
||||
namespace EmberNs
|
||||
{
|
||||
//Wrap the sincos function for Macs and PC.
|
||||
#if defined(__APPLE__) || defined(_MSC_VER)
|
||||
#define sincos(x, s, c) *(s)=sin(x); *(c)=cos(x);
|
||||
#else
|
||||
extern void sincos(double x, double *s, double *c);
|
||||
extern void sincos(float x, float *s, float *c);
|
||||
//extern void sincos(double x, double *s, double *c);
|
||||
//extern void sincos(float x, float *s, float *c);
|
||||
static void sincos(float x, float* s, float* c)
|
||||
{
|
||||
*s = sin(x);
|
||||
*c = cos(x);
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace EmberNs
|
||||
{
|
||||
#define EMBER_VERSION "0.4.1.6"
|
||||
#define EPS6 T(1e-6)
|
||||
#define EPS std::numeric_limits<T>::epsilon()//Apoplugin.h uses -20, but it's more mathematically correct to do it this way.
|
||||
|
@ -1588,4 +1588,13 @@ void Renderer<T, bucketT>::GammaCorrection(glm::detail::tvec4<bucketT, glm::defa
|
||||
correctedChannels[3] = numeric_limits<accumT>::max();//Final accum, 4 channels, but not using transparency. 255 for 8 bpc, 65535 for 16 bpc.
|
||||
}
|
||||
}
|
||||
|
||||
//This class had to be implemented in a cpp file because the compiler was breaking.
|
||||
//So the explicit instantiation must be declared here rather than in Ember.cpp where
|
||||
//all of the other classes are done.
|
||||
template EMBER_API class Renderer<float, float>;
|
||||
|
||||
#ifdef DO_DOUBLE
|
||||
template EMBER_API class Renderer<double, double>;
|
||||
#endif
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ namespace EmberNs
|
||||
template <typename T, typename bucketT>
|
||||
class EMBER_API Renderer : public RendererBase
|
||||
{
|
||||
//using EmberReport::m_ErrorReport;
|
||||
public:
|
||||
Renderer();
|
||||
virtual ~Renderer();
|
||||
@ -189,9 +190,9 @@ protected:
|
||||
//This class had to be implemented in a cpp file because the compiler was breaking.
|
||||
//So the explicit instantiation must be declared here rather than in Ember.cpp where
|
||||
//all of the other classes are done.
|
||||
template EMBER_API class Renderer<float, float>;
|
||||
//template EMBER_API class Renderer<float, float>;
|
||||
|
||||
#ifdef DO_DOUBLE
|
||||
template EMBER_API class Renderer<double, double>;
|
||||
#endif
|
||||
//#ifdef DO_DOUBLE
|
||||
// template EMBER_API class Renderer<double, double>;
|
||||
//#endif
|
||||
}
|
||||
|
@ -91,6 +91,7 @@ enum eRendererType { CPU_RENDERER, OPENCL_RENDERER };
|
||||
/// </summary>
|
||||
class EMBER_API RendererBase : public EmberReport
|
||||
{
|
||||
//using EmberReport::m_ErrorReport;
|
||||
public:
|
||||
RendererBase();
|
||||
virtual ~RendererBase() { }
|
||||
@ -210,8 +211,8 @@ protected:
|
||||
size_t m_ThreadsToUse;
|
||||
size_t m_VibGamCount;
|
||||
size_t m_LastTemporalSample;
|
||||
double m_LastIterPercent;
|
||||
size_t m_LastIter;
|
||||
double m_LastIterPercent;
|
||||
eProcessAction m_ProcessAction;
|
||||
eProcessState m_ProcessState;
|
||||
eInteractiveFilter m_InteractiveFilter;
|
||||
|
@ -132,20 +132,20 @@ public:
|
||||
/// Add a vector of strings to report.
|
||||
/// </summary>
|
||||
/// <param name="vec">The vector of strings to add</param>
|
||||
virtual void AddToReport(vector<string>& vec) { m_ErrorReport.insert(m_ErrorReport.end(), vec.begin(), vec.end()); }
|
||||
virtual void AddToReport(const vector<string>& vec) { m_ErrorReport.insert(m_ErrorReport.end(), vec.begin(), vec.end()); }
|
||||
|
||||
/// <summary>
|
||||
/// Static function to dump a vector of strings passed in.
|
||||
/// </summary>
|
||||
/// <param name="errorReport">The vector of strings to dump</param>
|
||||
static void StaticDumpErrorReport(vector<string>& errorReport) { cout << StaticErrorReportString(errorReport); }
|
||||
static void StaticDumpErrorReport(const vector<string>& errorReport) { cout << StaticErrorReportString(errorReport); }
|
||||
|
||||
/// <summary>
|
||||
/// Static function to return the entire error report passed in as a single string.
|
||||
/// </summary>
|
||||
/// <param name="errorReport">The vector of strings to concatenate</param>
|
||||
/// <returns>A string containing all strings in the vector passed in separated by newlines</returns>
|
||||
static string StaticErrorReportString(vector<string>& errorReport)
|
||||
static string StaticErrorReportString(const vector<string>& errorReport)
|
||||
{
|
||||
stringstream ss;
|
||||
|
||||
@ -835,7 +835,7 @@ static string GetPath(const string& filename)
|
||||
{
|
||||
string s;
|
||||
const size_t lastSlash = filename.find_last_of("\\/");
|
||||
|
||||
|
||||
if (std::string::npos != lastSlash)
|
||||
s = filename.substr(0, lastSlash + 1);
|
||||
else
|
||||
|
Reference in New Issue
Block a user