summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/guic-x11.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-20 14:20:40 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-20 14:20:40 +0000
commit2450cbe42b1f36bd2b85abfc08ae25f6663b6a16 (patch)
tree9a2de352f79fe388903b08845c69a8db24eaa84c /crawl-ref/source/guic-x11.cc
parent19d229916a442397c1726d04298329283f2f39f2 (diff)
downloadcrawl-ref-2450cbe42b1f36bd2b85abfc08ae25f6663b6a16.tar.gz
crawl-ref-2450cbe42b1f36bd2b85abfc08ae25f6663b6a16.zip
Fixing minimap issue where the markers could get confused if there were multiple squares with the player colour. Markers no longer depend on the contents of the map.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4409 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/guic-x11.cc')
-rw-r--r--crawl-ref/source/guic-x11.cc41
1 files changed, 26 insertions, 15 deletions
diff --git a/crawl-ref/source/guic-x11.cc b/crawl-ref/source/guic-x11.cc
index 402b8680d8..18052dab2a 100644
--- a/crawl-ref/source/guic-x11.cc
+++ b/crawl-ref/source/guic-x11.cc
@@ -318,19 +318,23 @@ void MapRegionClass::redraw(int x1, int y1, int x2, int y2)
(x2-x1+1)*dx, (y2-y1+1)*dy);
}
-void MapRegionClass::draw_data(unsigned char *buf)
+void MapRegionClass::draw_data(unsigned char *buf, bool show_mark,
+ int mark_x, int mark_y)
{
- static int px = 0;
- static int py = 0;
-
if (!flag)
return;
for (int yy = 0; yy < dy * marker_length; yy++)
- XPutPixel(backbuf, px*dx+dx/2 + x_margin, yy, map_pix[MAP_BLACK]);
+ {
+ XPutPixel(backbuf, old_mark_x*dx+dx/2 + x_margin, yy,
+ map_pix[MAP_BLACK]);
+ }
for (int xx = 0; xx < dx * marker_length; xx++)
- XPutPixel(backbuf, xx, py*dy+dy/2 + y_margin, map_pix[MAP_BLACK]);
+ {
+ XPutPixel(backbuf, xx, old_mark_y*dy+dy/2 + y_margin,
+ map_pix[MAP_BLACK]);
+ }
for (int y = 0; y < my - y_margin; y++)
{
@@ -338,11 +342,6 @@ void MapRegionClass::draw_data(unsigned char *buf)
for (int x = 0; x < mx - x_margin; x++)
{
int col = ptr[x];
- if (col == Options.tile_player_col)
- {
- px = x;
- py = y;
- }
if (col != get_col(x, y) || force_redraw
|| x < marker_length || y < marker_length)
{
@@ -358,11 +357,23 @@ void MapRegionClass::draw_data(unsigned char *buf)
}
}
- for (int yy = 0; yy < dy * marker_length; yy++)
- XPutPixel(backbuf, px*dx+dx/2 + x_margin, yy, map_pix[MAP_WHITE]);
+ old_mark_x = mark_x;
+ old_mark_y = mark_y;
- for (int xx = 0; xx < dx * marker_length; xx++)
- XPutPixel(backbuf, xx, py*dy+dy/2 + y_margin, map_pix[MAP_WHITE]);
+ if (show_mark)
+ {
+ for (int yy = 0; yy < dy * marker_length; yy++)
+ {
+ XPutPixel(backbuf, old_mark_x*dx+dx/2 + x_margin, yy,
+ map_pix[MAP_WHITE]);
+ }
+
+ for (int xx = 0; xx < dx * marker_length; xx++)
+ {
+ XPutPixel(backbuf, xx, old_mark_y*dy+dy/2 + y_margin,
+ map_pix[MAP_WHITE]);
+ }
+ }
redraw();
XFlush(display);