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

Support CstDoom3 GUIs for aspect-ratio-independent HUD #641

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DanielGibson
Copy link
Member

@DanielGibson DanielGibson commented Jan 18, 2025

As requested in #324.
You won't see any difference unless you use CstDoom3's GUI files. But note that you can't just use their .pk4 files, because they contain other things incompatible with dhewm3 (I didn't port any gameplay changes from CstDoom3).

For the basegame I prepared this .pk4 (rename the .zip to .pk4 after download, Github doesn't support attaching .pk4 files): z_cstd3_guis.zip
It's for the base game, so put it into Doom3/base/, next to pak000.pk4 etc.

Also note that old savegames will stop working once you add z_cstd3_guis.pk4.

I'd appreciate if someone else could create cleaner .pk4s with .gui files for both the base game and d3xp and upload them somewhere, so I can link them on the dhewm3 page once this is merged.
I'm not gonna ship them with dhewm3, for license reasons and because so far dhewm3 could avoid shipping any own gamedata and I'd like to keep it like that, if possible.

those GUIs are aspectratio-independent

doesn't properly work yet, esp. together with my hack that makes sure
menus are rendered in 4:3
In idWindow::Redraw(), I had to make sure the menu scale fix (which,
if enabled for a window, renders that in 4:3 with empty or black bars
on the side if needed for widescreen etc, instead of stretching it)
is disabled if a window uses CST anchors, because the CST anchor code
also adjusts for the display aspect ratio and if we do both, things get
distorted in the other way.

The biggest change is that idDeviceContext::DrawStretchPic(Rotated) now
has code to adjust the coordinates for both CST and the menu scale fix,
so idDeviceContext::AdjustCoords() is mostly obsolete - it's only still
used by idRenderWindow.
Unlike DstDoom3 now that extra adjustCoords argument to those Draw
functions indicates that any coordinate adjustment should be done, so
if it's set by a caller, it's set to true.

I removed idDeviceContext::AdjustCursorCoords() because it was only used
in one place anyway
incl. backwards compat for older savegames.
only partly useful: old savegames only work if you didn't change the
gamedata, with the CstDoom3 .gui files, loading them crashes. I don't
think that can be avoided, apparently Doom3 has no way to detect that
the GUIs have changed?
@DanielGibson
Copy link
Member Author

Testbuilds for Windows under Artifacts: https://github.com/dhewm/dhewm3/actions/runs/12840240228

@DanielGibson
Copy link
Member Author

Note that neither CstDoom3 nor dhewm3 with those changes has widescreen menus or a widescreen PDA. But the HUD is widescreen now.
And at least in dhewm3 the menus and PDA have the correct aspect ratio, while in CstDoom3 they are stretched in widescreen resolutions.

It might be possible to create a widescreen-compatible main menu and/or PDA with thist CstDoom3 anchor stuff. They didn't do that though, and I have no time/motivation to try it myself.
Would love to see the results if someone else tries it, though!

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

Successfully merging this pull request may close these issues.

1 participant