Found that the crosshair function was wasting compute cycles by

drawing out-of-bounds when the crosshair was turned off rather
than just not drawing it.
This commit is contained in:
Tim Edwards 2017-09-15 22:20:00 -04:00
parent 074553a1e4
commit 3108e5f18c
2 changed files with 3 additions and 7 deletions

View File

@ -457,6 +457,9 @@ DBWDrawCrosshair(window, plane)
{
Point p;
/* Crosshair is disabled by setting to MINFINITY */
if (crosshairPos.p_x == MINFINITY) return;
WindPointToScreen(window, &crosshairPos, &p);
GrSetStuff(STYLE_YELLOW1);

View File

@ -146,13 +146,6 @@ int nb;
TCairoData *tcairodata = (TCairoData *)tcairoCurrent.mw->w_grdata2;
int i;
// Diagnostic
Display *disp = cairo_xlib_surface_get_display(tcairodata->surface);
Screen *screen = cairo_xlib_surface_get_screen(tcairodata->surface);
Drawable draw = cairo_xlib_surface_get_drawable(tcairodata->surface);
int w = cairo_xlib_surface_get_width(tcairodata->surface);
int h = cairo_xlib_surface_get_height(tcairodata->surface);
cairo_save(tcairodata->context);
for (i = 0; i < nb; i++)
{