feat: use any source for expo/weight/offset (#5220)

Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
philmoz
2024-07-26 20:51:21 +10:00
committed by GitHub
co-authored by philmoz 3djc elecpower
parent 326c58a7fd
commit 4b917b762c
87 changed files with 2751 additions and 1671 deletions
+30 -6
View File
@@ -681,10 +681,18 @@ static int luaModelInsertInput(lua_State *L)
expo->scale = luaL_checkinteger(L, -1);
}
else if (!strcmp(key, "weight")) {
expo->weight = luaL_checkinteger(L, -1);
int val = luaL_checkinteger(L, -1);
SourceNumVal v;
v.isSource = (abs(val) >= 1024);
v.value = val;
expo->weight = v.rawValue;
}
else if (!strcmp(key, "offset")) {
expo->offset = luaL_checkinteger(L, -1);
int val = luaL_checkinteger(L, -1);
SourceNumVal v;
v.isSource = (abs(val) >= 1024);
v.value = val;
expo->offset = v.rawValue;
}
else if (!strcmp(key, "switch")) {
expo->swtch = luaL_checkinteger(L, -1);
@@ -693,7 +701,11 @@ static int luaModelInsertInput(lua_State *L)
expo->curve.type = luaL_checkinteger(L, -1);
}
else if (!strcmp(key, "curveValue")) {
expo->curve.value = luaL_checkinteger(L, -1);
int val = luaL_checkinteger(L, -1);
SourceNumVal v;
v.isSource = (abs(val) >= 1024);
v.value = val;
expo->curve.value = v.rawValue;
}
else if (!strcmp(key, "trimSource")) {
expo->trimSource = - luaL_checkinteger(L, -1);
@@ -904,10 +916,18 @@ static int luaModelInsertMix(lua_State *L)
mix->srcRaw = luaL_checkinteger(L, -1);
}
else if (!strcmp(key, "weight")) {
mix->weight = luaL_checkinteger(L, -1);
int val = luaL_checkinteger(L, -1);
SourceNumVal v;
v.isSource = (abs(val) >= 1024);
v.value = val;
mix->weight = v.rawValue;
}
else if (!strcmp(key, "offset")) {
mix->offset = luaL_checkinteger(L, -1);
int val = luaL_checkinteger(L, -1);
SourceNumVal v;
v.isSource = (abs(val) >= 1024);
v.value = val;
mix->offset = v.rawValue;
}
else if (!strcmp(key, "switch")) {
mix->swtch = luaL_checkinteger(L, -1);
@@ -916,7 +936,11 @@ static int luaModelInsertMix(lua_State *L)
mix->curve.type = luaL_checkinteger(L, -1);
}
else if (!strcmp(key, "curveValue")) {
mix->curve.value = luaL_checkinteger(L, -1);
int val = luaL_checkinteger(L, -1);
SourceNumVal v;
v.isSource = (abs(val) >= 1024);
v.value = val;
mix->curve.value = v.rawValue;
}
else if (!strcmp(key, "multiplex")) {
mix->mltpx = luaL_checkinteger(L, -1);