winquake - hud / text scaling?

Discuss anything not covered by any of the other categories.
Post Reply
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

winquake - hud / text scaling?

Post by qbism »

Has anyone bothered to code scalable hud or text in winquake? In simplest form, a 2X scale factor to text/ HUD/ icons toggled by cvar or video mode. Conceptually simple but impacts many areas in the code.

Another idea would be to render to a separate hud/console layer. It would be an overlaid alpha-masked bitmap upscaled to screen resolution.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: winquake - hud / text scaling?

Post by leileilol »

Makaqu and Engoo has it. Similarly Hammer of Thyrion has it (Engoo uses Siggi's patch he submitted for that)

Engoo implements it slightly differently, with a scr_scale cvar, which can also accept decimal values and can scale the whole thing to a virtual 320x200.


The hard part is keeping the refdef consistent with your scale :(

There's also a potential performance problem when you're dealing with scaled transparent pics because it redraws it scaled when the view is refreshed before it. Bad for Quakeworld huds and menus.


I don't know how Makaqu does it, never looked into its source.
i should not be here
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: winquake - hud / text scaling?

Post by qbism »

Thanks, now I recall the HoT thread with that discussion (well, thanks to search). I tried the scaling out in Engoo and didn't notice any slowdown with the menus. And it's terrible that I have not run Makaqu 1.6 until now, was only up to 1.5 :oops:
MQ 1.6 scales the console text also.
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: winquake - hud / text scaling?

Post by mankrip »

All calculations and function calls for Makaqu's 2D drawing functions have been changed to use a fixed 320*200 resolution. Internally, the drawing functions scales that by an integer factor and aligns the 2D elements on the screen to the extra screen space that may be there.
This works great across different screen aspects, including really weird ones (try setting vid_mode 2 with vid_config_x 480 and vid_config_y 800 in square pixel aspect mode to simulate a vertically-oriented handheld device, for example).

I haven't implemented stretched scaling because it looks plain ugly to me. But in high resolutions it may be acceptable, so I'm thinking about implementing it.

Large portions of Makaqu's 2D drawing code aren't cleaned up and optimized yet, and the crosshair code is really messy. But they doesn't seem to affect performance.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: winquake - hud / text scaling?

Post by qbism »

I'm adding the functions from Makaqu, but scaling by float for better accuracy handling funky resolutions like 1680x1050, 1366x768, 1600x900. 900/200 = 4 int or 4.5 float. I don't know if I will scale console text. Or maybe by lesser factor. It's legible at HD res, (and still larger size than forum links :D ) but that's looking at laptop LCD rather than HDTV or CRT monitor.
Post Reply