Digital Paint Discussion Board

Paintball 2: The Game => Paintball 2 Discussion => Topic started by: sk89q on December 07, 2007, 01:34:47 PM

Title: Parsing BSP for list of textures
Post by: sk89q on December 07, 2007, 01:34:47 PM
Are there specs for Q2 BSPs that I can read? I can find Q1 specs... maybe they're the same.

I read the Q1 specs and parsed this out of the BSP header:

(long = little endian)

string(4) magic = IBSP
long bspver = 38
long entities_offset
long entities_length
long planes_offset
long planes_length
...etc...
Using this list:
Code: [Select]
var $fields = array('entities', 'planes', 'miptex', 'vertices',
                'visilist', 'nodes', 'texinfo', 'faces', 'lightmaps',
                'clipnodes', 'leaves', 'lface', 'edges', 'ledges',
                'models');

Now, (a) is this still valid for Q2, and (b) how do I parse out the textures (it's in miptext, correct?)?

(Actually, in the mean time, I pull out miptex and use regular expressions to find strings of minimum 5 characters and with a / in them. Not very clean or accurate.)
Title: Re: Parsing BSP for list of textures
Post by: y00tz on December 08, 2007, 01:23:40 AM
forewarning: this is not a solution to your problem

But, surely Jitspoe can help you since he was able to parse maps before to calculate texture usage: http://dplogin.com/forums/index.php?topic=5386.0
Title: Re: Parsing BSP for list of textures
Post by: jitspoe on December 14, 2007, 03:18:49 PM
I just did a simple find in files for "pball/", but that's not a real solution.
Title: Re: Parsing BSP for list of textures
Post by: sk89q on December 14, 2007, 03:52:56 PM
Mine is *slightly* better. :P