![]() |
SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
|
#include <BSP.h>

Public Member Functions | |
| BSP (std::string path_, bool loadPatchFiles=true) | |
| operator bool () const | |
| uint32_t | getVersion () const |
| void | setVersion (uint32_t version) |
| uint32_t | getMapRevision () const |
| void | setMapRevision (uint32_t mapRevision) |
| bool | isL4D2 () const |
| void | setL4D2 (bool isL4D2) |
| bool | isConsole () const |
| void | setConsole (bool isConsole) |
| bool | hasLump (BSPLump lumpIndex) const |
| bool | isLumpCompressed (BSPLump lumpIndex) const |
| uint32_t | getLumpVersion (BSPLump lumpIndex) const |
| std::optional< std::vector< std::byte > > | getLumpData (BSPLump lumpIndex, bool noDecompression=false) const |
| template<BSPLump Lump> | |
| auto | getLumpData () const |
| bool | setLump (BSPLump lumpIndex, uint32_t version, std::span< const std::byte > data, uint8_t compressLevel=0) |
| BSP::setGameLump should be used for writing game lumps as they need special handling. | |
| bool | setLump (uint32_t version, std::span< const BSPEntityKeyValues > data, uint8_t compressLevel=0) |
| bool | isGameLumpCompressed (BSPGameLump::Signature signature) const |
| uint16_t | getGameLumpVersion (BSPGameLump::Signature signature) const |
| std::optional< std::vector< std::byte > > | getGameLumpData (BSPGameLump::Signature signature) const |
| bool | setGameLump (BSPGameLump::Signature signature, uint16_t version, std::span< const std::byte > data, uint8_t compressLevel=0) |
| void | resetLump (BSPLump lumpIndex) |
| Reset changes made to a lump before they're written to disk. | |
| void | reset () |
| Resets ALL in-memory modifications (version, all lumps including game lumps, map revision). | |
| void | createLumpPatchFile (BSPLump lumpIndex) const |
| bool | setLumpFromPatchFile (const std::string &lumpFilePath) |
| bool | bake (std::string_view outputPath="") |
Static Public Member Functions | |
| static BSP | create (std::string path, uint32_t version=21, uint32_t mapRevision=0) |
Protected Member Functions | |
| bool | readHeader () |
| std::vector< BSPEntityKeyValues > | parseEntities () const |
| std::vector< BSPPlane > | parsePlanes () const |
| std::vector< BSPTextureData > | parseTextureData () const |
| std::vector< BSPVertex > | parseVertices () const |
| std::vector< BSPNode > | parseNodes () const |
| std::vector< BSPTextureInfo > | parseTextureInfo () const |
| std::vector< BSPFace > | parseFaces () const |
| std::vector< BSPEdge > | parseEdges () const |
| std::vector< BSPSurfEdge > | parseSurfEdges () const |
| std::vector< BSPBrushModel > | parseBrushModels () const |
| std::vector< BSPFace > | parseOriginalFaces () const |
| std::vector< BSPGameLump > | parseGameLumps (bool decompress) const |
Protected Attributes | |
| std::string | path |
| Header | header {} |
| uint32_t | stagedVersion {} |
| std::unordered_map< uint32_t, std::pair< Lump, std::vector< std::byte > > > | stagedLumps |
| std::vector< BSPGameLump > | stagedGameLumps |
| uint32_t | stagedMapRevision {} |
| bool | l4d2 = false |
| bool | console = false |
|
explicit |
|
static |
|
nodiscard |
|
nodiscard |
|
inlinenodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscardprotected |
|
nodiscardprotected |
|
nodiscardprotected |
|
nodiscardprotected |
|
nodiscardprotected |
|
nodiscardprotected |
|
nodiscardprotected |
|
nodiscardprotected |
|
nodiscardprotected |
|
nodiscardprotected |
|
nodiscardprotected |
|
nodiscardprotected |
| void BSP::reset | ( | ) |
| void BSP::resetLump | ( | BSPLump | lumpIndex | ) |
| bool BSP::setGameLump | ( | BSPGameLump::Signature | signature, |
| uint16_t | version, | ||
| std::span< const std::byte > | data, | ||
| uint8_t | compressLevel = 0 ) |
| bool BSP::setLump | ( | BSPLump | lumpIndex, |
| uint32_t | version, | ||
| std::span< const std::byte > | data, | ||
| uint8_t | compressLevel = 0 ) |
BSP::setGameLump should be used for writing game lumps as they need special handling.
Paklump can be written here but compression is unsupported, prefer using bsppp::PakLump or your favorite zip library instead. Valid compressLevel range is 0 to 9, 0 is considered off, 9 the slowest and most compressiest
| bool BSP::setLump | ( | uint32_t | version, |
| std::span< const BSPEntityKeyValues > | data, | ||
| uint8_t | compressLevel = 0 ) |
| bool BSP::setLumpFromPatchFile | ( | const std::string & | lumpFilePath | ) |
|
protected |
|
protected |