summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libgui.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-09 17:50:53 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-09 17:50:53 +0000
commit2da032e042b6fd699e14a73200770541af58530f (patch)
tree32585469ef87315bb99e0a1f35d3331547ff6b3b /crawl-ref/source/libgui.cc
parent0406c83edd618949fea3e801e9504c11179b192f (diff)
downloadcrawl-ref-2da032e042b6fd699e14a73200770541af58530f.tar.gz
crawl-ref-2da032e042b6fd699e14a73200770541af58530f.zip
Fixing tiles mini-map issues:
* Player markers no longer leave black trails. * Mini-map now displays the whole map and doesn't cut two cells off the edges. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3418 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libgui.cc')
-rw-r--r--crawl-ref/source/libgui.cc26
1 files changed, 12 insertions, 14 deletions
diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc
index d47f6a6b04..70bd5fac2b 100644
--- a/crawl-ref/source/libgui.cc
+++ b/crawl-ref/source/libgui.cc
@@ -431,8 +431,8 @@ void GmapUpdate(int x, int y, int what, bool upd_tile)
void GmapInit(bool upd_tile)
{
int x, y;
- gmap_min_x = gmap_max_x = you.x_pos -1;
- gmap_min_y = gmap_max_y = you.y_pos -1;
+ gmap_min_x = gmap_max_x = you.x_pos - 1;
+ gmap_min_y = gmap_max_y = you.y_pos - 1;
for (y = 0; y < GYM; y++)
{
@@ -447,26 +447,24 @@ void GmapDisplay(int linex, int liney)
{
static unsigned char buf2[GXM*GYM];
- int x,y;
- int count=0;
int ox, oy;
- for (x = 0; x < GXM*GYM; x++)
+ for (int x = 0; x < GXM*GYM; x++)
{
buf2[x] = 0;
}
- ox = ( gmap_min_x + (GXM -1 - gmap_max_x) ) / 2;
- oy = ( gmap_min_y + (GYM -1 - gmap_max_y) ) / 2;
- count = ox + oy * GXM;
+ ox = ( gmap_min_x + (GXM - 1 - gmap_max_x) ) / 2;
+ oy = ( gmap_min_y + (GYM - 1 - gmap_max_y) ) / 2;
+ int count = ox + oy * GXM;
gmap_ox = ox - gmap_min_x;
gmap_oy = oy - gmap_min_y;
- for (y = gmap_min_y; y <= gmap_max_y; y++)
+ for (int y = gmap_min_y; y <= gmap_max_y; y++)
{
- for (x = gmap_min_x; x <= gmap_max_x; x++, count++)
+ for (int x = gmap_min_x; x <= gmap_max_x; x++, count++)
{
- if ( (count>=0)&&(count<GXM*GYM) )
+ if ( (count>=0) && (count<GXM*GYM) )
buf2[count] = gmap_data[x][y];
}
count += GXM - (gmap_max_x - gmap_min_x + 1);
@@ -477,7 +475,7 @@ void GmapDisplay(int linex, int liney)
ox += linex - gmap_min_x;
oy += liney - gmap_min_y;
// highlight centre of the map
- buf2[ ox + oy * GXM] = Options.tile_player_col;
+ buf2[ox + oy * GXM] = Options.tile_player_col;
}
region_map->flag = true;
@@ -598,8 +596,8 @@ void libgui_init()
TextRegionClass::text_mode = region_crt;
region_map =
- new MapRegionClass(MAP_XMAX-map_margin*2,
- MAP_YMAX-map_margin*2,
+ new MapRegionClass(MAP_XMAX+map_margin,
+ MAP_YMAX+map_margin,
map_margin, map_margin,
false);
region_map->id = REGION_MAP;