Page 1 of 1

r1425 (+older) camera textures placed on floors are flipped

Posted: Sun Jul 22, 2012 1:02
by Enjay
Reference this thread at ZDoom:

http://forum.zdoom.org/viewtopic.php?f=19&t=22336

The mod can be obtained there. Or direct idgames link:
http://www.doomworld.com/idgames/?id=16830


My post:

[spoiler]
Enjay wrote:Now here's an odd thing that I can't see already mentioned: if I play a score game in ZDoom the score card is correct, if I play in GZDoom it is mirrored.

ZDoom
Image

GZDoom
Image

:?:
[/spoiler]

Isle's reply:
Isle wrote:
Enjay wrote:Now here's an odd thing that I can't see already mentioned: if I play a score game in ZDoom the score card is correct, if I play in GZDoom it is mirrored.
after some quick tests it appears to be gzdoom's fault. it's flipping camera textures placed on the floor.

Re: r1425 (+older) camera textures placed on floors are flip

Posted: Mon Jul 23, 2012 15:47
by Graf Zahl
Damnit!

Camera textures are generated upside down but the wall code contains some compensation for that. The flat code doesn't.

Re: r1425 (+older) camera textures placed on floors are flip

Posted: Mon Jul 30, 2012 0:18
by Gez
And is it any hard to fix? On a whim, I added this to gl_SetPlaneTextureRotation() for a test, and the result is that it actually worked for the normal render.

Code: Select all

		float xscale1=FIXED2FLOAT(secplane->xscale);
		float yscale1=FIXED2FLOAT(secplane->yscale);
+		if (gltexture->tex->bHasCanvas)
+		{
+			yscale1 = 0 - yscale1;
+		}
I'm not committing that change though, at least not without further input. Also, it doesn't affect the textured automap, which is still mirrored even with that change.

Re: r1425 (+older) camera textures placed on floors are flip

Posted: Sun Aug 05, 2012 19:42
by Lars
Is there a possibility that the fix breaks anything else? If not, go ahead and commit it. It is surely an enhancement over the current behaviour. (Rats Solitaire is a nice little gem, by the way... :) )

That said, perhaps there is another part in the code where the fix could be applied, so that the automap texture is corrected as well?

Re: r1425 (+older) camera textures placed on floors are flip

Posted: Mon Aug 06, 2012 21:19
by Edward-san
is that the only place where that part of code should be applied? sounds like a hack for me. just my 0.02€

Re: r1425 (+older) camera textures placed on floors are flip

Posted: Mon Aug 06, 2012 22:15
by Gez
You've got a weird definition of hack. It makes sense that when you draw one type of thing, there is only one place in the code where it is drawn, so any adjustment you may have to do to it can be on only one place upstream in the pipeline.

Though in this case, such code would also need to be applied wherever it is that the OpenGL automap is rendered.

Re: r1425 (+older) camera textures placed on floors are flip

Posted: Wed Aug 08, 2012 21:27
by Graf Zahl
The change is perfectly fine. For the automap it needs to be added to FGLRenderer::FillSimplePoly which rotates the coordinates on the fly.

Re: r1425 (+older) camera textures placed on floors are flip

Posted: Wed Aug 08, 2012 23:45
by Gez
Okay, then it's fixed.