OK, I've caved in and decided to add user-replacable crosshairs to DirectQ. This will actually be quite easy to do, and will most likely follow the way QRack does it, which is a subdirectory called "crosshairs" under your game directory with images called crosshair1, crosshair2, etc in it. The usual LINK, TGA, DDS, PNG, BMP, JPG and PCX formats will be supported, although for formats that don't have an alpha channel things will look a mite weird.
These will directly replace the built-in crosshair images in DirectQ, so if you want to use the classic Quake crosshair you shouldn't have any replacements stored in your game dir. I could make it work a little more flexible, but things would get messy and I don't like messy.
Speaking of messy, I've decided to remove padding from MDL skins. The solution I had for external textures was fine up to a point, but would break down if a MDL had more than one skin in use, only one (or any number less than all of them, in fact) of which was replaced by an external texture. This means that most MDL skins that are not replaced will need to go through a resampling filter, but fortunately D3D has a few higher quality filters available so that the damage can be minimized.
Ultimately we're in tradeoff country again with this one, and on balance a slight loss of visual quality (which most people won't even notice) seems preferable to a byzantine and fragile code-path. That's just the way some things go.
UPDATE
Crosshairs are done. Very easy as predicted, and for bonus marks I was able to generalise the drawing function for the "+" crosshairs, DirectQ's built-in additional crosshairs, and user-replacement crosshairs.
I've found another bug which occurs when the viewmodel pokes into an entity: the entity which is being poked-into vanishes. I had thought that this was an occlusion queries thing, but now think it's an unwanted side-effect of my "prevent the viewmodel poking into walls" code. Not certain what the best option to fix this might be; clearing the depth buffer before drawing the viewmodel would work for sure, but I'm terrified of the potential overhead of doing this...
UPDATE 2
I'm now 99% certain that it happens if the view is inside the entity's bounding box, and actually is an occlusion queries thing.
UPDATE 3
Confirmed and fixed.
Sunday, May 23, 2010
Crosshairs, crosshairs, crosshairs, and more skins
Posted by
mhquake
at
10:58 PM
Subscribe to:
Post Comments (Atom)
1 comments:
Great !
The new Release is going to be near Perfection...i can smell it. (gg)
Post a Comment