]> git.sesse.net Git - nageru/blobdiff - nageru/theme.lua
Allow giving class names to Block.choose_alternative.
[nageru] / nageru / theme.lua
index 0bbb7194a6eb8c2ff9151739c47fb5e55d9c12aa..e117e62949f4472e736fe03574fbfaf5fc50e8ea 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(0)  -- High-quality resampling (ResampleEffect)
+                       simple_scene.resample_effect:choose_alternative(ResampleEffect)  -- High-quality resampling.
                else
-                       simple_scene.resample_effect:choose_alternative(1)  -- Low-quality resampling (ResizeEffect)
+                       simple_scene.resample_effect:choose_alternative(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(1)  -- Low-quality resizing.
+               input.resample_switcher:choose_alternative(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(0)
+               input.resample_switcher:choose_alternative(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(1)
+               input.resample_switcher:choose_alternative(ResizeEffect)
 
                local width = round(x1 - x0)
                local height = round(y1 - y0)