[fixed] Problems replacing sprites with HIRESTEX

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
User avatar
Torr Samaho
Developer
Developer
Posts: 160
Joined: Fri Apr 13, 2007 8:26
Location: Germany
Contact:

[fixed] Problems replacing sprites with HIRESTEX

Post by Torr Samaho »

Hi all,

I want to replace the shotgun sprite with a high res version using the HIRESTEX lump. After some research in this forum, I came to the inclusion that it should be sufficient just to put the high res image in a wad (outside of any markers) and write a HIRESTEX lump like:

Code: Select all

remap SHOTA0 SHOTA0-H
This way I can properly replace menu graphics, but for some reason this doesn't work properly for me in GZDoom 1.0.24 for sprites. The image is scaled fine, but the offset it totally wrong. Check out the attached example wad, where the shotgun pickup sprite is replaced with a placeholder graphic.

This happens to me on two different system, one with a Nvidia and one with an ATI GPU, so I doubt it's system specific and omit the system details.

Am I doing something wrong, is this simply not supported or is this a GZDoom bug?
Attachments
hirestest.zip
example wad, showing the described problem
(466 Bytes) Downloaded 151 times
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Yes, there's most definitely something wrong here. Moving to Bugs. In the software renderer it's even worse.
User avatar
KeksDose
Stronghold Team
Posts: 319
Joined: Thu Apr 12, 2007 21:35
Location: Germany

Post by KeksDose »

You need to define your sprite like this:

Define SHOTA0-H 126 24

This defines the hires-sprite SHOTA0-H at the XScale 126 and YScale 24! Have fun =)

Code: Select all

remap M_DOOM SHOTA0-H
remap SHOTA0 SHOTA0-H
Define SHOTA0-H 126 24
It works perfectly for me!

[Edit] DAMN!!! A few seconds too late!
[Edit2] Wait the offset is wrong... argh, I'm just retarded, I have no plan.

[Edit3] Sorry for me being so irritating, but I found a work-around for this, you need to play with the original sprite offset to get this working.
Last edited by KeksDose on Sun May 27, 2007 16:10, edited 1 time in total.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

The offsets are calculated correctly. The problem is caused elsewhere.
User avatar
Torr Samaho
Developer
Developer
Posts: 160
Joined: Fri Apr 13, 2007 8:26
Location: Germany
Contact:

Post by Torr Samaho »

Graf Zahl wrote:Yes, there's most definitely something wrong here. Moving to Bugs. In the software renderer it's even worse.
Thanks for the quick answer! So I can stop puzzling, what I'm doing wrong here :).

Yeah, in software there seems to be no scaling at all, but here the offset looks ok.

@KeksDose: Thanks for the suggestion. I tried it, but the additional define doesn't seem to change the behavior at all.

EDIT:
KeksDose wrote: [Edit3] Sorry for me being so irritating, but I found a work-around for this, you need to play with the original sprite offset to get this working.
This seems to do the trick. Thanks! So you have to include the original sprite with offset in the wad between S_START and S_END.
Last edited by Torr Samaho on Sun May 27, 2007 16:24, edited 1 time in total.
User avatar
KeksDose
Stronghold Team
Posts: 319
Joined: Thu Apr 12, 2007 21:35
Location: Germany

Post by KeksDose »

Yes, I've just read something wrong... But I hope this would get fixed soon, it's a bit stupid to re-offset every original sprite in DooM to get HiresTex working.
This seems to do the trick.
Yes, HiresTex is only remapping the original sprites from DooM or low-res sprites with high-res ones, in their original low-res offsets, so only the picture we see will be replaced, but the offsets keep. But it's a really weird thing it always works out for me. Maybe it's a quirk with Pick-Ups? I never really replace Pick-Ups.

[Edit]

If you compare the original DooM sprite with the re-offset by me, you will notice that they aren't in the right place, so placing them in S_START and S_END markers won't really help. I played about five minutes with the offsets, to get this working, it's only a poor work-around, done by KeksDose. ;) I will play a bit more with non-Pick-Up sprites.

[Edit]

Hmm, now it isn't working for projectiles and monsters and such, it's really weird :sniped: HiresTex suddenly doesn't like us GZDooMers that much now...
User avatar
Torr Samaho
Developer
Developer
Posts: 160
Joined: Fri Apr 13, 2007 8:26
Location: Germany
Contact:

Post by Torr Samaho »

Oh, didn't notice that the shotgun sprite doesn't have the standard offset. Re-offsetting all the sprites is really not desirable...

And one additional thing: The workaround doesn't work for the software renderer.
User avatar
KeksDose
Stronghold Team
Posts: 319
Joined: Thu Apr 12, 2007 21:35
Location: Germany

Post by KeksDose »

Yes, I noticed that too. It's not really fun to re-offset every single sprite, we can only hope Graf will fix it. And this software thing is weird, too. We can only hope that Graf finds a way to fix this odd thing. Maybe it's caused because of Graf's recent update for scaling precision.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Fixed.

Replace FGLTexture::GetRect with

Code: Select all

//===========================================================================
//
// GetRect
//
//===========================================================================
void FGLTexture::GetRect(GL_RECT * r) const
{
	r->left=-(float)GetScaledLeftOffset();
	r->top=-(float)GetScaledTopOffset();
	r->width=(float)TextureWidth();
	r->height=(float)TextureHeight();
}

and update R_ProjectSprite from the ZDoom SVN repository to get this fixed for both software and hardware renderer.
User avatar
KeksDose
Stronghold Team
Posts: 319
Joined: Thu Apr 12, 2007 21:35
Location: Germany

Post by KeksDose »

Thank you very much Graf. I replace it right now. (Whoa, fast paced edit+reply post)
User avatar
Torr Samaho
Developer
Developer
Posts: 160
Joined: Fri Apr 13, 2007 8:26
Location: Germany
Contact:

Post by Torr Samaho »

The fix works nicely. Thanks alot for solving this so quickly, Graf!
Locked

Return to “Closed Bugs”