Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- Echo ==============================================================================
- ECHO Welcome to Axem's NVDXT Batch Converter.
- Echo ==============================================================================
- :ConvertMode
- :InputSet
- Echo ==============================================================================
- ECHO Enter Input Directory. Leave blank for the current directory. (No trailing \)
- SET /P inputDir=Input Directory:
- If not defined inputDir set inputDir=%cd%
- REM Echo %inputDir%
- :OutputSet
- Echo ==============================================================================
- ECHO Enter Output Directory. Leave blank for the current directory. (No trailing \)
- SET /P outputDir=Output Directory:
- If not defined outputDir set outputDir=%cd%
- REM Echo %outputDir%
- Echo ==============================================================================
- Echo Please enter the input string. Wildcards accepted.
- Echo Examples:
- Echo exp04_0000.png - Exact file
- Echo exp*.* - Starts with exp
- Echo *_0000.* - Ends with _0000
- Echo *.png - All PNG files
- :InputStringSet
- SET /P inputString=Input String:
- If not defined inputString goto InputStringSet
- REM Echo %inputString%
- :DXTSet
- Echo ==============================================================================
- Echo Please select your DXT compression
- choice /C 135nu /N /M "Use DXT[1], DXT[3], DXT[5], DXT5[n]m, [U]888"
- IF ERRORLEVEL 5 ( SET DXT=-u888 && GOTO DXTdone )
- IF ERRORLEVEL 4 ( SET DXT=-dxt5nm && GOTO DXTdone )
- IF ERRORLEVEL 3 ( SET DXT=-dxt5 && GOTO DXTdone )
- IF ERRORLEVEL 2 ( SET DXT=-dxt3 && GOTO DXTdone )
- IF ERRORLEVEL 1 ( SET DXT=-dxt1a && GOTO DXTdone )
- :DXTdone
- REM Echo %DXT%
- echo If I need to rescale the image, should it to the...
- choice /C nhld /N /M "[N]earest power of 2, next [H]igher power of 2, the next [L]ower power of 2, or [D]on't touch it"
- IF ERRORLEVEL 4 ( SET rescale= && GOTO RescaleDone )
- IF ERRORLEVEL 3 ( SET rescale=-rescale next_lo && GOTO RescaleDone )
- IF ERRORLEVEL 2 ( SET rescale=-rescale hi && GOTO RescaleDone )
- IF ERRORLEVEL 1 ( SET rescale=-rescale nearest && GOTO RescaleDone )
- :RescaleDone
- choice /C yn /M "Would you like MipMaps?"
- IF ERRORLEVEL 2 ( SET mipmap=-nomipmap && GOTO MipMapDone )
- IF ERRORLEVEL 1 ( SET mipmap= && GOTO MipMapDone )
- :MipMapDone
- Echo ==============================================================================
- Echo ==============================================================================
- Echo NVDXT will run with...
- Echo Input: %inputDir%\%inputString%
- Echo Output: %outputDir%
- Echo Compression: %DXT%
- Echo Rescale Style: %rescale%
- IF defined mipmap echo Mipmaps Off
- choice /C yn /M "Is this okay"
- IF ERRORLEVEL 2 GOTO ConvertMode
- IF ERRORLEVEL 1 GOTO RunNVDXT
- :RunNVDXT
- Echo ==============================================================================
- Echo ==============================================================================
- Echo Running NVDXT...
- nvdxt -file %inputDir%\%inputString% -outdir %outputDir% -quality_highest %DXT% %rescale% %mipmap% -overwrite
- :EndBatch
- Echo Script has finished running.
- pause
Advertisement
Add Comment
Please, Sign In to add comment