#!/usr/bin/env bash
#Author: linux-gaming.ru
#eve.exe
#evelauncher.exe
#Rating=5
#####################examples###########################
##export PW_COMMENT_DB="blablabla"
# export PW_WINE_USE=PROTON_GE
export PW_VULKAN_USE=1
#export PW_WINDOWS_VER=7                        # Set windows version 10, 7 or XP
export PW_DLL_INSTALL="vcrun2019 d3dcompiler_47"               # Install DDL in port prefix (used winetricks) 
export WINEDLLOVERRIDES="concrt140,msvcp140,msvcp140_1,msvcp140_2,d3dcompiler_47=n"

##export PW_FORCE_USE_VSYNC=2                     # Vsync: 0-FORCE_OFF, 1-FORCE_ON, 2-BY_DEFAULT
##export ENABLE_VKBASALT=1
export PW_VKBASALT_EFFECTS="cas:FilmGrain2"
export PW_VKBASALT_FFX_CAS="0.5"

##export PW_NO_FSYNC=1                            # Do not use futex-based in-process synchronization primitives. (Automatically disabled on systems with no FUTEX_WAIT_MULTIPLE support.
##export PW_NO_ESYNC=1                            # Do not use eventfd-based in-process synchronization primitives

##export PULSE_LATENCY_MSEC=60                    # Fix crackling audio in games

##export PW_USE_GAMEMODE=0              # Force disabele gamemod
##export PW_FORCE_LARGE_ADDRESS_AWARE=1           # Force Wine to enable the LARGE_ADDRESS_AWARE flag for all executables. Enabled by default.
##export PW_NO_WRITE_WATCH=0                      # Disable support for memory write watches in ntdll. This is a very dangerous hack and should only be applied if you have verified that the game can operate without write watches. This improves performance for some very specific games (e.g. CoreRT-based games).
##export PW_HEAP_DELAY_FREE=0

##export WINEARCH=win32                           # defaut = win64
##export WINEPREFIX=

##export PW_WINEDBG_DISABLE=1                     # Disabled WINEDBG
##export PW_USE_TERMINAL=0                        # Force run in terminal
##export PW_LOG=0                                 # Enable debug mode fo terminal
##export PW_GUI_DISABLED_CS=1                     # 1 = disabled GUI

# eve_fix () {
#     export EVE_SHADER_CASH="$WINEPREFIX/drive_c/Games/EVE Online/SharedCache"
#     if [[ ! -f "$EVE_SHADER_CASH/tq/bin64/launchdarkly_client.pyd" ]] ; then
#     sleep 30
#         while check_process evelauncher.exe && [[ ! -f "$EVE_SHADER_CASH/tq/bin64/launchdarkly_client.pyd" ]]
#         do sleep 1
#         done
#     fi
#     sleep 2
#     try_remove_file "$EVE_SHADER_CASH/tq/launchdarkly_client.pyd"
#     try_copy_file "$EVE_SHADER_CASH/tq/bin64/launchdarkly_client.pyd" "$EVE_SHADER_CASH/tq/"
#     chmod 444 "$EVE_SHADER_CASH/tq/launchdarkly_client.pyd"
# }

add_in_start_portwine () { 
    # eve_fix &
    echo ""
}