1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-03 04:53:35 +00:00

Fix -2 scale components;

This commit is contained in:
bjorn 2024-06-07 18:30:27 -07:00
parent d941e55f4f
commit bcf0421da9

View file

@ -649,6 +649,7 @@ int luax_readscale(lua_State* L, int index, vec3 v, int components, const char*
} else if (components == -2) { // -2 is special and means "2 components: xy and z" } else if (components == -2) { // -2 is special and means "2 components: xy and z"
v[0] = v[1] = luax_tofloat(L, index); v[0] = v[1] = luax_tofloat(L, index);
v[2] = luax_optfloat(L, index, 1.f); v[2] = luax_optfloat(L, index, 1.f);
return index + 2;
} else { } else {
v[0] = v[1] = v[2] = 1.f; v[0] = v[1] = v[2] = 1.f;
for (int i = 0; i < components; i++) { for (int i = 0; i < components; i++) {