diff --git a/Builds/CB/Ember.cbp b/Builds/CB/Ember.cbp index f89144d..dfed5cc 100644 --- a/Builds/CB/Ember.cbp +++ b/Builds/CB/Ember.cbp @@ -98,6 +98,8 @@ + + diff --git a/Builds/CB/Ember.depend b/Builds/CB/Ember.depend index 8d2ec01..751d8d5 100644 --- a/Builds/CB/Ember.depend +++ b/Builds/CB/Ember.depend @@ -1,9 +1,9 @@ # depslib dependency file v1.0 -1417821052 source:/home/heretic/Dev/fractorium/Source/Ember/Affine2D.cpp +1417901704 source:/home/heretic/Dev/fractorium/Source/Ember/Affine2D.cpp "EmberPch.h" "Affine2D.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/EmberPch.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/EmberPch.h @@ -35,6 +35,7 @@ "tbb/parallel_for.h" "tbb/task_scheduler_init.h" "glm/glm.hpp" + "glm/detail/type_int.hpp" "glm/gtc/matrix_transform.hpp" "glm/gtc/type_ptr.hpp" "glm/gtx/string_cast.hpp" @@ -160,22 +161,22 @@ -1417810095 /home/heretic/Dev/fractorium/Source/Ember/Affine2D.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Affine2D.h "Utils.h" -1417776440 /home/heretic/Dev/fractorium/Source/Ember/Utils.h +1417905955 /home/heretic/Dev/fractorium/Source/Ember/Utils.h "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Isaac.h +1417921234 /home/heretic/Dev/fractorium/Source/Ember/Isaac.h "EmberDefines.h" -1417811373 /home/heretic/Dev/fractorium/Source/Ember/EmberDefines.h +1417917311 /home/heretic/Dev/fractorium/Source/Ember/EmberDefines.h "EmberPch.h" -1417760119 source:/home/heretic/Dev/fractorium/Source/Ember/DllMain.cpp +1417901704 source:/home/heretic/Dev/fractorium/Source/Ember/DllMain.cpp "EmberPch.h" -1417813888 source:/home/heretic/Dev/fractorium/Source/Ember/Ember.cpp +1417901704 source:/home/heretic/Dev/fractorium/Source/Ember/Ember.cpp "EmberPch.h" "EmberDefines.h" "Isaac.h" @@ -205,17 +206,17 @@ "Timing.h" "SheepTools.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Ember.h +1417915457 /home/heretic/Dev/fractorium/Source/Ember/Ember.h "Xform.h" "PaletteList.h" "SpatialFilter.h" "TemporalFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Xform.h +1417908868 /home/heretic/Dev/fractorium/Source/Ember/Xform.h "VariationList.h" "Interpolate.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/VariationList.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/VariationList.h "Variations01.h" "Variations02.h" "Variations03.h" @@ -223,70 +224,70 @@ "Variations05.h" "VariationsDC.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations01.h +1417907217 /home/heretic/Dev/fractorium/Source/Ember/Variations01.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variation.h +1417917944 /home/heretic/Dev/fractorium/Source/Ember/Variation.h "Point.h" "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Point.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Point.h "EmberDefines.h" "Affine2D.h" "Timing.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Timing.h +1417906341 /home/heretic/Dev/fractorium/Source/Ember/Timing.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations02.h +1417908486 /home/heretic/Dev/fractorium/Source/Ember/Variations02.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations03.h +1417907820 /home/heretic/Dev/fractorium/Source/Ember/Variations03.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations04.h +1417908559 /home/heretic/Dev/fractorium/Source/Ember/Variations04.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations05.h +1417908258 /home/heretic/Dev/fractorium/Source/Ember/Variations05.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/VariationsDC.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/VariationsDC.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Interpolate.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Interpolate.h "Ember.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/PaletteList.h +1417909715 /home/heretic/Dev/fractorium/Source/Ember/PaletteList.h "Palette.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Palette.h +1417908559 /home/heretic/Dev/fractorium/Source/Ember/Palette.h "Utils.h" "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/SpatialFilter.h +1417907380 /home/heretic/Dev/fractorium/Source/Ember/SpatialFilter.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/TemporalFilter.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/TemporalFilter.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Iterator.h +1417928702 /home/heretic/Dev/fractorium/Source/Ember/Iterator.h "Ember.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/EmberToXml.h +1417918151 /home/heretic/Dev/fractorium/Source/Ember/EmberToXml.h "Utils.h" "PaletteList.h" "VariationList.h" "Ember.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/XmlToEmber.h +1417919921 /home/heretic/Dev/fractorium/Source/Ember/XmlToEmber.h "Utils.h" "PaletteList.h" "VariationList.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/DensityFilter.h +1417915259 /home/heretic/Dev/fractorium/Source/Ember/DensityFilter.h "SpatialFilter.h" -1417810944 /home/heretic/Dev/fractorium/Source/Ember/Renderer.h +1417921679 /home/heretic/Dev/fractorium/Source/Ember/Renderer.h "RendererBase.h" "Iterator.h" "SpatialFilter.h" @@ -295,28 +296,28 @@ "CarToRas.h" "EmberToXml.h" -1417770762 /home/heretic/Dev/fractorium/Source/Ember/RendererBase.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/RendererBase.h "Utils.h" "Ember.h" "DensityFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/CarToRas.h +1417905627 /home/heretic/Dev/fractorium/Source/Ember/CarToRas.h "Point.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/SheepTools.h +1417905627 /home/heretic/Dev/fractorium/Source/Ember/SheepTools.h "EmberDefines.h" "Isaac.h" "VariationList.h" "Renderer.h" -1417760119 source:/home/heretic/Dev/fractorium/Source/Ember/EmberPch.cpp +1417901704 source:/home/heretic/Dev/fractorium/Source/Ember/EmberPch.cpp "EmberPch.h" -1417813874 source:/home/heretic/Dev/fractorium/Source/Ember/Renderer.cpp +1417922137 source:/home/heretic/Dev/fractorium/Source/Ember/Renderer.cpp "EmberPch.h" "Renderer.h" -1417760119 source:/home/heretic/Dev/fractorium/Source/Ember/RendererBase.cpp +1417920290 source:/home/heretic/Dev/fractorium/Source/Ember/RendererBase.cpp "EmberPch.h" "RendererBase.h" diff --git a/Builds/CB/Ember.layout b/Builds/CB/Ember.layout index d71a35d..fd89704 100644 --- a/Builds/CB/Ember.layout +++ b/Builds/CB/Ember.layout @@ -1,139 +1,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -141,11 +16,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -153,22 +138,47 @@ - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Builds/CB/EmberAnimate.cbp b/Builds/CB/EmberAnimate.cbp index af36919..c57f68b 100644 --- a/Builds/CB/EmberAnimate.cbp +++ b/Builds/CB/EmberAnimate.cbp @@ -76,6 +76,8 @@ + + diff --git a/Builds/CB/EmberAnimate.depend b/Builds/CB/EmberAnimate.depend index c69478c..01dba0e 100644 --- a/Builds/CB/EmberAnimate.depend +++ b/Builds/CB/EmberAnimate.depend @@ -1,8 +1,8 @@ # depslib dependency file v1.0 -1417760119 source:/home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.cpp +1417901704 source:/home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.cpp "EmberCommonPch.h" -1417812217 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.h @@ -33,17 +33,17 @@ "SimpleGlob.h" "SimpleOpt.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Ember.h +1417915457 /home/heretic/Dev/fractorium/Source/Ember/Ember.h "Xform.h" "PaletteList.h" "SpatialFilter.h" "TemporalFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Xform.h +1417908868 /home/heretic/Dev/fractorium/Source/Ember/Xform.h "VariationList.h" "Interpolate.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/VariationList.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/VariationList.h "Variations01.h" "Variations02.h" "Variations03.h" @@ -51,22 +51,22 @@ "Variations05.h" "VariationsDC.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations01.h +1417907217 /home/heretic/Dev/fractorium/Source/Ember/Variations01.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variation.h +1417917944 /home/heretic/Dev/fractorium/Source/Ember/Variation.h "Point.h" "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Point.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Point.h "EmberDefines.h" "Affine2D.h" "Timing.h" -1417811373 /home/heretic/Dev/fractorium/Source/Ember/EmberDefines.h +1417917311 /home/heretic/Dev/fractorium/Source/Ember/EmberDefines.h "EmberPch.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/EmberPch.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/EmberPch.h @@ -98,6 +98,7 @@ "tbb/parallel_for.h" "tbb/task_scheduler_init.h" "glm/glm.hpp" + "glm/detail/type_int.hpp" "glm/gtc/matrix_transform.hpp" "glm/gtc/type_ptr.hpp" "glm/gtx/string_cast.hpp" @@ -223,64 +224,64 @@ -1417810095 /home/heretic/Dev/fractorium/Source/Ember/Affine2D.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Affine2D.h "Utils.h" -1417776440 /home/heretic/Dev/fractorium/Source/Ember/Utils.h +1417905955 /home/heretic/Dev/fractorium/Source/Ember/Utils.h "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Isaac.h +1417921234 /home/heretic/Dev/fractorium/Source/Ember/Isaac.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Timing.h +1417906341 /home/heretic/Dev/fractorium/Source/Ember/Timing.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations02.h +1417908486 /home/heretic/Dev/fractorium/Source/Ember/Variations02.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations03.h +1417907820 /home/heretic/Dev/fractorium/Source/Ember/Variations03.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations04.h +1417908559 /home/heretic/Dev/fractorium/Source/Ember/Variations04.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations05.h +1417908258 /home/heretic/Dev/fractorium/Source/Ember/Variations05.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/VariationsDC.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/VariationsDC.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Interpolate.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Interpolate.h "Ember.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/PaletteList.h +1417909715 /home/heretic/Dev/fractorium/Source/Ember/PaletteList.h "Palette.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Palette.h +1417908559 /home/heretic/Dev/fractorium/Source/Ember/Palette.h "Utils.h" "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/SpatialFilter.h +1417907380 /home/heretic/Dev/fractorium/Source/Ember/SpatialFilter.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/TemporalFilter.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/TemporalFilter.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/EmberToXml.h +1417918151 /home/heretic/Dev/fractorium/Source/Ember/EmberToXml.h "Utils.h" "PaletteList.h" "VariationList.h" "Ember.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/XmlToEmber.h +1417919921 /home/heretic/Dev/fractorium/Source/Ember/XmlToEmber.h "Utils.h" "PaletteList.h" "VariationList.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Iterator.h +1417928702 /home/heretic/Dev/fractorium/Source/Ember/Iterator.h "Ember.h" -1417810944 /home/heretic/Dev/fractorium/Source/Ember/Renderer.h +1417921679 /home/heretic/Dev/fractorium/Source/Ember/Renderer.h "RendererBase.h" "Iterator.h" "SpatialFilter.h" @@ -289,25 +290,25 @@ "CarToRas.h" "EmberToXml.h" -1417770762 /home/heretic/Dev/fractorium/Source/Ember/RendererBase.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/RendererBase.h "Utils.h" "Ember.h" "DensityFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/DensityFilter.h +1417915259 /home/heretic/Dev/fractorium/Source/Ember/DensityFilter.h "SpatialFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/CarToRas.h +1417905627 /home/heretic/Dev/fractorium/Source/Ember/CarToRas.h "Point.h" -1417828769 /home/heretic/Dev/fractorium/Source/EmberCL/RendererCL.h +1417928136 /home/heretic/Dev/fractorium/Source/EmberCL/RendererCL.h "EmberCLPch.h" "OpenCLWrapper.h" "IterOpenCLKernelCreator.h" "DEOpenCLKernelCreator.h" "FinalAccumOpenCLKernelCreator.h" -1417766202 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLPch.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLPch.h "Timing.h" "Renderer.h" @@ -324,38 +325,38 @@ -1417770248 /home/heretic/Dev/fractorium/Source/EmberCL/OpenCLWrapper.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/OpenCLWrapper.h "EmberCLPch.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/IterOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/IterOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417764380 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLStructs.h +1417928227 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLStructs.h "EmberCLPch.h" -1417760119 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLFunctions.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLFunctions.h "EmberCLPch.h" "EmberCLStructs.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/DEOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/DEOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/FinalAccumOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/FinalAccumOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/SheepTools.h +1417905627 /home/heretic/Dev/fractorium/Source/Ember/SheepTools.h "EmberDefines.h" "Isaac.h" "VariationList.h" "Renderer.h" -1417816836 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleGlob.h +1417934059 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleGlob.h @@ -367,26 +368,26 @@ -1417817700 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleOpt.h +1417934252 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleOpt.h -1417821813 source:/home/heretic/Dev/fractorium/Source/EmberAnimate/EmberAnimate.cpp +1417935223 source:/home/heretic/Dev/fractorium/Source/EmberAnimate/EmberAnimate.cpp "EmberCommonPch.h" "EmberAnimate.h" "JpegUtils.h" -1417760119 /home/heretic/Dev/fractorium/Source/EmberAnimate/EmberAnimate.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberAnimate/EmberAnimate.h "EmberOptions.h" -1417774919 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberOptions.h +1417930466 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberOptions.h "EmberCommon.h" -1417760119 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommon.h +1417930466 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommon.h "EmberCommonPch.h" -1417775759 /home/heretic/Dev/fractorium/Source/EmberCommon/JpegUtils.h +1417932245 /home/heretic/Dev/fractorium/Source/EmberCommon/JpegUtils.h "EmberCommonPch.h" diff --git a/Builds/CB/EmberAnimate.layout b/Builds/CB/EmberAnimate.layout index 6c4ae9b..1ce9e60 100644 --- a/Builds/CB/EmberAnimate.layout +++ b/Builds/CB/EmberAnimate.layout @@ -3,7 +3,12 @@ - + + + + + + diff --git a/Builds/CB/EmberCL.cbp b/Builds/CB/EmberCL.cbp index c7c627a..3a1bf14 100644 --- a/Builds/CB/EmberCL.cbp +++ b/Builds/CB/EmberCL.cbp @@ -149,6 +149,8 @@ + + diff --git a/Builds/CB/EmberCL.depend b/Builds/CB/EmberCL.depend index c963baa..a03c297 100644 --- a/Builds/CB/EmberCL.depend +++ b/Builds/CB/EmberCL.depend @@ -1,9 +1,9 @@ # depslib dependency file v1.0 -1417814313 source:/home/heretic/Dev/fractorium/Source/EmberCL/DEOpenCLKernelCreator.cpp +1417928577 source:/home/heretic/Dev/fractorium/Source/EmberCL/DEOpenCLKernelCreator.cpp "EmberCLPch.h" "DEOpenCLKernelCreator.h" -1417766202 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLPch.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLPch.h "Timing.h" "Renderer.h" @@ -20,13 +20,13 @@ -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Timing.h +1417906341 /home/heretic/Dev/fractorium/Source/Ember//Timing.h "EmberDefines.h" -1417811373 /home/heretic/Dev/fractorium/Source/Ember//EmberDefines.h +1417917311 /home/heretic/Dev/fractorium/Source/Ember//EmberDefines.h "EmberPch.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//EmberPch.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember//EmberPch.h @@ -58,6 +58,7 @@ "tbb/parallel_for.h" "tbb/task_scheduler_init.h" "glm/glm.hpp" + "glm/detail/type_int.hpp" "glm/gtc/matrix_transform.hpp" "glm/gtc/type_ptr.hpp" "glm/gtx/string_cast.hpp" @@ -183,7 +184,7 @@ -1417810944 /home/heretic/Dev/fractorium/Source/Ember//Renderer.h +1417921679 /home/heretic/Dev/fractorium/Source/Ember//Renderer.h "RendererBase.h" "Iterator.h" "SpatialFilter.h" @@ -192,28 +193,28 @@ "CarToRas.h" "EmberToXml.h" -1417770762 /home/heretic/Dev/fractorium/Source/Ember//RendererBase.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember//RendererBase.h "Utils.h" "Ember.h" "DensityFilter.h" -1417776440 /home/heretic/Dev/fractorium/Source/Ember//Utils.h +1417905955 /home/heretic/Dev/fractorium/Source/Ember//Utils.h "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Isaac.h +1417921234 /home/heretic/Dev/fractorium/Source/Ember//Isaac.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Ember.h +1417915457 /home/heretic/Dev/fractorium/Source/Ember//Ember.h "Xform.h" "PaletteList.h" "SpatialFilter.h" "TemporalFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Xform.h +1417908868 /home/heretic/Dev/fractorium/Source/Ember//Xform.h "VariationList.h" "Interpolate.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//VariationList.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember//VariationList.h "Variations01.h" "Variations02.h" "Variations03.h" @@ -221,112 +222,112 @@ "Variations05.h" "VariationsDC.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Variations01.h +1417907217 /home/heretic/Dev/fractorium/Source/Ember//Variations01.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Variation.h +1417917944 /home/heretic/Dev/fractorium/Source/Ember//Variation.h "Point.h" "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Point.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember//Point.h "EmberDefines.h" "Affine2D.h" "Timing.h" -1417810095 /home/heretic/Dev/fractorium/Source/Ember//Affine2D.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember//Affine2D.h "Utils.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Variations02.h +1417908486 /home/heretic/Dev/fractorium/Source/Ember//Variations02.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Variations03.h +1417907820 /home/heretic/Dev/fractorium/Source/Ember//Variations03.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Variations04.h +1417908559 /home/heretic/Dev/fractorium/Source/Ember//Variations04.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Variations05.h +1417908258 /home/heretic/Dev/fractorium/Source/Ember//Variations05.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//VariationsDC.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember//VariationsDC.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Interpolate.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember//Interpolate.h "Ember.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//PaletteList.h +1417909715 /home/heretic/Dev/fractorium/Source/Ember//PaletteList.h "Palette.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Palette.h +1417908559 /home/heretic/Dev/fractorium/Source/Ember//Palette.h "Utils.h" "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//SpatialFilter.h +1417907380 /home/heretic/Dev/fractorium/Source/Ember//SpatialFilter.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//TemporalFilter.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember//TemporalFilter.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//DensityFilter.h +1417915259 /home/heretic/Dev/fractorium/Source/Ember//DensityFilter.h "SpatialFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//Iterator.h +1417928702 /home/heretic/Dev/fractorium/Source/Ember//Iterator.h "Ember.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//CarToRas.h +1417905627 /home/heretic/Dev/fractorium/Source/Ember//CarToRas.h "Point.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember//EmberToXml.h +1417918151 /home/heretic/Dev/fractorium/Source/Ember//EmberToXml.h "Utils.h" "PaletteList.h" "VariationList.h" "Ember.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/DEOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/DEOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417764380 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLStructs.h +1417928227 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLStructs.h "EmberCLPch.h" -1417760119 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLFunctions.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLFunctions.h "EmberCLPch.h" "EmberCLStructs.h" -1417760119 source:/home/heretic/Dev/fractorium/Source/EmberCL/DllMain.cpp +1417901704 source:/home/heretic/Dev/fractorium/Source/EmberCL/DllMain.cpp "EmberCLPch.h" -1417814313 source:/home/heretic/Dev/fractorium/Source/EmberCL/FinalAccumOpenCLKernelCreator.cpp +1417901704 source:/home/heretic/Dev/fractorium/Source/EmberCL/FinalAccumOpenCLKernelCreator.cpp "EmberCLPch.h" "FinalAccumOpenCLKernelCreator.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/FinalAccumOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/FinalAccumOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417814434 source:/home/heretic/Dev/fractorium/Source/EmberCL/IterOpenCLKernelCreator.cpp +1417901704 source:/home/heretic/Dev/fractorium/Source/EmberCL/IterOpenCLKernelCreator.cpp "EmberCLPch.h" "IterOpenCLKernelCreator.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/IterOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/IterOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417814434 source:/home/heretic/Dev/fractorium/Source/EmberCL/OpenCLWrapper.cpp +1417929845 source:/home/heretic/Dev/fractorium/Source/EmberCL/OpenCLWrapper.cpp "EmberCLPch.h" "OpenCLWrapper.h" -1417770248 /home/heretic/Dev/fractorium/Source/EmberCL/OpenCLWrapper.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/OpenCLWrapper.h "EmberCLPch.h" -1417829447 source:/home/heretic/Dev/fractorium/Source/EmberCL/RendererCL.cpp +1417926792 source:/home/heretic/Dev/fractorium/Source/EmberCL/RendererCL.cpp "EmberCLPch.h" "RendererCL.h" -1417828769 /home/heretic/Dev/fractorium/Source/EmberCL/RendererCL.h +1417928136 /home/heretic/Dev/fractorium/Source/EmberCL/RendererCL.h "EmberCLPch.h" "OpenCLWrapper.h" "IterOpenCLKernelCreator.h" diff --git a/Builds/CB/EmberCL.layout b/Builds/CB/EmberCL.layout index 0f90453..6d66f54 100644 --- a/Builds/CB/EmberCL.layout +++ b/Builds/CB/EmberCL.layout @@ -1,44 +1,14 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -46,29 +16,59 @@ - - - - - - - - - - - - - - - - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Builds/CB/EmberGenome.cbp b/Builds/CB/EmberGenome.cbp index 93aa007..168a8c3 100644 --- a/Builds/CB/EmberGenome.cbp +++ b/Builds/CB/EmberGenome.cbp @@ -76,6 +76,8 @@ + + diff --git a/Builds/CB/EmberGenome.depend b/Builds/CB/EmberGenome.depend index 39b448a..37d137e 100644 --- a/Builds/CB/EmberGenome.depend +++ b/Builds/CB/EmberGenome.depend @@ -1,8 +1,8 @@ # depslib dependency file v1.0 -1417760119 source:/home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.cpp +1417901704 source:/home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.cpp "EmberCommonPch.h" -1417812217 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.h @@ -33,17 +33,17 @@ "SimpleGlob.h" "SimpleOpt.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Ember.h +1417915457 /home/heretic/Dev/fractorium/Source/Ember/Ember.h "Xform.h" "PaletteList.h" "SpatialFilter.h" "TemporalFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Xform.h +1417908868 /home/heretic/Dev/fractorium/Source/Ember/Xform.h "VariationList.h" "Interpolate.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/VariationList.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/VariationList.h "Variations01.h" "Variations02.h" "Variations03.h" @@ -51,22 +51,22 @@ "Variations05.h" "VariationsDC.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations01.h +1417907217 /home/heretic/Dev/fractorium/Source/Ember/Variations01.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variation.h +1417917944 /home/heretic/Dev/fractorium/Source/Ember/Variation.h "Point.h" "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Point.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Point.h "EmberDefines.h" "Affine2D.h" "Timing.h" -1417811373 /home/heretic/Dev/fractorium/Source/Ember/EmberDefines.h +1417917311 /home/heretic/Dev/fractorium/Source/Ember/EmberDefines.h "EmberPch.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/EmberPch.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/EmberPch.h @@ -98,6 +98,7 @@ "tbb/parallel_for.h" "tbb/task_scheduler_init.h" "glm/glm.hpp" + "glm/detail/type_int.hpp" "glm/gtc/matrix_transform.hpp" "glm/gtc/type_ptr.hpp" "glm/gtx/string_cast.hpp" @@ -223,64 +224,64 @@ -1417810095 /home/heretic/Dev/fractorium/Source/Ember/Affine2D.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Affine2D.h "Utils.h" -1417776440 /home/heretic/Dev/fractorium/Source/Ember/Utils.h +1417905955 /home/heretic/Dev/fractorium/Source/Ember/Utils.h "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Isaac.h +1417921234 /home/heretic/Dev/fractorium/Source/Ember/Isaac.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Timing.h +1417906341 /home/heretic/Dev/fractorium/Source/Ember/Timing.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations02.h +1417908486 /home/heretic/Dev/fractorium/Source/Ember/Variations02.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations03.h +1417907820 /home/heretic/Dev/fractorium/Source/Ember/Variations03.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations04.h +1417908559 /home/heretic/Dev/fractorium/Source/Ember/Variations04.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations05.h +1417908258 /home/heretic/Dev/fractorium/Source/Ember/Variations05.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/VariationsDC.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/VariationsDC.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Interpolate.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Interpolate.h "Ember.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/PaletteList.h +1417909715 /home/heretic/Dev/fractorium/Source/Ember/PaletteList.h "Palette.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Palette.h +1417908559 /home/heretic/Dev/fractorium/Source/Ember/Palette.h "Utils.h" "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/SpatialFilter.h +1417907380 /home/heretic/Dev/fractorium/Source/Ember/SpatialFilter.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/TemporalFilter.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/TemporalFilter.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/EmberToXml.h +1417918151 /home/heretic/Dev/fractorium/Source/Ember/EmberToXml.h "Utils.h" "PaletteList.h" "VariationList.h" "Ember.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/XmlToEmber.h +1417919921 /home/heretic/Dev/fractorium/Source/Ember/XmlToEmber.h "Utils.h" "PaletteList.h" "VariationList.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Iterator.h +1417928702 /home/heretic/Dev/fractorium/Source/Ember/Iterator.h "Ember.h" -1417810944 /home/heretic/Dev/fractorium/Source/Ember/Renderer.h +1417921679 /home/heretic/Dev/fractorium/Source/Ember/Renderer.h "RendererBase.h" "Iterator.h" "SpatialFilter.h" @@ -289,25 +290,25 @@ "CarToRas.h" "EmberToXml.h" -1417770762 /home/heretic/Dev/fractorium/Source/Ember/RendererBase.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/RendererBase.h "Utils.h" "Ember.h" "DensityFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/DensityFilter.h +1417915259 /home/heretic/Dev/fractorium/Source/Ember/DensityFilter.h "SpatialFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/CarToRas.h +1417905627 /home/heretic/Dev/fractorium/Source/Ember/CarToRas.h "Point.h" -1417828769 /home/heretic/Dev/fractorium/Source/EmberCL/RendererCL.h +1417928136 /home/heretic/Dev/fractorium/Source/EmberCL/RendererCL.h "EmberCLPch.h" "OpenCLWrapper.h" "IterOpenCLKernelCreator.h" "DEOpenCLKernelCreator.h" "FinalAccumOpenCLKernelCreator.h" -1417766202 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLPch.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLPch.h "Timing.h" "Renderer.h" @@ -324,38 +325,38 @@ -1417770248 /home/heretic/Dev/fractorium/Source/EmberCL/OpenCLWrapper.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/OpenCLWrapper.h "EmberCLPch.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/IterOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/IterOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417764380 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLStructs.h +1417928227 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLStructs.h "EmberCLPch.h" -1417760119 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLFunctions.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLFunctions.h "EmberCLPch.h" "EmberCLStructs.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/DEOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/DEOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/FinalAccumOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/FinalAccumOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/SheepTools.h +1417905627 /home/heretic/Dev/fractorium/Source/Ember/SheepTools.h "EmberDefines.h" "Isaac.h" "VariationList.h" "Renderer.h" -1417816836 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleGlob.h +1417934059 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleGlob.h @@ -367,26 +368,26 @@ -1417817700 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleOpt.h +1417934252 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleOpt.h -1417823420 source:/home/heretic/Dev/fractorium/Source/EmberGenome/EmberGenome.cpp +1417901704 source:/home/heretic/Dev/fractorium/Source/EmberGenome/EmberGenome.cpp "EmberCommonPch.h" "EmberGenome.h" "JpegUtils.h" -1417760119 /home/heretic/Dev/fractorium/Source/EmberGenome/EmberGenome.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberGenome/EmberGenome.h "EmberOptions.h" -1417774919 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberOptions.h +1417930466 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberOptions.h "EmberCommon.h" -1417760119 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommon.h +1417930466 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommon.h "EmberCommonPch.h" -1417775759 /home/heretic/Dev/fractorium/Source/EmberCommon/JpegUtils.h +1417932245 /home/heretic/Dev/fractorium/Source/EmberCommon/JpegUtils.h "EmberCommonPch.h" diff --git a/Builds/CB/EmberGenome.layout b/Builds/CB/EmberGenome.layout index d84f586..93cc027 100644 --- a/Builds/CB/EmberGenome.layout +++ b/Builds/CB/EmberGenome.layout @@ -1,14 +1,9 @@ - + - - - - - - + @@ -21,7 +16,7 @@ - + @@ -31,7 +26,12 @@ - + + + + + + diff --git a/Builds/CB/EmberRender.cbp b/Builds/CB/EmberRender.cbp index fc68f0b..2175287 100644 --- a/Builds/CB/EmberRender.cbp +++ b/Builds/CB/EmberRender.cbp @@ -136,6 +136,8 @@ + + diff --git a/Builds/CB/EmberRender.depend b/Builds/CB/EmberRender.depend index 587bffc..7675f50 100644 --- a/Builds/CB/EmberRender.depend +++ b/Builds/CB/EmberRender.depend @@ -1,8 +1,8 @@ # depslib dependency file v1.0 -1417760119 source:/home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.cpp +1417901704 source:/home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.cpp "EmberCommonPch.h" -1417812217 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommonPch.h @@ -33,17 +33,17 @@ "SimpleGlob.h" "SimpleOpt.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Ember.h +1417915457 /home/heretic/Dev/fractorium/Source/Ember/Ember.h "Xform.h" "PaletteList.h" "SpatialFilter.h" "TemporalFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Xform.h +1417908868 /home/heretic/Dev/fractorium/Source/Ember/Xform.h "VariationList.h" "Interpolate.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/VariationList.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/VariationList.h "Variations01.h" "Variations02.h" "Variations03.h" @@ -51,22 +51,22 @@ "Variations05.h" "VariationsDC.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations01.h +1417907217 /home/heretic/Dev/fractorium/Source/Ember/Variations01.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variation.h +1417917944 /home/heretic/Dev/fractorium/Source/Ember/Variation.h "Point.h" "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Point.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Point.h "EmberDefines.h" "Affine2D.h" "Timing.h" -1417811373 /home/heretic/Dev/fractorium/Source/Ember/EmberDefines.h +1417917311 /home/heretic/Dev/fractorium/Source/Ember/EmberDefines.h "EmberPch.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/EmberPch.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/EmberPch.h @@ -98,6 +98,7 @@ "tbb/parallel_for.h" "tbb/task_scheduler_init.h" "glm/glm.hpp" + "glm/detail/type_int.hpp" "glm/gtc/matrix_transform.hpp" "glm/gtc/type_ptr.hpp" "glm/gtx/string_cast.hpp" @@ -223,64 +224,64 @@ -1417810095 /home/heretic/Dev/fractorium/Source/Ember/Affine2D.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Affine2D.h "Utils.h" -1417776440 /home/heretic/Dev/fractorium/Source/Ember/Utils.h +1417905955 /home/heretic/Dev/fractorium/Source/Ember/Utils.h "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Isaac.h +1417921234 /home/heretic/Dev/fractorium/Source/Ember/Isaac.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Timing.h +1417906341 /home/heretic/Dev/fractorium/Source/Ember/Timing.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations02.h +1417908486 /home/heretic/Dev/fractorium/Source/Ember/Variations02.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations03.h +1417907820 /home/heretic/Dev/fractorium/Source/Ember/Variations03.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations04.h +1417908559 /home/heretic/Dev/fractorium/Source/Ember/Variations04.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Variations05.h +1417908258 /home/heretic/Dev/fractorium/Source/Ember/Variations05.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/VariationsDC.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/VariationsDC.h "Variation.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Interpolate.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/Interpolate.h "Ember.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/PaletteList.h +1417909715 /home/heretic/Dev/fractorium/Source/Ember/PaletteList.h "Palette.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Palette.h +1417908559 /home/heretic/Dev/fractorium/Source/Ember/Palette.h "Utils.h" "Isaac.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/SpatialFilter.h +1417907380 /home/heretic/Dev/fractorium/Source/Ember/SpatialFilter.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/TemporalFilter.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/TemporalFilter.h "EmberDefines.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/EmberToXml.h +1417918151 /home/heretic/Dev/fractorium/Source/Ember/EmberToXml.h "Utils.h" "PaletteList.h" "VariationList.h" "Ember.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/XmlToEmber.h +1417919921 /home/heretic/Dev/fractorium/Source/Ember/XmlToEmber.h "Utils.h" "PaletteList.h" "VariationList.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/Iterator.h +1417928702 /home/heretic/Dev/fractorium/Source/Ember/Iterator.h "Ember.h" -1417810944 /home/heretic/Dev/fractorium/Source/Ember/Renderer.h +1417921679 /home/heretic/Dev/fractorium/Source/Ember/Renderer.h "RendererBase.h" "Iterator.h" "SpatialFilter.h" @@ -289,25 +290,25 @@ "CarToRas.h" "EmberToXml.h" -1417770762 /home/heretic/Dev/fractorium/Source/Ember/RendererBase.h +1417901704 /home/heretic/Dev/fractorium/Source/Ember/RendererBase.h "Utils.h" "Ember.h" "DensityFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/DensityFilter.h +1417915259 /home/heretic/Dev/fractorium/Source/Ember/DensityFilter.h "SpatialFilter.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/CarToRas.h +1417905627 /home/heretic/Dev/fractorium/Source/Ember/CarToRas.h "Point.h" -1417828769 /home/heretic/Dev/fractorium/Source/EmberCL/RendererCL.h +1417928136 /home/heretic/Dev/fractorium/Source/EmberCL/RendererCL.h "EmberCLPch.h" "OpenCLWrapper.h" "IterOpenCLKernelCreator.h" "DEOpenCLKernelCreator.h" "FinalAccumOpenCLKernelCreator.h" -1417766202 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLPch.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLPch.h "Timing.h" "Renderer.h" @@ -324,38 +325,38 @@ -1417770248 /home/heretic/Dev/fractorium/Source/EmberCL/OpenCLWrapper.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/OpenCLWrapper.h "EmberCLPch.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/IterOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/IterOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417764380 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLStructs.h +1417928227 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLStructs.h "EmberCLPch.h" -1417760119 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLFunctions.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/EmberCLFunctions.h "EmberCLPch.h" "EmberCLStructs.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/DEOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/DEOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417816098 /home/heretic/Dev/fractorium/Source/EmberCL/FinalAccumOpenCLKernelCreator.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberCL/FinalAccumOpenCLKernelCreator.h "EmberCLPch.h" "EmberCLStructs.h" "EmberCLFunctions.h" -1417760119 /home/heretic/Dev/fractorium/Source/Ember/SheepTools.h +1417905627 /home/heretic/Dev/fractorium/Source/Ember/SheepTools.h "EmberDefines.h" "Isaac.h" "VariationList.h" "Renderer.h" -1417816836 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleGlob.h +1417934059 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleGlob.h @@ -367,26 +368,26 @@ -1417817700 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleOpt.h +1417934252 /home/heretic/Dev/fractorium/Source/EmberCommon/SimpleOpt.h -1417826935 source:/home/heretic/Dev/fractorium/Source/EmberRender/EmberRender.cpp +1417931774 source:/home/heretic/Dev/fractorium/Source/EmberRender/EmberRender.cpp "EmberCommonPch.h" "EmberRender.h" "JpegUtils.h" -1417760119 /home/heretic/Dev/fractorium/Source/EmberRender/EmberRender.h +1417901704 /home/heretic/Dev/fractorium/Source/EmberRender/EmberRender.h "EmberOptions.h" -1417774919 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberOptions.h +1417930466 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberOptions.h "EmberCommon.h" -1417760119 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommon.h +1417930466 /home/heretic/Dev/fractorium/Source/EmberCommon/EmberCommon.h "EmberCommonPch.h" -1417775759 /home/heretic/Dev/fractorium/Source/EmberCommon/JpegUtils.h +1417932245 /home/heretic/Dev/fractorium/Source/EmberCommon/JpegUtils.h "EmberCommonPch.h" diff --git a/Builds/CB/EmberRender.layout b/Builds/CB/EmberRender.layout index 0e85420..091afe1 100644 --- a/Builds/CB/EmberRender.layout +++ b/Builds/CB/EmberRender.layout @@ -1,6 +1,16 @@ + + + + + + + + + + @@ -8,27 +18,22 @@ - - - - - - + - + - + - + - + - + diff --git a/Builds/CB/fractorium.workspace.layout b/Builds/CB/fractorium.workspace.layout index 4647952..db9effd 100644 --- a/Builds/CB/fractorium.workspace.layout +++ b/Builds/CB/fractorium.workspace.layout @@ -1,4 +1,5 @@ + diff --git a/Source/Ember/CarToRas.h b/Source/Ember/CarToRas.h index af920c5..89c5381 100644 --- a/Source/Ember/CarToRas.h +++ b/Source/Ember/CarToRas.h @@ -128,10 +128,10 @@ public: T invSizeW = T(1.0) / carW; T invSizeH = T(1.0) / carH; - m_PixPerImageUnitW = (T)rasW * invSizeW; + m_PixPerImageUnitW = static_cast(rasW) * invSizeW; m_RasLlX = m_PixPerImageUnitW * carLlX; - m_PixPerImageUnitH = (T)rasH * invSizeH; + m_PixPerImageUnitH = static_cast(rasH) * invSizeH; m_RasLlY = m_PixPerImageUnitH * carLlY; m_OneRow = abs(m_CarUrY - m_CarLlY) / m_RasHeight; @@ -158,8 +158,8 @@ public: /// The converted raster y inline void Convert(T cartX, T cartY, size_t& rasX, size_t& rasY) { - rasX = (size_t)(m_PixPerImageUnitW * cartX - m_RasLlX); - rasY = (size_t)(m_RasLlY - (m_PixPerImageUnitH * cartY)); + rasX = static_cast(m_PixPerImageUnitW * cartX - m_RasLlX); + rasY = static_cast(m_RasLlY - (m_PixPerImageUnitH * cartY)); } /// @@ -175,7 +175,7 @@ public: /// The converted single raster buffer index inline void Convert(T cartX, T cartY, size_t& singleBufferIndex) { - singleBufferIndex = (size_t)(m_PixPerImageUnitW * cartX - m_RasLlX) + (m_RasWidth * (size_t)(m_PixPerImageUnitH * cartY - m_RasLlY)); + singleBufferIndex = static_cast(m_PixPerImageUnitW * cartX - m_RasLlX) + (m_RasWidth * static_cast(m_PixPerImageUnitH * cartY - m_RasLlY)); } /// @@ -192,7 +192,7 @@ public: /// The converted single raster buffer index inline void Convert(Point& point, size_t& singleBufferIndex) { - singleBufferIndex = (size_t)(m_PixPerImageUnitW * point.m_X - m_RasLlX) + (m_RasWidth * (size_t)(m_PixPerImageUnitH * point.m_Y - m_RasLlY)); + singleBufferIndex = static_cast(m_PixPerImageUnitW * point.m_X - m_RasLlX) + (m_RasWidth * static_cast(m_PixPerImageUnitH * point.m_Y - m_RasLlY)); } /// diff --git a/Source/Ember/DensityFilter.h b/Source/Ember/DensityFilter.h index 2757a37..01f5c9d 100644 --- a/Source/Ember/DensityFilter.h +++ b/Source/Ember/DensityFilter.h @@ -128,13 +128,13 @@ public: if (decFilterCount > 1e7)//Too many filters. return false; - intFilterCount = (int)ceil(decFilterCount); + intFilterCount = static_cast(ceil(decFilterCount)); //Condense the smaller kernels to save space. if (intFilterCount > keepThresh) { - maxIndex = (int)ceil(DE_THRESH + pow(T(intFilterCount - DE_THRESH), m_Curve)) + 1; - m_MaxFilteredCounts = (int)pow(T(maxIndex - DE_THRESH), T(1.0) / m_Curve) + DE_THRESH; + maxIndex = static_cast(ceil(DE_THRESH + pow(T(intFilterCount - DE_THRESH), m_Curve))) + 1; + m_MaxFilteredCounts = static_cast(pow(T(maxIndex - DE_THRESH), T(1.0) / m_Curve)) + DE_THRESH; } else { @@ -143,7 +143,7 @@ public: } //Allocate the memory for these filters and the hit/width lookup array. - rowSize = (int)(2 * ceil(finalMaxRad) - 1); + rowSize = static_cast(2 * ceil(finalMaxRad) - 1); m_FilterWidth = (rowSize - 1) / 2; m_KernelSize = (m_FilterWidth + 1) * (2 + m_FilterWidth) / 2; @@ -185,7 +185,7 @@ public: { for (dek = -m_FilterWidth; dek <= m_FilterWidth; dek++) { - filterVal = sqrt((T)(dej * dej + dek * dek)) / filterHeight; + filterVal = sqrt(T(dej * dej + dek * dek)) / filterHeight; //Only populate the coefs within this radius. if (filterVal <= 1.0) @@ -344,4 +344,4 @@ private: vector m_Widths; vector m_CoefIndices; }; -} \ No newline at end of file +} diff --git a/Source/Ember/Ember.h b/Source/Ember/Ember.h index e3a4b79..e71ad62 100644 --- a/Source/Ember/Ember.h +++ b/Source/Ember/Ember.h @@ -370,7 +370,7 @@ public: Xform* GetXform(size_t i) const { if (i < XformCount()) - return (Xform*)&m_Xforms[i]; + return const_cast*>(&m_Xforms[i]); else return nullptr; } @@ -384,9 +384,9 @@ public: Xform* GetTotalXform(size_t i, bool forceFinal = false) const { if (i < XformCount()) - return (Xform*)&m_Xforms[i]; + return const_cast*>(&m_Xforms[i]); else if (i == XformCount() || forceFinal) - return (Xform*)&m_FinalXform; + return const_cast*>(&m_FinalXform); else return nullptr; } @@ -402,7 +402,7 @@ public: for (size_t i = 0; i < m_Xforms.size(); i++) if (GetXform(i) == xform) - return (intmax_t)i; + return intmax_t(i); return index; } @@ -418,7 +418,7 @@ public: for (size_t i = 0; i < totalXformCount; i++) if (GetTotalXform(i) == xform) - return (intmax_t)i; + return intmax_t(i); return -1; } @@ -1478,7 +1478,7 @@ public: //The multiplier in size of the histogram and DE filtering buffers. Must be at least one, preferrably never larger than 4, only useful at 2. //Xml field: "supersample" or "overample (deprecated)". size_t m_Supersample; - + //When animating, split each pass into this many pieces, each doing a fraction of the total iterations. Each temporal sample //will render an interpolated instance of the ember that is a fraction of the current ember and the next one. //When rendering a single image, this field is always set to 1. @@ -1711,7 +1711,7 @@ private: for (size_t k = 0; k < size; k++) t += coefs[k] * embers[k].*m; - this->*m = (size_t)Rint(t); + this->*m = size_t(Rint(t)); } /// diff --git a/Source/Ember/EmberDefines.h b/Source/Ember/EmberDefines.h index cc0d6fc..6d9eebd 100644 --- a/Source/Ember/EmberDefines.h +++ b/Source/Ember/EmberDefines.h @@ -61,7 +61,10 @@ namespace EmberNs #define COLORMAP_LENGTH_MINUS_1 255 #define WHITE 255 #define DEFAULT_SBS (1024 * 10) -#define XC (const xmlChar*) +//#define XC(c) ((const xmlChar*)(c)) +#define XC(c) (reinterpret_cast(c)) +#define CX(c) (reinterpret_cast(c)) +#define CCX(c) (reinterpret_cast(c)) #define BadVal(x) (((x) != (x)) || ((x) > 1e10) || ((x) < -1e10)) #define Rint(A) floor((A) + (((A) < 0) ? T(-0.5) : T(0.5))) #define Vlen(x) (sizeof(x) / sizeof(*x)) diff --git a/Source/Ember/EmberToXml.h b/Source/Ember/EmberToXml.h index 7b59877..7e0b24a 100644 --- a/Source/Ember/EmberToXml.h +++ b/Source/Ember/EmberToXml.h @@ -231,9 +231,9 @@ public: { size_t idx = 8 * i + j; - os << hex << setw(2) << setfill('0') << (int)Rint(ember.m_Palette[idx][0] * 255); - os << hex << setw(2) << setfill('0') << (int)Rint(ember.m_Palette[idx][1] * 255); - os << hex << setw(2) << setfill('0') << (int)Rint(ember.m_Palette[idx][2] * 255); + os << hex << setw(2) << setfill('0') << int(Rint(ember.m_Palette[idx][0] * 255)); + os << hex << setw(2) << setfill('0') << int(Rint(ember.m_Palette[idx][1] * 255)); + os << hex << setw(2) << setfill('0') << int(Rint(ember.m_Palette[idx][2] * 255)); } os << endl; @@ -255,14 +255,14 @@ public: if (IsClose(a, 255.0)) { if (intPalette) - os << ""; + os << ""; else os << ""; } else { if (intPalette) - os << " "; + os << " "; else os << " "; } @@ -300,13 +300,13 @@ public: time_t myTime; string s; xmlDocPtr commentDoc = nullptr; - xmlDocPtr doc = xmlNewDoc(XC "1.0"); + xmlDocPtr doc = xmlNewDoc(XC("1.0")); xmlNodePtr rootNode = nullptr, node = nullptr, nodeCopy = nullptr; xmlNodePtr rootComment = nullptr; ostringstream os; //Create the root node, called "edit". - rootNode = xmlNewNode(nullptr, XC "edit"); + rootNode = xmlNewNode(nullptr, XC("edit")); xmlDocSetRootElement(doc, rootNode); //Add the edit attributes. @@ -321,37 +321,37 @@ public: localt = localtime(&myTime); strftime(timeString, 128, "%a %b %d %H:%M:%S %z %Y", localt);//XXX use standard time format including timezone. #endif - xmlNewProp(rootNode, XC "date", XC timeString); + xmlNewProp(rootNode, XC("date"), XC(timeString)); //Nick. if (nick != "") - xmlNewProp(rootNode, XC "nick", XC nick.c_str()); + xmlNewProp(rootNode, XC("nick"), XC(nick.c_str())); //Url. if (url != "") - xmlNewProp(rootNode, XC "url", XC url.c_str()); + xmlNewProp(rootNode, XC("url"), XC(url.c_str())); if (id != "") - xmlNewProp(rootNode, XC "id", XC id.c_str()); + xmlNewProp(rootNode, XC("id"), XC(id.c_str())); //Action. - xmlNewProp(rootNode, XC "action", XC action.c_str()); + xmlNewProp(rootNode, XC("action"), XC(action.c_str())); //Sheep info. if (sheepGen > 0 && sheepId > 0) { //Create a child node of the root node called sheep. - node = xmlNewChild(rootNode, nullptr, XC "sheep", nullptr); + node = xmlNewChild(rootNode, nullptr, XC("sheep"), nullptr); //Create the sheep attributes. os << sheepGen; s = os.str(); - xmlNewProp(node, XC "generation", XC s.c_str()); + xmlNewProp(node, XC("generation"), XC(s.c_str())); os.str(""); os << sheepId; s = os.str(); - xmlNewProp(node, XC "id", XC s.c_str()); + xmlNewProp(node, XC("id"), XC(s.c_str())); os.str(""); } @@ -368,16 +368,16 @@ public: node = xmlDocGetRootElement(parent0->m_Edits); nodeCopy = xmlCopyNode(node, 1); AddFilenameWithoutAmpersand(nodeCopy, parent0->m_ParentFilename); - - xmlNewProp(nodeCopy, XC "index", XC s.c_str()); + + xmlNewProp(nodeCopy, XC("index"), XC(s.c_str())); xmlAddChild(rootNode, nodeCopy); } else { //Insert a (parent has no edit) message. - nodeCopy = xmlNewChild(rootNode, nullptr, XC "edit", nullptr); + nodeCopy = xmlNewChild(rootNode, nullptr, XC("edit"), nullptr); AddFilenameWithoutAmpersand(nodeCopy, parent0->m_ParentFilename); - xmlNewProp(nodeCopy, XC "index", XC s.c_str()); + xmlNewProp(nodeCopy, XC("index"), XC(s.c_str())); } os.str(""); @@ -394,15 +394,15 @@ public: node = xmlDocGetRootElement(parent1->m_Edits); nodeCopy = xmlCopyNode(node, 1); AddFilenameWithoutAmpersand(nodeCopy, parent1->m_ParentFilename); - xmlNewProp(nodeCopy, XC "index", XC s.c_str()); + xmlNewProp(nodeCopy, XC("index"), XC(s.c_str())); xmlAddChild(rootNode, nodeCopy); } else { //Insert a (parent has no edit) message. - nodeCopy = xmlNewChild(rootNode, nullptr, XC "edit",nullptr); + nodeCopy = xmlNewChild(rootNode, nullptr, XC("edit"),nullptr); AddFilenameWithoutAmpersand(nodeCopy, parent1->m_ParentFilename); - xmlNewProp(nodeCopy, XC "index", XC s.c_str()); + xmlNewProp(nodeCopy, XC("index"), XC(s.c_str())); } os.str(""); @@ -419,7 +419,7 @@ public: { os << "" << comment << ""; s = os.str(); - commentDoc = xmlReadMemory(s.c_str(), (int)s.length(), "comment.env", nullptr, XML_PARSE_NONET); + commentDoc = xmlReadMemory(s.c_str(), int(s.length()), "comment.env", nullptr, XML_PARSE_NONET); os.str(""); //Check for errors. @@ -617,9 +617,9 @@ private: for (curAtt = attPtr; curAtt; curAtt = curAtt->next) { - attStr = (char*)xmlGetProp(editNode, curAtt->name); + attStr = CX(xmlGetProp(editNode, curAtt->name)); os << " " << curAtt->name << "=\"" << attStr << "\""; - xmlFree((void*)attStr); + xmlFree(reinterpret_cast(const_cast(attStr))); } //Does this node have children? @@ -695,7 +695,7 @@ private: } else if (editNode->type == XML_TEXT_NODE) { - string s((char*)xmlNodeGetContent(editNode)); + string s(reinterpret_cast(xmlNodeGetContent(editNode))); os << Trim(s); } @@ -709,11 +709,11 @@ private: string filenameWithoutAmpersands = filename; FindAndReplace(filenameWithoutAmpersands, "&", "&"); - xmlNewProp(node, XC "filename", XC filenameWithoutAmpersands.c_str()); + xmlNewProp(node, XC("filename"), XC(filenameWithoutAmpersands.c_str())); } else { - xmlNewProp(node, XC "filename", XC filename.c_str()); + xmlNewProp(node, XC("filename"), XC(filename.c_str())); } } }; diff --git a/Source/Ember/Isaac.h b/Source/Ember/Isaac.h index 680cfbb..10746f6 100644 --- a/Source/Ember/Isaac.h +++ b/Source/Ember/Isaac.h @@ -118,7 +118,7 @@ public: template inline floatType Frand(floatType fMin, floatType fMax) { - floatType f = (floatType)Rand() / (floatType)std::numeric_limits::max(); + floatType f = static_cast(Rand()) / static_cast(std::numeric_limits::max()); return fMin + (f * (fMax - fMin)); } @@ -261,7 +261,7 @@ public: if (s == nullptr)//Default to using time plus index as the seed if s was nullptr. { for (int i = 0; i < N; i++) - m_Rc.randrsl[i] = (T)time(0) + i; + m_Rc.randrsl[i] = static_cast(time(nullptr)) + i; } else { @@ -272,9 +272,9 @@ public: #ifndef ISAAC_FLAM3_DEBUG if (a == 0 && b == 0 && c == 0) { - m_Rc.randa = (T)time(nullptr); - m_Rc.randb = (T)time(nullptr) * (T)time(nullptr); - m_Rc.randc = (T)time(nullptr) * (T)time(nullptr) * (T)time(nullptr); + m_Rc.randa = static_cast(time(nullptr)); + m_Rc.randb = static_cast(time(nullptr)) * static_cast(time(nullptr)); + m_Rc.randc = static_cast(time(nullptr)) * static_cast(time(nullptr)) * static_cast(time(nullptr)); } else #endif @@ -351,9 +351,9 @@ protected: inline T Ind(T* mm, T x) { #ifndef __ISAAC64 - return (*(T*)((byte*)(mm) + ((x) & ((N - 1) << 2)))); + return (*reinterpret_cast(reinterpret_cast(mm) + ((x) & ((N - 1) << 2)))); #else // __ISAAC64 - return (*(T*)((byte*)(mm) + ((x) & ((N - 1) << 3)))); + return (*reinterpret_cast(reinterpret_cast(mm) + ((x) & ((N - 1) << 3)))); #endif // __ISAAC64 } diff --git a/Source/Ember/Iterator.h b/Source/Ember/Iterator.h index bd66f3e..72793e1 100644 --- a/Source/Ember/Iterator.h +++ b/Source/Ember/Iterator.h @@ -69,7 +69,7 @@ public: /// Accessors. /// const byte* XformDistributions() const { return m_XformDistributions.empty() ? nullptr : &m_XformDistributions[0]; } - const size_t XformDistributionsSize() const { return m_XformDistributions.size(); } + size_t XformDistributionsSize() const { return m_XformDistributions.size(); } /// /// Virtual empty iteration function that will be overidden in derived iterator classes. @@ -146,7 +146,7 @@ public: while (tempDensity < currentDensityLimit && j < CHOOSE_XFORM_GRAIN) { //printf("offset = %d, xform = %d, running sum = %f\n", j, i, tempDensity); - m_XformDistributions[(distrib * CHOOSE_XFORM_GRAIN) + j] = (byte)i; + m_XformDistributions[(distrib * CHOOSE_XFORM_GRAIN) + j] = byte(i); tempDensity += densityPerElement; j++; } @@ -259,7 +259,7 @@ protected: /// size_t NextXformFromIndex(size_t index, size_t distribOffset = 0) { - return (size_t)m_XformDistributions[(index % CHOOSE_XFORM_GRAIN) + (CHOOSE_XFORM_GRAIN * distribOffset)]; + return size_t(m_XformDistributions[(index % CHOOSE_XFORM_GRAIN) + (CHOOSE_XFORM_GRAIN * distribOffset)]); } vector m_XformDistributions; diff --git a/Source/Ember/Palette.h b/Source/Ember/Palette.h index 3917c0b..3a87213 100644 --- a/Source/Ember/Palette.h +++ b/Source/Ember/Palette.h @@ -88,10 +88,10 @@ public: for (uint i = 0; i < size; i++) { - m_Entries[i].a = (T)palette15[i * 4 + 0]; - m_Entries[i].r = (T)palette15[i * 4 + 1]; - m_Entries[i].g = (T)palette15[i * 4 + 2]; - m_Entries[i].b = (T)palette15[i * 4 + 3]; + m_Entries[i].a = T(palette15[i * 4 + 0]); + m_Entries[i].r = T(palette15[i * 4 + 1]); + m_Entries[i].g = T(palette15[i * 4 + 2]); + m_Entries[i].b = T(palette15[i * 4 + 3]); } } } @@ -307,7 +307,7 @@ public: rgb[1] = 0; rgb[2] = 0; - for (int j = i - (int)blur; j <= i + (int)blur; j++) + for (int j = i - int(blur); j <= i + int(blur); j++) { n++; int k = (256 + j) % 256; @@ -369,9 +369,9 @@ public: { for (uint 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)] = 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)); } } } @@ -545,11 +545,11 @@ public: //Calculate the max-value color (ranged 0 - 1). for (rgbi = 0; rgbi < 3; rgbi++) - newRgb[rgbi] = (bucketT)newls * cBuf[rgbi] / bucketT(255.0); + newRgb[rgbi] = bucketT(newls) * cBuf[rgbi] / bucketT(255.0); //Reduce saturation by the lsratio. Palette::RgbToHsv(newRgb, newhsv); - newhsv[1] *= (bucketT)lsratio; + newhsv[1] *= bucketT(lsratio); Palette::HsvToRgb(newhsv, newRgb); for (rgbi = 0; rgbi < 3; rgbi++) diff --git a/Source/Ember/PaletteList.h b/Source/Ember/PaletteList.h index b882845..13461bb 100644 --- a/Source/Ember/PaletteList.h +++ b/Source/Ember/PaletteList.h @@ -45,7 +45,7 @@ public: if (ReadFile(filename.c_str(), buf)) { - xmlDocPtr doc = xmlReadMemory((const char*)buf.data(), (int)buf.size(), filename.c_str(), nullptr, XML_PARSE_NONET); + xmlDocPtr doc = xmlReadMemory(static_cast(buf.data()), int(buf.size()), filename.c_str(), nullptr, XML_PARSE_NONET); if (doc != nullptr) { @@ -81,7 +81,7 @@ public: { if (i == -1) return &m_Palettes[QTIsaac::GlobalRand->Rand() % Size()]; - else if (i < (int)m_Palettes.size()) + else if (i < int(m_Palettes.size())) return &m_Palettes[i]; } @@ -161,7 +161,7 @@ private: while (attr) { - val = (char*)xmlGetProp(node, attr->name); + val = reinterpret_cast(xmlGetProp(node, attr->name)); if (!Compare(attr->name, "data")) { @@ -172,7 +172,7 @@ private: do { - int ret = sscanf_s((char*)&(val[colorIndex]),"00%2x%2x%2x", &r, &g, &b); + int ret = sscanf_s(static_cast(&(val[colorIndex])),"00%2x%2x%2x", &r, &g, &b); if (ret != 3) { @@ -183,7 +183,7 @@ private: colorIndex += 8; - while (isspace((int)val[colorIndex])) + while (isspace(int(val[colorIndex]))) colorIndex++; palette[colorCount].r = T(r) / T(255);//Store as normalized colors in the range of 0-1. diff --git a/Source/Ember/Renderer.cpp b/Source/Ember/Renderer.cpp index 47c40c6..75a4555 100644 --- a/Source/Ember/Renderer.cpp +++ b/Source/Ember/Renderer.cpp @@ -124,11 +124,11 @@ void Renderer::ComputeBounds() //If the radius of the density estimation filter is greater than the //gutter width, have to pad with more. Otherwise, use the same value. for (size_t i = 0; i < m_Embers.size(); i++) - maxDEFilterWidth = max((size_t)(ceil(m_Embers[i].m_MaxRadDE) * m_Ember.m_Supersample), maxDEFilterWidth); + maxDEFilterWidth = max(size_t(ceil(m_Embers[i].m_MaxRadDE) * m_Ember.m_Supersample), maxDEFilterWidth); //Need an extra ss = (int)floor(m_Supersample / 2.0) of pixels so that a local iteration count for DE can be determined.//SMOULDER if (maxDEFilterWidth > 0) - maxDEFilterWidth += (size_t)Floor(m_Ember.m_Supersample / T(2)); + maxDEFilterWidth += size_t(Floor(m_Ember.m_Supersample / T(2))); //To have a fully present set of pixels for the spatial filter, must //add the DE filter width to the spatial filter width.//SMOULDER @@ -546,7 +546,7 @@ FilterAndAccum: //to be very dark. Correct it by pretending the number of iters done is the exact quality desired and then scale according to that. if (forceOutput) { - T quality = ((T)m_Stats.m_Iters / (T)FinalDimensions()) * (m_Scale * m_Scale); + T quality = (T(m_Stats.m_Iters) / T(FinalDimensions())) * (m_Scale * m_Scale); m_K2 = (Supersample() * Supersample()) / (area * quality * m_TemporalFilter->SumFilt()); } else @@ -654,7 +654,7 @@ EmberImageComments Renderer::ImageComments(EmberStats& stats, size_t ss.imbue(std::locale("")); comments.m_Genome = m_EmberToXml.ToString(m_Ember, "", printEditDepth, false, intPalette, hexPalette); - ss << ((double)stats.m_Badvals / (double)stats.m_Iters);//Percentage of bad values to iters. + ss << (double(stats.m_Badvals) / double(stats.m_Iters));//Percentage of bad values to iters. comments.m_Badvals = ss.str(); ss.str(""); ss << stats.m_Iters; comments.m_NumIters = ss.str(); ss.str("");//Total iters. @@ -804,7 +804,7 @@ eRenderStatus Renderer::LogScaleDensityFilter() //Original did a temporary assignment, then *= logScale, then passed the result to bump_no_overflow(). //Combine here into one operation for a slight speedup. - m_AccumulatorBuckets[index] = m_HistBuckets[index] * (bucketT)logScale; + m_AccumulatorBuckets[index] = m_HistBuckets[index] * bucketT(logScale); } } }); @@ -833,14 +833,14 @@ eRenderStatus Renderer::GaussianDensityFilter() size_t endRow = m_SuperRasH - (Supersample() - 1);//Original did + which is most likely wrong. intmax_t startCol = Supersample() - 1; intmax_t endCol = m_SuperRasW - (Supersample() - 1); - size_t chunkSize = (size_t)ceil(double(endRow - startRow) / double(threads)); + size_t chunkSize = size_t(ceil(double(endRow - startRow) / double(threads))); //parallel_for scales very well, dividing the work almost perfectly among all processors. parallel_for(size_t(0), threads, [&] (size_t threadIndex) { size_t pixelNumber = 0; - int localStartRow = (int)min(startRow + (threadIndex * chunkSize), endRow - 1); - int localEndRow = (int)min(localStartRow + chunkSize, endRow); + int localStartRow = int(min(startRow + (threadIndex * chunkSize), endRow - 1)); + int localEndRow = int(min(localStartRow + chunkSize, endRow)); size_t pixelsThisThread = size_t(localEndRow - localStartRow) * m_SuperRasW; double lastPercent = 0; glm::detail::tvec4 logScaleBucket; @@ -876,9 +876,9 @@ eRenderStatus Renderer::GaussianDensityFilter() //when calculating the density for a box centered on the last row or column. //Clamp here to not run over the edge. intmax_t densityBoxLeftX = (i - min(i, ss)); - intmax_t densityBoxRightX = (i + min(ss, (intmax_t)m_SuperRasW - i - 1)); + intmax_t densityBoxRightX = (i + min(ss, intmax_t(m_SuperRasW) - i - 1)); intmax_t densityBoxTopY = (j - min(j, ss)); - intmax_t densityBoxBottomY = (j + min(ss, (intmax_t)m_SuperRasH - j - 1)); + intmax_t densityBoxBottomY = (j + min(ss, intmax_t(m_SuperRasH) - j - 1)); //Count density in ssxss area. //Original went one col at a time, which is cache inefficient. Go one row at at time here for a slight speedup. @@ -894,9 +894,9 @@ eRenderStatus Renderer::GaussianDensityFilter() if (filterSelect > m_DensityFilter->MaxFilteredCounts()) filterSelectInt = m_DensityFilter->MaxFilterIndex(); else if (filterSelect <= DE_THRESH) - filterSelectInt = (size_t)ceil(filterSelect) - 1; + filterSelectInt = size_t(ceil(filterSelect)) - 1; else - filterSelectInt = DE_THRESH + (size_t)Floor(pow(filterSelect - DE_THRESH, m_DensityFilter->Curve())); + filterSelectInt = DE_THRESH + size_t(Floor(pow(filterSelect - DE_THRESH, m_DensityFilter->Curve()))); //If the filter selected below the min specified clamp it to the min. if (filterSelectInt > m_DensityFilter->MaxFilterIndex()) @@ -904,7 +904,7 @@ eRenderStatus Renderer::GaussianDensityFilter() //Only have to calculate the values for ~1/8 of the square. filterCoefIndex = filterSelectInt * m_DensityFilter->KernelSize(); - arrFilterWidth = (intmax_t)ceil(filterWidths[filterSelectInt]) - 1; + arrFilterWidth = intmax_t(ceil(filterWidths[filterSelectInt])) - 1; for (jj = 0; jj <= arrFilterWidth; jj++) { @@ -1074,46 +1074,46 @@ eRenderStatus Renderer::AccumulatorToFinalImage(byte* pixels, size_t if (BytesPerChannel() == 2) { - p16 = (uint16*)(pixels + pixelsRowStart); + p16 = reinterpret_cast(pixels + pixelsRowStart); if (EarlyClip()) { - p16[0] = (uint16)(Clamp(newBucket.r, 0, 255) * bucketT(256)); - p16[1] = (uint16)(Clamp(newBucket.g, 0, 255) * bucketT(256)); - p16[2] = (uint16)(Clamp(newBucket.b, 0, 255) * bucketT(256)); + p16[0] = uint16(Clamp(newBucket.r, 0, 255) * bucketT(256)); + p16[1] = uint16(Clamp(newBucket.g, 0, 255) * bucketT(256)); + p16[2] = uint16(Clamp(newBucket.b, 0, 255) * bucketT(256)); if (NumChannels() > 3) { if (Transparency()) - p16[3] = (byte)(Clamp(newBucket.a, 0, 1) * bucketT(65535.0)); + p16[3] = byte(Clamp(newBucket.a, 0, 1) * bucketT(65535.0)); else p16[3] = 65535; } } else { - GammaCorrection(*(glm::detail::tvec4*)(&newBucket), background, g, linRange, vibrancy, NumChannels() > 3, true, p16); + GammaCorrection(*(reinterpret_cast*>(&newBucket)), background, g, linRange, vibrancy, NumChannels() > 3, true, p16); } } else { if (EarlyClip()) { - pixels[pixelsRowStart] = (byte)Clamp(newBucket.r, 0, 255); - pixels[pixelsRowStart + 1] = (byte)Clamp(newBucket.g, 0, 255); - pixels[pixelsRowStart + 2] = (byte)Clamp(newBucket.b, 0, 255); + pixels[pixelsRowStart] = byte(Clamp(newBucket.r, 0, 255)); + pixels[pixelsRowStart + 1] = byte(Clamp(newBucket.g, 0, 255)); + pixels[pixelsRowStart + 2] = byte(Clamp(newBucket.b, 0, 255)); if (NumChannels() > 3) { if (Transparency()) - pixels[pixelsRowStart + 3] = (byte)(Clamp(newBucket.a, 0, 1) * bucketT(255.0)); + pixels[pixelsRowStart + 3] = byte(Clamp(newBucket.a, 0, 1) * bucketT(255.0)); else pixels[pixelsRowStart + 3] = 255; } } else { - GammaCorrection(*(glm::detail::tvec4*)(&newBucket), background, g, linRange, vibrancy, NumChannels() > 3, true, pixels + pixelsRowStart); + GammaCorrection(*(reinterpret_cast*>(&newBucket)), background, g, linRange, vibrancy, NumChannels() > 3, true, pixels + pixelsRowStart); } } } @@ -1133,9 +1133,9 @@ eRenderStatus Renderer::AccumulatorToFinalImage(byte* pixels, size_t { byte* p = pixels + (NumChannels() * (i + j * FinalRasW())); - p[0] = (byte)(m_TempEmber.m_Palette[i * 256 / FinalRasW()][0] * WHITE);//The palette is [0..1], output image is [0..255]. - p[1] = (byte)(m_TempEmber.m_Palette[i * 256 / FinalRasW()][1] * WHITE); - p[2] = (byte)(m_TempEmber.m_Palette[i * 256 / FinalRasW()][2] * WHITE); + p[0] = byte(m_TempEmber.m_Palette[i * 256 / FinalRasW()][0] * WHITE);//The palette is [0..1], output image is [0..255]. + p[1] = byte(m_TempEmber.m_Palette[i * 256 / FinalRasW()][1] * WHITE); + p[2] = byte(m_TempEmber.m_Palette[i * 256 / FinalRasW()][2] * WHITE); } } } @@ -1164,7 +1164,7 @@ EmberStats Renderer::Iterate(size_t iterCount, size_t temporalSample { //Timing t2(4); m_IterTimer.Tic(); - size_t totalItersPerThread = (size_t)ceil((double)iterCount / (double)m_ThreadsToUse); + size_t totalItersPerThread = size_t(ceil(double(iterCount) / double(m_ThreadsToUse))); double percent, etaMs; EmberStats stats; @@ -1232,7 +1232,7 @@ EmberStats Renderer::Iterate(size_t iterCount, size_t temporalSample //This assumes the threads progress at roughly the same speed. double(m_LastIter + (m_SubBatch[threadIndex] * m_ThreadsToUse)) / double(ItersPerTemporalSample()) ) + temporalSample - ) / (double)TemporalSamples() + ) / double(TemporalSamples()) ); double percentDiff = percent - m_LastIterPercent; @@ -1305,11 +1305,11 @@ template TemporalFilter* Renderer -template double Renderer::ScaledQuality() const { return (double)m_ScaledQuality; } -template double Renderer::LowerLeftX(bool gutter) const { return (double)(gutter ? m_CarToRas.CarLlX() : m_LowerLeftX); } -template double Renderer::LowerLeftY(bool gutter) const { return (double)(gutter ? m_CarToRas.CarLlY() : m_LowerLeftY); } -template double Renderer::UpperRightX(bool gutter) const { return (double)(gutter ? m_CarToRas.CarUrX() : m_UpperRightX); } -template double Renderer::UpperRightY(bool gutter) const { return (double)(gutter ? m_CarToRas.CarUrY() : m_UpperRightY); } +template double Renderer::ScaledQuality() const { return double(m_ScaledQuality); } +template double Renderer::LowerLeftX(bool gutter) const { return double(gutter ? m_CarToRas.CarLlX() : m_LowerLeftX); } +template double Renderer::LowerLeftY(bool gutter) const { return double(gutter ? m_CarToRas.CarLlY() : m_LowerLeftY); } +template double Renderer::UpperRightX(bool gutter) const { return double(gutter ? m_CarToRas.CarUrX() : m_UpperRightX); } +template double Renderer::UpperRightY(bool gutter) const { return double(gutter ? m_CarToRas.CarUrY() : m_UpperRightY); } template DensityFilterBase* Renderer::GetDensityFilter() { return m_DensityFilter.get(); } /// @@ -1357,9 +1357,9 @@ template size_t Renderer::FuseCount() /// Non-virtual iterator wrappers. /// -template const byte* Renderer::XformDistributions() const { return m_Iterator != nullptr ? m_Iterator->XformDistributions() : nullptr; } -template const size_t Renderer::XformDistributionsSize() const { return m_Iterator != nullptr ? m_Iterator->XformDistributionsSize() : 0; } -template Point* Renderer::Samples(size_t threadIndex) const { return threadIndex < m_Samples.size() ? (Point*)m_Samples[threadIndex].data() : nullptr; } +template const byte* Renderer::XformDistributions() const { return m_Iterator != nullptr ? m_Iterator->XformDistributions() : nullptr; } +template size_t Renderer::XformDistributionsSize() const { return m_Iterator != nullptr ? m_Iterator->XformDistributionsSize() : 0; } +template Point* Renderer::Samples(size_t threadIndex) const { return threadIndex < m_Samples.size() ? const_cast*>(m_Samples[threadIndex].data()) : nullptr; } /// /// Non-virtual functions that might be needed by a derived class. @@ -1465,8 +1465,8 @@ void Renderer::Accumulate(QTIsaac& rand, Poin //Use overloaded addition and multiplication operators in vec4 to perform the accumulation. if (PaletteMode() == PALETTE_LINEAR) { - colorIndex = (bucketT)p.m_ColorX * COLORMAP_LENGTH; - intColorIndex = (size_t)colorIndex; + colorIndex = bucketT(p.m_ColorX) * COLORMAP_LENGTH; + intColorIndex = size_t(colorIndex); if (intColorIndex < 0) { @@ -1480,22 +1480,22 @@ void Renderer::Accumulate(QTIsaac& rand, Poin } else { - colorIndexFrac = colorIndex - (bucketT)intColorIndex;//Interpolate between intColorIndex and intColorIndex + 1. + colorIndexFrac = colorIndex - bucketT(intColorIndex);//Interpolate between intColorIndex and intColorIndex + 1. } if (p.m_VizAdjusted == 1) m_HistBuckets[histIndex] += ((dmap[intColorIndex] * (1 - colorIndexFrac)) + (dmap[intColorIndex + 1] * colorIndexFrac)); else - m_HistBuckets[histIndex] += (((dmap[intColorIndex] * (1 - colorIndexFrac)) + (dmap[intColorIndex + 1] * colorIndexFrac)) * (bucketT)p.m_VizAdjusted); + m_HistBuckets[histIndex] += (((dmap[intColorIndex] * (1 - colorIndexFrac)) + (dmap[intColorIndex + 1] * colorIndexFrac)) * bucketT(p.m_VizAdjusted)); } else if (PaletteMode() == PALETTE_STEP) { - intColorIndex = Clamp((size_t)(p.m_ColorX * COLORMAP_LENGTH), 0, COLORMAP_LENGTH_MINUS_1); + intColorIndex = Clamp(size_t(p.m_ColorX * COLORMAP_LENGTH), 0, COLORMAP_LENGTH_MINUS_1); if (p.m_VizAdjusted == 1) m_HistBuckets[histIndex] += dmap[intColorIndex]; else - m_HistBuckets[histIndex] += (dmap[intColorIndex] * (bucketT)p.m_VizAdjusted); + m_HistBuckets[histIndex] += (dmap[intColorIndex] * bucketT(p.m_VizAdjusted)); } } } @@ -1514,7 +1514,7 @@ void Renderer::Accumulate(QTIsaac& rand, Poin template void Renderer::AddToAccum(const glm::detail::tvec4& bucket, intmax_t i, intmax_t ii, intmax_t j, intmax_t jj) { - if (j + jj >= 0 && j + jj < (intmax_t)m_SuperRasH && i + ii >= 0 && i + ii < (intmax_t)m_SuperRasW) + if (j + jj >= 0 && j + jj < intmax_t(m_SuperRasH) && i + ii >= 0 && i + ii < intmax_t(m_SuperRasW)) m_AccumulatorBuckets[(i + ii) + ((j + jj) * m_SuperRasW)] += bucket; } @@ -1573,17 +1573,17 @@ void Renderer::GammaCorrection(glm::detail::tvec4(a, 0, 255);//Early clip, just assign directly. + correctedChannels[rgbi] = accumT(Clamp(a, 0, 255));//Early clip, just assign directly. else - correctedChannels[rgbi] = (accumT)(Clamp(a, 0, 255) * scaleVal);//Final accum, multiply by 1 for 8 bpc, or 256 for 16 bpc. + correctedChannels[rgbi] = accumT(Clamp(a, 0, 255) * scaleVal);//Final accum, multiply by 1 for 8 bpc, or 256 for 16 bpc. } if (doAlpha) { if (!scale) - correctedChannels[3] = (accumT)alpha;//Early clip, just assign alpha directly. + correctedChannels[3] = accumT(alpha);//Early clip, just assign alpha directly. else if (Transparency()) - correctedChannels[3] = (accumT)(alpha * numeric_limits::max());//Final accum, 4 channels, using transparency. Scale alpha from 0-1 to 0-255 for 8 bpc or 0-65535 for 16 bpc. + correctedChannels[3] = accumT(alpha * numeric_limits::max());//Final accum, 4 channels, using transparency. Scale alpha from 0-1 to 0-255 for 8 bpc or 0-65535 for 16 bpc. else correctedChannels[3] = numeric_limits::max();//Final accum, 4 channels, but not using transparency. 255 for 8 bpc, 65535 for 16 bpc. } diff --git a/Source/Ember/Renderer.h b/Source/Ember/Renderer.h index 345ef40..3756715 100644 --- a/Source/Ember/Renderer.h +++ b/Source/Ember/Renderer.h @@ -139,9 +139,9 @@ public: virtual size_t FuseCount() const override; //Non-virtual iterator wrappers. - const byte* XformDistributions() const; - const size_t XformDistributionsSize() const; - Point* Samples(size_t threadIndex) const; + const byte* XformDistributions() const; + size_t XformDistributionsSize() const; + Point* Samples(size_t threadIndex) const; protected: //Non-virtual functions that might be needed by a derived class. diff --git a/Source/Ember/RendererBase.cpp b/Source/Ember/RendererBase.cpp index e15358a..5f7a9c8 100644 --- a/Source/Ember/RendererBase.cpp +++ b/Source/Ember/RendererBase.cpp @@ -280,8 +280,8 @@ size_t RendererBase::FinalBufferSize() const { return FinalRowSize() * size_t RendererBase::PixelSize() const { return NumChannels() * BytesPerChannel(); } size_t RendererBase::GutterWidth() const { return m_GutterWidth; } size_t RendererBase::DensityFilterOffset() const { return m_DensityFilterOffset; } -size_t RendererBase::TotalIterCount(size_t strips) const { return (size_t)((size_t)Round(ScaledQuality()) * FinalRasW() * FinalRasH() * strips); }//Use Round() because there can be some roundoff error when interpolating. -size_t RendererBase::ItersPerTemporalSample() const { return (size_t)ceil(double(TotalIterCount(1)) / double(TemporalSamples())); }//Temporal samples is used with animation, which doesn't support strips, so pass 1. +size_t RendererBase::TotalIterCount(size_t strips) const { return size_t(size_t(Round(ScaledQuality())) * FinalRasW() * FinalRasH() * strips); }//Use Round() because there can be some roundoff error when interpolating. +size_t RendererBase::ItersPerTemporalSample() const { return size_t(ceil(double(TotalIterCount(1)) / double(TemporalSamples()))); }//Temporal samples is used with animation, which doesn't support strips, so pass 1. eProcessState RendererBase::ProcessState() const { return m_ProcessState; } eProcessAction RendererBase::ProcessAction() const { return m_ProcessAction; } EmberStats RendererBase::Stats() const { return m_Stats; } @@ -449,7 +449,7 @@ void RendererBase::ThreadCount(size_t threads, const char* seedString) if (seedString) { memset(seeds, 0, isaacSize * sizeof(ISAAC_INT)); - memcpy((char*)seeds, seedString, min(strlen(seedString), isaacSize * sizeof(ISAAC_INT))); + memcpy(reinterpret_cast(seeds), seedString, min(strlen(seedString), isaacSize * sizeof(ISAAC_INT))); } //This is critical for multithreading, otherwise the threads all happen @@ -460,7 +460,7 @@ void RendererBase::ThreadCount(size_t threads, const char* seedString) if (seedString) { - ISAAC_INT newSize = (ISAAC_INT)(size + 5 + (t.Toc() + t.EndTime())); + ISAAC_INT newSize = ISAAC_INT(size + 5 + (t.Toc() + t.EndTime())); #ifdef ISAAC_FLAM3_DEBUG QTIsaac isaac(0, 0, 0, seeds); @@ -470,18 +470,18 @@ void RendererBase::ThreadCount(size_t threads, const char* seedString) m_Rand.push_back(isaac); for (i = 0; i < (isaacSize * sizeof(ISAAC_INT)); i++) - ((byte*)seeds)[i]++; + reinterpret_cast(seeds)[i]++; } else { for (i = 0; i < isaacSize; i++) { t.Toc(); - seeds[i] = (ISAAC_INT)((t.EndTime() * i) + (size + 1)); + seeds[i] = ISAAC_INT((t.EndTime() * i) + (size + 1)); } t.Toc(); - ISAAC_INT r = (ISAAC_INT)((size * i) + i + t.EndTime()); + ISAAC_INT r = ISAAC_INT((size * i) + i + t.EndTime()); QTIsaac isaac(r, r * 2, r * 3, seeds); m_Rand.push_back(isaac); @@ -611,4 +611,4 @@ bool RendererBase::Aborted() { return m_Abort; } bool RendererBase::InRender() { return m_InRender; } bool RendererBase::InFinalAccum() { return m_InFinalAccum; } -} \ No newline at end of file +} diff --git a/Source/Ember/SheepTools.h b/Source/Ember/SheepTools.h index 7ccbf47..8eb4e43 100644 --- a/Source/Ember/SheepTools.h +++ b/Source/Ember/SheepTools.h @@ -610,7 +610,7 @@ public: { vector useVars; - Random(ember, useVars, (int)m_Rand.Frand(-2, 2), 0); + Random(ember, useVars, static_cast(m_Rand.Frand(-2, 2)), 0); } /// @@ -747,7 +747,7 @@ public: if (var != -2) { //Pick a random variation and use a random weight from 0-1. - Variation* v = m_VariationList.GetVariationCopy((size_t)(m_Rand.Rand() % varCount), m_Rand.Frand(T(0.001), 1)); + Variation* v = m_VariationList.GetVariationCopy(static_cast(m_Rand.Rand() % varCount), m_Rand.Frand(T(0.001), 1)); if (v && !xform->AddVariation(v)) delete v;//It already existed and therefore was not added. @@ -782,7 +782,7 @@ public: if (var != -2) { //Pick a random variation and use a random weight from 0-1. - xform->AddVariation(m_VariationList.GetVariationCopy((size_t)(m_Rand.Rand() % varCount), m_Rand.Frand(T(0.001), 1))); + xform->AddVariation(m_VariationList.GetVariationCopy(static_cast(m_Rand.Rand() % varCount), m_Rand.Frand(T(0.001), 1))); } else { @@ -869,8 +869,8 @@ public: //Scale the image so that the total number of pixels is ~10,000. pixTotal = ember.m_FinalRasW * ember.m_FinalRasH; scalar = sqrt(T(10000) / pixTotal); - adjustedEmber.m_FinalRasW = (size_t)(ember.m_FinalRasW * scalar); - adjustedEmber.m_FinalRasH = (size_t)(ember.m_FinalRasH * scalar); + adjustedEmber.m_FinalRasW = static_cast(ember.m_FinalRasW * scalar); + adjustedEmber.m_FinalRasH = static_cast(ember.m_FinalRasH * scalar); adjustedEmber.m_PixelsPerUnit *= scalar; adjustedEmber.m_TemporalSamples = 1; @@ -889,7 +889,7 @@ public: m_Hist.resize(res3); memset(m_Hist.data(), 0, res3); - + p = m_FinalImage.data(); for (i = 0; i < m_Renderer->FinalDimensions(); i++) @@ -1310,7 +1310,7 @@ public: if (eps > T(0.3)) eps = T(0.3); - lowTarget = (size_t)(samples * eps); + lowTarget = static_cast(samples * eps); highTarget = samples - lowTarget; min[0] = min[1] = 1e10; diff --git a/Source/Ember/SpatialFilter.h b/Source/Ember/SpatialFilter.h index 6743221..f9d3bbe 100644 --- a/Source/Ember/SpatialFilter.h +++ b/Source/Ember/SpatialFilter.h @@ -110,7 +110,7 @@ public: T fw = T(2.0) * m_Support * m_Supersample * m_FilterRadius / m_PixelAspectRatio; T adjust, ii, jj; - int fwidth = ((int)fw) + 1; + int fwidth = int(fw) + 1; int i, j; //Make sure the filter kernel has same parity as oversample. @@ -147,7 +147,7 @@ public: m_FinalFilterWidth = fwidth; break; } - + m_FilterRadius += T(0.01);//Values were too small. } while (1); } diff --git a/Source/Ember/Timing.h b/Source/Ember/Timing.h index d6de627..9ab96b8 100644 --- a/Source/Ember/Timing.h +++ b/Source/Ember/Timing.h @@ -62,13 +62,13 @@ public: /// Return the begin time as a double. /// /// - double BeginTime() { return (double)m_BeginTime.time_since_epoch().count(); } + double BeginTime() { return static_cast(m_BeginTime.time_since_epoch().count()); } /// /// Return the end time as a double. /// /// - double EndTime() { return (double)m_EndTime.time_since_epoch().count(); } + double EndTime() { return static_cast(m_EndTime.time_since_epoch().count()); } /// /// Return the elapsed time in milliseconds. @@ -103,13 +103,13 @@ public: double days = x; if (days >= 1) - ss << (int)days << "d "; + ss << static_cast(days) << "d "; if (hours >= 1) - ss << (int)hours << "h "; + ss << static_cast(hours) << "h "; if (mins >= 1) - ss << (int)mins << "m "; + ss << static_cast(mins) << "m "; ss << std::fixed << std::setprecision(m_Precision) << secs << "s"; return ss.str(); diff --git a/Source/Ember/Utils.h b/Source/Ember/Utils.h index b52c1ef..aad52ab 100644 --- a/Source/Ember/Utils.h +++ b/Source/Ember/Utils.h @@ -188,11 +188,11 @@ static bool ReadFile(const char* filename, string& buf, bool nullTerminate = tru { buf.resize(statBuf.st_size + (nullTerminate ? 1 : 0));//Allocate vector to be the size of the entire file, with an optional additional character for nullptr. - if (buf.size() == (size_t)(statBuf.st_size + 1))//Ensure allocation succeeded. + if (buf.size() == static_cast(statBuf.st_size + 1))//Ensure allocation succeeded. { size_t bytesRead = fread(&buf[0], 1, statBuf.st_size, f);//Read the entire file at once. - if (bytesRead == (size_t)statBuf.st_size)//Ensure the number of bytes read matched what was requested. + if (bytesRead == (static_cast(statBuf.st_size)))//Ensure the number of bytes read matched what was requested. { if (nullTerminate)//Optionally nullptr terminate if they want to treat it as a string. buf[buf.size() - 1] = 0; @@ -229,7 +229,7 @@ static void CopyVec(vector& dest, const vector& source) dest.resize(source.size()); for (size_t i = 0; i < source.size(); i++) - dest[i] = (T)source[i];//Valid assignment operator between T and U types must be defined somewhere. + dest[i] = static_cast(source[i]);//Valid assignment operator between T and U types must be defined somewhere. } /// @@ -248,7 +248,7 @@ static void CopyVec(vector& dest, const vector& source, std::function(source[i]);//Valid assignment operator between T and U types must be defined somewhere. perElementOperation(dest[i]); } } @@ -287,7 +287,7 @@ static void ClearVec(vector& vec, bool arrayDelete = false) template static inline void Memset(vector& vec, int val = 0) { - memset((void*)vec.data(), val, SizeOf(vec)); + memset(static_cast(vec.data()), val, SizeOf(vec)); } /// @@ -301,11 +301,11 @@ static inline int Floor(T val) { if (val >= 0) { - return (int)val; + return static_cast(val); } else { - int i = (int)val;//Truncate. + int i = static_cast(val);//Truncate. return i - (i > val);//Convert trunc to floor. } } @@ -430,7 +430,7 @@ static inline void ClampGte0Ref(T& val) template static inline T Round(T r) { - return (r > 0) ? (T)Floor(r + T(0.5)) : ceil(r - T(0.5)); + return (r > 0) ? static_cast(Floor(r + T(0.5))) : ceil(r - T(0.5)); } /// @@ -440,8 +440,8 @@ static inline T Round(T r) /// The rounded value static inline float LRint(float x) { - int temp = (x >= 0 ? (int)(x + 0.5f) : (int)(x - 0.5f)); - return (float)temp; + int temp = (x >= 0 ? static_cast(x + 0.5f) : static_cast(x - 0.5f)); + return static_cast(temp); } /// @@ -451,8 +451,8 @@ static inline float LRint(float x) /// The rounded value static inline double LRint(double x) { - glm::int64_t temp = (x >= 0 ? (int64_t)(x + 0.5) : (int64_t)(x - 0.5)); - return (double)temp; + glm::int64_t temp = (x >= 0 ? static_cast(x + 0.5) : static_cast(x - 0.5)); + return static_cast(temp); } /// @@ -468,7 +468,7 @@ static inline T Round6(T r) if (r < 0) r -= 1; - return T(1e-6 * (int)(r + T(0.5))); + return static_cast(1e-6 * static_cast(r + T(0.5))); } /// @@ -480,7 +480,7 @@ static inline T Round6(T r) template static inline T Sign(T v) { - return (v < 0) ? T(-1) : (v > 0) ? T(1) : T(0); + return (v < 0) ? static_cast(-1) : (v > 0) ? static_cast(1) : static_cast(0); } /// @@ -492,7 +492,7 @@ static inline T Sign(T v) template static inline T SignNz(T v) { - return (v < 0) ? T(-1) : T(1); + return (v < 0) ? static_cast(-1) : static_cast(1); } /// @@ -701,7 +701,7 @@ static inline T LogMap(T x) /// True if the comparison matched, else false static inline bool Compare(const xmlChar* name, const char* val) { - return xmlStrcmp(name, XC val) != 0; + return xmlStrcmp(name, XC(val)) != 0; } /// @@ -904,7 +904,7 @@ static #endif uint Arg(char* name, uint def) { - return Arg(name, (int)def); + return Arg(name, static_cast(def)); } /// diff --git a/Source/Ember/Variation.h b/Source/Ember/Variation.h index df70e86..ce39fc2 100644 --- a/Source/Ember/Variation.h +++ b/Source/Ember/Variation.h @@ -1085,7 +1085,7 @@ public: m_AssignType = variation.AssignType(); m_VariationId = variation.VariationId(); m_Weight = T(variation.m_Weight); - m_Xform = typeid(T) == typeid(U) ? (Xform*)variation.ParentXform() : nullptr; + m_Xform = typeid(T) == typeid(U) ? const_cast*>(reinterpret_cast*>(variation.ParentXform())) : nullptr; m_NeedPrecalcSumSquares = variation.NeedPrecalcSumSquares(); m_NeedPrecalcSqrtSumSquares = variation.NeedPrecalcSqrtSumSquares(); m_NeedPrecalcAngles = variation.NeedPrecalcAngles(); @@ -1536,17 +1536,17 @@ public: case INTEGER : { - *m_Param = T((int)max(min((T)Floor(val + T(0.5)), m_Max), m_Min)); + *m_Param = T(int(max(min(T(Floor(val + T(0.5))), m_Max), m_Min))); break; } case INTEGER_NONZERO : default: { - int vi = (int)max(min((T)Floor(val + T(0.5)), m_Max), m_Min); + int vi = int(max(min(T(Floor(val + T(0.5))), m_Max), m_Min)); if (vi == 0) - vi = (int)SignNz(val); + vi = int(SignNz(val)); *m_Param = T(vi); break; diff --git a/Source/Ember/Variations01.h b/Source/Ember/Variations01.h index b464288..a62baf3 100644 --- a/Source/Ember/Variations01.h +++ b/Source/Ember/Variations01.h @@ -1149,7 +1149,7 @@ public: { m_BlobLow = T(0.2) + T(0.5) * rand.Frand01(); m_BlobHigh = T(0.8) + T(0.4) * rand.Frand01(); - m_BlobWaves = (T)(int)(2 + 5 * rand.Frand01()); + m_BlobWaves = T(int(2 + 5 * rand.Frand01())); } protected: @@ -1293,7 +1293,7 @@ public: { T a = helper.m_PrecalcAtanxy; T r = m_Weight * helper.m_PrecalcSqrtSumSquares; - T t = a + m_Fan2Y - m_Fan2Dx * (int)((a + m_Fan2Y) / m_Fan2Dx); + T t = a + m_Fan2Y - m_Fan2Dx * int((a + m_Fan2Y) / m_Fan2Dx); if (t > m_Fan2Dx2) a = a - m_Fan2Dx2; @@ -1390,7 +1390,7 @@ public: { T r = helper.m_PrecalcSqrtSumSquares; - r += -2 * m_Rings2Val2 * (int)((r + m_Rings2Val2) / (2 * m_Rings2Val2)) + r * (1 - m_Rings2Val2); + r += -2 * m_Rings2Val2 * int((r + m_Rings2Val2) / (2 * m_Rings2Val2)) + r * (1 - m_Rings2Val2); helper.Out.x = m_Weight * helper.m_PrecalcSina * r; helper.Out.y = m_Weight * helper.m_PrecalcCosa * r; helper.Out.z = m_Weight * helper.In.z; @@ -1689,7 +1689,7 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { - T tempr = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand((ISAAC_INT)m_Rn)) / m_Power; + T tempr = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand(ISAAC_INT(m_Rn))) / m_Power; T r = m_Weight * pow(helper.m_PrecalcSumSquares, m_Cn); helper.Out.x = r * cos(tempr); @@ -1731,7 +1731,7 @@ public: virtual void Random(QTIsaac& rand) override { m_Dist = 1; - m_Power = (T)(int)(5 * rand.Frand01() + 2); + m_Power = T(int(5 * rand.Frand01() + 2)); } protected: @@ -1769,7 +1769,7 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { - int rnd = (int)(m_Rn * rand.Frand01()); + int rnd = int(m_Rn * rand.Frand01()); T tempr, r = m_Weight * pow(helper.m_PrecalcSumSquares, m_Cn); if ((rnd & 1) == 0) @@ -1851,7 +1851,7 @@ public: virtual void Random(QTIsaac& rand) override { m_Dist = 1; - m_Power = (T)(int)(5 * rand.Frand01() + 2); + m_Power = T(int(5 * rand.Frand01() + 2)); } protected: @@ -2051,7 +2051,7 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { - int sl = (int)(rand.Frand01() * m_Slices + T(0.5)); + int sl = int(rand.Frand01() * m_Slices + T(0.5)); T a = m_Rotation + M_2PI * (sl + rand.Frand01() * m_Thickness) / m_Slices; T r = m_Weight * rand.Frand01(); @@ -2187,7 +2187,7 @@ public: virtual void Random(QTIsaac& rand) override { - m_Sides = (T)(int)(rand.Frand01() * 10 + 3); + m_Sides = T(int(rand.Frand01() * 10 + 3)); m_Power = 3 * rand.Frand01() + 1; m_Circle = 3 * rand.Frand01(); m_Corners = 2 * rand.Frand01() * m_Circle; @@ -2874,7 +2874,7 @@ public: virtual void Random(QTIsaac& rand) override { m_Rnd = rand.Frand01(); - m_M = (T)(int)(rand.Frand01() * 6); + m_M = T(int(rand.Frand01() * 6)); m_N1 = rand.Frand01() * 40; m_N2 = rand.Frand01() * 20; m_N3 = m_N2; @@ -4985,7 +4985,7 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { - T roundx = (T)(int)(helper.In.x >= 0 ? (helper.In.x + T(0.5)) : (helper.In.x - T(0.5))); + T roundx = T(int(helper.In.x >= 0 ? (helper.In.x + T(0.5)) : (helper.In.x - T(0.5)))); T offsetx = helper.In.x - roundx; helper.Out.x = m_Weight * (offsetx * (1 - m_Space) + roundx); @@ -5053,7 +5053,7 @@ public: { T r = helper.m_PrecalcSqrtSumSquares; T a = helper.m_PrecalcAtanyx + m_Swirl * r; - T c = (T)Floor((m_Count * a + T(M_PI)) * T(M_1_PI) * T(0.5)); + T c = T(Floor((m_Count * a + T(M_PI)) * T(M_1_PI) * T(0.5))); a = a * m_CompFac + c * m_Angle; r = m_Weight * (r + m_Hole); @@ -5098,7 +5098,7 @@ public: { m_Angle = T(M_PI) * rand.Frand01(); m_Hole = T(0.5) * rand.Frand11(); - m_Count = (T)Floor(5 * rand.Frand01()) + 1; + m_Count = T(Floor(5 * rand.Frand01())) + 1; m_Swirl = rand.Frand01(); } @@ -5140,9 +5140,9 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { T r = m_Weight * pow(helper.m_PrecalcSumSquares, m_Cn); - int tRand = (int)(m_Rn * rand.Frand01()); + int tRand = int(m_Rn * rand.Frand01()); T a = (helper.m_PrecalcAtanyx + M_2PI * tRand) / m_Power; - T c = (T)Floor((m_Count * a + T(M_PI)) * T(M_1_PI) * T(0.5)); + T c = T(Floor((m_Count * a + T(M_PI)) * T(M_1_PI) * T(0.5))); a = a * m_Cf + c * m_Angle; helper.Out.x = r * cos(a); @@ -5188,9 +5188,9 @@ public: virtual void Random(QTIsaac& rand) override { - m_Power = (T)(int)(5 * rand.Frand01() + 2); + m_Power = T(int(5 * rand.Frand01() + 2)); m_Dist = 1; - m_Count = (T)(int)(3 * rand.Frand01() + 1); + m_Count = T(int(3 * rand.Frand01() + 1)); m_Angle = T(M_PI) * rand.Frand01(); } @@ -5237,7 +5237,7 @@ public: { T r = 1 / Zeps(helper.m_PrecalcSqrtSumSquares); T a = helper.m_PrecalcAtanyx + m_Swirl * r; - T c = (T)Floor((m_Count * a + T(M_PI)) * T(M_1_PI) * T(0.5)); + T c = T(Floor((m_Count * a + T(M_PI)) * T(M_1_PI) * T(0.5))); T compFac = 1 - m_Angle * m_Count * T(M_1_PI) * T(0.5); a = a * compFac + c * m_Angle; @@ -5277,7 +5277,7 @@ public: virtual void Random(QTIsaac& rand) override { m_Angle = T(M_PI) * rand.Frand01(); - m_Count = (T)Floor(5 * rand.Frand01()) + 1; + m_Count = T(Floor(5 * rand.Frand01())) + 1; m_Hole = T(0.5) * rand.Frand11(); m_Swirl = rand.Frand01(); } @@ -6116,7 +6116,7 @@ public: { m_Symmetry = 0; m_AugerWeight = T(0.5) + rand.Frand01() / 2; - m_Freq = (T)Floor(5 * rand.Frand01()) + 1; + m_Freq = T(Floor(5 * rand.Frand01())) + 1; m_Scale = rand.Frand01(); } diff --git a/Source/Ember/Variations02.h b/Source/Ember/Variations02.h index 2febec8..784645e 100644 --- a/Source/Ember/Variations02.h +++ b/Source/Ember/Variations02.h @@ -474,8 +474,8 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { - T x = (T)Floor(helper.In.x * m_InvSize); - T y = (T)Floor(helper.In.y * m_InvSize); + T x = T(Floor(helper.In.x * m_InvSize)); + T y = T(Floor(helper.In.y * m_InvSize)); helper.Out.x = m_V * (x + m_BlurPixelizeScale * (rand.Frand01() - T(0.5)) + T(0.5)); helper.Out.y = m_V * (y + m_BlurPixelizeScale * (rand.Frand01() - T(0.5)) + T(0.5)); @@ -1366,8 +1366,8 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { - T roundX = (T)(int)(helper.In.x >= 0 ? (int)(helper.In.x + T(0.5)) : (int)(helper.In.x - T(0.5))); - T roundY = (T)(int)(helper.In.y >= 0 ? (int)(helper.In.y + T(0.5)) : (int)(helper.In.y - T(0.5))); + T roundX = T(int(helper.In.x >= 0 ? int(helper.In.x + T(0.5)) : int(helper.In.x - T(0.5)))); + T roundY = T(int(helper.In.y >= 0 ? int(helper.In.y + T(0.5)) : int(helper.In.y - T(0.5)))); T offsetX = helper.In.x - roundX; T offsetY = helper.In.y - roundY; @@ -1578,7 +1578,7 @@ public: T rnx = m_Rnd * rand.Frand01(); T rny = m_Rnd * rand.Frand01(); - int isXY = (int)(LRint(helper.In.x * m_Cs) + LRint(helper.In.y * m_Cs)); + int isXY = int(LRint(helper.In.x * m_Cs) + LRint(helper.In.y * m_Cs)); if (isXY % 2) { @@ -3456,7 +3456,7 @@ public: { T x = m_A * helper.In.x + m_B * helper.In.y + m_E; T y = m_C * helper.In.x + m_D * helper.In.y + m_F; - T angle = (atan2(y, x) + M_2PI * rand.Rand((int)m_AbsN)) / m_Power; + T angle = (atan2(y, x) + M_2PI * rand.Rand(int(m_AbsN))) / m_Power; T sina = sin(angle); T cosa = cos(angle); T r = m_Weight * pow(SQR(x) + SQR(y), m_Cn); @@ -3504,7 +3504,7 @@ public: if (m_Power == 0) m_Power = 2; - m_AbsN = T((int)abs(m_Power)); + m_AbsN = T(int(abs(m_Power))); m_Cn = m_Dist / m_Power / 2; } @@ -3837,7 +3837,7 @@ public: { T x = (m_IsOdd != 0) ? helper.In.x : m_Vvar * helper.m_PrecalcAtanxy; T y = (m_IsOdd != 0) ? helper.In.y : m_Vvar2 * log(helper.m_PrecalcSumSquares); - T angle = (atan2(y, x) + M_2PI * rand.Rand((int)m_AbsN)) / m_Nnz; + T angle = (atan2(y, x) + M_2PI * rand.Rand(int(m_AbsN))) / m_Nnz; T r = m_Weight * pow(SQR(x) + SQR(y), m_Cn) * ((m_IsOdd == 0) ? 1 : m_Parity); T sina = sin(angle) * r; T cosa = cos(angle) * r; @@ -3889,7 +3889,7 @@ public: m_Vvar2 = m_Vvar * T(0.5); m_AbsN = abs(m_Nnz); m_Cn = 1 / m_Nnz / 2; - m_IsOdd = T(abs((int)m_Parity) % 2); + m_IsOdd = T(abs(int(m_Parity)) % 2); } protected: @@ -5161,7 +5161,7 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { - T angle = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand((int)m_AbsN)) / m_Power; + T angle = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand(int(m_AbsN))) / m_Power; T r = m_Weight * pow(helper.m_PrecalcSumSquares, m_Cn); T sina = sin(angle); T cosa = cos(angle); @@ -5218,7 +5218,7 @@ public: if (m_Power == 0) m_Power = 2; - m_AbsN = T((int)fabs(m_Power)); + m_AbsN = T(int(fabs(m_Power))); m_Cn = 1 / m_Power / 2; } @@ -5594,7 +5594,7 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { T a = helper.m_PrecalcAtanyx; - int n = rand.Rand((uint)m_Spread); + int n = rand.Rand(uint(m_Spread)); if (a < 0) n++; diff --git a/Source/Ember/Variations03.h b/Source/Ember/Variations03.h index e672cec..243bcbd 100644 --- a/Source/Ember/Variations03.h +++ b/Source/Ember/Variations03.h @@ -278,7 +278,7 @@ public: { T r = Zeps(pow(helper.m_PrecalcSqrtSumSquares, m_Dist)); int n = Floor(m_Power * rand.Frand01()); - T alpha = helper.m_PrecalcAtanyx + n * M_2PI / Zeps((T)Floor(m_Power)); + T alpha = helper.m_PrecalcAtanyx + n * M_2PI / Zeps(T(Floor(m_Power))); T sina = sin(alpha); T cosa = cos(alpha); @@ -923,17 +923,17 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { T f = rand.Frand01() * m_Power * 2; - T angle = (T)(int)(f); + T angle = T(int(f)); f -= angle; T x = f * m_Length; T z = sqrt(1 + SQR(x) - 2 * x * cos(m_Alpha)); - if (((int)angle) % 2) - angle = M_2PI / m_Power * (((int)angle) / 2) + asin(sin(m_Alpha) * x / z); + if (int(angle) % 2) + angle = M_2PI / m_Power * (int(angle) / 2) + asin(sin(m_Alpha) * x / z); else - angle = M_2PI / m_Power * (((int)angle) / 2) - asin(sin(m_Alpha) * x / z); + angle = M_2PI / m_Power * (int(angle) / 2) - asin(sin(m_Alpha) * x / z); z *= sqrt(rand.Frand01()); @@ -1186,7 +1186,7 @@ public: { T xang = (helper.m_PrecalcAtanyx + T(M_PI)) / m_Alpha; - xang = (xang - (int) xang) * m_Alpha; + xang = (xang - int(xang)) * m_Alpha; xang = cos((xang < m_Alpha / 2) ? xang : m_Alpha - xang); T xr = xang > 0 ? m_Radius / xang : 1; @@ -1310,7 +1310,7 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { T xang = (helper.m_PrecalcAtanyx + M_3PI + m_Alpha / 2) / m_Alpha; - T zang = ((xang - (int)xang) * m_Width + (int)xang) * m_Alpha - T(M_PI) - m_Alpha / 2 * m_Width; + T zang = ((xang - int(xang)) * m_Width + int(xang)) * m_Alpha - T(M_PI) - m_Alpha / 2 * m_Width; helper.Out.x = m_Weight * helper.m_PrecalcSqrtSumSquares * cos(zang); helper.Out.y = m_Weight * helper.m_PrecalcSqrtSumSquares * sin(zang); @@ -1495,7 +1495,7 @@ public: T z = helper.In.z / m_AbsN; T r = m_Weight * pow(helper.m_PrecalcSumSquares + SQR(z), m_Cn); T tmp = r * helper.m_PrecalcSqrtSumSquares; - T ang = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand((uint)m_AbsN)) / m_N; + T ang = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand(uint(m_AbsN))) / m_N; helper.Out.x = tmp * cos(ang); helper.Out.y = tmp * sin(ang); @@ -1574,7 +1574,7 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { T r = m_Weight * pow(helper.m_PrecalcSumSquares, m_Cn); - T temp = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand((uint)m_AbsN)) / m_N; + T temp = (helper.m_PrecalcAtanyx + M_2PI * rand.Rand(uint(m_AbsN))) / m_N; helper.Out.x = r * cos(temp); helper.Out.y = r * sin(temp); @@ -3200,7 +3200,7 @@ public: if (a >= 0) { - alt = (int)(a * m_KnPi); + alt = int(a * m_KnPi); if (alt % 2 == 0) a = alt * m_PiKn + fmod(m_KaKn + a, m_PiKn); @@ -3209,7 +3209,7 @@ public: } else { - alt = (int)(-a * m_KnPi); + alt = int(-a * m_KnPi); if (alt % 2 == 1) a = -(alt * m_PiKn + fmod(-m_KaKn - a, m_PiKn)); @@ -3539,7 +3539,7 @@ public: { T tau = T(0.5) * (log(Sqr(helper.In.x + 1) + SQR(helper.In.y)) - log(Sqr(helper.In.x - 1) + SQR(helper.In.y))); T sigma = T(M_PI) - atan2(helper.In.y, helper.In.x + 1) - atan2(helper.In.y, 1 - helper.In.x); - int alt = (int)(sigma * m_CnPi); + int alt = int(sigma * m_CnPi); if (alt % 2 == 0) sigma = alt * m_PiCn + fmod(sigma + m_CaCn, m_PiCn); @@ -3857,7 +3857,7 @@ public: if (helper.In.y > 0) { - alt = (int)(nu * m_CnPi); + alt = int(nu * m_CnPi); if (alt % 2 == 0) nu = alt * m_PiCn + fmod(nu + m_CaCn, m_PiCn); @@ -3866,7 +3866,7 @@ public: } else { - alt = (int)(nu * m_CnPi); + alt = int(nu * m_CnPi); if (alt % 2 == 0) nu = alt * m_PiCn + fmod(nu + m_CaCn, m_PiCn); diff --git a/Source/Ember/Variations04.h b/Source/Ember/Variations04.h index d6c9b43..3e1f409 100644 --- a/Source/Ember/Variations04.h +++ b/Source/Ember/Variations04.h @@ -1533,24 +1533,24 @@ public: switch (rand.Rand(5)) { case 0: - a = (rand.Rand((ISAAC_INT)m_Slices) + rand.Frand01() * m_XThickness) / m_Slices; - r = (rand.Rand((ISAAC_INT)m_Slices) + rand.Frand01() * m_YThickness) / m_Slices; + a = (rand.Rand(ISAAC_INT(m_Slices)) + rand.Frand01() * m_XThickness) / m_Slices; + r = (rand.Rand(ISAAC_INT(m_Slices)) + rand.Frand01() * m_YThickness) / m_Slices; break; case 1: - a = (rand.Rand((ISAAC_INT)m_Slices) + rand.Frand01()) / m_Slices; - r = (rand.Rand((ISAAC_INT)m_Slices) + m_YThickness) / m_Slices; + a = (rand.Rand(ISAAC_INT(m_Slices)) + rand.Frand01()) / m_Slices; + r = (rand.Rand(ISAAC_INT(m_Slices)) + m_YThickness) / m_Slices; break; case 2: - a = (rand.Rand((ISAAC_INT)m_Slices) + m_XThickness) / m_Slices; - r = (rand.Rand((ISAAC_INT)m_Slices) + rand.Frand01()) / m_Slices; + a = (rand.Rand(ISAAC_INT(m_Slices)) + m_XThickness) / m_Slices; + r = (rand.Rand(ISAAC_INT(m_Slices)) + rand.Frand01()) / m_Slices; break; case 3: a = rand.Frand01(); - r = (rand.Rand((ISAAC_INT)m_Slices) + m_YThickness + rand.Frand01() * (1 - m_YThickness)) / m_Slices; + r = (rand.Rand(ISAAC_INT(m_Slices)) + m_YThickness + rand.Frand01() * (1 - m_YThickness)) / m_Slices; break; case 4: default: - a = (rand.Rand((ISAAC_INT)m_Slices) + m_XThickness + rand.Frand01() * (1 - m_XThickness)) / m_Slices; + a = (rand.Rand(ISAAC_INT(m_Slices)) + m_XThickness + rand.Frand01() * (1 - m_XThickness)) / m_Slices; r = rand.Frand01(); break; } @@ -1713,7 +1713,7 @@ public: r1 = pow(fabs(pr1), m_N1_1) + m_Spiral * rho1; r2 = pow(fabs(pr2), m_N1_2); - if ((int)m_Toroidmap == 1) + if (int(m_Toroidmap) == 1) { helper.Out.x = m_Weight * cosr * (r1 + r2 * cosp); helper.Out.y = m_Weight * sinr * (r1 + r2 * cosp); @@ -1908,7 +1908,7 @@ public: helper.Out.y = helper.In.y * rY; //Optional 3D calculation. - if ((int)m_ZOn == 1) + if (int(m_ZOn) == 1) { rZ = m_Weight / pow(t, m_StretchZ); helper.Out.z = helper.In.z * rZ; @@ -1992,7 +1992,7 @@ public: const T c = cos(ang); const int esc = rad > m_Radius; - const int cr0 = (int)m_Zero; + const int cr0 = int(m_Zero); if (cr0 && esc) { @@ -2133,7 +2133,7 @@ public: const T radiusOut = m_Weight * pow(helper.m_PrecalcSumSquares + z * z, m_Cn); const T x = m_A * helper.In.x + m_B * helper.In.y + m_E; const T y = m_C * helper.In.x + m_D * helper.In.y + m_F; - const T tempRand = (T)(int)(rand.Frand01() * m_AbsN); + const T tempRand = T(int(rand.Frand01() * m_AbsN)); const T alpha = (atan2(y, x) + M_2PI * tempRand) / m_Power; const T gamma = radiusOut * helper.m_PrecalcSqrtSumSquares; @@ -2963,7 +2963,7 @@ public: T fp2x; T fp2y; - switch ((int)m_T1) + switch (int(m_T1)) { case 0: fp1x = Sine(m_A1, m_B1, m_C1, m_P1, helper.In.x); @@ -2983,7 +2983,7 @@ public: break; } - switch ((int)m_T2) + switch (int(m_T2)) { case 0: fp2x = Sine(m_A2, m_B2, m_C2, m_P2, helper.In.x); @@ -4115,7 +4115,7 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { - int extended = (int)m_Extended; + int extended = int(m_Extended); T seed = m_AbsSeed; T r = -m_Rotation; T r0 = 0; @@ -4128,8 +4128,8 @@ public: T niter = 0; T x = helper.In.x * m_Scale; T y = helper.In.y * m_Scale; - int intx = (int)Round(x); - int inty = (int)Round(y); + int intx = int(Round(x)); + int inty = int(Round(y)); int randiter; r = x - intx; @@ -4166,11 +4166,11 @@ public: } else { - int xrand = (int)Round(helper.In.x); - int yrand = (int)Round(helper.In.y); + int xrand = int(Round(helper.In.x)); + int yrand = int(Round(helper.In.y)); - seed = (T)Floor(seed); - niter = (T)abs(xrand + yrand + xrand * yrand); + seed = T(Floor(seed)); + niter = T(abs(xrand + yrand + xrand * yrand)); randInt = seed + niter; randiter = 0; @@ -4557,7 +4557,7 @@ protected: } private: - static inline T GdoffsFcip(T a) { return (T)((a < 0) ? -((int)(fabs(a)) + 1) : 0) + ((a > 1) ? ((int)(a)) : 0); } + static inline T GdoffsFcip(T a) { return T((a < 0) ? -(int(fabs(a)) + 1) : 0) + ((a > 1) ? (int(a)) : 0); } static inline T GdoffsFclp(T a) { return ((a < 0) ? -(fmod(fabs(a), T(1))) : fmod(fabs(a), T(1))); } static inline T GdoffsFscl(T a) { return GdoffsFclp((a + 1) / 2); } static inline T GdoffsFosc(T p, T a) { return GdoffsFscl(-1 * cos(p * a * M_2PI)); } @@ -5043,7 +5043,7 @@ public: { m_BlobLow = T(0.2) + T(0.5) * rand.Frand01(); m_BlobHigh = T(0.8) + T(0.4) * rand.Frand01(); - m_BlobWaves = (T)(int)(2 + 5 * rand.Frand01()); + m_BlobWaves = T(int(2 + 5 * rand.Frand01())); } protected: diff --git a/Source/Ember/Variations05.h b/Source/Ember/Variations05.h index 35c3b09..a4b3116 100644 --- a/Source/Ember/Variations05.h +++ b/Source/Ember/Variations05.h @@ -293,7 +293,7 @@ public: if (++iters > 10) break; } - while ((DiscreteNoise2((int)(m + m_Seed), n) > m_Dens) || (u > (T(0.3) + T(0.7) * DiscreteNoise2(m + 10, n + 3)) * m_Sc)); + while ((DiscreteNoise2(int(m + m_Seed), n) > m_Dens) || (u > (T(0.3) + T(0.7) * DiscreteNoise2(m + 10, n + 3)) * m_Sc)); helper.Out.x = m_Weight * (x + (m * 2 + 1) * m_Sc); helper.Out.y = m_Weight * (y + (n * 2 + 1) * m_Sc); @@ -413,7 +413,7 @@ public: y = uy - (n * 2 + 1) * m_Sc; u = Hypot(x, y); - if ((DiscreteNoise2((int)(m + m_Seed), n) > m_Dens) || (u > (T(0.3) + T(0.7) * DiscreteNoise2(m + 10, n + 3)) * m_Sc)) + if ((DiscreteNoise2(int(m + m_Seed), n) > m_Dens) || (u > (T(0.3) + T(0.7) * DiscreteNoise2(m + 10, n + 3)) * m_Sc)) { ux = ux; uy = uy; @@ -565,7 +565,7 @@ private: if (++iters > 10) break; } - while (DiscreteNoise2((int)(m + m_Seed), n) > m_Dens); + while (DiscreteNoise2(int(m + m_Seed), n) > m_Dens); *ux = x + (m * 2 + 1) * m_Sc; *vy = y + (n * 2 + 1) * m_Sc; @@ -1551,7 +1551,7 @@ public: virtual void Func(IteratorHelper& helper, Point& outPoint, QTIsaac& rand) override { - int sl = (int)(rand.Frand01() * m_Slices + T(0.5)); + int sl = int(rand.Frand01() * m_Slices + T(0.5)); T a = m_Rotation + M_2PI * (sl + rand.Frand01() * m_Thickness) / m_Slices; T r = m_Weight * rand.Frand01(); @@ -1585,7 +1585,7 @@ public: virtual void Random(QTIsaac& rand) override { - m_Params[0].Set((int)10 * rand.Frand01());//Slices. + m_Params[0].Set(10 * rand.Frand01());//Slices. m_Params[1].Set(M_2PI * rand.Frand11());//Rotation. m_Thickness = rand.Frand01(); } @@ -1835,8 +1835,8 @@ public: const T xrng = helper.In.x / m_XDistance; const T yrng = helper.In.y / m_YDistance; - helper.Out.x = m_Xw * ((xrng - (int)xrng) * m_XWidth + (int)xrng + (T(0.5) - xpos) * m_1mX); - helper.Out.y = m_Yw * ((yrng - (int)yrng) * m_YWidth + (int)yrng + (T(0.5) - ypos) * m_1mY); + helper.Out.x = m_Xw * ((xrng - int(xrng)) * m_XWidth + int(xrng) + (T(0.5) - xpos) * m_1mX); + helper.Out.y = m_Yw * ((yrng - int(yrng)) * m_YWidth + int(yrng) + (T(0.5) - ypos) * m_1mY); helper.Out.z = m_Weight * helper.In.z; //outPoint.m_X = 0; //outPoint.m_Y = 0; @@ -2125,7 +2125,7 @@ public: T sigma, phi, rad, sigmas, sigmac, phis, phic; T scale, denom; - switch ((int)m_Type) + switch (int(m_Type)) { case 0://Linear. helper.Out.x = m_Weight * (helper.In.x + m_MulX * ax * rs); @@ -2282,7 +2282,7 @@ public: const T distB = m_Invert != 0 ? max(1 - distA, 0) : max(distA, 0);//Original called a macro named min, which internally performed max. const T dist = max((distB - m_MinDist) * m_RMax, 0); - switch ((int)m_Type) + switch (int(m_Type)) { case 0://Linear. { @@ -2477,7 +2477,7 @@ public: const v4T random(rand.Frand(T(-0.5), T(0.5)), rand.Frand(T(-0.5), T(0.5)), rand.Frand(T(-0.5), T(0.5)), rand.Frand(T(-0.5), T(0.5))); T radius; - switch ((int)m_BlurShape) + switch (int(m_BlurShape)) { case 0://Circle. radius = sqrt(Sqr(helper.In.x - m_CenterX) + Sqr(helper.In.y - m_CenterY) + Sqr(helper.In.z - m_CenterZ)); @@ -2490,7 +2490,7 @@ public: const T dist = max(((m_InvertDistance != 0 ? max(1 - radius, 0) : max(radius, 0)) - m_MinDistance) * m_RMax, 0); - switch ((int)m_BlurType) + switch (int(m_BlurType)) { case 0://Gaussian. { @@ -3041,7 +3041,7 @@ public: if (m_Power == 0) m_Power = 2; - m_AbsN = T((int)fabs(m_Power)); + m_AbsN = T(int(fabs(m_Power))); m_Cn = m_Dist / m_Power / 2; } @@ -3092,7 +3092,7 @@ private: { T inx = (be - m_Radius + (al - m_Radius) * m_CosC) / m_SinC; T iny = al - m_Radius; - T angle = (atan2(iny, inx) + M_2PI * (rand.Rand((int)m_AbsN))) / m_Power; + T angle = (atan2(iny, inx) + M_2PI * (rand.Rand(int(m_AbsN)))) / m_Power; T r = m_Weight * pow(SQR(inx) + SQR(iny), m_Cn); x = r * cos(angle); diff --git a/Source/Ember/Xform.h b/Source/Ember/Xform.h index 4c855f4..47f5301 100644 --- a/Source/Ember/Xform.h +++ b/Source/Ember/Xform.h @@ -185,7 +185,7 @@ public: //If this xform was already part of a different ember, then do not assign, else do. if (!m_ParentEmber && (typeid(T) == typeid(U))) - m_ParentEmber = (Ember*)xform.ParentEmber(); + m_ParentEmber = static_cast*>(xform.ParentEmber()); CopyVec(m_Xaos, xform.XaosVec()); CopyVec(m_Motion, xform.m_Motion); diff --git a/Source/Ember/XmlToEmber.h b/Source/Ember/XmlToEmber.h index b3d0573..0f7869f 100644 --- a/Source/Ember/XmlToEmber.h +++ b/Source/Ember/XmlToEmber.h @@ -178,7 +178,7 @@ public: m_FlattenNames.push_back("post_falloff2"); m_FlattenNames.push_back("post_rotate_x"); m_FlattenNames.push_back("post_rotate_y"); - + m_FlattenNames.push_back("curl3D_cz"); //This is a vector of the param names as they are in the legacy, badly named flam3/Apophysis code. @@ -264,10 +264,10 @@ public: m_ErrorReport.clear(); //Parse XML string into internal document. - xmlPtr = (const char*)(&buf[0]); + xmlPtr = CX(&buf[0]); bufSize = strlen(xmlPtr); embers.reserve(bufSize / 2500);//The Xml text for an ember is around 2500 bytes, but can be much more. Pre-allocate to aovid unnecessary resizing. - doc = xmlReadMemory(xmlPtr, (int)bufSize, filename, "ISO-8859-1", XML_PARSE_NONET);//Forbid network access during read. + doc = xmlReadMemory(xmlPtr, int(bufSize), filename, "ISO-8859-1", XML_PARSE_NONET);//Forbid network access during read. //t.Toc("xmlReadMemory"); if (doc == nullptr) @@ -281,7 +281,7 @@ public: //Scan for nodes, starting with this node. //t.Tic(); - bn = basename((char*)filename); + bn = basename(const_cast(filename)); ScanForEmberNodes(rootnode, bn, embers); xmlFreeDoc(doc); emberSize = embers.size(); @@ -349,7 +349,7 @@ public: if (ReadFile(filename, buf)) { std::replace(buf.begin(), buf.end(), '&', '+'); - return Parse((byte*)buf.data(), filename, embers); + return Parse(reinterpret_cast(const_cast(buf.data())), filename, embers); } else return false; @@ -372,7 +372,7 @@ public: errno = 0;//Note that this is not thread-safe. //Convert the string using strtod(). - val = (T)strtod(str, &endp); + val = T(strtod(str, &endp)); //Check errno & return string. if (endp != str + strlen(str)) @@ -399,7 +399,7 @@ public: /// True if success, else false. bool Atoi(const char* str, uint& val) { - return Atoi(str, (int&)val); + return Atoi(str, reinterpret_cast(val)); } /// @@ -562,7 +562,7 @@ private: for (curAtt = att; curAtt; curAtt = curAtt->next) { - attStr = (char*)xmlGetProp(emberNode, curAtt->name); + attStr = reinterpret_cast(xmlGetProp(emberNode, curAtt->name)); //First parse out simple float reads. if (ParseAndAssignFloat(curAtt->name, attStr, "time", currentEmber.m_Time, ret)) { } @@ -723,7 +723,7 @@ private: for (curAtt = att; curAtt; curAtt = curAtt->next) { - attStr = (char*)xmlGetProp(childNode, curAtt->name); + attStr = reinterpret_cast(xmlGetProp(childNode, curAtt->name)); a = 255; //This signifies that a palette is not being retrieved from the palette file, rather it's being parsed directly out of the ember xml. @@ -752,7 +752,7 @@ private: } else { - m_ErrorReport.push_back(string(loc) + " : Unknown color attribute " + string((const char*)curAtt->name)); + m_ErrorReport.push_back(string(loc) + " : Unknown color attribute " + string(CCX(curAtt->name))); } xmlFree(attStr); @@ -789,7 +789,7 @@ private: for (curAtt = att; curAtt; curAtt = curAtt->next) { - attStr = (char*)xmlGetProp(childNode, curAtt->name); + attStr = reinterpret_cast(xmlGetProp(childNode, curAtt->name)); if (!Compare(curAtt->name, "count")) { @@ -804,7 +804,7 @@ private: } else { - m_ErrorReport.push_back(string(loc) + " : Unknown color attribute " + string((const char*)curAtt->name)); + m_ErrorReport.push_back(string(loc) + " : Unknown color attribute " + string(CCX(curAtt->name))); } xmlFree(attStr); @@ -835,7 +835,7 @@ private: for (curAtt = att; curAtt; curAtt = curAtt->next) { - attStr = (char*)xmlGetProp(childNode, curAtt->name); + attStr = reinterpret_cast(xmlGetProp(childNode, curAtt->name)); if (!Compare(curAtt->name, "index0")) { @@ -883,7 +883,7 @@ private: } else { - m_ErrorReport.push_back(string(loc) + " : Unknown palette attribute " + string((const char*)curAtt->name)); + m_ErrorReport.push_back(string(loc) + " : Unknown palette attribute " + string(CCX(curAtt->name))); } xmlFree(attStr); @@ -903,7 +903,7 @@ private: else { //Read formatted string from contents of tag. - char* palStr = (char*)xmlNodeGetContent(childNode); + char* palStr = CX(xmlNodeGetContent(childNode)); if (!ParseHexColors(palStr, currentEmber, numColors, numBytes)) { @@ -928,7 +928,7 @@ private: for (curAtt = att; curAtt; curAtt = curAtt->next) { - attStr = (char*)xmlGetProp(childNode, curAtt->name); + attStr = reinterpret_cast(xmlGetProp(childNode, curAtt->name)); if (!Compare(curAtt->name, "kind")) { @@ -1013,7 +1013,7 @@ private: else if (!Compare(childNode->name, "edit")) { //Create a new XML document with this edit node as the root node. - currentEmber.m_Edits = xmlNewDoc((const xmlChar*)"1.0"); + currentEmber.m_Edits = xmlNewDoc(XC("1.0")); editNode = xmlCopyNode(childNode, 1); xmlDocSetRootElement(currentEmber.m_Edits, editNode); } @@ -1058,7 +1058,7 @@ private: for (curAtt = attPtr; curAtt; curAtt = curAtt->next) { - attStr = (char*)xmlGetProp(childNode, curAtt->name); + attStr = reinterpret_cast(xmlGetProp(childNode, curAtt->name)); //First parse out simple float reads. if (ParseAndAssignFloat(curAtt->name, attStr, "weight", xform.m_Weight, success)) { } @@ -1196,14 +1196,14 @@ private: if (!Compare(curAtt->name, "var1")) { - attStr = (char*)xmlGetProp(childNode, curAtt->name); + attStr = reinterpret_cast(xmlGetProp(childNode, curAtt->name)); for (j = 0; j < xform.TotalVariationCount(); j++) xform.GetVariation(j)->m_Weight = 0; if (Atof(attStr, temp)) { - uint iTemp = (uint)temp; + uint iTemp = static_cast(temp); if (iTemp < xform.TotalVariationCount()) { @@ -1227,7 +1227,7 @@ private: if (!Compare(curAtt->name, "var")) { - attStr = (char*)xmlGetProp(childNode, curAtt->name); + attStr = reinterpret_cast(xmlGetProp(childNode, curAtt->name)); if (Atof(attStr, temp)) { @@ -1252,13 +1252,13 @@ private: { for (curAtt = attPtr; curAtt; curAtt = curAtt->next) { - string s = GetCorrectedParamName(m_BadParamNames, (const char*)curAtt->name); + string s = GetCorrectedParamName(m_BadParamNames, CCX(curAtt->name)); const char* name = s.c_str(); if (parVar->ContainsParam(name)) { T val = 0; - attStr = (char*)xmlGetProp(childNode, curAtt->name); + attStr = CX(xmlGetProp(childNode, curAtt->name)); if (Atof(attStr, val)) { @@ -1309,7 +1309,7 @@ private: { for (size_t i = 0; i < vec.size(); i++) { - if (!_stricmp(vec[i].first.first.c_str(), (const char*)att->name))//Do case insensitive here. + if (!_stricmp(vec[i].first.first.c_str(), CCX(att->name)))//Do case insensitive here. { if (!vec[i].second.empty()) { @@ -1326,7 +1326,7 @@ private: } } - return string((const char*)att->name); + return string(CCX(att->name)); } /// @@ -1341,7 +1341,7 @@ private: do { - if (!_stricmp(name, (const char*)temp->name)) + if (!_stricmp(name, CCX(temp->name))) return true; } while ((temp = temp->next)); @@ -1364,12 +1364,12 @@ private: uint r, g, b, a; int ret; char tmps[2]; - int skip = (int)abs(chan); + int skip = static_cast(abs(chan)); bool ok = true; const char* loc = __FUNCTION__; //Strip whitespace prior to first color. - while (isspace((int)colstr[colorIndex])) + while (isspace(static_cast(colstr[colorIndex]))) colorIndex++; do @@ -1394,7 +1394,7 @@ private: colorIndex += 2 * skip; - while (isspace((int)colstr[colorIndex])) + while (isspace(static_cast(colstr[colorIndex]))) colorIndex++; ember.m_Palette.m_Entries[colorCount].r = T(r) / T(255);//Hex palette is [0..255], convert to [0..1]. @@ -1504,7 +1504,7 @@ private: if (!Compare(name, str)) { b &= Atof(attStr, fval); - val = (intT)fval; + val = static_cast(fval); ret = true;//Means the strcmp() was right, but doesn't necessarily mean the conversion went ok. } diff --git a/Source/EmberAnimate/EmberAnimate.cpp b/Source/EmberAnimate/EmberAnimate.cpp index fed5fe9..d3d5632 100644 --- a/Source/EmberAnimate/EmberAnimate.cpp +++ b/Source/EmberAnimate/EmberAnimate.cpp @@ -190,13 +190,13 @@ bool EmberAnimate(EmberOptions& opt) embers[i].m_SubBatchSize = opt.SubBatchSize(); embers[i].m_Quality *= T(opt.QualityScale()); - embers[i].m_FinalRasW = (uint)((T)embers[i].m_FinalRasW * opt.SizeScale()); - embers[i].m_FinalRasH = (uint)((T)embers[i].m_FinalRasH * opt.SizeScale()); + embers[i].m_FinalRasW = uint(T(embers[i].m_FinalRasW) * opt.SizeScale()); + embers[i].m_FinalRasH = uint(T(embers[i].m_FinalRasH) * opt.SizeScale()); embers[i].m_PixelsPerUnit *= T(opt.SizeScale()); //Cast to double in case the value exceeds 2^32. - double imageMem = (double)channels * (double)embers[i].m_FinalRasW - * (double)embers[i].m_FinalRasH * (double)renderer->BytesPerChannel(); + double imageMem = double(channels) * double(embers[i].m_FinalRasW) + * double(embers[i].m_FinalRasH) * double(renderer->BytesPerChannel()); double maxMem = pow(2.0, double((sizeof(void*) * 8) - 1)); if (imageMem > maxMem)//Ensure the max amount of memory for a process isn't exceeded. @@ -233,10 +233,10 @@ bool EmberAnimate(EmberOptions& opt) if (!opt.Time() && !opt.Frame()) { if (opt.FirstFrame() == UINT_MAX) - opt.FirstFrame((int)embers[0].m_Time); + opt.FirstFrame(int(embers[0].m_Time)); if (opt.LastFrame() == UINT_MAX) - opt.LastFrame(ClampGte((uint)embers.back().m_Time - 1, opt.FirstFrame())); + opt.LastFrame(ClampGte(uint(embers.back().m_Time - 1), opt.FirstFrame())); } if (!opt.Out().empty()) @@ -303,7 +303,7 @@ bool EmberAnimate(EmberOptions& opt) comments = renderer->ImageComments(stats, opt.PrintEditDepth(), opt.IntPalette(), opt.HexPalette()); os.str(""); size_t iterCount = renderer->TotalIterCount(1); - os << comments.m_NumIters << " / " << iterCount << " (" << std::fixed << std::setprecision(2) << ((double)stats.m_Iters / (double)iterCount * 100) << "%)"; + os << comments.m_NumIters << " / " << iterCount << " (" << std::fixed << std::setprecision(2) << double(stats.m_Iters) / double(iterCount * 100) << "%)"; VerbosePrint("\nIters ran/requested: " + os.str()); VerbosePrint("Bad values: " << stats.m_Badvals); @@ -358,7 +358,7 @@ int _tmain(int argc, _TCHAR* argv[]) #ifdef WIN32 _putenv_s("GPU_MAX_ALLOC_PERCENT", "100"); #else - putenv((char*)"GPU_MAX_ALLOC_PERCENT=100"); + putenv(const_cast("GPU_MAX_ALLOC_PERCENT=100")); #endif if (!opt.Populate(argc, argv, OPT_USE_ANIMATE)) diff --git a/Source/EmberCL/DEOpenCLKernelCreator.cpp b/Source/EmberCL/DEOpenCLKernelCreator.cpp index 2863210..4bc0e61 100644 --- a/Source/EmberCL/DEOpenCLKernelCreator.cpp +++ b/Source/EmberCL/DEOpenCLKernelCreator.cpp @@ -188,14 +188,14 @@ uint DEOpenCLKernelCreator::MaxDEFilterSize() { return 9; }//The true max wou template T DEOpenCLKernelCreator::SolveMaxDERad(uint maxBoxSize, T desiredFilterSize, T ss) { - uint finalFilterSize = (uint)((ceil(desiredFilterSize) * ss) + (ss - 1.0)); + uint finalFilterSize = uint((ceil(desiredFilterSize) * ss) + (ss - 1.0)); //Return the desired size if the final size of it will fit. if (finalFilterSize <= MaxDEFilterSize()) return desiredFilterSize; //The final size doesn't fit, so scale the original down until it fits. - return (T)floor((MaxDEFilterSize() - (ss - 1.0)) / ss); + return T(floor((MaxDEFilterSize() - (ss - 1.0)) / ss)); } /// @@ -207,7 +207,7 @@ T DEOpenCLKernelCreator::SolveMaxDERad(uint maxBoxSize, T desiredFilterSize, template uint DEOpenCLKernelCreator::SolveMaxBoxSize(uint localMem) { - return (uint)floor(sqrt(floor((T)localMem / 16.0)));//Divide by 16 because each element is float4. + return uint(floor(sqrt(floor(T(localMem) / 16.0))));//Divide by 16 because each element is float4. } /// diff --git a/Source/EmberCL/OpenCLWrapper.cpp b/Source/EmberCL/OpenCLWrapper.cpp index 9cd5d69..ffc23be 100644 --- a/Source/EmberCL/OpenCLWrapper.cpp +++ b/Source/EmberCL/OpenCLWrapper.cpp @@ -70,7 +70,7 @@ bool OpenCLWrapper::Init(uint platform, uint device, bool shared) m_Device = m_Devices[m_PlatformIndex][device]; m_DeviceVec.clear(); m_DeviceVec.push_back(m_Device); - m_LocalMemSize = (uint)GetInfo(m_PlatformIndex, m_DeviceIndex, CL_DEVICE_LOCAL_MEM_SIZE); + m_LocalMemSize = uint(GetInfo(m_PlatformIndex, m_DeviceIndex, CL_DEVICE_LOCAL_MEM_SIZE)); m_Shared = shared; m_Init = true;//Command queue is ok, it's now ok to begin building and running programs. } @@ -277,9 +277,9 @@ bool OpenCLWrapper::ReadBuffer(uint bufferIndex, void* data, size_t size) /// The index if found, else -1. int OpenCLWrapper::FindBufferIndex(const string& name) { - for (uint i = 0; i < m_Buffers.size(); i++) + for (size_t i = 0; i < m_Buffers.size(); i++) if (m_Buffers[i].m_Name == name) - return (int)i; + return int(i); return -1; } @@ -303,8 +303,8 @@ uint OpenCLWrapper::GetBufferSize(const string& name) /// The size of the buffer if found, else 0. uint OpenCLWrapper::GetBufferSize(uint bufferIndex) { - if (m_Init && bufferIndex < m_Buffers.size()) - return (uint)m_Buffers[bufferIndex].m_Buffer.getInfo(nullptr); + if (m_Init && (bufferIndex < m_Buffers.size())) + return uint(m_Buffers[bufferIndex].m_Buffer.getInfo(nullptr)); return 0; } @@ -355,7 +355,7 @@ bool OpenCLWrapper::AddAndWriteImage(const string& name, cl_mem_flags flags, con m_GLImages.push_back(namedImageGL); if (data) - return WriteImage2D((uint)m_GLImages.size() - 1, true, width, height, row_pitch, data);//OpenGL images/textures require a separate write. + return WriteImage2D(uint(m_GLImages.size() - 1), true, width, height, row_pitch, data);//OpenGL images/textures require a separate write. else return true; } @@ -552,13 +552,13 @@ int OpenCLWrapper::FindImageIndex(const string& name, bool shared) { if (shared) { - for (uint i = 0; i < m_GLImages.size(); i++) + for (size_t i = 0; i < m_GLImages.size(); i++) if (m_GLImages[i].m_Name == name) return i; } else { - for (uint i = 0; i < m_Images.size(); i++) + for (size_t i = 0; i < m_Images.size(); i++) if (m_Images[i].m_Name == name) return i; } @@ -608,7 +608,7 @@ uint OpenCLWrapper::GetImageSize(uint imageIndex, bool shared) } } - return (uint)size; + return uint(size); } /// @@ -920,9 +920,9 @@ bool OpenCLWrapper::SetImageArg(uint kernelIndex, uint argIndex, bool shared, ui /// The index if found, else -1. int OpenCLWrapper::FindKernelIndex(const string& name) { - for (uint i = 0; i < m_Programs.size(); i++) + for (size_t i = 0; i < m_Programs.size(); i++) if (m_Programs[i].m_Name == name) - return (int)i; + return int(i); return -1; } @@ -999,7 +999,7 @@ vector OpenCLWrapper::PlatformNames() platforms.reserve(m_Platforms.size()); - for (uint i = 0; i < m_Platforms.size(); i++) + for (size_t i = 0; i < m_Platforms.size(); i++) platforms.push_back(PlatformName(i)); return platforms; @@ -1172,7 +1172,7 @@ bool OpenCLWrapper::CreateContext(bool shared) { CL_GL_CONTEXT_KHR, (cl_context_properties)wglGetCurrentContext(), CL_WGL_HDC_KHR, (cl_context_properties)wglGetCurrentDC(), - CL_CONTEXT_PLATFORM, (cl_context_properties)(m_Platforms[m_PlatformIndex])(), + CL_CONTEXT_PLATFORM, reinterpret_cast((m_Platforms[m_PlatformIndex])()), 0 }; @@ -1180,9 +1180,9 @@ bool OpenCLWrapper::CreateContext(bool shared) #else cl_context_properties props[] = { - CL_GL_CONTEXT_KHR, (cl_context_properties)glXGetCurrentContext(), - CL_GLX_DISPLAY_KHR, (cl_context_properties)glXGetCurrentDisplay(), - CL_CONTEXT_PLATFORM, (cl_context_properties)(m_Platforms[m_PlatformIndex])(), + CL_GL_CONTEXT_KHR, cl_context_properties(glXGetCurrentContext()), + CL_GLX_DISPLAY_KHR, cl_context_properties(glXGetCurrentDisplay()), + CL_CONTEXT_PLATFORM, reinterpret_cast((m_Platforms[m_PlatformIndex])()), 0 }; @@ -1195,7 +1195,7 @@ bool OpenCLWrapper::CreateContext(bool shared) cl_context_properties props[3] = { CL_CONTEXT_PLATFORM, - (cl_context_properties)(m_Platforms[m_PlatformIndex])(), + reinterpret_cast((m_Platforms[m_PlatformIndex])()), 0 }; diff --git a/Source/EmberCL/RendererCL.cpp b/Source/EmberCL/RendererCL.cpp index 291764d..51fccc4 100644 --- a/Source/EmberCL/RendererCL.cpp +++ b/Source/EmberCL/RendererCL.cpp @@ -107,8 +107,8 @@ bool RendererCL::Init(uint platform, uint device, bool shared, GLuint outputT if (b && !(b = m_Wrapper.AddProgram(m_IterOpenCLKernelCreator.ZeroizeEntryPoint(), zeroizeProgram, m_IterOpenCLKernelCreator.ZeroizeEntryPoint(), m_DoublePrecision))) { m_ErrorReport.push_back(loc); } if (b && !(b = m_Wrapper.AddProgram(m_DEOpenCLKernelCreator.LogScaleAssignDEEntryPoint(), logAssignProgram, m_DEOpenCLKernelCreator.LogScaleAssignDEEntryPoint(), m_DoublePrecision))) { m_ErrorReport.push_back(loc); } - if (b && !(b = m_Wrapper.AddAndWriteImage("Palette", CL_MEM_READ_ONLY, m_PaletteFormat, 256, 1, 0, NULL))) { m_ErrorReport.push_back(loc); } - if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_SeedsBufferName, (void*)m_Seeds.data(), SizeOf(m_Seeds)))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.AddAndWriteImage("Palette", CL_MEM_READ_ONLY, m_PaletteFormat, 256, 1, 0, nullptr))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_SeedsBufferName, reinterpret_cast(m_Seeds.data()), SizeOf(m_Seeds)))) { m_ErrorReport.push_back(loc); } //This is the maximum box dimension for density filtering which consists of (blockSize * blockSize) + (2 * filterWidth). //These blocks must be square, and ideally, 32x32. @@ -141,7 +141,7 @@ bool RendererCL::SetOutputTexture(GLuint outputTexID) m_OutputTexID = outputTexID; EnterResize(); - if (!m_Wrapper.AddAndWriteImage(m_FinalImageName, CL_MEM_WRITE_ONLY, m_FinalFormat, FinalRasW(), FinalRasH(), 0, NULL, m_Wrapper.Shared(), m_OutputTexID)) + if (!m_Wrapper.AddAndWriteImage(m_FinalImageName, CL_MEM_WRITE_ONLY, m_FinalFormat, FinalRasW(), FinalRasH(), 0, nullptr, m_Wrapper.Shared(), m_OutputTexID)) { m_ErrorReport.push_back(loc); success = false; @@ -187,7 +187,7 @@ template bool RendererCL::ReadHist() { if (Renderer::Alloc())//Allocate the memory to read into. - return m_Wrapper.ReadBuffer(m_HistBufferName, (void*)HistBuckets(), SuperSize() * sizeof(v4T)); + return m_Wrapper.ReadBuffer(m_HistBufferName, reinterpret_cast(HistBuckets()), SuperSize() * sizeof(v4T)); return false; } @@ -201,7 +201,7 @@ template bool RendererCL::ReadAccum() { if (Renderer::Alloc())//Allocate the memory to read into. - return m_Wrapper.ReadBuffer(m_AccumBufferName, (void*)AccumulatorBuckets(), SuperSize() * sizeof(v4T)); + return m_Wrapper.ReadBuffer(m_AccumBufferName, reinterpret_cast(AccumulatorBuckets()), SuperSize() * sizeof(v4T)); return false; } @@ -218,7 +218,7 @@ bool RendererCL::ReadPoints(vector>& vec) vec.resize(IterGridKernelCount());//Allocate the memory to read into. if (vec.size() >= IterGridKernelCount()) - return m_Wrapper.ReadBuffer(m_PointsBufferName, (void*)vec.data(), IterGridKernelCount() * sizeof(PointCL)); + return m_Wrapper.ReadBuffer(m_PointsBufferName, reinterpret_cast(vec.data()), IterGridKernelCount() * sizeof(PointCL)); return false; } @@ -230,7 +230,7 @@ bool RendererCL::ReadPoints(vector>& vec) template bool RendererCL::ClearHist() { - return ClearBuffer(m_HistBufferName, (uint)SuperRasW(), (uint)SuperRasH(), sizeof(v4T)); + return ClearBuffer(m_HistBufferName, uint(SuperRasW()), uint(SuperRasH()), sizeof(v4T)); } /// @@ -240,7 +240,7 @@ bool RendererCL::ClearHist() template bool RendererCL::ClearAccum() { - return ClearBuffer(m_AccumBufferName, (uint)SuperRasW(), (uint)SuperRasH(), sizeof(v4T)); + return ClearBuffer(m_AccumBufferName, uint(SuperRasW()), uint(SuperRasH()), sizeof(v4T)); } /// @@ -252,7 +252,7 @@ bool RendererCL::ClearAccum() template bool RendererCL::WritePoints(vector>& vec) { - return m_Wrapper.WriteBuffer(m_PointsBufferName, (void*)vec.data(), vec.size() * sizeof(vec[0])); + return m_Wrapper.WriteBuffer(m_PointsBufferName, reinterpret_cast(vec.data()), SizeOf(vec)); } #ifdef TEST_CL @@ -422,9 +422,9 @@ bool RendererCL::CreateDEFilter(bool& newAlloc) const char* loc = __FUNCTION__; DensityFilter* filter = dynamic_cast*>(GetDensityFilter()); - if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DECoefsBufferName, (void*)filter->Coefs(), filter->CoefsSizeBytes()))) { m_ErrorReport.push_back(loc); } - if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DEWidthsBufferName, (void*)filter->Widths(), filter->WidthsSizeBytes()))) { m_ErrorReport.push_back(loc); } - if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DECoefIndicesBufferName, (void*)filter->CoefIndices(), filter->CoefsIndicesSizeBytes()))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DECoefsBufferName, reinterpret_cast(const_cast(filter->Coefs())), filter->CoefsSizeBytes()))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DEWidthsBufferName, reinterpret_cast(const_cast(filter->Widths())), filter->WidthsSizeBytes()))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DECoefIndicesBufferName, reinterpret_cast(const_cast(filter->CoefIndices())), filter->CoefsIndicesSizeBytes()))) { m_ErrorReport.push_back(loc); } } } else @@ -447,7 +447,7 @@ bool RendererCL::CreateSpatialFilter(bool& newAlloc) if (Renderer::CreateSpatialFilter(newAlloc)) { if (newAlloc) - if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_SpatialFilterCoefsBufferName, (void*)GetSpatialFilter()->Filter(), GetSpatialFilter()->BufferSizeBytes()))) { m_ErrorReport.push_back(__FUNCTION__); } + if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_SpatialFilterCoefsBufferName, reinterpret_cast(GetSpatialFilter()->Filter()), GetSpatialFilter()->BufferSizeBytes()))) { m_ErrorReport.push_back(__FUNCTION__); } } else @@ -507,7 +507,7 @@ bool RendererCL::RandVec(vector>& randVec) if (m_Wrapper.Ok()) { FillSeeds(); - if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_SeedsBufferName, (void*)m_Seeds.data(), SizeOf(m_Seeds)))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_SeedsBufferName, reinterpret_cast(m_Seeds.data()), SizeOf(m_Seeds)))) { m_ErrorReport.push_back(loc); } } return b; @@ -633,11 +633,11 @@ eRenderStatus RendererCL::GaussianDensityFilter() /// /// Run final accumulation. -/// If pixels is NULL, the output will remain in the OpenCL 2D image. -/// However, if pixels is not NULL, the output will be copied. This is +/// If pixels is nullptr, the output will remain in the OpenCL 2D image. +/// However, if pixels is not nullptr, the output will be copied. This is /// useful when rendering in OpenCL, but saving the output to a file. /// -/// The pixels to copy the final image to if not NULL +/// The pixels to copy the final image to if not nullptr /// Offset in the buffer to store the pixels to /// True if success and not aborted, else false. template @@ -645,7 +645,7 @@ eRenderStatus RendererCL::AccumulatorToFinalImage(byte* pixels, size_t finalO { eRenderStatus status = RunFinalAccum(); - if (status == RENDER_OK && pixels != NULL && !m_Wrapper.Shared()) + if (status == RENDER_OK && pixels != nullptr && !m_Wrapper.Shared()) { pixels += finalOffset; @@ -769,10 +769,10 @@ bool RendererCL::RunIter(size_t iterCount, size_t temporalSample, size_t& ite uint fuse, argIndex; uint iterCountPerKernel = IterCountPerKernel(); uint iterCountPerBlock = IterCountPerBlock(); - uint supersize = (uint)SuperSize(); + uint supersize = uint(SuperSize()); int kernelIndex = m_Wrapper.FindKernelIndex(m_IterOpenCLKernelCreator.IterEntryPoint()); size_t fuseFreq = Renderer::SubBatchSize() / m_IterCountPerKernel;//Use the base sbs to determine when to fuse. - size_t itersRemaining, localIterCount = 0; + size_t itersRemaining; double percent, etaMs; const char* loc = __FUNCTION__; @@ -786,10 +786,10 @@ bool RendererCL::RunIter(size_t iterCount, size_t temporalSample, size_t& ite ConvertEmber(m_Ember, m_EmberCL, m_XformsCL); m_CarToRasCL = ConvertCarToRas(*CoordMap()); - if (b && !(b = m_Wrapper.WriteBuffer (m_EmberBufferName, (void*)&m_EmberCL, sizeof(m_EmberCL)))) { m_ErrorReport.push_back(loc); } - if (b && !(b = m_Wrapper.WriteBuffer (m_XformsBufferName, (void*)m_XformsCL.data(), sizeof(m_XformsCL[0]) * m_XformsCL.size()))) { m_ErrorReport.push_back(loc); } - if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DistBufferName, (void*)XformDistributions(), XformDistributionsSize()))) { m_ErrorReport.push_back(loc); }//Will be resized for xaos. - if (b && !(b = m_Wrapper.WriteBuffer (m_CarToRasBufferName, (void*)&m_CarToRasCL, sizeof(m_CarToRasCL)))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.WriteBuffer (m_EmberBufferName, reinterpret_cast(&m_EmberCL), sizeof(m_EmberCL)))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.WriteBuffer (m_XformsBufferName, reinterpret_cast(m_XformsCL.data()), sizeof(m_XformsCL[0]) * m_XformsCL.size()))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DistBufferName, reinterpret_cast(const_cast(XformDistributions())), XformDistributionsSize()))) { m_ErrorReport.push_back(loc); }//Will be resized for xaos. + if (b && !(b = m_Wrapper.WriteBuffer (m_CarToRasBufferName, reinterpret_cast(&m_CarToRasCL), sizeof(m_CarToRasCL)))) { m_ErrorReport.push_back(loc); } if (b && !(b = m_Wrapper.AddAndWriteImage("Palette", CL_MEM_READ_ONLY, m_PaletteFormat, m_DmapCL.m_Entries.size(), 1, 0, m_DmapCL.m_Entries.data()))) { m_ErrorReport.push_back(loc); } @@ -805,19 +805,19 @@ bool RendererCL::RunIter(size_t iterCount, size_t temporalSample, size_t& ite #else //fuse = 100; //fuse = ((m_Calls % fuseFreq) == 0 ? (EarlyClip() ? 100u : 15u) : 0u); - fuse = (uint)((m_Calls % fuseFreq) == 0u ? FuseCount() : 0u); + fuse = uint((m_Calls % fuseFreq) == 0u ? FuseCount() : 0u); //fuse = ((m_Calls % 4) == 0 ? 100u : 0u); #endif itersRemaining = iterCount - itersRan; - uint gridW = (uint)min(ceil((double)itersRemaining / (double)iterCountPerBlock), (double)IterGridBlockWidth()); - uint gridH = (uint)min(ceil((double)itersRemaining / ((double)gridW * iterCountPerBlock)), (double)IterGridBlockHeight()); + uint gridW = uint(min(ceil(double(itersRemaining) / double(iterCountPerBlock)), double(IterGridBlockWidth()))); + uint gridH = uint(min(ceil(double(itersRemaining) / double(gridW * iterCountPerBlock)), double(IterGridBlockHeight()))); uint iterCountThisLaunch = iterCountPerBlock * gridW * gridH; //Similar to what's done in the base class. //The number of iters per thread must be adjusted if they've requested less iters than is normally ran in a block (256 * 256). if (iterCountThisLaunch > iterCount) { - iterCountPerKernel = (uint)ceil((double)iterCount / (double)(gridW * gridH * IterBlockKernelCount())); + iterCountPerKernel = uint(ceil(double(iterCount) / double(gridW * gridH * IterBlockKernelCount()))); iterCountThisLaunch = iterCountPerKernel * (gridW * gridH * IterBlockKernelCount()); } @@ -861,7 +861,7 @@ bool RendererCL::RunIter(size_t iterCount, size_t temporalSample, size_t& ite ( double(m_LastIter + itersRan) / double(ItersPerTemporalSample()) ) + temporalSample - ) / (double)TemporalSamples() + ) / double(TemporalSamples()) ); double percentDiff = percent - m_LastIterPercent; @@ -901,7 +901,6 @@ eRenderStatus RendererCL::RunLogScaleFilter() bool b = true; int kernelIndex = m_Wrapper.FindKernelIndex(m_DEOpenCLKernelCreator.LogScaleAssignDEEntryPoint()); const char* loc = __FUNCTION__; - eRenderStatus status = RENDER_OK; if (kernelIndex != -1) { @@ -914,7 +913,7 @@ eRenderStatus RendererCL::RunLogScaleFilter() OpenCLWrapper::MakeEvenGridDims(blockW, blockH, gridW, gridH); - if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DEFilterParamsBufferName, (void*)&m_DensityFilterCL, sizeof(m_DensityFilterCL)))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DEFilterParamsBufferName, reinterpret_cast(&m_DensityFilterCL), sizeof(m_DensityFilterCL)))) { m_ErrorReport.push_back(loc); } if (b && !(b = m_Wrapper.SetBufferArg(kernelIndex, argIndex++, m_HistBufferName))) { m_ErrorReport.push_back(loc); }//Histogram. if (b && !(b = m_Wrapper.SetBufferArg(kernelIndex, argIndex++, m_AccumBufferName))) { m_ErrorReport.push_back(loc); }//Accumulator. @@ -977,13 +976,13 @@ eRenderStatus RendererCL::RunDensityFilter() //that are far enough apart such that their filters do not overlap. //Do the latter. //Gap is in terms of blocks. How many blocks must separate two blocks running at the same time. - uint gapW = (uint)ceil((m_DensityFilterCL.m_FilterWidth * 2.0) / (double)blockSizeW); + uint gapW = uint(ceil((m_DensityFilterCL.m_FilterWidth * 2.0) / double(blockSizeW))); uint chunkSizeW = gapW + 1; - uint gapH = (uint)ceil((m_DensityFilterCL.m_FilterWidth * 2.0) / (double)blockSizeH); + uint gapH = uint(ceil((m_DensityFilterCL.m_FilterWidth * 2.0) / double(blockSizeH))); uint chunkSizeH = gapH + 1; double totalChunks = chunkSizeW * chunkSizeH; - if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DEFilterParamsBufferName, (void*)&m_DensityFilterCL, sizeof(m_DensityFilterCL)))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_DEFilterParamsBufferName, reinterpret_cast(&m_DensityFilterCL), sizeof(m_DensityFilterCL)))) { m_ErrorReport.push_back(loc); } #ifdef ROW_ONLY_DE blockSizeW = 64;//These *must* both be divisible by 16 or else pixels will go missing. @@ -1079,7 +1078,7 @@ eRenderStatus RendererCL::RunFinalAccum() //This is needed with or without early clip. m_SpatialFilterCL = ConvertSpatialFilter(); - if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_SpatialFilterParamsBufferName, (void*)&m_SpatialFilterCL, sizeof(m_SpatialFilterCL)))) { m_ErrorReport.push_back(loc); } + if (b && !(b = m_Wrapper.AddAndWriteBuffer(m_SpatialFilterParamsBufferName, reinterpret_cast(&m_SpatialFilterCL), sizeof(m_SpatialFilterCL)))) { m_ErrorReport.push_back(loc); } //Since early clip requires gamma correcting the entire accumulator first, //it can't be done inside of the normal final accumulation kernel, so @@ -1323,19 +1322,19 @@ DensityFilterCL RendererCL::ConvertDensityFilter() DensityFilterCL filterCL; DensityFilter* densityFilter = dynamic_cast*>(GetDensityFilter()); - filterCL.m_Supersample = (uint)Supersample(); - filterCL.m_SuperRasW = (uint)SuperRasW(); - filterCL.m_SuperRasH = (uint)SuperRasH(); + filterCL.m_Supersample = uint(Supersample()); + filterCL.m_SuperRasW = uint(SuperRasW()); + filterCL.m_SuperRasH = uint(SuperRasH()); filterCL.m_K1 = K1(); filterCL.m_K2 = K2(); if (densityFilter) { filterCL.m_Curve = densityFilter->Curve(); - filterCL.m_KernelSize = (uint)densityFilter->KernelSize(); - filterCL.m_MaxFilterIndex = (uint)densityFilter->MaxFilterIndex(); - filterCL.m_MaxFilteredCounts = (uint)densityFilter->MaxFilteredCounts(); - filterCL.m_FilterWidth = (uint)densityFilter->FilterWidth(); + filterCL.m_KernelSize = uint(densityFilter->KernelSize()); + filterCL.m_MaxFilterIndex = uint(densityFilter->MaxFilterIndex()); + filterCL.m_MaxFilteredCounts = uint(densityFilter->MaxFilteredCounts()); + filterCL.m_FilterWidth = uint(densityFilter->FilterWidth()); } return filterCL; @@ -1355,17 +1354,17 @@ SpatialFilterCL RendererCL::ConvertSpatialFilter() this->PrepFinalAccumVals(background, g, linRange, vibrancy); - filterCL.m_SuperRasW = (uint)SuperRasW(); - filterCL.m_SuperRasH = (uint)SuperRasH(); - filterCL.m_FinalRasW = (uint)FinalRasW(); - filterCL.m_FinalRasH = (uint)FinalRasH(); - filterCL.m_Supersample = (uint)Supersample(); - filterCL.m_FilterWidth = (uint)GetSpatialFilter()->FinalFilterWidth(); - filterCL.m_NumChannels = (uint)Renderer::NumChannels(); - filterCL.m_BytesPerChannel = (uint)BytesPerChannel(); - filterCL.m_DensityFilterOffset = (uint)DensityFilterOffset(); + filterCL.m_SuperRasW = uint(SuperRasW()); + filterCL.m_SuperRasH = uint(SuperRasH()); + filterCL.m_FinalRasW = uint(FinalRasW()); + filterCL.m_FinalRasH = uint(FinalRasH()); + filterCL.m_Supersample = uint(Supersample()); + filterCL.m_FilterWidth = uint(GetSpatialFilter()->FinalFilterWidth()); + filterCL.m_NumChannels = uint(Renderer::NumChannels()); + filterCL.m_BytesPerChannel = uint(BytesPerChannel()); + filterCL.m_DensityFilterOffset = uint(DensityFilterOffset()); filterCL.m_Transparency = Transparency(); - filterCL.m_YAxisUp = (uint)m_YAxisUp; + filterCL.m_YAxisUp = uint(m_YAxisUp); filterCL.m_Vibrancy = vibrancy; filterCL.m_HighlightPower = HighlightPower(); filterCL.m_Gamma = g; @@ -1441,7 +1440,7 @@ CarToRasCL RendererCL::ConvertCarToRas(const CarToRas& carToRas) { CarToRasCL carToRasCL; - carToRasCL.m_RasWidth = (uint)carToRas.RasWidth(); + carToRasCL.m_RasWidth = uint(carToRas.RasWidth()); carToRasCL.m_PixPerImageUnitW = carToRas.PixPerImageUnitW(); carToRasCL.m_RasLlX = carToRas.RasLlX(); carToRasCL.m_PixPerImageUnitH = carToRas.PixPerImageUnitH(); diff --git a/Source/EmberCL/RendererCL.h b/Source/EmberCL/RendererCL.h index 5c072da..1478851 100644 --- a/Source/EmberCL/RendererCL.h +++ b/Source/EmberCL/RendererCL.h @@ -36,7 +36,21 @@ public: template class EMBERCL_API RendererCL : public Renderer, public RendererCLBase { -using EmberNs::Renderer::RendererBase::EmberReport::m_ErrorReport; +using EmberNs::Renderer::RendererBase::Abort; +using EmberNs::Renderer::RendererBase::EarlyClip; +using EmberNs::Renderer::RendererBase::Transparency; +using EmberNs::Renderer::RendererBase::EnterResize; +using EmberNs::Renderer::RendererBase::LeaveResize; +using EmberNs::Renderer::RendererBase::FinalRasW; +using EmberNs::Renderer::RendererBase::FinalRasH; +using EmberNs::Renderer::RendererBase::SuperRasW; +using EmberNs::Renderer::RendererBase::SuperRasH; +using EmberNs::Renderer::RendererBase::SuperSize; +using EmberNs::Renderer::RendererBase::BytesPerChannel; +using EmberNs::Renderer::RendererBase::TemporalSamples; +using EmberNs::Renderer::RendererBase::ItersPerTemporalSample; +using EmberNs::Renderer::RendererBase::FuseCount; +using EmberNs::Renderer::RendererBase::DensityFilterOffset; using EmberNs::Renderer::RendererBase::m_ProgressParameter; using EmberNs::Renderer::RendererBase::m_YAxisUp; using EmberNs::Renderer::RendererBase::m_LockAccum; @@ -50,8 +64,22 @@ using EmberNs::Renderer::RendererBase::m_Rand; using EmberNs::Renderer::RendererBase::m_RenderTimer; using EmberNs::Renderer::RendererBase::m_IterTimer; using EmberNs::Renderer::RendererBase::m_ProgressTimer; +using EmberNs::Renderer::RendererBase::EmberReport::m_ErrorReport; using EmberNs::Renderer::m_RotMat; using EmberNs::Renderer::m_Ember; +using EmberNs::Renderer::CenterX; +using EmberNs::Renderer::CenterY; +using EmberNs::Renderer::K1; +using EmberNs::Renderer::K2; +using EmberNs::Renderer::Supersample; +using EmberNs::Renderer::HighlightPower; +using EmberNs::Renderer::HistBuckets; +using EmberNs::Renderer::AccumulatorBuckets; +using EmberNs::Renderer::GetDensityFilter; +using EmberNs::Renderer::GetSpatialFilter; +using EmberNs::Renderer::CoordMap; +using EmberNs::Renderer::XformDistributions; +using EmberNs::Renderer::XformDistributionsSize; public: RendererCL(uint platform = 0, uint device = 0, bool shared = false, GLuint outputTexID = 0); diff --git a/Source/EmberCommon/EmberCommon.h b/Source/EmberCommon/EmberCommon.h index 0eea695..0a9016e 100644 --- a/Source/EmberCommon/EmberCommon.h +++ b/Source/EmberCommon/EmberCommon.h @@ -161,7 +161,7 @@ static uint CalcStrips(double memRequired, double memAvailable, double useMem) if (memAvailable >= memRequired) return 1; - strips = (uint)ceil(memRequired / memAvailable); + strips = uint(ceil(memRequired / memAvailable)); return strips; } @@ -290,7 +290,7 @@ static bool StripsRender(RendererBase* renderer, Ember& ember, vector& vector> randVec; ember.m_Quality *= strips; - ember.m_FinalRasH = (size_t)ceil(floatStripH); + ember.m_FinalRasH = size_t(ceil(floatStripH)); if (strips > 1) randVec = renderer->RandVec(); @@ -298,7 +298,7 @@ static bool StripsRender(RendererBase* renderer, Ember& ember, vector& for (size_t strip = 0; strip < strips; strip++) { size_t stripOffset; - + if (yAxisUp) stripOffset = ember.m_FinalRasH * ((strips - strip) - 1) * renderer->FinalRowSize(); else @@ -346,7 +346,7 @@ static bool StripsRender(RendererBase* renderer, Ember& ember, vector& allStripsFinished(ember); } } - + Memset(finalImage); return success; @@ -370,7 +370,7 @@ static size_t VerifyStrips(size_t height, size_t strips, { os << "A strips value of " << strips << " does not divide evenly into a height of " << height << "."; stripError2(os.str()); os.str(""); - + strips = NextHighestEvenDiv(height, strips); if (strips == 1)//No higher divisor, check for a lower one. diff --git a/Source/EmberCommon/EmberOptions.h b/Source/EmberCommon/EmberOptions.h index b72e493..9b17f92 100644 --- a/Source/EmberCommon/EmberOptions.h +++ b/Source/EmberCommon/EmberOptions.h @@ -159,12 +159,12 @@ public: EmberOptionEntry(eOptionUse optUsage, eOptionIDs optId, const CharT* arg, T defaultVal, ESOArgType argType, string docString) { m_OptionUse = optUsage; - m_Option.nId = (int)optId; + m_Option.nId = int(optId); m_Option.pszArg = arg; m_Option.nArgType = argType; m_DocString = docString; m_NameWithoutDashes = Trim(string(arg), '-'); - m_Val = Arg((char*)m_NameWithoutDashes.c_str(), defaultVal); + m_Val = Arg(const_cast(m_NameWithoutDashes.c_str()), defaultVal); } /// diff --git a/Source/EmberCommon/JpegUtils.h b/Source/EmberCommon/JpegUtils.h index 1539ed4..ea186bb 100644 --- a/Source/EmberCommon/JpegUtils.h +++ b/Source/EmberCommon/JpegUtils.h @@ -70,8 +70,8 @@ static bool WriteJpeg(const char* filename, byte* image, size_t width, size_t he jpeg_stdio_dest(&info, file); info.in_color_space = JCS_RGB; info.input_components = 3; - info.image_width = (JDIMENSION)width; - info.image_height = (JDIMENSION)height; + info.image_width = JDIMENSION(width); + info.image_height = JDIMENSION(height); jpeg_set_defaults(&info); jpeg_set_quality(&info, quality, TRUE); jpeg_start_compress(&info, TRUE); @@ -79,36 +79,36 @@ static bool WriteJpeg(const char* filename, byte* image, size_t width, size_t he //Write comments to jpeg. if (enableComments) { - jpeg_write_marker(&info, JPEG_COM, (byte*)verString, (int)strlen(verString)); + jpeg_write_marker(&info, JPEG_COM, reinterpret_cast(verString), strlen(verString)); if (nick != "") { snprintf_s(nickString, 64, "flam3_nickname: %s", nick.c_str()); - jpeg_write_marker(&info, JPEG_COM, (byte*)nickString, (int)strlen(nickString)); + jpeg_write_marker(&info, JPEG_COM, reinterpret_cast(nickString), strlen(nickString)); } if (url != "") { snprintf_s(urlString, 128, "flam3_url: %s", url.c_str()); - jpeg_write_marker(&info, JPEG_COM, (byte*)urlString, (int)strlen(urlString)); + jpeg_write_marker(&info, JPEG_COM, reinterpret_cast(urlString), strlen(urlString)); } if (id != "") { snprintf_s(idString, 128, "flam3_id: %s", id.c_str()); - jpeg_write_marker(&info, JPEG_COM, (byte*)idString, (int)strlen(idString)); + jpeg_write_marker(&info, JPEG_COM, reinterpret_cast(idString), strlen(idString)); } - jpeg_write_marker(&info, JPEG_COM, (byte*)bvString, (int)strlen(bvString)); - jpeg_write_marker(&info, JPEG_COM, (byte*)niString, (int)strlen(niString)); - jpeg_write_marker(&info, JPEG_COM, (byte*)rtString, (int)strlen(rtString)); - jpeg_write_marker(&info, JPEG_COM, (byte*)genomeString, (int)strlen(genomeString)); + jpeg_write_marker(&info, JPEG_COM, reinterpret_cast(bvString), strlen(bvString)); + jpeg_write_marker(&info, JPEG_COM, reinterpret_cast(niString), strlen(niString)); + jpeg_write_marker(&info, JPEG_COM, reinterpret_cast(rtString), strlen(rtString)); + jpeg_write_marker(&info, JPEG_COM, reinterpret_cast(genomeString), strlen(genomeString)); } for (i = 0; i < height; i++) { JSAMPROW row_pointer[1]; - row_pointer[0] = (byte*)image + (3 * width * i); + row_pointer[0] = reinterpret_cast(image) + (3 * width * i); jpeg_write_scanlines(&info, row_pointer, 1); } @@ -150,39 +150,39 @@ static bool WritePng(const char* filename, byte* image, size_t width, size_t hei vector rows(height); text[0].compression = PNG_TEXT_COMPRESSION_NONE; - text[0].key = (png_charp)"flam3_version"; - text[0].text = (png_charp)EmberVersion(); + text[0].key = const_cast("flam3_version"); + text[0].text = const_cast(EmberVersion()); text[1].compression = PNG_TEXT_COMPRESSION_NONE; - text[1].key = (png_charp)"flam3_nickname"; - text[1].text = (png_charp)nick.c_str(); + text[1].key = const_cast("flam3_nickname"); + text[1].text = const_cast(nick.c_str()); text[2].compression = PNG_TEXT_COMPRESSION_NONE; - text[2].key = (png_charp)"flam3_url"; - text[2].text = (png_charp)url.c_str(); + text[2].key = const_cast("flam3_url"); + text[2].text = const_cast(url.c_str()); text[3].compression = PNG_TEXT_COMPRESSION_NONE; - text[3].key = (png_charp)"flam3_id"; - text[3].text = (png_charp)id.c_str(); + text[3].key = const_cast("flam3_id"); + text[3].text = const_cast(id.c_str()); text[4].compression = PNG_TEXT_COMPRESSION_NONE; - text[4].key = (png_charp)"flam3_error_rate"; - text[4].text = (png_charp)comments.m_Badvals.c_str(); + text[4].key = const_cast("flam3_error_rate"); + text[4].text = const_cast(comments.m_Badvals.c_str()); text[5].compression = PNG_TEXT_COMPRESSION_NONE; - text[5].key = (png_charp)"flam3_samples"; - text[5].text = (png_charp)comments.m_NumIters.c_str(); + text[5].key = const_cast("flam3_samples"); + text[5].text = const_cast(comments.m_NumIters.c_str()); text[6].compression = PNG_TEXT_COMPRESSION_NONE; - text[6].key = (png_charp)"flam3_time"; - text[6].text = (png_charp)comments.m_Runtime.c_str(); + text[6].key = const_cast("flam3_time"); + text[6].text = const_cast(comments.m_Runtime.c_str()); text[7].compression = PNG_TEXT_COMPRESSION_zTXt; - text[7].key = (png_charp)"flam3_genome"; - text[7].text = (png_charp)comments.m_Genome.c_str(); + text[7].key = const_cast("flam3_genome"); + text[7].text = const_cast(comments.m_Genome.c_str()); for (i = 0; i < height; i++) - rows[i] = (byte*)image + i * width * 4 * bytesPerChannel; + rows[i] = image + i * width * 4 * bytesPerChannel; png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); info_ptr = png_create_info_struct(png_ptr); @@ -197,7 +197,7 @@ static bool WritePng(const char* filename, byte* image, size_t width, size_t hei png_init_io(png_ptr, file); - png_set_IHDR(png_ptr, info_ptr, (png_uint_32)width, (png_uint_32)height, 8 * (png_uint_32)bytesPerChannel, + png_set_IHDR(png_ptr, info_ptr, png_uint_32(width), png_uint_32(height), 8 * png_uint_32(bytesPerChannel), PNG_COLOR_TYPE_RGBA, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, @@ -214,7 +214,7 @@ static bool WritePng(const char* filename, byte* image, size_t width, size_t hei png_set_swap(png_ptr); } - png_write_image(png_ptr, (png_bytepp) rows.data()); + png_write_image(png_ptr, const_cast(rows.data())); png_write_end(png_ptr, info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr); fclose(file); diff --git a/Source/EmberCommon/SimpleGlob.h b/Source/EmberCommon/SimpleGlob.h index dbdc494..35bb300 100644 --- a/Source/EmberCommon/SimpleGlob.h +++ b/Source/EmberCommon/SimpleGlob.h @@ -214,7 +214,7 @@ class SimpleGlobUtil { public: static const char * strchr(const char *s, char c) { - return (char *) sg_strchr((const SOCHAR_T *)s, c); + return sg_strchr(reinterpret_cast(s), c); } static const wchar_t * strchr(const wchar_t *s, wchar_t c) { return ::wcschr(s, c); @@ -226,7 +226,7 @@ public: #endif static const char * strrchr(const char *s, char c) { - return (char *) sg_strrchr((const SOCHAR_T *)s, c); + return sg_strrchr(reinterpret_cast(s), c); } static const wchar_t * strrchr(const wchar_t *s, wchar_t c) { return ::wcsrchr(s, c); @@ -246,7 +246,7 @@ public: static void strcpy_s(char *dst, size_t n, const char *src) { (void) n; - sg_strcpy_s((SOCHAR_T *)dst, n, (const SOCHAR_T *)src); + sg_strcpy_s(reinterpret_cast(dst), n, reinterpret_cast(src)); } static void strcpy_s(wchar_t *dst, size_t n, const wchar_t *src) { # if __STDC_WANT_SECURE_LIB__ @@ -263,7 +263,7 @@ public: #endif static int strcmp(const char *s1, const char *s2) { - return sg_strcmp((const SOCHAR_T *)s1, (const SOCHAR_T *)s2); + return sg_strcmp(reinterpret_cast(s1), reinterpret_cast(s2)); } static int strcmp(const wchar_t *s1, const wchar_t *s2) { return ::wcscmp(s1, s2); @@ -275,7 +275,7 @@ public: #endif static int strcasecmp(const char *s1, const char *s2) { - return sg_strcasecmp((const SOCHAR_T *)s1, (const SOCHAR_T *)s2); + return sg_strcasecmp(reinterpret_cast(s1), reinterpret_cast(s2)); } #if _WIN32 static int strcasecmp(const wchar_t *s1, const wchar_t *s2) { @@ -389,7 +389,7 @@ struct SimpleGlobBase { SimpleGlobBase() { memset(&m_glob, 0, sizeof(m_glob)); - m_uiCurr = (size_t)-1; + m_uiCurr = size_t(-1); } ~SimpleGlobBase() { @@ -446,11 +446,11 @@ struct SimpleGlobBase void FindDone() { globfree(&m_glob); memset(&m_glob, 0, sizeof(m_glob)); - m_uiCurr = (size_t)-1; + m_uiCurr = size_t(-1); } const char * GetFileNameS(char) const { - SG_ASSERT(m_uiCurr != (size_t)-1); + SG_ASSERT(m_uiCurr != size_t(-1)); return m_glob.gl_pathv[m_uiCurr]; } @@ -467,7 +467,7 @@ struct SimpleGlobBase #endif bool IsDirS(char) const { - SG_ASSERT(m_uiCurr != (size_t)-1); + SG_ASSERT(m_uiCurr != size_t(-1)); return m_bIsDir; } @@ -747,8 +747,8 @@ CSimpleGlobTempl::Add( int nError, nStartLen = m_nArgsLen; bool bSuccess; do { - nError = AppendName(this->GetFileNameS((SOCHAR)0), this->IsDirS((SOCHAR)0)); - bSuccess = this->FindNextFileS((SOCHAR)0); + nError = AppendName(this->GetFileNameS(SOCHAR(0)), this->IsDirS(SOCHAR(0))); + bSuccess = this->FindNextFileS(SOCHAR(0)); } while (nError == SG_SUCCESS && bSuccess); SimpleGlobBase::FindDone(); @@ -829,7 +829,7 @@ CSimpleGlobTempl::AppendName( } // add this entry. m_uiBufferLen is offset from beginning of buffer. - m_rgpArgs[m_nArgsLen++] = (SOCHAR*)m_uiBufferLen; + m_rgpArgs[m_nArgsLen++] = reinterpret_cast(m_uiBufferLen); SimpleGlobUtil::strcpy_s(m_pBuffer + m_uiBufferLen, m_uiBufferSize - m_uiBufferLen, m_szPathPrefix); SimpleGlobUtil::strcpy_s(m_pBuffer + m_uiBufferLen + uiPrefixLen, @@ -856,8 +856,8 @@ CSimpleGlobTempl::SetArgvArrayType( if (a_nNewType == POINTERS) { SG_ASSERT(m_nArgArrayType == OFFSETS); for (int n = 0; n < m_nArgsLen; ++n) { - m_rgpArgs[n] = (m_rgpArgs[n] == (SOCHAR*)-1) ? - nullptr : m_pBuffer + (size_t) m_rgpArgs[n]; + m_rgpArgs[n] = (m_rgpArgs[n] == reinterpret_cast(-1)) ? + nullptr : m_pBuffer + size_t(m_rgpArgs[n]); } } else { @@ -865,7 +865,7 @@ CSimpleGlobTempl::SetArgvArrayType( SG_ASSERT(m_nArgArrayType == POINTERS); for (int n = 0; n < m_nArgsLen; ++n) { m_rgpArgs[n] = (m_rgpArgs[n] == nullptr) ? - (SOCHAR*) -1 : (SOCHAR*) (m_rgpArgs[n] - m_pBuffer); + reinterpret_cast(-1) : reinterpret_cast(m_rgpArgs[n] - m_pBuffer); } } m_nArgArrayType = a_nNewType; @@ -887,7 +887,7 @@ CSimpleGlobTempl::GrowArgvArray( void * pNewBuffer = realloc(m_rgpArgs, nNewSize * sizeof(SOCHAR*)); if (!pNewBuffer) return false; m_nArgsSize = nNewSize; - m_rgpArgs = (SOCHAR**) pNewBuffer; + m_rgpArgs = reinterpret_cast(pNewBuffer); } return true; } @@ -908,7 +908,7 @@ CSimpleGlobTempl::GrowStringBuffer( void * pNewBuffer = realloc(m_pBuffer, uiNewSize * sizeof(SOCHAR)); if (!pNewBuffer) return false; m_uiBufferSize = uiNewSize; - m_pBuffer = (SOCHAR*) pNewBuffer; + m_pBuffer = reinterpret_cast(pNewBuffer); } return true; } @@ -920,8 +920,8 @@ CSimpleGlobTempl::fileSortCompare( const void *a2 ) { - const SOCHAR * s1 = *(const SOCHAR **)a1; - const SOCHAR * s2 = *(const SOCHAR **)a2; + const SOCHAR * s1 = *(reinterpret_cast(a1)); + const SOCHAR * s2 = *(reinterpret_cast(a2)); if (s1 && s2) { return SimpleGlobUtil::strcasecmp(s1, s2); } diff --git a/Source/EmberCommon/SimpleOpt.h b/Source/EmberCommon/SimpleOpt.h index 51f5f63..bf680b6 100644 --- a/Source/EmberCommon/SimpleOpt.h +++ b/Source/EmberCommon/SimpleOpt.h @@ -522,7 +522,7 @@ private: // Find the '=' character within a string. inline SOCHAR * FindEquals(SOCHAR *s) const { - while (*s && *s != (SOCHAR)'=') ++s; + while (*s && *s != SOCHAR('=')) ++s; return *s ? s : nullptr; } bool IsEqual(SOCHAR a_cLeft, SOCHAR a_cRight, int a_nArgType) const; @@ -576,8 +576,8 @@ CSimpleOptTempl::Init( m_pszOptionText = nullptr; m_pszOptionArg = nullptr; m_nNextOption = (a_nFlags & SO_O_USEALL) ? 0 : 1; - m_szShort[0] = (SOCHAR)'-'; - m_szShort[2] = (SOCHAR)'\0'; + m_szShort[0] = SOCHAR('-'); + m_szShort[2] = SOCHAR('\0'); m_nFlags = a_nFlags; m_pszClump = nullptr; @@ -592,7 +592,7 @@ CSimpleOptTempl::Init( free(m_rgShuffleBuf); } if (m_argc > SO_STATICBUF) { - m_rgShuffleBuf = (SOCHAR**) malloc(sizeof(SOCHAR*) * m_argc); + m_rgShuffleBuf = reinterpret_cast(malloc(sizeof(SOCHAR*) * m_argc)); if (!m_rgShuffleBuf) { return false; } @@ -646,11 +646,11 @@ CSimpleOptTempl::Next() // find this option in the options table cFirst = PrepareArg(pszArg); - if (pszArg[0] == (SOCHAR)'-') { + if (pszArg[0] == SOCHAR('-')) { // find any combined argument string and remove equals sign m_pszOptionArg = FindEquals(pszArg); if (m_pszOptionArg) { - *m_pszOptionArg++ = (SOCHAR)'\0'; + *m_pszOptionArg++ = SOCHAR('\0'); } } nTableIdx = LookupOption(pszArg); @@ -659,9 +659,9 @@ CSimpleOptTempl::Next() // option then we try the alternative forms if (nTableIdx < 0 && !m_pszOptionArg - && pszArg[0] == (SOCHAR)'-' + && pszArg[0] == SOCHAR('-') && pszArg[1] - && pszArg[1] != (SOCHAR)'-' + && pszArg[1] != SOCHAR('-') && pszArg[2]) { // test for a short-form with argument if appropriate @@ -694,7 +694,7 @@ CSimpleOptTempl::Next() // and we are not suppressing errors for invalid options then it // is reported as an error, otherwise it is data. if (nTableIdx < 0) { - if (!HasFlag(SO_O_NOERR) && pszArg[0] == (SOCHAR)'-') { + if (!HasFlag(SO_O_NOERR) && pszArg[0] == SOCHAR('-')) { m_pszOptionText = pszArg; break; } @@ -702,7 +702,7 @@ CSimpleOptTempl::Next() pszArg[0] = cFirst; ++nOptIdx; if (m_pszOptionArg) { - *(--m_pszOptionArg) = (SOCHAR)'='; + *(--m_pszOptionArg) = SOCHAR('='); } } } @@ -719,7 +719,7 @@ CSimpleOptTempl::Next() // get the option id ESOArgType nArgType = SO_NONE; if (nTableIdx < 0) { - m_nLastError = (ESOError) nTableIdx; // error code + m_nLastError = ESOError(nTableIdx); // error code } else { m_nOptionId = m_rgOptions[nTableIdx].nId; @@ -836,7 +836,7 @@ CSimpleOptTempl::NextClumped() // unknown option if (nTableIdx < 0) { m_pszOptionText = m_szShort; // invalid option - m_nLastError = (ESOError) nTableIdx; // error code + m_nLastError = ESOError(nTableIdx); // error code return false; } @@ -951,11 +951,11 @@ CSimpleOptTempl::CalcMatch( } // match and skip leading hyphens - while (*a_pszSource == (SOCHAR)'-' && *a_pszSource == *a_pszTest) { + while (*a_pszSource == SOCHAR('-') && *a_pszSource == *a_pszTest) { ++a_pszSource; ++a_pszTest; } - if (*a_pszSource == (SOCHAR)'-' || *a_pszTest == (SOCHAR)'-') { + if (*a_pszSource == SOCHAR('-') || *a_pszTest == SOCHAR('-')) { return 0; } @@ -1027,7 +1027,7 @@ CSimpleOptTempl::MultiArg( if (!HasFlag(SO_O_NOERR)) { for (int n = 0; n < a_nCount; ++n) { SOCHAR ch = PrepareArg(rgpszArg[n]); - if (rgpszArg[n][0] == (SOCHAR)'-') { + if (rgpszArg[n][0] == SOCHAR('-')) { rgpszArg[n][0] = ch; m_nLastError = SO_ARG_INVALID_DATA; return nullptr; diff --git a/Source/EmberGenome/EmberGenome.cpp b/Source/EmberGenome/EmberGenome.cpp index 926c537..8bf5e36 100644 --- a/Source/EmberGenome/EmberGenome.cpp +++ b/Source/EmberGenome/EmberGenome.cpp @@ -169,10 +169,10 @@ bool EmberGenome(EmberOptions& opt) while (std::getline(iss, token, ',')) { - if (parser.Atoi((char*)token.c_str(), val)) + if (parser.Atoi(token.c_str(), val)) { if (val < varList.Size()) - vars.push_back((eVariationId)val); + vars.push_back(static_cast(val)); } } } @@ -182,10 +182,10 @@ bool EmberGenome(EmberOptions& opt) while (std::getline(iss, token, ',')) { - if (parser.Atoi((char*)token.c_str(), val)) + if (parser.Atoi(token.c_str(), val)) { if (val < varList.Size()) - noVars.push_back((eVariationId)val); + noVars.push_back(static_cast(val)); } } @@ -291,7 +291,7 @@ bool EmberGenome(EmberOptions& opt) if (pTemplate) tools.ApplyTemplate(embers[i], *pTemplate); - tools.Offset(embers[i], (T)opt.OffsetX(), (T)opt.OffsetY()); + tools.Offset(embers[i], T(opt.OffsetX()), T(opt.OffsetY())); cout << emberToXml.ToString(embers[i], opt.Extras(), opt.PrintEditDepth(), !opt.NoEdits(), false, opt.HexPalette()); } @@ -312,8 +312,8 @@ bool EmberGenome(EmberOptions& opt) embers[i].DeleteMotionElements(); } - firstFrame = (uint)(opt.FirstFrame() == UINT_MAX ? embers[0].m_Time : opt.FirstFrame()); - lastFrame = (uint)(opt.LastFrame() == UINT_MAX ? embers.back().m_Time : opt.LastFrame()); + firstFrame = uint(opt.FirstFrame() == UINT_MAX ? embers[0].m_Time : opt.FirstFrame()); + lastFrame = uint(opt.LastFrame() == UINT_MAX ? embers.back().m_Time : opt.LastFrame()); if (lastFrame < firstFrame) lastFrame = firstFrame; @@ -326,7 +326,7 @@ bool EmberGenome(EmberOptions& opt) for (i = 0; i < embers.size(); i++) { - if (ftime == (uint)embers[i].m_Time) + if (ftime == uint(embers[i].m_Time)) { interpolated = embers[i]; exactTimeMatch = true; @@ -340,7 +340,7 @@ bool EmberGenome(EmberOptions& opt) for (i = 0; i < embers.size(); i++) { - if (ftime == (uint)(embers[i].m_Time - 1)) + if (ftime == uint(embers[i].m_Time - 1)) { exactTimeMatch = true; break; @@ -383,7 +383,7 @@ bool EmberGenome(EmberOptions& opt) { for (frame = 0; frame < opt.Frames(); frame++) { - blend = (T)frame / (T)opt.Frames(); + blend = T(frame) / T(opt.Frames()); tools.Spin(embers[i], pTemplate, result, frameCount++, blend);//Result is cleared and reassigned each time inside of Spin(). cout << emberToXml.ToString(result, opt.Extras(), opt.PrintEditDepth(), !opt.NoEdits(), false, opt.HexPalette()); } @@ -394,7 +394,7 @@ bool EmberGenome(EmberOptions& opt) for (frame = 0; frame < opt.Frames(); frame++) { seqFlag = (frame == 0 || frame == opt.Frames() - 1); - blend = frame / (T)opt.Frames(); + blend = frame / T(opt.Frames()); result.Clear(); tools.SpinInter(&embers[i], pTemplate, result, frameCount++, seqFlag, blend); cout << emberToXml.ToString(result, opt.Extras(), opt.PrintEditDepth(), !opt.NoEdits(), false, opt.HexPalette()); @@ -480,7 +480,7 @@ bool EmberGenome(EmberOptions& opt) oldX = embers[i].m_CenterX; oldY = embers[i].m_CenterY; - embers[i].m_FinalRasH = (uint)((T)embers[i].m_FinalRasH / (T)opt.Frames()); + embers[i].m_FinalRasH = uint(T(embers[i].m_FinalRasH) / T(opt.Frames())); embers[i].m_CenterY = embers[i].m_CenterY - ((opt.Frames() - 1) * embers[i].m_FinalRasH) / (2 * embers[i].m_PixelsPerUnit * pow(T(2.0), embers[i].m_Zoom)); @@ -764,7 +764,7 @@ int _tmain(int argc, _TCHAR* argv[]) #ifdef WIN32 _putenv_s("GPU_MAX_ALLOC_PERCENT", "100"); #else - putenv((char*)"GPU_MAX_ALLOC_PERCENT=100"); + putenv(const_cast("GPU_MAX_ALLOC_PERCENT=100")); #endif if (!opt.Populate(argc, argv, OPT_USE_GENOME)) diff --git a/Source/EmberRender/EmberRender.cpp b/Source/EmberRender/EmberRender.cpp index 192bb6d..064c099 100644 --- a/Source/EmberRender/EmberRender.cpp +++ b/Source/EmberRender/EmberRender.cpp @@ -168,8 +168,8 @@ bool EmberRender(EmberOptions& opt) embers[i].m_TemporalSamples = 1;//Force temporal samples to 1 for render. embers[i].m_Quality *= T(opt.QualityScale()); - embers[i].m_FinalRasW = (uint)((T)embers[i].m_FinalRasW * opt.SizeScale()); - embers[i].m_FinalRasH = (uint)((T)embers[i].m_FinalRasH * opt.SizeScale()); + embers[i].m_FinalRasW = uint(T(embers[i].m_FinalRasW) * opt.SizeScale()); + embers[i].m_FinalRasH = uint(T(embers[i].m_FinalRasH) * opt.SizeScale()); embers[i].m_PixelsPerUnit *= T(opt.SizeScale()); if (embers[i].m_FinalRasW == 0 || embers[i].m_FinalRasH == 0) @@ -180,8 +180,8 @@ bool EmberRender(EmberOptions& opt) } //Cast to double in case the value exceeds 2^32. - double imageMem = (double)renderer->NumChannels() * (double)embers[i].m_FinalRasW - * (double)embers[i].m_FinalRasH * (double)renderer->BytesPerChannel(); + double imageMem = double(renderer->NumChannels()) * double(embers[i].m_FinalRasW) + * double(embers[i].m_FinalRasH) * double(renderer->BytesPerChannel()); double maxMem = pow(2.0, double((sizeof(void*) * 8) - 1)); if (imageMem > maxMem)//Ensure the max amount of memory for a process is not exceeded. @@ -201,7 +201,7 @@ bool EmberRender(EmberOptions& opt) } else { - strips = CalcStrips((double)renderer->MemoryRequired(1, true), (double)renderer->MemoryAvailable(), opt.UseMem()); + strips = CalcStrips(double(renderer->MemoryRequired(1, true)), double(renderer->MemoryAvailable()), opt.UseMem()); if (strips > 1) VerbosePrint("Setting strips to " << strips << " with specified memory usage of " << opt.UseMem()); @@ -268,7 +268,7 @@ bool EmberRender(EmberOptions& opt) iterCount = renderer->TotalIterCount(1); comments = renderer->ImageComments(stats, opt.PrintEditDepth(), opt.IntPalette(), opt.HexPalette()); os.str(""); - os << comments.m_NumIters << " / " << iterCount << " (" << std::fixed << std::setprecision(2) << (((double)stats.m_Iters / (double)iterCount) * 100) << "%)"; + os << comments.m_NumIters << " / " << iterCount << " (" << std::fixed << std::setprecision(2) << ((double(stats.m_Iters) / double(iterCount)) * 100) << "%)"; VerbosePrint("\nIters ran/requested: " + os.str()); VerbosePrint("Bad values: " << stats.m_Badvals); @@ -304,7 +304,7 @@ bool EmberRender(EmberOptions& opt) }); if (opt.EmberCL() && opt.DumpKernel()) - cout << "Iteration kernel: \n" << ((RendererCL*)renderer.get())->IterKernel() << endl; + cout << "Iteration kernel: \n" << reinterpret_cast*>(renderer.get())->IterKernel() << endl; VerbosePrint("Done."); } @@ -331,7 +331,7 @@ int _tmain(int argc, _TCHAR* argv[]) #ifdef WIN32 _putenv_s("GPU_MAX_ALLOC_PERCENT", "100"); #else - putenv((char*)"GPU_MAX_ALLOC_PERCENT=100"); + putenv(const_cast("GPU_MAX_ALLOC_PERCENT=100")); #endif if (!opt.Populate(argc, argv, OPT_USE_RENDER))