Browse Source

Fixed a typo.

David Piuva 5 years ago
parent
commit
2e68e0e73c

+ 2 - 2
Source/DFPSR/api/drawAPI.cpp

@@ -193,9 +193,9 @@ void dsr::draw_maxAlpha(ImageRgbaU8& target, const ImageRgbaU8& source, int32_t
 		imageImpl_drawMaxAlpha(*target, *source, left, top, sourceAlphaOffset);
 	}
 }
-void dsr::draw_alphaClip(ImageRgbaU8& target, const ImageRgbaU8& source, int32_t left, int32_t top, int32_t treshold) {
+void dsr::draw_alphaClip(ImageRgbaU8& target, const ImageRgbaU8& source, int32_t left, int32_t top, int32_t threshold) {
 	if (target && source) {
-		imageImpl_drawAlphaClip(*target, *source, left, top, treshold);
+		imageImpl_drawAlphaClip(*target, *source, left, top, threshold);
 	}
 }
 void dsr::draw_silhouette(ImageRgbaU8& target, const ImageU8& source, const ColorRgbaI32& color, int32_t left, int32_t top) {

+ 2 - 2
Source/DFPSR/api/drawAPI.h

@@ -117,8 +117,8 @@ namespace dsr {
 	);
 
 	// Draw one RGBA image to another using alpha clipping
-	//   Source is solid where alpha is greater than treshold, which can be used for animations
-	void draw_alphaClip(ImageRgbaU8& target, const ImageRgbaU8& source, int32_t left = 0, int32_t top = 0, int32_t treshold = 127);
+	//   Source is solid where alpha is greater than threshold, which can be used for animations
+	void draw_alphaClip(ImageRgbaU8& target, const ImageRgbaU8& source, int32_t left = 0, int32_t top = 0, int32_t threshold = 127);
 	// Draw a uniform color using a grayscale silhouette as the alpha channel
 	void draw_silhouette(ImageRgbaU8& target, const ImageU8& silhouette, const ColorRgbaI32& color, int32_t left = 0, int32_t top = 0);
 

+ 4 - 4
Source/DFPSR/api/modelAPI.cpp

@@ -87,9 +87,9 @@ void model_setPoint(Model& model, int pointIndex, const FVector3D& position) {
 	model->setPoint(pointIndex, position);
 }
 
-int model_findPoint(const Model& model, const FVector3D &position, float treshold) {
+int model_findPoint(const Model& model, const FVector3D &position, float threshold) {
 	MUST_EXIST(model,model_findPoint);
-	return model->findPoint(position, treshold);
+	return model->findPoint(position, threshold);
 }
 
 int model_addPoint(const Model& model, const FVector3D &position) {
@@ -97,9 +97,9 @@ int model_addPoint(const Model& model, const FVector3D &position) {
 	return model->addPoint(position);
 }
 
-int model_addPointIfNeeded(Model& model, const FVector3D &position, float treshold) {
+int model_addPointIfNeeded(Model& model, const FVector3D &position, float threshold) {
 	MUST_EXIST(model,model_addPointIfNeeded);
-	return model->addPointIfNeeded(position, treshold);
+	return model->addPointIfNeeded(position, threshold);
 }
 
 int model_getVertexPointIndex(const Model& model, int partIndex, int polygonIndex, int vertexIndex) {

+ 2 - 2
Source/DFPSR/api/modelAPI.h

@@ -54,9 +54,9 @@ namespace dsr {
 	int model_getNumberOfPoints(const Model& model);
 	FVector3D model_getPoint(const Model& model, int pointIndex);
 	void model_setPoint(Model& model, int pointIndex, const FVector3D& position);
-	int model_findPoint(const Model& model, const FVector3D &position, float treshold);
+	int model_findPoint(const Model& model, const FVector3D &position, float threshold);
 	int model_addPoint(const Model& model, const FVector3D &position);
-	int model_addPointIfNeeded(Model& model, const FVector3D &position, float treshold);
+	int model_addPointIfNeeded(Model& model, const FVector3D &position, float threshold);
 
 	// Vertex
 	int model_getVertexPointIndex(const Model& model, int partIndex, int polygonIndex, int vertexIndex);

+ 2 - 2
Source/DFPSR/image/draw.cpp

@@ -611,12 +611,12 @@ void dsr::imageImpl_drawMaxAlpha(ImageRgbaU8Impl& target, const ImageRgbaU8Impl&
 	}
 }
 
-void dsr::imageImpl_drawAlphaClip(ImageRgbaU8Impl& target, const ImageRgbaU8Impl& source, int32_t left, int32_t top, int32_t treshold) {
+void dsr::imageImpl_drawAlphaClip(ImageRgbaU8Impl& target, const ImageRgbaU8Impl& source, int32_t left, int32_t top, int32_t threshold) {
 	if (ImageIntersection::canCreate(target, source, left, top)) {
 		ImageIntersection intersection = ImageIntersection::create(target, source, left, top);
 		// Read and repack to convert between different color formats
 		ITERATE_PIXELS(intersection.subTarget, intersection.subSource,
-			if (sourcePixel[source.packOrder.alphaIndex] > treshold) {
+			if (sourcePixel[source.packOrder.alphaIndex] > threshold) {
 				targetPixel[target.packOrder.redIndex]   = sourcePixel[source.packOrder.redIndex];
 				targetPixel[target.packOrder.greenIndex] = sourcePixel[source.packOrder.greenIndex];
 				targetPixel[target.packOrder.blueIndex]  = sourcePixel[source.packOrder.blueIndex];

+ 1 - 1
Source/DFPSR/image/draw.h

@@ -61,7 +61,7 @@ void imageImpl_drawCopy(ImageF32Impl& target, const ImageU16Impl& source, int32_
 
 void imageImpl_drawAlphaFilter(ImageRgbaU8Impl& target, const ImageRgbaU8Impl& source, int32_t left = 0, int32_t top = 0);
 void imageImpl_drawMaxAlpha(ImageRgbaU8Impl& target, const ImageRgbaU8Impl& source, int32_t left = 0, int32_t top = 0, int32_t sourceAlphaOffset = 0);
-void imageImpl_drawAlphaClip(ImageRgbaU8Impl& target, const ImageRgbaU8Impl& source, int32_t left = 0, int32_t top = 0, int32_t treshold = 0);
+void imageImpl_drawAlphaClip(ImageRgbaU8Impl& target, const ImageRgbaU8Impl& source, int32_t left = 0, int32_t top = 0, int32_t threshold = 0);
 void imageImpl_drawSilhouette(ImageRgbaU8Impl& target, const ImageU8Impl& source, const ColorRgbaI32& color, int32_t left = 0, int32_t top = 0);
 
 void imageImpl_drawHigher(ImageU16Impl& targetHeight, const ImageU16Impl& sourceHeight, int32_t left = 0, int32_t top = 0, int32_t sourceHeightOffset = 0);

+ 7 - 7
Source/DFPSR/render/ITriangle2D.cpp

@@ -96,7 +96,7 @@ static void cutConvexEdge(const LVector2D& startPoint, const LVector2D& endPoint
 	int64_t originY = constants::unitsPerHalfPixel + clipBound.top() * constants::unitsPerPixel;
 
 	// To turn x > 0 into x >= 0 without branching, just compare to -1 instead as it is equivalent for integers.
-	int64_t treshold = (startPoint.x > endPoint.x || (startPoint.x == endPoint.x && startPoint.y > endPoint.y)) ? -1 : 0;
+	int64_t threshold = (startPoint.x > endPoint.x || (startPoint.x == endPoint.x && startPoint.y > endPoint.y)) ? -1 : 0;
 	// Get normals for each edge
 	int64_t normalX = endPoint.y - startPoint.y;
 	int64_t normalY = startPoint.x - endPoint.x;
@@ -111,12 +111,12 @@ static void cutConvexEdge(const LVector2D& startPoint, const LVector2D& endPoint
 		int64_t valueRow = valueOrigin;
 		// Proof for the limit variable:
 		//   Find the highest x for the left side where offsetX < 0 or the lowest x for the right side where offsetX > 0
-		//   x must satisfy the equation valueRow + (offsetX * (x - leftBound)) > treshold
-		//   offsetX * (x - leftBound) > treshold - valueRow
-		//   (offsetX * x) - (offsetX * leftBound) > treshold - valueRow
-		//   offsetX * x > treshold - valueRow + (offsetX * leftBound)
+		//   x must satisfy the equation valueRow + (offsetX * (x - leftBound)) > threshold
+		//   offsetX * (x - leftBound) > threshold - valueRow
+		//   (offsetX * x) - (offsetX * leftBound) > threshold - valueRow
+		//   offsetX * x > threshold - valueRow + (offsetX * leftBound)
 		//   offsetX * x > limit
-		int64_t limit = treshold - valueRow + (offsetX * leftBound);
+		int64_t limit = threshold - valueRow + (offsetX * leftBound);
 		if (normalX < 0) { // Left
 			for (int32_t y = topBound; y < bottomBound; y++) {
 				int32_t rowIndex = y - topBound;
@@ -139,7 +139,7 @@ static void cutConvexEdge(const LVector2D& startPoint, const LVector2D& endPoint
 		int64_t valueRow = valueOrigin + (offsetY * (topBound - topBound));
 		for (int32_t y = topBound; y < bottomBound; y++) {
 			int32_t rowIndex = y - topBound;
-			if (valueRow > treshold) { // If outside of the current edge
+			if (valueRow > threshold) { // If outside of the current edge
 				rows[rowIndex].left = rightBound;
 				rows[rowIndex].right = leftBound;
 			}

+ 4 - 4
Source/DFPSR/render/model/Model.cpp

@@ -299,8 +299,8 @@ void ModelImpl::expandBound(const FVector3D& point) {
 	if (this->maxBound.y > point.y) { this->maxBound.y = point.y; }
 	if (this->maxBound.z > point.z) { this->maxBound.z = point.z; }
 }
-int ModelImpl::findPoint(const FVector3D &position, float treshold) const {
-	float bestDistance = treshold;
+int ModelImpl::findPoint(const FVector3D &position, float threshold) const {
+	float bestDistance = threshold;
 	int bestIndex = -1;
 	for (int index = 0; index < this->positionBuffer.length(); index++) {
 		float distance = length(position - this->getPoint(index));
@@ -325,8 +325,8 @@ int ModelImpl::addPoint(const FVector3D &position) {
 	this->expandBound(position);
 	return this->positionBuffer.length() - 1;
 }
-int ModelImpl::addPointIfNeeded(const FVector3D &position, float treshold) {
-	int existingIndex = this->findPoint(position, treshold);
+int ModelImpl::addPointIfNeeded(const FVector3D &position, float threshold) {
+	int existingIndex = this->findPoint(position, threshold);
 	if (existingIndex > -1) {
 		return existingIndex;
 	} else {

+ 2 - 2
Source/DFPSR/render/model/Model.h

@@ -118,9 +118,9 @@ public:
 	int getNumberOfPoints() const;
 	FVector3D getPoint(int pointIndex) const;
 	void setPoint(int pointIndex, const FVector3D& position);
-	int findPoint(const FVector3D &position, float treshold) const;
+	int findPoint(const FVector3D &position, float threshold) const;
 	int addPoint(const FVector3D &position);
-	int addPointIfNeeded(const FVector3D &position, float treshold); // Returns the index of a new point or the first existing within treshold in euclidean 3D distance
+	int addPointIfNeeded(const FVector3D &position, float threshold); // Returns the index of a new point or the first existing within threshold in euclidean 3D distance
 	// Vertex interface
 	int getVertexPointIndex(int partIndex, int polygonIndex, int vertexIndex) const;
 	void setVertexPointIndex(int partIndex, int polygonIndex, int vertexIndex, int pointIndex);

+ 4 - 4
Source/DFPSR/render/model/format/dmf1.cpp

@@ -337,10 +337,10 @@ static Model convertFromDMF1(const Model_DMF1 &nativeModel, ResourcePool &pool,
 			}
 			for (int inputTriangleIndex = 0; inputTriangleIndex < inputPart->triangles.length(); inputTriangleIndex++) {
 				const Triangle_DMF1 *inputTriangle = &(inputPart->triangles[inputTriangleIndex]);
-				const float treshold = 0.00001f;
-				int posIndexA = result->addPointIfNeeded(inputTriangle->vertices[0].position, treshold);
-				int posIndexB = result->addPointIfNeeded(inputTriangle->vertices[1].position, treshold);
-				int posIndexC = result->addPointIfNeeded(inputTriangle->vertices[2].position, treshold);
+				const float threshold = 0.00001f;
+				int posIndexA = result->addPointIfNeeded(inputTriangle->vertices[0].position, threshold);
+				int posIndexB = result->addPointIfNeeded(inputTriangle->vertices[1].position, threshold);
+				int posIndexC = result->addPointIfNeeded(inputTriangle->vertices[2].position, threshold);
 				VertexData dataA(inputTriangle->vertices[0].texCoord, inputTriangle->vertices[0].color);
 				VertexData dataB(inputTriangle->vertices[1].texCoord, inputTriangle->vertices[1].color);
 				VertexData dataC(inputTriangle->vertices[2].texCoord, inputTriangle->vertices[2].color);

+ 1 - 1
Source/SDK/sandbox/sandbox.cpp

@@ -45,7 +45,7 @@ VISUALS:
 		Used like passive lights but drawing to the diffuse layer and ignoring dynamic sprites.
 		Will only be drawn when updating passive blocks or adding to existing background blocks.
 		A 3D transform defines where the decal is placed like a cube in world space.
-			The near and far clipping can use a fading treshold to allow placing explosion decals without creating hard seams.
+			The near and far clipping can use a fading threshold to allow placing explosion decals without creating hard seams.
 		New sprites added after a decal should not be affected by an old sprite.
 			How can this be solved without resorting to dangerous polymorphism.
 		Allow defining decals locally for each level by loading their images from a temporary image pool of level specific content.

+ 1 - 1
Source/SDK/terrain/main.cpp

@@ -69,7 +69,7 @@
 			Remember at what height the light reached in the previous pixel and lower it by the pixelwise light slope.
 			If it goes below the ground's height, set it to the ground's height.
 			If the light is above the ground level, the sun is occluded.
-			The tresholding can be made soft by linearly fading when light is a bit above the ground as if grass absorbed the light partially.
+			The thresholding can be made soft by linearly fading when light is a bit above the ground as if grass absorbed the light partially.
 			Having a static lightmap might however not need this optimizing restriction.
 */