-------------------------------------------------------------------------------
local GetPreloadTextureTools = nil
local GetPreloadTextureGUI = nil
local GetPreloadTextureNotes = nil
local GetPreloadTexturePanel = nil
local GetPreloadTextureMainMenu = nil
local GetPreloadTextureInGameMenu = nil
local GetPreloadTextureCommonAnimations = nil
local GetPreloadTextureCollect = nil
-------------------------------------------------------------------------------
function ExtractFilesFromDirectory(folder, data_files)
    local vecFiles = ParseDirectory(folder)
    for i = 0, vecFiles:size() - 1 do
        local file = vecFiles:get(i)
        if IsDirectory(file) then
            ExtractFilesFromDirectory(folder, data_files)
        else
            table.insert(data_files, file)
        end
    end
end
-------------------------------------------------------------------------------
function GetPreloadResource()
    local data = {}
    
    GetPreloadTextureTools(data)
    GetPreloadTextureGUI(data)
    GetPreloadTextureNotes(data)
    GetPreloadTexturePanel(data)
    GetPreloadTextureMainMenu(data)
    GetPreloadTextureInGameMenu(data)
    GetPreloadTextureCommonAnimations(data)
    GetPreloadTextureCollect(data)
    
    --table.insert(data, PreloadSceneSounds)
    --table.insert(data, PreloadAmbientSounds)
    table.insert(data, RegisterScenes)

    return data
end
-------------------------------------------------------------------------------
function GetPreloadTextureTools(data)
    -- load texture inventory tool
    local toolInfoVec = ParseToolsDirectory(TOOL_FOLDER, TOOL_INVENTORY_SUFFIX, TOOL_WINDOW_SUFFIX)
    for i = 0,  toolInfoVec:size() - 1 do
        local inv_path      = toolInfoVec:get(i).toolInvPath
        
        table.insert(data, inv_path)
    end
    
    if IsCollectorsEdition() and not IsDemoMode() then
        local toolInfoVec = ParseToolsDirectory(TOOL_FOLDER_EXTRA, TOOL_INVENTORY_SUFFIX, TOOL_WINDOW_SUFFIX)
        for i = 0,  toolInfoVec:size() - 1 do
            local inv_path      = toolInfoVec:get(i).toolInvPath
            
            table.insert(data, inv_path)
        end
    end

end
-------------------------------------------------------------------------------
function GetPreloadTextureGUI(data)
    -- preload texture zoom-zone
    table.insert(data, 'data/Texture/GUI/Zoom/zoom350.png')
    table.insert(data, 'data/Texture/GUI/Zoom/zoom640.png')
    table.insert(data, 'data/Texture/GUI/Zoom/zoom_vertical.png')
    
    -- preload texture buttons
    table.insert(data, 'data/Texture/GUI/Buttons/bttn_ok.png')
    
    -- preload texture common/area
    ExtractFilesFromDirectory('data/Texture/Common/', data)
    
    -- preload texture OK-screen
    table.insert(data, 'data/Texture/GUI/OK/WindowOK.png')
    
    -- preload texture YesNo-screen
    table.insert(data, 'data/Texture/GUI/YesNo/YesNoScreenBackground.png')
end
-------------------------------------------------------------------------------
function GetPreloadTextureNotes(data)
    table.insert(data, 'data/Texture/GUI/Notes/NotesBackground.png')
    table.insert(data, 'data/Texture/GUI/Notes/Button_Close.png')
end
-------------------------------------------------------------------------------
function GetPreloadTexturePanel(data)
    ExtractFilesFromDirectory('data/Texture/GUI/Panel/', data)
    ExtractFilesFromDirectory('data/Texture/GUI/Panel/animations/', data)
    --ExtractFilesFromDirectory('data/Texture/GUI/Panel/bat/', data)
    ExtractFilesFromDirectory('data/Texture/GUI/Panel/bttn/', data)
    ExtractFilesFromDirectory('data/Texture/GUI/Panel/hint/', data)
    ExtractFilesFromDirectory('data/Texture/GUI/Panel/HintAnim/', data)
    ExtractFilesFromDirectory('data/Texture/GUI/Panel/inventory/', data)
    ExtractFilesFromDirectory('data/Texture/GUI/Panel/inventory/bttn/', data)
    ExtractFilesFromDirectory('data/Texture/GUI/Panel/note/', data)
end
-------------------------------------------------------------------------------
function GetPreloadTextureMainMenu(data)
    -- ExtractFilesFromDirectory('data/Texture/Menu/', data)
    -- ExtractFilesFromDirectory('data/Texture/Menu/animations/bg/', data)
    -- ExtractFilesFromDirectory('data/Texture/Menu/bttn/', data)
    ExtractFilesFromDirectory('data/Texture/Menu/layer/', data)    
end
-------------------------------------------------------------------------------
function GetPreloadTextureInGameMenu(data)
    ExtractFilesFromDirectory('data/Texture/GUI/InGameMenu/', data)
end
-------------------------------------------------------------------------------
function GetPreloadTextureCommonAnimations(data)
    ExtractFilesFromDirectory('data/Texture/Common/anim/', data)
end
-------------------------------------------------------------------------------
function GetPreloadTextureCollect(data)
    -- ExtractFilesFromDirectory('data/Texture/Collect/anim/crystal/', data)
    -- ExtractFilesFromDirectory('data/Texture/Collect/anim/face/blue/', data)
    -- ExtractFilesFromDirectory('data/Texture/Collect/anim/face/green/', data)
    -- ExtractFilesFromDirectory('data/Texture/Collect/anim/face/red/', data)
    -- ExtractFilesFromDirectory('data/Texture/Collect/anim/face/violet/', data)
end
-------------------------------------------------------------------------------
