mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-12-03 17:12:06 +00:00
Fixed an issue where grid background images were drawn upside down and moved in the wrong direction on the Y axis when scrolling
This commit is contained in:
parent
dfc3089b9f
commit
a14fc7cafd
1 changed files with 14 additions and 14 deletions
|
@ -759,23 +759,23 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
backimageverts = CreateScreenVerts(windowsize);
|
||||
|
||||
// Determine map coordinates for view window
|
||||
Vector2D ltpos = DisplayToMap(new Vector2D(0f, 0f));
|
||||
Vector2D rbpos = DisplayToMap(new Vector2D(windowsize.Width, windowsize.Height));
|
||||
|
||||
Vector2D lbpos = DisplayToMap(new Vector2D(0f, windowsize.Height));
|
||||
Vector2D rtpos = DisplayToMap(new Vector2D(windowsize.Width, 0));
|
||||
|
||||
// Offset by given background offset
|
||||
ltpos -= backoffset;
|
||||
rbpos -= backoffset;
|
||||
|
||||
lbpos -= backoffset;
|
||||
rtpos -= backoffset;
|
||||
|
||||
// Calculate UV coordinates
|
||||
// NOTE: backimagesize.y is made negative to match Doom's coordinate system
|
||||
backimageverts[0].u = ltpos.x / backimagesize.x;
|
||||
backimageverts[0].v = ltpos.y / -backimagesize.y;
|
||||
backimageverts[1].u = rbpos.x / backimagesize.x;
|
||||
backimageverts[1].v = ltpos.y / -backimagesize.y;
|
||||
backimageverts[2].u = ltpos.x / backimagesize.x;
|
||||
backimageverts[2].v = rbpos.y / -backimagesize.y;
|
||||
backimageverts[3].u = rbpos.x / backimagesize.x;
|
||||
backimageverts[3].v = rbpos.y / -backimagesize.y;
|
||||
backimageverts[0].u = lbpos.x / backimagesize.x;
|
||||
backimageverts[0].v = lbpos.y / -backimagesize.y;
|
||||
backimageverts[1].u = rtpos.x / backimagesize.x;
|
||||
backimageverts[1].v = lbpos.y / -backimagesize.y;
|
||||
backimageverts[2].u = lbpos.x / backimagesize.x;
|
||||
backimageverts[2].v = rtpos.y / -backimagesize.y;
|
||||
backimageverts[3].u = rtpos.x / backimagesize.x;
|
||||
backimageverts[3].v = rtpos.y / -backimagesize.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue