Home

Awesome

valve-bsp-parser

Valve BSP-file parser, written in modern C++. This parser does only parse the basic .bsp tree and doesn't include a .vpk/.mdl parser/reader. Feel free to contribute 😊

Requirements

Installation

I'm using /MT in release and /MTd in debug as runtime library. So either adjust your project settings to mine or vice versa!

Usage

All you need to parse a .bsp file is the path of the game- and map-directory. There's a short example code for Counter-Strike: Global Offensive

// in your update routine

_parsed_map = _bsp_parser->load_map(
  _engine->get_game_directory(),
  _client_state->get_map_directory()
);

// your sdk helper or wrapper function ... w/e
bool sdk_helper::is_visible(
  const rn::vector3& origin,
  const rn::vector3& destination
) const
{
    return _parsed_map
        ? _bsp_parser->is_visible( origin, destination )
        : false;
}