More C++11.

This commit is contained in:
mfeemster 2014-08-31 22:03:45 -07:00
parent 79d611dd20
commit abfd36de32
3 changed files with 65 additions and 50 deletions

View File

@ -1,42 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file> <CodeBlocks_layout_file>
<ActiveTarget name="Debug x64" /> <ActiveTarget name="Debug x64" />
<File name="../../Source/Ember/XmlToEmber.h" open="1" top="1" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <File name="../../Source/Ember/XmlToEmber.h" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/DllMain.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/Renderer.cpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/Affine2D.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/Ember.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/EmberPch.cpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/Ember.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/CarToRas.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor> <Cursor>
<Cursor1 position="0" topLine="0" /> <Cursor1 position="0" topLine="0" />
</Cursor> </Cursor>
@ -46,4 +11,54 @@
<Cursor1 position="0" topLine="0" /> <Cursor1 position="0" topLine="0" />
</Cursor> </Cursor>
</File> </File>
<File name="../../Source/Ember/EmberToXml.h" open="1" top="1" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6418" topLine="129" />
</Cursor>
</File>
<File name="../../Source/Ember/Renderer.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="5242" topLine="116" />
</Cursor>
</File>
<File name="../../Source/Ember/Renderer.cpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/Ember.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/Utils.h" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="21424" topLine="713" />
</Cursor>
</File>
<File name="../../Source/Ember/CarToRas.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/Ember.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/Affine2D.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/DllMain.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../Source/Ember/EmberPch.cpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file> </CodeBlocks_layout_file>

View File

@ -18,7 +18,7 @@ namespace EmberNs
{ {
/// <summary> /// <summary>
/// Function pointers present a major restriction when dealing /// Function pointers present a major restriction when dealing
/// with member functions, and that is they can only point to /// with member functions, and that is they can only point to
/// static ones. So instead of a straight function pointer, use /// static ones. So instead of a straight function pointer, use
/// a callback class with a single virtual callback /// a callback class with a single virtual callback
/// member function. /// member function.
@ -47,7 +47,7 @@ public:
/// <summary> /// <summary>
/// Render statistics for the number of iterations ran, /// Render statistics for the number of iterations ran,
/// number of bad values calculated during iteration, and /// number of bad values calculated during iteration, and
/// the total time for the entire render from the start of /// the total time for the entire render from the start of
/// iteration to the end of final accumulation. /// iteration to the end of final accumulation.
/// </summary> /// </summary>
@ -193,7 +193,7 @@ public:
virtual uint64_t MemoryRequired(bool includeFinal); virtual uint64_t MemoryRequired(bool includeFinal);
//Virtual functions to be overriden in derived renderers that use the GPU. //Virtual functions to be overriden in derived renderers that use the GPU.
virtual unsigned __int64 MemoryAvailable(); virtual uint64_t MemoryAvailable();
virtual void Reset(); virtual void Reset();
virtual bool Ok() const; virtual bool Ok() const;
virtual bool CreateDEFilter(bool& newAlloc); virtual bool CreateDEFilter(bool& newAlloc);
@ -241,7 +241,7 @@ public:
inline bool Transparency() const; inline bool Transparency() const;
virtual void Transparency(bool transparency); virtual void Transparency(bool transparency);
inline unsigned int BytesPerChannel() const; inline unsigned int BytesPerChannel() const;
void BytesPerChannel(unsigned int bytesPerChannel); void BytesPerChannel(unsigned int bytesPerChannel);
inline T PixelAspectRatio() const; inline T PixelAspectRatio() const;
@ -249,7 +249,7 @@ public:
inline eInteractiveFilter InteractiveFilter() const; inline eInteractiveFilter InteractiveFilter() const;
virtual void InteractiveFilter(eInteractiveFilter filter); virtual void InteractiveFilter(eInteractiveFilter filter);
//Threading control. //Threading control.
virtual void EnterRender(); virtual void EnterRender();
virtual void LeaveRender(); virtual void LeaveRender();
@ -293,7 +293,7 @@ public:
inline SpatialFilter<T>* GetSpatialFilter(); inline SpatialFilter<T>* GetSpatialFilter();
inline TemporalFilter<T>* GetTemporalFilter(); inline TemporalFilter<T>* GetTemporalFilter();
virtual DensityFilter<T>* GetDensityFilter(); virtual DensityFilter<T>* GetDensityFilter();
//Ember wrappers, getters only. //Ember wrappers, getters only.
inline bool XaosPresent(); inline bool XaosPresent();
unsigned int FinalRasW() const; unsigned int FinalRasW() const;
@ -326,7 +326,7 @@ public:
inline bool UseFinalXform() const; inline bool UseFinalXform() const;
inline const Palette<T>* GetPalette() const; inline const Palette<T>* GetPalette() const;
inline ePaletteMode PaletteMode() const; inline ePaletteMode PaletteMode() const;
//Iterator wrappers. //Iterator wrappers.
const unsigned char* XformDistributions() const; const unsigned char* XformDistributions() const;
const unsigned int XformDistributionsSize() const; const unsigned int XformDistributionsSize() const;
@ -421,4 +421,4 @@ template EMBER_API class Renderer<float, float>;
#ifdef DO_DOUBLE #ifdef DO_DOUBLE
template EMBER_API class Renderer<double, double>; template EMBER_API class Renderer<double, double>;
#endif #endif
} }

View File

@ -109,13 +109,13 @@ public:
/// </summary> /// </summary>
/// <param name="vec">The vector of strings to add</param> /// <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(vector<string>& vec) { m_ErrorReport.insert(m_ErrorReport.end(), vec.begin(), vec.end()); }
/// <summary> /// <summary>
/// Static function to dump a vector of strings passed in. /// Static function to dump a vector of strings passed in.
/// </summary> /// </summary>
/// <param name="errorReport">The vector of strings to dump</param> /// <param name="errorReport">The vector of strings to dump</param>
static void StaticDumpErrorReport(vector<string>& errorReport) { cout << StaticErrorReportString(errorReport); } static void StaticDumpErrorReport(vector<string>& errorReport) { cout << StaticErrorReportString(errorReport); }
/// <summary> /// <summary>
/// Static function to return the entire error report passed in as a single string. /// Static function to return the entire error report passed in as a single string.
/// </summary> /// </summary>
@ -126,7 +126,7 @@ public:
stringstream ss; stringstream ss;
ForEach(errorReport, [&](string s) { ss << s << endl; }); ForEach(errorReport, [&](string s) { ss << s << endl; });
return ss.str(); return ss.str();
} }
@ -713,7 +713,7 @@ static inline T NormalizeDeg360(T angle)
/// </summary> /// </summary>
/// <param name="str">The string to copy and make lower case</param> /// <param name="str">The string to copy and make lower case</param>
/// <returns>The lower case string</returns> /// <returns>The lower case string</returns>
static inline string ToLower(string& str) static inline string ToLower(const string& str)
{ {
string lower; string lower;
@ -751,7 +751,7 @@ static inline string Trim(string& str, char ch = ' ')
{ {
size_t firstChar = str.find_first_not_of(ch); size_t firstChar = str.find_first_not_of(ch);
size_t lastChar = str.find_last_not_of(ch); size_t lastChar = str.find_last_not_of(ch);
if (firstChar == string::npos) if (firstChar == string::npos)
firstChar = 0; firstChar = 0;
@ -950,4 +950,4 @@ static const char* EmberVersion()
{ {
return EMBER_OS "-" EMBER_VERSION; return EMBER_OS "-" EMBER_VERSION;
} }
} }