Advertisement Jump to content
Sign in to follow this  

Quake/Doom BSP Loader (C# and Managed DirectX)

This topic is 4899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Good evening everyone from sunny South Africa, The News I have searched most of the weekend for a C#/MDX Quake/Doom BSP Loader. I decided to do the nail biting and teeth grinding recode of a c++ implementation. It's not complete as yet and still needs alot of work. This is in Beta phase and I will continue the work on it and release versions of it. Thanks Thanks goes to Jonathan "Korpse" Jacobs for helping me along the way :) The Loader C# Managed DirectX BSP Loader (Beta) - Source To be Done - Implement lightmaps - Implement a decent texture loader - Implement a culling system to speed up framerates. Usage
//loading the BSP file
BSPLoader bspLoader;
bspLoader.FromFile(device, "bspFile.bsp");
//Rendering the map (BSP)

Update: (As per Grozzler's request/comments) - Updated naming of the structures and class. - Fixed check order for cleaning up of objects. I hope this helps some of you. Take care. [Edited by - Armadon on August 21, 2005 10:43:25 PM]

Share this post

Link to post
Share on other sites
Nicely done, though I don't agree with your use of all uppercase names like BSP_TEXTURE. To also follow conventions, I strongly recommend BspLoader instead of BSPLoader. Those are just my views on conventions though.

The only problem I could see when I looked it over was:
if(!vertexBuffer.Disposed || vertexBuffer != null)
if(!indexBuffer.Disposed || indexBuffer != null)

You have your checks backwards. ;)

This also seems silly:
using Microsoft.DirectX;
using DX = Microsoft.DirectX;

One or the other, no?

Good work!

Share this post

Link to post
Share on other sites
Perfectly valid, thanks for the reply guys.

Grozzler, I totally agree. I am in the process of fixing those weird naming conventions :) Will have the changes up by tommorow :).

Share this post

Link to post
Share on other sites
This looks good. The overall structure and commenting is excellent. very nicly done.

I've made a slight modification to the texture loading btw:

filename = filename.Substring(0, filename.IndexOf("\0"));
FileInfo[] files = new DirectoryInfo(Directory.GetCurrentDirectory()).GetFiles(filename + "*");

if (files.Length > 0)
textureMaps = TextureLoader.FromFile(device, files[0].FullName);
textureMaps = null;

I've only tested it with the map DarkMeat though, so there may be some cases where it doesn't work? Not sure. Direct3D's texture loader is *really* good so I'd use that above anything else unless you absolutly have to.

Ohh I'll also say I'm impressed you didn't use any unsafe code. Good job.

*Also Wondering, by doom bsp maps do you mean doom3?*

[Edited by - RipTorn on August 22, 2005 1:07:54 PM]

Share this post

Link to post
Share on other sites
Original post by Armadon
- Implement lightmaps

mwahahahaha who needs light maps when you have....

per-pixel with stencil shadows!!

[wink] [wink] [wink] [wink] [wink] [wink]

I have far too much time on my hands.

However I've still got a lot of work to do before I get it looking as good as my old engine (same map). And running as fast too.... stencil shadows are a pain to optimise.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!