Overriding AltHud.Draw() does nothing

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

Overriding AltHud.Draw() does nothing

Postby Blue Shadow » Fri Oct 29, 2021 4:18 am

Tested with: GZDoom 4.7.1 (64-bit)
Test material: https://www.dropbox.com/s/zbl41ctzd86qt ... o.pk3?dl=1



The attached demo above has the following, which is a custom alternative HUD class:

Code: Select allExpand view
class TestHUD : AltHud
{
    override void Draw (PlayerInfo CPlayer, int w, int h)
    {
    }

    override void DrawHealth (PlayerInfo CPlayer, int x, int y)
    {
        DrawImageToBox(gameinfo.berserkpic, x, y, 31, 17);
        DrawHudNumber(HudFont, Font.CR_SAPPHIRE, CPlayer.health, x + 33, y + 17);
    }
}

Running that code should draw nothing to the screen, yet it does. This is not a matter of incorrectly overriding the HUD, since that DrawHealth override works as expected. And yes, I do have hud_althud_forceinternal set to false.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest