* Update the virtual coords needed to draw the station sign. */
| 430 | * Update the virtual coords needed to draw the station sign. |
| 431 | */ |
| 432 | void Station::UpdateVirtCoord() |
| 433 | { |
| 434 | Point pt = RemapCoords2(TileX(this->xy) * TILE_SIZE, TileY(this->xy) * TILE_SIZE); |
| 435 | |
| 436 | pt.y -= 32 * ZOOM_BASE; |
| 437 | if (this->facilities.Test(StationFacility::Airport) && this->airport.type == AT_OILRIG) pt.y -= 16 * ZOOM_BASE; |
| 438 | |
| 439 | if (this->sign.kdtree_valid) _viewport_sign_kdtree.Remove(ViewportSignKdtreeItem::MakeStation(this->index)); |
| 440 | |
| 441 | this->sign.UpdatePosition(pt.x, pt.y, GetString(STR_VIEWPORT_STATION, this->index, this->facilities), GetString(STR_STATION_NAME, this->index, this->facilities)); |
| 442 | |
| 443 | _viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeStation(this->index)); |
| 444 | |
| 445 | SetWindowDirty(WC_STATION_VIEW, this->index); |
| 446 | } |
| 447 | |
| 448 | /** |
| 449 | * Move the station main coordinate somewhere else. |
no test coverage detected