]> git.sesse.net Git - ultimatescore/commitdiff
Make the theme use strict-compliant.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 26 Apr 2018 17:42:36 +0000 (19:42 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 26 Apr 2018 17:42:36 +0000 (19:42 +0200)
nageru/ultimate.lua

index 2f863578d2231d87b6c623608747c19eeab23c6a..e4cc82150d19fe22571446ebb14002aa9a2b931f 100644 (file)
@@ -281,7 +281,7 @@ function make_simple_chain(input_deint, input_video, input_scale, has_overlay, h
        end
 
        local resample_effect, resize_effect
-       if scale then
+       if input_scale then
                if hq then
                        resample_effect = chain:add_effect(ResampleEffect.new())
                else
@@ -382,7 +382,7 @@ end
 -- and get_channel_resolution_raw() is that this one also can say that
 -- there's no signal.
 function get_channel_resolution(signal_num)
-       res = last_resolution[signal_num]
+       local res = last_resolution[signal_num]
        if (not res) or not res.is_connected then
                return "disconnected"
        end
@@ -690,7 +690,7 @@ function get_fade_chain(signals, t, width, height, input_resolution)
        local input1_type = get_input_type(signals, transition_dst_signal)
        local input1_scale = needs_scale(signals, transition_dst_signal, width, height)
        local chain = fade_chains[input0_type][input0_scale][input1_type][input1_scale][overlay_enabled][true]
-       prepare = function()
+       local prepare = function()
                if input0_type == "live" or input0_type == "livedeint" then
                        chain.input0.input:connect_signal(transition_src_signal)
                end
@@ -807,7 +807,7 @@ function get_chain(num, t, width, height, signals)
                if transition_type == ZOOM_TRANSITION then
                        -- Transition in or out of SBS.
                        local chain = get_sbs_chain(signals, t, width, height, input_resolution)
-                       prepare = function()
+                       local prepare = function()
                                prepare_sbs_chain(chain, calc_zoom_progress(t), transition_type, transition_src_signal, transition_dst_signal, width, height, input_resolution)
                                prepare_overlay_live(chain, t, 1.0)
                        end
@@ -815,7 +815,7 @@ function get_chain(num, t, width, height, signals)
                elseif transition_type == NO_TRANSITION and live_signal_num == SBS_SIGNAL_NUM then
                        -- Static SBS view.
                        local chain = get_sbs_chain(signals, t, width, height, input_resolution)
-                       prepare = function()
+                       local prepare = function()
                                prepare_sbs_chain(chain, 0.0, NO_TRANSITION, 0, SBS_SIGNAL_NUM, width, height, input_resolution)
                                prepare_overlay_live(chain, t, 1.0)
                        end
@@ -827,7 +827,7 @@ function get_chain(num, t, width, height, signals)
                        local input_scale = needs_scale(signals, live_signal_num, width, height)
                        local overlay_really_enabled = overlay_enabled and simple_signal_has_overlay(live_signal_num)
                        local chain = simple_chains[input_type][input_scale][overlay_really_enabled][true]
-                       prepare = function()
+                       local prepare = function()
                                if input_type ~= "video" then
                                        chain.input:connect_signal(live_signal_num)
                                end
@@ -838,7 +838,7 @@ function get_chain(num, t, width, height, signals)
                        return chain.chain, prepare
                elseif live_signal_num == STATIC_SIGNAL_NUM then  -- Static picture.
                        local chain = static_chains[true]
-                       prepare = function()
+                       local prepare = function()
                                prepare_overlay_live(chain, t, 1.0)  -- FIXME: Should this ever be here?
                        end
                        return chain.chain, prepare
@@ -870,7 +870,7 @@ function get_chain(num, t, width, height, signals)
                local input_type = get_input_type(signals, signal_num)
                local input_scale = needs_scale(signals, signal_num, width, height)
                local chain = simple_chains[input_type][input_scale][show_overlay][false]
-               prepare = function()
+               local prepare = function()
                        if input_type ~= "video" then
                                chain.input:connect_signal(signal_num)
                        end
@@ -884,20 +884,20 @@ function get_chain(num, t, width, height, signals)
                local input0_type = get_input_type(signals, INPUT0_SIGNAL_NUM)
                local input1_type = get_input_type(signals, INPUT4_SIGNAL_NUM)
                local chain = sbs_chains[input0_type][show_overlay][input1_type][false]
-               prepare = function()
+               local prepare = function()
                        prepare_sbs_chain(chain, 0.0, NO_TRANSITION, 0, SBS_SIGNAL_NUM, width, height, input_resolution)
                end
                return chain.chain, prepare
        end
        if num == STATIC_SIGNAL_NUM + 2 then
                local chain = static_chains[false]
-               prepare = function()
+               local prepare = function()
                        prepare_overlay_static(chain, t)
                end
                return chain.chain, prepare
        end
        if num == OVERLAY_SIGNAL_NUM + 2 then
-               prepare = function()
+               local prepare = function()
 --                     prepare_overlay(overlay_chain_lq, t)
                end
                return overlay_chain_lq, prepare
@@ -1087,7 +1087,7 @@ end
 function prepare_overlay_live(chain, t, extra_alpha_factor)
        if chain.overlay then
                local tt = calc_fade_progress(t, overlay_transition_start, overlay_transition_end)
-               overlay_alpha = overlay_alpha_src + tt * (overlay_alpha_dst - overlay_alpha_src)
+               local overlay_alpha = overlay_alpha_src + tt * (overlay_alpha_dst - overlay_alpha_src)
                overlay_alpha = overlay_alpha * extra_alpha_factor
                --print("overlay_alpha=" .. overlay_alpha .. " [" .. overlay_alpha_src .. "," .. overlay_alpha_dst .. "]@" .. tt)
                if t > overlay_transition_end and overlay_alpha_dst == 0.0 then