Overlay flip/mirroring flags do not work on non-Weapon

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!
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Overlay flip/mirroring flags do not work on non-Weapon

Post by Nash »

Run example file, "give test". The fist sprite is not mirrored as expected.

This problem doesn't happen if the overlay is ran from a Weapon.

Problem also persists if the overlay is ran from PlayerPawn. But example file only demonstrates problem from CustomInventory context.

Wiki page suggests overlays can be ran from PlayerPawns and CustomInventory. https://zdoom.org/wiki/A_Overlay

Code: Select all

class Test : CustomInventory
{
    Default
    {
        Inventory.MaxAmount 1;
        +INVENTORY.UNDROPPABLE
        +INVENTORY.UNTOSSABLE
        +INVENTORY.AUTOACTIVATE
    }

    action void DoStuff(void)
    {
        Console.Printf("blah");
    }

    States
    {
    Use:
        TNT1 A 0
        {
            A_Overlay(666, "DoStuff");
            A_OverlayFlags(666, PSPF_FLIP | PSPF_MIRROR, true); // doesn't work
        }
        Fail;
    Pickup:
        TNT1 A 0
        {
            return true;
        }
        Stop;
    DoStuff:
        PUNG A 1 DoStuff();
        Loop;
    }
}
 
UPDATE:

Seems like almost nothing works. Alpha, renderstyle, nothing.

Code: Select all

            A_Overlay(666, "DoStuff");
            A_OverlayFlags(666, PSPF_FLIP | PSPF_MIRROR | PSPF_ALPHA | PSPF_RENDERSTYLE, true);

            // none of these work
            A_OverlayRenderStyle(666, STYLE_Translucent);
            A_OverlayAlpha(666, 0.5);

            // this works though
            A_OverlayOffset(666, -50);
Attachments
test.pk3
(462 Bytes) Downloaded 96 times
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Overlay flip/mirroring flags do not work on non-Weapon

Post by Major Cooke »

Does this work on other renderers too? I.e. anything beside OpenGL? That's the only one in the code where I could find that has it specifically set to weapons.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Overlay flip/mirroring flags do not work on non-Weapon

Post by Nash »

Nope, the different renderers make no difference. Sprite is still unflipped despite being told to flip.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Overlay flip/mirroring flags do not work on non-Weapon

Post by Major Cooke »

Alright, thanks to phantom we discovered it's simply not possible to set the overlay flags from an overlay that's not from the same source. It might be due to the ACTION_CALL_FROM_PSPRITE() function. Perhaps this could be changed to include all overlays instead?

Code: Select all

DEFINE_ACTION_FUNCTION(AActor, A_OverlayRenderStyle)
{
    PARAM_ACTION_PROLOGUE(AActor);
    PARAM_INT(layer);
    PARAM_INT(style);

    if (ACTION_CALL_FROM_PSPRITE())
    {
        DPSprite *pspr = self->player->FindPSprite((layer != 0) ? layer : stateinfo->mPSPIndex);

        if (pspr == nullptr || style >= STYLE_Count || style < 0)
            return 0;

        pspr->Renderstyle = ERenderStyle(style);
    }
    return 0;
}
User avatar
phantombeta
Posts: 2084
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Overlay flip/mirroring flags do not work on non-Weapon

Post by phantombeta »

No, that's not what I said it was at all. You just can't use those functions from outside a PSprite. You can use them in Nash's example PK3 by moving the check to the overlay's states because overlays are PSprites.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Overlay flip/mirroring flags do not work on non-Weapon

Post by Major Cooke »

I know that. I was asking if that could be changed a little.
Post Reply

Return to “Bugs [GZDoom]”