+void ScopeGUI::draw_scope()
+{
+ int graticule = use_vector < 0 ? grat_idx : 0;
+ if( grat_image && use_graticule != graticule ) {
+ delete grat_image; grat_image = 0;
+ }
+ if( !grat_image && graticule > 0 )
+ grat_image = VFramePng::vframe_png(grat_paths[graticule]);
+ if( grat_image ) {
+ if( !overlay )
+ overlay = new OverlayFrame(1);
+ int cx = vector_cx, cy = vector_cy, r = radius;
+ int iw = grat_image->get_w(), ih = grat_image->get_h();
+ overlay->overlay(vector_vframe, grat_image,
+ 0,0, iw, ih, cx-r,cy-r, cx+r, cy+r,
+ 1, TRANSFER_NORMAL, CUBIC_CUBIC);
+ }
+ use_graticule = graticule;
+ vectorscope->draw_vframe(vector_vframe);
+ if( use_vector > 0 ) {
+ int margin = theme->widget_border;
+ set_line_dashes(1);
+ for( int i=1; i<=VECTORSCOPE_DIVISIONS; i+=2 ) {
+ int y = vector_cy - radius * i / VECTORSCOPE_DIVISIONS;
+ int text_y = y + vector_y + get_text_ascent(SMALLFONT) / 2;
+ set_color(text_color);
+ char string[BCTEXTLEN];
+ sprintf(string, "%d",
+ (int)((FLOAT_MAX / VECTORSCOPE_DIVISIONS * i) * 100));
+ int text_x = vector_x - get_text_width(SMALLFONT, string) - margin;
+ draw_text(text_x, text_y, string);
+ int x = vector_cx - radius * i / VECTORSCOPE_DIVISIONS;
+ int w = radius * i / VECTORSCOPE_DIVISIONS * 2;
+ int h = radius * i / VECTORSCOPE_DIVISIONS * 2;
+ if( i+2 > VECTORSCOPE_DIVISIONS )
+ set_line_dashes(0);
+ set_color(dark_color);
+ vectorscope->draw_circle(x, y, w, h);
+ }
+ float th = TO_RAD(90 + 32.875);
+ vectorscope->draw_radient(th, 0.1f, .75f, dark_color);
+ }
+}