The latest in the series of weird bugs from another dimension, comes: VANISHING COUNTRY NAMES. So recently I introduced detail on the globe. Regions, country borders, country names, etc. The weird thing is, the country names randomly vanish when the globe is rotated in certain positions.
Now you see them:
Now you don't:
Amazing!
It's probably something stupidly obvious but I'm so blinded that I can't see it. All the math should be right, so should the coordinates. After all the whole globe relies on the same formulas, and only the labels are vanishing, not the whole thing.
The code that renders the labels is in Globe.cpp, lines 462-482:
https:// Draw the country names
if (_zoom >= 2)
{
Sint16 x, y;
for (map<LangString, Country*>::iterator i = _save->getCountries()->begin(); i != _save->getCountries()->end(); i++)
{
https:// Don't draw if label is facing back
if (pointBack(i->second->getLabelLongitude(), i->second->getLabelLatitude()))
continue;
https:// Convert coordinates
polarToCart(i->second->getLabelLongitude(), i->second->getLabelLatitude(), &x, &y);
Text *label = new Text(_res->getFont("BIGLETS.DAT"), _res->getFont("SMALLSET.DAT"), 80, 9, x - 40, y);
label->setPalette(getPalette());
label->setAlign(ALIGN_CENTER);
label->setText(_res->getLanguage()->getString(i->first));
label->setColor(Palette::blockOffset(15)-1);
label->blit(_markers);
}
}
All the labels are centered around single polar points pulled from the country data. As far as I can tell, the problem only seems to happen on the 3 biggest zoom levels.