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

Adding particle blend, glow and animation (#4705)

This commit is contained in:
Foghrye4 2016-11-14 18:09:59 +04:00 committed by Zeno-
parent 649448a2a9
commit 93e3555eae
15 changed files with 800 additions and 81 deletions

View file

@ -513,6 +513,28 @@ int getintfield_default(lua_State *L, int table,
return result;
}
int check_material_type_param(lua_State *L, int table,
const char *fieldname, int default_)
{
int material_type_param =
getintfield_default(L, table, fieldname, default_);
u32 alphaSource = (material_type_param & 0x0000F000) >> 12;
u32 modulo = (material_type_param & 0x00000F00) >> 8;
u32 srcFact = (material_type_param & 0x000000F0) >> 4;
u32 dstFact = material_type_param & 0x0000000F;
if (alphaSource <= 3 && modulo <= 4 && srcFact <= 10 && dstFact <= 10) {
return material_type_param;
} else {
std::ostringstream error_text;
error_text << "Incorrect material_type_param value ";
error_text << "for particle or particle spawner.";
error_text << std::endl;
throw LuaError(error_text.str());
return 0;
}
}
float getfloatfield_default(lua_State *L, int table,
const char *fieldname, float default_)
{