Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit adb104b

Browse files
committed
Not related to sound but oh well - changed a variable name in Reader and figured out and clarified naming and comments on LERP in RTETools
1 parent 5559baa commit adb104b

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

System/RTETools.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ namespace RTE {
2525

2626
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2727

28-
float LERP(float xStart, float xEnd, float yStart, float yEnd, float progressScalar) {
29-
if (progressScalar <= xStart) {
30-
return yStart;
31-
} else if (progressScalar >= xEnd) {
32-
return yEnd;
28+
float LERP(float scaleStart, float scaleEnd, float startValue, float endValue, float progressScalar) {
29+
if (progressScalar <= scaleStart) {
30+
return startValue;
31+
} else if (progressScalar >= scaleEnd) {
32+
return endValue;
3333
}
34-
return yStart + ((progressScalar - xStart) * ((yEnd - yStart) / (xEnd - xStart)));
34+
return startValue + ((progressScalar - scaleStart) * ((endValue - startValue) / (scaleEnd - scaleStart)));
3535
}
3636

3737
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

System/RTETools.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,16 @@ namespace RTE {
4747

4848
#pragma region Interpolation
4949
/// <summary>
50-
/// Simple Linear Interpolation, returns y for the last x passed in.
50+
/// Simple Linear Interpolation, with an added bonus: scaleStart and scaleEnd let you define your scale, where 0 and 1 would be standard scale.
51+
/// This scale is used to normalize your progressScalar value and lerp accordingly.
5152
/// </summary>
52-
/// <param name="xStart">X axis start value.</param>
53-
/// <param name="xEnd">X axis end value.</param>
54-
/// <param name="yStart">Y axis start value.</param>
55-
/// <param name="yEnd">Y axis end value.</param>
56-
/// <param name="progressScalar">Normalized positive progress scalar (0 - 1.0).</param>
53+
/// <param name="scaleStart">The start of the scale to lerp along.</param>
54+
/// <param name="scaleEnd">The end of the scale to lerp along.</param>
55+
/// <param name="startValue">The start value of your lerp.</param>
56+
/// <param name="endValue">The end value of your lerp.</param>
57+
/// <param name="progressScalar">How far your lerp has progressed. Automatically normalized through use of scaleStart and scaleEnd.</param>
5758
/// <returns>Interpolated value.</returns>
58-
float LERP(float xStart, float xEnd, float yStart, float yEnd, float progressScalar);
59+
float LERP(float scaleStart, float scaleEnd, float startValue, float endValue, float progressScalar);
5960

6061
/// <summary>
6162
/// Nonlinear ease-in interpolation. Starts slow.

System/Reader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ namespace RTE {
231231
bool Reader::DiscardEmptySpace() {
232232
char peek;
233233
int indent = 0;
234-
bool ateLine = false;
234+
bool discardedLine = false;
235235
char report[512];
236236

237237
while (true) {
@@ -264,7 +264,7 @@ namespace RTE {
264264
}
265265
}
266266
indent = 0;
267-
ateLine = true;
267+
discardedLine = true;
268268
m_pStream->ignore(1);
269269

270270
// Comment line?
@@ -296,7 +296,7 @@ namespace RTE {
296296
}
297297

298298
// This precaution enables us to use DiscardEmptySpace repeatedly without messing up the indentation tracking logic
299-
if (ateLine) {
299+
if (discardedLine) {
300300
// Get indentation difference from the last line of the last call to DiscardEmptySpace(), and the last line of this call to DiscardEmptySpace().
301301
m_IndentDifference = indent - m_PreviousIndent;
302302
// Save the last tab count

0 commit comments

Comments
 (0)