]> git.sesse.net Git - nageru/commitdiff
Rename choose_alternative() to choose().
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 15 Jun 2019 22:31:20 +0000 (00:31 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 15 Jun 2019 22:31:20 +0000 (00:31 +0200)
nageru/scene.cpp
nageru/scene.h
nageru/theme.cpp
nageru/theme.lua

index bebaa56d1af3b71b86f7868d9f4b345860267f3b..38927384a1fafc4fb8fa8cb1477334f1e4b4cad7 100644 (file)
@@ -491,7 +491,7 @@ int Block_display(lua_State* L)
        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");
@@ -499,7 +499,7 @@ int Block_choose_alternative(lua_State* L)
        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));
@@ -509,7 +509,7 @@ int Block_choose_alternative(lua_State* L)
        }
 
        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);
index 5d5d783a6dff38eefe05be81b0b926db245890ae..fc36963cc9eebd3ae56943293e9c74ce71886ea5 100644 (file)
@@ -103,7 +103,7 @@ struct Block {
 };
 
 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);
index bf7cdee1e3ceb64f7705f619f1f992c464357b5d..53b7543cee3a9f5fe07b1d9c8dc441633fd5b171 100644 (file)
@@ -791,7 +791,7 @@ const luaL_Reg Scene_funcs[] = {
 
 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 },
index 596108d5f0db710ebfd911d572d008becb56c5d3..172b91d371ad6a525f74560d68ed7a5bc87f70db 100644 (file)
@@ -401,9 +401,9 @@ function setup_simple_input(state, signals, signal_num, width, height, hq)
        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)
@@ -509,7 +509,7 @@ function place_rectangle(input, x0, y0, x1, y1, screen_width, screen_height, inp
 
        -- 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)
@@ -542,7 +542,7 @@ function place_rectangle(input, x0, y0, x1, y1, screen_width, screen_height, inp
 
        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)
@@ -578,7 +578,7 @@ function place_rectangle(input, x0, y0, x1, y1, screen_width, screen_height, inp
                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)