BspDecompiler class is the main orchestrator for the BSP decompilation process. It initializes and coordinates all sub-modules (entity, brush, texture, etc.) and controls the overall decompilation workflow.
Source: BspDecompiler.java:35
Overview
BspDecompiler is the central component that ties together all decompilation modules. It manages the decompilation process from start to finish, handling world geometry, entities, textures, and metadata.Constructor
Creates a new decompiler instance.The constructor initializes all sub-modules including:
- TextureSource - Texture handling
- BspProtection - Protection detection
- VmfMeta - VMF metadata writing
- BrushSource - Brush geometry decompilation
- FaceSource - Face-based geometry decompilation
- EntitySource - Entity decompilation
Methods
Start the decompilation process.Executes the complete decompilation workflow:
- Configure texture fixing options
- Check for map protection (if enabled)
- Load brush-face mappings (for BRUSHPLANES mode)
- Write VMF header and worldspawn
- Write world brushes and displacements
- Write entities
- Write visgroups
- Finalize VMF structure
Set NMO data for No More Room in Hell maps.Provides additional objective data for NMRIH game mode maps.
Decompilation Workflow
The decompilation process follows this sequence:Data Loading
Load required data structures based on brush mode (BRUSHPLANES requires additional mapping data).
Entities
Write all entities including brush entities, point entities, static props, overlays, and cubemaps.
Sub-Modules
BspDecompiler coordinates these specialized modules:TextureSource
Handles texture name fixing and material processing.BspProtection
Detects and handles various map protection techniques.VmfMeta
Manages VMF metadata, comments, and version information.BrushSource
Decompiles brush geometry using brush and plane lumps.FaceSource
Decompiles geometry using face lumps (alternative to BrushSource).EntitySource
Decompiles all entity types including point and brush entities.Usage Example
Configuration Impact
The BspSourceConfig settings control what BspDecompiler writes:- brushMode - Determines which module (BrushSource vs FaceSource) handles geometry
- writeWorldBrushes - Enable/disable world geometry decompilation
- writePointEntities/writeBrushEntities - Control entity writing
- fixCubemapTextures/fixToolTextures - Configure texture fixing
- skipProt - Skip protection checking for faster processing
Related
- BspSource - High-level decompiler entry point
- BspSourceConfig - Configuration options
- VmfWriter - VMF file writer
- BrushSource - Brush geometry module
- EntitySource - Entity decompilation module