--Helper.
function p.txt_col(wid, col)
    ga_win_set_front_color(wid, col)
end

function p.interp_col(col1, col2, frac)
    local col = {x=0, y=0, z=0}
    col.x = (1.0 - frac)*col1.x + frac*col2.x
    col.y = (1.0 - frac)*col1.y + frac*col2.y
    col.z = (1.0 - frac)*col1.z + frac*col2.z
    return col
end

function p.__render(wid)
    if( ga_get_b("xar.hud.disable_hud") ) then return end

    if( ga_get_b("xar.cheat.inf2.enabled") ) then
        --Infinifrag2 Easter egg.
        game_inf2.hud_render(wid)
        return
    end

    --Debugging.
    blinker_test.render(wid)

    -- ga_win_set_char_size(wid, 0.012, 0.024)

    game_hud_render_dark_hole_charge.render_dark_hole_charge(wid)

    game_hud_render_low_health_border.render_low_health_border(wid)

    game_hud_render_compass.render_compass(wid)
    game_hud_render_dps.render_dps(wid)
    game_hud_render_identified_ment.render_identified_ment(wid)

    game_hud_render_hive_attack_meter.render_hive_attack_meter(wid)

    game_hud_render_shield.render_shield(wid)
    game_hud_render_health.render_health(wid)
    game_hud_render_armor.render_armor(wid)

    game_hud_render_gold.render_gold(wid)
    game_hud_render_markers.render_markers(wid)

    game_hud_render_ammo.render_ammo(wid)

    game_hud_render_xp_bar.render_xp_bar(wid)

    if ga_get_b("xar.hud.show_icons") then
        game_hud_render_icons.render_icons(wid)
    end

    game_hud_render_lower_left_msg.render_lower_left_msg(wid)

    game_hud_render_flash.render_flash(wid)
end
