Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- EndLocal
- SetLocal EnableDelayedExpansion
- :: START batch for Quake
- :: cheking is batch started in debug mode
- if "%1"=="debug" set echo==echo
- :: defaults
- set def_engine=winquake
- set engine_cmd=_ _w _win _winquake
- set ndef_engine=glquake
- set def_game=ID1
- set def_heapsize=16
- 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=16
- set ndef_bitdepth=32
- set def_video=7
- 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.
- :: engine
- echo Choose the engine
- echo [nothing] : %def_engine%
- echo [else] : %ndef_engine%
- set /p engine=
- for %%a in (%break%) do (
- if "%engine%"=="%%a" goto eof
- )
- for %%a in (%manual%) do (
- if "%engine%"=="%%a" goto manual
- )
- for %%a in (%default%) do (
- if "%engine%"=="%%a" (
- color 30
- set engine=
- goto default
- )
- )
- set engine=_%engine%
- for %%a in (%engine_cmd%) do (
- if "%%a"=="%engine%" (
- color 30
- set engine=%def_engine%
- )
- )
- if not "%engine%"=="%def_engine%" (
- color 60
- set engine=%ndef_engine%
- )
- :game
- echo Choose the game
- echo [nothing] : quake (%def_game%)
- echo [else] : [else]
- 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%
- )
- :: 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%
- :: winquake and glquake are using different video switches
- if "%engine%"=="winquake" (
- set wcmd=+vid_config_x
- set hcmd=+vid_config_y
- goto video
- ) else (
- set wcmd=-width
- set hcmd=-height
- )
- :: 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=-bpp %def_bitdepth%
- ) else (
- set bitdepth=-bpp %ndef_bitdepth%
- )
- :: 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%
- )
- :: skip winquake-specific options
- goto resolution
- :video
- echo Set vid_mode
- echo [nothing] : %def_video%
- echo [else] : [else]
- echo list of possible values:
- echo windowed
- echo 0 for 320x240
- echo 1 for 640x480
- echo 2 for user-defined
- echo fullscreen
- echo 3 for 320x240
- echo 4 for 640x480
- echo 5 for 800x600
- echo 6 for 1024x768
- echo 7 for 1280x1024
- set /p video=
- for %%a in (%break%) do (
- if "%video%"=="%%a" goto eof
- )
- for %%a in (%manual%) do (
- if "%video%"=="%%a" (
- set video=
- goto pass
- )
- )
- for %%a in (%default%) do (
- if "%video%"=="%%a" (
- set video=
- goto start
- )
- )
- if "%video%"=="" (
- set video=+vid_mode %def_video%
- ) else (
- set video=+vid_mode %video%
- )
- :: check for windowed mode
- if not "%video%"=="+vid_mode 2" (
- goto pass
- )
- set w=%ndef_width%
- set h=%ndef_height%
- set startwindowed=-startwindowed
- :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=%wcmd% %w%
- ) else (
- set width=%wcmd% %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=%hcmd% %h%
- ) else (
- set height=%hcmd% %height%
- )
- :pass
- color 20
- echo Set the additional options
- echo [nothing] : [nothing]
- echo [else] : [else]
- call :switches
- set /p options=
- for %%a in (%break%) do (
- if "%options%"=="%%a" goto eof
- )
- :start
- %echo% start %engine%.exe -listen 8 %game% %heapsize% %mode% %video% %bitdepth% %width% %height% %startwindowed% %options%
- goto eof
- :manual
- color 47
- echo WARNING: you have choosed to skip hints and enter the commandline manually.
- echo [nothing] : [nothing]
- echo [else] : [else]
- echo Enter full command to start game, e. g.:
- echo.
- echo %def_engine%.exe -game %def_game% -heapsize 16384 -listen 8 -%def_mode% -width %def_width% -height %def_height% -bpp %def_bitdepth% +vid_mode %def_video% +vid_config_x %def_width% +vid_config_y %def_height% +map somemap
- echo.
- call :switches
- set /p cmdline=
- for %%a in (%break%) do (
- if "%cmdline%"=="%%a" goto eof
- )
- %echo% start %cmdline%
- 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 "%engine%"=="winquake" (
- if not defined video set video=+vid_mode %def_video%
- if "%video%"=="+vid_mode 2" (
- if not defined width set width=+vid_config_x %ndef_width%
- if not defined height set height=+vid_config_y %ndef_height%
- )
- ) else (
- if not defined bitdepth set bitdepth=-bpp %def_bitdepth%
- 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
- :switches
- echo list of additional switches:
- echo memory: -winlock -winlockunlock
- echo draw: -nodirectdraw -startwindowed -nowindirect -noautostretch
- echo -notriplebuf -novbeaf -nofulldib -dibonly
- echo -allow360 -noforcevga +vid_window_x X +vid_window_y Y
- echo -resetwinpos
- echo sound: -wavonly -nocdaudio -nosound -primarysound
- echo -sndspeed MHz -sndbits BITS -snoforceformat
- echo control: -dinput
- echo ? : -basedir DIR -cddev DEV -nomtex -ip
- echo.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement