[r1440] Incorrect decals scaling and crash on player death

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
User avatar
MaxED
Developer
Developer
Posts: 47
Joined: Fri Aug 03, 2012 0:06

[r1440] Incorrect decals scaling and crash on player death

Post 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
}
Attachments
2bugs.rar
(2.63 KiB) Downloaded 62 times
Blue Shadow
Global Moderator
Global Moderator
Posts: 308
Joined: Sun Aug 29, 2010 6:09

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

Post 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.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

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

Post 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().
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

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

Post by Graf Zahl »

No need to bother with this. The player actor is missing fundamental stuff and will cause all sorts of problems.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

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

Post 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:
Locked

Return to “Closed Bugs”