This project has only been tested with files from Counter Strike: Global Offensive.
BSPMap.vpkLoc = @"C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo"; BSPMap map = new BSPMap(@"C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\maps\ar_shoots.bsp"); map.ParseFile(); map.MakeGameObject();
BSPMap.combineMeshesWithSameTextures = true; BSPMap.excludeMapFaces = true; BSPMap.excludeModels = true; SourceTexture.averageTextures = true; SourceTexture.maxTextureSize = 256;
map.Unload();
Make sure to call this function when you are done with a map to release its memory.