1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Proselytize the network. Use IEEE F32 (#8030)

* Proselytize the network. Use IEEE F32
* Remove unused V2F1000 functions
This commit is contained in:
SmallJoker 2019-01-03 17:04:26 +01:00 committed by Loïc Blot
parent ceacff13a6
commit bba4563d89
19 changed files with 237 additions and 262 deletions

View file

@ -218,8 +218,18 @@ void read_object_properties(lua_State *L, int index,
getstringfield(L, -1, "mesh", prop->mesh);
lua_getfield(L, -1, "visual_size");
if(lua_istable(L, -1))
prop->visual_size = read_v2f(L, -1);
if (lua_istable(L, -1)) {
// Backwards compatibility: Also accept { x = ?, y = ? }
v2f scale_xy = read_v2f(L, -1);
f32 scale_z = scale_xy.X;
lua_getfield(L, -1, "z");
if (lua_isnumber(L, -1))
scale_z = lua_tonumber(L, -1);
lua_pop(L, 1);
prop->visual_size = v3f(scale_xy.X, scale_xy.Y, scale_z);
}
lua_pop(L, 1);
lua_getfield(L, -1, "textures");
@ -331,7 +341,7 @@ void push_object_properties(lua_State *L, ObjectProperties *prop)
lua_setfield(L, -2, "visual");
lua_pushlstring(L, prop->mesh.c_str(), prop->mesh.size());
lua_setfield(L, -2, "mesh");
push_v2f(L, prop->visual_size);
push_v3f(L, prop->visual_size);
lua_setfield(L, -2, "visual_size");
lua_newtable(L);