I was looking through a bunch of old code and came across some utilities in C# that handle loading the Quake MAP file format.   There are several classes in this bunch:

  • The basic MAP file parser that take the text based MAP file and loads it into memory.
  • A “compiler” that converts the MAP file into primitives that can be rendered
  • A token parser used to parse the MAP file itself.

The second step is necessary because the results of the first step is basically a list of planes that when clipped against each other create the actual geometry of the world.  The second step is responsible for doing this clipping as well as a few other things.  From this point it wouldn't take much to throw the resulting triangles into a VertexBuffer and use it for rendering.

If there is interest in this code I can spend a little time cleaning it up then posting it.  Let me know!