Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HUD scaling via triangle API #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Toodles2You
Copy link
Contributor

Real HUD scaling!

This is achieved by having HUD elements use a reference resolution, instead of the actual window resolution. Some of the engine rendering macros have been replaced with functions that call the triangle API. These new drawing functions internally scale the HUD to fit the window.

The reference resolution is 640x480 and, as such, the 640 sprite set is used.

This feature can be toggled off via the hud_scale cvar. Though, it does require a video restart. It will also be disabled for software rendering.

The nice part is that this requires no code changes in the actual HUD elements themselves.

@Toodles2You Toodles2You marked this pull request as draft October 7, 2024 16:10
@Toodles2You
Copy link
Contributor Author

I realized that I still need to re-implement the auto-aim crosshair.

@Toodles2You Toodles2You marked this pull request as ready for review October 7, 2024 18:15
@Toodles2You Toodles2You marked this pull request as draft October 7, 2024 18:48
@Toodles2You
Copy link
Contributor Author

I fixed the VGUI menus getting affected. I forgot they used the same macros. I ended up making changes to the HUD elements but, only to replace the old macros with new "get" functions.

@Toodles2You Toodles2You marked this pull request as ready for review October 8, 2024 01:30
@sabianroberts
Copy link

I've just tested this and when hud_scale is set to 0 after a video restart the HUD number sprites because scruffed up in >= 2560 resolutions. I haven't tested it in any lower resolutions yet but when I do I'll edit this comment and provide screenshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants