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

add darkcolormap to shade the screen during drawing #1610

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

Conversation

rfomin
Copy link
Collaborator

@rfomin rfomin commented Mar 21, 2024

Fix #1609

This is unfinished. I think we should duplicate r_draw functions for this, or introduce some other system for changing drawing parameters.

@rfomin rfomin marked this pull request as draft March 21, 2024 03:30
@fabiangreffrath
Copy link
Owner

Thanks, but I think you are over-engineering this. If you want to fix #1609 and help spot HOMs, then we could either (1) draw them in a brighter color, or (2) ask users to use the menu without backdrop or (3) use pause instead of the menu to interrupt the game.

@fabiangreffrath
Copy link
Owner

Also, does it hep if we let HOMs blink based on leveltime instead of gametic?

@rfomin
Copy link
Collaborator Author

rfomin commented Mar 21, 2024

If you want to fix #1609 and help spot HOMs, then we could either (1) draw them in a brighter color, or (2) ask users to use the menu without backdrop or (3) use pause instead of the menu to interrupt the game.

It's not about the HOM cheat or the menu background, it's about the automap overlay. There are some PWADs that use HOM as a visual effect, wow.wad is one of them.

HOM pixels are not "refreshed" every frame, so if we use the current V_ShadeScreen they will go black very quickly.

@fabiangreffrath
Copy link
Owner

Ah, now I see.

But, instead of duplicating drawing functions or introducing more branching into drawing functions I'd recommend to introduce a function pointer for pixel drawing and use this in the drawing functions.

static byte draw_pixel_regular (byte src) {return colormap[brightmap[src]][src];};
static byte draw_pixel_shaded  (byte src) {return darkcolormap[colormap[brightmap[src]][src]];};
static byte (*draw_pixel) (byte src) = draw_pixel_regular;

void R_ShadeScreen(boolean on)
{
    if (on)
    {
        draw_pixel = draw_pixel_shaded;
    }
    else
    {
        draw_pixel = draw_pixel_regular;
    }
}

However, this doesn't solve the problem of shading the HUD elements and status bar. Is this really worth the effort?

@rfomin
Copy link
Collaborator Author

rfomin commented Mar 21, 2024

However, this doesn't solve the problem of shading the HUD elements and status bar. Is this really worth the effort?

It's not hard to add a "shade" option to a patch drawing, but yeah, I'm not sure it's worth it.

If we already had a system for drawing parameters, we can add another option to it. Maybe we should have such a system, for example we could remove brightmaps[] if the user has disabled it.

@fabiangreffrath
Copy link
Owner

If we already had a system for drawing parameters, we can add another option to it. Maybe we should have such a system, for example we could remove brightmaps[] if the user has disabled it.

If we had such a system, we'd be one step closer to truecolor rendering. 🤔

@ceski-1
Copy link
Collaborator

ceski-1 commented Mar 21, 2024

Just a note that this method has a nice performance boost over the old one, so it may be worth pursuing for that reason alone. For example, compare the master branch and this one at native resolution with dark overlay automap.

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.

No HOMs with dark overlay
3 participants