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:
parent
074553a1e4
commit
3108e5f18c
|
|
@ -457,6 +457,9 @@ DBWDrawCrosshair(window, plane)
|
||||||
{
|
{
|
||||||
Point p;
|
Point p;
|
||||||
|
|
||||||
|
/* Crosshair is disabled by setting to MINFINITY */
|
||||||
|
if (crosshairPos.p_x == MINFINITY) return;
|
||||||
|
|
||||||
WindPointToScreen(window, &crosshairPos, &p);
|
WindPointToScreen(window, &crosshairPos, &p);
|
||||||
|
|
||||||
GrSetStuff(STYLE_YELLOW1);
|
GrSetStuff(STYLE_YELLOW1);
|
||||||
|
|
|
||||||
|
|
@ -146,13 +146,6 @@ int nb;
|
||||||
TCairoData *tcairodata = (TCairoData *)tcairoCurrent.mw->w_grdata2;
|
TCairoData *tcairodata = (TCairoData *)tcairoCurrent.mw->w_grdata2;
|
||||||
int i;
|
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);
|
cairo_save(tcairodata->context);
|
||||||
for (i = 0; i < nb; i++)
|
for (i = 0; i < nb; i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue