Clamp colors in love.graphics.newMesh. I missed this one in my previous commit.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-11-25 10:23:29 -04:00
parent 6dea2ab714
commit 82553d793d
+4 -4
View File
@@ -1454,10 +1454,10 @@ static Mesh *newStandardMesh(lua_State *L)
v.s = (float) luaL_optnumber(L, -6, 0.0);
v.t = (float) luaL_optnumber(L, -5, 0.0);
v.color.r = (unsigned char) (luaL_optnumber(L, -4, 1.0) * 255.0);
v.color.g = (unsigned char) (luaL_optnumber(L, -3, 1.0) * 255.0);
v.color.b = (unsigned char) (luaL_optnumber(L, -2, 1.0) * 255.0);
v.color.a = (unsigned char) (luaL_optnumber(L, -1, 1.0) * 255.0);
v.color.r = (unsigned char) (luax_optnumberclamped01(L, -4, 1.0) * 255.0);
v.color.g = (unsigned char) (luax_optnumberclamped01(L, -3, 1.0) * 255.0);
v.color.b = (unsigned char) (luax_optnumberclamped01(L, -2, 1.0) * 255.0);
v.color.a = (unsigned char) (luax_optnumberclamped01(L, -1, 1.0) * 255.0);
lua_pop(L, 9);
vertices.push_back(v);