Crusader_Decomp/render_maps.bat
MaddoScientisto 82ae89865a Add new modules for Crusader map rendering and processing
- Implemented `formats.py` to define data structures and functions for handling map data, including reading and decoding shape and map items.
- Created `png.py` for generating PNG images from shape frames and pixel data.
- Developed `sorting.py` to manage the sorting and rendering order of map items based on their properties and spatial relationships.
- Introduced `render_all_maps.py` to facilitate the rendering of all maps for specified games, including command-line argument parsing and subprocess management for rendering tasks.
2026-03-27 08:22:09 +01:00

84 lines
1.9 KiB
Batchfile

@echo off
setlocal EnableExtensions
pushd "%~dp0" >nul
set "PYTHON_EXE=%PYTHON_EXE%"
if not defined PYTHON_EXE if exist "C:\Users\Maddo\.PYENV\PYENV-WIN\versions\3.14.3\python.exe" set "PYTHON_EXE=C:\Users\Maddo\.PYENV\PYENV-WIN\versions\3.14.3\python.exe"
if not defined PYTHON_EXE set "PYTHON_EXE=python"
set "RENDER_ARGS=%RENDER_ARGS%"
if /I "%~1"=="remorse" goto remorse_cli
if /I "%~1"=="regret" goto regret_cli
if /I "%~1"=="all" goto all_cli
if "%~1"=="" goto menu
echo Unknown option: %~1
echo Usage: render_maps.bat [remorse^|regret^|all] [start_map] [end_map]
goto end
:menu
cls
echo Crusader Map Renderer
echo.
echo 1. Render all No Remorse maps
echo 2. Render all No Regret maps
echo 3. Render all maps for both games
echo 4. Exit
echo.
set /p choice=Choose an option:
if "%choice%"=="1" goto remorse_menu
if "%choice%"=="2" goto regret_menu
if "%choice%"=="3" goto all_menu
if "%choice%"=="4" goto end
echo.
echo Invalid choice.
pause
goto menu
:remorse_menu
"%PYTHON_EXE%" tools\render_all_maps.py --game remorse %RENDER_ARGS%
goto after_run
:regret_menu
"%PYTHON_EXE%" tools\render_all_maps.py --game regret %RENDER_ARGS%
goto after_run
:all_menu
"%PYTHON_EXE%" tools\render_all_maps.py --game all %RENDER_ARGS%
goto after_run
:remorse_cli
if "%~2"=="" (
"%PYTHON_EXE%" tools\render_all_maps.py --game remorse %RENDER_ARGS%
) else (
"%PYTHON_EXE%" tools\render_all_maps.py --game remorse --start %~2 --end %~3 %RENDER_ARGS%
)
goto end
:regret_cli
if "%~2"=="" (
"%PYTHON_EXE%" tools\render_all_maps.py --game regret %RENDER_ARGS%
) else (
"%PYTHON_EXE%" tools\render_all_maps.py --game regret --start %~2 --end %~3 %RENDER_ARGS%
)
goto end
:all_cli
if "%~2"=="" (
"%PYTHON_EXE%" tools\render_all_maps.py --game all %RENDER_ARGS%
) else (
"%PYTHON_EXE%" tools\render_all_maps.py --game all --start %~2 --end %~3 %RENDER_ARGS%
)
goto end
:after_run
echo.
pause
goto menu
:end
popd >nul
endlocal