@echo off
echo Deleteing textures from %1
echo .
echo DEL DKDIR\DATA\TEXTURES\%1
del DKDIR\data\textures\%1\colormap.bmp
del DKDIR\data\textures\%1\*.wal
echo DEL MAPDIR\%1\GFX8
del MAPDIR\%1\gfx8\*.bmp
del MAPDIR\%1\gfx8\*.wal

cd MAPDIR\%1
echo Converting 24-bit textures to 8-bit textures
opti gfx gfx8
cd gfx8
echo Converting 8-bit BMPs to WALs
dkdata -colormap clip.bmp
dkdata -mipdir %1
mkdir DKDIR\data\textures\%1
copy *.wal DKDIR\data\textures\%1
copy colormap.bmp DKDIR\data\textures\%1
echo ** .Wal files copied **
echo  
