#endif
#include <simgear/math/SGLimits.hxx>
-#include <simgear/props/condition.hxx>
#include "HUD.hxx"
if (node)
_condition = sgReadCondition(globals->get_props(), node);
- _x = n->getIntValue("x") + x;
- _y = n->getIntValue("y") + y;
- _w = n->getIntValue("width");
- _h = n->getIntValue("height");
+ _x = n->getFloatValue("x") + x;
+ _y = n->getFloatValue("y") + y;
+ _w = n->getFloatValue("width");
+ _h = n->getFloatValue("height");
vector<SGPropertyNode_ptr> opt = n->getChildren("option");
for (unsigned int i = 0; i < opt.size(); i++) {
}
-void HUD::Item::draw_text(float x, float y, char *msg, int align, int digit)
+void HUD::Item::draw_text(float x, float y, const char *msg, int align, int digit)
{
_hud->_text_list.add(x, y, msg, align, digit);
}
glEnd();
}
+void HUD::Item::draw_arc(float xoffs, float yoffs, float t0, float t1, float r) const
+{
+ glBegin(GL_LINE_STRIP);
+ float step = SG_PI / r;
+ t0 = t0 * SG_DEGREES_TO_RADIANS;
+ t1 = t1 * SG_DEGREES_TO_RADIANS;
+
+ for (float alpha = t0; alpha < t1; alpha += step) {
+ float x = r * cos(alpha);
+ float y = r * sin(alpha);
+ glVertex2f(x + xoffs, y + yoffs);
+ }
+ glEnd();
+}
void HUD::Item::draw_bullet(float x, float y, float size)
{