Page 1 of 1

[All] TEXTURES weapon sprites problem

Posted: Sun Aug 09, 2009 18:42
by phi108
This method works perfectly in the software renderer, but the GL renderer doesn't cut off the unwanted areas of the sprite correctly.

Here is the TEXTURES code:

Code: Select all

sprite WNDRy0, 374, 240   ////original sprite TEXTURES definition
{
  offset 0, 39
  YScale 1.198
  Patch WNDRy0, 0, 0
}

Sprite "SGPDaa", 150, 240
{
   Patch "WNDRy0", -224, 0   /////the left hand is chopped off in this sprite
}

Sprite "SGPDab", 224, 240
{
   Patch "WNDRy0", 0, 0      /////the shotgun is chopped off in this sprite
}

Sprite "SGPDa0", 374, 240    /////they display side-by-side (224+150=374 wide)
{
   Offset 0, 39
   YScale 1.198
   Patch "SGPDaa", 224, 0    /////the shotgun of the "WNDRy0" sprite
   Patch "SGPDab", 0, 20     /////the left hand of the "WNDRy0" sprite
}

Sprite "SGPDb0", 374, 240
{
   Offset 0, 39
   YScale 1.198
   Patch "SGPDaa", 224, 0    /////only the shotgun is displayed
}

Sprite "SGPDc0", 427, 240
{
   Offset 53, 39
   YScale 1.198
   Patch "SGPDaa", 277, 0  /////holding the shotgun in the right hand for the whole pistol animation
   Patch "P22Da0", 0, 38   /////First frame of the pistol draw
	{
	flipx
	}
}
And here is the DECORATE:

Code: Select all

	Altfire:
		WNDR "[" 1    /////
		WNDR z 1      ///// two unmodified sprites of the shotgun draw 
		SGPD a 1      ///// The left hand is lowered in this sprite
		SGPD b 4      /////the left hand isn't visible here
		SGPD cdefghijklmnopqrst 1    ////The left handed pistol drawing animation
When the altfire button is pressed, a couple unmodified frames of the shotgun holstering animation are played.

Then the shotgun stops moving, as if the player is holding it pointed up with the right hand.

The left hand goes down out of sight, then pulls out the pistol (using the pistol sprites with the "flipx" option.

In the GL renderer, during the whole pistol animation, the left hand that should have gone out of sight is displayed in the middle of the screen. This hand isn't displayed in the software renderer.

I think the GL renderer treats the texture offsets correctly and displays it in the correct place, but it displays the areas of the sprite that are beyond the defined borders of the texture.

Below is a screenshot: Software on left, GL on right

Re: [All] TEXTURES weapon sprites problem

Posted: Sun Aug 09, 2009 21:52
by Graf Zahl
Can you please post the WAD? This I can't debug.

Re: [All] TEXTURES weapon sprites problem

Posted: Sun Aug 09, 2009 22:31
by phi108
Here is the file:

http://www.sendspace.com/file/v9hx5k 5.88 MB

Use the GL renderer and use altfire on the shotgun. The problem is in all of the pistol and punching animations for the shotgun's alternate fire. Punching animation plays when the clip ammo is depleted, and it shows the same problem.

Re: [All] TEXTURES weapon sprites problem

Posted: Sun Aug 09, 2009 22:57
by Graf Zahl
Argh. This isn't going to be easy. The code was never designed to handle such a weird setup of textures.

The software renderer just works by dumb luck, not by design...

Re: [All] TEXTURES weapon sprites problem

Posted: Sun Aug 09, 2009 23:24
by phi108
The simple solution on my part would be to manually make a new sprite that doesn't include that left hand, but I posted this bug in case this problem shows up again for TEXTURES lump makers.

Re: [All] TEXTURES weapon sprites problem

Posted: Sun Aug 09, 2009 23:37
by Graf Zahl
Don't worry, it's fixable - but it's a rather extensive change because I need to alter quite a bit of code - one function for each supported texture format...

Re: [All] TEXTURES weapon sprites problem

Posted: Fri Oct 02, 2009 22:54
by Graf Zahl
I believe this is fixed now that the texture composition code uses a clipping rectangle. I can't confirm though because the file is no longer there.