@echo off
SETLOCAL EnableDelayedExpansion
for %%a in (*_front.png) do (
	SET "b=%%~na"
	SET "b=!b:_front=!"
	bin\astcenc-avx2.exe -cl "!b!_right.png" "!b!_right.astc" 8x6 -thorough
	bin\astcenc-avx2.exe -cl "!b!_left.png" "!b!_left.astc" 8x6 -thorough
	bin\astcenc-avx2.exe -cl "!b!_up.png" "!b!_up.astc" 8x6 -thorough
	bin\astcenc-avx2.exe -cl "!b!_down.png" "!b!_down.astc" 8x6 -thorough
	bin\astcenc-avx2.exe -cl "!b!_back.png" "!b!_back.astc" 8x6 -thorough
	bin\astcenc-avx2.exe -cl "!b!_front.png" "!b!_front.astc" 8x6 -thorough
	copy /b "!b!_right.astc" + "!b!_left.astc" + "!b!_up.astc" + "!b!_down.astc" + "!b!_back.astc" + "!b!_front.astc" "!b!"_cube.astc6
	del "!b!_right.astc" "!b!_left.astc" "!b!_up.astc" "!b!_down.astc" "!b!_back.astc" "!b!_front.astc"
)
ENDLOCAL