Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- EndLocal
- SetLocal EnableDelayedExpansion
- :: START batch for Half-Life
- :: cheking is batch started in debug mode
- if "%1"=="debug" set echo==echo
- :: defaults
- set def_game=valve
- set def_engine=-gl
- set engine0_cmd=_ _g _gl
- set engine1=-software
- set engine1_cmd=_s _sw _soft _software
- set engine2=-d3d
- set engine2_cmd=_x _d3 _dx _d3d
- set def_heapsize=64
- set def_mode=-fullscreen
- set mode_cmd=_ _f _ful _full _fullscreen
- set def_width=1280
- set def_height=1024
- set ndef_mode=-window
- set ndef_width=1152
- set ndef_height=864
- set def_bitdepth=32
- set ndef_bitdepth=16
- set break=b brk break
- set default=d def default
- set manual=m man manual
- :: hints
- color
- echo you can enter any time one of the following commands:
- echo %break%
- echo - to immediatelly quit without running the game
- echo %default%
- echo - to skip this and all next steps and run the game using default settings
- echo %manual%
- echo - to skip this and all next steps and enter commandline by hand
- echo.
- :game
- echo Choose the game
- echo [nothing] : Half-Life (%def_game%)
- echo [else] : [else]
- set LC_COLLATE=ru_RU.utf8
- ls --hide=*.*
- set /p game=
- for %%a in (%break%) do (
- if "%game%"=="%%a" goto eof
- )
- for %%a in (%manual%) do (
- if "%game%"=="%%a" (
- set game=
- goto pass
- )
- )
- for %%a in (%default%) do (
- if "%game%"=="%%a" (
- set game=
- goto default
- )
- )
- if "%game%"=="" (
- set game=%def_game%
- )
- if not exist %game%\ (
- echo cannot find the game: %game%
- goto game
- ) else (
- set game=-game %game%
- )
- :: engine
- echo Choose the engine
- echo [nothing] : %def_engine%
- echo s : %engine1%
- echo x : %engine2%
- echo [else] : %def_engine%
- set /p engine=
- for %%a in (%break%) do (
- if "%engine%"=="%%a" goto eof
- )
- for %%a in (%manual%) do (
- if "%engine%"=="%%a" (
- set engine=
- goto pass
- )
- )
- for %%a in (%default%) do (
- if "%engine%"=="%%a" (
- color 60
- set engine=
- goto default
- )
- )
- set engine=_%engine%
- for %%a in (%engine1_cmd%) do (
- if "%%a"=="%engine%" (
- color 30
- set engine=%engine1%
- )
- )
- for %%a in (%engine2_cmd%) do (
- if "%%a"=="%engine%" (
- color 50
- set engine=%engine2%
- )
- )
- if not "%engine%"=="%engine1%" (
- if not "%engine%"=="%engine2%" (
- color 60
- set engine=%def_engine%
- )
- )
- :: heapsize
- echo Set heapsize
- echo [nothing] : %def_heapsize%M
- echo [else] : [else] (in megabytes)
- set /p heapsize=
- for %%a in (%break%) do (
- if "%heapsize%"=="%%a" goto eof
- )
- for %%a in (%manual%) do (
- if "%heapsize%"=="%%a" (
- set heapsize=
- goto pass
- )
- )
- for %%a in (%default%) do (
- if "%heapsize%"=="%%a" (
- set heapsize=
- goto default
- )
- )
- if "%heapsize%"=="" (
- set heapsize=%def_heapsize%
- )
- set /a heapsize=%heapsize%*1024
- set heapsize=-heapsize %heapsize%
- :: software engine indifferent to bitdepth switches
- if "%engine%"=="-software" goto mode
- :: bitdepth
- echo Set bitdepth
- echo [nothing] : %def_bitdepth%
- echo [else] : %ndef_bitdepth%
- set /p bitdepth=
- for %%a in (%break%) do (
- if "%bitdepth%"=="%%a" goto eof
- )
- for %%a in (%manual%) do (
- if "%bitdepth%"=="%%a" (
- set bitdepth=
- goto pass
- )
- )
- for %%a in (%default%) do (
- if "%bitdepth%"=="%%a" (
- set bitdepth=
- goto default
- )
- )
- if "%bitdepth%"=="" (
- set bitdepth=-%def_bitdepth%bpp
- ) else (
- set bitdepth=-%ndef_bitdepth%bpp
- )
- :mode
- echo Run windowed or in fullscreen?
- echo [nothing] : %def_mode%
- echo [else] : %ndef_mode%
- set /p mode=
- for %%a in (%break%) do (
- if "%mode%"=="%%a" goto eof
- )
- for %%a in (%manual%) do (
- if "%mode%"=="%%a" (
- set mode=
- goto pass
- )
- )
- for %%a in (%default%) do (
- if "%mode%"=="%%a" (
- set mode=
- goto default
- )
- )
- set mode=_%mode%
- for %%a in (%mode_cmd%) do (
- if "%%a"=="%mode%" (
- set mode=%def_mode%
- )
- )
- if not "%mode%"=="%def_mode%" (
- set mode=%ndef_mode%
- )
- :: default resolutions
- if "%mode%"=="%def_mode%" (
- set w=%def_width%
- set h=%def_height%
- ) else (
- set w=%ndef_width%
- set h=%ndef_height%
- )
- :: resolution
- :: width
- echo Set width resolution
- echo [nothing] : %w%
- echo [else] : [else]
- set /p width=
- for %%a in (%break%) do (
- if "%width%"=="%%a" goto eof
- )
- for %%a in (%manual%) do (
- if "%width%"=="%%a" (
- set width=
- goto pass
- )
- )
- for %%a in (%default%) do (
- if "%width%"=="%%a" (
- set width=
- goto start
- )
- )
- if "%width%"=="" (
- set width=-width %w%
- ) else (
- set width=-width %width%
- )
- :: height
- echo Set height resolution
- echo [nothing] : %h%
- echo [else] : [else]
- set /p height=
- for %%a in (%break%) do (
- if "%height%"=="%%a" goto eof
- )
- for %%a in (%manual%) do (
- if "%height%"=="%%a" (
- set height=
- goto pass
- )
- )
- for %%a in (%default%) do (
- if "%height%"=="%%a" (
- set height=
- goto start
- )
- )
- if "%height%"=="" (
- set height=-height %h%
- ) else (
- set height=-height %height%
- )
- :pass
- color 20
- echo Set the additional options
- echo [nothing] : [nothing]
- echo [else] : [else]
- echo list of additional switches:
- echo dev: +cl_showfps +developer +r_speeds +sv_cheats +dev_overview
- echo +hud_draw -nosound -condebug
- echo limits: -particles -num_edicts +fps_max
- echo other: -anyaspect -insecure -nomaster
- echo control: -noforcemparms -noforcemaccel
- echo won: -toconsole -dev
- echo.
- set /p options=
- for %%a in (%break%) do (
- if "%options%"=="%%a" goto eof
- )
- :start
- %echo% start hl.exe %engine% %game% %heapsize% %mode% %video% %bitdepth% %width% %height% %startwindowed% %options%
- goto eof
- :default
- if not defined engine set engine=%def_engine%
- if not defined game set game=-game %def_game%
- if not defined heapsize (
- set /a heapsize=%def_heapsize%*1024
- set heapsize=-heapsize !heapsize!
- )
- if not "%engine%"=="-software" if not defined bitdepth set bitdepth=-%def_bitdepth%bpp
- if not defined mode set mode=%def_mode%
- if "%mode%"=="-window" (
- if not defined width set width=-width %ndef_width%
- if not defined height set height=-height %ndef_height%
- ) else (
- if not defined width set width=-width %def_width%
- if not defined height set height=-height %def_height%
- )
- goto start
- :eof
- color
- EndLocal
- exit/b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement