summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/heretic/am_map.c35
-rw-r--r--src/hexen/am_map.c34
2 files changed, 45 insertions, 24 deletions
diff --git a/src/heretic/am_map.c b/src/heretic/am_map.c
index b753d96b..5454ba54 100644
--- a/src/heretic/am_map.c
+++ b/src/heretic/am_map.c
@@ -309,18 +309,23 @@ void AM_changeWindowLoc(void)
m_y = min_y - m_h / 2;
m_paninc.y = 0;
}
-/*
- mapxstart += MTOF(m_paninc.x+FRACUNIT/2);
- mapystart -= MTOF(m_paninc.y+FRACUNIT/2);
- if(mapxstart >= finit_width)
- mapxstart -= finit_width;
- if(mapxstart < 0)
- mapxstart += finit_width;
- if(mapystart >= finit_height)
- mapystart -= finit_height;
- if(mapystart < 0)
- mapystart += finit_height;
-*/
+
+ // The following code was commented out in the released Heretic source,
+ // but I believe we need to do this here to stop the background moving
+ // when we reach the map boundaries. (In the released source it's done
+ // in AM_clearFB).
+ mapxstart += MTOF(m_paninc.x+FRACUNIT/2);
+ mapystart -= MTOF(m_paninc.y+FRACUNIT/2);
+ if(mapxstart >= finit_width)
+ mapxstart -= finit_width;
+ if(mapxstart < 0)
+ mapxstart += finit_width;
+ if(mapystart >= finit_height)
+ mapystart -= finit_height;
+ if(mapystart < 0)
+ mapystart += finit_height;
+ // - end of code that was commented-out
+
m_x2 = m_x + m_w;
m_y2 = m_y + m_h;
}
@@ -783,8 +788,13 @@ void AM_clearFB(int color)
}
else
{
+ // The released Heretic source does this here, but this causes a bug
+ // where the map background keeps moving when we reach the map
+ // boundaries. This is instead done in AM_changeWindowLoc.
+ /*
mapxstart += (MTOF(m_paninc.x) >> 1);
mapystart -= (MTOF(m_paninc.y) >> 1);
+
if (mapxstart >= finit_width)
mapxstart -= finit_width;
if (mapxstart < 0)
@@ -793,6 +803,7 @@ void AM_clearFB(int color)
mapystart -= finit_height;
if (mapystart < 0)
mapystart += finit_height;
+ */
}
//blit the automap background to the screen.
diff --git a/src/hexen/am_map.c b/src/hexen/am_map.c
index 05d03d8f..465df9ba 100644
--- a/src/hexen/am_map.c
+++ b/src/hexen/am_map.c
@@ -255,18 +255,23 @@ void AM_changeWindowLoc(void)
m_y = min_y - m_h / 2;
m_paninc.y = 0;
}
-/*
- mapxstart += MTOF(m_paninc.x+FRACUNIT/2);
- mapystart -= MTOF(m_paninc.y+FRACUNIT/2);
- if(mapxstart >= finit_width)
- mapxstart -= finit_width;
- if(mapxstart < 0)
- mapxstart += finit_width;
- if(mapystart >= finit_height)
- mapystart -= finit_height;
- if(mapystart < 0)
- mapystart += finit_height;
-*/
+
+ // The following code was commented out in the released Hexen source,
+ // but I believe we need to do this here to stop the background moving
+ // when we reach the map boundaries. (In the released source it's done
+ // in AM_clearFB).
+ mapxstart += MTOF(m_paninc.x+FRACUNIT/2);
+ mapystart -= MTOF(m_paninc.y+FRACUNIT/2);
+ if(mapxstart >= finit_width)
+ mapxstart -= finit_width;
+ if(mapxstart < 0)
+ mapxstart += finit_width;
+ if(mapystart >= finit_height)
+ mapystart -= finit_height;
+ if(mapystart < 0)
+ mapystart += finit_height;
+ // - end of code that was commented-out
+
m_x2 = m_x + m_w;
m_y2 = m_y + m_h;
}
@@ -682,6 +687,10 @@ void AM_clearFB(int color)
}
else
{
+ // The released Hexen source does this here, but this causes a bug
+ // where the map background keeps moving when we reach the map
+ // boundaries. This is instead done in AM_changeWindowLoc.
+ /*
mapxstart += (MTOF(m_paninc.x) >> 1);
mapystart -= (MTOF(m_paninc.y) >> 1);
if (mapxstart >= finit_width)
@@ -692,6 +701,7 @@ void AM_clearFB(int color)
mapystart -= finit_height;
if (mapystart < 0)
mapystart += finit_height;
+ */
}
//blit the automap background to the screen.