KeenSoftwareHouse/Miner-Wars-2081 — pull request #3 by nopoe (2013-10-27 18:13:42+00:00)
Title: Fix for cockpit rendering issue on some hardware

The cockpit was being rendered behind the scene on my hardware as pictured:

![2013-10-26_00007](https://f.cloud.github.com/assets/1936763/1415999/70df4a22-3f2e-11e3-8802-cf7c3bc4233b.jpg)

I don't fully understand the codebase but I did what made sense to me, and it seemed to work.

Currently my code uses a stencil buffer value of 1 to indicate the cockpit is being rendered on the screen in that location.

I enabled the stencil buffer on the Default DepthStencilState, which seems to be used for regular scenery, but set the write mask to 0 to prevent writing. I set the stencil function to equal and the reference stencil value to 0, indicating (I think) that the pixel should only be written if the stencil value is equal to 0. This prevents anything else in the scene from being drawn where the cockpit and guns are, but may have unintended consequences, especially if the stencil buffer is used elsewhere.

I have tested this code on my machine which uses a 3rd gen i5 and a Radeon HD 7970 and my brother's machine which uses a 1st gen i7 and a GTX 260. It works on both machines, whereas the original miner wars code only worked on my brother's machine.