for (unsigned int i = 0; i < object_group_nodes.size(); i++)
object_groups.push_back(new SGMatModelGroup(object_group_nodes[i]));
- // handling of glyphs for taxi-/runway-signs
- xscale = props->getDoubleValue("xscale", 1.0);
+ // read glyph table for taxi-/runway-signs
vector<SGPropertyNode_ptr> glyph_nodes = props->getChildren("glyph");
for (unsigned int i = 0; i < glyph_nodes.size(); i++) {
const char *name = glyph_nodes[i]->getStringValue("name");
ysize = 0;
wrapu = true;
wrapv = true;
- xscale = 1;
mipmap = true;
light_coverage = 0.0;
return object_groups[index];
}
- /**
- * Get the horizontal scaling factor for runway/taxiway signs.
- */
- virtual inline double get_xscale() const { return xscale; }
-
/**
* Return pointer to glyph class, or 0 if it doesn't exist.
*/
vector<SGSharedPtr<SGMatModelGroup> > object_groups;
- // taxiway-/runway-sign elements
- double xscale;
+ // taxiway-/runway-sign texture elements
map<string, SGMaterialGlyph *> glyphs;
\f
// for temporary storage of sign elements
struct element_info {
- element_info(SGMaterial *m, SGMaterialGlyph *g) : material(m), glyph(g) {}
+ element_info(SGMaterial *m, SGMaterialGlyph *g) : material(m), glyph(g) {
+ scale = m->get_xsize() / (m->get_ysize() < 0.001 ? 1.0 : m->get_ysize());
+ }
SGMaterial *material;
SGMaterialGlyph *glyph;
+ double scale;
};
continue;
}
- elements.push_back(new element_info(material, glyph));
- total_width += glyph->get_width() * material->get_xscale();
+ element_info *e = new element_info(material, glyph);
+ elements.push_back(e);
+ total_width += glyph->get_width() * e->scale;
}
double hpos = -total_width / 2;
double xoffset = element->glyph->get_left();
double width = element->glyph->get_width();
- double abswidth = width * element->material->get_xscale();
+ double abswidth = width * element->scale;
// vertices
ssgVertexArray *vl = new ssgVertexArray(4);