OpenJKDF2
OpenJKDF2 copied to clipboard
[Feature Request] Custom UI scaling
The UI is too tiny and hard to see at a glance. Some scaling options would be nice.
+1 for this request. Even a simple integer scaling option for the HUD would be a very useful enhancement.
Looks like this was implemented not long ago-- there's now a 'HUD Scale' option in the settings. Thank you for adding that
Unfortunately, the current "HUD Scale" scaling algorithm seems to have issues even at ×1.00. The following issues occur at all scales that I tested (integers from 1 to 8):
- Pixels are irregularly scaled (this is particularly bad at ×1.00, where some pixels will be rendered as 2×1 rectangles!)
- Certain elements, such as ammo counter and text characters (force/inv. selection prompts) render horizontal/vertical artifacts at their boundaries (more prominent at particular scales, e.g. ×6.00).
I might suggest implementing something similar to DOSBOX Staging's "sharp" filter? Themaister also has an interesting algorithm, though I can't exactly tell you how it compares to the prior-mentioned implementation.
Also, it would be neat to have an "integer scale" option for the fixed 640×480 interfaces.
Edit: OK, I've done some experimentation. OpenJKDF2 seems to render the HUD correctly only at vertical resolutions of 960 pixels or less. You can test this with ×1.00 scale.
Any vertical resolution higher than 960 requires the following formula to calculate the corrected scale value: 960 / <vertical resolution>. E.g. for 1080p the corrected scale value for ×1.00 would be ~×0.89. Though, the individual HUD elements will still not render correctly above 960 pixel height, causing the aforementioned artifacts.
Edit: OK, I've done some experimentation. OpenJKDF2 seems to render the HUD correctly only at vertical resolutions of 960 pixels or less. You can test this with ×1.00 scale.
Any vertical resolution higher than 960 requires the following formula to calculate the corrected scale value:
960 / <vertical resolution>. E.g. for 1080p the corrected scale value for ×1.00 would be ~×0.89. Though, the individual HUD elements will still not render correctly above 960 pixel height, causing the aforementioned artifacts.
This is happening due to this block of code that appears a couple times in jkMain.c
I don't really get why it is doing these calculations but effectively the result is that the 2D display size is capped at 480x2 (960) height and any width depending on the window's aspect ratio. Since this will be scaled up unevenly to pretty much any modern monitor resolution it will always look like shit. Getting rid of that block makes the scaling correct at any resolution but I'm guessing might have some performance ramifications.