return 0;
}
-int Block_choose_alternative(lua_State* L)
+int Block_choose(lua_State* L)
{
assert(lua_gettop(L) == 2);
Block *block = *(Block **)luaL_checkudata(L, 1, "Block");
if (lua_isnumber(L, 2)) {
alternative_idx = luaL_checknumber(L, 2);
} else if (lua_istable(L, 2)) {
- // See if it's an Effect metatable (e.g. foo:choose_alternative(ResampleEffect))
+ // See if it's an Effect metatable (e.g. foo:choose(ResampleEffect))
lua_getfield(L, 2, "__effect_type_id");
if (lua_isnumber(L, -1)) {
EffectType effect_type = EffectType(luaL_checknumber(L, -1));
}
if (alternative_idx == -1) {
- luaL_error(L, "choose_alternative() called with something that was not an index or an effect type (e.g. ResampleEffect) that was part of the alternatives");
+ luaL_error(L, "choose() called with something that was not an index or an effect type (e.g. ResampleEffect) that was part of the alternatives");
}
assert(alternative_idx >= 0);
};
int Block_display(lua_State* L);
-int Block_choose_alternative(lua_State* L);
+int Block_choose(lua_State* L);
int Block_enable(lua_State *L);
int Block_disable(lua_State *L);
int Block_set_int(lua_State *L);
const luaL_Reg Block_funcs[] = {
{ "display", Block_display },
- { "choose_alternative", Block_choose_alternative },
+ { "choose", Block_choose },
{ "enable", Block_enable },
{ "disable", Block_disable },
{ "set_int", Block_set_int },
simple_scene.input:display(signal_num)
if needs_scale(signals, signal_num, width, height) then
if hq then
- simple_scene.resample_effect:choose_alternative(ResampleEffect) -- High-quality resampling.
+ simple_scene.resample_effect:choose(ResampleEffect) -- High-quality resampling.
else
- simple_scene.resample_effect:choose_alternative(ResizeEffect) -- Low-quality resampling.
+ simple_scene.resample_effect:choose(ResizeEffect) -- Low-quality resampling.
end
simple_scene.resample_effect:set_int("width", width)
simple_scene.resample_effect:set_int("height", height)
-- Cull.
if x0 > screen_width or x1 < 0.0 or y0 > screen_height or y1 < 0.0 then
- input.resample_switcher:choose_alternative(ResizeEffect) -- Low-quality resizing.
+ input.resample_switcher:choose(ResizeEffect) -- Low-quality resizing.
input.resize_effect:set_int("width", 1)
input.resize_effect:set_int("height", 1)
input.padding_effect:set_int("left", screen_width + 100)
if hq then
-- High-quality resampling.
- input.resample_switcher:choose_alternative(ResampleEffect)
+ input.resample_switcher:choose(ResampleEffect)
local x_subpixel_offset = x0 - math.floor(x0)
local y_subpixel_offset = y0 - math.floor(y0)
input.padding_effect:set_float("border_offset_bottom", y1 - (math.floor(y0) + height))
else
-- Lower-quality simple resizing.
- input.resample_switcher:choose_alternative(ResizeEffect)
+ input.resample_switcher:choose(ResizeEffect)
local width = round(x1 - x0)
local height = round(y1 - y0)