mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add particle blend mode "clip" (#15444)
This lets modders avoid alpha blending rendering bugs as well as potential (future) performance issues. The appropriate blend modes are also used for node dig particles. --------- Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
parent
f493e73aeb
commit
138052adfc
11 changed files with 93 additions and 33 deletions
|
@ -118,13 +118,14 @@ namespace LuaParticleParams
|
|||
{(int)BlendMode::add, "add"},
|
||||
{(int)BlendMode::sub, "sub"},
|
||||
{(int)BlendMode::screen, "screen"},
|
||||
{(int)BlendMode::clip, "clip"},
|
||||
{0, nullptr},
|
||||
};
|
||||
|
||||
luaL_checktype(L, -1, LUA_TSTRING);
|
||||
int v = (int)BlendMode::alpha;
|
||||
if (!string_to_enum(opts, v, lua_tostring(L, -1))) {
|
||||
throw LuaError("blend mode must be one of ('alpha', 'add', 'sub', 'screen')");
|
||||
throw LuaError("blend mode must be one of ('alpha', 'clip', 'add', 'sub', 'screen')");
|
||||
}
|
||||
ret = (BlendMode)v;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue