VmfWriter class is responsible for writing formatted VMF (Valve Map Format) files during the decompilation process. It handles proper indentation, section nesting, and value formatting.
Source: VmfWriter.java:34
Overview
VmfWriter provides a structured API for writing VMF files with correct formatting. It manages nested sections, handles different data types, and ensures proper precision for coordinate values.Constructor
Creates a new VMF writer instance.
Methods
Section Management
Start a new VMF section.Opens a new named section with proper indentation and braces.
End the current VMF section.Closes the current section. The name must match the currently open section.
Value Writing
Write a key-value pair.Writes a property with proper quoting and formatting. Supports various data types including primitives, vectors, and arrays.
Usage Example
Precision Scaling
The scale parameters control decimal precision for different value types:- doubleScale: Used for world coordinates and vertex positions
- doubleScaleTextureAxes: Used for texture axis vectors
- doubleScaleTextureScale: Used for texture scale values
Related
- BspDecompiler - Main decompiler that uses VmfWriter
- BrushSource - Writes brushes using VmfWriter
- EntitySource - Writes entities using VmfWriter