(svn r24179) -Codechange: move some variables of Town to TownCache

This commit is contained in:
rubidium
2012-04-25 20:50:13 +00:00
parent 21f63bd589
commit 76d5833650
13 changed files with 108 additions and 102 deletions

View File

@@ -879,17 +879,17 @@ class SmallMapWindow : public Window {
FOR_ALL_TOWNS(t) {
/* Remap the town coordinate */
Point pt = this->RemapTile(TileX(t->xy), TileY(t->xy));
int x = pt.x - this->subscroll - (t->sign.width_small >> 1);
int x = pt.x - this->subscroll - (t->cache.sign.width_small >> 1);
int y = pt.y;
/* Check if the town sign is within bounds */
if (x + t->sign.width_small > dpi->left &&
if (x + t->cache.sign.width_small > dpi->left &&
x < dpi->left + dpi->width &&
y + FONT_HEIGHT_SMALL > dpi->top &&
y < dpi->top + dpi->height) {
/* And draw it. */
SetDParam(0, t->index);
DrawString(x, x + t->sign.width_small, y, STR_SMALLMAP_TOWN);
DrawString(x, x + t->cache.sign.width_small, y, STR_SMALLMAP_TOWN);
}
}
}