QUAKE II BSP TEXTURE EXTRACTOR
=============================

Requirements:
  Windows, macOS, or Linux with Python 3.9+ and Tkinter installed.
  No Python packages need to be installed.

HOW TO RUN (WINDOWS)
  Double-click Quake2_Texture_Extractor.pyw.
  If Windows has not associated .pyw with Python, install Python 3
  from python.org and enable file associations during setup.
  Alternatively run it with: py -3 Quake2_Texture_Extractor.pyw

USAGE
  1. Browse to the Quake II .bsp map file.
  2. Select your Quake II installation directory (the directory
     containing baseq2), or a direct game data folder such as baseq2.
  3. Optional: select the mod's data folder so its textures override baseq2.
  4. Choose an existing destination folder (Desktop is the default).
  5. Click Extract Textures.

The program creates a *new* folder, named after the map, e.g.:
  Desktop/q2dm1_textures/textures/base/metal01.wal
  Desktop/q2dm1_textures/textures/e1u1/floor01.wal
  Desktop/q2dm1_textures/extraction_report.txt

The report lists what was found, where it was copied from, and anything missing.
Files in the original game directory and archives are never modified.
Repeated extractions go into *_textures_2, *_textures_3, etc., to avoid
accidentally overwriting your previous exports.

WHERE IT LOOKS
  - Loose files under textures/
  - Quake II .pak files (including pak0.pak)
  - ZIP-format .pk3 and .pkz archives
  - If the selected folder is a Quake II install root containing baseq2,
    the selected/inferred mod directory is searched before baseq2.
  - Loose files take precedence over packed files in each game directory.

Supported texture extensions: .wal, .png, .tga, .jpg, .jpeg, .dds
Replacement image support may be toggled off (WAL only).

This program reads the Quake II version-38 BSP TEXINFO list (not Quake 1
BSPs or remastered formats with different version numbers). It copies map
texture files only; skyboxes, sounds, models, and other assets are not
included. It does not need Quake II to be running.

OPTIONAL COMMAND-LINE USAGE
  py -3 Quake2_Texture_Extractor.pyw --bsp "C:\Quake2\baseq2\maps\q2dm1.bsp" --game "C:\Quake2" --out "C:\Users\YOURNAME\Desktop"
  Include --mod "C:\Quake2\violator" to search a mod first.
  Add --wal-only to copy only classic .wal textures.

BUILD A WINDOWS EXE (OPTIONAL)
  Run build_windows_exe.bat on Windows after installing PyInstaller.
  The batch file creates dist\Quake2_Texture_Extractor.exe.
