Fix infinite loop error w/ unsigned ints used on decrementing for counters.

This commit is contained in:
Joey de Vries
2020-04-22 12:58:38 +02:00
parent 7452f38392
commit a8499a2668
6 changed files with 6 additions and 6 deletions

View File

@@ -289,7 +289,7 @@ void renderSphere()
}
else
{
for (unsigned int x = X_SEGMENTS; x >= 0; --x)
for (int x = X_SEGMENTS; x >= 0; --x)
{
indices.push_back((y + 1) * (X_SEGMENTS + 1) + x);
indices.push_back(y * (X_SEGMENTS + 1) + x);

View File

@@ -300,7 +300,7 @@ void renderSphere()
}
else
{
for (unsigned int x = X_SEGMENTS; x >= 0; --x)
for (int x = X_SEGMENTS; x >= 0; --x)
{
indices.push_back((y + 1) * (X_SEGMENTS + 1) + x);
indices.push_back(y * (X_SEGMENTS + 1) + x);

View File

@@ -405,7 +405,7 @@ void renderSphere()
}
else
{
for (unsigned int x = X_SEGMENTS; x >= 0; --x)
for (int x = X_SEGMENTS; x >= 0; --x)
{
indices.push_back((y + 1) * (X_SEGMENTS + 1) + x);
indices.push_back(y * (X_SEGMENTS + 1) + x);

View File

@@ -445,7 +445,7 @@ void renderSphere()
}
else
{
for (unsigned int x = X_SEGMENTS; x >= 0; --x)
for (int x = X_SEGMENTS; x >= 0; --x)
{
indices.push_back((y + 1) * (X_SEGMENTS + 1) + x);
indices.push_back(y * (X_SEGMENTS + 1) + x);

View File

@@ -543,7 +543,7 @@ void renderSphere()
}
else
{
for (unsigned int x = X_SEGMENTS; x >= 0; --x)
for (int x = X_SEGMENTS; x >= 0; --x)
{
indices.push_back((y + 1) * (X_SEGMENTS + 1) + x);
indices.push_back(y * (X_SEGMENTS + 1) + x);

View File

@@ -643,7 +643,7 @@ void renderSphere()
}
else
{
for (unsigned int x = X_SEGMENTS; x >= 0; --x)
for (int x = X_SEGMENTS; x >= 0; --x)
{
indices.push_back((y + 1) * (X_SEGMENTS + 1) + x);
indices.push_back(y * (X_SEGMENTS + 1) + x);