Page 1 of 1

[r1440] Incorrect decals scaling and crash on player death

Posted: Fri Aug 10, 2012 15:32
by MaxED
1. When using a texture defined in TEXTURES as a decal like so:

Code: Select all

Texture DECAL1, 30, 30 {
    XScale 4
    YScale 4
    Offset 15, 15
    Patch DECAL1, 0, 0
}
it's displayed incorrectly. In ZDoom r3818, it's drawn unstretched, but also unscaled. Decal is drawn correctly if texture offsets are set in Slade (Slade stores them in image itself, I suppose) and scale is applied in DECALDEF.
Image

2. If you press a switch in the middle of the room, GZDoom will crash (switch calls a script that does 100 damage to a player). This doesn't happen in ZDoom r3818. Custom player class is used, so I suppose that's what causing it.

Code: Select all

ACTOR TestPlayer : PlayerPawn
{
	Speed 0.7
	Health 100
	Radius 16
	Height 56
	Mass 100
	PainChance 255
	Player.DisplayName "TestPlayer"
	Player.StartItem "TestPistol"
	Player.StartItem "Clip", 50
	Player.viewheight 45
	Player.attackzoffset 20
}

Re: [r1440] Incorrect decals scaling and crash on player dea

Posted: Fri Aug 10, 2012 16:24
by Blue Shadow
For the crash issue, you're inheriting from the PlayerPawn class which doesn't itself define any states. Inheriting from the DoomPlayer class will solve this.

Edit: Not that I'm implying it shouldn't be looked at or investigated. A crash is a crash.

Re: [r1440] Incorrect decals scaling and crash on player dea

Posted: Sat Aug 11, 2012 1:01
by Gez
The problem is that somehow the player actor becomes nulled at some point, and the OpenGL renderer needs to access the player actor more than the software renderer does.

If in FGLRenderer::RenderView(), you comment out the call to SetFixedColormap (player); (line 945 of gl_scene.cpp), instead of a crash, you get the game aborting by sending you to the console with the error message "Tried to render from a NULL actor." (which is outputted by R_SetupFrame() in r_utility.cpp).

However, if instead of commenting it out entirely, you merely make it conditional: "if (player) SetFixedColormap(player);" then you will still get the crash. So the player gets nulled down the path from SetFixedColormap(), but it is not nulled yet in RenderView().

Re: [r1440] Incorrect decals scaling and crash on player dea

Posted: Sat Aug 11, 2012 21:20
by Graf Zahl
No need to bother with this. The player actor is missing fundamental stuff and will cause all sorts of problems.

Re: [r1440] Incorrect decals scaling and crash on player dea

Posted: Sat Aug 11, 2012 21:53
by Gez
MXD, for the decal thing, start with a bug report over on the ZDoom forum, since it ignores texture scaling over there.

The GZDoom issue can be investigated once the core decal logic is addressed.

Also in the future try to avoid putting two separate and unrelated bugs in the same thread. :wink: