Remove some type conversion warnings.

This commit is contained in:
vrld
2011-12-28 14:17:10 +01:00
parent a7e040001b
commit cde8b92113
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -841,8 +841,11 @@ namespace opengl
Color *colors = new Color[count];
for (size_t i = 0; i < count; ++i)
{
colors[i] = Color(c[0] * 255.f, c[1] * 255.f, c[2] * 255.f,
c[3] * 255.f * int(i%2 == 0));// avoids branching. equiv to colors[i].a *= (i%2==0) ? 1 : 0;
colors[i] = Color(GLubyte(c[0] * 255.f),
GLubyte(c[1] * 255.f),
GLubyte(c[2] * 255.f),
// avoids branching. equiv to if (i%2 == 1) colors[i].a = 0;
GLubyte(c[3] * 255.f) * GLubyte(i%2 == 0));
}
// TODO: overdraw at line start and end
@@ -93,7 +93,7 @@ namespace opengl
lua_rawgeti(L, 3 + i, k);
values[i * dimension + k - 1] = (float)lua_tonumber(L, -1);
}
lua_pop(L, dimension);
lua_pop(L, int(dimension));
}
try