summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/guic-win.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-win.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-win.cc')
-rw-r--r--crawl-ref/source/guic-win.cc31
1 files changed, 15 insertions, 16 deletions
diff --git a/crawl-ref/source/guic-win.cc b/crawl-ref/source/guic-win.cc
index 432f14d8c8..ba7208128b 100644
--- a/crawl-ref/source/guic-win.cc
+++ b/crawl-ref/source/guic-win.cc
@@ -574,11 +574,9 @@ void MapRegionClass::redraw(int x1, int y1, int x2, int y2)
ReleaseDC(win->hWnd, hdc);
}
-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;
@@ -603,10 +601,10 @@ void MapRegionClass::draw_data(unsigned char *buf)
// erase old markers
for (int j = 0; j < dy * marker_length; j++)
- *(pDibBit0 + BUF_IDX(px, 0, dx/2 + x_margin, j)) = MAP_BLACK;
+ *(pDibBit0 + BUF_IDX(old_mark_x, 0, dx/2 + x_margin, j)) = MAP_BLACK;
for (int j = 0; j < dx * marker_length; j++)
- *(pDibBit0 + BUF_IDX(0, py, j, dy/2 + y_margin)) = MAP_BLACK;
+ *(pDibBit0 + BUF_IDX(0, old_mark_y, j, dy/2 + y_margin)) = MAP_BLACK;
force_redraw = true;
@@ -618,11 +616,6 @@ void MapRegionClass::draw_data(unsigned char *buf)
{
int col = (j >= my2 - y_margin || i >= mx2 - x_margin) ?
MAP_BLACK : ptr[i];
- if (col == Options.tile_player_col)
- {
- px = i;
- py = j;
- }
if ( col != get_col(i,j) || force_redraw
|| i < marker_length || j < marker_length)
{
@@ -643,12 +636,18 @@ void MapRegionClass::draw_data(unsigned char *buf)
ppix += inc_y;
}
- // draw new markers
- for (int j = 0; j < dy * marker_length; j++)
- *(pDibBit0 + BUF_IDX(px, 0, dx/2 + x_margin, j)) = MAP_WHITE;
+ old_mark_x = mark_x;
+ old_mark_y = mark_y;
- for (int j = 0; j < dx * marker_length; j++)
- *(pDibBit0 + BUF_IDX(0, py, j, dy/2 + y_margin)) = MAP_WHITE;
+ if (show_mark)
+ {
+ // draw new markers
+ for (int j = 0; j < dy * marker_length; j++)
+ *(pDibBit0 + BUF_IDX(mark_x, 0, dx/2 + x_margin, j)) = MAP_WHITE;
+
+ for (int j = 0; j < dx * marker_length; j++)
+ *(pDibBit0 + BUF_IDX(0, mark_y, j, dy/2 + y_margin)) = MAP_WHITE;
+ }
redraw();
force_redraw = false;