Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crosshair placement/alignment changes
This has to do with issue #53. As near as I can tell, the original reQuiem code was working on a couple of assertions/assumptions. 1) The player's shots are a little off-center. 2) Crosshair images have equal height and width. #1 is true of course, hence why people fiddle with cl_crossx and maybe cl_crossy. It looks like JDH or maybe Joe of JoeQuake was trying to correct for this by shifting the crosshair right and down by a half pixel. Unfortunately shifting crosshair graphics by a half pixel makes them often look like garbage. (The half-pixel shift was only for the built-in 8x8 crosshair graphics. For user-specified crosshair images, which could be of any dimensions, I don't at all understand what the original code was trying to do. It gives the same result as the built-ins if the user-specified image is 8x8, but if it is larger then it is more and more off-center.) #2 isn't necessarily true, but it is true for the built-in crosshairs, and should be usually true for user-specified images. This is probably why the code was treating the distances "from top to center" and "from left to center" as one constant value, and then the distances "from right to center" and "from bottom to center" as a different constant value. And also why for user- specified crosshair images it was only looking at the image width as the basis for calculating both vertical and horizontal positions. ========== These changes shake things around in a few ways: - Crosshair images are not assumed to have equal height and width. - Crosshairs are placed dead-center on screen (as with original Quake). If the user is not happy with that then they can adjust cl_crossx/cl_crossy like grandpa used to do. - User-specified crosshair images will be centered, regardless of their size. I'm also clamping the crosshair graphic so that it doesn't "wraparound bleed", which might otherwise happen for certain image dimensions and certain cl_crossx/cl_crossy values. ========== I'm not sure my interpretation of the original code's behavior is correct, or that this fix is the right fix. It also might be preferable to (for example) go ahead and put in a bias of 1 pixel for the crosshair X position. Or default cl_crossx to 1, or something like that. I'm just committing this now in case Spirit or any other interested party wants to try it and give feedback.
- Loading branch information