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

Heretic/Hexen: Correction of Transparent HUD Elements in Heretic Truecolor #1272

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

Conversation

Noseey
Copy link

@Noseey Noseey commented Feb 11, 2025

Related Issue:
Closes #1269

Changes Summary
Fixing the Transparent HUD Elements in Heretic Truecolor by introducing different blendovertinttab-functions for Heretic and Hexen in truecolor.

@@ -87,14 +87,26 @@ const uint32_t I_BlendOverTranmap (const uint32_t bg, const uint32_t fg)
return I_BlendOver(bg, fg, 0xA8); // 168 (66% opacity)
}

// [crispy] TINTTAB blending emulation, used for Heretic and Hexen
const uint32_t I_BlendOverTinttab (const uint32_t bg, const uint32_t fg)
// [crispy] TINTTAB blending emulation, used for Heretic
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea was to rename the previous I_BlendOverTinttab() to e.g. I_BlendOverTinttab38() and I_BlendOverAltTinttab() to I_BlendOverTinttab56(),. Then we could introduce function pointers with the former names of the functions and let them point to either I_BlendOverTinttab38() or I_BlendOverTinttab56() depending on game mission. The way it is now introduces an extra layer of indirection.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could rename blendfunc_tinttab and blendfunc_alt_tinttab to I_BlendOverTinttab and I_BlendOverAltTinttab respectively, I think that makes sense.

As for those four functions, it seems you want to keep game-specifics out of the name. But I'm hesitant to add fixed opacity-values to the name itself. How about something like I_BlendStrongOverTinttab and I_BlendWeakOverTinttab?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, fine with me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed the symbols now, hope that gets it closer to the above mentioned idea.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still have two pairs of two identical functions (I_BlendStrongOverTinttab() == I_BlendStrongOverAltTinttab() and I_BlendWeakOverTinttab() == I_BlendWeakOverAltTinttab()) and I want to get rid of this. The game should only call I_BlendOverTinttab() or I_BlendOverAltTinttab() and nothing else, just as before. The initialization code should determine which of the actual blending functions these point to.

#ifndef CRISPY_TRUECOLOR
V_LoadTintTable();
#endif
V_LoadTintTable(mission);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or simply V_LoadTintTable(heretic) (or V_LoadTintTable((GameMission_t)heretic) if you want to be explicit).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it using the cast.

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.

Heretic: Opacity of Transparent HUD Elements not correct in TrueColor
2 participants